2022-05-23 00:16:32 +04:00

19 lines
2.0 MiB
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("@jupyter-widgets/base"));else if("function"==typeof define&&define.amd)define(["@jupyter-widgets/base"],e);else{var r="object"==typeof exports?e(require("@jupyter-widgets/base")):e(t["@jupyter-widgets/base"]);for(var n in r)("object"==typeof exports?exports:t)[n]=r[n]}}(window,(function(t){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=247)}([function(t,e){t.exports=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}},function(t,e){function r(e){return t.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},r(e)}t.exports=r},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e){function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}},function(t,e,r){"use strict";function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}r.d(e,"a",(function(){return n}))},function(t,e,r){var n=r(248);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&n(t,e)}},function(t,e,r){var n=r(24),i=r(189);t.exports=function(t,e){return!e||"object"!==n(e)&&"function"!=typeof e?i(t):e}},function(t,e,r){"use strict";const n=new(r(276).a)({id:"luma.gl"});var i=r(31),o=(r(202),r(84)),a=r(70),s=r(26),u=r(36);function c(t){const{luma:e}=t;if(t.canvas&&e){const{clientWidth:r}=e.canvasSizeInfo;return r?t.drawingBufferWidth/r:1}return 1}function l(t,e,r=!0){return function(t,e,r,n,i){const o=h(t[0],e,r);let a=f(t[1],e,n,i),s=h(t[0]+1,e,r);const u=s===r-1?s:s-1;let c;s=f(t[1]+1,e,n,i),i?(s=0===s?s:s+1,c=a,a=s):c=s===n-1?s:s-1;return{x:o,y:a,width:Math.max(u-o+1,1),height:Math.max(c-a+1,1)}}(e,c(t),t.drawingBufferWidth,t.drawingBufferHeight,r)}function h(t,e,r){return Math.min(Math.round(t*e),r-1)}function f(t,e,r,n){return n?Math.max(0,r-1-Math.round(t*e)):Math.min(Math.round(t*e),r-1)}const p=Object(s.isBrowser)(),d=p&&"undefined"!=typeof document,A={webgl2:!0,webgl1:!0,throwOnError:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function g(t={}){Object(u.a)(p,"createGLContext only available in the browser.\nCreate your own headless context or use 'createHeadlessContext' from @luma.gl/test-utils"),t=Object.assign({},A,t);const{width:e,height:r}=t;function o(e){if(t.throwOnError)throw new Error(e);return console.error(e),null}let a;t.onError=o;const{canvas:s}=t;return a=function(t,e){const{onError:r}=e;let n=null;const i=t=>n=t.statusMessage||n;t.addEventListener("webglcontextcreationerror",i,!1);const{webgl1:o=!0,webgl2:a=!0}=e;let s=null;a&&(s=s||t.getContext("webgl2",e),s=s||t.getContext("experimental-webgl2",e));o&&(s=s||t.getContext("webgl",e),s=s||t.getContext("experimental-webgl",e));if(t.removeEventListener("webglcontextcreationerror",i,!1),!s)return r(`Failed to create ${a&&!o?"WebGL2":"WebGL"} context: ${n||"Unknown error"}`);e.onContextLost&&t.addEventListener("webglcontextlost",e.onContextLost,!1);e.onContextRestored&&t.addEventListener("webglcontextrestored",e.onContextRestored,!1);return s}(function({canvas:t,width:e=800,height:r=600,onError:n}){let i;if("string"==typeof t){d&&"complete"===document.readyState||n(`createGLContext called on canvas '${t}' before page was loaded`),i=document.getElementById(t)}else t?i=t:(i=document.createElement("canvas"),i.id="lumagl-canvas",i.style.width=Number.isFinite(e)?`${e}px`:"100%",i.style.height=Number.isFinite(r)?`${r}px`:"100%",document.body.insertBefore(i,document.body.firstChild));return i}({canvas:s,width:e,height:r,onError:o}),t),a?(a=m(a,t),function(t){const e=Object(i.e)(t)?"WebGL2":"WebGL1",r=function(t){const e=t.getParameter(7936),r=t.getParameter(7937),n=t.getExtension("WEBGL_debug_renderer_info"),i=n&&t.getParameter(n.UNMASKED_VENDOR_WEBGL||7936),o=n&&t.getParameter(n.UNMASKED_RENDERER_WEBGL||7937);return{vendor:i||e,renderer:o||r,vendorMasked:e,rendererMasked:r,version:t.getParameter(7938),shadingLanguageVersion:t.getParameter(35724)}}(t),o=r?`(${r.vendor},${r.renderer})`:"",a=t.debug?" debug":"";n.info(1,`${e}${a} context ${o}`)()}(a),a):null}function m(t,e={}){if(!t||t._instrumented)return t;t._version=t._version||function(t){if("undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext)return 2;return 1}(t),t.luma=t.luma||{},t.luma.canvasSizeInfo=t.luma.canvasSizeInfo||{},e=Object.assign({},A,e);const{manageState:r,debug:i}=e;return r&&Object(a.c)(t,{copyState:!1,log:(...t)=>n.log(1,...t)()}),p&&i&&(s.global.makeDebugContext?(t=s.global.makeDebugContext(t,e),n.level=Math.max(n.level,1)):n.warn('WebGL debug mode not activated. import "@luma.gl/debug" to enable.')()),t._instrumented=!0,t}function y(t,e={}){if(t.canvas){return void function(t,e,r){let i="width"in r?r.width:t.canvas.clientWidth,o="height"in r?r.height:t.canvas.clientHeight;i&&o||(n.log(1,"Canvas clientWidth/clientHeight is 0")(),e=1,i=t.canvas.width||1,o=t.canvas.height||1);t.luma=t.luma||{},t.luma.canvasSizeInfo=t.luma.canvasSizeInfo||{};const a=t.luma.canvasSizeInfo;if(a.clientWidth!==i||a.clientHeight!==o||a.devicePixelRatio!==e){let r=e;const a=Math.floor(i*r),s=Math.floor(o*r);t.canvas.width=a,t.canvas.height=s,t.drawingBufferWidth===a&&t.drawingBufferHeight===s||(n.warn("Device pixel ratio clamped")(),r=Math.min(t.drawingBufferWidth/i,t.drawingBufferHeight/o),t.canvas.width=Math.floor(i*r),t.canvas.height=Math.floor(o*r)),Object.assign(t.luma.canvasSizeInfo,{clientWidth:i,clientHeight:o,devicePixelRatio:e})}}(t,function(t){const e="undefined"==typeof window?1:window.devicePixelRatio||1;return Number.isFinite(t)?t<=0?1:t:t?e:1}(e.useDevicePixels),e)}const r=t.getExtension("STACKGL_resize_drawingbuffer");r&&"width"in e&&"height"in e&&r.resize(e.width,e.height)}r.d(e,"k",(function(){return n})),r.d(e,"i",(function(){return i.d})),r.d(e,"j",(function(){return i.e})),r.d(e,"g",(function(){return i.c})),r.d(e,"b",(function(){return i.b})),r.d(e,"a",(function(){return i.a})),r.d(e,"f",(function(){return o.a})),r.d(e,"n",(function(){return o.c})),r.d(e,"l",(function(){return o.b})),r.d(e,"o",(function(){return o.d})),r.d(e,"c",(function(){return g})),r.d(e,"m",(function(){return y})),r.d(e,"h",(function(){return m})),r.d(e,"e",(function(){return c})),r.d(e,"d",(function(){return l}))},function(t,e,r){var n=r(249);function i(e,r,o){return"undefined"!=typeof Reflect&&Reflect.get?t.exports=i=Reflect.get:t.exports=i=function(t,e,r){var i=n(t,e);if(i){var o=Object.getOwnPropertyDescriptor(i,e);return o.get?o.get.call(r):o.value}},i(e,r,o||e)}t.exports=i},function(t,e,r){"use strict";function n(t,e){if(!t)throw new Error(e||"luma.gl: assertion failed.")}r.d(e,"a",(function(){return n}))},function(t,e,r){var n=r(258),i=r(259),o=r(260);t.exports=function(t,e){return n(t)||i(t,e)||o()}},function(t,e,r){"use strict";var n=r(25);r.d(e,"a",(function(){return n.a})),r.d(e,"b",(function(){return n.b})),r.d(e,"c",(function(){return n.c})),r.d(e,"d",(function(){return n.d})),r.d(e,"e",(function(){return n.e})),r.d(e,"f",(function(){return n.f}))},function(t,e,r){"use strict";r.d(e,"b",(function(){return n})),r.d(e,"a",(function(){return i})),r.d(e,"c",(function(){return o}));var n=1e-6,i="undefined"!=typeof Float32Array?Float32Array:Array,o=Math.random;Math.PI;Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)})},function(t,e,r){"use strict";r.d(e,"b",(function(){return o})),r.d(e,"e",(function(){return a})),r.d(e,"f",(function(){return s})),r.d(e,"j",(function(){return c})),r.d(e,"i",(function(){return l})),r.d(e,"h",(function(){return h})),r.d(e,"c",(function(){return f})),r.d(e,"a",(function(){return p})),r.d(e,"g",(function(){return d})),r.d(e,"d",(function(){return A}));r(42);const n=1/Math.PI*180,i=1/180*Math.PI,o={};function a(t,{precision:e=o.precision||4}={}){return t=function(t){return Math.round(t/o.EPSILON)*o.EPSILON}(t),`${parseFloat(t.toPrecision(e))}`}function s(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function u(t,e,r){if(s(t)){r=r||((n=t).clone?n.clone():new Array(n.length));for(let n=0;n<r.length&&n<t.length;++n)r[n]=e(t[n],n,r);return r}var n;return e(t)}function c(t){return h(t)}function l(t){return f(t)}function h(t,e){return u(t,t=>t*i,e)}function f(t,e){return u(t,t=>t*n,e)}function p(t,e,r){return u(t,t=>Math.max(e,Math.min(r,t)))}function d(t,e,r){return s(t)?t.map((t,n)=>d(t,e[n],r)):r*e+(1-r)*t}function A(t,e,r){const n=o.EPSILON;r&&(o.EPSILON=r);try{if(t===e)return!0;if(s(t)&&s(e)){if(t.length!==e.length)return!1;for(let r=0;r<t.length;++r)if(!A(t[r],e[r]))return!1;return!0}return t&&t.equals?t.equals(e):e&&e.equals?e.equals(t):!(!Number.isFinite(t)||!Number.isFinite(e))&&Math.abs(t-e)<=o.EPSILON*Math.max(1,Math.abs(t),Math.abs(e))}finally{o.EPSILON=n}}o.EPSILON=1e-12,o.debug=!1,o.precision=4,o.printTypes=!1,o.printDegrees=!1,o.printRowMajor=!0},function(t,e,r){"use strict";r.d(e,"a",(function(){return i})),r.d(e,"c",(function(){return o})),r.d(e,"d",(function(){return a})),r.d(e,"b",(function(){return s}));var n=r(18),i={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(i,"IDENTITY",{get:function(){return n.a.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")()||0}});var o={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},a={common:0,meters:1,pixels:2},s={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}}},function(t,e,r){"use strict";r.r(e);var n=r(14),i=r(130),o=r(148),a=r(93),s=r(0),u=r.n(s),c=r(2),l=r.n(c),h=r(3),f=r.n(h),p=r(134);function d(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function A(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?d(Object(r),!0).forEach((function(e){u()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var g=[255,255,255],m=[0,0,1],y=[0,0,1],v=0,_=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};l()(this,t);var r=e.color,n=void 0===r?g:r,i=e.intensity,o=void 0===i?1:i,a=e.position,s=void 0===a?y:a;this.id=e.id||"point-".concat(v++),this.color=n,this.intensity=o,this.type="point",this.position=s,this.attenuation=b(e),this.projectedLight=A({},this)}return f()(t,[{key:"getProjectedLight",value:function(t){var e=t.layer,r=this.projectedLight,i=e.context.viewport,o=e.props,a=o.coordinateSystem,s=o.coordinateOrigin,u=Object(p.b)(this.position,{viewport:i,coordinateSystem:a,coordinateOrigin:s,fromCoordinateSystem:i.isGeospatial?n.a.LNGLAT:n.a.CARTESIAN,fromCoordinateOrigin:[0,0,0]});return r.color=this.color,r.intensity=this.intensity,r.position=u,r}}]),t}();function b(t){return"attenuation"in t?t.attenuation:"intensity"in t?[0,0,t.intensity]:m}var x=r(5),w=r.n(x),E=r(6),S=r.n(E),O=r(1),T=r.n(O),P=r(113);function M(t){var e=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(t){return!1}}();return function(){var r,n=T()(t);if(e){var i=T()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return S()(this,r)}}var C=function(t){w()(r,t);var e=M(r);function r(){return l()(this,r),e.apply(this,arguments)}return f()(r,[{key:"getProjectedLight",value:function(t){var e=t.layer,r=this.projectedLight,n=e.context.viewport,i=e.props,o=i.coordinateSystem,a=i.coordinateOrigin,s=i.modelMatrix,u=Object(P.b)({viewport:n,modelMatrix:s,coordinateSystem:o,coordinateOrigin:a}).project_uCameraPosition;return r.color=this.color,r.intensity=this.intensity,r.position=u,r}}]),r}(_),I=r(10),k=r.n(I),R=r(233),L=r.n(R),j=Math.PI/180,D=23.4397*j;function B(t,e,r){var n,i,o,a,s,u,c=j*-r,l=j*e,h=function(t){return function(t){return t/864e5-.5+2440588}(t)-2451545}(t),f=(n=j*(357.5291+.98560028*h),i=j*(1.9148*Math.sin(n)+.02*Math.sin(2*n)+3e-4*Math.sin(3*n)),o=n+i+102.9372*j+Math.PI,{declination:(a=o,s=0,u=a,Math.asin(Math.sin(s)*Math.cos(D)+Math.cos(s)*Math.sin(D)*Math.sin(u))),rightAscension:z(o,0)}),p=function(t,e){return j*(280.147+360.9856235*t)-e}(h,c)-f.rightAscension;return{azimuth:N(p,l,f.declination),altitude:U(p,l,f.declination)}}function F(t,e,r){var n=B(t,e,r),i=n.azimuth,o=n.altitude;return[Math.sin(i)*Math.cos(o),Math.cos(i)*Math.cos(o),-Math.sin(o)]}function z(t,e){var r=t;return Math.atan2(Math.sin(r)*Math.cos(D)-Math.tan(e)*Math.sin(D),Math.cos(r))}function N(t,e,r){var n=t,i=e,o=r;return Math.atan2(Math.sin(n),Math.cos(n)*Math.sin(i)-Math.tan(o)*Math.cos(i))}function U(t,e,r){var n=t,i=e,o=r;return Math.asin(Math.sin(i)*Math.sin(o)+Math.cos(i)*Math.cos(o)*Math.cos(n))}function V(t){var e=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(t){return!1}}();return function(){var r,n=T()(t);if(e){var i=T()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return S()(this,r)}}var G=function(t){w()(r,t);var e=V(r);function r(t){var n,i=t.timestamp,o=L()(t,["timestamp"]);return l()(this,r),(n=e.call(this,o)).timestamp=i,n}return f()(r,[{key:"getProjectedLight",value:function(t){var e=t.layer.context.viewport;if(e.resolution>0){var r=F(this.timestamp,0,0),n=k()(r,3),i=n[0],o=n[1],a=n[2];this.direction=[i,-a,o]}else{var s=e.latitude,u=e.longitude;this.direction=F(this.timestamp,s,u)}return this}}]),r}(a.a),W=r(86),H=r(176),q=r(62);const Z=[-1,-1,1,-1,-1,1,1,1];class X extends H.a{constructor(t,e){const r=Z.map(t=>-1===t?0:t);super(t,Object.assign({},e,{vs:"attribute vec2 aClipSpacePosition;\nattribute vec2 aTexCoord;\nattribute vec2 aCoordinate;\n\nvarying vec2 position;\nvarying vec2 coordinate;\nvarying vec2 uv;\n\nvoid main(void) {\n gl_Position = vec4(aClipSpacePosition, 0., 1.);\n position = aClipSpacePosition;\n coordinate = aCoordinate;\n uv = aTexCoord;\n}\n",geometry:new q.a({drawMode:5,vertexCount:4,attributes:{aClipSpacePosition:{size:2,value:new Float32Array(Z)},aTexCoord:{size:2,value:new Float32Array(r)},aCoordinate:{size:2,value:new Float32Array(r)}}})})),this.setVertexCount(4)}}var Q=r(7),Y=r(178);function K(t){var e=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(t){return!1}}();return function(){var r,n=T()(t);if(e){var i=T()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return S()(this,r)}}var $=function(t){w()(r,t);var e=K(r);function r(t){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};l()(this,r),n=e.call(this,t,i);var o=i.module,a=i.fs,s=i.id;return n.model=new X(t,{id:s,fs:a,modules:[o]}),n}return f()(r,[{key:"render",value:function(t){var e=this,r=this.gl;Object(Q.n)(r,{viewport:[0,0,r.drawingBufferWidth,r.drawingBufferHeight]}),Object(Q.o)(r,{framebuffer:t.outputBuffer,clearColor:[0,0,0,0]},(function(){return e._renderPass(r,t)}))}},{key:"delete",value:function(){this.model.delete(),this.model=null}},{key:"_renderPass",value:function(t,e){var r=e.inputBuffer;e.outputBuffer;Object(Y.a)(t,{color:!0}),this.model.draw({moduleSettings:this.props.moduleSettings,uniforms:{texture:r,texSize:[r.width,r.height]},parameters:{depthWrite:!1,depthTest:!1}})}}]),r}(r(170).a),J=r(196);function tt(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return et(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return et(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function et(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function rt(t){var e=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(t){return!1}}();return function(){var r,n=T()(t);if(e){var i=T()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return S()(this,r)}}var nt=function(t){w()(r,t);var e=rt(r);function r(t){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return l()(this,r),(n=e.call(this,i)).id="".concat(t.name,"-pass"),Object(J.b)(t),n.module=t,n}return f()(r,[{key:"postRender",value:function(t,e){this.passes||(this.passes=function(t,e,r,n){if(e.filter||e.sampler){var i=at(e);return[new $(t,{id:r,module:e,fs:i,moduleSettings:n})]}return(e.passes||[]).map((function(i,o){var a=at(e,i),s="".concat(r,"-").concat(o);return new $(t,{id:s,module:e,fs:a,moduleSettings:n})}))}(t,this.module,this.id,this.props));for(var r=e.target,n=e.inputBuffer,i=e.swapBuffer,o=0;o<this.passes.length;o++){r&&o===this.passes.length-1&&(i=r),this.passes[o].render({inputBuffer:n,outputBuffer:i});var a=i;i=n,n=a}return n}},{key:"cleanup",value:function(){if(this.passes){var t,e=tt(this.passes);try{for(e.s();!(t=e.n()).done;){t.value.delete()}}catch(t){e.e(t)}finally{e.f()}this.passes=null}}}]),r}(W.a);var it=function(t){return"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(t,"(gl_FragColor, texSize, texCoord);\n}\n")},ot=function(t){return"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(t,"(texture, texSize, texCoord);\n}\n")};function at(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;if(e.filter){var r="string"==typeof e.filter?e.filter:"".concat(t.name,"_filterColor");return it(r)}if(e.sampler){var n="string"==typeof e.sampler?e.sampler:"".concat(t.name,"_sampleColor");return ot(n)}return null}var st=r(85),ut=r(191),ct=r(161),lt=r(156),ht=r(155),ft=r(190),pt=r(163),dt=r(40),At=r(105),gt=r(11),mt=r(21),yt=r(28);function vt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function _t(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?vt(Object(r),!0).forEach((function(e){u()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):vt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function bt(t){var e=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(t){return!1}}();return function(){var r,n=T()(t);if(e){var i=T()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return S()(this,r)}}var xt=Math.PI/180,wt=180/Math.PI;function Et(){var t=Math.PI/180*256;return{unitsPerMeter:[256/6370972,256/6370972,256/6370972],unitsPerMeter2:[0,0,0],metersPerUnit:[24886.609375,24886.609375,24886.609375],unitsPerDegree:[t,t,256/6370972],unitsPerDegree2:[0,0,0],degreesPerUnit:[1/t,1/t,24886.609375]}}var St=function(t){w()(r,t);var e=bt(r);function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};l()(this,r);var i=n.latitude,o=void 0===i?0:i,a=n.longitude,s=void 0===a?0:a,u=n.zoom,c=void 0===u?11:u,h=n.nearZMultiplier,f=void 0===h?.1:h,p=n.farZMultiplier,d=void 0===p?2:p,A=n.resolution,g=void 0===A?10:A,m=n.width,y=n.height,v=n.altitude,_=void 0===v?1.5:v;m=m||1,y=y||1,_=Math.max(.75,_);var b=(new gt.a).lookAt({eye:[0,-_,0],up:[0,0,1]}),x=Math.pow(2,c);b.rotateX(o*xt),b.rotateZ(-s*xt),b.scale(x/y);var w=Math.atan(.5/_),E=512*x/y;return(t=e.call(this,_t(_t({},n),{},{width:m,height:y,viewMatrix:b,longitude:s,latitude:o,zoom:c,fovyRadians:2*w,aspect:m/y,focalDistance:_,near:f,far:Math.min(2,1/E+1)*_*d}))).resolution=g,t.distanceScales=Et(),t}return f()(r,[{key:"getDistanceScales",value:function(){return this.distanceScales}},{key:"getBounds",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e={targetZ:t.z||0},r=this.unproject([0,this.height/2],e),n=this.unproject([this.width/2,0],e),i=this.unproject([this.width,this.height/2],e),o=this.unproject([this.width/2,this.height],e);return i[0]<this.longitude&&(i[0]+=360),r[0]>this.longitude&&(r[0]-=360),[Math.min(r[0],i[0],n[0],o[0]),Math.min(r[1],i[1],n[1],o[1]),Math.max(r[0],i[0],n[0],o[0]),Math.max(r[1],i[1],n[1],o[1])]}},{key:"unproject",value:function(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.topLeft,i=void 0===n||n,o=r.targetZ,a=k()(t,3),s=a[0],u=a[1],c=a[2],l=i?u:this.height-u,h=this.pixelUnprojectionMatrix;if(Number.isFinite(c))e=Ot(h,[s,l,c,1]);else{var f=Ot(h,[s,l,-1,1]),p=Ot(h,[s,l,1,1]),d=256*((o||0)/6370972+1),A=mt.p(mt.q([],f,p)),g=mt.p(f),m=mt.p(p),y=(4*g*m-Math.pow(A-g-m,2))/16,v=4*y/A,_=Math.sqrt(g-v),b=Math.sqrt(Math.max(0,d*d-v)),x=(_-b)/Math.sqrt(A);e=mt.i([],f,p,x)}var w=this.unprojectPosition(e),E=k()(w,3),S=E[0],O=E[1],T=E[2];return Number.isFinite(c)?[S,O,T]:Number.isFinite(o)?[S,O,o]:[S,O]}},{key:"projectPosition",value:function(t){var e=k()(t,3),r=e[0],n=e[1],i=e[2],o=void 0===i?0:i,a=r*xt,s=n*xt,u=Math.cos(s),c=256*(o/6370972+1);return[Math.sin(a)*u*c,-Math.cos(a)*u*c,Math.sin(s)*c]}},{key:"unprojectPosition",value:function(t){var e=k()(t,3),r=e[0],n=e[1],i=e[2],o=mt.g(t),a=Math.asin(i/o);return[Math.atan2(r,-n)*wt,a*wt,6370972*(o/256-1)]}},{key:"projectFlat",value:function(t){return t}},{key:"unprojectFlat",value:function(t){return t}},{key:"panByPosition",value:function(t,e){var r=this.unproject(e);return{longitude:t[0]-r[0]+this.longitude,latitude:t[1]-r[1]+this.latitude}}},{key:"projectionMode",get:function(){return n.c.GLOBE}}]),r}(dt.a);function Ot(t,e){var r=yt.n([],e,t);return yt.k(r,r,1/r[3]),r}var Tt=r(226),Pt=r(95),Mt=r(207),Ct=r(227),It=r(112),kt=r(61),Rt=r(149),Lt=r(22),jt=r(60),Dt=r(114),Bt=r(35);function Ft(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function zt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ft(Object(r),!0).forEach((function(e){u()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ft(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Nt(t){var e=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(t){return!1}}();return function(){var r,n=T()(t);if(e){var i=T()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return S()(this,r)}}var Ut={position:[0,0,0],pitch:0,bearing:0,maxPitch:90,minPitch:-90},Vt=function(t){w()(r,t);var e=Nt(r);function r(t){var n,i=t.width,o=t.height,a=t.position,s=void 0===a?Ut.position:a,u=t.bearing,c=void 0===u?Ut.bearing:u,h=t.pitch,f=void 0===h?Ut.pitch:h,p=t.longitude,d=t.latitude,A=t.maxPitch,g=void 0===A?Ut.maxPitch:A,m=t.minPitch,y=void 0===m?Ut.minPitch:m,v=t.startRotatePos,_=t.startBearing,b=t.startPitch,x=t.startZoomPosition,w=t.startZoom;return l()(this,r),(n=e.call(this,{width:i,height:o,position:s,bearing:c,pitch:f,longitude:p,latitude:d,maxPitch:g,minPitch:y}))._state={startRotatePos:v,startBearing:_,startPitch:b,startZoomPosition:x,startZoom:w},n}return f()(r,[{key:"getDirection",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=new gt.c({bearing:this._viewportProps.bearing,pitch:t?90:90+this._viewportProps.pitch}),r=e.toVector3().normalize();return r}},{key:"panStart",value:function(){return this}},{key:"pan",value:function(){return this}},{key:"panEnd",value:function(){return this}},{key:"rotateStart",value:function(t){var e=t.pos;return this._getUpdatedState({startRotatePos:e,startBearing:this._viewportProps.bearing,startPitch:this._viewportProps.pitch})}},{key:"rotate",value:function(t){var e,r=t.pos,n=t.deltaAngleX,i=void 0===n?0:n,o=t.deltaAngleY,a=void 0===o?0:o,s=this._state,u=s.startRotatePos,c=s.startBearing,l=s.startPitch,h=this._viewportProps,f=h.width,p=h.height;if(!u||!Number.isFinite(c)||!Number.isFinite(l))return this;r?e={bearing:c-180*((r[0]-u[0])/f),pitch:l-90*((r[1]-u[1])/p)}:e={bearing:c-i,pitch:l-a};return this._getUpdatedState(e)}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startRotatePos:null,startBearing:null,startPitch:null})}},{key:"zoomStart",value:function(){return this._getUpdatedState({startZoomPosition:this._viewportProps.position,startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(t){var e=t.scale,r=this._state.startZoomPosition;r||(r=this._viewportProps.position);var n=this.getDirection();return this._move(n,20*Math.log2(e),r)}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomPosition:null,startZoom:null})}},{key:"moveLeft",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,e=this.getDirection(!0);return this._move(e.rotateZ({radians:Math.PI/2}),t)}},{key:"moveRight",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,e=this.getDirection(!0);return this._move(e.rotateZ({radians:-Math.PI/2}),t)}},{key:"moveUp",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,e=this.getDirection(!0);return this._move(e,t)}},{key:"moveDown",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,e=this.getDirection(!0);return this._move(e.negate(),t)}},{key:"rotateLeft",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15;return this._getUpdatedState({bearing:this._viewportProps.bearing-t})}},{key:"rotateRight",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15;return this._getUpdatedState({bearing:this._viewportProps.bearing+t})}},{key:"rotateUp",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this._getUpdatedState({pitch:this._viewportProps.pitch+t})}},{key:"rotateDown",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this._getUpdatedState({pitch:this._viewportProps.pitch-t})}},{key:"zoomIn",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;return this.zoom({scale:t})}},{key:"zoomOut",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;return this.zoom({scale:1/t})}},{key:"shortestPathFrom",value:function(t){var e=t.getViewportProps(),r=zt({},this._viewportProps),n=r.bearing,i=r.longitude;return Math.abs(n-e.bearing)>180&&(r.bearing=n<0?n+360:n-360),Math.abs(i-e.longitude)>180&&(r.longitude=i<0?i+360:i-360),r}},{key:"_move",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this._viewportProps.position,n=t.scale(e);return this._getUpdatedState({position:new gt.b(r).add(n)})}},{key:"_getUpdatedState",value:function(t){return new r(zt(zt(zt({},this._viewportProps),this._state),t))}},{key:"_applyConstraints",value:function(t){var e=t.pitch,r=t.maxPitch,n=t.minPitch,i=t.longitude,o=t.bearing;return t.pitch=Object(gt.d)(e,n,r),(i<-180||i>180)&&(t.longitude=Object(Bt.e)(i+180,360)-180),(o<-180||o>180)&&(t.bearing=Object(Bt.e)(o+180,360)-180),t}}]),r}(Dt.a),Gt=function(t){w()(r,t);var e=Nt(r);function r(t){return l()(this,r),e.call(this,Vt,t)}return f()(r,[{key:"linearTransitionProps",get:function(){return["position","pitch","bearing"]}}]),r}(jt.a);function Wt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Ht(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Wt(Object(r),!0).forEach((function(e){u()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Wt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function qt(t){var e=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(t){return!1}}();return function(){var r,n=T()(t);if(e){var i=T()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return S()(this,r)}}var Zt=function(t){w()(r,t);var e=qt(r);function r(t){l()(this,r);var n=t.modelMatrix,i=void 0===n?null:n,o=t.bearing,a=void 0===o?0:o,s=t.pitch,u=void 0===s?0:s,c=t.up,h=void 0===c?[0,0,1]:c,f=function(t){var e=t.bearing,r=t.pitch;return new gt.c({bearing:e,pitch:r}).toVector3().normalize()}({bearing:a,pitch:-90===u?1e-4:90+u}),p=i?i.transformDirection(f):f,d=Object(Lt.i)(t),A=Math.pow(2,d),g=(new gt.a).lookAt({eye:[0,0,0],center:p,up:h}).scale(A);return e.call(this,Ht(Ht({},t),{},{zoom:d,viewMatrix:g}))}return r}(dt.a),Xt=function(t){w()(r,t);var e=qt(r);function r(t){return l()(this,r),e.call(this,Ht(Ht({},t),{},{type:Zt}))}return f()(r,[{key:"controller",get:function(){return this._getControllerProps({type:Gt})}}]),r}(kt.a);function Qt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Yt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Qt(Object(r),!0).forEach((function(e){u()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Qt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Kt(t){var e=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(t){return!1}}();return function(){var r,n=T()(t);if(e){var i=T()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return S()(this,r)}}Xt.displayName="FirstPersonView";var $t={rotationX:0,rotationOrbit:0,zoom:0,target:[0,0,0],minRotationX:-90,maxRotationX:90,minZoom:-1/0,maxZoom:1/0},Jt=function(t){w()(r,t);var e=Kt(r);function r(t){var n,i=t.makeViewport,o=t.width,a=t.height,s=t.rotationX,u=void 0===s?$t.rotationX:s,c=t.rotationOrbit,h=void 0===c?$t.rotationOrbit:c,f=t.target,p=void 0===f?$t.target:f,d=t.zoom,A=void 0===d?$t.zoom:d,g=t.minRotationX,m=void 0===g?$t.minRotationX:g,y=t.maxRotationX,v=void 0===y?$t.maxRotationX:y,_=t.minZoom,b=void 0===_?$t.minZoom:_,x=t.maxZoom,w=void 0===x?$t.maxZoom:x,E=t.startPanPosition,S=t.startRotatePos,O=t.startRotationX,T=t.startRotationOrbit,P=t.startZoomPosition,M=t.startZoom;return l()(this,r),(n=e.call(this,{width:o,height:a,rotationX:u,rotationOrbit:h,target:p,zoom:A,minRotationX:m,maxRotationX:v,minZoom:b,maxZoom:w}))._state={startPanPosition:E,startRotatePos:S,startRotationX:O,startRotationOrbit:T,startZoomPosition:P,startZoom:M},n.makeViewport=i,n}return f()(r,[{key:"panStart",value:function(t){var e=t.pos;return this._getUpdatedState({startPanPosition:this._unproject(e)})}},{key:"pan",value:function(t){var e=t.pos,r=t.startPosition,n=this._state.startPanPosition||r;if(!n)return this;var i=this.makeViewport(this._viewportProps).panByPosition(n,e);return this._getUpdatedState(i)}},{key:"panEnd",value:function(){return this._getUpdatedState({startPanPosition:null})}},{key:"rotateStart",value:function(t){var e=t.pos;return this._getUpdatedState({startRotatePos:e,startRotationX:this._viewportProps.rotationX,startRotationOrbit:this._viewportProps.rotationOrbit})}},{key:"rotate",value:function(t){var e,r=t.pos,n=t.deltaAngleX,i=void 0===n?0:n,o=t.deltaAngleY,a=void 0===o?0:o,s=this._state,u=s.startRotatePos,c=s.startRotationX,l=s.startRotationOrbit,h=this._viewportProps,f=h.width,p=h.height;if(!u||!Number.isFinite(c)||!Number.isFinite(l))return this;if(r){var d=(r[0]-u[0])/f;(c<-90||c>90)&&(d*=-1),e={rotationX:c+180*((r[1]-u[1])/p),rotationOrbit:l+180*d}}else e={rotationX:c+a,rotationOrbit:l+i};return this._getUpdatedState(e)}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startRotationX:null,startRotationOrbit:null})}},{key:"shortestPathFrom",value:function(t){var e=t.getViewportProps(),r=Yt({},this._viewportProps),n=r.rotationOrbit;return Math.abs(n-e.rotationOrbit)>180&&(r.rotationOrbit=n<0?n+360:n-360),r}},{key:"zoomStart",value:function(t){var e=t.pos;return this._getUpdatedState({startZoomPosition:this._unproject(e),startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(t){var e=t.pos,r=t.startPos,n=t.scale,i=this._viewportProps.zoom,o=this._state,a=o.startZoom,s=o.startZoomPosition;Number.isFinite(a)||(a=i,s=this._unproject(r)||this._unproject(e));var u=this._calculateNewZoom({scale:n,startZoom:a}),c=this.makeViewport(Yt(Yt({},this._viewportProps),{},{zoom:u}));return this._getUpdatedState(Yt({zoom:u},c.panByPosition(s,e)))}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomPosition:null,startZoom:null})}},{key:"zoomIn",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;return this._getUpdatedState({zoom:this._calculateNewZoom({scale:t})})}},{key:"zoomOut",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;return this._getUpdatedState({zoom:this._calculateNewZoom({scale:1/t})})}},{key:"moveLeft",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50;return this._panFromCenter([-t,0])}},{key:"moveRight",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50;return this._panFromCenter([t,0])}},{key:"moveUp",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50;return this._panFromCenter([0,-t])}},{key:"moveDown",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50;return this._panFromCenter([0,t])}},{key:"rotateLeft",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15;return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit-t})}},{key:"rotateRight",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15;return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit+t})}},{key:"rotateUp",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this._getUpdatedState({rotationX:this._viewportProps.rotationX-t})}},{key:"rotateDown",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this._getUpdatedState({rotationX:this._viewportProps.rotationX+t})}},{key:"_unproject",value:function(t){var e=this.makeViewport(this._viewportProps);return t&&e.unproject(t)}},{key:"_calculateNewZoom",value:function(t){var e=t.scale,r=t.startZoom,n=this._viewportProps,i=n.maxZoom,o=n.minZoom;Number.isFinite(r)||(r=this._viewportProps.zoom);var a=r+Math.log2(e);return Object(gt.d)(a,o,i)}},{key:"_panFromCenter",value:function(t){var e=this._viewportProps,r=e.width,n=e.height,i=e.target;return this.pan({startPosition:i,pos:[r/2+t[0],n/2+t[1]]})}},{key:"_getUpdatedState",value:function(t){return new this.constructor(Yt(Yt(Yt({},this._viewportProps),this._state),t))}},{key:"_applyConstraints",value:function(t){var e=t.maxZoom,r=t.minZoom,n=t.zoom,i=t.maxRotationX,o=t.minRotationX,a=t.rotationOrbit;return t.zoom=Object(gt.d)(n,r,e),t.rotationX=Object(gt.d)(t.rotationX,o,i),(a<-180||a>180)&&(t.rotationOrbit=Object(Bt.e)(a+180,360)-180),t}}]),r}(Dt.a),te=function(t){w()(r,t);var e=Kt(r);function r(t){return l()(this,r),e.call(this,Jt,t)}return f()(r,[{key:"linearTransitionProps",get:function(){return["target","zoom","rotationX","rotationOrbit"]}}]),r}(jt.a);function ee(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function re(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ee(Object(r),!0).forEach((function(e){u()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ee(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ne(t){var e=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(t){return!1}}();return function(){var r,n=T()(t);if(e){var i=T()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return S()(this,r)}}var ie=Math.PI/180;function oe(t){var e=t.height,r=t.focalDistance,n=t.orbitAxis,i=t.rotationX,o=t.rotationOrbit,a=t.zoom,s="Z"===n?[0,0,1]:[0,1,0],u="Z"===n?[0,-r,0]:[0,0,r],c=(new gt.a).lookAt({eye:u,up:s});c.rotateX(i*ie),"Z"===n?c.rotateZ(o*ie):c.rotateY(o*ie);var l=Math.pow(2,a)/(e||1);return c.scale(l),c}var ae=function(t){w()(r,t);var e=ne(r);function r(t){var n;l()(this,r);var i=t.height,o=t.projectionMatrix,a=t.fovy,s=void 0===a?50:a,u=t.orbitAxis,c=t.target,h=void 0===c?[0,0,0]:c,f=t.rotationX,p=void 0===f?0:f,d=t.rotationOrbit,A=void 0===d?0:d,g=t.zoom,m=void 0===g?0:g,y=o?o[5]/2:Object(Lt.e)(s);return(n=e.call(this,re(re({},t),{},{longitude:null,viewMatrix:oe({height:i,focalDistance:y,orbitAxis:u,rotationX:p,rotationOrbit:A,zoom:m}),fovy:s,focalDistance:y,position:h,zoom:m}))).projectedCenter=n.project(n.center),n}return f()(r,[{key:"unproject",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.topLeft,n=void 0===r||r,i=k()(t,3),o=i[0],a=i[1],s=i[2],u=void 0===s?this.projectedCenter[2]:s,c=n?a:this.height-a,l=Object(Lt.n)([o,c,u],this.pixelUnprojectionMatrix),h=k()(l,3),f=h[0],p=h[1],d=h[2];return[f,p,d]}},{key:"panByPosition",value:function(t,e){var r=this.project(t),n=[this.width/2+r[0]-e[0],this.height/2+r[1]-e[1],this.projectedCenter[2]];return{target:this.unproject(n)}}}]),r}(dt.a),se=function(t){w()(r,t);var e=ne(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};l()(this,r);var n=t.orbitAxis,i=void 0===n?"Z":n;return e.call(this,re(re({},t),{},{orbitAxis:i,type:ae}))}return f()(r,[{key:"controller",get:function(){return this._getControllerProps({type:te})}}]),r}(kt.a);se.displayName="OrbitView";var ue=r(27);function ce(t){var e=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(t){return!1}}();return function(){var r,n=T()(t);if(e){var i=T()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return S()(this,r)}}var le=function(t){w()(r,t);var e=ce(r);function r(t){var n;return l()(this,r),(n=e.call(this,t)).zoomAxis=t.zoomAxis||"all",n}return f()(r,[{key:"_applyConstraints",value:function(t){var e=t.maxZoom,r=t.minZoom,n=t.zoom;return t.zoom=Array.isArray(n)?[Object(gt.d)(n[0],r,e),Object(gt.d)(n[1],r,e)]:Object(gt.d)(n,r,e),t}},{key:"_calculateNewZoom",value:function(t){var e=t.scale,r=t.startZoom,n=this._viewportProps,i=n.maxZoom,o=n.minZoom;r||0===r||(r=this._viewportProps.zoom);var a=Math.log2(e);if(Array.isArray(r)){var s=r,u=k()(s,2),c=u[0],l=u[1];switch(this.zoomAxis){case"X":c=Object(gt.d)(c+a,o,i);break;case"Y":l=Object(gt.d)(l+a,o,i);break;default:var h=Math.min(c+a,l+a);h<o&&(a+=o-h),(h=Math.max(c+a,l+a))>i&&(a+=i-h),c+=a,l+=a}return[c,l]}return Object(gt.d)(r+a,o,i)}}]),r}(Jt),he=function(t){w()(r,t);var e=ce(r);function r(t){return l()(this,r),t.dragMode=t.dragMode||"pan",e.call(this,le,t)}return f()(r,[{key:"_onPanRotate",value:function(t){return!1}},{key:"linearTransitionProps",get:function(){return["target","zoom"]}}]),r}(jt.a);function fe(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function pe(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?fe(Object(r),!0).forEach((function(e){u()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):fe(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function de(t){var e=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(t){return!1}}();return function(){var r,n=T()(t);if(e){var i=T()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return S()(this,r)}}var Ae=(new gt.a).lookAt({eye:[0,0,1]});function ge(t){var e=t.width,r=t.height,n=t.near,i=t.far;return e=e||1,r=r||1,(new gt.a).ortho({left:-e/2,right:e/2,bottom:-r/2,top:r/2,near:n,far:i})}var me=function(t){w()(r,t);var e=de(r);function r(t){var n;l()(this,r);var i=t.width,o=t.height,a=t.near,s=void 0===a?.1:a,u=t.far,c=void 0===u?1e3:u,h=t.zoom,f=void 0===h?0:h,p=t.target,d=void 0===p?[0,0,0]:p,A=t.flipY,g=void 0===A||A,m=Array.isArray(f)?f[0]:f,y=Array.isArray(f)?f[1]:f,v=Math.min(m,y),_=Math.pow(2,v);if(n=e.call(this,pe(pe({},t),{},{longitude:null,position:d,viewMatrix:Ae.clone().scale([_,_*(g?-1:1),_]),projectionMatrix:ge({width:i,height:o,near:s,far:c}),zoom:v})),m!==y){var b=Math.pow(2,m),x=Math.pow(2,y);n.distanceScales={unitsPerMeter:[b/_,x/_,1],metersPerUnit:[_/b,_/x,1]}}return n}return f()(r,[{key:"projectFlat",value:function(t){var e=k()(t,2),r=e[0],n=e[1],i=this.distanceScales.unitsPerMeter;return[r*i[0],n*i[1]]}},{key:"unprojectFlat",value:function(t){var e=k()(t,2),r=e[0],n=e[1],i=this.distanceScales.metersPerUnit;return[r*i[0],n*i[1]]}},{key:"panByPosition",value:function(t,e){var r=Object(Lt.n)(e,this.pixelUnprojectionMatrix),n=this.projectFlat(t),i=ue.a([],n,ue.d([],r));return{target:ue.a([],this.center,i)}}}]),r}(dt.a),ye=function(t){w()(r,t);var e=de(r);function r(t){return l()(this,r),e.call(this,pe(pe({},t),{},{type:me}))}return f()(r,[{key:"controller",get:function(){return this._getControllerProps({type:he})}}]),r}(kt.a);ye.displayName="OrthographicView";var ve=r(8),_e=r.n(ve),be=r(106);function xe(t){var e=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(t){return!1}}();return function(){var r,n=T()(t);if(e){var i=T()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return S()(this,r)}}var we=function(t){w()(r,t);var e=xe(r);function r(){return l()(this,r),e.apply(this,arguments)}return f()(r,[{key:"_applyConstraints",value:function(t){var e=t.maxZoom,r=t.minZoom,n=t.zoom;t.zoom=Object(gt.d)(n,r,e);var i=t.longitude,o=t.latitude;return(i<-180||i>180)&&(t.longitude=Object(Bt.e)(i+180,360)-180),t.latitude=Object(gt.d)(o,-89,89),t}}]),r}(be.a),Ee=function(t){w()(r,t);var e=xe(r);function r(t){return l()(this,r),t.dragMode=t.dragMode||"pan",e.call(this,we,t)}return f()(r,[{key:"setProps",value:function(t){_e()(T()(r.prototype),"setProps",this).call(this,t),this.dragRotate=!1,this.touchRotate=!1}},{key:"linearTransitionProps",get:function(){return["longitude","latitude","zoom"]}}]),r}(jt.a);function Se(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Oe(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Se(Object(r),!0).forEach((function(e){u()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Se(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Te(t){var e=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(t){return!1}}();return function(){var r,n=T()(t);if(e){var i=T()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return S()(this,r)}}var Pe=function(t){w()(r,t);var e=Te(r);function r(t){return l()(this,r),e.call(this,Oe(Oe({},t),{},{type:St}))}return f()(r,[{key:"controller",get:function(){return this._getControllerProps({type:Ee})}}]),r}(kt.a);Pe.displayName="GlobeView";var Me=r(208),Ce=r(127),Ie=r(107),ke=r(128);function Re(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Le(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Le(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Le(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function je(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function De(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?je(Object(r),!0).forEach((function(e){u()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):je(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Be(t){var e=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(t){return!1}}();return function(){var r,n=T()(t);if(e){var i=T()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return S()(this,r)}}var Fe=["bearing","pitch"],ze={speed:1.2,curve:1.414},Ne=function(t){w()(r,t);var e=Be(r);function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return l()(this,r),(t=e.call(this,{compare:["longitude","latitude","zoom","bearing","pitch"],extract:["width","height","longitude","latitude","zoom","bearing","pitch"],required:["width","height","latitude","longitude","zoom"]})).props=De(De({},ze),n),t}return f()(r,[{key:"interpolateProps",value:function(t,e,r){var n,i=Object(Lt.d)(t,e,r,this.props),o=Re(Fe);try{for(o.s();!(n=o.n()).done;){var a=n.value;i[a]=Object(gt.f)(t[a]||0,e[a]||0,r)}}catch(t){o.e(t)}finally{o.f()}return i}},{key:"getDuration",value:function(t,e){var r=e.transitionDuration;return"auto"===r&&(r=Object(Lt.h)(t,e,this.props)),r}}]),r}(Ie.a),Ue=r(18),Ve=r(53),Ge=r(209),We=r(66),He=r(154),qe=r(80),Ze=r(153),Xe=r(129);r.d(e,"COORDINATE_SYSTEM",(function(){return n.a})),r.d(e,"UNIT",(function(){return n.d})),r.d(e,"LightingEffect",(function(){return i.a})),r.d(e,"AmbientLight",(function(){return o.a})),r.d(e,"DirectionalLight",(function(){return a.a})),r.d(e,"PointLight",(function(){return _})),r.d(e,"_CameraLight",(function(){return C})),r.d(e,"_SunLight",(function(){return G})),r.d(e,"PostProcessEffect",(function(){return nt})),r.d(e,"_LayersPass",(function(){return st.a})),r.d(e,"Deck",(function(){return ut.a})),r.d(e,"LayerManager",(function(){return ct.a})),r.d(e,"AttributeManager",(function(){return lt.a})),r.d(e,"Layer",(function(){return ht.a})),r.d(e,"CompositeLayer",(function(){return ft.a})),r.d(e,"DeckRenderer",(function(){return pt.a})),r.d(e,"Viewport",(function(){return dt.a})),r.d(e,"WebMercatorViewport",(function(){return At.a})),r.d(e,"_GlobeViewport",(function(){return St})),r.d(e,"picking",(function(){return Tt.a})),r.d(e,"project",(function(){return Pt.a})),r.d(e,"project32",(function(){return Mt.a})),r.d(e,"gouraudLighting",(function(){return Ct.a})),r.d(e,"phongLighting",(function(){return Ct.b})),r.d(e,"shadow",(function(){return It.a})),r.d(e,"View",(function(){return kt.a})),r.d(e,"MapView",(function(){return Rt.a})),r.d(e,"FirstPersonView",(function(){return Xt})),r.d(e,"OrbitView",(function(){return se})),r.d(e,"OrthographicView",(function(){return ye})),r.d(e,"_GlobeView",(function(){return Pe})),r.d(e,"Controller",(function(){return jt.a})),r.d(e,"MapController",(function(){return be.b})),r.d(e,"_GlobeController",(function(){return Ee})),r.d(e,"FirstPersonController",(function(){return Gt})),r.d(e,"OrbitController",(function(){return te})),r.d(e,"OrthographicController",(function(){return he})),r.d(e,"Effect",(function(){return W.a})),r.d(e,"LayerExtension",(function(){return Me.a})),r.d(e,"TRANSITION_EVENTS",(function(){return Ce.a})),r.d(e,"TransitionInterpolator",(function(){return Ie.a})),r.d(e,"LinearInterpolator",(function(){return ke.a})),r.d(e,"FlyToInterpolator",(function(){return Ne})),r.d(e,"log",(function(){return Ue.a})),r.d(e,"createIterable",(function(){return Ve.a})),r.d(e,"fp64LowPart",(function(){return Bt.b})),r.d(e,"Tesselator",(function(){return Ge.a})),r.d(e,"_fillArray",(function(){return We.a})),r.d(e,"_flatten",(function(){return We.b})),r.d(e,"_count",(function(){return He.a})),r.d(e,"_memoize",(function(){return qe.a})),r.d(e,"_mergeShaders",(function(){return Ze.a})),r.d(e,"_compareProps",(function(){return Xe.a}))},,function(t,e,r){"use strict";r.d(e,"q",(function(){return i})),r.d(e,"f",(function(){return o})),r.d(e,"a",(function(){return a})),r.d(e,"h",(function(){return s})),r.d(e,"p",(function(){return u})),r.d(e,"o",(function(){return c})),r.d(e,"k",(function(){return l})),r.d(e,"l",(function(){return h})),r.d(e,"m",(function(){return f})),r.d(e,"n",(function(){return p})),r.d(e,"e",(function(){return d})),r.d(e,"c",(function(){return A})),r.d(e,"d",(function(){return g})),r.d(e,"j",(function(){return m})),r.d(e,"i",(function(){return y})),r.d(e,"g",(function(){return v})),r.d(e,"b",(function(){return _}));var n=r(12);function i(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],o=e[6],a=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function o(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],h=e[9],f=e[10],p=e[11],d=e[12],A=e[13],g=e[14],m=e[15],y=r*s-n*a,v=r*u-i*a,_=r*c-o*a,b=n*u-i*s,x=n*c-o*s,w=i*c-o*u,E=l*A-h*d,S=l*g-f*d,O=l*m-p*d,T=h*g-f*A,P=h*m-p*A,M=f*m-p*g,C=y*M-v*P+_*T+b*O-x*S+w*E;return C?(C=1/C,t[0]=(s*M-u*P+c*T)*C,t[1]=(i*P-n*M-o*T)*C,t[2]=(A*w-g*x+m*b)*C,t[3]=(f*x-h*w-p*b)*C,t[4]=(u*O-a*M-c*S)*C,t[5]=(r*M-i*O+o*S)*C,t[6]=(g*_-d*w-m*v)*C,t[7]=(l*w-f*_+p*v)*C,t[8]=(a*P-s*O+c*E)*C,t[9]=(n*O-r*P-o*E)*C,t[10]=(d*x-A*_+m*y)*C,t[11]=(h*_-l*x-p*y)*C,t[12]=(s*S-a*T-u*E)*C,t[13]=(r*T-n*S+i*E)*C,t[14]=(A*v-d*b-g*y)*C,t[15]=(l*b-h*v+f*y)*C,t):null}function a(t){var e=t[0],r=t[1],n=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],c=t[8],l=t[9],h=t[10],f=t[11],p=t[12],d=t[13],A=t[14],g=t[15];return(e*a-r*o)*(h*g-f*A)-(e*s-n*o)*(l*g-f*d)+(e*u-i*o)*(l*A-h*d)+(r*s-n*a)*(c*g-f*p)-(r*u-i*a)*(c*A-h*p)+(n*u-i*s)*(c*d-l*p)}function s(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],f=e[9],p=e[10],d=e[11],A=e[12],g=e[13],m=e[14],y=e[15],v=r[0],_=r[1],b=r[2],x=r[3];return t[0]=v*n+_*s+b*h+x*A,t[1]=v*i+_*u+b*f+x*g,t[2]=v*o+_*c+b*p+x*m,t[3]=v*a+_*l+b*d+x*y,v=r[4],_=r[5],b=r[6],x=r[7],t[4]=v*n+_*s+b*h+x*A,t[5]=v*i+_*u+b*f+x*g,t[6]=v*o+_*c+b*p+x*m,t[7]=v*a+_*l+b*d+x*y,v=r[8],_=r[9],b=r[10],x=r[11],t[8]=v*n+_*s+b*h+x*A,t[9]=v*i+_*u+b*f+x*g,t[10]=v*o+_*c+b*p+x*m,t[11]=v*a+_*l+b*d+x*y,v=r[12],_=r[13],b=r[14],x=r[15],t[12]=v*n+_*s+b*h+x*A,t[13]=v*i+_*u+b*f+x*g,t[14]=v*o+_*c+b*p+x*m,t[15]=v*a+_*l+b*d+x*y,t}function u(t,e,r){var n,i,o,a,s,u,c,l,h,f,p,d,A=r[0],g=r[1],m=r[2];return e===t?(t[12]=e[0]*A+e[4]*g+e[8]*m+e[12],t[13]=e[1]*A+e[5]*g+e[9]*m+e[13],t[14]=e[2]*A+e[6]*g+e[10]*m+e[14],t[15]=e[3]*A+e[7]*g+e[11]*m+e[15]):(n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],f=e[9],p=e[10],d=e[11],t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=c,t[7]=l,t[8]=h,t[9]=f,t[10]=p,t[11]=d,t[12]=n*A+s*g+h*m+e[12],t[13]=i*A+u*g+f*m+e[13],t[14]=o*A+c*g+p*m+e[14],t[15]=a*A+l*g+d*m+e[15]),t}function c(t,e,r){var n=r[0],i=r[1],o=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function l(t,e,r,i){var o,a,s,u,c,l,h,f,p,d,A,g,m,y,v,_,b,x,w,E,S,O,T,P,M=i[0],C=i[1],I=i[2],k=Math.hypot(M,C,I);return k<n.b?null:(M*=k=1/k,C*=k,I*=k,o=Math.sin(r),s=1-(a=Math.cos(r)),u=e[0],c=e[1],l=e[2],h=e[3],f=e[4],p=e[5],d=e[6],A=e[7],g=e[8],m=e[9],y=e[10],v=e[11],_=M*M*s+a,b=C*M*s+I*o,x=I*M*s-C*o,w=M*C*s-I*o,E=C*C*s+a,S=I*C*s+M*o,O=M*I*s+C*o,T=C*I*s-M*o,P=I*I*s+a,t[0]=u*_+f*b+g*x,t[1]=c*_+p*b+m*x,t[2]=l*_+d*b+y*x,t[3]=h*_+A*b+v*x,t[4]=u*w+f*E+g*S,t[5]=c*w+p*E+m*S,t[6]=l*w+d*E+y*S,t[7]=h*w+A*E+v*S,t[8]=u*O+f*T+g*P,t[9]=c*O+p*T+m*P,t[10]=l*O+d*T+y*P,t[11]=h*O+A*T+v*P,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}function h(t,e,r){var n=Math.sin(r),i=Math.cos(r),o=e[4],a=e[5],s=e[6],u=e[7],c=e[8],l=e[9],h=e[10],f=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+c*n,t[5]=a*i+l*n,t[6]=s*i+h*n,t[7]=u*i+f*n,t[8]=c*i-o*n,t[9]=l*i-a*n,t[10]=h*i-s*n,t[11]=f*i-u*n,t}function f(t,e,r){var n=Math.sin(r),i=Math.cos(r),o=e[0],a=e[1],s=e[2],u=e[3],c=e[8],l=e[9],h=e[10],f=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i-c*n,t[1]=a*i-l*n,t[2]=s*i-h*n,t[3]=u*i-f*n,t[8]=o*n+c*i,t[9]=a*n+l*i,t[10]=s*n+h*i,t[11]=u*n+f*i,t}function p(t,e,r){var n=Math.sin(r),i=Math.cos(r),o=e[0],a=e[1],s=e[2],u=e[3],c=e[4],l=e[5],h=e[6],f=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i+c*n,t[1]=a*i+l*n,t[2]=s*i+h*n,t[3]=u*i+f*n,t[4]=c*i-o*n,t[5]=l*i-a*n,t[6]=h*i-s*n,t[7]=f*i-u*n,t}function d(t,e){var r=e[0],n=e[1],i=e[2],o=e[4],a=e[5],s=e[6],u=e[8],c=e[9],l=e[10];return t[0]=Math.hypot(r,n,i),t[1]=Math.hypot(o,a,s),t[2]=Math.hypot(u,c,l),t}function A(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r+r,s=n+n,u=i+i,c=r*a,l=n*a,h=n*s,f=i*a,p=i*s,d=i*u,A=o*a,g=o*s,m=o*u;return t[0]=1-h-d,t[1]=l+m,t[2]=f-g,t[3]=0,t[4]=l-m,t[5]=1-c-d,t[6]=p+A,t[7]=0,t[8]=f+g,t[9]=p-A,t[10]=1-c-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function g(t,e,r,n,i,o,a){var s=1/(r-e),u=1/(i-n),c=1/(o-a);return t[0]=2*o*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*u,t[6]=0,t[7]=0,t[8]=(r+e)*s,t[9]=(i+n)*u,t[10]=(a+o)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*c,t[15]=0,t}function m(t,e,r,n,i){var o,a=1/Math.tan(e/2);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(o=1/(n-i),t[10]=(i+n)*o,t[14]=2*i*n*o):(t[10]=-1,t[14]=-2*n),t}function y(t,e,r,n,i,o,a){var s=1/(e-r),u=1/(n-i),c=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*u,t[14]=(a+o)*c,t[15]=1,t}function v(t,e,r,i){var o,a,s,u,c,l,h,f,p,d,A=e[0],g=e[1],m=e[2],y=i[0],v=i[1],_=i[2],b=r[0],x=r[1],w=r[2];return Math.abs(A-b)<n.b&&Math.abs(g-x)<n.b&&Math.abs(m-w)<n.b?function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}(t):(h=A-b,f=g-x,p=m-w,o=v*(p*=d=1/Math.hypot(h,f,p))-_*(f*=d),a=_*(h*=d)-y*p,s=y*f-v*h,(d=Math.hypot(o,a,s))?(o*=d=1/d,a*=d,s*=d):(o=0,a=0,s=0),u=f*s-p*a,c=p*o-h*s,l=h*a-f*o,(d=Math.hypot(u,c,l))?(u*=d=1/d,c*=d,l*=d):(u=0,c=0,l=0),t[0]=o,t[1]=u,t[2]=h,t[3]=0,t[4]=a,t[5]=c,t[6]=f,t[7]=0,t[8]=s,t[9]=l,t[10]=p,t[11]=0,t[12]=-(o*A+a*g+s*m),t[13]=-(u*A+c*g+l*m),t[14]=-(h*A+f*g+p*m),t[15]=1,t)}function _(t,e){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],u=t[5],c=t[6],l=t[7],h=t[8],f=t[9],p=t[10],d=t[11],A=t[12],g=t[13],m=t[14],y=t[15],v=e[0],_=e[1],b=e[2],x=e[3],w=e[4],E=e[5],S=e[6],O=e[7],T=e[8],P=e[9],M=e[10],C=e[11],I=e[12],k=e[13],R=e[14],L=e[15];return Math.abs(r-v)<=n.b*Math.max(1,Math.abs(r),Math.abs(v))&&Math.abs(i-_)<=n.b*Math.max(1,Math.abs(i),Math.abs(_))&&Math.abs(o-b)<=n.b*Math.max(1,Math.abs(o),Math.abs(b))&&Math.abs(a-x)<=n.b*Math.max(1,Math.abs(a),Math.abs(x))&&Math.abs(s-w)<=n.b*Math.max(1,Math.abs(s),Math.abs(w))&&Math.abs(u-E)<=n.b*Math.max(1,Math.abs(u),Math.abs(E))&&Math.abs(c-S)<=n.b*Math.max(1,Math.abs(c),Math.abs(S))&&Math.abs(l-O)<=n.b*Math.max(1,Math.abs(l),Math.abs(O))&&Math.abs(h-T)<=n.b*Math.max(1,Math.abs(h),Math.abs(T))&&Math.abs(f-P)<=n.b*Math.max(1,Math.abs(f),Math.abs(P))&&Math.abs(p-M)<=n.b*Math.max(1,Math.abs(p),Math.abs(M))&&Math.abs(d-C)<=n.b*Math.max(1,Math.abs(d),Math.abs(C))&&Math.abs(A-I)<=n.b*Math.max(1,Math.abs(A),Math.abs(I))&&Math.abs(g-k)<=n.b*Math.max(1,Math.abs(g),Math.abs(k))&&Math.abs(m-R)<=n.b*Math.max(1,Math.abs(m),Math.abs(R))&&Math.abs(y-L)<=n.b*Math.max(1,Math.abs(y),Math.abs(L))}},function(t,e,r){"use strict";var n=r(276);e.a=new n.a({id:"deck"})},function(t,e,r){"use strict";r.d(e,"f",(function(){return o})),r.d(e,"h",(function(){return a})),r.d(e,"g",(function(){return s})),r.d(e,"d",(function(){return u})),r.d(e,"a",(function(){return c})),r.d(e,"e",(function(){return l})),r.d(e,"j",(function(){return h})),r.d(e,"b",(function(){return f})),r.d(e,"c",(function(){return p})),r.d(e,"i",(function(){return d})),r.d(e,"k",(function(){return A}));const n=t=>"boolean"==typeof t,i=t=>"function"==typeof t,o=t=>null!==t&&"object"==typeof t,a=t=>o(t)&&t.constructor==={}.constructor,s=t=>o(t)&&i(t.then),u=t=>t&&"function"==typeof t[Symbol.iterator],c=t=>t&&"function"==typeof t[Symbol.asyncIterator],l=t=>t&&i(t.next),h=t=>"undefined"!=typeof Response&&t instanceof Response||t&&t.arrayBuffer&&t.text&&t.json,f=t=>"undefined"!=typeof Blob&&t instanceof Blob,p=t=>t&&"object"==typeof t&&t.isBuffer,d=t=>(t=>"undefined"!=typeof ReadableStream&&t instanceof ReadableStream||o(t)&&i(t.tee)&&i(t.cancel)&&i(t.getReader))(t)||(t=>o(t)&&i(t.read)&&i(t.pipe)&&n(t.readable))(t),A=t=>(t=>o(t)&&i(t.abort)&&i(t.getWriter))(t)||(t=>o(t)&&i(t.end)&&i(t.write)&&n(t.writable))(t)},function(t,e,r){"use strict";var n={};function i(t){const e=t&&t.lastIndexOf("/");return e>=0?t.substr(0,e):""}function o(...t){return(t=t.map((e,r)=>(r&&(e=e.replace(new RegExp("^/"),"")),r!==t.length-1&&(e=e.replace(new RegExp("/$"),"")),e))).join("/")}r.r(n),r.d(n,"dirname",(function(){return i})),r.d(n,"join",(function(){return o}));var a=r(210);r.d(e,"b",(function(){return n})),r.d(e,"a",(function(){return a}))},function(t,e,r){"use strict";r.d(e,"c",(function(){return i})),r.d(e,"h",(function(){return o})),r.d(e,"f",(function(){return a})),r.d(e,"a",(function(){return s})),r.d(e,"k",(function(){return u})),r.d(e,"l",(function(){return c})),r.d(e,"e",(function(){return l})),r.d(e,"d",(function(){return h})),r.d(e,"i",(function(){return f})),r.d(e,"s",(function(){return p})),r.d(e,"r",(function(){return d})),r.d(e,"t",(function(){return A})),r.d(e,"m",(function(){return g})),r.d(e,"n",(function(){return m})),r.d(e,"o",(function(){return y})),r.d(e,"b",(function(){return v})),r.d(e,"q",(function(){return b})),r.d(e,"j",(function(){return x})),r.d(e,"g",(function(){return w})),r.d(e,"p",(function(){return E}));var n=r(12);function i(){var t=new n.a(3);return n.a!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function o(t){var e=t[0],r=t[1],n=t[2];return Math.hypot(e,r,n)}function a(t,e,r){var i=new n.a(3);return i[0]=t,i[1]=e,i[2]=r,i}function s(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function u(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function c(t,e){var r=e[0],n=e[1],i=e[2],o=r*r+n*n+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function l(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function h(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[0],s=r[1],u=r[2];return t[0]=i*u-o*s,t[1]=o*a-n*u,t[2]=n*s-i*a,t}function f(t,e,r,n){var i=e[0],o=e[1],a=e[2];return t[0]=i+n*(r[0]-i),t[1]=o+n*(r[1]-o),t[2]=a+n*(r[2]-a),t}function p(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[3]*n+r[7]*i+r[11]*o+r[15];return a=a||1,t[0]=(r[0]*n+r[4]*i+r[8]*o+r[12])/a,t[1]=(r[1]*n+r[5]*i+r[9]*o+r[13])/a,t[2]=(r[2]*n+r[6]*i+r[10]*o+r[14])/a,t}function d(t,e,r){var n=e[0],i=e[1],o=e[2];return t[0]=n*r[0]+i*r[3]+o*r[6],t[1]=n*r[1]+i*r[4]+o*r[7],t[2]=n*r[2]+i*r[5]+o*r[8],t}function A(t,e,r){var n=r[0],i=r[1],o=r[2],a=r[3],s=e[0],u=e[1],c=e[2],l=i*c-o*u,h=o*s-n*c,f=n*u-i*s,p=i*f-o*h,d=o*l-n*f,A=n*h-i*l,g=2*a;return l*=g,h*=g,f*=g,p*=2,d*=2,A*=2,t[0]=s+l+p,t[1]=u+h+d,t[2]=c+f+A,t}function g(t,e,r,n){var i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[0],o[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),o[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function m(t,e,r,n){var i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),o[1]=i[1],o[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function y(t,e,r,n){var i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),o[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),o[2]=i[2],t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function v(t,e){var r=t[0],n=t[1],i=t[2],o=e[0],a=e[1],s=e[2],u=Math.sqrt(r*r+n*n+i*i)*Math.sqrt(o*o+a*a+s*s),c=u&&l(t,e)/u;return Math.acos(Math.min(Math.max(c,-1),1))}var _,b=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t},x=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t},w=o,E=function(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n};_=i()},function(t,e,r){"use strict";var n=r(28);function i(t,e){const r=n.n([],e,t);return n.k(r,r,1/r[3]),r}function o(t,e){const r=t%e;return r<0?e+r:r}const a=Math.log2||function(t){return Math.log(t)*Math.LOG2E};var s=r(17),u=r(27),c=r(21);function l(t,e){if(!t)throw new Error(e||"@math.gl/web-mercator: assertion failed.")}const h=Math.PI,f=h/4,p=h/180,d=180/h;function A(t){return Math.pow(2,t)}function g(t){return a(t)}function m([t,e]){l(Number.isFinite(t)),l(Number.isFinite(e)&&e>=-90&&e<=90,"invalid latitude");const r=e*p;return[512*(t*p+h)/(2*h),512*(h+Math.log(Math.tan(f+.5*r)))/(2*h)]}function y([t,e]){const r=t/512*(2*h)-h,n=2*(Math.atan(Math.exp(e/512*(2*h)-h))-f);return[r*d,n*d]}function v({latitude:t}){return l(Number.isFinite(t)),g(4003e4*Math.cos(t*p))-9}function _({latitude:t,longitude:e,highPrecision:r=!1}){l(Number.isFinite(t)&&Number.isFinite(e));const n={},i=Math.cos(t*p),o=512/360/i,a=512/4003e4/i;if(n.unitsPerMeter=[a,a,a],n.metersPerUnit=[1/a,1/a,1/a],n.unitsPerDegree=[512/360,o,a],n.degreesPerUnit=[.703125,1/o,1/a],r){const e=p*Math.tan(t*p)/i,r=512/360*e/2,s=512/4003e4*e,u=s/o*a;n.unitsPerDegree2=[0,r,s],n.unitsPerMeter2=[u,0,u]}return n}function b(t,e){const[r,n,i]=t,[o,a,s]=e,{unitsPerMeter:u,unitsPerMeter2:c}=_({longitude:r,latitude:n,highPrecision:!0}),l=m(t);l[0]+=o*(u[0]+c[0]*a),l[1]+=a*(u[1]+c[1]*a);const h=y(l),f=(i||0)+(s||0);return Number.isFinite(i)||Number.isFinite(s)?[h[0],h[1],f]:h}function x({height:t,pitch:e,bearing:r,altitude:n,scale:i,center:o=null}){const a=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return s.p(a,a,[0,0,-n]),s.l(a,a,-e*p),s.n(a,a,r*p),i/=t,s.o(a,a,[i,i,i]),o&&s.p(a,a,c.k([],o)),a}function w({width:t,height:e,fovy:r=E(1.5),altitude:n,pitch:i=0,nearZMultiplier:o=1,farZMultiplier:a=1}){void 0!==n&&(r=E(n));const s=.5*r*p,u=S(r),c=i*p,l=Math.sin(s)*u/Math.sin(Math.min(Math.max(Math.PI/2-c-s,.01),Math.PI-.01));return{fov:2*s,aspect:t/e,focalDistance:u,near:o,far:(Math.sin(c)*l+u)*a}}function E(t){return 2*Math.atan(.5/t)*d}function S(t){return.5/Math.tan(.5*t*p)}function O(t,e){const[r,n,o=0]=t;return l(Number.isFinite(r)&&Number.isFinite(n)&&Number.isFinite(o)),i(e,[r,n,o,1])}function T(t,e,r=0){const[n,o,a]=t;if(l(Number.isFinite(n)&&Number.isFinite(o),"invalid pixel coordinate"),Number.isFinite(a)){return i(e,[n,o,a,1])}const s=i(e,[n,o,0,1]),c=i(e,[n,o,1,1]),h=s[2],f=c[2],p=h===f?0:((r||0)-h)/(f-h);return u.c([],s,c,p)}function P({width:t,height:e,bounds:r,minExtent:n=0,maxZoom:i=24,padding:o=0,offset:s=[0,0]}){const[[u,c],[h,f]]=r;if(Number.isFinite(o)){o={top:o,bottom:o,left:o,right:o}}else l(Number.isFinite(o.top)&&Number.isFinite(o.bottom)&&Number.isFinite(o.left)&&Number.isFinite(o.right));const p=new k({width:t,height:e,longitude:0,latitude:0,zoom:0}),d=p.project([u,f]),A=p.project([h,c]),g=[Math.max(Math.abs(A[0]-d[0]),n),Math.max(Math.abs(A[1]-d[1]),n)],m=[t-o.left-o.right-2*Math.abs(s[0]),e-o.top-o.bottom-2*Math.abs(s[1])];l(m[0]>0&&m[1]>0);const y=m[0]/g[0],v=m[1]/g[1],_=(o.right-o.left)/2/y,b=(o.bottom-o.top)/2/v,x=[(A[0]+d[0])/2+_,(A[1]+d[1])/2+b],w=p.unproject(x),E=Math.min(i,p.zoom+a(Math.abs(Math.min(y,v))));return l(Number.isFinite(E)),{longitude:w[0],latitude:w[1],zoom:E}}const M=Math.PI/180;function C(t,e=0){const{width:r,height:n,unproject:i}=t,o={targetZ:e},a=i([0,n],o),s=i([r,n],o);let u,c;return(t.fovy?.5*t.fovy*M:Math.atan(.5/t.altitude))>(90-t.pitch)*M-.01?(u=I(t,0,e),c=I(t,r,e)):(u=i([0,0],o),c=i([r,0],o)),[a,s,c,u]}function I(t,e,r){const{pixelUnprojectionMatrix:n}=t,o=i(n,[e,0,1,1]),a=i(n,[e,t.height,1,1]),s=(r*t.distanceScales.unitsPerMeter[2]-o[2])/(a[2]-o[2]),c=y(u.c([],o,a,s));return c[2]=r,c}class k{constructor({width:t,height:e,latitude:r=0,longitude:n=0,zoom:i=0,pitch:o=0,bearing:a=0,altitude:u=null,fovy:l=null,position:h=null,nearZMultiplier:f=.02,farZMultiplier:p=1.01}={width:1,height:1}){t=t||1,e=e||1,null===l&&null===u?l=E(u=1.5):null===l?l=E(u):null===u&&(u=S(l));const d=A(i);u=Math.max(.75,u);const g=_({longitude:n,latitude:r}),y=m([n,r]);y[2]=0,h&&c.a(y,y,c.j([],h,g.unitsPerMeter)),this.projectionMatrix=function({width:t,height:e,pitch:r,altitude:n,fovy:i,nearZMultiplier:o,farZMultiplier:a}){const{fov:u,aspect:c,near:l,far:h}=w({width:t,height:e,altitude:n,fovy:i,pitch:r,nearZMultiplier:o,farZMultiplier:a});return s.j([],u,c,l,h)}({width:t,height:e,pitch:o,fovy:l,nearZMultiplier:f,farZMultiplier:p}),this.viewMatrix=x({height:e,scale:d,center:y,pitch:o,bearing:a,altitude:u}),this.width=t,this.height=e,this.scale=d,this.latitude=r,this.longitude=n,this.zoom=i,this.pitch=o,this.bearing=a,this.altitude=u,this.fovy=l,this.center=y,this.meterOffset=h||[0,0,0],this.distanceScales=g,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)}_initMatrices(){const{width:t,height:e,projectionMatrix:r,viewMatrix:n}=this,i=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];s.h(i,i,r),s.h(i,i,n),this.viewProjectionMatrix=i;const o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];s.o(o,o,[t/2,-e/2,1]),s.p(o,o,[1,-1,0]),s.h(o,o,i);const a=s.f([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],o);if(!a)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=o,this.pixelUnprojectionMatrix=a}equals(t){return t instanceof k&&(t.width===this.width&&t.height===this.height&&s.b(t.projectionMatrix,this.projectionMatrix)&&s.b(t.viewMatrix,this.viewMatrix))}project(t,{topLeft:e=!0}={}){const r=O(this.projectPosition(t),this.pixelProjectionMatrix),[n,i]=r,o=e?i:this.height-i;return 2===t.length?[n,o]:[n,o,r[2]]}unproject(t,{topLeft:e=!0,targetZ:r}={}){const[n,i,o]=t,a=e?i:this.height-i,s=r&&r*this.distanceScales.unitsPerMeter[2],u=T([n,a,o],this.pixelUnprojectionMatrix,s),[c,l,h]=this.unprojectPosition(u);return Number.isFinite(o)?[c,l,h]:Number.isFinite(r)?[c,l,r]:[c,l]}projectPosition(t){const[e,r]=m(t);return[e,r,(t[2]||0)*this.distanceScales.unitsPerMeter[2]]}unprojectPosition(t){const[e,r]=y(t);return[e,r,(t[2]||0)*this.distanceScales.metersPerUnit[2]]}projectFlat(t){return m(t)}unprojectFlat(t){return y(t)}getMapCenterByLngLatPosition({lngLat:t,pos:e}){const r=T(e,this.pixelUnprojectionMatrix),n=m(t),i=u.a([],n,u.d([],r));return y(u.a([],this.center,i))}getLocationAtPoint({lngLat:t,pos:e}){return this.getMapCenterByLngLatPosition({lngLat:t,pos:e})}fitBounds(t,e={}){const{width:r,height:n}=this,{longitude:i,latitude:o,zoom:a}=P(Object.assign({width:r,height:n,bounds:t},e));return new k({width:r,height:n,longitude:i,latitude:o,zoom:a})}getBounds(t){const e=this.getBoundingRegion(t),r=Math.min(...e.map(t=>t[0])),n=Math.max(...e.map(t=>t[0]));return[[r,Math.min(...e.map(t=>t[1]))],[n,Math.max(...e.map(t=>t[1]))]]}getBoundingRegion(t={}){return C(this,t.z||0)}}function R({width:t,height:e,longitude:r,latitude:n,zoom:i,pitch:s=0,bearing:u=0}){(r<-180||r>180)&&(r=o(r+180,360)-180),(u<-180||u>180)&&(u=o(u+180,360)-180);let c=new k({width:t,height:e,longitude:r,latitude:n,zoom:i}),l=c.project([r,85.05113])[1],h=c.project([r,-85.05113])[1],f=0;return h-l<e&&(i+=a(e/(h-l)),c=new k({width:t,height:e,longitude:r,latitude:n,zoom:i}),l=c.project([r,85.05113])[1],h=c.project([r,-85.05113])[1]),l>0?f=l:h<e&&(f=h-e),f&&(n=c.unproject([t/2,e/2+f])[1]),{width:t,height:e,longitude:r,latitude:n,zoom:i,pitch:s,bearing:u}}const L=["longitude","latitude","zoom"],j={curve:1.414,speed:1.2};function D(t,e,r,n={}){const i={},{startZoom:o,startCenterXY:a,uDelta:s,w0:c,u1:l,S:h,rho:f,rho2:p,r0:d}=F(t,e,n);if(l<.01){for(const n of L){const o=t[n],a=e[n];i[n]=(A=r)*a+(1-A)*o}return i}var A;const m=r*h,v=Math.cosh(d)/Math.cosh(d+f*m),_=c*((Math.cosh(d)*Math.tanh(d+f*m)-Math.sinh(d))/p)/l,b=o+g(1/v),x=u.e([],s,_);u.a(x,x,a);const w=y(x);return i.longitude=w[0],i.latitude=w[1],i.zoom=b,i}function B(t,e,r={}){r=Object.assign({},j,r);const{screenSpeed:n,speed:i,maxDuration:o}=r,{S:a,rho:s}=F(t,e,r),u=1e3*a;let c;return c=Number.isFinite(n)?u/(n/s):u/i,Number.isFinite(o)&&c>o?0:c}function F(t,e,r){const n=(r=Object.assign({},j,r)).curve,i=t.zoom,o=[t.longitude,t.latitude],a=A(i),s=e.zoom,c=[e.longitude,e.latitude],l=A(s-i),h=m(o),f=m(c),p=u.f([],f,h),d=Math.max(t.width,t.height),g=d/l,y=u.b(p)*a,v=Math.max(y,.01),_=n*n,b=(g*g-d*d+_*_*v*v)/(2*d*_*v),x=(g*g-d*d-_*_*v*v)/(2*g*_*v),w=Math.log(Math.sqrt(b*b+1)-b),E=Math.log(Math.sqrt(x*x+1)-x);return{startZoom:i,startCenterXY:h,uDelta:p,w0:d,u1:y,S:(E-w)/n,rho:n,rho2:_,r0:w,r1:E}}r.d(e,"f",(function(){return C})),r.d(e,"c",(function(){return P})),r.d(e,"m",(function(){return R})),r.d(e,"d",(function(){return D})),r.d(e,"h",(function(){return B})),r.d(e,"l",(function(){return m})),r.d(e,"o",(function(){return y})),r.d(e,"p",(function(){return O})),r.d(e,"n",(function(){return T})),r.d(e,"b",(function(){return E})),r.d(e,"e",(function(){return S})),r.d(e,"i",(function(){return v})),r.d(e,"g",(function(){return _})),r.d(e,"a",(function(){return b})),r.d(e,"k",(function(){return x})),r.d(e,"j",(function(){return w}))},function(t,e,r){"use strict";r.d(e,"a",(function(){return i})),r.d(e,"b",(function(){return o})),r.d(e,"c",(function(){return s}));var n=r(13);function i(t){if(!Number.isFinite(t))throw new Error(`Invalid number ${t}`);return t}function o(t,e,r=""){if(n.b.debug&&!function(t,e){if(t.length!==e)return!1;for(let e=0;e<t.length;++e)if(!Number.isFinite(t[e]))return!1;return!0}(t,e))throw new Error(`math.gl: ${r} some fields set to invalid numbers'`);return t}const a={};function s(t,e){a[t]||(a[t]=!0,console.warn(`${t} has been removed in version ${e}, see upgrade guide for more information`))}},function(t,e){function r(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=r=function(t){return typeof t}:t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(e)}t.exports=r},function(t,e,r){"use strict";(function(t){var n=r(13),i=r(147);r.d(e,"b",(function(){return i.a}));var o=r(205);r.d(e,"a",(function(){return o.a})),r.d(e,"e",(function(){return n.d})),r.d(e,"d",(function(){return n.a})),r.d(e,"f",(function(){return n.g}));var a=r(143);r.d(e,"c",(function(){return a.a}));const s={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==t&&t};(s.global||s.self||s.window).mathgl={config:n.b}}).call(this,r(65))},function(t,e,r){t.exports=r(253)},function(t,e,r){"use strict";r.d(e,"a",(function(){return i})),r.d(e,"e",(function(){return o})),r.d(e,"b",(function(){return a})),r.d(e,"d",(function(){return s})),r.d(e,"c",(function(){return u})),r.d(e,"g",(function(){return c})),r.d(e,"h",(function(){return l})),r.d(e,"i",(function(){return h})),r.d(e,"j",(function(){return f})),r.d(e,"f",(function(){return A}));var n=r(12);function i(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function o(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function a(t){var e=t[0],r=t[1];return Math.hypot(e,r)}function s(t,e){return t[0]=-e[0],t[1]=-e[1],t}function u(t,e,r,n){var i=e[0],o=e[1];return t[0]=i+n*(r[0]-i),t[1]=o+n*(r[1]-o),t}function c(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t}function l(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5],t}function h(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t}function f(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t}var p,d,A=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t};p=new n.a(2),n.a!=Float32Array&&(p[0]=0,p[1]=0),d=p},function(t,e,r){"use strict";r.d(e,"b",(function(){return i})),r.d(e,"g",(function(){return o})),r.d(e,"c",(function(){return a})),r.d(e,"l",(function(){return s})),r.d(e,"a",(function(){return u})),r.d(e,"k",(function(){return c})),r.d(e,"h",(function(){return l})),r.d(e,"m",(function(){return h})),r.d(e,"j",(function(){return f})),r.d(e,"d",(function(){return p})),r.d(e,"i",(function(){return d})),r.d(e,"n",(function(){return A})),r.d(e,"o",(function(){return g})),r.d(e,"f",(function(){return m})),r.d(e,"e",(function(){return y}));var n=r(12);function i(t){var e=new n.a(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function o(t,e,r,i){var o=new n.a(4);return o[0]=t,o[1]=e,o[2]=r,o[3]=i,o}function a(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function s(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}function u(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function c(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function l(t){var e=t[0],r=t[1],n=t[2],i=t[3];return Math.hypot(e,r,n,i)}function h(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i}function f(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r*r+n*n+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=r*a,t[1]=n*a,t[2]=i*a,t[3]=o*a,t}function p(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function d(t,e,r,n){var i=e[0],o=e[1],a=e[2],s=e[3];return t[0]=i+n*(r[0]-i),t[1]=o+n*(r[1]-o),t[2]=a+n*(r[2]-a),t[3]=s+n*(r[3]-s),t}function A(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*a,t[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*a,t[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*a,t[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*a,t}function g(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[0],s=r[1],u=r[2],c=r[3],l=c*n+s*o-u*i,h=c*i+u*n-a*o,f=c*o+a*i-s*n,p=-a*n-s*i-u*o;return t[0]=l*c+p*-a+h*-u-f*-s,t[1]=h*c+p*-s+f*-a-l*-u,t[2]=f*c+p*-u+l*-s-h*-a,t[3]=e[3],t}function m(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function y(t,e){var r=t[0],i=t[1],o=t[2],a=t[3],s=e[0],u=e[1],c=e[2],l=e[3];return Math.abs(r-s)<=n.b*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-u)<=n.b*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(o-c)<=n.b*Math.max(1,Math.abs(o),Math.abs(c))&&Math.abs(a-l)<=n.b*Math.max(1,Math.abs(a),Math.abs(l))}var v,_;v=new n.a(4),n.a!=Float32Array&&(v[0]=0,v[1]=0,v[2]=0,v[3]=0),_=v},function(t,e,r){t.exports=r(264)()},,function(t,e,r){"use strict";r.d(e,"d",(function(){return i})),r.d(e,"e",(function(){return o})),r.d(e,"c",(function(){return a})),r.d(e,"b",(function(){return s})),r.d(e,"a",(function(){return u}));var n=r(36);function i(t){return"undefined"!=typeof WebGLRenderingContext&&t instanceof WebGLRenderingContext||("undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||Boolean(t&&Number.isFinite(t._version)))}function o(t){return"undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||Boolean(t&&2===t._version)}function a(t){return o(t)?t:null}function s(t){return Object(n.a)(i(t),"Invalid WebGLRenderingContext"),t}function u(t){return Object(n.a)(o(t),"Requires WebGL2"),t}},function(t,e,r){"use strict";r.d(e,"b",(function(){return o})),r.d(e,"a",(function(){return a}));var n=r(18),i={};function o(t){i=t}function a(t){var e;n.a.level>0&&i[t]&&(e=i[t]).call.apply(e,arguments)}},function(t,e,r){"use strict";r.d(e,"a",(function(){return n})),r.d(e,"b",(function(){return i}));var n={NO_STATE:"Awaiting state",MATCHED:"Matched. State transferred from previous layer",INITIALIZED:"Initialized",AWAITING_GC:"Discarded. Awaiting garbage collection",AWAITING_FINALIZATION:"No longer matched. Awaiting garbage collection",FINALIZED:"Finalized! Awaiting garbage collection"},i={COMPONENT:Symbol.for("component"),ASYNC_DEFAULTS:Symbol.for("asyncPropDefaults"),ASYNC_ORIGINAL:Symbol.for("asyncPropOriginal"),ASYNC_RESOLVED:Symbol.for("asyncPropResolved")}},function(t,e,r){"use strict";r.d(e,"a",(function(){return f}));var n=r(39),i=r(64),o=r(54),a=r(7),s=r(9),u=r(133);const c={offset:"accessor.offset",stride:"accessor.stride",type:"accessor.type",size:"accessor.size",divisor:"accessor.divisor",normalized:"accessor.normalized",integer:"accessor.integer",instanced:"accessor.divisor",isInstanced:"accessor.divisor"},l={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:c},h={removedProps:c};class f extends n.a{constructor(t,e={}){super(t,e),this.stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),this.target=e.target||(this.gl.webgl2?36662:34962),this.initialize(e),Object.seal(this)}getElementCount(t=this.accessor){return Math.round(this.byteLength/i.a.getBytesPerElement(t))}getVertexCount(t=this.accessor){return Math.round(this.byteLength/i.a.getBytesPerVertex(t))}initialize(t={}){return ArrayBuffer.isView(t)&&(t={data:t}),Number.isFinite(t)&&(t={byteLength:t}),t=Object(u.a)("Buffer",t,l),this.usage=t.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},t,t.accessor)),t.data?this._setData(t.data,t.offset,t.byteLength):this._setByteLength(t.byteLength||0),this}setProps(t){return"accessor"in(t=Object(u.a)("Buffer",t,h))&&this.setAccessor(t.accessor),this}setAccessor(t){return delete(t=Object.assign({},t)).buffer,this.accessor=new i.a(t),this}reallocate(t){return t>this.byteLength?(this._setByteLength(t),!0):(this.bytesUsed=t,!1)}setData(t){return this.initialize(t)}subData(t){ArrayBuffer.isView(t)&&(t={data:t});const{data:e,offset:r=0,srcOffset:n=0}=t,i=t.byteLength||t.length;Object(s.a)(e);const o=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(o,this.handle),0!==n||void 0!==i?(Object(a.a)(this.gl),this.gl.bufferSubData(this.target,r,e,n,i)):this.gl.bufferSubData(o,r,e),this.gl.bindBuffer(o,null),this.debugData=null,this._inferType(e),this}copyData({sourceBuffer:t,readOffset:e=0,writeOffset:r=0,size:n}){const{gl:i}=this;return Object(a.a)(i),i.bindBuffer(36662,t.handle),i.bindBuffer(36663,this.handle),i.copyBufferSubData(36662,36663,e,r,n),i.bindBuffer(36662,null),i.bindBuffer(36663,null),this.debugData=null,this}getData({dstData:t=null,srcByteOffset:e=0,dstOffset:r=0,length:n=0}={}){Object(a.a)(this.gl);const i=Object(o.c)(this.accessor.type||5126,{clamped:!1}),u=this._getAvailableElementCount(e),c=r;let l,h;t?(h=t.length,l=h-c):(l=Math.min(u,n||u),h=c+l);const f=Math.min(u,l);return n=n||f,Object(s.a)(n<=f),t=t||new i(h),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,e,t,r,n),this.gl.bindBuffer(36662,null),t}bind({target:t=this.target,index:e=this.accessor&&this.accessor.index,offset:r=0,size:n}={}){return 35345===t||35982===t?void 0!==n?this.gl.bindBufferRange(t,e,this.handle,r,n):(Object(s.a)(0===r),this.gl.bindBufferBase(t,e,this.handle)):this.gl.bindBuffer(t,this.handle),this}unbind({target:t=this.target,index:e=this.accessor&&this.accessor.index}={}){return 35345===t||35982===t?this.gl.bindBufferBase(t,e,null):this.gl.bindBuffer(t,null),this}getDebugData(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:Math.min(10,this.byteLength)}),{data:this.debugData,changed:!0})}invalidateDebugData(){this.debugData=null}_setData(t,e=0,r=t.byteLength+e){Object(s.a)(ArrayBuffer.isView(t)),this._trackDeallocatedMemory();const n=this._getTarget();this.gl.bindBuffer(n,this.handle),this.gl.bufferData(n,r,this.usage),this.gl.bufferSubData(n,e,t),this.gl.bindBuffer(n,null),this.debugData=t.slice(0,10),this.bytesUsed=r,this._trackAllocatedMemory(r);const a=Object(o.b)(t);return Object(s.a)(a),this.setAccessor(new i.a(this.accessor,{type:a})),this}_setByteLength(t,e=this.usage){Object(s.a)(t>=0),this._trackDeallocatedMemory();let r=t;0===t&&(r=new Float32Array(0));const n=this._getTarget();return this.gl.bindBuffer(n,this.handle),this.gl.bufferData(n,r,e),this.gl.bindBuffer(n,null),this.usage=e,this.debugData=null,this.bytesUsed=t,this._trackAllocatedMemory(t),this}_getTarget(){return this.gl.webgl2?36663:this.target}_getAvailableElementCount(t){const e=t/Object(o.c)(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-e}_inferType(t){this.accessor.type||this.setAccessor(new i.a(this.accessor,{type:Object(o.b)(t)}))}_createHandle(){return this.gl.createBuffer()}_deleteHandle(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}_getParameter(t){this.gl.bindBuffer(this.target,this.handle);const e=this.gl.getBufferParameter(this.target,t);return this.gl.bindBuffer(this.target,null),e}get type(){return a.k.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}get bytes(){return a.k.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}setByteLength(t){return a.k.deprecated("setByteLength","reallocate")(),this.reallocate(t)}updateAccessor(t){return a.k.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new i.a(this.accessor,t),this}}},function(t,e,r){"use strict";r.d(e,"a",(function(){return o})),r.d(e,"e",(function(){return a})),r.d(e,"c",(function(){return s})),r.d(e,"d",(function(){return u})),r.d(e,"b",(function(){return f})),r.d(e,"f",(function(){return p}));var n=r(67),i=r(11);function o(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function a(t,e){var r=t%e;return r<0?e+r:r}function s(t){return[t[12],t[13],t[14]]}function u(t){var e={};return e.left=h(t[3]+t[0],t[7]+t[4],t[11]+t[8],t[15]+t[12]),e.right=h(t[3]-t[0],t[7]-t[4],t[11]-t[8],t[15]-t[12]),e.bottom=h(t[3]+t[1],t[7]+t[5],t[11]+t[9],t[15]+t[13]),e.top=h(t[3]-t[1],t[7]-t[5],t[11]-t[9],t[15]-t[13]),e.near=h(t[3]+t[2],t[7]+t[6],t[11]+t[10],t[15]+t[14]),e.far=h(t[3]-t[2],t[7]-t[6],t[11]-t[10],t[15]-t[14]),e}var c,l=new i.b;function h(t,e,r,n){l.set(t,e,r);var o=l.len();return{distance:n/o,normal:new i.b(-t/o,-e/o,-r/o)}}function f(t){return t-Math.fround(t)}function p(t,e){var r=e.size,i=void 0===r?1:r,o=e.startIndex,a=void 0===o?0:o,s=e.endIndex;Number.isFinite(s)||(s=t.length);var u=(s-a)/i;c=n.a.allocate(c,u,{type:Float32Array,size:2*i});for(var l=a,h=0;l<s;){for(var p=0;p<i;p++){var d=t[l++];c[h+p]=d,c[h+p+i]=f(d)}h+=2*i}return c.subarray(0,u*i*2)}},function(t,e,r){"use strict";function n(t,e){if(!t)throw new Error(e||"luma.gl: assertion failed.")}r.d(e,"a",(function(){return n}))},function(t,e,r){"use strict";function n(t,e){if(!t)throw new Error(e||"deck.gl: assertion failed.")}r.d(e,"a",(function(){return n}))},function(t,e,r){"use strict";r(13);const n={CLOCKWISE:1,COUNTER_CLOCKWISE:-1};function i(t,e,r={}){return function(t,e={}){return Math.sign(o(t,e))}(t,r)!==e&&(function(t,e){const{start:r=0,end:n=t.length,size:i=2}=e,o=(n-r)/i,a=Math.floor(o/2);for(let e=0;e<a;++e){const n=r+e*i,a=r+(o-1-e)*i;for(let e=0;e<i;++e){const r=t[n+e];t[n+e]=t[a+e],t[a+e]=r}}}(t,r),!0)}function o(t,e={}){const{start:r=0,end:n=t.length}=e,i=e.size||2;let o=0;for(let e=r,a=n-i;e<n;e+=i)o+=(t[e]-t[a])*(t[e+1]+t[a+1]),a=e;return o/2}function a(t,e,r,n){r=r||2;const i=e&&e.length,o=i?e[0]*r:t.length;let a=s(t,0,o,r,!0,n&&n[0]);const l=[];if(!a||a.next===a.prev)return l;let h,f,p,g,m,v,_;if(i&&(a=function(t,e,r,n,i){const o=[];let a,c,l,h,f;for(a=0,c=e.length;a<c;a++)l=e[a]*n,h=a<c-1?e[a+1]*n:t.length,f=s(t,l,h,n,!1,i&&i[a+1]),f===f.next&&(f.steiner=!0),o.push(y(f));for(o.sort(d),a=0;a<o.length;a++)A(o[a],r),r=u(r,r.next);return r}(t,e,a,r,n)),t.length>80*r){g=f=t[0],m=p=t[1];for(let e=r;e<o;e+=r)v=t[e],_=t[e+1],v<g&&(g=v),_<m&&(m=_),v>f&&(f=v),_>p&&(p=_);h=Math.max(f-g,p-m),h=0!==h?1/h:0}return c(a,l,r,g,m,h),l}function s(t,e,r,n,i,a){let s,u;if(void 0===a&&(a=o(t,{start:e,end:r,size:n})),i===a<0)for(s=e;s<r;s+=n)u=P(s,t[s],t[s+1],u);else for(s=r-n;s>=e;s-=n)u=P(s,t[s],t[s+1],u);return u&&x(u,u.next)&&(M(u),u=u.next),u}function u(t,e){if(!t)return t;e||(e=t);let r,n=t;do{if(r=!1,n.steiner||!x(n,n.next)&&0!==b(n.prev,n,n.next))n=n.next;else{if(M(n),n=e=n.prev,n===n.next)break;r=!0}}while(r||n!==e);return e}function c(t,e,r,n,i,o,a){if(!t)return;!a&&o&&function(t,e,r,n){let i=t;do{null===i.z&&(i.z=m(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){let e,r,n,i,o,a,s,u,c=1;do{for(i=t,t=null,u=null,n=0;i;){for(n++,a=i,o=0,r=0;r<c&&(o++,a=a.nextZ,a);r++);for(s=c;o>0||s>0&&a;)0!==o&&(0===s||!a||i.z<=a.z)?(e=i,i=i.nextZ,o--):(e=a,a=a.nextZ,s--),u?u.nextZ=e:t=e,e.prevZ=u,u=e;i=a}u.nextZ=null,c*=2}while(n>1)}(i)}(t,n,i,o);let s,d,A=t;for(;t.prev!==t.next;)if(s=t.prev,d=t.next,o?h(t,n,i,o):l(t))e.push(s.i/r),e.push(t.i/r),e.push(d.i/r),M(t),t=d.next,A=d.next;else if((t=d)===A){a?1===a?c(t=f(u(t),e,r),e,r,n,i,o,2):2===a&&p(t,e,r,n,i,o):c(u(t),e,r,n,i,o,1);break}}function l(t){const e=t.prev,r=t,n=t.next;if(b(e,r,n)>=0)return!1;let i=t.next.next;for(;i!==t.prev;){if(v(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&b(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function h(t,e,r,n){const i=t.prev,o=t,a=t.next;if(b(i,o,a)>=0)return!1;const s=i.x<o.x?i.x<a.x?i.x:a.x:o.x<a.x?o.x:a.x,u=i.y<o.y?i.y<a.y?i.y:a.y:o.y<a.y?o.y:a.y,c=i.x>o.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,l=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,h=m(s,u,e,r,n),f=m(c,l,e,r,n);let p=t.prevZ,d=t.nextZ;for(;p&&p.z>=h&&d&&d.z<=f;){if(p!==t.prev&&p!==t.next&&v(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&b(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,d!==t.prev&&d!==t.next&&v(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&b(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(;p&&p.z>=h;){if(p!==t.prev&&p!==t.next&&v(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&b(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;d&&d.z<=f;){if(d!==t.prev&&d!==t.next&&v(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&b(d.prev,d,d.next)>=0)return!1;d=d.nextZ}return!0}function f(t,e,r){let n=t;do{const i=n.prev,o=n.next.next;!x(i,o)&&w(i,n,n.next,o)&&O(i,o)&&O(o,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(o.i/r),M(n),M(n.next),n=t=o),n=n.next}while(n!==t);return u(n)}function p(t,e,r,n,i,o){let a=t;do{let t=a.next.next;for(;t!==a.prev;){if(a.i!==t.i&&_(a,t)){let s=T(a,t);return a=u(a,a.next),s=u(s,s.next),c(a,e,r,n,i,o),void c(s,e,r,n,i,o)}t=t.next}a=a.next}while(a!==t)}function d(t,e){return t.x-e.x}function A(t,e){if(e=function(t,e){let r=e;const n=t.x,i=t.y;let o,a=-1/0;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){const t=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(t<=n&&t>a){if(a=t,t===n){if(i===r.y)return r;if(i===r.next.y)return r.next}o=r.x<r.next.x?r:r.next}}r=r.next}while(r!==e);if(!o)return null;if(n===a)return o;const s=o,u=o.x,c=o.y;let l,h=1/0;r=o;do{n>=r.x&&r.x>=u&&n!==r.x&&v(i<c?n:a,i,u,c,i<c?a:n,i,r.x,r.y)&&(l=Math.abs(i-r.y)/(n-r.x),O(r,t)&&(l<h||l===h&&(r.x>o.x||r.x===o.x&&g(o,r)))&&(o=r,h=l)),r=r.next}while(r!==s);return o}(t,e)){const r=T(e,t);u(e,e.next),u(r,r.next)}}function g(t,e){return b(t.prev,t,e.prev)<0&&b(e.next,t,t.next)<0}function m(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function y(t){let e=t,r=t;do{(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next}while(e!==t);return r}function v(t,e,r,n,i,o,a,s){return(i-a)*(e-s)-(t-a)*(o-s)>=0&&(t-a)*(n-s)-(r-a)*(e-s)>=0&&(r-a)*(o-s)-(i-a)*(n-s)>=0}function _(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&w(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(O(t,e)&&O(e,t)&&function(t,e){let r=t,n=!1;const i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(b(t.prev,t,e.prev)||b(t,e.prev,e))||x(t,e)&&b(t.prev,t,t.next)>0&&b(e.prev,e,e.next)>0)}function b(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function x(t,e){return t.x===e.x&&t.y===e.y}function w(t,e,r,n){const i=S(b(t,e,r)),o=S(b(t,e,n)),a=S(b(r,n,t)),s=S(b(r,n,e));return i!==o&&a!==s||(!(0!==i||!E(t,r,e))||(!(0!==o||!E(t,n,e))||(!(0!==a||!E(r,t,n))||!(0!==s||!E(r,e,n)))))}function E(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function S(t){return t>0?1:t<0?-1:0}function O(t,e){return b(t.prev,t,t.next)<0?b(t,e,t.next)>=0&&b(t,t.prev,e)>=0:b(t,e,t.prev)<0||b(t,t.next,e)<0}function T(t,e){const r=new C(t.i,t.x,t.y),n=new C(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function P(t,e,r,n){const i=new C(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function M(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function C(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function I(t,e){const r=e.length,n=t.length;if(n>0){let i=!0;for(let o=0;o<r;o++)if(t[n-r+o]!==e[o]){i=!1;break}if(i)return!1}for(let i=0;i<r;i++)t[n+i]=e[i];return!0}function k(t,e){const r=e.length;for(let n=0;n<r;n++)t[n]=e[n]}function R(t,e,r,n,i=[]){const o=n+e*r;for(let e=0;e<r;e++)i[e]=t[o+e];return i}function L(t,e,r,n,i=[]){let o,a;if(8&r)o=(n[3]-t[1])/(e[1]-t[1]),a=3;else if(4&r)o=(n[1]-t[1])/(e[1]-t[1]),a=1;else if(2&r)o=(n[2]-t[0])/(e[0]-t[0]),a=2;else{if(!(1&r))return null;o=(n[0]-t[0])/(e[0]-t[0]),a=0}for(let r=0;r<t.length;r++)i[r]=(1&a)===r?n[a]:o*(e[r]-t[r])+t[r];return i}function j(t,e){let r=0;return t[0]<e[0]?r|=1:t[0]>e[2]&&(r|=2),t[1]<e[1]?r|=4:t[1]>e[3]&&(r|=8),r}function D(t,e={}){const{size:r=2,broken:n=!1,gridResolution:i=10,gridOffset:o=[0,0],startIndex:a=0,endIndex:s=t.length}=e,u=(s-a)/r;let c=[];const l=[c],h=R(t,0,r,a);let f,p;const d=N(h,i,o,[]),A=[];I(c,h);for(let e=1;e<u;e++){for(f=R(t,e,r,a,f),p=j(f,d);p;){L(h,f,p,d,A);const t=j(A,d);t&&(L(h,A,t,d,A),p=t),I(c,A),k(h,A),U(d,i,p),n&&c.length>r&&(c=[],l.push(c),I(c,h)),p=j(f,d)}I(c,f),k(h,f)}return n?l:l[0]}function B(t,e){for(let r=0;r<e.length;r++)t.push(e[r]);return t}function F(t,e,r={}){if(!t.length)return[];const{size:n=2,gridResolution:i=10,gridOffset:o=[0,0],edgeTypes:a=!1}=r,s=[],u=[{pos:t,types:a&&new Array(t.length/n).fill(1),holes:e||[]}],c=[[],[]];let l=[];for(;u.length;){const{pos:t,types:e,holes:r}=u.shift();V(t,n,r[0]||t.length,c),l=N(c[0],i,o,l);const h=j(c[1],l);if(h){let i=z(t,e,n,0,r[0]||t.length,l,h);const o={pos:i[0].pos,types:i[0].types,holes:[]},s={pos:i[1].pos,types:i[1].types,holes:[]};u.push(o,s);for(let u=0;u<r.length;u++)i=z(t,e,n,r[u],r[u+1]||t.length,l,h),i[0]&&(o.holes.push(o.pos.length),o.pos=B(o.pos,i[0].pos),a&&(o.types=B(o.types,i[0].types))),i[1]&&(s.holes.push(s.pos.length),s.pos=B(s.pos,i[1].pos),a&&(s.types=B(s.types,i[1].types)))}else{const n={positions:t};a&&(n.edgeTypes=e),r.length&&(n.holeIndices=r),s.push(n)}}return s}function z(t,e,r,n,i,o,a){const s=(i-n)/r,u=[],c=[],l=[],h=[],f=[];let p,d,A;const g=R(t,s-1,r,n);let m=Math.sign(8&a?g[1]-o[3]:g[0]-o[2]),y=e&&e[s-1],v=0,_=0;for(let i=0;i<s;i++)p=R(t,i,r,n,p),d=Math.sign(8&a?p[1]-o[3]:p[0]-o[2]),A=e&&e[n/r+i],d&&m&&m!==d&&(L(g,p,a,o,f),I(u,f)&&l.push(y),I(c,f)&&h.push(y)),d<=0?(I(u,p)&&l.push(A),v-=d):l.length&&(l[l.length-1]=0),d>=0?(I(c,p)&&h.push(A),_+=d):h.length&&(h[h.length-1]=0),k(g,p),m=d,y=A;return[v?{pos:u,types:e&&l}:null,_?{pos:c,types:e&&h}:null]}function N(t,e,r,n){const i=Math.floor((t[0]-r[0])/e)*e+r[0],o=Math.floor((t[1]-r[1])/e)*e+r[1];return n[0]=i,n[1]=o,n[2]=i+e,n[3]=o+e,n}function U(t,e,r){8&r?(t[1]+=e,t[3]+=e):4&r?(t[1]-=e,t[3]-=e):2&r?(t[0]+=e,t[2]+=e):1&r&&(t[0]-=e,t[2]-=e)}function V(t,e,r,n){let i=1/0,o=-1/0,a=1/0,s=-1/0;for(let n=0;n<r;n+=e){const e=t[n],r=t[n+1];i=e<i?e:i,o=e>o?e:o,a=r<a?r:a,s=r>s?r:s}return n[0][0]=i,n[0][1]=a,n[1][0]=o,n[1][1]=s,n}function G(t,e={}){const{size:r=2,startIndex:n=0,endIndex:i=t.length,normalize:o=!0}=e,a=t.slice(n,i);Z(a,r,0,i-n);const s=D(a,{size:r,broken:!0,gridResolution:360,gridOffset:[-180,-180]});if(o)for(const t of s)X(t,r);return s}function W(t,e,r={}){const{size:n=2,normalize:i=!0,edgeTypes:o=!1}=r;e=e||[];const a=[],s=[];let u=0,c=0;for(let i=0;i<=e.length;i++){const o=e[i]||t.length,l=c,h=H(t,n,u,o);for(let e=h;e<o;e++)a[c++]=t[e];for(let e=u;e<h;e++)a[c++]=t[e];Z(a,n,l,c),q(a,n,l,c,r.maxLatitude),u=o,s[i]=c}s.pop();const l=F(a,s,{size:n,gridResolution:360,gridOffset:[-180,-180],edgeTypes:o});if(i)for(const t of l)X(t.positions,n);return l}function H(t,e,r,n){let i=-1,o=-1;for(let a=r+1;a<n;a+=e){const e=Math.abs(t[a]);e>i&&(i=e,o=a-1)}return o}function q(t,e,r,n,i=85.051129){const o=t[r],a=t[n-e];if(Math.abs(o-a)>180){const n=R(t,0,e,r);n[0]+=360*Math.round((a-o)/360),I(t,n),n[1]=Math.sign(n[1])*i,I(t,n),n[0]=o,I(t,n)}}function Z(t,e,r,n){let i,o=t[0];for(let a=r;a<n;a+=e){i=t[a];const e=i-o;(e>180||e<-180)&&(i-=360*Math.round(e/360)),t[a]=o=i}}function X(t,e){let r;const n=t.length/e;for(let i=0;i<n&&(r=t[i*e],(r+180)%360==0);i++);const i=360*-Math.round(r/360);if(0!==i)for(let r=0;r<n;r++)t[r*e]+=i}r.d(e,"g",(function(){return o})),r.d(e,"h",(function(){return i})),r.d(e,"a",(function(){return n})),r.d(e,"f",(function(){return a})),r.d(e,"b",(function(){return F})),r.d(e,"d",(function(){return D})),r.d(e,"e",(function(){return G})),r.d(e,"c",(function(){return W}))},function(t,e,r){"use strict";r.d(e,"a",(function(){return l}));var n=r(7),i=r(139),o=r(49),a=r(9),s=r(48),u=r(167);const c="Resource subclass must define virtual methods";class l{constructor(t,e={}){Object(n.b)(t);const{id:r,userData:i={}}=e;this.gl=t,this.gl2=t,this.id=r||Object(s.c)(this.constructor.name),this.userData=i,this._bound=!1,this._handle=e.handle,void 0===this._handle&&(this._handle=this._createHandle()),this.byteLength=0,this._addStats()}toString(){return`${this.constructor.name}(${this.id})`}get handle(){return this._handle}delete({deleteChildren:t=!1}={}){const e=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,e&&t&&e.filter(Boolean).forEach(t=>t.delete()),this}bind(t=this.handle){if("function"!=typeof t)return this._bindHandle(t),this;let e;return this._bound?e=t():(this._bindHandle(this.handle),this._bound=!0,e=t(),this._bound=!1,this._bindHandle(null)),e}unbind(){this.bind(null)}getParameter(t,e={}){t=Object(o.b)(this.gl,t),Object(a.a)(t);const r=(this.constructor.PARAMETERS||{})[t];if(r){const t=Object(n.j)(this.gl);if(!((!("webgl2"in r)||t)&&(!("extension"in r)||this.gl.getExtension(r.extension)))){const e=r.webgl1,n="webgl2"in r?r.webgl2:r.webgl1;return t?n:e}}return this._getParameter(t,e)}getParameters(t={}){const{parameters:e,keys:r}=t,i=this.constructor.PARAMETERS||{},a=Object(n.j)(this.gl),s={},u=e||Object.keys(i);for(const e of u){const n=i[e];if(n&&(!("webgl2"in n)||a)&&(!("extension"in n)||this.gl.getExtension(n.extension))){const i=r?Object(o.a)(this.gl,e):e;s[i]=this.getParameter(e,t),r&&"GLenum"===n.type&&(s[i]=Object(o.a)(this.gl,s[i]))}}return s}setParameter(t,e){t=Object(o.b)(this.gl,t),Object(a.a)(t);const r=(this.constructor.PARAMETERS||{})[t];if(r){const t=Object(n.j)(this.gl);if(!((!("webgl2"in r)||t)&&(!("extension"in r)||this.gl.getExtension(r.extension))))throw new Error("Parameter not available on this platform");"GLenum"===r.type&&(e=Object(o.b)(e))}return this._setParameter(t,e),this}setParameters(t){for(const e in t)this.setParameter(e,t[e]);return this}stubRemovedMethods(t,e,r){return Object(u.a)(this,t,e,r)}initialize(t){}_createHandle(){throw new Error(c)}_deleteHandle(){throw new Error(c)}_bindHandle(t){throw new Error(c)}_getOptsFromHandle(){throw new Error(c)}_getParameter(t,e){throw new Error(c)}_setParameter(t,e){throw new Error(c)}_context(){return this.gl.luma=this.gl.luma||{},this.gl.luma}_addStats(){const t=this.constructor.name,e=i.a.get("Resource Counts");e.get("Resources Created").incrementCount(),e.get(`${t}s Created`).incrementCount(),e.get(`${t}s Active`).incrementCount()}_removeStats(){const t=this.constructor.name;i.a.get("Resource Counts").get(`${t}s Active`).decrementCount()}_trackAllocatedMemory(t,e=this.constructor.name){const r=i.a.get("Memory Usage");r.get("GPU Memory").addCount(t),r.get(`${e} Memory`).addCount(t),this.byteLength=t}_trackDeallocatedMemory(t=this.constructor.name){const e=i.a.get("Memory Usage");e.get("GPU Memory").subtractCount(this.byteLength),e.get(`${t} Memory`).subtractCount(this.byteLength),this.byteLength=0}}},function(t,e,r){"use strict";r.d(e,"a",(function(){return v}));var n=r(10),i=r.n(n),o=r(2),a=r.n(o),s=r(3),u=r.n(s),c=r(18),l=r(35),h=r(11),f=r(17),p=r(22),d=r(14),A=Math.PI/180,g=Object(l.a)(),m=[0,0,0],y={unitsPerMeter:[1,1,1],metersPerUnit:[1,1,1]},v=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};a()(this,t);var r=e.id,n=void 0===r?null:r,i=e.x,o=void 0===i?0:i,s=e.y,u=void 0===s?0:s,c=e.width,l=void 0===c?1:c,h=e.height,f=void 0===h?1:h;this.id=n||this.constructor.displayName||"viewport",this.x=o,this.y=u,this.width=l||1,this.height=f||1,this._frustumPlanes={},this._initViewMatrix(e),this._initProjectionMatrix(e),this._initPixelMatrices(),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),this.projectFlat=this.projectFlat.bind(this),this.unprojectFlat=this.unprojectFlat.bind(this)}return u()(t,[{key:"equals",value:function(e){return e instanceof t&&(this===e||e.width===this.width&&e.height===this.height&&e.scale===this.scale&&Object(h.e)(e.projectionMatrix,this.projectionMatrix)&&Object(h.e)(e.viewMatrix,this.viewMatrix))}},{key:"project",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.topLeft,n=void 0===r||r,o=this.projectPosition(t),a=Object(p.p)(o,this.pixelProjectionMatrix),s=i()(a,2),u=s[0],c=s[1],l=n?c:this.height-c;return 2===t.length?[u,l]:[u,l,a[2]]}},{key:"unproject",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.topLeft,n=void 0===r||r,o=e.targetZ,a=i()(t,3),s=a[0],u=a[1],c=a[2],l=n?u:this.height-u,h=o&&o*this.distanceScales.unitsPerMeter[2],f=Object(p.n)([s,l,c],this.pixelUnprojectionMatrix,h),d=this.unprojectPosition(f),A=i()(d,3),g=A[0],m=A[1],y=A[2];return Number.isFinite(c)?[g,m,y]:Number.isFinite(o)?[g,m,o]:[g,m]}},{key:"projectPosition",value:function(t){var e=this.projectFlat(t),r=i()(e,2);return[r[0],r[1],(t[2]||0)*this.distanceScales.unitsPerMeter[2]]}},{key:"unprojectPosition",value:function(t){var e=this.unprojectFlat(t),r=i()(e,2);return[r[0],r[1],(t[2]||0)*this.distanceScales.metersPerUnit[2]]}},{key:"projectFlat",value:function(t){return this.isGeospatial?Object(p.l)(t):t}},{key:"unprojectFlat",value:function(t){return this.isGeospatial?Object(p.o)(t):t}},{key:"getBounds",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e={targetZ:t.z||0},r=this.unproject([0,0],e),n=this.unproject([this.width,0],e),i=this.unproject([0,this.height],e),o=this.unproject([this.width,this.height],e);return[Math.min(r[0],n[0],i[0],o[0]),Math.min(r[1],n[1],i[1],o[1]),Math.max(r[0],n[0],i[0],o[0]),Math.max(r[1],n[1],i[1],o[1])]}},{key:"getDistanceScales",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t?Object(p.g)({longitude:t[0],latitude:t[1],highPrecision:!0}):this.distanceScales}},{key:"containsPixel",value:function(t){var e=t.x,r=t.y,n=t.width,i=void 0===n?1:n,o=t.height,a=void 0===o?1:o;return e<this.x+this.width&&this.x<e+i&&r<this.y+this.height&&this.y<r+a}},{key:"getFrustumPlanes",value:function(){return this._frustumPlanes.near?this._frustumPlanes:(Object.assign(this._frustumPlanes,Object(l.d)(this.viewProjectionMatrix)),this._frustumPlanes)}},{key:"panByPosition",value:function(t,e){return null}},{key:"getCameraPosition",value:function(){return this.cameraPosition}},{key:"getCameraDirection",value:function(){return this.cameraDirection}},{key:"getCameraUp",value:function(){return this.cameraUp}},{key:"_createProjectionMatrix",value:function(t){var e=t.orthographic,r=t.fovyRadians,n=t.aspect,i=t.focalDistance,o=t.near,a=t.far;return e?(new h.a).orthographic({fovy:r,aspect:n,focalDistance:i,near:o,far:a}):(new h.a).perspective({fovy:r,aspect:n,near:o,far:a})}},{key:"_initViewMatrix",value:function(t){var e=t.viewMatrix,r=void 0===e?g:e,n=t.longitude,i=void 0===n?null:n,o=t.latitude,a=void 0===o?null:o,s=t.zoom,u=void 0===s?null:s,c=t.position,l=void 0===c?null:c,f=t.modelMatrix,d=void 0===f?null:f,A=t.focalDistance,v=void 0===A?1:A,_=t.distanceScales,b=void 0===_?null:_;this.isGeospatial=Number.isFinite(a)&&Number.isFinite(i),this.zoom=u,Number.isFinite(this.zoom)||(this.zoom=this.isGeospatial?Object(p.i)({latitude:a})+Math.log2(v):0);var x=Math.pow(2,this.zoom);this.scale=x,this.distanceScales=this.isGeospatial?Object(p.g)({latitude:a,longitude:i}):b||y,this.focalDistance=v,this.distanceScales.metersPerUnit=new h.b(this.distanceScales.metersPerUnit),this.distanceScales.unitsPerMeter=new h.b(this.distanceScales.unitsPerMeter),this.position=m,this.meterOffset=m,l&&(this.position=l,this.modelMatrix=d,this.meterOffset=d?d.transformVector(l):l),this.isGeospatial?(this.longitude=i,this.latitude=a,this.center=this._getCenterInWorld({longitude:i,latitude:a})):this.center=l?this.projectPosition(l):[0,0,0],this.viewMatrixUncentered=r,this.viewMatrix=(new h.a).multiplyRight(this.viewMatrixUncentered).translate(new h.b(this.center||m).negate())}},{key:"_getCenterInWorld",value:function(t){var e=t.longitude,r=t.latitude,n=this.meterOffset,i=this.distanceScales,o=new h.b(this.projectPosition([e,r,0]));if(n){var a=new h.b(n).scale(i.unitsPerMeter);o.add(a)}return o}},{key:"_initProjectionMatrix",value:function(t){var e=t.projectionMatrix,r=void 0===e?null:e,n=t.orthographic,i=void 0!==n&&n,o=t.fovyRadians,a=t.fovy,s=void 0===a?75:a,u=t.near,c=void 0===u?.1:u,l=t.far,h=void 0===l?1e3:l,f=t.focalDistance,p=void 0===f?1:f;this.projectionMatrix=r||this._createProjectionMatrix({orthographic:i,fovyRadians:o||s*A,aspect:this.width/this.height,focalDistance:p,near:c,far:h})}},{key:"_initPixelMatrices",value:function(){var t=Object(l.a)();f.h(t,t,this.projectionMatrix),f.h(t,t,this.viewMatrix),this.viewProjectionMatrix=t,this.viewMatrixInverse=f.f([],this.viewMatrix)||this.viewMatrix,this.cameraPosition=Object(l.c)(this.viewMatrixInverse);var e=Object(l.a)(),r=Object(l.a)();f.o(e,e,[this.width/2,-this.height/2,1]),f.p(e,e,[1,-1,0]),f.h(r,e,this.viewProjectionMatrix),this.pixelProjectionMatrix=r,this.viewportMatrix=e,this.pixelUnprojectionMatrix=f.f(Object(l.a)(),this.pixelProjectionMatrix),this.pixelUnprojectionMatrix||c.a.warn("Pixel project matrix not invertible")()}},{key:"metersPerPixel",get:function(){return this.distanceScales.metersPerUnit[2]/this.scale}},{key:"projectionMode",get:function(){return this.isGeospatial?this.zoom<12?d.c.WEB_MERCATOR:d.c.WEB_MERCATOR_AUTO_OFFSET:d.c.IDENTITY}}]),t}();v.displayName="Viewport"},function(t,e,r){"use strict";var n=r(83),i=r(19),o=r(94),a=r(4);const s=new(r(276).a)({id:"loaders.gl"});class u{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}const c={fetch:null,mimeType:void 0,nothrow:!1,log:new class{constructor(){Object(a.a)(this,"console",void 0),this.console=console}log(...t){return this.console.log.bind(this.console,...t)}info(...t){return this.console.info.bind(this.console,...t)}warn(...t){return this.console.warn.bind(this.console,...t)}error(...t){return this.console.error.bind(this.console,...t)}},CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},l={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function h(){n.b.loaders=n.b.loaders||{};const{loaders:t}=n.b;return t._state=t._state||{},t._state}r.d(e,"b",(function(){return h})),r.d(e,"d",(function(){return p})),r.d(e,"c",(function(){return d})),r.d(e,"a",(function(){return A}));const f=()=>{const t=h();return t.globalOptions=t.globalOptions||{...c},t.globalOptions};function p(t){const e=h(),r=f();e.globalOptions=y(r,t)}function d(t,e,r,n){return r=r||[],function(t,e){g(t,null,c,l,e);for(const r of e){const n=t&&t[r.id]||{},i=r.options&&r.options[r.id]||{},o=r.deprecatedOptions&&r.deprecatedOptions[r.id]||{};g(n,r.id,i,o,e)}}(t,r=Array.isArray(r)?r:[r]),y(e,t,n)}function A(t,e){const r=f(),n=t||r;return"function"==typeof n.fetch?n.fetch:Object(i.f)(n.fetch)?t=>Object(o.a)(t,n):null!=e&&e.fetch?null==e?void 0:e.fetch:o.a}function g(t,e,r,n,o){const a=e||"Top level",u=e?`${e}.`:"";for(const c in t){const l=!e&&Object(i.f)(t[c]),h="baseUri"===c&&!e,f="workerUrl"===c&&e;if(!(c in r||h||f))if(c in n)s.warn(`${a} loader option '${u}${c}' no longer supported, use '${n[c]}'`)();else if(!l){const t=m(c,o);s.warn(`${a} loader option '${u}${c}' not recognized. ${t}`)()}}}function m(t,e){const r=t.toLowerCase();let n="";for(const i of e)for(const e in i.options){if(t===e)return`Did you mean '${i.id}.${e}'?`;const o=e.toLowerCase();(r.startsWith(o)||o.startsWith(r))&&(n=n||`Did you mean '${i.id}.${e}'?`)}return n}function y(t,e,r){const n={...t.options||{}};return function(t,e){!e||"baseUri"in t||(t.baseUri=e)}(n,r),null===n.log&&(n.log=new u),v(n,f()),v(n,e),n}function v(t,e){for(const r in e)if(r in e){const n=e[r];Object(i.h)(n)&&Object(i.h)(t[r])?t[r]={...t[r],...e[r]}:t[r]=e[r]}}},function(t,e,r){"use strict";function n(t,e){if(!t)throw new Error(`math.gl assertion ${e}`)}r.d(e,"a",(function(){return n}))},function(t,e,r){t.exports=r(262)},function(t,e,r){var n=r(255),i=r(256),o=r(257);t.exports=function(t){return n(t)||i(t)||o()}},function(t,e,r){var n=r(251);Object.assign(n,r(58),r(270),r(269),r(146),r(272),r(186)),t.exports=n},function(t,e,r){"use strict";var n=r(0),i=r.n(n);function o(t){var e=t.source,r=t.target,n=t.start,i=void 0===n?0:n,o=t.end,a=t.size,s=t.getData;o=o||r.length;var u=e.length,c=o-i;if(u>c)r.set(e.subarray(0,c),i);else if(r.set(e,i),s)for(var l=u;l<c;)for(var h=s(l,e),f=0;f<a;f++)r[i+l]=h[f]||0,l++}function a(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function s(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?a(Object(r),!0).forEach((function(e){i()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}r.d(e,"e",(function(){return c})),r.d(e,"d",(function(){return l})),r.d(e,"c",(function(){return h})),r.d(e,"a",(function(){return f})),r.d(e,"b",(function(){return p})),r.d(e,"f",(function(){return d}));var u={interpolation:{duration:0,easing:function(t){return t}},spring:{stiffness:.05,damping:.5}};function c(t,e){return t?(Number.isFinite(t)&&(t={duration:t}),t.type=t.type||"interpolation",s(s(s({},u[t.type]),e),t)):null}function l(t,e){return e.getBuffer()?[e.getBuffer(),{divisor:0,size:e.size,normalized:e.settings.normalized}]:e.value}function h(t){switch(t){case 1:return"float";case 2:return"vec2";case 3:return"vec3";case 4:return"vec4";default:throw new Error('No defined attribute type for size "'.concat(t,'"'))}}function f(t){t.push(t.shift())}function p(t,e){var r=t.doublePrecision,n=t.settings,i=t.value,o=t.size,a=r&&i instanceof Float64Array?2:1;return(n.noAlloc?i.length:e*o)*a}function d(t){var e=t.buffer,r=t.numInstances,n=t.attribute,i=t.fromLength,a=t.fromStartIndices,s=t.getData,u=void 0===s?function(t){return t}:s,c=n.doublePrecision&&n.value instanceof Float64Array?2:1,l=n.size*c,h=n.byteOffset,f=n.startIndices,d=a&&f,A=p(n,r),g=n.state.constant;if(d||!(i>=A)){var m=g?n.value:n.getBuffer().getData({srcByteOffset:h});if(n.settings.normalized&&!g){var y=u;u=function(t,e){return n._normalizeConstant(y(t,e))}}var v=g?function(t,e){return u(m,e)}:function(t,e){return u(m.subarray(t,t+l),e)},_=e.getData({length:i}),b=new Float32Array(A);!function(t){var e=t.source,r=t.target,n=t.size,i=t.getData,a=t.sourceStartIndices,s=t.targetStartIndices;if(!Array.isArray(s))return o({source:e,target:r,size:n,getData:i}),r;for(var u=0,c=0,l=i&&function(t,e){return i(t+c,e)},h=Math.min(a.length,s.length),f=1;f<h;f++){var p=a[f]*n,d=s[f]*n;o({source:e.subarray(u,p),target:r,start:c,end:d,size:n,getData:l}),u=p,c=d}c<r.length&&o({source:[],target:r,start:c,size:n,getData:l})}({source:_,target:b,sourceStartIndices:a,targetStartIndices:f,size:l,getData:v}),e.byteLength<b.byteLength+h&&e.reallocate(b.byteLength+h),e.subData({data:b,offset:h})}}},function(t,e,r){"use strict";r.d(e,"a",(function(){return i})),r.d(e,"b",(function(){return o}));var n=r(97);function i(t){var e;if(!t)return!1;return Array.isArray(t)&&(t=t[0]),Array.isArray(null===(e=t)||void 0===e?void 0:e.extensions)}function o(t){var e,r;let o;return Object(n.a)(t,"null loader"),Object(n.a)(i(t),"invalid loader"),Array.isArray(t)&&(o=t[1],t=t[0],t={...t,options:{...t.options,...o}}),(null!==(e=t)&&void 0!==e&&e.parseTextSync||null!==(r=t)&&void 0!==r&&r.parseText)&&(t.text=!0),t.text||(t.binary=!0),t}},function(t,e,r){"use strict";r.d(e,"c",(function(){return o})),r.d(e,"b",(function(){return a})),r.d(e,"a",(function(){return s}));var n=r(9);const i={};function o(t="id"){return i[t]=i[t]||1,`${t}-${i[t]++}`}function a(t){return Object(n.a)("number"==typeof t,"Input must be a number"),t&&0==(t&t-1)}function s(t){let e=!0;for(const r in t){e=!1;break}return e}},function(t,e,r){"use strict";r.d(e,"b",(function(){return i})),r.d(e,"a",(function(){return o}));var n=r(9);function i(t,e){if("string"!=typeof e)return e;const r=Number(e);if(!isNaN(r))return r;const i=t[e=e.replace(/^.*\./,"")];return Object(n.a)(void 0!==i,`Accessing undefined constant GL.${e}`),i}function o(t,e){e=Number(e);for(const r in t)if(t[r]===e)return`GL.${r}`;return String(e)}},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}r.d(e,"a",(function(){return n}))},function(t,e,r){"use strict";function n(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function i(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t}r.d(e,"a",(function(){return i}))},function(t,e,r){"use strict";function n(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}r.d(e,"a",(function(){return n}))},function(t,e,r){"use strict";r.d(e,"a",(function(){return o})),r.d(e,"c",(function(){return a})),r.d(e,"b",(function(){return s}));var n=[],i=[];function o(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,o=n,a={index:-1,data:t,target:[]};return t?"function"==typeof t[Symbol.iterator]?o=t:t.length>0&&(i.length=t.length,o=i):o=n,(e>0||Number.isFinite(r))&&(o=(Array.isArray(o)?o:Array.from(o)).slice(e,r),a.index=e-1),{iterable:o,objectInfo:a}}function a(t){return t&&t[Symbol.asyncIterator]}function s(t,e){var r=e.size,n=e.stride,i=e.offset,o=e.startIndices,a=e.nested,s=t.BYTES_PER_ELEMENT,u=n?n/s:r,c=i?i/s:0,l=Math.floor((t.length-c)/u);return function(e,n){var i=n.index,s=n.target;if(!o){for(var h=i*u+c,f=0;f<r;f++)s[f]=t[h+f];return s}var p,d=o[i],A=o[i+1]||l;if(a){p=new Array(A-d);for(var g=d;g<A;g++){var m=g*u+c;s=new Array(r);for(var y=0;y<r;y++)s[y]=t[m+y];p[g-d]=s}}else if(u===r)p=t.subarray(d*r+c,A*r+c);else{p=new t.constructor((A-d)*r);for(var v=0,_=d;_<A;_++)for(var b=_*u+c,x=0;x<r;x++)p[v++]=t[b+x]}return p}}},function(t,e,r){"use strict";r.d(e,"b",(function(){return n})),r.d(e,"c",(function(){return i})),r.d(e,"a",(function(){return o})),r.d(e,"d",(function(){return a}));function n(t){switch(ArrayBuffer.isView(t)?t.constructor:t){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error("Failed to deduce GL constant from typed array")}}function i(t,{clamped:e=!0}={}){switch(t){case 5126:return Float32Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return e?Uint8ClampedArray:Uint8Array;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Failed to deduce typed array type from GL constant")}}function o({data:t,width:e,height:r,bytesPerPixel:n=4,temp:i}){const o=e*n;i=i||new Uint8Array(o);for(let e=0;e<r/2;++e){const n=e*o,a=(r-e-1)*o;i.set(t.subarray(n,n+o)),t.copyWithin(n,a,a+o),t.set(i,a)}}function a({data:t,width:e,height:r}){const n=Math.round(e/2),i=Math.round(r/2),o=new Uint8Array(n*i*4);for(let r=0;r<i;r++)for(let i=0;i<n;i++)for(let a=0;a<4;a++)o[4*(r*n+i)+a]=t[4*(2*r*e+2*i)+a];return{data:o,width:n,height:i}}},function(t,e,r){"use strict";r.d(e,"a",(function(){return f}));var n=r(7),i=r(26),o=r(39),a=r(34),s=r(82),u=r(9),c=r(48);const l=[9729,9728],h=i.global.WebGLBuffer||function(){};class f extends o.a{static isSupported(t,e={}){const{format:r,linearFiltering:n}=e;let i=!0;return r&&(i=i&&Object(s.d)(t,r),i=i&&(!n||Object(s.e)(t,r))),i}constructor(t,e){const{id:r=Object(c.c)("texture"),handle:n,target:i}=e;super(t,{id:r,handle:n}),this.target=i,this.textureUnit=void 0,this.loaded=!1,this.width=void 0,this.height=void 0,this.depth=void 0,this.format=void 0,this.type=void 0,this.dataFormat=void 0,this.border=void 0,this.textureUnit=void 0,this.mipmaps=void 0}toString(){return`Texture(${this.id},${this.width}x${this.height})`}initialize(t={}){let e=t.data;if(e instanceof Promise)return e.then(e=>this.initialize(Object.assign({},t,{pixels:e,data:e}))),this;const r="undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement;if(r&&e.readyState<HTMLVideoElement.HAVE_METADATA)return this._video=null,e.addEventListener("loadeddata",()=>this.initialize(t)),this;const{pixels:i=null,format:o=6408,border:a=0,recreate:s=!1,parameters:u={},pixelStore:c={},textureUnit:l}=t;e||(e=i);let{width:h,height:f,dataFormat:p,type:d,compressed:A=!1,mipmaps:g=!0}=t;const{depth:m=0}=t;return({width:h,height:f,compressed:A,dataFormat:p,type:d}=this._deduceParameters({format:o,type:d,dataFormat:p,compressed:A,data:e,width:h,height:f})),this.width=h,this.height=f,this.depth=m,this.format=o,this.type=d,this.dataFormat=p,this.border=a,this.textureUnit=l,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),g&&this._isNPOT()&&(n.k.warn(`texture: ${this} is Non-Power-Of-Two, disabling mipmaping`)(),g=!1,this._updateForNPOT(u)),this.mipmaps=g,this.setImageData({data:e,width:h,height:f,depth:m,format:o,type:d,dataFormat:p,border:a,mipmaps:g,parameters:c,compressed:A}),g&&this.generateMipmap(),this.setParameters(u),s&&(this.data=e),r&&(this._video={video:e,parameters:u,lastTime:e.readyState>=HTMLVideoElement.HAVE_CURRENT_DATA?e.currentTime:-1}),this}update(){if(this._video){const{video:t,parameters:e,lastTime:r}=this._video;if(r===t.currentTime||t.readyState<HTMLVideoElement.HAVE_CURRENT_DATA)return;this.setSubImageData({data:t,parameters:e}),this.mipmaps&&this.generateMipmap(),this._video.lastTime=t.currentTime}}resize({height:t,width:e,mipmaps:r=!1}){return e!==this.width||t!==this.height?this.initialize({width:e,height:t,format:this.format,type:this.type,dataFormat:this.dataFormat,border:this.border,mipmaps:r}):this}generateMipmap(t={}){return this._isNPOT()?(n.k.warn(`texture: ${this} is Non-Power-Of-Two, disabling mipmaping`)(),this):(this.mipmaps=!0,this.gl.bindTexture(this.target,this.handle),Object(n.o)(this.gl,t,()=>{this.gl.generateMipmap(this.target)}),this.gl.bindTexture(this.target,null),this)}setImageData(t){this._trackDeallocatedMemory("Texture");const{target:e=this.target,pixels:r=null,level:i=0,format:o=this.format,border:a=this.border,offset:c=0,parameters:l={}}=t;let{data:h=null,type:f=this.type,width:p=this.width,height:d=this.height,dataFormat:A=this.dataFormat,compressed:g=!1}=t;h||(h=r),({type:f,dataFormat:A,compressed:g,width:p,height:d}=this._deduceParameters({format:o,type:f,dataFormat:A,compressed:g,data:h,width:p,height:d}));const{gl:m}=this;m.bindTexture(this.target,this.handle);let y,v=null;if(({data:h,dataType:v}=this._getDataType({data:h,compressed:g})),Object(n.o)(this.gl,l,()=>{switch(v){case"null":m.texImage2D(e,i,o,p,d,a,A,f,h);break;case"typed-array":m.texImage2D(e,i,o,p,d,a,A,f,h,c);break;case"buffer":y=Object(n.a)(m),y.bindBuffer(35052,h.handle||h),y.texImage2D(e,i,o,p,d,a,A,f,c),y.bindBuffer(35052,null);break;case"browser-object":Object(n.j)(m)?m.texImage2D(e,i,o,p,d,a,A,f,h):m.texImage2D(e,i,o,A,f,h);break;case"compressed":for(const[t,r]of h.entries())m.compressedTexImage2D(e,t,r.format,r.width,r.height,a,r.data);break;default:Object(u.a)(!1,"Unknown image data type")}}),h&&h.byteLength)this._trackAllocatedMemory(h.byteLength,"Texture");else{const t=s.a[this.dataFormat]||4,e=s.c[this.type]||1;this._trackAllocatedMemory(this.width*this.height*t*e,"Texture")}return this.loaded=!0,this}setSubImageData({target:t=this.target,pixels:e=null,data:r=null,x:i=0,y:o=0,width:s=this.width,height:c=this.height,level:l=0,format:f=this.format,type:p=this.type,dataFormat:d=this.dataFormat,compressed:A=!1,offset:g=0,border:m=this.border,parameters:y={}}){if(({type:p,dataFormat:d,compressed:A,width:s,height:c}=this._deduceParameters({format:f,type:p,dataFormat:d,compressed:A,data:r,width:s,height:c})),Object(u.a)(0===this.depth,"texSubImage not supported for 3D textures"),r||(r=e),r&&r.data){const t=r;r=t.data,s=t.shape[0],c=t.shape[1]}r instanceof a.a&&(r=r.handle),this.gl.bindTexture(this.target,this.handle),Object(n.o)(this.gl,y,()=>{if(A)this.gl.compressedTexSubImage2D(t,l,i,o,s,c,f,r);else if(null===r)this.gl.texSubImage2D(t,l,i,o,s,c,d,p,null);else if(ArrayBuffer.isView(r))this.gl.texSubImage2D(t,l,i,o,s,c,d,p,r,g);else if(r instanceof h){const e=Object(n.a)(this.gl);e.bindBuffer(35052,r),e.texSubImage2D(t,l,i,o,s,c,d,p,g),e.bindBuffer(35052,null)}else if(Object(n.j)(this.gl)){Object(n.a)(this.gl).texSubImage2D(t,l,i,o,s,c,d,p,r)}else this.gl.texSubImage2D(t,l,i,o,d,p,r)}),this.gl.bindTexture(this.target,null)}copyFramebuffer(t={}){return n.k.error("Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}getActiveUnit(){return this.gl.getParameter(34016)-33984}bind(t=this.textureUnit){const{gl:e}=this;return void 0!==t&&(this.textureUnit=t,e.activeTexture(33984+t)),e.bindTexture(this.target,this.handle),t}unbind(t=this.textureUnit){const{gl:e}=this;return void 0!==t&&(this.textureUnit=t,e.activeTexture(33984+t)),e.bindTexture(this.target,null),t}_getDataType({data:t,compressed:e=!1}){return e?{data:t,dataType:"compressed"}:null===t?{data:t,dataType:"null"}:ArrayBuffer.isView(t)?{data:t,dataType:"typed-array"}:t instanceof a.a?{data:t.handle,dataType:"buffer"}:t instanceof h?{data:t,dataType:"buffer"}:{data:t,dataType:"browser-object"}}_deduceParameters(t){const{format:e,data:r}=t;let{width:n,height:i,dataFormat:o,type:a,compressed:u}=t;const c=s.b[e];return o=o||c&&c.dataFormat,a=a||c&&c.types[0],u=u||c&&c.compressed,({width:n,height:i}=this._deduceImageSize(r,n,i)),{dataFormat:o,type:a,compressed:u,width:n,height:i,format:e,data:r}}_deduceImageSize(t,e,r){let n;return n="undefined"!=typeof ImageData&&t instanceof ImageData?{width:t.width,height:t.height}:"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement?{width:t.naturalWidth,height:t.naturalHeight}:"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement?{width:t.width,height:t.height}:"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?{width:t.width,height:t.height}:"undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement?{width:t.videoWidth,height:t.videoHeight}:t?{width:e,height:r}:{width:e>=0?e:1,height:r>=0?r:1},Object(u.a)(n,"Could not deduced texture size"),Object(u.a)(void 0===e||n.width===e,"Deduced texture width does not match supplied width"),Object(u.a)(void 0===r||n.height===r,"Deduced texture height does not match supplied height"),n}_createHandle(){return this.gl.createTexture()}_deleteHandle(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}_getParameter(t){switch(t){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);const e=this.gl.getTexParameter(this.target,t);return this.gl.bindTexture(this.target,null),e}}_setParameter(t,e){switch(this.gl.bindTexture(this.target,this.handle),e=this._getNPOTParam(t,e),t){case 33082:case 33083:this.gl.texParameterf(this.handle,t,e);break;case 4096:case 4097:Object(u.a)(!1);break;default:this.gl.texParameteri(this.target,t,e)}return this.gl.bindTexture(this.target,null),this}_isNPOT(){return!Object(n.j)(this.gl)&&(!(!this.width||!this.height)&&(!Object(c.b)(this.width)||!Object(c.b)(this.height)))}_updateForNPOT(t){void 0===t[this.gl.TEXTURE_MIN_FILTER]&&(t[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),void 0===t[this.gl.TEXTURE_WRAP_S]&&(t[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),void 0===t[this.gl.TEXTURE_WRAP_T]&&(t[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}_getNPOTParam(t,e){if(this._isNPOT())switch(t){case 10241:-1===l.indexOf(e)&&(e=9729);break;case 10242:case 10243:33071!==e&&(e=33071)}return e}}},function(t,e,r){"use strict";r.d(e,"a",(function(){return i})),r.d(e,"i",(function(){return o})),r.d(e,"d",(function(){return a})),r.d(e,"b",(function(){return s})),r.d(e,"e",(function(){return u})),r.d(e,"h",(function(){return c})),r.d(e,"f",(function(){return l})),r.d(e,"g",(function(){return h})),r.d(e,"c",(function(){return f}));var n=r(12);function i(){var t=new n.a(9);return n.a!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function o(t,e){if(t===e){var r=e[1],n=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function a(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],h=l*a-s*c,f=-l*o+s*u,p=c*o-a*u,d=r*h+n*f+i*p;return d?(d=1/d,t[0]=h*d,t[1]=(-l*n+i*c)*d,t[2]=(s*n-i*a)*d,t[3]=f*d,t[4]=(l*r-i*u)*d,t[5]=(-s*r+i*o)*d,t[6]=p*d,t[7]=(-c*r+n*u)*d,t[8]=(a*r-n*o)*d,t):null}function s(t){var e=t[0],r=t[1],n=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],c=t[8];return e*(c*o-a*u)+r*(-c*i+a*s)+n*(u*i-o*s)}function u(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],f=r[0],p=r[1],d=r[2],A=r[3],g=r[4],m=r[5],y=r[6],v=r[7],_=r[8];return t[0]=f*n+p*a+d*c,t[1]=f*i+p*s+d*l,t[2]=f*o+p*u+d*h,t[3]=A*n+g*a+m*c,t[4]=A*i+g*s+m*l,t[5]=A*o+g*u+m*h,t[6]=y*n+v*a+_*c,t[7]=y*i+v*s+_*l,t[8]=y*o+v*u+_*h,t}function c(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],f=r[0],p=r[1];return t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=f*n+p*a+c,t[7]=f*i+p*s+l,t[8]=f*o+p*u+h,t}function l(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],f=Math.sin(r),p=Math.cos(r);return t[0]=p*n+f*a,t[1]=p*i+f*s,t[2]=p*o+f*u,t[3]=p*a-f*n,t[4]=p*s-f*i,t[5]=p*u-f*o,t[6]=c,t[7]=l,t[8]=h,t}function h(t,e,r){var n=r[0],i=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function f(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r+r,s=n+n,u=i+i,c=r*a,l=n*a,h=n*s,f=i*a,p=i*s,d=i*u,A=o*a,g=o*s,m=o*u;return t[0]=1-h-d,t[3]=l-m,t[6]=f+g,t[1]=l+m,t[4]=1-c-d,t[7]=p-A,t[2]=f-g,t[5]=p+A,t[8]=1-c-h,t}},function(t,e){var r,n,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(r===setTimeout)return setTimeout(t,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(t){r=o}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(t){n=a}}();var u,c=[],l=!1,h=-1;function f(){l&&u&&(l=!1,u.length?c=u.concat(c):h=-1,c.length&&p())}function p(){if(!l){var t=s(f);l=!0;for(var e=c.length;e;){for(u=c,c=[];++h<e;)u&&u[h].run();h=-1,e=c.length}u=null,l=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function A(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];c.push(new d(t,e)),1!==c.length||l||s(p)},d.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=A,i.addListener=A,i.once=A,i.off=A,i.removeListener=A,i.removeAllListeners=A,i.emit=A,i.prependListener=A,i.prependOnceListener=A,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e,r){"use strict";r.r(e);var n=r(222),i=r(10),o=r.n(i),a=r(0),s=r.n(a),u=r(2),c=r.n(u),l=r(3),h=r.n(l),f=r(8),p=r.n(f),d=r(5),A=r.n(d),g=r(6),m=r.n(g),y=r(1),v=r.n(y),_=r(14),b=r(207),x=r(226),w=r(155),E=r(176),S=r(62),O=r(22),T=r(11),P=new Uint16Array([0,2,1,0,3,2]),M=new Float32Array([0,1,0,0,1,0,1,1]);function C(t,e){if(!e)return function(t){for(var e=new Float64Array(12),r=0;r<t.length;r++)e[3*r+0]=t[r][0],e[3*r+1]=t[r][1],e[3*r+2]=t[r][2]||0;return{vertexCount:6,positions:e,indices:P,texCoords:M}}(t);for(var r=Math.max(Math.abs(t[0][0]-t[3][0]),Math.abs(t[1][0]-t[2][0])),n=Math.max(Math.abs(t[1][1]-t[0][1]),Math.abs(t[2][1]-t[3][1])),i=Math.ceil(r/e)+1,o=Math.ceil(n/e)+1,a=(i-1)*(o-1)*6,s=new Uint32Array(a),u=new Float32Array(i*o*2),c=new Float64Array(i*o*3),l=0,h=0,f=0;f<i;f++)for(var p=f/(i-1),d=0;d<o;d++){var A=d/(o-1),g=I(t,p,A);c[3*l+0]=g[0],c[3*l+1]=g[1],c[3*l+2]=g[2]||0,u[2*l+0]=p,u[2*l+1]=1-A,f>0&&d>0&&(s[h++]=l-o,s[h++]=l-o-1,s[h++]=l-1,s[h++]=l-o,s[h++]=l-1,s[h++]=l),l++}return{vertexCount:a,positions:c,indices:s,texCoords:u}}function I(t,e,r){return Object(T.f)(Object(T.f)(t[0],t[1],r),Object(T.f)(t[3],t[2],r),e)}var k="\n#define SHADER_NAME bitmap-layer-fragment-shader\n\n#ifdef GL_ES\nprecision highp float;\n#endif\n\nuniform sampler2D bitmapTexture;\n\nvarying vec2 vTexCoord;\nvarying vec2 vTexPos;\n\nuniform float desaturate;\nuniform vec4 transparentColor;\nuniform vec3 tintColor;\nuniform float opacity;\n\nuniform float coordinateConversion;\nuniform vec4 bounds;\n\n/* projection utils */\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / PI / 2.0;\n\n// from degrees to Web Mercator\nvec2 lnglat_to_mercator(vec2 lnglat) {\n float x = lnglat.x;\n float y = clamp(lnglat.y, -89.9, 89.9);\n return vec2(\n radians(x) + PI,\n PI + log(tan(PI * 0.25 + radians(y) * 0.5))\n ) * WORLD_SCALE;\n}\n\n// from Web Mercator to degrees\nvec2 mercator_to_lnglat(vec2 xy) {\n xy /= WORLD_SCALE;\n return degrees(vec2(\n xy.x - PI,\n atan(exp(xy.y - PI)) * 2.0 - PI * 0.5\n ));\n}\n/* End projection utils */\n\n// apply desaturation\nvec3 color_desaturate(vec3 color) {\n float luminance = (color.r + color.g + color.b) * 0.333333333;\n return mix(color, vec3(luminance), desaturate);\n}\n\n// apply tint\nvec3 color_tint(vec3 color) {\n return color * tintColor;\n}\n\n// blend with background color\nvec4 apply_opacity(vec3 color, float alpha) {\n return mix(transparentColor, vec4(color, 1.0), alpha);\n}\n\nvec2 getUV(vec2 pos) {\n return vec2(\n (pos.x - bounds[0]) / (bounds[2] - bounds[0]),\n (pos.y - bounds[3]) / (bounds[1] - bounds[3])\n );\n}\n\n".concat("\nvec3 packUVsIntoRGB(vec2 uv) {\n // Extract the top 8 bits. We want values to be truncated down so we can add a fraction\n vec2 uv8bit = floor(uv * 256.);\n\n // Calculate the normalized remainders of u and v parts that do not fit into 8 bits\n // Scale and clamp to 0-1 range\n vec2 uvFraction = fract(uv * 256.);\n vec2 uvFraction4bit = floor(uvFraction * 16.);\n\n // Remainder can be encoded in blue channel, encode as 4 bits for pixel coordinates\n float fractions = uvFraction4bit.x + uvFraction4bit.y * 16.;\n\n return vec3(uv8bit, fractions) / 255.;\n}\n","\n\nvoid main(void) {\n vec2 uv = vTexCoord;\n if (coordinateConversion < -0.5) {\n vec2 lnglat = mercator_to_lnglat(vTexPos);\n uv = getUV(lnglat);\n } else if (coordinateConversion > 0.5) {\n vec2 commonPos = lnglat_to_mercator(vTexPos);\n uv = getUV(commonPos);\n }\n vec4 bitmapColor = texture2D(bitmapTexture, uv);\n\n gl_FragColor = apply_opacity(color_tint(color_desaturate(bitmapColor.rgb)), bitmapColor.a * opacity);\n\n geometry.uv = uv;\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n\n if (picking_uActive) {\n // Since instance information is not used, we can use picking color for pixel index\n gl_FragColor.rgb = packUVsIntoRGB(uv);\n }\n}\n");function R(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function L(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?R(Object(r),!0).forEach((function(e){s()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):R(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function j(t){var e=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(t){return!1}}();return function(){var r,n=v()(t);if(e){var i=v()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m()(this,r)}}var D={image:{type:"image",value:null,async:!0},bounds:{type:"array",value:[1,0,0,1],compare:!0},_imageCoordinateSystem:_.a.DEFAULT,desaturate:{type:"number",min:0,max:1,value:0},transparentColor:{type:"color",value:[0,0,0,0]},tintColor:{type:"color",value:[255,255,255]}},B=function(t){A()(r,t);var e=j(r);function r(){return c()(this,r),e.apply(this,arguments)}return h()(r,[{key:"getShaders",value:function(){return p()(v()(r.prototype),"getShaders",this).call(this,{vs:"\n#define SHADER_NAME bitmap-layer-vertex-shader\n\nattribute vec2 texCoords;\nattribute vec3 positions;\nattribute vec3 positions64Low;\n\nvarying vec2 vTexCoord;\nvarying vec2 vTexPos;\n\nuniform float coordinateConversion;\n\nconst vec3 pickingColor = vec3(1.0, 0.0, 0.0);\n\nvoid main(void) {\n geometry.worldPosition = positions;\n geometry.uv = texCoords;\n geometry.pickingColor = pickingColor;\n\n gl_Position = project_position_to_clipspace(positions, positions64Low, vec3(0.0), geometry.position);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vTexCoord = texCoords;\n\n if (coordinateConversion < -0.5) {\n vTexPos = geometry.position.xy;\n } else if (coordinateConversion > 0.5) {\n vTexPos = geometry.worldPosition.xy;\n }\n\n vec4 color = vec4(0.0);\n DECKGL_FILTER_COLOR(color, geometry);\n}\n",fs:k,modules:[b.a,x.a]})}},{key:"initializeState",value:function(){var t=this,e=this.getAttributeManager();e.remove(["instancePickingColors"]);e.add({indices:{size:1,isIndexed:!0,update:function(e){return e.value=t.state.mesh.indices},noAlloc:!0},positions:{size:3,type:5130,fp64:this.use64bitPositions(),update:function(e){return e.value=t.state.mesh.positions},noAlloc:!0},texCoords:{size:2,update:function(e){return e.value=t.state.mesh.texCoords},noAlloc:!0}})}},{key:"updateState",value:function(t){var e=t.props,r=t.oldProps;if(t.changeFlags.extensionsChanged){var n,i=this.context.gl;null===(n=this.state.model)||void 0===n||n.delete(),this.state.model=this._getModel(i),this.getAttributeManager().invalidateAll()}var o=this.getAttributeManager();if(e.bounds!==r.bounds){var a=this.state.mesh,s=this._createMesh();for(var u in this.state.model.setVertexCount(s.vertexCount),s)a&&a[u]!==s[u]&&o.invalidate(u);this.setState(L({mesh:s},this._getCoordinateUniforms()))}else e._imageCoordinateSystem!==r._imageCoordinateSystem&&this.setState(this._getCoordinateUniforms())}},{key:"getPickingInfo",value:function(t){var e=t.info,r=this.props.image;if(!e.color||!r)return e.bitmap=null,e;var n=r.width,i=r.height;e.index=0;var a,s,u,c,l,h=(a=e.color,s=o()(a,3),u=s[0],c=s[1],l=s[2],[(u+(15&l)/16)/256,(c+(240&l)/256)/256]),f=[Math.floor(h[0]*n),Math.floor(h[1]*i)];return e.bitmap={size:{width:n,height:i},uv:h,pixel:f},e}},{key:"disablePickingIndex",value:function(){this.setState({disablePicking:!0})}},{key:"restorePickingColors",value:function(){this.setState({disablePicking:!1})}},{key:"_updateAutoHighlight",value:function(t){p()(v()(r.prototype),"_updateAutoHighlight",this).call(this,L(L({},t),{},{color:this.encodePickingColor(0)}))}},{key:"_createMesh",value:function(){var t=this.props.bounds,e=t;return Number.isFinite(t[0])&&(e=[[t[0],t[1]],[t[0],t[3]],[t[2],t[3]],[t[2],t[1]]]),C(e,this.context.viewport.resolution)}},{key:"_getModel",value:function(t){return t?new E.a(t,L(L({},this.getShaders()),{},{id:this.props.id,geometry:new S.a({drawMode:4,vertexCount:6}),isInstanced:!1})):null}},{key:"draw",value:function(t){var e=t.uniforms,r=t.moduleParameters,n=this.state,i=n.model,o=n.coordinateConversion,a=n.bounds,s=n.disablePicking,u=this.props,c=u.image,l=u.desaturate,h=u.transparentColor,f=u.tintColor;r.pickingActive&&s||c&&i&&i.setUniforms(e).setUniforms({bitmapTexture:c,desaturate:l,transparentColor:h.map((function(t){return t/255})),tintColor:f.slice(0,3).map((function(t){return t/255})),coordinateConversion:o,bounds:a}).draw()}},{key:"_getCoordinateUniforms",value:function(){var t=_.a.LNGLAT,e=_.a.CARTESIAN,r=_.a.DEFAULT,n=this.props._imageCoordinateSystem;if(n!==r){var i=this.props.bounds;if(!Number.isFinite(i[0]))throw new Error("_imageCoordinateSystem only supports rectangular bounds");var o=this.context.viewport.resolution?t:e;if((n=n===t?t:e)===t&&o===e)return{coordinateConversion:-1,bounds:i};if(n===e&&o===t){var a=Object(O.l)([i[0],i[1]]),s=Object(O.l)([i[2],i[3]]);return{coordinateConversion:1,bounds:[a[0],a[1],s[0],s[1]]}}}return{coordinateConversion:0,bounds:[0,0,0,0]}}}]),r}(w.a);B.layerName="BitmapLayer",B.defaultProps=D;var F=r(110),z=r(223),N=r(224),U=r(159),V=r(157),G=r(214),W=r(109),H=r(215),q=r(221),Z=r(158),X=r(108),Q=r(162),Y=r(160);r.d(e,"ArcLayer",(function(){return n.a})),r.d(e,"BitmapLayer",(function(){return B})),r.d(e,"IconLayer",(function(){return F.a})),r.d(e,"LineLayer",(function(){return z.a})),r.d(e,"PointCloudLayer",(function(){return N.a})),r.d(e,"ScatterplotLayer",(function(){return U.a})),r.d(e,"ColumnLayer",(function(){return V.a})),r.d(e,"GridCellLayer",(function(){return G.a})),r.d(e,"PathLayer",(function(){return W.a})),r.d(e,"PolygonLayer",(function(){return H.a})),r.d(e,"GeoJsonLayer",(function(){return q.a})),r.d(e,"TextLayer",(function(){return Z.a})),r.d(e,"SolidPolygonLayer",(function(){return X.a})),r.d(e,"_MultiIconLayer",(function(){return Q.a})),r.d(e,"_TextBackgroundLayer",(function(){return Y.a}))},function(t,e,r){"use strict";(function(t,n){r.d(e,"b",(function(){return o})),r.d(e,"a",(function(){return a}));const i={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==t&&t,document:"undefined"!=typeof document&&document,process:"object"==typeof n&&n},o=i.window||i.self||i.global,a=i.process||{};console}).call(this,r(65),r(57))},function(t,e,r){"use strict";r.d(e,"a",(function(){return x}));var n=r(0),i=r.n(n),o=r(2),a=r.n(o),s=r(3),u=r.n(s),c=r(127),l=r(128);function h(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function f(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?h(Object(r),!0).forEach((function(e){i()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var p={transitionDuration:0},d={transitionDuration:300,transitionEasing:function(t){return t},transitionInterruption:c.a.BREAK},A=function(t){return 1-(1-t)*(1-t)},g=["wheel"],m=["panstart","panmove","panend"],y=["pinchstart","pinchmove","pinchend"],v=["tripanstart","tripanmove","tripanend"],_=["doubletap"],b=["keydown"],x=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};a()(this,t),this.ControllerState=e,this.controllerState=null,this.controllerStateProps=null,this.eventManager=null,this.transitionManager=new c.b(e,f(f({},r),{},{onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)}));var n=this.linearTransitionProps;this._transition=n&&f(f({},d),{},{transitionInterpolator:new l.a({transitionProps:n})}),this._events=null,this._interactionState={isDragging:!1},this._customEvents=[],this.onViewStateChange=null,this.onStateChange=null,this.handleEvent=this.handleEvent.bind(this),this.setProps(r)}return u()(t,[{key:"finalize",value:function(){for(var t in this._events)this._events[t]&&this.eventManager.off(t,this.handleEvent);this.transitionManager.finalize()}},{key:"handleEvent",value:function(t){var e=this.ControllerState;this.controllerState=new e(f(f({makeViewport:this.makeViewport},this.controllerStateProps),this._state));var r=this._eventStartBlocked;switch(t.type){case"panstart":return!r&&this._onPanStart(t);case"panmove":return this._onPan(t);case"panend":return this._onPanEnd(t);case"pinchstart":return!r&&this._onPinchStart(t);case"pinchmove":return this._onPinch(t);case"pinchend":return this._onPinchEnd(t);case"tripanstart":return!r&&this._onTriplePanStart(t);case"tripanmove":return this._onTriplePan(t);case"tripanend":return this._onTriplePanEnd(t);case"doubletap":return this._onDoubleTap(t);case"wheel":return this._onWheel(t);case"keydown":return this._onKeyDown(t);default:return!1}}},{key:"getCenter",value:function(t){var e=this.controllerStateProps,r=e.x,n=e.y,i=t.offsetCenter;return[i.x-r,i.y-n]}},{key:"isPointInBounds",value:function(t,e){var r=this.controllerStateProps,n=r.width,i=r.height;if(e&&e.handled)return!1;var o=t[0]>=0&&t[0]<=n&&t[1]>=0&&t[1]<=i;return o&&e&&e.stopPropagation(),o}},{key:"isFunctionKeyPressed",value:function(t){var e=t.srcEvent;return Boolean(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}},{key:"isDragging",value:function(){return this._interactionState.isDragging}},{key:"blockEvents",value:function(t){var e=this,r=setTimeout((function(){e._eventStartBlocked===r&&(e._eventStartBlocked=null)}),t);this._eventStartBlocked=r}},{key:"setProps",value:function(t){"onViewStateChange"in t&&(this.onViewStateChange=t.onViewStateChange),"onStateChange"in t&&(this.onStateChange=t.onStateChange),"makeViewport"in t&&(this.makeViewport=t.makeViewport),"dragMode"in t&&(this.dragMode=t.dragMode),this.controllerStateProps=t,"eventManager"in t&&this.eventManager!==t.eventManager&&(this.eventManager=t.eventManager,this._events={},this.toggleEvents(this._customEvents,!0)),"transitionInterpolator"in t||(t.transitionInterpolator=this._getTransitionProps().transitionInterpolator),this.transitionManager.processViewStateChange(t);var e=t.inertia;!0===e&&(e=300),this.inertia=e;var r=t.scrollZoom,n=void 0===r||r,i=t.dragPan,o=void 0===i||i,a=t.dragRotate,s=void 0===a||a,u=t.doubleClickZoom,c=void 0===u||u,l=t.touchZoom,h=void 0===l||l,f=t.touchRotate,p=void 0!==f&&f,d=t.keyboard,A=void 0===d||d,x=Boolean(this.onViewStateChange);this.toggleEvents(g,x&&n),this.toggleEvents(m,x&&(o||s)),this.toggleEvents(y,x&&(h||p)),this.toggleEvents(v,x&&p),this.toggleEvents(_,x&&c),this.toggleEvents(b,x&&A),this.scrollZoom=n,this.dragPan=o,this.dragRotate=s,this.doubleClickZoom=c,this.touchZoom=h,this.touchRotate=p,this.keyboard=A}},{key:"updateTransition",value:function(){this.transitionManager.updateTransition()}},{key:"toggleEvents",value:function(t,e){var r=this;this.eventManager&&t.forEach((function(t){r._events[t]!==e&&(r._events[t]=e,e?r.eventManager.on(t,r.handleEvent):r.eventManager.off(t,r.handleEvent))}))}},{key:"updateViewport",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=f(f({},t.getViewportProps()),e),i=this.controllerState!==t;if(this._state=t.getState(),this._setInteractionState(r),i){var o=this.controllerState?this.controllerState.getViewportProps():null;this.onViewStateChange&&this.onViewStateChange({viewState:n,interactionState:this._interactionState,oldViewState:o})}}},{key:"_onTransition",value:function(t){this.onViewStateChange&&(t.interactionState=this._interactionState,this.onViewStateChange(t))}},{key:"_setInteractionState",value:function(t){Object.assign(this._interactionState,t),this.onStateChange&&this.onStateChange(this._interactionState)}},{key:"_onPanStart",value:function(t){var e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;var r=this.isFunctionKeyPressed(t)||t.rightButton;(this.invertPan||"pan"===this.dragMode)&&(r=!r);var n=this.controllerState[r?"panStart":"rotateStart"]({pos:e});return this._panMove=r,this.updateViewport(n,p,{isDragging:!0}),!0}},{key:"_onPan",value:function(t){return!!this.isDragging()&&(this._panMove?this._onPanMove(t):this._onPanRotate(t))}},{key:"_onPanEnd",value:function(t){return!!this.isDragging()&&(this._panMove?this._onPanMoveEnd(t):this._onPanRotateEnd(t))}},{key:"_onPanMove",value:function(t){if(!this.dragPan)return!1;var e=this.getCenter(t),r=this.controllerState.pan({pos:e});return this.updateViewport(r,p,{isDragging:!0,isPanning:!0}),!0}},{key:"_onPanMoveEnd",value:function(t){var e=this.inertia;if(this.dragPan&&e&&t.velocity){var r=this.getCenter(t),n=[r[0]+t.velocityX*e/2,r[1]+t.velocityY*e/2],i=this.controllerState.pan({pos:n}).panEnd();this.updateViewport(i,f(f({},this._getTransitionProps()),{},{transitionDuration:e,transitionEasing:A}),{isDragging:!1,isPanning:!0})}else{var o=this.controllerState.panEnd();this.updateViewport(o,null,{isDragging:!1,isPanning:!1})}return!0}},{key:"_onPanRotate",value:function(t){if(!this.dragRotate)return!1;var e=this.getCenter(t),r=this.controllerState.rotate({pos:e});return this.updateViewport(r,p,{isDragging:!0,isRotating:!0}),!0}},{key:"_onPanRotateEnd",value:function(t){var e=this.inertia;if(this.dragRotate&&e&&t.velocity){var r=this.getCenter(t),n=[r[0]+t.velocityX*e/2,r[1]+t.velocityY*e/2],i=this.controllerState.rotate({pos:n}).rotateEnd();this.updateViewport(i,f(f({},this._getTransitionProps()),{},{transitionDuration:e,transitionEasing:A}),{isDragging:!1,isRotating:!0})}else{var o=this.controllerState.rotateEnd();this.updateViewport(o,null,{isDragging:!1,isRotating:!1})}return!0}},{key:"_onWheel",value:function(t){if(!this.scrollZoom)return!1;t.preventDefault();var e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;var r=this.scrollZoom,n=r.speed,i=void 0===n?.01:n,o=r.smooth,a=void 0!==o&&o,s=t.delta,u=2/(1+Math.exp(-Math.abs(s*i)));s<0&&0!==u&&(u=1/u);var c=this.controllerState.zoom({pos:e,scale:u});return this.updateViewport(c,f(f({},this._getTransitionProps({around:e})),{},{transitionDuration:a?250:1}),{isZooming:!0,isPanning:!0}),!0}},{key:"_onTriplePanStart",value:function(t){var e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;var r=this.controllerState.rotateStart({pos:e});return this.updateViewport(r,p,{isDragging:!0}),!0}},{key:"_onTriplePan",value:function(t){if(!this.touchRotate)return!1;if(!this.isDragging())return!1;var e=this.getCenter(t);e[0]-=t.deltaX;var r=this.controllerState.rotate({pos:e});return this.updateViewport(r,p,{isDragging:!0,isRotating:!0}),!0}},{key:"_onTriplePanEnd",value:function(t){if(!this.isDragging())return!1;var e=this.inertia;if(this.touchRotate&&e&&t.velocityY){var r=this.getCenter(t),n=[r[0],r[1]+=t.velocityY*e/2],i=this.controllerState.rotate({pos:n});this.updateViewport(i,f(f({},this._getTransitionProps()),{},{transitionDuration:e,transitionEasing:A}),{isDragging:!1,isRotating:!0}),this.blockEvents(e)}else{var o=this.controllerState.rotateEnd();this.updateViewport(o,null,{isDragging:!1,isRotating:!1})}return!0}},{key:"_onPinchStart",value:function(t){var e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;var r=this.controllerState.zoomStart({pos:e}).rotateStart({pos:e});return this._startPinchRotation=t.rotation,this._lastPinchEvent=t,this.updateViewport(r,p,{isDragging:!0}),!0}},{key:"_onPinch",value:function(t){if(!this.touchZoom&&!this.touchRotate)return!1;if(!this.isDragging())return!1;var e=this.controllerState;if(this.touchZoom){var r=t.scale,n=this.getCenter(t);e=e.zoom({pos:n,scale:r})}if(this.touchRotate){var i=t.rotation;e=e.rotate({deltaAngleX:this._startPinchRotation-i})}return this.updateViewport(e,p,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),this._lastPinchEvent=t,!0}},{key:"_onPinchEnd",value:function(t){if(!this.isDragging())return!1;var e=this.inertia,r=this._lastPinchEvent;if(this.touchZoom&&e&&r&&t.scale!==r.scale){var n=this.getCenter(t),i=this.controllerState.rotateEnd(),o=Math.log2(t.scale),a=(o-Math.log2(r.scale))/(t.deltaTime-r.deltaTime),s=Math.pow(2,o+a*e/2);i=i.zoom({pos:n,scale:s}).zoomEnd(),this.updateViewport(i,f(f({},this._getTransitionProps({around:n})),{},{transitionDuration:e,transitionEasing:A}),{isDragging:!1,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:!1}),this.blockEvents(e)}else{var u=this.controllerState.zoomEnd().rotateEnd();this.updateViewport(u,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1})}return this._startPinchRotation=null,this._lastPinchEvent=null,!0}},{key:"_onDoubleTap",value:function(t){if(!this.doubleClickZoom)return!1;var e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;var r=this.isFunctionKeyPressed(t),n=this.controllerState.zoom({pos:e,scale:r?.5:2});return this.updateViewport(n,this._getTransitionProps({around:e}),{isZooming:!0,isPanning:!0}),this.blockEvents(100),!0}},{key:"_onKeyDown",value:function(t){if(!this.keyboard)return!1;var e,r=this.isFunctionKeyPressed(t),n=this.keyboard,i=n.zoomSpeed,o=n.moveSpeed,a=n.rotateSpeedX,s=n.rotateSpeedY,u=this.controllerState,c={};switch(t.srcEvent.code){case"Minus":e=r?u.zoomOut(i).zoomOut(i):u.zoomOut(i),c.isZooming=!0;break;case"Equal":e=r?u.zoomIn(i).zoomIn(i):u.zoomIn(i),c.isZooming=!0;break;case"ArrowLeft":r?(e=u.rotateLeft(a),c.isRotating=!0):(e=u.moveLeft(o),c.isPanning=!0);break;case"ArrowRight":r?(e=u.rotateRight(a),c.isRotating=!0):(e=u.moveRight(o),c.isPanning=!0);break;case"ArrowUp":r?(e=u.rotateUp(s),c.isRotating=!0):(e=u.moveUp(o),c.isPanning=!0);break;case"ArrowDown":r?(e=u.rotateDown(s),c.isRotating=!0):(e=u.moveDown(o),c.isPanning=!0);break;default:return!1}return this.updateViewport(e,this._getTransitionProps(),c),!0}},{key:"_getTransitionProps",value:function(t){var e=this._transition;return e?t?f(f({},e),{},{transitionInterpolator:new l.a(f(f({},t),{},{transitionProps:this.linearTransitionProps,makeViewport:this.controllerState.makeViewport}))}):e:p}},{key:"linearTransitionProps",get:function(){return null}},{key:"events",set:function(t){this.toggleEvents(this._customEvents,!1),this.toggleEvents(t,!0),this._customEvents=t,this.setProps(this.controllerStateProps)}}]),t}()},function(t,e,r){"use strict";var n=r(24),i=r.n(n),o=r(0),a=r.n(o),s=r(2),u=r.n(s),c=r(3),l=r.n(c),h=r(40),f=/([0-9]+\.?[0-9]*)(%|px)/;function p(t){switch(i()(t)){case"number":return{position:t,relative:!1};case"string":var e=t.match(f);if(e&&e.length>=3){var r="%"===e[2],n=parseFloat(e[1]);return{position:r?n/100:n,relative:r}}default:throw new Error("Could not parse position string ".concat(t))}}function d(t,e){return t.relative?Math.round(t.position*e):t.position}var A=r(72),g=r(37);function m(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function y(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?m(Object(r),!0).forEach((function(e){a()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}r.d(e,"a",(function(){return v}));var v=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};u()(this,t);var r=e.id,n=void 0===r?null:r,i=e.x,o=void 0===i?0:i,a=e.y,s=void 0===a?0:a,c=e.width,l=void 0===c?"100%":c,f=e.height,p=void 0===f?"100%":f,d=e.viewportInstance,A=e.type,m=void 0===A?h.a:A;Object(g.a)(!d||d instanceof h.a),this.viewportInstance=d,this.id=n||this.constructor.displayName||"view",this.type=m,this.props=y(y({},e),{},{id:this.id}),this._parseDimensions({x:o,y:s,width:l,height:p}),this.equals=this.equals.bind(this),Object.seal(this)}return l()(t,[{key:"equals",value:function(t){return this===t||(this.viewportInstance?t.viewportInstance&&this.viewportInstance.equals(t.viewportInstance):Object(A.a)(this.props,t.props))}},{key:"makeViewport",value:function(t){var e=t.width,r=t.height,n=t.viewState;if(this.viewportInstance)return this.viewportInstance;n=this.filterViewState(n);var i=this.getDimensions({width:e,height:r});return this._getViewport(n,i)}},{key:"getViewStateId",value:function(){switch(i()(this.props.viewState)){case"string":return this.props.viewState;case"object":return this.props.viewState&&this.props.viewState.id;default:return this.id}}},{key:"filterViewState",value:function(t){if(this.props.viewState&&"object"===i()(this.props.viewState)){if(!this.props.viewState.id)return this.props.viewState;var e=y({},t);for(var r in this.props.viewState)"id"!==r&&(e[r]=this.props.viewState[r]);return e}return t}},{key:"getDimensions",value:function(t){var e=t.width,r=t.height;return{x:d(this._x,e),y:d(this._y,r),width:d(this._width,e),height:d(this._height,r)}}},{key:"_getControllerProps",value:function(t){var e=this.props.controller;return e?!0===e?t:("function"==typeof e&&(e={type:e}),y(y({},t),e)):null}},{key:"_getViewport",value:function(t,e){return new(0,this.type)(y(y(y({},t),this.props),e))}},{key:"_parseDimensions",value:function(t){var e=t.x,r=t.y,n=t.width,i=t.height;this._x=p(e),this._y=p(r),this._width=p(n),this._height=p(i)}}]),t}()},function(t,e,r){"use strict";r.d(e,"a",(function(){return a}));var n=r(48),i=r(9);const o={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};class a{static get DRAW_MODE(){return o}constructor(t={}){const{id:e=Object(n.c)("geometry"),drawMode:r=o.TRIANGLES,attributes:i={},indices:a=null,vertexCount:s=null}=t;this.id=e,this.drawMode=0|r,this.attributes={},this.userData={},this._setAttributes(i,a),this.vertexCount=s||this._calculateVertexCount(this.attributes,this.indices)}get mode(){return this.drawMode}getVertexCount(){return this.vertexCount}getAttributes(){return this.indices?{indices:this.indices,...this.attributes}:this.attributes}_print(t){return`Geometry ${this.id} attribute ${t}`}_setAttributes(t,e){e&&(this.indices=ArrayBuffer.isView(e)?{value:e,size:1}:e);for(const e in t){let r=t[e];r=ArrayBuffer.isView(r)?{value:r}:r,Object(i.a)(ArrayBuffer.isView(r.value),`${this._print(e)}: must be typed array or object with value as typed array`),"POSITION"!==e&&"positions"!==e||r.size||(r.size=3),"indices"===e?(Object(i.a)(!this.indices),this.indices=r):this.attributes[e]=r}return this.indices&&void 0!==this.indices.isIndexed&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this}_calculateVertexCount(t,e){if(e)return e.value.length;let r=1/0;for(const e in t){const n=t[e],{value:i,size:o,constant:a}=n;!a&&i&&o>=1&&(r=Math.min(r,i.length/o))}return Object(i.a)(Number.isFinite(r)),r}}},function(t,e,r){"use strict";var n=r(19);const i=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,o=/^([-\w.]+\/[-\w.+]+)/;function a(t){const e=o.exec(t);return e?e[1]:t}function s(t){const e=i.exec(t);return e?e[1]:""}r.d(e,"b",(function(){return c})),r.d(e,"a",(function(){return l}));const u=/\?.*/;function c(t){if(Object(n.j)(t)){const e=h(t.url||"");return{url:e,type:a(t.headers.get("content-type")||"")||s(e)}}return Object(n.b)(t)?{url:h(t.name||""),type:t.type||""}:"string"==typeof t?{url:h(t),type:s(t)}:{url:"",type:""}}function l(t){return Object(n.j)(t)?t.headers["content-length"]||-1:Object(n.b)(t)?t.size:"string"==typeof t?t.length:t instanceof ArrayBuffer?t.byteLength:ArrayBuffer.isView(t)?t.byteLength:-1}function h(t){return t.replace(u,"")}},function(t,e,r){"use strict";r.d(e,"a",(function(){return u}));var n=r(54),i=r(9),o=r(133);const a={offset:0,stride:0,type:5126,size:1,divisor:0,normalized:!1,integer:!1},s={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}};class u{static getBytesPerElement(t){return Object(n.c)(t.type||5126).BYTES_PER_ELEMENT}static getBytesPerVertex(t){return Object(i.a)(t.size),Object(n.c)(t.type||5126).BYTES_PER_ELEMENT*t.size}static resolve(...t){return new u(...[a,...t])}constructor(...t){t.forEach(t=>this._assign(t)),Object.freeze(this)}toString(){return JSON.stringify(this)}get BYTES_PER_ELEMENT(){return u.getBytesPerElement(this)}get BYTES_PER_VERTEX(){return u.getBytesPerVertex(this)}_assign(t={}){return void 0!==(t=Object(o.a)("Accessor",t,s)).type&&(this.type=t.type,5124!==t.type&&5125!==t.type||(this.integer=!0)),void 0!==t.size&&(this.size=t.size),void 0!==t.offset&&(this.offset=t.offset),void 0!==t.stride&&(this.stride=t.stride),void 0!==t.normalized&&(this.normalized=t.normalized),void 0!==t.integer&&(this.integer=t.integer),void 0!==t.divisor&&(this.divisor=t.divisor),void 0!==t.buffer&&(this.buffer=t.buffer),void 0!==t.index&&("boolean"==typeof t.index?this.index=t.index?1:0:this.index=t.index),void 0!==t.instanced&&(this.divisor=t.instanced?1:0),void 0!==t.isInstanced&&(this.divisor=t.isInstanced?1:0),this}}},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";function n(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0};return Array.isArray(t)?i(t,e,[]):e(t)?[t]:[]}function i(t,e,r){for(var n=-1;++n<t.length;){var o=t[n];Array.isArray(o)?i(o,e,r):e(o)&&r.push(o)}return r}function o(t){for(var e=t.target,r=t.source,n=t.start,i=void 0===n?0:n,o=t.count,a=void 0===o?1:o,s=r.length,u=a*s,c=0,l=i;c<s;c++)e[l++]=r[c];for(;c<u;)c<u-c?(e.copyWithin(i+c,i,i+c),c*=2):(e.copyWithin(i+c,i,i+u-c),c=u);return e}r.d(e,"b",(function(){return n})),r.d(e,"a",(function(){return o}))},function(t,e,r){"use strict";var n=r(2),i=r.n(n),o=r(3),a=r.n(o),s=function(){function t(e){i()(this,t),this._pool=[],this.props={overAlloc:2,poolSize:100},this.setProps(e)}return a()(t,[{key:"setProps",value:function(t){Object.assign(this.props,t)}},{key:"allocate",value:function(t,e,r){var n,i=r.size,o=void 0===i?1:i,a=r.type,s=r.padding,u=void 0===s?0:s,c=r.copy,l=void 0!==c&&c,h=r.initialize,f=void 0!==h&&h,p=r.maxCount,d=a||t&&t.constructor||Float32Array,A=e*o+u;if(ArrayBuffer.isView(t)){if(A<=t.length)return t;if(A*t.BYTES_PER_ELEMENT<=t.buffer.byteLength)return new d(t.buffer,0,A)}p&&(n=p*o+u);var g=this._allocate(d,A,f,n);return t&&l?g.set(t):f||g.fill(0,0,4),this._release(t),g}},{key:"release",value:function(t){this._release(t)}},{key:"_allocate",value:function(t,e,r,n){var i=Math.max(Math.ceil(e*this.props.overAlloc),1);i>n&&(i=n);var o=this._pool,a=t.BYTES_PER_ELEMENT*i,s=o.findIndex((function(t){return t.byteLength>=a}));if(s>=0){var u=new t(o.splice(s,1)[0],0,i);return r&&u.fill(0),u}return new t(i)}},{key:"_release",value:function(t){if(ArrayBuffer.isView(t)){var e=this._pool,r=t.buffer,n=r.byteLength,i=e.findIndex((function(t){return t.byteLength>=n}));i<0?e.push(r):(i>0||e.length<this.props.poolSize)&&e.splice(i,0,r),e.length>this.props.poolSize&&e.shift()}}}]),t}();e.a=new s},function(t,e){function r(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise((function(i,o){var a=t.apply(e,n);function s(t){r(a,i,o,s,u,"next",t)}function u(t){r(a,i,o,s,u,"throw",t)}s(void 0)}))}}},function(t,e,r){"use strict";r.d(e,"c",(function(){return i})),r.d(e,"e",(function(){return c})),r.d(e,"a",(function(){return h})),r.d(e,"b",(function(){return f})),r.d(e,"d",(function(){return d}));var n=r(31);const i={3042:!1,32773:new Float32Array([0,0,0,0]),32777:32774,34877:32774,32969:1,32968:0,32971:1,32970:0,3106:new Float32Array([0,0,0,0]),3107:[!0,!0,!0,!0],2884:!1,2885:1029,2929:!1,2931:1,2932:513,2928:new Float32Array([0,1]),2930:!0,3024:!0,36006:null,2886:2305,33170:4352,2849:1,32823:!1,32824:0,10752:0,32938:1,32939:!1,3089:!1,3088:new Int32Array([0,0,1024,1024]),2960:!1,2961:0,2968:4294967295,36005:4294967295,2962:519,2967:0,2963:4294967295,34816:519,36003:0,36004:4294967295,2964:7680,2965:7680,2966:7680,34817:7680,34818:7680,34819:7680,2978:[0,0,1024,1024],3333:4,3317:4,37440:!1,37441:!1,37443:37444,35723:4352,36010:null,35977:!1,3330:0,3332:0,3331:0,3314:0,32878:0,3316:0,3315:0,32877:0},o=(t,e,r)=>e?t.enable(r):t.disable(r),a=(t,e,r)=>t.hint(r,e),s=(t,e,r)=>t.pixelStorei(r,e);function u(t){return Array.isArray(t)||ArrayBuffer.isView(t)}const c={3042:o,32773:(t,e)=>t.blendColor(...e),32777:"blendEquation",34877:"blendEquation",32969:"blendFunc",32968:"blendFunc",32971:"blendFunc",32970:"blendFunc",3106:(t,e)=>t.clearColor(...e),3107:(t,e)=>t.colorMask(...e),2884:o,2885:(t,e)=>t.cullFace(e),2929:o,2931:(t,e)=>t.clearDepth(e),2932:(t,e)=>t.depthFunc(e),2928:(t,e)=>t.depthRange(...e),2930:(t,e)=>t.depthMask(e),3024:o,35723:a,36006:(t,e)=>{const r=Object(n.e)(t)?36009:36160;return t.bindFramebuffer(r,e)},2886:(t,e)=>t.frontFace(e),33170:a,2849:(t,e)=>t.lineWidth(e),32823:o,32824:"polygonOffset",10752:"polygonOffset",35977:o,32938:"sampleCoverage",32939:"sampleCoverage",3089:o,3088:(t,e)=>t.scissor(...e),2960:o,2961:(t,e)=>t.clearStencil(e),2968:(t,e)=>t.stencilMaskSeparate(1028,e),36005:(t,e)=>t.stencilMaskSeparate(1029,e),2962:"stencilFuncFront",2967:"stencilFuncFront",2963:"stencilFuncFront",34816:"stencilFuncBack",36003:"stencilFuncBack",36004:"stencilFuncBack",2964:"stencilOpFront",2965:"stencilOpFront",2966:"stencilOpFront",34817:"stencilOpBack",34818:"stencilOpBack",34819:"stencilOpBack",2978:(t,e)=>t.viewport(...e),3333:s,3317:s,37440:s,37441:s,37443:s,3330:s,3332:s,3331:s,36010:(t,e)=>t.bindFramebuffer(36008,e),3314:s,32878:s,3316:s,3315:s,32877:s,framebuffer:(t,e)=>{const r=e&&"handle"in e?e.handle:e;return t.bindFramebuffer(36160,r)},blend:(t,e)=>e?t.enable(3042):t.disable(3042),blendColor:(t,e)=>t.blendColor(...e),blendEquation:(t,e)=>{e=u(e)?e:[e,e],t.blendEquationSeparate(...e)},blendFunc:(t,e)=>{e=u(e)&&2===e.length?[...e,...e]:e,t.blendFuncSeparate(...e)},clearColor:(t,e)=>t.clearColor(...e),clearDepth:(t,e)=>t.clearDepth(e),clearStencil:(t,e)=>t.clearStencil(e),colorMask:(t,e)=>t.colorMask(...e),cull:(t,e)=>e?t.enable(2884):t.disable(2884),cullFace:(t,e)=>t.cullFace(e),depthTest:(t,e)=>e?t.enable(2929):t.disable(2929),depthFunc:(t,e)=>t.depthFunc(e),depthMask:(t,e)=>t.depthMask(e),depthRange:(t,e)=>t.depthRange(...e),dither:(t,e)=>e?t.enable(3024):t.disable(3024),derivativeHint:(t,e)=>{t.hint(35723,e)},frontFace:(t,e)=>t.frontFace(e),mipmapHint:(t,e)=>t.hint(33170,e),lineWidth:(t,e)=>t.lineWidth(e),polygonOffsetFill:(t,e)=>e?t.enable(32823):t.disable(32823),polygonOffset:(t,e)=>t.polygonOffset(...e),sampleCoverage:(t,e)=>t.sampleCoverage(...e),scissorTest:(t,e)=>e?t.enable(3089):t.disable(3089),scissor:(t,e)=>t.scissor(...e),stencilTest:(t,e)=>e?t.enable(2960):t.disable(2960),stencilMask:(t,e)=>{e=u(e)?e:[e,e];const[r,n]=e;t.stencilMaskSeparate(1028,r),t.stencilMaskSeparate(1029,n)},stencilFunc:(t,e)=>{e=u(e)&&3===e.length?[...e,...e]:e;const[r,n,i,o,a,s]=e;t.stencilFuncSeparate(1028,r,n,i),t.stencilFuncSeparate(1029,o,a,s)},stencilOp:(t,e)=>{e=u(e)&&3===e.length?[...e,...e]:e;const[r,n,i,o,a,s]=e;t.stencilOpSeparate(1028,r,n,i),t.stencilOpSeparate(1029,o,a,s)},viewport:(t,e)=>t.viewport(...e)};function l(t,e,r){return void 0!==e[t]?e[t]:r[t]}const h={blendEquation:(t,e,r)=>t.blendEquationSeparate(l(32777,e,r),l(34877,e,r)),blendFunc:(t,e,r)=>t.blendFuncSeparate(l(32969,e,r),l(32968,e,r),l(32971,e,r),l(32970,e,r)),polygonOffset:(t,e,r)=>t.polygonOffset(l(32824,e,r),l(10752,e,r)),sampleCoverage:(t,e,r)=>t.sampleCoverage(l(32938,e,r),l(32939,e,r)),stencilFuncFront:(t,e,r)=>t.stencilFuncSeparate(1028,l(2962,e,r),l(2967,e,r),l(2963,e,r)),stencilFuncBack:(t,e,r)=>t.stencilFuncSeparate(1029,l(34816,e,r),l(36003,e,r),l(36004,e,r)),stencilOpFront:(t,e,r)=>t.stencilOpSeparate(1028,l(2964,e,r),l(2965,e,r),l(2966,e,r)),stencilOpBack:(t,e,r)=>t.stencilOpSeparate(1029,l(34817,e,r),l(34818,e,r),l(34819,e,r))},f={enable:(t,e)=>t({[e]:!0}),disable:(t,e)=>t({[e]:!1}),pixelStorei:(t,e,r)=>t({[e]:r}),hint:(t,e,r)=>t({[e]:r}),bindFramebuffer:(t,e,r)=>{switch(e){case 36160:return t({36006:r,36010:r});case 36009:return t({36006:r});case 36008:return t({36010:r});default:return null}},blendColor:(t,e,r,n,i)=>t({32773:new Float32Array([e,r,n,i])}),blendEquation:(t,e)=>t({32777:e,34877:e}),blendEquationSeparate:(t,e,r)=>t({32777:e,34877:r}),blendFunc:(t,e,r)=>t({32969:e,32968:r,32971:e,32970:r}),blendFuncSeparate:(t,e,r,n,i)=>t({32969:e,32968:r,32971:n,32970:i}),clearColor:(t,e,r,n,i)=>t({3106:new Float32Array([e,r,n,i])}),clearDepth:(t,e)=>t({2931:e}),clearStencil:(t,e)=>t({2961:e}),colorMask:(t,e,r,n,i)=>t({3107:[e,r,n,i]}),cullFace:(t,e)=>t({2885:e}),depthFunc:(t,e)=>t({2932:e}),depthRange:(t,e,r)=>t({2928:new Float32Array([e,r])}),depthMask:(t,e)=>t({2930:e}),frontFace:(t,e)=>t({2886:e}),lineWidth:(t,e)=>t({2849:e}),polygonOffset:(t,e,r)=>t({32824:e,10752:r}),sampleCoverage:(t,e,r)=>t({32938:e,32939:r}),scissor:(t,e,r,n,i)=>t({3088:new Int32Array([e,r,n,i])}),stencilMask:(t,e)=>t({2968:e,36005:e}),stencilMaskSeparate:(t,e,r)=>t({[1028===e?2968:36005]:r}),stencilFunc:(t,e,r,n)=>t({2962:e,2967:r,2963:n,34816:e,36003:r,36004:n}),stencilFuncSeparate:(t,e,r,n,i)=>t({[1028===e?2962:34816]:r,[1028===e?2967:36003]:n,[1028===e?2963:36004]:i}),stencilOp:(t,e,r,n)=>t({2964:e,2965:r,2966:n,34817:e,34818:r,34819:n}),stencilOpSeparate:(t,e,r,n,i)=>t({[1028===e?2964:34817]:r,[1028===e?2965:34818]:n,[1028===e?2966:34819]:i}),viewport:(t,e,r,n,i)=>t({2978:[e,r,n,i]})},p=(t,e)=>t.isEnabled(e),d={3042:p,2884:p,2929:p,3024:p,32823:p,32926:p,32928:p,3089:p,2960:p,35977:p}},function(t,e,r){"use strict";(function(t){r.d(e,"c",(function(){return l})),r.d(e,"b",(function(){return h})),r.d(e,"a",(function(){return f}));var n=r(69),i=r(84),o=r(36),a=r(132);function s(t,e){const r=t[e].bind(t);t[e]=function(...e){const n=e[0];return n in t.state.cache&&t.state.enable?t.state.cache[n]:r(...e)},Object.defineProperty(t[e],"name",{value:`${e}-from-cache`,configurable:!1})}function u(t,e,r){const n=t[e].bind(t);t[e]=function(...e){const{valueChanged:i,oldValue:o}=r(t.state._updateCache,...e);return i&&n(...e),o},Object.defineProperty(t[e],"name",{value:`${e}-to-cache`,configurable:!1})}class c{constructor(t,{copyState:e=!1,log:r=(()=>{})}={}){this.gl=t,this.program=null,this.stateStack=[],this.enable=!0,this.cache=e?Object(i.a)(t):Object.assign({},n.c),this.log=r,this._updateCache=this._updateCache.bind(this),Object.seal(this)}push(t={}){this.stateStack.push({})}pop(){Object(o.a)(this.stateStack.length>0);const t=this.stateStack[this.stateStack.length-1];Object(i.c)(this.gl,t),this.stateStack.pop()}_updateCache(t){let e,r=!1;const n=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(const i in t){Object(o.a)(void 0!==i);const s=t[i],u=this.cache[i];Object(a.a)(s,u)||(r=!0,e=u,!n||i in n||(n[i]=u),this.cache[i]=s)}return{valueChanged:r,oldValue:e}}}function l(e,r={}){const{enable:i=!0,copyState:a}=r;if(Object(o.a)(void 0!==a),!e.state){const r=void 0!==t?t:window,{polyfillContext:i}=r;i&&i(e),e.state=new c(e,{copyState:a}),function(t){const e=t.useProgram.bind(t);t.useProgram=function(r){t.state.program!==r&&(e(r),t.state.program=r)}}(e);for(const t in n.b){u(e,t,n.b[t])}s(e,"getParameter"),s(e,"isEnabled")}return e.state.enable=i,e}function h(t){t.state||l(t,{copyState:!1}),t.state.push()}function f(t){Object(o.a)(t.state),t.state.pop()}}).call(this,r(65))},function(t,e,r){"use strict";r.d(e,"a",(function(){return f}));var n=r(7),i=r(39),o=r(98),a=r(100),s=r(178),u=r(197),c=r(240),l=r(49),h=r(9);class f extends i.a{static isSupported(t,e={}){const{colorBufferFloat:r,colorBufferHalfFloat:n}=e;let i=!0;return r&&(i=Boolean(t.getExtension("EXT_color_buffer_float")||t.getExtension("WEBGL_color_buffer_float")||t.getExtension("OES_texture_float"))),n&&(i=i&&Boolean(t.getExtension("EXT_color_buffer_float")||t.getExtension("EXT_color_buffer_half_float"))),i}static getDefaultFramebuffer(t){return t.luma=t.luma||{},t.luma.defaultFramebuffer=t.luma.defaultFramebuffer||new f(t,{id:"default-framebuffer",handle:null,attachments:{}}),t.luma.defaultFramebuffer}get MAX_COLOR_ATTACHMENTS(){const t=Object(n.a)(this.gl);return t.getParameter(t.MAX_COLOR_ATTACHMENTS)}get MAX_DRAW_BUFFERS(){const t=Object(n.a)(this.gl);return t.getParameter(t.MAX_DRAW_BUFFERS)}constructor(t,e={}){super(t,e),this.width=null,this.height=null,this.attachments={},this.readBuffer=36064,this.drawBuffers=[36064],this.ownResources=[],this.initialize(e),Object.seal(this)}get color(){return this.attachments[36064]||null}get texture(){return this.attachments[36064]||null}get depth(){return this.attachments[36096]||this.attachments[33306]||null}get stencil(){return this.attachments[36128]||this.attachments[33306]||null}initialize({width:t=1,height:e=1,attachments:r=null,color:n=!0,depth:i=!0,stencil:o=!1,check:a=!0,readBuffer:s,drawBuffers:u}){if(Object(h.a)(t>=0&&e>=0,"Width and height need to be integers"),this.width=t,this.height=e,r)for(const n in r){const i=r[n];(Array.isArray(i)?i[0]:i).resize({width:t,height:e})}else r=this._createDefaultAttachments(n,i,o,t,e);this.update({clearAttachments:!0,attachments:r,readBuffer:s,drawBuffers:u}),r&&a&&this.checkStatus()}delete(){for(const t of this.ownResources)t.delete();return super.delete(),this}update({attachments:t={},readBuffer:e,drawBuffers:r,clearAttachments:n=!1,resizeAttachments:i=!0}){this.attach(t,{clearAttachments:n,resizeAttachments:i});const{gl:o}=this,a=o.bindFramebuffer(36160,this.handle);return e&&this._setReadBuffer(e),r&&this._setDrawBuffers(r),o.bindFramebuffer(36160,a||null),this}resize(t={}){let{width:e,height:r}=t;if(null===this.handle)return Object(h.a)(void 0===e&&void 0===r),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;void 0===e&&(e=this.gl.drawingBufferWidth),void 0===r&&(r=this.gl.drawingBufferHeight),e!==this.width&&r!==this.height&&n.k.log(2,`Resizing framebuffer ${this.id} to ${e}x${r}`)();for(const t in this.attachments)this.attachments[t].resize({width:e,height:r});return this.width=e,this.height=r,this}attach(t,{clearAttachments:e=!1,resizeAttachments:r=!0}={}){const n={};e&&Object.keys(this.attachments).forEach(t=>{n[t]=null}),Object.assign(n,t);const i=this.gl.bindFramebuffer(36160,this.handle);for(const t in n){Object(h.a)(void 0!==t,"Misspelled framebuffer binding point?");const e=Number(t),i=n[e];let o=i;if(o)if(o instanceof a.a)this._attachRenderbuffer({attachment:e,renderbuffer:o});else if(Array.isArray(i)){const[t,r=0,n=0]=i;o=t,this._attachTexture({attachment:e,texture:t,layer:r,level:n})}else this._attachTexture({attachment:e,texture:o,layer:0,level:0});else this._unattach(e);r&&o&&o.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,i||null),Object.assign(this.attachments,t),Object.keys(this.attachments).filter(t=>!this.attachments[t]).forEach(t=>{delete this.attachments[t]})}checkStatus(){const{gl:t}=this,e=this.getStatus();if(36053!==e)throw new Error(function(t){return(f.STATUS||{})[t]||`Framebuffer error ${t}`}(e));return this}getStatus(){const{gl:t}=this,e=t.bindFramebuffer(36160,this.handle),r=t.checkFramebufferStatus(36160);return t.bindFramebuffer(36160,e||null),r}clear(t={}){const{color:e,depth:r,stencil:n,drawBuffers:i=[]}=t,o=this.gl.bindFramebuffer(36160,this.handle);return(e||r||n)&&Object(s.a)(this.gl,{color:e,depth:r,stencil:n}),i.forEach((t,e)=>{Object(s.b)(this.gl,{drawBuffer:e,value:t})}),this.gl.bindFramebuffer(36160,o||null),this}readPixels(t={}){return n.k.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}readPixelsToBuffer(t={}){return n.k.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}copyToDataUrl(t={}){return n.k.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}copyToImage(t={}){return n.k.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}copyToTexture(t={}){return n.k.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}blit(t={}){return n.k.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}invalidate({attachments:t=[],x:e=0,y:r=0,width:i,height:o}){const a=Object(n.a)(this.gl),s=a.bindFramebuffer(36008,this.handle);return 0===e&&0===r&&void 0===i&&void 0===o?a.invalidateFramebuffer(36008,t):a.invalidateFramebuffer(36008,t,e,r,i,o),a.bindFramebuffer(36008,s),this}getAttachmentParameter(t,e,r){let n=this._getAttachmentParameterFallback(e);return null===n&&(this.gl.bindFramebuffer(36160,this.handle),n=this.gl.getFramebufferAttachmentParameter(36160,t,e),this.gl.bindFramebuffer(36160,null)),r&&n>1e3&&(n=Object(l.a)(this.gl,n)),n}getAttachmentParameters(t=36064,e,r=this.constructor.ATTACHMENT_PARAMETERS||[]){const n={};for(const i of r){n[e?Object(l.a)(this.gl,i):i]=this.getAttachmentParameter(t,i,e)}return n}getParameters(t=!0){const e=Object.keys(this.attachments),r={};for(const n of e){const e=Number(n);r[t?Object(l.a)(this.gl,e):e]=this.getAttachmentParameters(e,t)}return r}show(){return"undefined"!=typeof window&&window.open(Object(u.a)(this),"luma-debug-texture"),this}log(t=0,e=""){if(t>n.k.level||"undefined"==typeof window)return this;e=e||`Framebuffer ${this.id}`;const r=Object(u.a)(this,{targetMaxHeight:100});return n.k.image({logLevel:t,message:e,image:r},e)(),this}bind({target:t=36160}={}){return this.gl.bindFramebuffer(t,this.handle),this}unbind({target:t=36160}={}){return this.gl.bindFramebuffer(t,null),this}_createDefaultAttachments(t,e,r,n,i){let s=null;return t&&(s=s||{},s[36064]=new o.a(this.gl,{id:`${this.id}-color0`,pixels:null,format:6408,type:5121,width:n,height:i,mipmaps:!1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.ownResources.push(s[36064])),e&&r?(s=s||{},s[33306]=new a.a(this.gl,{id:`${this.id}-depth-stencil`,format:35056,width:n,height:111}),this.ownResources.push(s[33306])):e?(s=s||{},s[36096]=new a.a(this.gl,{id:`${this.id}-depth`,format:33189,width:n,height:i}),this.ownResources.push(s[36096])):r&&Object(h.a)(!1),s}_unattach(t){const e=this.attachments[t];e&&(e instanceof a.a?this.gl.framebufferRenderbuffer(36160,t,36161,null):this.gl.framebufferTexture2D(36160,t,3553,null,0),delete this.attachments[t])}_attachRenderbuffer({attachment:t=36064,renderbuffer:e}){const{gl:r}=this;r.framebufferRenderbuffer(36160,t,36161,e.handle),this.attachments[t]=e}_attachTexture({attachment:t=36064,texture:e,layer:r,level:i}){const{gl:o}=this;switch(o.bindTexture(e.target,e.handle),e.target){case 35866:case 32879:Object(n.a)(o).framebufferTextureLayer(36160,t,e.target,i,r);break;case 34067:const a=function(t){return t<34069?t+34069:t}(r);o.framebufferTexture2D(36160,t,a,e.handle,i);break;case 3553:o.framebufferTexture2D(36160,t,3553,e.handle,i);break;default:Object(h.a)(!1,"Illegal texture type")}o.bindTexture(e.target,null),this.attachments[t]=e}_setReadBuffer(t){const e=Object(n.g)(this.gl);e?e.readBuffer(t):Object(h.a)(36064===t||1029===t,"Multiple render targets not supported"),this.readBuffer=t}_setDrawBuffers(t){const{gl:e}=this,r=Object(n.a)(e);if(r)r.drawBuffers(t);else{const r=e.getExtension("WEBGL_draw_buffers");r?r.drawBuffersWEBGL(t):Object(h.a)(1===t.length&&(36064===t[0]||1029===t[0]),"Multiple render targets not supported")}this.drawBuffers=t}_getAttachmentParameterFallback(t){const e=Object(c.a)(this.gl);switch(t){case 36052:return e.WEBGL2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return e.WEBGL2?null:8;case 33297:return e.WEBGL2?null:5125;case 33296:return e.WEBGL2||e.EXT_sRGB?null:9729;default:return null}}_createHandle(){return this.gl.createFramebuffer()}_deleteHandle(){this.gl.deleteFramebuffer(this.handle)}_bindHandle(t){return this.gl.bindFramebuffer(36160,t)}}f.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303]},function(t,e,r){"use strict";function n(t,e){if(t===e)return!0;if(!t||!e)return!1;for(var r in t){var i=t[r],o=e[r];if(!(i===o||Array.isArray(i)&&Array.isArray(o)&&n(i,o)))return!1}return!0}r.d(e,"a",(function(){return n}))},function(t,e,r){"use strict";r.d(e,"a",(function(){return p}));var n=r(0),i=r.n(n),o=r(2),a=r.n(o),s=r(3),u=r.n(s);function c(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function l(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?c(Object(r),!0).forEach((function(e){i()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function h(){}var f={onStart:h,onUpdate:h,onInterrupt:h,onEnd:h},p=function(){function t(e){a()(this,t),this._inProgress=!1,this._handle=null,this.timeline=e,this.settings={}}return u()(t,[{key:"start",value:function(t){this.cancel(),this.settings=l(l({},f),t),this._inProgress=!0,this.settings.onStart(this)}},{key:"end",value:function(){this._inProgress&&(this.timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1,this.settings.onEnd(this))}},{key:"cancel",value:function(){this._inProgress&&(this.settings.onInterrupt(this),this.timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1)}},{key:"update",value:function(){if(!this._inProgress)return!1;if(null===this._handle){var t=this.timeline,e=this.settings;this._handle=t.addChannel({delay:t.getTime(),duration:e.duration})}return this.time=this.timeline.getTime(this._handle),this._onUpdate(),this.settings.onUpdate(this),this.timeline.isFinished(this._handle)&&this.end(),!0}},{key:"_onUpdate",value:function(){}},{key:"inProgress",get:function(){return this._inProgress}}]),t}()},function(t,e,r){"use strict";function n(t,e,r){const n=e[0],i=e[1],o=r[3]*n+r[7]*i||1;return t[0]=(r[0]*n+r[4]*i)/o,t[1]=(r[1]*n+r[5]*i)/o,t}function i(t,e,r){const n=e[0],i=e[1],o=e[2],a=r[3]*n+r[7]*i+r[11]*o||1;return t[0]=(r[0]*n+r[4]*i+r[8]*o)/a,t[1]=(r[1]*n+r[5]*i+r[9]*o)/a,t[2]=(r[2]*n+r[6]*i+r[10]*o)/a,t}function o(t,e,r){const n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t[2]=e[2],t}function a(t,e,r){const n=e[0],i=e[1],o=e[2];return t[0]=r[0]*n+r[3]*i+r[6]*o,t[1]=r[1]*n+r[4]*i+r[7]*o,t[2]=r[2]*n+r[5]*i+r[8]*o,t[3]=e[3],t}r.d(e,"a",(function(){return n})),r.d(e,"c",(function(){return i})),r.d(e,"b",(function(){return o})),r.d(e,"d",(function(){return a}))},function(t,e,r){"use strict";r.d(e,"b",(function(){return n})),r.d(e,"a",(function(){return i}));const n="vs",i="fs"},function(t,e,r){"use strict";(function(t,n){r.d(e,"a",(function(){return o})),r.d(e,"b",(function(){return a})),r.d(e,"d",(function(){return s})),r.d(e,"c",(function(){return u}));const i={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==t&&t,document:"undefined"!=typeof document&&document},o=i.global||i.self||i.window||{},a="object"!=typeof n||"[object process]"!==String(n)||n.browser,s="function"==typeof importScripts,u="undefined"!=typeof window&&void 0!==window.orientation,c=void 0!==n&&n.version&&/v([0-9]*)/.exec(n.version);c&&parseFloat(c[1])}).call(this,r(65),r(57))},function(t,e,r){"use strict";r.r(e);var n=r(94),i=r(20);async function o(t,e,r){if("number"==typeof t)return await i.a._readToArrayBuffer(t,e,r);t instanceof Blob||(t=new Blob([t]));const n=t.slice(e,e+r);return await async function(t){return await new Promise((e,r)=>{const n=new FileReader;n.onload=t=>{var r;return e(null==t?void 0:null===(r=t.target)||void 0===r?void 0:r.result)},n.onerror=t=>r(t),n.readAsArrayBuffer(t)})}(n)}var a=r(92),s=r(83),u=r(78),c=r(97);function l(t,e={}){if(t=Object(a.b)(t),!s.c){const r=i.a.readFileSync(t,e);return"string"!=typeof r?Object(u.d)(r):r}return e.nothrow||Object(c.a)(!1),null}var h=r(144);async function f(t,e,r){t=Object(a.b)(t),s.c||await i.a.writeFile(t,Object(h.a)(e),{flag:"w"}),Object(c.a)(!1)}function p(t,e,r){t=Object(a.b)(t),s.c||i.a.writeFileSync(t,Object(h.a)(e),{flag:"w"}),Object(c.a)(!1)}var d=r(41);function A(t){Object(d.d)(t)}var g=r(104),m=r(79),y=r(96),v=r(47),_=r(115),b=r(88),x=r(63);function w(t,e,r,n){Object(c.a)(!n||"object"==typeof n),Array.isArray(e)||Object(v.a)(e)||(n=void 0,r=e,e=void 0),r=r||{};const i=e,o=Object(b.b)(i,n),a=Object(m.b)(t,o,r);if(!a)return null;r=Object(d.c)(r,a,o);const{url:s}=Object(x.b)(t);return function(t,e,r,n){if(e=Object(_.b)(e,t,r),t.parseTextSync&&"string"==typeof e)return t.parseTextSync(e,r);if(t.parseSync&&e instanceof ArrayBuffer)return t.parseSync(e,r,n);throw new Error(`${t.name} loader: 'parseSync' not supported by this loader, use 'parse' instead. ${n.url||""}`)}(a,t,r,n=Object(b.a)({url:s,parseSync:w,parse:()=>{throw new Error("parseSync called parse")},loaders:e},r))}var E=r(151);async function S(t,e,r,n){Object(c.a)(!n||"object"==typeof n),Array.isArray(e)||Object(v.a)(e)||(n=void 0,r=e,e=void 0),t=await t,r=r||{};const{url:i}=Object(x.b)(t),o=await Object(m.a)(t,e,r);return o?(r=Object(d.c)(r,o,e,i),n=Object(b.a)({url:i,parseInBatches:S,parse:y.a,loaders:e},r,n),await async function(t,e,r,n){const i=await async function(t,e,r,n){const i=await Object(_.c)(e,r),o=await async function(t,e=[]){let r=t;for await(const t of e)r=t(r);return r}(i,(null==r?void 0:r.transforms)||[]);if(t.parseInBatches)return t.parseInBatches(o,r,n);return async function*(){const e=await Object(E.a)(o),i=await Object(y.a)(e,t,{...r,mimeType:t.mimeTypes[0]},n),a={mimeType:t.mimeTypes[0],shape:Array.isArray(i)?"row-table":"unknown",batchType:"data",data:i,length:Array.isArray(i)?i.length:1};yield a}()}(t,e,r,n);if(!r.metadata)return i;const o={batchType:"metadata",metadata:{_loader:t,_context:n},data:[],bytesUsed:0};return async function*(t){yield o,yield*t}(i)}(o,t,r,n)):null}var O=r(206);function T(t,e,r,n){Array.isArray(e)||Object(v.a)(e)||(void 0,r=e,e=null);const i=Object(d.a)(r||{});return Array.isArray(t)?t.map(t=>P(t,e,r,i)):P(t,e,r,i)}async function P(t,e,r,n){if("string"==typeof t){const i=t,o=await n(i);return await S(o,e,r)}return await S(t,e,r)}async function M(t,e,r){if(e.encode)return await e.encode(t,r);if(e.encodeSync)return e.encodeSync(t,r);if(e.encodeText)return(new TextEncoder).encode(await e.encodeText(t,r));if(e.encodeInBatches){const n=k(t,e,r),i=[];for await(const t of n)i.push(t);return Object(u.b)(...i)}if(!s.c&&e.encodeURLtoURL){const i=L("input");await f(i,t);const o=L("output"),a=await R(i,o,e,r);return(await Object(n.a)(a)).arrayBuffer()}throw new Error("Writer could not encode data")}function C(t,e,r){if(e.encodeSync)return e.encodeSync(t,r);throw new Error("Writer could not synchronously encode data")}async function I(t,e,r){if(e.text&&e.encodeText)return await e.encodeText(t,r);if(e.text&&(e.encode||e.encodeInBatches)){const n=await M(t,e,r);return(new TextDecoder).decode(n)}throw new Error("Writer could not encode data as text")}function k(t,e,r){if(e.encodeInBatches){const n=function(t){return[{table:t,start:0,end:t.length}]}(t);return e.encodeInBatches(n,r)}throw new Error("Writer could not encode data in batches")}async function R(t,e,r,n){if(t=Object(a.b)(t),e=Object(a.b)(e),s.c||!r.encodeURLtoURL)throw new Error;return await r.encodeURLtoURL(t,e,n)}function L(t){return`/tmp/${t}`}async function j(t,e,r,n){const i=await M(t,r,n);return await f(e,i)}function D(t,e,r,n){return p(e,C(t,r,n))}var B=r(211),F=r(116);function z(t,e){const r=t[Symbol.asyncIterator]?t[Symbol.asyncIterator]():t[Symbol.iterator]();return new ReadableStream({type:"bytes",async pull(t){try{const{done:e,value:n}=await r.next();e?t.close():t.enqueue(new Uint8Array(n))}catch(e){t.error(e)}},async cancel(){var t;await(null==r?void 0:null===(t=r.return)||void 0===t?void 0:t.call(r))}},{highWaterMark:2**24,...e})}var N=r(236);function U(t,e){return s.c?z(t,e):Object(N.makeNodeStream)(t,e)}var V=r(212);const G={name:"Null loader",id:"null",module:"core",version:"3.0.8",worker:!0,mimeTypes:["application/x.empty"],extensions:["null"],tests:[()=>!1],options:{null:{}}},W={name:"Null loader",id:"null",module:"core",version:"3.0.8",mimeTypes:["application/x.empty"],extensions:["null"],parse:async t=>t,parseSync:t=>t,parseInBatches:async function*(t){for await(const e of t)yield e},tests:[()=>!1],options:{null:{}}};var H=r(213);async function q(t,e,r=(()=>{}),n=(()=>{})){if(!(t=await t).ok)return t;const i=t.body;if(!i)return t;const o=t.headers.get("content-length")||0,a=o&&parseInt(o);if(!(o>0))return t;if("undefined"==typeof ReadableStream||!i.getReader)return t;const s=new ReadableStream({async start(t){const o=i.getReader();await async function t(e,r,n,i,o,a,s){try{const{done:u,value:c}=await r.read();if(u)return a(),void e.close();n+=c.byteLength;const l=Math.round(n/i*100);o(l,{loadedBytes:n,totalBytes:i}),e.enqueue(c),await t(e,r,n,i,o,a,s)}catch(t){e.error(t),s(t)}}(t,o,0,a,e,r,n)}});return new Response(s)}var Z=r(4);class X{constructor(t,e){Object(Z.a)(this,"_fetch",void 0),Object(Z.a)(this,"files",{}),Object(Z.a)(this,"lowerCaseFiles",{}),Object(Z.a)(this,"usedFiles",{}),this._fetch=(null==e?void 0:e.fetch)||fetch;for(let e=0;e<t.length;++e){const r=t[e];this.files[r.name]=r,this.lowerCaseFiles[r.name.toLowerCase()]=r,this.usedFiles[r.name]=!1}this.fetch=this.fetch.bind(this)}async fetch(t,e){if(t.includes("://"))return this._fetch(t,e);const r=this.files[t];if(!r)return new Response(t,{status:400,statusText:"NOT FOUND"});const n=new Headers(null==e?void 0:e.headers).get("Range"),i=n&&/bytes=($1)-($2)/.exec(n);if(i){const e=parseInt(i[1]),n=parseInt(i[2]),o=await r.slice(e,n).arrayBuffer(),a=new Response(o);return Object.defineProperty(a,"url",{value:t}),a}const o=new Response(r);return Object.defineProperty(o,"url",{value:t}),o}async readdir(t){const e=[];for(const t in this.files)e.push(t);return e}async stat(t,e){const r=this.files[t];if(!r)throw new Error(t);return{size:r.size}}async unlink(t){delete this.files[t],delete this.lowerCaseFiles[t],this.usedFiles[t]=!0}async open(t,e,r){return this.files[t]}async read(t,e,r=0,n=e.byteLength,i=null){const o=t;return{bytesRead:n,buffer:await o.slice(0,0+n).arrayBuffer()}}async close(t){}_getFile(t,e){const r=this.files[t]||this.lowerCaseFiles[t];return r&&e&&(this.usedFiles[t]=!0),r}}var Q=r(124),Y=r(19);r.d(e,"fetchFile",(function(){return n.a})),r.d(e,"readArrayBuffer",(function(){return o})),r.d(e,"readFileSync",(function(){return l})),r.d(e,"writeFile",(function(){return f})),r.d(e,"writeFileSync",(function(){return p})),r.d(e,"setLoaderOptions",(function(){return A})),r.d(e,"registerLoaders",(function(){return g.c})),r.d(e,"selectLoader",(function(){return m.a})),r.d(e,"selectLoaderSync",(function(){return m.b})),r.d(e,"parse",(function(){return y.a})),r.d(e,"parseSync",(function(){return w})),r.d(e,"parseInBatches",(function(){return S})),r.d(e,"load",(function(){return O.a})),r.d(e,"loadInBatches",(function(){return T})),r.d(e,"encode",(function(){return M})),r.d(e,"encodeSync",(function(){return C})),r.d(e,"encodeInBatches",(function(){return k})),r.d(e,"encodeText",(function(){return I})),r.d(e,"encodeURLtoURL",(function(){return R})),r.d(e,"save",(function(){return j})),r.d(e,"saveSync",(function(){return D})),r.d(e,"setPathPrefix",(function(){return a.c})),r.d(e,"getPathPrefix",(function(){return a.a})),r.d(e,"resolvePath",(function(){return a.b})),r.d(e,"RequestScheduler",(function(){return B.a})),r.d(e,"makeIterator",(function(){return F.a})),r.d(e,"makeStream",(function(){return U})),r.d(e,"makeDOMStream",(function(){return z})),r.d(e,"makeNodeStream",(function(){return V.makeNodeStream})),r.d(e,"NullWorkerLoader",(function(){return G})),r.d(e,"NullLoader",(function(){return W})),r.d(e,"JSONLoader",(function(){return H.a})),r.d(e,"_fetchProgress",(function(){return q})),r.d(e,"_BrowserFileSystem",(function(){return X})),r.d(e,"_unregisterLoaders",(function(){return g.a})),r.d(e,"isBrowser",(function(){return s.c})),r.d(e,"isWorker",(function(){return s.d})),r.d(e,"self",(function(){return s.e})),r.d(e,"window",(function(){return s.f})),r.d(e,"global",(function(){return s.b})),r.d(e,"document",(function(){return s.a})),r.d(e,"assert",(function(){return c.a})),r.d(e,"forEach",(function(){return E.b})),r.d(e,"concatenateArrayBuffersAsync",(function(){return E.a})),r.d(e,"makeTextDecoderIterator",(function(){return Q.c})),r.d(e,"makeTextEncoderIterator",(function(){return Q.d})),r.d(e,"makeLineIterator",(function(){return Q.a})),r.d(e,"makeNumberedLineIterator",(function(){return Q.b})),r.d(e,"isPureObject",(function(){return Y.h})),r.d(e,"isPromise",(function(){return Y.g})),r.d(e,"isIterable",(function(){return Y.d})),r.d(e,"isAsyncIterable",(function(){return Y.a})),r.d(e,"isIterator",(function(){return Y.e})),r.d(e,"isResponse",(function(){return Y.j})),r.d(e,"isReadableStream",(function(){return Y.i})),r.d(e,"isWritableStream",(function(){return Y.k}))},function(t,e,r){"use strict";r.d(e,"d",(function(){return i})),r.d(e,"a",(function(){return o})),r.d(e,"b",(function(){return a})),r.d(e,"c",(function(){return s}));var n=r(89);function i(t){if(n.toArrayBuffer&&(t=n.toArrayBuffer(t)),t instanceof ArrayBuffer)return t;if(ArrayBuffer.isView(t))return t.buffer;if("string"==typeof t){const e=t;return(new TextEncoder).encode(e).buffer}if(t&&"object"==typeof t&&t._toArrayBuffer)return t._toArrayBuffer();throw new Error("toArrayBuffer")}function o(t,e,r){if(r=r||t.byteLength,t.byteLength<r||e.byteLength<r)return!1;const n=new Uint8Array(t),i=new Uint8Array(e);for(let t=0;t<n.length;++t)if(n[t]!==i[t])return!1;return!0}function a(...t){const e=t.map(t=>t instanceof ArrayBuffer?new Uint8Array(t):t),r=e.reduce((t,e)=>t+e.byteLength,0),n=new Uint8Array(r);let i=0;for(const t of e)n.set(t,i),i+=t.byteLength;return n.buffer}function s(t,e,r){const n=void 0!==r?new Uint8Array(t).subarray(e,e+r):new Uint8Array(t).subarray(e);return new Uint8Array(n).buffer}},function(t,e,r){"use strict";r.d(e,"a",(function(){return c})),r.d(e,"b",(function(){return l}));var n=r(78),i=r(47),o=r(63),a=r(104),s=r(19);const u=/\.([^.]+)$/;async function c(t,e=[],r,n){if(!h(t))return null;let i=l(t,e,{...r,nothrow:!0},n);if(i)return i;if(Object(s.b)(t)&&(i=l(t=await t.slice(0,10).arrayBuffer(),e,r,n)),!(i||null!=r&&r.nothrow))throw new Error(f(t));return i}function l(t,e=[],r,n){if(!h(t))return null;if(e&&!Array.isArray(e))return Object(i.b)(e);let s=[];e&&(s=s.concat(e)),null!=r&&r.ignoreRegisteredLoaders||s.push(...Object(a.b)()),function(t){for(const e of t)Object(i.b)(e)}(s);const c=function(t,e,r,n){const{url:i,type:a}=Object(o.b)(t),s=i||(null==n?void 0:n.url);let c=null;null!=r&&r.mimeType&&(c=p(e,null==r?void 0:r.mimeType));return c=c||function(t,e){const r=e&&u.exec(e),n=r&&r[1];return n?function(t,e){e=e.toLowerCase();for(const r of t)for(const t of r.extensions)if(t.toLowerCase()===e)return r;return null}(t,n):null}(e,s),c=c||p(e,a),c=c||function(t,e){if(!e)return null;for(const r of t)if("string"==typeof e){if(d(e,r))return r}else if(ArrayBuffer.isView(e)){if(A(e.buffer,e.byteOffset,r))return r}else if(e instanceof ArrayBuffer){if(A(e,0,r))return r}return null}(e,t),c=c||p(e,null==r?void 0:r.fallbackMimeType),c}(t,s,r,n);if(!(c||null!=r&&r.nothrow))throw new Error(f(t));return c}function h(t){return!(t instanceof Response&&204===t.status)}function f(t){const{url:e,type:r}=Object(o.b)(t);let n="No valid loader found";return t&&(n+=` data: "${function(t,e=5){if("string"==typeof t)return t.slice(0,e);if(ArrayBuffer.isView(t))return g(t.buffer,t.byteOffset,e);if(t instanceof ArrayBuffer){return g(t,0,e)}return""}(t)}", contentType: "${r}"`),e&&(n+=` url: ${e}`),n}function p(t,e){for(const r of t){if(r.mimeTypes&&r.mimeTypes.includes(e))return r;if(e===`application/x.${r.id}`)return r}return null}function d(t,e){if(e.testText)return e.testText(t);return(Array.isArray(e.tests)?e.tests:[e.tests]).some(e=>t.startsWith(e))}function A(t,e,r){return(Array.isArray(r.tests)?r.tests:[r.tests]).some(i=>function(t,e,r,i){if(i instanceof ArrayBuffer)return Object(n.a)(i,t,i.byteLength);switch(typeof i){case"function":return i(t,r);case"string":const n=g(t,e,i.length);return i===n;default:return!1}}(t,e,r,i))}function g(t,e,r){if(t.byteLength<e+r)return"";const n=new DataView(t);let i="";for(let t=0;t<r;t++)i+=String.fromCharCode(n.getUint8(e+t));return i}},function(t,e,r){"use strict";function n(t,e){if(t===e)return!0;if(Array.isArray(t)){var r=t.length;if(!e||e.length!==r)return!1;for(var n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}return!1}function i(t){var e,r={};return function(i){for(var o in i)if(!n(i[o],r[o])){e=t(i),r=i;break}return e}}r.d(e,"a",(function(){return i}))},function(t,e,r){"use strict";r.d(e,"c",(function(){return o})),r.d(e,"a",(function(){return a})),r.d(e,"b",(function(){return s}));var n=r(9);const i={5126:[5126,1,"float"],35664:[5126,2,"vec2"],35665:[5126,3,"vec3"],35666:[5126,4,"vec4"],5124:[5124,1,"int"],35667:[5124,2,"ivec2"],35668:[5124,3,"ivec3"],35669:[5124,4,"ivec4"],5125:[5125,1,"uint"],36294:[5125,2,"uvec2"],36295:[5125,3,"uvec3"],36296:[5125,4,"uvec4"],35670:[5126,1,"bool"],35671:[5126,2,"bvec2"],35672:[5126,3,"bvec3"],35673:[5126,4,"bvec4"],35674:[5126,8,"mat2"],35685:[5126,8,"mat2x3"],35686:[5126,8,"mat2x4"],35675:[5126,12,"mat3"],35687:[5126,12,"mat3x2"],35688:[5126,12,"mat3x4"],35676:[5126,16,"mat4"],35689:[5126,16,"mat4x2"],35690:[5126,16,"mat4x3"]};function o(t){switch(t){case 0:return 0;case 1:case 3:case 2:return 1;case 4:case 5:case 6:return 4;default:return Object(n.a)(!1),0}}function a(t){const e=i[t];if(!e)return null;const[r,n]=e;return{type:r,components:n}}function s(t,e){switch(t){case 5120:case 5121:case 5122:case 5123:t=5126}for(const r in i){const[n,o,a]=i[r];if(n===t&&o===e)return{glType:r,name:a}}return null}},function(t,e,r){"use strict";r.d(e,"b",(function(){return i})),r.d(e,"a",(function(){return o})),r.d(e,"c",(function(){return a})),r.d(e,"d",(function(){return s})),r.d(e,"e",(function(){return u}));var n=r(7);const i={6407:{dataFormat:6407,types:[5121,33635]},6408:{dataFormat:6408,types:[5121,32819,32820]},6406:{dataFormat:6406,types:[5121]},6409:{dataFormat:6409,types:[5121]},6410:{dataFormat:6410,types:[5121]},33326:{dataFormat:6403,types:[5126],gl2:!0},33328:{dataFormat:33319,types:[5126],gl2:!0},34837:{dataFormat:6407,types:[5126],gl2:!0},34836:{dataFormat:6408,types:[5126],gl2:!0}},o={6403:1,36244:1,33319:2,33320:2,6407:3,36248:3,6408:4,36249:4,6402:1,34041:1,6406:1,6409:1,6410:2},a={5126:4,5125:4,5124:4,5123:2,5122:2,5131:2,5120:1,5121:1};function s(t,e){const r=i[e];if(!r)return!1;if(void 0===r.gl1&&void 0===r.gl2)return!0;const o=Object(n.j)(t)&&r.gl2||r.gl1;return"string"==typeof o?t.getExtension(o):o}function u(t,e){const r=i[e];switch(r&&r.types[0]){case 5126:return t.getExtension("OES_texture_float_linear");case 5131:return t.getExtension("OES_texture_half_float_linear");default:return!0}}},function(t,e,r){"use strict";(function(t,n){r.d(e,"e",(function(){return o})),r.d(e,"f",(function(){return a})),r.d(e,"b",(function(){return s})),r.d(e,"a",(function(){return u})),r.d(e,"c",(function(){return c})),r.d(e,"d",(function(){return l}));const i={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==t&&t,document:"undefined"!=typeof document&&document},o=i.self||i.window||i.global||{},a=i.window||i.self||i.global||{},s=i.global||i.self||i.window||{},u=i.document||{},c="object"!=typeof n||"[object process]"!==String(n)||n.browser,l="function"==typeof importScripts,h=void 0!==n&&n.version&&/v([0-9]*)/.exec(n.version);h&&parseFloat(h[1])}).call(this,r(65),r(57))},function(t,e,r){"use strict";r.d(e,"c",(function(){return u})),r.d(e,"a",(function(){return c})),r.d(e,"b",(function(){return l})),r.d(e,"d",(function(){return h}));var n=r(69),i=r(70),o=r(36),a=r(31),s=r(132);function u(t,e){if(Object(o.a)(Object(a.d)(t),"setParameters requires a WebGL context"),Object(s.b)(e))return;const r={};for(const i in e){const o=Number(i),a=n.e[i];a&&("string"==typeof a?r[a]=!0:a(t,e[i],o))}const i=t.state&&t.state.cache;if(i)for(const o in r){(0,n.a[o])(t,e,i)}}function c(t,e){if("number"==typeof(e=e||n.c)){const r=e,i=n.d[r];return i?i(t,r):t.getParameter(r)}const r=Array.isArray(e)?e:Object.keys(e),i={};for(const e of r){const r=n.d[e];i[e]=r?r(t,Number(e)):t.getParameter(Number(e))}return i}function l(t){u(t,n.c)}function h(t,e,r){if(Object(s.b)(e))return r(t);const{nocatch:n=!0}=e;let o;if(Object(i.b)(t),u(t,e),n)o=r(t),Object(i.a)(t);else try{o=r(t)}finally{Object(i.a)(t)}return o}},function(t,e,r){"use strict";r.d(e,"a",(function(){return v}));var n=r(2),i=r.n(n),o=r(3),a=r.n(o),s=r(5),u=r.n(s),c=r(6),l=r.n(c),h=r(1),f=r.n(h),p=r(170),d=r(7),A=r(178);function g(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return m(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return m(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function m(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function y(t){var e=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(t){return!1}}();return function(){var r,n=f()(t);if(e){var i=f()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return l()(this,r)}}var v=function(t){u()(r,t);var e=y(r);function r(){return i()(this,r),e.apply(this,arguments)}return a()(r,[{key:"render",value:function(t){var e=this.gl;return Object(d.n)(e,{framebuffer:t.target}),this._drawLayers(t)}},{key:"_drawLayers",value:function(t){var e=t.viewports,r=t.views,n=t.onViewportActive,i=t.clearCanvas,o=void 0===i||i;t.pass=t.pass||"unknown";var a=this.gl;o&&function(t){var e=t.drawingBufferWidth,r=t.drawingBufferHeight;Object(d.n)(t,{viewport:[0,0,e,r]}),t.clear(16640)}(a);var s,u=[],c=g(e);try{for(c.s();!(s=c.n()).done;){var l=s.value,h=l.viewport||l,f=r&&r[h.id];n(h);var p=this._getDrawLayerParams(h,t);t.view=f;var A,m=g(h.subViewports||[h]);try{for(m.s();!(A=m.n()).done;){var y=A.value;t.viewport=y;var v=this._drawLayersInViewport(a,t,p);u.push(v)}}catch(t){m.e(t)}finally{m.f()}}}catch(t){c.e(t)}finally{c.f()}return u}},{key:"_getDrawLayerParams",value:function(t,e){for(var r=e.layers,n=e.pass,i=e.layerFilter,o=e.effects,a=e.moduleParameters,s=[],u=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={},i=function i(o,a){var s,u=o.props._offset,c=o.id,l=o.parent&&o.parent.id;if(!l||l in r||i(o.parent,!1),l in n){var h=n[l]=n[l]||t(r[l],r);s=h(o,a),n[c]=h}else Number.isFinite(u)?(s=u+(r[l]||0),n[c]=null):s=e;return a&&s>=e&&(e=s+1),r[c]=s,s};return i}(),c={viewport:t,isPicking:n.startsWith("picking"),renderPass:n},l={},h=0;h<r.length;h++){var f=r[h],p=this._shouldDrawLayer(f,c,i,l),d={shouldDrawLayer:p,layerRenderIndex:u(f,p)};p&&(d.moduleParameters=this._getModuleParameters(f,o,n,a),d.layerParameters=this.getLayerParameters(f,h,t)),s[h]=d}return s}},{key:"_drawLayersInViewport",value:function(t,e,r){var n=e.layers,i=e.pass,o=e.viewport,a=e.view,s=function(t,e){var r=e.viewport,n=t.canvas?t.canvas.clientHeight||t.canvas.height:100,i=r,o=Object(d.e)(t);return[i.x*o,(n-i.y-i.height)*o,i.width*o,i.height*o]}(t,{viewport:o});if(a&&a.props.clear){var u=!0===a.props.clear?{color:!0,depth:!0}:a.props.clear;Object(d.o)(t,{scissorTest:!0,scissor:s},(function(){return Object(A.a)(t,u)}))}var c={totalCount:n.length,visibleCount:0,compositeCount:0,pickableCount:0};Object(d.n)(t,{viewport:s});for(var l=0;l<n.length;l++){var h=n[l],f=r[l],p=f.shouldDrawLayer,g=f.layerRenderIndex,m=f.moduleParameters,y=f.layerParameters;if(p&&h.props.pickable&&c.pickableCount++,h.isComposite)c.compositeCount++;else if(p){c.visibleCount++,m.viewport=o;try{h.drawLayer({moduleParameters:m,uniforms:{layerIndex:g},parameters:y})}catch(t){h.raiseError(t,"drawing ".concat(h," to ").concat(i))}}}return c}},{key:"shouldDrawLayer",value:function(t){return!0}},{key:"getModuleParameters",value:function(t,e){return null}},{key:"getLayerParameters",value:function(t,e){return t.props.parameters}},{key:"_shouldDrawLayer",value:function(t,e,r,n){if(!(this.shouldDrawLayer(t)&&t.props.visible))return!1;e.layer=t;for(var i=t.parent;i;){if(!i.props.visible||!i.filterSubLayer(e))return!1;e.layer=i,i=i.parent}if(r){var o=e.layer.id;if(o in n||(n[o]=r(e)),!n[o])return!1}return t.activateViewport(e.viewport),!0}},{key:"_getModuleParameters",value:function(t,e,r,n){var i=Object.assign(Object.create(t.props),{autoWrapLongitude:t.wrapLongitude,viewport:t.context.viewport,mousePosition:t.context.mousePosition,pickingActive:0,devicePixelRatio:Object(d.e)(this.gl)});if(e){var o,a=g(e);try{for(a.s();!(o=a.n()).done;){var s=o.value;Object.assign(i,s.getModuleParameters(t))}}catch(t){a.e(t)}finally{a.f()}}return Object.assign(i,this.getModuleParameters(t,e),n)}}]),r}(p.a)},function(t,e,r){"use strict";r.d(e,"a",(function(){return h}));var n=r(0),i=r.n(n),o=r(2),a=r.n(o),s=r(3),u=r.n(s);function c(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function l(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?c(Object(r),!0).forEach((function(e){i()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var h=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};a()(this,t);var r=e.id,n=void 0===r?"effect":r;this.id=n,this.props=l({},e)}return u()(t,[{key:"preRender",value:function(){}},{key:"getModuleParameters",value:function(){}},{key:"cleanup",value:function(){}}]),t}()},function(t,e,r){"use strict";r.r(e);var n=r(0),i=r.n(n);function o(t,e){if(!t)throw new Error("null row");if(!e)throw new Error("no headers");const r={};for(let n=0;n<e.length;n++)r[e[n]]=t[n];return r}function a(t,e){if(!t)throw new Error("null row");if(!e)throw new Error("no headers");const r=new Array(e.length);for(let n=0;n<e.length;n++)r[n]=t[e[n]];return r}var s=r(4);let u;class c extends Array{enqueue(t){return this.push(t)}dequeue(){return this.shift()}}u=Symbol.asyncIterator;class l{constructor(){Object(s.a)(this,"_values",void 0),Object(s.a)(this,"_settlers",void 0),Object(s.a)(this,"_closed",void 0),this._values=new c,this._settlers=new c,this._closed=!1}close(){for(;this._settlers.length>0;)this._settlers.dequeue().resolve({done:!0});this._closed=!0}[u](){return this}enqueue(t){if(this._closed)throw new Error("Closed");if(this._settlers.length>0){if(this._values.length>0)throw new Error("Illegal internal state");const e=this._settlers.dequeue();t instanceof Error?e.reject(t):e.resolve({value:t})}else this._values.enqueue(t)}next(){if(this._values.length>0){const t=this._values.dequeue();return t instanceof Error?Promise.reject(t):Promise.resolve({value:t})}if(this._closed){if(this._settlers.length>0)throw new Error("Illegal internal state");return Promise.resolve({done:!0})}return new Promise((t,e)=>{this._settlers.enqueue({resolve:t,reject:e})})}}class h{constructor(t,e){if(Object(s.a)(this,"schema",void 0),Object(s.a)(this,"options",void 0),Object(s.a)(this,"length",0),Object(s.a)(this,"rows",null),Object(s.a)(this,"cursor",0),Object(s.a)(this,"_headers",[]),this.options=e,this.schema=t,!Array.isArray(t)){this._headers=[];for(const e in t)this._headers[t[e].index]=t[e].name}}rowCount(){return this.length}addArrayRow(t,e){Number.isFinite(e)&&(this.cursor=e),this.rows=this.rows||new Array(100),this.rows[this.length]=t,this.length++}addObjectRow(t,e){Number.isFinite(e)&&(this.cursor=e),this.rows=this.rows||new Array(100),this.rows[this.length]=t,this.length++}getBatch(){let t=this.rows;if(!t)return null;return t=t.slice(0,this.length),this.rows=null,{shape:this.options.shape,batchType:"data",data:t,length:this.length,schema:this.schema,cursor:this.cursor}}}class f{constructor(t,e){if(Object(s.a)(this,"schema",void 0),Object(s.a)(this,"options",void 0),Object(s.a)(this,"length",0),Object(s.a)(this,"objectRows",null),Object(s.a)(this,"arrayRows",null),Object(s.a)(this,"cursor",0),Object(s.a)(this,"_headers",[]),this.options=e,this.schema=t,!Array.isArray(t)){this._headers=[];for(const e in t)this._headers[t[e].index]=t[e].name}}rowCount(){return this.length}addArrayRow(t,e){switch(Number.isFinite(e)&&(this.cursor=e),this.options.shape){case"object-row-table":const r=o(t,this._headers);this.addObjectRow(r,e);break;case"array-row-table":this.arrayRows=this.arrayRows||new Array(100),this.arrayRows[this.length]=t,this.length++}}addObjectRow(t,e){switch(Number.isFinite(e)&&(this.cursor=e),this.options.shape){case"array-row-table":const r=a(t,this._headers);this.addArrayRow(r,e);break;case"object-row-table":this.objectRows=this.objectRows||new Array(100),this.objectRows[this.length]=t,this.length++}}getBatch(){let t=this.arrayRows||this.objectRows;return t?(t=t.slice(0,this.length),this.arrayRows=null,this.objectRows=null,{shape:this.options.shape,batchType:"data",data:t,length:this.length,schema:this.schema,cursor:this.cursor}):null}}class p{constructor(t,e){Object(s.a)(this,"schema",void 0),Object(s.a)(this,"length",0),Object(s.a)(this,"allocated",0),Object(s.a)(this,"columns",{}),this.schema=t,this._reallocateColumns()}rowCount(){return this.length}addArrayRow(t){this._reallocateColumns();let e=0;for(const r in this.columns)this.columns[r][this.length]=t[e++];this.length++}addObjectRow(t){this._reallocateColumns();for(const e in t)this.columns[e][this.length]=t[e];this.length++}getBatch(){this._pruneColumns();const t=Array.isArray(this.schema)?this.columns:{};if(!Array.isArray(this.schema))for(const e in this.schema){const r=this.schema[e];t[r.name]=this.columns[r.index]}return this.columns={},{shape:"columnar-table",batchType:"data",data:t,schema:this.schema,length:this.length}}_reallocateColumns(){if(!(this.length<this.allocated)){this.allocated=this.allocated>0?this.allocated*=2:100,this.columns={};for(const t in this.schema){const e=this.schema[t],r=e.type||Float32Array,n=this.columns[e.index];if(n&&ArrayBuffer.isView(n)){const t=new r(this.allocated);t.set(n),this.columns[e.index]=t}else n?(n.length=this.allocated,this.columns[e.index]=n):this.columns[e.index]=new r(this.allocated)}}}_pruneColumns(){for(const[t,e]of Object.entries(this.columns))this.columns[t]=e.slice(0,this.length)}}const d={shape:"array-row-table",batchSize:"auto",batchDebounceMs:0,limit:0,_limitMB:0};class A{constructor(t,e){Object(s.a)(this,"schema",void 0),Object(s.a)(this,"options",void 0),Object(s.a)(this,"aggregator",null),Object(s.a)(this,"batchCount",0),Object(s.a)(this,"bytesUsed",0),Object(s.a)(this,"isChunkComplete",!1),Object(s.a)(this,"lastBatchEmittedMs",Date.now()),Object(s.a)(this,"totalLength",0),Object(s.a)(this,"totalBytes",0),Object(s.a)(this,"rowBytes",0),this.schema=t,this.options={...d,...e}}limitReached(){var t,e;return!!(Boolean(null===(t=this.options)||void 0===t?void 0:t.limit)&&this.totalLength>=this.options.limit)||!!(Boolean(null===(e=this.options)||void 0===e?void 0:e._limitMB)&&this.totalBytes/1e6>=this.options._limitMB)}addRow(t){this.limitReached()||(this.totalLength++,this.rowBytes=this.rowBytes||this._estimateRowMB(t),this.totalBytes+=this.rowBytes,Array.isArray(t)?this.addArrayRow(t):this.addObjectRow(t))}addArrayRow(t){if(!this.aggregator){const t=this._getTableBatchType();this.aggregator=new t(this.schema,this.options)}this.aggregator.addArrayRow(t)}addObjectRow(t){if(!this.aggregator){const t=this._getTableBatchType();this.aggregator=new t(this.schema,this.options)}this.aggregator.addObjectRow(t)}chunkComplete(t){t instanceof ArrayBuffer&&(this.bytesUsed+=t.byteLength),"string"==typeof t&&(this.bytesUsed+=t.length),this.isChunkComplete=!0}getFullBatch(t){return this._isFull()?this._getBatch(t):null}getFinalBatch(t){return this._getBatch(t)}_estimateRowMB(t){return Array.isArray(t)?8*t.length:8*Object.keys(t).length}_isFull(){if(!this.aggregator||0===this.aggregator.rowCount())return!1;if("auto"===this.options.batchSize){if(!this.isChunkComplete)return!1}else if(this.options.batchSize>this.aggregator.rowCount())return!1;return!(this.options.batchDebounceMs>Date.now()-this.lastBatchEmittedMs)&&(this.isChunkComplete=!1,this.lastBatchEmittedMs=Date.now(),!0)}_getBatch(t){if(!this.aggregator)return null;null!=t&&t.bytesUsed&&(this.bytesUsed=t.bytesUsed);const e=this.aggregator.getBatch();return e.count=this.batchCount,e.bytesUsed=this.bytesUsed,Object.assign(e,t),this.batchCount++,this.aggregator=null,e}_getTableBatchType(){switch(this.options.shape){case"row-table":return h;case"array-row-table":case"object-row-table":return f;case"columnar-table":return p;case"arrow-table":if(!A.ArrowBatch)throw new Error("TableBatchBuilder");return A.ArrowBatch;default:throw new Error("TableBatchBuilder")}}}Object(s.a)(A,"ArrowBatch",void 0);var g=r(120),m=r.n(g);const{ChunkStreamer:y}=m.a;function v(t){t=t||{},y.call(this,t),this.textDecoder=new TextDecoder(this._config.encoding),this.stream=async function(t){this._input=t;try{for await(const e of t)this.parseChunk(this.getStringChunk(e));this._finished=!0,this.parseChunk("")}catch(t){this._sendError(t)}},this._nextChunk=function(){},this.getStringChunk=function(t){return"string"==typeof t?t:this.textDecoder.decode(t,{stream:!0})}}v.prototype=Object.create(y.prototype),v.prototype.constructor=v;const _={csv:{shape:"object-row-table",optimizeMemoryUsage:!1,header:"auto",columnPrefix:"column",quoteChar:'"',escapeChar:'"',dynamicTyping:!0,comments:!1,skipEmptyLines:!0,delimitersToGuess:[",","\t","|",";"]}},b={id:"csv",module:"csv",name:"CSV",version:"3.0.8",extensions:["csv"],mimeTypes:["text/csv"],category:"table",parse:async(t,e)=>x((new TextDecoder).decode(t),e),parseText:(t,e)=>x(t,e),parseInBatches:function(t,e){var r;"auto"===(e={...e}).batchSize&&(e.batchSize=4e3);const n={..._.csv,...null===(r=e)||void 0===r?void 0:r.csv},i=new l;let o=!0,a=null,s=null,u=null;const c={...n,header:!1,download:!1,chunkSize:5242880,skipEmptyLines:!1,step(t){let r=t.data;if(n.skipEmptyLines){if(""===r.flat().join("").trim())return}const c=t.meta.cursor;if(o&&!a){if("auto"===n.header?w(r):Boolean(n.header))return void(a=r.map(E()))}o&&(o=!1,a||(a=S(n.columnPrefix,r.length)),u=function(t,e){const r=e?{}:[];for(let n=0;n<t.length;n++){const i=e&&e[n]||n;switch(typeof t[n]){case"number":case"boolean":r[i]={name:String(i),index:n,type:Float32Array};break;case"string":default:r[i]={name:String(i),index:n,type:Array}}}return r}(r,a)),n.optimizeMemoryUsage&&(r=JSON.parse(JSON.stringify(r))),s=s||new A(u,{shape:n.shape||"array-row-table",...e});try{s.addRow(r);const t=s&&s.getFullBatch({bytesUsed:c});t&&i.enqueue(t)}catch(t){i.enqueue(t)}},complete(t){try{const e=t.meta.cursor,r=s&&s.getFinalBatch({bytesUsed:e});r&&i.enqueue(r)}catch(t){i.enqueue(t)}i.close()}};return m.a.parse(t,c,v),i},options:_};async function x(t,e){const r={..._.csv,...null==e?void 0:e.csv},n=function(t){return m.a.parse(t,{download:!1,dynamicTyping:!0,preview:1}).data[0]}(t),i="auto"===r.header?w(n):Boolean(r.header),s={...r,header:i,download:!1,transformHeader:i?E():void 0,error:t=>{throw new Error(t)}},u=m.a.parse(t,s);let{data:c}=u;const l=u.meta.fields||S(r.columnPrefix,n.length);switch(r.shape){case"object-row-table":c=c.map(t=>Array.isArray(t)?o(t,l):t);break;case"array-row-table":c=c.map(t=>Array.isArray(t)?t:a(t,l))}return c}function w(t){return t&&t.every(t=>"string"==typeof t)}function E(){const t=new Set;return e=>{let r=e,n=1;for(;t.has(r);)r=`${e}.${n}`,n++;return t.add(r),r}}function S(t,e=0){const r=[];for(let n=0;n<e;n++)r.push(`${t}${n+1}`);return r}var O,T,P=r(104),M={fontFamily:'"Helvetica Neue", Helvetica, Arial, sans-serif',display:"flex",flex:"wrap",maxWidth:"500px",flexDirection:"column",zIndex:2};function C(){return document.createElement("div")}function I(t){if(!t.picked)return null;if(t.object===O)return T;var e={html:R(t.object),style:M};return T=e,O=t.object,e}var k=new Set(["position","index"]);function R(t){var e=C();for(var r in t)if(!k.has(r)){var n=C();n.className="header",n.textContent=r;var i=C();i.className="value",i.textContent=j(t[r]);var o=C();L(o,n,i),o.appendChild(n),o.appendChild(i),e.appendChild(o)}return e.innerHTML}function L(t,e,r){Object.assign(e.style,{fontWeight:700,marginRight:"10px",flex:"1 1 0%"}),Object.assign(r.style,{flex:"none",maxWidth:"250px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),Object.assign(t.style,{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"stretch"})}function j(t){var e;if(Array.isArray(t)&&t.length>4)e="Array<".concat(t.length,">");else if("string"==typeof t)e=t;else if("number"==typeof t)e=String(t);else try{e=JSON.stringify(t)}catch(t){e="<Non-Serializable Object>"}return e.length>50&&(e=e.slice(0,50)),e}function D(t,e){var r=t;for(var n in e)r=r.replace("{".concat(n,"}"),e[n]);return r}var B=r(121),F={};var z=r(45);var N=r(2),U=r.n(N),V=r(3),G=r.n(V),W={position:"absolute",top:"0px",left:"0px",width:344,padding:"12px 24px",margin:24,overflowX:"hidden",overflowY:"overlay",outline:"none",maxHeight:"94%",boxSizing:"border-box",backgroundColor:"rgb(255, 255, 255)",fontFamily:'"Fira Sans", sans-serif',zIndex:1},H=function(){function t(e){var r=e.container,n=e.props;U()(this,t);var i=n.description,o=document.createElement("div");o.className="deck-json-description-box",Object.assign(o.style,W),this.el=o;var a=document.createElement("div");a.innerHTML=i,o.appendChild(a),r.append(o)}return G()(t,[{key:"remove",value:function(){this.el.remove(),this.description=null}}],[{key:"stringName",get:function(){return"description"}}]),t}();function q(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Z(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?q(Object(r),!0).forEach((function(e){i()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):q(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function X(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Q(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Q(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Q(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Y(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r={},n=Object.keys(e).filter((function(t){return t.charAt(0)===t.charAt(0).toUpperCase()})),i=X(n);try{for(i.s();!(t=i.n()).done;){var o=t.value;r[o]=e[o]}}catch(t){i.e(t)}finally{i.f()}return r}r.d(e,"addCustomLibraries",(function(){return J})),r.d(e,"createDeck",(function(){return rt})),r.d(e,"updateDeck",(function(){return tt})),r.d(e,"jsonConverter",(function(){return $}));var K={classes:Y(z),enumerations:{COORDINATE_SYSTEM:z.COORDINATE_SYSTEM,GL:{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}}};Object(P.c)([b]);var $=new z.JSONConverter({configuration:K});function J(t,e){if(t){var r={};t.forEach((function(t){var e=t.libraryName,i=t.resourceUri;r[e]=!1,e in window?n(e,window[e]):(Object.defineProperty(window,e,{set:function(t){return n(e,t)},get:function(){return r[e]}}),function(t){if(!F[t]){var e=document.createElement("script");e.type="text/javascript",e.src=t,document.querySelector("head").appendChild(e),F[t]=new Promise((function(t){e.onload=t}))}F[t]}(i))}))}function n(t,n){!function(t,e){var r={classes:Y(t)};e.mergeConfiguration(r)}(n,$),r[t]=n,Object.values(r).every((function(t){return t}))&&"function"==typeof e&&e()}}function tt(t,e){var r=$.convert(t);e.setProps(r)}function et(t){var e=t.mapProvider,r=t.props,n=t.mapboxApiKey,i=t.googleMapsKey,o=t.handleEvent,a=t.getTooltip,s=t.container,u=Z(Z({},o?{onClick:function(t){return o("deck-click-event",t)},onHover:function(t){return o("deck-hover-event",t)},onResize:function(t){return o("deck-resize-event",t)},onViewStateChange:function(t){var e=t.viewState,r=(t.interactionState,t.oldViewState,new z.WebMercatorViewport(e));e.nw=r.unproject([0,0]),e.se=r.unproject([r.width,r.height]),o("deck-view-state-change-event",e)},onDragStart:function(t){return o("deck-drag-start-event",t)},onDrag:function(t){return o("deck-drag-event",t)},onDragEnd:function(t){return o("deck-drag-end-event",t)}}:null),{},{getTooltip:a,container:s});switch(e){case"mapbox":return z.log.info("Using Mapbox base maps")(),new z.DeckGL(Z(Z(Z({},u),r),{},{map:B.a,mapboxApiAccessToken:n,onLoad:B.c}));case"carto":return z.log.info("Using Carto base maps")(),new z.DeckGL(Z(Z({map:B.a},u),r));case"google_maps":return z.log.info("Using Google Maps base maps")(),function(t){var e=t.container,r=(t.onClick,t.onComplete,t.getTooltip,t.googleMapsKey),n=t.layers,i=t.mapStyle,o=void 0===i?"satellite":i,a=t.initialViewState,s=void 0===a?{latitude:0,longitude:0,zoom:1}:a;if(!r)return z.log.warn("No Google Maps API key set")(),null;var u=new z.GoogleMapsOverlay({layers:n}),c={center:{lat:s.latitude,lng:s.longitude},mapTypeId:o,zoom:s.zoom},l=new window.google.maps.Map(e,c);return u.setMap(l),u}(Z(Z(Z({},u),r),{},{googleMapsKey:i}));default:return z.log.info("No recognized map provider specified")(),new z.DeckGL(Z(Z(Z({},u),r),{},{map:null,mapboxApiAccessToken:null}))}}function rt(t){var e,r=t.mapboxApiKey,n=t.googleMapsKey,i=t.container,o=t.jsonInput,a=t.tooltip,s=t.handleEvent,u=t.customLibraries;try{var c=o.layers||[],l=$.convert(o);!function(t,e){var r=document.createElement("div");r.className="deckgl-ui-elements-overlay",r.style.zIndex=1,t.insertAdjacentElement("beforebegin",r);for(var n=[],i=0,o=Object.keys(e);i<o.length;i++){switch(o[i]){case"description":var a=new H({container:r,props:e});n.push(a)}}}(i,l);var h=(l.layers||[]).filter((function(t){return t})),f=function(t,e){return t.filter((function(t){return t&&t.id&&!e.find((function(e){return e.id===t.id}))}))}(c,h),p=function(t){return t?t.html||t.text?function(e){if(!e.picked)return null;var r={style:t.style||M};return t.html?r.html=D(t.html,e.object):r.text=D(t.text,e.object),r}:I:null}(a),d=l.mapProvider;e=et({mapProvider:d,props:l,mapboxApiKey:r,googleMapsKey:n,handleEvent:s,getTooltip:p,container:i});J(u,(function(){if(f.length){var t=($.convert({layers:o.layers}).layers||[]).filter((function(t){return t}));t.length>h.length&&e.setProps({layers:t})}}))}catch(t){console.error(t)}return e}},function(t,e,r){"use strict";r.d(e,"a",(function(){return i})),r.d(e,"b",(function(){return o}));var n=r(41);function i(t,e,r=null){if(r)return r;const i={fetch:Object(n.a)(e,t),...t};return Array.isArray(i.loaders)||(i.loaders=null),i}function o(t,e){if(!e&&t&&!Array.isArray(t))return t;let r;if(t&&(r=Array.isArray(t)?t:[t]),e&&e.loaders){const t=Array.isArray(e.loaders)?e.loaders:[e.loaders];r=r?[...r,...t]:t}return r&&r.length?r:null}},function(t,e){},,,function(t,e,r){"use strict";r.d(e,"c",(function(){return o})),r.d(e,"a",(function(){return a})),r.d(e,"b",(function(){return s}));let n="";const i={};function o(t){n=t}function a(){return n}function s(t){for(const e in i)if(t.startsWith(e)){const r=i[e];t=t.replace(e,r)}return t.startsWith("http://")||t.startsWith("https://")||(t=`${n}${t}`),t}},function(t,e,r){"use strict";r.d(e,"a",(function(){return h}));var n=r(2),i=r.n(n),o=r(3),a=r.n(o),s=r(11),u=[255,255,255],c=[0,0,-1],l=0,h=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i()(this,t);var r=e.color,n=void 0===r?u:r,o=e.intensity,a=void 0===o?1:o,h=e.direction,f=void 0===h?c:h,p=e._shadow,d=void 0!==p&&p;this.id=e.id||"directional-".concat(l++),this.color=n,this.intensity=a,this.type="directional",this.direction=new s.b(f).normalize().toArray(),this.shadow=d}return a()(t,[{key:"getProjectedLight",value:function(){return this}}]),t}()},function(t,e,r){"use strict";r.d(e,"a",(function(){return o}));var n=r(92),i=r(99);async function o(t,e){if("string"==typeof t){t=Object(n.b)(t);let r=e;return null!=e&&e.fetch&&"function"!=typeof(null==e?void 0:e.fetch)&&(r=e.fetch),await fetch(t,r)}return await Object(i.b)(t)}},function(t,e,r){"use strict";const n={name:"fp32",vs:"#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\nconst float TWO_PI = 6.2831854820251465;\nconst float PI_2 = 1.5707963705062866;\nconst float PI_16 = 0.1963495463132858;\n\nconst float SIN_TABLE_0 = 0.19509032368659973;\nconst float SIN_TABLE_1 = 0.3826834261417389;\nconst float SIN_TABLE_2 = 0.5555702447891235;\nconst float SIN_TABLE_3 = 0.7071067690849304;\n\nconst float COS_TABLE_0 = 0.9807852506637573;\nconst float COS_TABLE_1 = 0.9238795042037964;\nconst float COS_TABLE_2 = 0.8314695954322815;\nconst float COS_TABLE_3 = 0.7071067690849304;\n\nconst float INVERSE_FACTORIAL_3 = 1.666666716337204e-01;\nconst float INVERSE_FACTORIAL_5 = 8.333333767950535e-03;\nconst float INVERSE_FACTORIAL_7 = 1.9841270113829523e-04;\nconst float INVERSE_FACTORIAL_9 = 2.75573188446287533e-06;\n\nfloat sin_taylor_fp32(float a) {\n float r, s, t, x;\n\n if (a == 0.0) {\n return 0.0;\n }\n\n x = -a * a;\n s = a;\n r = a;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_3;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_5;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_7;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_9;\n s = s + t;\n\n return s;\n}\n\nvoid sincos_taylor_fp32(float a, out float sin_t, out float cos_t) {\n if (a == 0.0) {\n sin_t = 0.0;\n cos_t = 1.0;\n }\n sin_t = sin_taylor_fp32(a);\n cos_t = sqrt(1.0 - sin_t * sin_t);\n}\n\nfloat tan_taylor_fp32(float a) {\n float sin_a;\n float cos_a;\n\n if (a == 0.0) {\n return 0.0;\n }\n float z = floor(a / TWO_PI);\n float r = a - TWO_PI * z;\n\n float t;\n float q = floor(r / PI_2 + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return 1.0 / 0.0;\n }\n\n t = r - PI_2 * q;\n\n q = floor(t / PI_16 + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return 1.0 / 0.0;\n } else {\n t = t - PI_16 * q;\n }\n\n float u = 0.0;\n float v = 0.0;\n\n float sin_t, cos_t;\n float s, c;\n sincos_taylor_fp32(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0;\n v = SIN_TABLE_0;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1;\n v = SIN_TABLE_1;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2;\n v = SIN_TABLE_2;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3;\n v = SIN_TABLE_3;\n }\n if (k > 0) {\n s = u * sin_t + v * cos_t;\n c = u * cos_t - v * sin_t;\n } else {\n s = u * sin_t - v * cos_t;\n c = u * cos_t + v * sin_t;\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return sin_a / cos_a;\n}\n#endif\n\nfloat tan_fp32(float a) {\n#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\n return tan_taylor_fp32(a);\n#else\n return tan(a);\n#endif\n}\n",fs:null};var i={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),\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=r(14),a=Object.keys(o.a).map((function(t){return"const int COORDINATE_SYSTEM_".concat(t," = ").concat(o.a[t],";")})).join(""),s=Object.keys(o.c).map((function(t){return"const int PROJECTION_MODE_".concat(t," = ").concat(o.c[t],";")})).join(""),u=Object.keys(o.d).map((function(t){return"const int UNIT_".concat(t.toUpperCase()," = ").concat(o.d[t],";")})).join(""),c="".concat(a,"\n").concat(s,"\n").concat(u,"\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}\nvec3 project_normal(vec3 vector) {\n vec4 normal_modelspace = project_uModelMatrix * vec4(vector, 0.0);\n return normalize(normal_modelspace.xyz * project_uCommonUnitsPerMeter);\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}\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}\n"),l=r(113),h={};e.a={name:"project",dependencies:[n,i],vs:c,getUniforms:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h;return t.viewport?Object(l.b)(t):{}}}},function(t,e,r){"use strict";var n=r(52),i=r(150);var o=r(187),a=r(47),s=r(41),u=r(115),c=r(88),l=r(63),h=r(79);async function f(t,e,r,p){Object(n.a)(!p||"object"==typeof p),!e||Array.isArray(e)||Object(a.a)(e)||(p=void 0,r=e,e=void 0),t=await t,r=r||{};const{url:d}=Object(l.b)(t),A=e,g=Object(c.b)(A,p),m=await Object(h.a)(t,g,r);return m?(r=Object(s.c)(r,m,g,d),p=Object(c.a)({url:d,parse:f,loaders:g},r,p),await async function(t,e,r,a){if(function(t,e=i.a){Object(n.a)(t,"no worker provided");const r=t.version}(t),e=await Object(u.a)(e,t,r),t.parseTextSync&&"string"==typeof e)return r.dataType="text",t.parseTextSync(e,r,a,t);if(Object(o.a)(t,r))return await Object(o.b)(t,e,r,a,f);if(t.parseText&&"string"==typeof e)return await t.parseText(e,r,a,t);if(t.parse)return await t.parse(e,r,a,t);throw Object(n.a)(!t.parseSync),new Error(`${t.id} loader - no parser found and worker is disabled`)}(m,t,r,p)):null}r.d(e,"a",(function(){return f}))},function(t,e,r){"use strict";function n(t,e){if(!t)throw new Error(e||"loader assertion failed.")}r.d(e,"a",(function(){return n}))},function(t,e,r){"use strict";var n=r(7),i=r(55),o=r(9);let a="";r.d(e,"a",(function(){return s}));class s extends i.a{static isSupported(t,e){return i.a.isSupported(t,e)}constructor(t,e={}){var r,i;Object(n.b)(t),(e instanceof Promise||"string"==typeof e)&&(e={data:e}),"string"==typeof e.data&&(e=Object.assign({},e,{data:(r=e.data,Object(o.a)("string"==typeof r),r=a+r,new Promise((t,e)=>{try{const n=new Image;n.onload=()=>t(n),n.onerror=()=>e(new Error(`Could not load image ${r}.`)),n.crossOrigin=i&&i.crossOrigin||"anonymous",n.src=r}catch(t){e(t)}}))})),super(t,Object.assign({},e,{target:3553})),this.initialize(e),Object.seal(this)}}},function(t,e,r){"use strict";r.d(e,"b",(function(){return o})),r.d(e,"a",(function(){return a}));var n=r(19),i=r(63);async function o(t){if(Object(n.j)(t))return t;const e={},r=Object(i.a)(t);r>=0&&(e["content-length"]=String(r));const{url:o,type:a}=Object(i.b)(t);a&&(e["content-type"]=a);const s=await async function(t){if("string"==typeof t)return`data:,${t.slice(0,5)}`;if(t instanceof Blob){const e=t.slice(0,5);return await new Promise(t=>{const r=new FileReader;r.onload=e=>{var r;return t(null==e?void 0:null===(r=e.target)||void 0===r?void 0:r.result)},r.readAsDataURL(e)})}if(t instanceof ArrayBuffer){return`data:base64,${function(t){let e="";const r=new Uint8Array(t);for(let t=0;t<r.byteLength;t++)e+=String.fromCharCode(r[t]);return btoa(e)}(t.slice(0,5))}`}return null}(t);s&&(e["x-first-bytes"]=s),"string"==typeof t&&(t=(new TextEncoder).encode(t));const u=new Response(t,{headers:e});return Object.defineProperty(u,"url",{value:o}),u}async function a(t){if(!t.ok){const e=await async function(t){let e=`Failed to fetch resource ${t.url} (${t.status}): `;try{const r=t.headers.get("Content-Type");let n=t.statusText;r.includes("application/json")&&(n+=` ${await t.text()}`),e+=n,e=e.length>60?`${e.slice(60)}...`:e}catch(t){}return e}(t);throw new Error(e)}}},function(t,e,r){"use strict";var n=r(39);const i="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:i,bpp:2},33327:{gl2:i,bpp:4},34842:{gl2:i,bpp:8},33326:{gl2:i,bpp:4},33328:{gl2:i,bpp:8},34836:{gl2:i,bpp:16},35898:{gl2:i,bpp:4}},a=r(7),s=r(9);r.d(e,"a",(function(){return u}));class u extends n.a{static isSupported(t,{format:e}={format:null}){return!e||function(t,e,r){const n=r[e];if(!n)return!1;const i=Object(a.j)(t)&&n.gl2||n.gl1;return"string"==typeof i?t.getExtension(i):i}(t,e,o)}static getSamplesForFormat(t,{format:e}){return t.getInternalformatParameter(36161,e,32937)}constructor(t,e={}){super(t,e),this.initialize(e),Object.seal(this)}initialize({format:t,width:e=1,height:r=1,samples:n=0}){return Object(s.a)(t,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==n&&Object(a.j)(this.gl)?this.gl.renderbufferStorageMultisample(36161,n,t,e,r):this.gl.renderbufferStorage(36161,t,e,r),this.format=t,this.width=e,this.height=r,this.samples=n,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*o[this.format].bpp),this}resize({width:t,height:e}){return t!==this.width||e!==this.height?this.initialize({width:t,height:e,format:this.format,samples:this.samples}):this}_createHandle(){return this.gl.createRenderbuffer()}_deleteHandle(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}_bindHandle(t){this.gl.bindRenderbuffer(36161,t)}_syncHandle(t){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}_getParameter(t){return this.gl.bindRenderbuffer(36161,this.handle),this.gl.getRenderbufferParameter(36161,t)}}},function(t,e,r){"use strict";(function(t){r.d(e,"b",(function(){return n})),r.d(e,"c",(function(){return i})),r.d(e,"a",(function(){return o}));var n="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",i="undefined"!=typeof window?window:t,o=(void 0!==t||window,"undefined"!=typeof document&&document,!1);try{var a={get passive(){return o=!0,!0}};i.addEventListener("test",a,a),i.removeEventListener("test",a,a)}catch(t){}}).call(this,r(65))},function(t,e,r){"use strict";(function(t){r.d(e,"a",(function(){return n}));"undefined"!=typeof window&&window,void 0!==t||window;var n="undefined"!=typeof document?document:{}}).call(this,r(65))},,function(t,e,r){"use strict";r.d(e,"c",(function(){return a})),r.d(e,"b",(function(){return s})),r.d(e,"a",(function(){return u}));var n=r(47),i=r(41);const o=()=>{const t=Object(i.b)();return t.loaderRegistry=t.loaderRegistry||[],t.loaderRegistry};function a(t){const e=o();t=Array.isArray(t)?t:[t];for(const r of t){const t=Object(n.b)(r);e.find(e=>t===e)||e.unshift(t)}}function s(){return o()}function u(){Object(i.b)().loaderRegistry=[]}},function(t,e,r){"use strict";r.d(e,"a",(function(){return C}));var n=r(10),i=r.n(n),o=r(0),a=r.n(o),s=r(2),u=r.n(s),c=r(3),l=r.n(c),h=r(189),f=r.n(h),p=r(8),d=r.n(p),A=r(5),g=r.n(A),m=r(6),y=r.n(m),v=r(1),_=r.n(v),b=r(40),x=r(22),w=r(27),E=r(11);function S(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function O(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?S(Object(r),!0).forEach((function(e){a()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):S(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function T(t){var e=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(t){return!1}}();return function(){var r,n=_()(t);if(e){var i=_()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}var P=Math.PI/180;function M(t){return 512/4003e4/Math.cos(t*P)}var C=function(t){g()(r,t);var e=T(r);function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};u()(this,r);var i,o=n.latitude,a=void 0===o?0:o,s=n.longitude,c=void 0===s?0:s,l=n.zoom,h=void 0===l?11:l,p=n.pitch,d=void 0===p?0:p,A=n.bearing,g=void 0===A?0:A,m=n.nearZMultiplier,y=void 0===m?.1:m,v=n.farZMultiplier,_=void 0===v?1.01:v,b=n.orthographic,w=void 0!==b&&b,S=n.projectionMatrix,T=n.repeat,P=void 0!==T&&T,M=n.worldOffset,C=void 0===M?0:M,I=n.legacyMeterSizes,k=void 0!==I&&I,R=n.width,L=n.height,j=n.altitude,D=void 0===j?1.5:j,B=Math.pow(2,h);R=R||1,L=L||1;var F=null;S?(D=S[5]/2,i=Object(x.b)(D)):(n.fovy?(i=n.fovy,D=Object(x.e)(i)):i=Object(x.b)(D),F=Object(x.j)({width:R,height:L,pitch:d,fovy:i,nearZMultiplier:y,farZMultiplier:_}));var z=Object(x.k)({height:L,pitch:d,bearing:g,scale:B,altitude:D});if(C){var N=(new E.a).translate([512*C,0,0]);z=N.multiplyLeft(z)}return(t=e.call(this,O(O(O({},n),{},{width:R,height:L,viewMatrix:z,longitude:c,latitude:a,zoom:h},F),{},{fovy:i,focalDistance:D}))).latitude=a,t.longitude=c,t.zoom=h,t.pitch=d,t.bearing=g,t.altitude=D,t.fovy=i,t.orthographic=w,t._subViewports=P?[]:null,t._pseudoMeters=k,Object.freeze(f()(t)),t}return l()(r,[{key:"projectPosition",value:function(t){if(this._pseudoMeters)return d()(_()(r.prototype),"projectPosition",this).call(this,t);var e=this.projectFlat(t),n=i()(e,2);return[n[0],n[1],(t[2]||0)*M(t[1])]}},{key:"unprojectPosition",value:function(t){if(this._pseudoMeters)return d()(_()(r.prototype),"unprojectPosition",this).call(this,t);var e=this.unprojectFlat(t),n=i()(e,2),o=n[0],a=n[1];return[o,a,(t[2]||0)/M(a)]}},{key:"addMetersToLngLat",value:function(t,e){return Object(x.a)(t,e)}},{key:"panByPosition",value:function(t,e){var r=Object(x.n)(e,this.pixelUnprojectionMatrix),n=this.projectFlat(t),o=w.a([],n,w.d([],r)),a=w.a([],this.center,o),s=this.unprojectFlat(a),u=i()(s,2);return{longitude:u[0],latitude:u[1]}}},{key:"getBounds",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=Object(x.f)(this,t.z||0);return[Math.min(e[0][0],e[1][0],e[2][0],e[3][0]),Math.min(e[0][1],e[1][1],e[2][1],e[3][1]),Math.max(e[0][0],e[1][0],e[2][0],e[3][0]),Math.max(e[0][1],e[1][1],e[2][1],e[3][1])]}},{key:"fitBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.width,i=this.height,o=Object(x.c)(O({width:n,height:i,bounds:t},e)),a=o.longitude,s=o.latitude,u=o.zoom;return new r({width:n,height:i,longitude:a,latitude:s,zoom:u})}},{key:"subViewports",get:function(){if(this._subViewports&&!this._subViewports.length)for(var t=this.getBounds(),e=Math.floor((t[0]+180)/360),n=Math.ceil((t[2]-180)/360),i=e;i<=n;i++){var o=i?new r(O(O({},this),{},{worldOffset:i})):this;this._subViewports.push(o)}return this._subViewports}}]),r}(b.a);C.displayName="WebMercatorViewport"},function(t,e,r){"use strict";r.d(e,"a",(function(){return k})),r.d(e,"b",(function(){return R}));var n=r(8),i=r.n(n),o=r(0),a=r.n(o),s=r(2),u=r.n(s),c=r(3),l=r.n(c),h=r(5),f=r.n(h),p=r(6),d=r.n(p),A=r(1),g=r.n(A),m=r(11),y=r(60),v=r(114),_=r(22),b=r(37);function x(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function w(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?x(Object(r),!0).forEach((function(e){a()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function E(t){var e=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(t){return!1}}();return function(){var r,n=g()(t);if(e){var i=g()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d()(this,r)}}var S=0,O=0,T=1.5,P=0,M=20,C=0,I=60,k=function(t){f()(r,t);var e=E(r);function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n.makeViewport,o=n.width,a=n.height,s=n.latitude,c=n.longitude,l=n.zoom,h=n.bearing,f=void 0===h?O:h,p=n.pitch,d=void 0===p?S:p,A=n.altitude,g=void 0===A?T:A,m=n.maxZoom,y=void 0===m?M:m,v=n.minZoom,_=void 0===v?P:v,x=n.maxPitch,w=void 0===x?I:x,E=n.minPitch,k=void 0===E?C:E,R=n.startPanLngLat,L=n.startZoomLngLat,j=n.startRotatePos,D=n.startBearing,B=n.startPitch,F=n.startZoom,z=n.normalize;return u()(this,r),Object(b.a)(Number.isFinite(c)),Object(b.a)(Number.isFinite(s)),Object(b.a)(Number.isFinite(l)),(t=e.call(this,{width:o,height:a,latitude:s,longitude:c,zoom:l,bearing:f,pitch:d,altitude:g,maxZoom:y,minZoom:_,maxPitch:w,minPitch:k,normalize:z}))._state={startPanLngLat:R,startZoomLngLat:L,startRotatePos:j,startBearing:D,startPitch:B,startZoom:F},t.makeViewport=i,t}return l()(r,[{key:"panStart",value:function(t){var e=t.pos;return this._getUpdatedState({startPanLngLat:this._unproject(e)})}},{key:"pan",value:function(t){var e=t.pos,r=t.startPos,n=this._state.startPanLngLat||this._unproject(r);if(!n)return this;var i=this.makeViewport(this._viewportProps).panByPosition(n,e);return this._getUpdatedState(i)}},{key:"panEnd",value:function(){return this._getUpdatedState({startPanLngLat:null})}},{key:"rotateStart",value:function(t){var e=t.pos;return this._getUpdatedState({startRotatePos:e,startBearing:this._viewportProps.bearing,startPitch:this._viewportProps.pitch})}},{key:"rotate",value:function(t){var e,r=t.pos,n=t.deltaAngleX,i=void 0===n?0:n,o=t.deltaAngleY,a=void 0===o?0:o,s=this._state,u=s.startRotatePos,c=s.startBearing,l=s.startPitch;return u&&Number.isFinite(c)&&Number.isFinite(l)?(e=r?this._calculateNewPitchAndBearing(w(w({},this._getRotationParams(r,u)),{},{startBearing:c,startPitch:l})):{bearing:c+i,pitch:l+a},this._getUpdatedState(e)):this}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startBearing:null,startPitch:null})}},{key:"zoomStart",value:function(t){var e=t.pos;return this._getUpdatedState({startZoomLngLat:this._unproject(e),startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(t){var e=t.pos,r=t.startPos,n=t.scale,i=this._state,o=i.startZoom,a=i.startZoomLngLat;Number.isFinite(o)||(o=this._viewportProps.zoom,a=this._unproject(r)||this._unproject(e));var s=this._calculateNewZoom({scale:n,startZoom:o}),u=this.makeViewport(w(w({},this._viewportProps),{},{zoom:s}));return this._getUpdatedState(w({zoom:s},u.panByPosition(a,e)))}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}},{key:"zoomIn",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;return this._zoomFromCenter(t)}},{key:"zoomOut",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;return this._zoomFromCenter(1/t)}},{key:"moveLeft",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return this._panFromCenter([t,0])}},{key:"moveRight",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return this._panFromCenter([-t,0])}},{key:"moveUp",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return this._panFromCenter([0,t])}},{key:"moveDown",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return this._panFromCenter([0,-t])}},{key:"rotateLeft",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15;return this._getUpdatedState({bearing:this._viewportProps.bearing-t})}},{key:"rotateRight",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15;return this._getUpdatedState({bearing:this._viewportProps.bearing+t})}},{key:"rotateUp",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this._getUpdatedState({pitch:this._viewportProps.pitch+t})}},{key:"rotateDown",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this._getUpdatedState({pitch:this._viewportProps.pitch-t})}},{key:"shortestPathFrom",value:function(t){var e=t.getViewportProps(),r=w({},this._viewportProps),n=r.bearing,i=r.longitude;return Math.abs(n-e.bearing)>180&&(r.bearing=n<0?n+360:n-360),Math.abs(i-e.longitude)>180&&(r.longitude=i<0?i+360:i-360),r}},{key:"_zoomFromCenter",value:function(t){var e=this._viewportProps,r=e.width,n=e.height;return this.zoom({pos:[r/2,n/2],scale:t})}},{key:"_panFromCenter",value:function(t){var e=this._viewportProps,r=e.width,n=e.height;return this.pan({startPos:[r/2,n/2],pos:[r/2+t[0],n/2+t[1]]})}},{key:"_getUpdatedState",value:function(t){return new this.constructor(w(w(w({makeViewport:this.makeViewport},this._viewportProps),this._state),t))}},{key:"_applyConstraints",value:function(t){var e=t.maxZoom,r=t.minZoom,n=t.zoom;t.zoom=Object(m.d)(n,r,e);var i=t.maxPitch,o=t.minPitch,a=t.pitch;t.pitch=Object(m.d)(a,o,i);var s=t.normalize;return(void 0===s||s)&&Object.assign(t,Object(_.m)(t)),t}},{key:"_unproject",value:function(t){var e=this.makeViewport(this._viewportProps);return t&&e.unproject(t)}},{key:"_calculateNewZoom",value:function(t){var e=t.scale,r=t.startZoom,n=this._viewportProps,i=n.maxZoom,o=n.minZoom,a=r+Math.log2(e);return Object(m.d)(a,o,i)}},{key:"_calculateNewPitchAndBearing",value:function(t){var e=t.deltaScaleX,r=t.deltaScaleY,n=t.startBearing,i=t.startPitch;r=Object(m.d)(r,-1,1);var o=this._viewportProps,a=o.minPitch,s=o.maxPitch,u=i;return r>0?u=i+r*(s-i):r<0&&(u=i-r*(a-i)),{pitch:u,bearing:n+180*e}}},{key:"_getRotationParams",value:function(t,e){var r=t[0]-e[0],n=t[1]-e[1],i=t[1],o=e[1],a=this._viewportProps,s=a.width,u=a.height,c=r/s,l=0;return n>0?Math.abs(u-o)>5&&(l=n/(o-u)*1.2):n<0&&o>5&&(l=1-i/o),{deltaScaleX:c,deltaScaleY:l=Math.min(1,Math.max(-1,l))}}}]),r}(v.a),R=function(t){f()(r,t);var e=E(r);function r(t){return u()(this,r),t.dragMode=t.dragMode||"pan",e.call(this,k,t)}return l()(r,[{key:"setProps",value:function(t){var e=this.controllerStateProps;i()(g()(r.prototype),"setProps",this).call(this,t),(!e||e.height!==t.height)&&this.updateViewport(new this.ControllerState(w(w({makeViewport:this.makeViewport},this.controllerStateProps),this._state)))}},{key:"linearTransitionProps",get:function(){return["longitude","latitude","zoom","bearing","pitch"]}}]),r}(y.a)},function(t,e,r){"use strict";r.d(e,"a",(function(){return h}));var n=r(2),i=r.n(n),o=r(3),a=r.n(o),s=r(11),u=r(37);function c(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return l(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return l(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var h=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i()(this,t),Array.isArray(e)&&(e={compare:e,extract:e,required:e});var r=e,n=r.compare,o=r.extract,a=r.required;this._propsToCompare=n,this._propsToExtract=o,this._requiredProps=a}return a()(t,[{key:"arePropsEqual",value:function(t,e){var r,n=c(this._propsToCompare||Object.keys(e));try{for(n.s();!(r=n.n()).done;){var i=r.value;if(!(i in t&&i in e&&Object(s.e)(t[i],e[i])))return!1}}catch(t){n.e(t)}finally{n.f()}return!0}},{key:"initializeProps",value:function(t,e){var r;if(this._propsToExtract){var n,i={},o={},a=c(this._propsToExtract);try{for(a.s();!(n=a.n()).done;){var s=n.value;i[s]=t[s],o[s]=e[s]}}catch(t){a.e(t)}finally{a.f()}r={start:i,end:o}}else r={start:t,end:e};return this._checkRequiredProps(r.start),this._checkRequiredProps(r.end),r}},{key:"interpolateProps",value:function(t,e,r){return e}},{key:"getDuration",value:function(t,e){return e.transitionDuration}},{key:"_checkRequiredProps",value:function(t){this._requiredProps&&this._requiredProps.forEach((function(e){var r=t[e];Object(u.a)(Number.isFinite(r)||Array.isArray(r),"".concat(e," is required for transition"))}))}}]),t}()},function(t,e,r){"use strict";var n=r(0),i=r.n(n),o=r(2),a=r.n(o),s=r(3),u=r.n(s),c=r(8),l=r.n(c),h=r(5),f=r.n(h),p=r(6),d=r.n(p),A=r(1),g=r.n(A),m=r(207),y=r(227),v=r(226),_=r(14),b=r(155),x=r(240),w=r(179),E=r(176),S=r(62),O=r(136),T=r(209),P=r(38);function M(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return C(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return C(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function C(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function I(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function k(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?I(Object(r),!0).forEach((function(e){i()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):I(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function R(t){var e=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(t){return!1}}();return function(){var r,n=g()(t);if(e){var i=g()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d()(this,r)}}var L=function(t){f()(r,t);var e=R(r);function r(t){a()(this,r);var n=t.fp64,i=t.IndexType,o=void 0===i?Uint32Array:i;return e.call(this,k(k({},t),{},{attributes:{positions:{size:3,type:n?Float64Array:Float32Array},vertexValid:{type:Uint8ClampedArray,size:1},indices:{type:o,size:1}}}))}return u()(r,[{key:"get",value:function(t){var e=this.attributes;return"indices"===t?e.indices&&e.indices.subarray(0,this.vertexCount):e[t]}},{key:"updateGeometry",value:function(t){l()(g()(r.prototype),"updateGeometry",this).call(this,t);var e=this.buffers.indices;e&&(this.vertexCount=(e.value||e).length)}},{key:"normalizeGeometry",value:function(t){if(this.normalize){if(t=O.b(t,this.positionSize),this.opts.resolution)return Object(P.b)(t.positions||t,t.holeIndices,{size:this.positionSize,gridResolution:this.opts.resolution,edgeTypes:!0});if(this.opts.wrapLongitude)return Object(P.c)(t.positions||t,t.holeIndices,{size:this.positionSize,maxLatitude:86,edgeTypes:!0})}return t}},{key:"getGeometrySize",value:function(t){if(Array.isArray(t)&&!Number.isFinite(t[0])){var e,r=0,n=M(t);try{for(n.s();!(e=n.n()).done;){var i=e.value;r+=this.getGeometrySize(i)}}catch(t){n.e(t)}finally{n.f()}return r}return(t.positions||t).length/this.positionSize}},{key:"getGeometryFromBuffer",value:function(t){return this.normalize||!this.buffers.indices?l()(g()(r.prototype),"getGeometryFromBuffer",this).call(this,t):function(){return null}}},{key:"updateGeometryAttributes",value:function(t,e){if(Array.isArray(t)&&!Number.isFinite(t[0])){var r,n=M(t);try{for(n.s();!(r=n.n()).done;){var i=r.value,o=this.getGeometrySize(i);e.geometrySize=o,this.updateGeometryAttributes(i,e),e.vertexStart+=o,e.indexStart=this.indexStarts[e.geometryIndex+1]}}catch(t){n.e(t)}finally{n.f()}}else this._updateIndices(t,e),this._updatePositions(t,e),this._updateVertexValid(t,e)}},{key:"_updateIndices",value:function(t,e){var r=e.geometryIndex,n=e.vertexStart,i=e.indexStart,o=this.attributes,a=this.indexStarts,s=this.typedArrayManager,u=o.indices;if(u){var c=i,l=O.a(t,this.positionSize,this.opts.preproject);u=s.allocate(u,i+l.length,{copy:!0});for(var h=0;h<l.length;h++)u[c++]=l[h]+n;a[r+1]=i+l.length,o.indices=u}}},{key:"_updatePositions",value:function(t,e){var r=e.vertexStart,n=e.geometrySize,i=this.attributes.positions,o=this.positionSize;if(i)for(var a=t.positions||t,s=r,u=0;u<n;s++,u++){var c=a[u*o],l=a[u*o+1],h=o>2?a[u*o+2]:0;i[3*s]=c,i[3*s+1]=l,i[3*s+2]=h}}},{key:"_updateVertexValid",value:function(t,e){var r=e.vertexStart,n=e.geometrySize,i=this.attributes.vertexValid,o=this.positionSize,a=t&&t.holeIndices;if(t&&t.edgeTypes?i.set(t.edgeTypes,r):i.fill(1,r,r+n),a)for(var s=0;s<a.length;s++)i[r+a[s]/o-1]=0;i[r+n-1]=0}}]),r}(T.a),j="\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#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 = vec3(0.0, 0.0, 1.0);\n#endif\n geometry.normal = normal;\n }\n\n gl_Position = project_position_to_clipspace(pos, pos64Low, vec3(0.), geometry.position);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n if (extruded) {\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",D="#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(j,"\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"),B="#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(j,"\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");function F(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function z(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?F(Object(r),!0).forEach((function(e){i()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):F(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function N(t){var e=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(t){return!1}}();return function(){var r,n=g()(t);if(e){var i=g()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d()(this,r)}}r.d(e,"a",(function(){return W}));var U=[0,0,0,255],V={filled:!0,extruded:!1,wireframe:!1,_normalize:!0,_windingOrder:"CW",elevationScale:{type:"number",min:0,value:1},getPolygon:{type:"accessor",value:function(t){return t.polygon}},getElevation:{type:"accessor",value:1e3},getFillColor:{type:"accessor",value:U},getLineColor:{type:"accessor",value:U},material:!0},G={enter:function(t,e){return e.length?e.subarray(e.length-t.length):t}},W=function(t){f()(r,t);var e=N(r);function r(){return a()(this,r),e.apply(this,arguments)}return u()(r,[{key:"getShaders",value:function(t){return l()(g()(r.prototype),"getShaders",this).call(this,{vs:"top"===t?D:B,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:[m.a,y.a,v.a]})}},{key:"initializeState",value:function(){var t=this,e=this.context,r=e.gl,n=e.viewport,i=this.props.coordinateSystem;n.isGeospatial&&i===_.a.DEFAULT&&(i=_.a.LNGLAT),this.setState({numInstances:0,polygonTesselator:new L({preproject:i===_.a.LNGLAT&&n.projectFlat,fp64:this.use64bitPositions(),IndexType:!r||Object(x.c)(r,w.a.ELEMENT_INDEX_UINT32)?Uint32Array:Uint16Array})});var o=this.getAttributeManager();o.remove(["instancePickingColors"]),o.add({indices:{size:1,isIndexed:!0,update:this.calculateIndices,noAlloc:!0},positions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:G,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:G,accessor:"getElevation",shaderAttributes:{elevations:{divisor:0},instanceElevations:{divisor:1}}},fillColors:{alias:"colors",size:this.props.colorFormat.length,type:5121,normalized:!0,transition:G,accessor:"getFillColor",defaultValue:U,shaderAttributes:{fillColors:{divisor:0},instanceFillColors:{divisor:1}}},lineColors:{alias:"colors",size:this.props.colorFormat.length,type:5121,normalized:!0,transition:G,accessor:"getLineColor",defaultValue:U,shaderAttributes:{lineColors:{divisor:0},instanceLineColors:{divisor:1}}},pickingColors:{size:3,type:5121,accessor:function(e,r){var n=r.index,i=r.target;return t.encodePickingColor(e&&e.__source?e.__source.index:n,i)},shaderAttributes:{pickingColors:{divisor:0},instancePickingColors:{divisor:1}}}})}},{key:"getPickingInfo",value:function(t){var e=l()(g()(r.prototype),"getPickingInfo",this).call(this,t),n=e.index,i=this.props.data;return i[0]&&i[0].__source&&(e.object=i.find((function(t){return t.__source.index===n}))),e}},{key:"disablePickingIndex",value:function(t){var e=this.props.data;if(e[0]&&e[0].__source)for(var r=0;r<e.length;r++)e[r].__source.index===t&&this._disablePickingIndex(r);else this._disablePickingIndex(t)}},{key:"draw",value:function(t){var e=t.uniforms,r=this.props,n=r.extruded,i=r.filled,o=r.wireframe,a=r.elevationScale,s=this.state,u=s.topModel,c=s.sideModel,l=s.polygonTesselator,h=z(z({},e),{},{extruded:Boolean(n),elevationScale:a});c&&(c.setInstanceCount(l.instanceCount-1),c.setUniforms(h),o&&(c.setDrawMode(3),c.setUniforms({isWireframe:!0}).draw()),i&&(c.setDrawMode(6),c.setUniforms({isWireframe:!1}).draw())),u&&(u.setVertexCount(l.vertexCount),u.setUniforms(h).draw())}},{key:"updateState",value:function(t){l()(g()(r.prototype),"updateState",this).call(this,t),this.updateGeometry(t);var e,n=t.props,i=t.oldProps,o=t.changeFlags,a=this.getAttributeManager();(o.extensionsChanged||n.filled!==i.filled||n.extruded!==i.extruded)&&(null===(e=this.state.models)||void 0===e||e.forEach((function(t){return t.delete()})),this.setState(this._getModels(this.context.gl)),a.invalidateAll())}},{key:"updateGeometry",value:function(t){var e=t.props,r=(t.oldProps,t.changeFlags);if(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getPolygon)){var n=this.state.polygonTesselator,i=e.data.attributes||{};n.updateGeometry({data:e.data,normalize:e._normalize,geometryBuffer:i.getPolygon,buffers:i,getGeometry:e.getPolygon,positionFormat:e.positionFormat,wrapLongitude:e.wrapLongitude,resolution:this.context.viewport.resolution,fp64:this.use64bitPositions(),dataChanged:r.dataChanged}),this.setState({numInstances:n.instanceCount,startIndices:n.vertexStarts}),r.dataChanged||this.getAttributeManager().invalidateAll()}}},{key:"_getModels",value:function(t){var e,r,n=this.props,i=n.id,o=n.filled,a=n.extruded;if(o){var s=this.getShaders("top");s.defines.NON_INSTANCED_MODEL=1,e=new E.a(t,z(z({},s),{},{id:"".concat(i,"-top"),drawMode:4,attributes:{vertexPositions:new Float32Array([0,1])},uniforms:{isWireframe:!1,isSideVertex:!1},vertexCount:0,isIndexed:!0}))}return a&&((r=new E.a(t,z(z({},this.getShaders("side")),{},{id:"".concat(i,"-side"),geometry:new S.a({drawMode:1,vertexCount:4,attributes:{vertexPositions:{size:2,value:new Float32Array([1,0,0,0,0,1,1,1])}}}),instanceCount:0,isInstanced:1}))).userData.excludeAttributes={indices:!0}),{models:[r,e].filter(Boolean),topModel:e,sideModel:r}}},{key:"calculateIndices",value:function(t){var e=this.state.polygonTesselator;t.startIndices=e.indexStarts,t.value=e.get("indices")}},{key:"calculatePositions",value:function(t){var e=this.state.polygonTesselator;t.startIndices=e.vertexStarts,t.value=e.get("positions")}},{key:"calculateVertexValid",value:function(t){t.value=this.state.polygonTesselator.get("vertexValid")}},{key:"wrapLongitude",get:function(){return!1}}]),r}(b.a);W.layerName="SolidPolygonLayer",W.defaultProps=V},function(t,e,r){"use strict";var n=r(0),i=r.n(n),o=r(2),a=r.n(o),s=r(3),u=r.n(s),c=r(8),l=r.n(c),h=r(5),f=r.n(h),p=r(6),d=r.n(p),A=r(1),g=r.n(A),m=r(207),y=r(226),v=r(18),_=r(14),b=r(155),x=r(176),w=r(62),E=r(209),S=r(38);function O(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return T(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return T(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function T(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function P(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function M(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?P(Object(r),!0).forEach((function(e){i()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):P(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function C(t){var e=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(t){return!1}}();return function(){var r,n=g()(t);if(e){var i=g()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d()(this,r)}}var I=function(t){f()(r,t);var e=C(r);function r(t){return a()(this,r),e.call(this,M(M({},t),{},{attributes:{positions:{size:3,padding:18,initialize:!0,type:t.fp64?Float64Array:Float32Array},segmentTypes:{size:1,type:Uint8ClampedArray}}}))}return u()(r,[{key:"getGeometryFromBuffer",value:function(t){return this.normalize?l()(g()(r.prototype),"getGeometryFromBuffer",this).call(this,t):function(){return null}}},{key:"normalizeGeometry",value:function(t){return this.normalize?function(t,e,r,n){var i=t;if(Array.isArray(t[0])){var o=t.length*e;i=new Array(o);for(var a=0;a<t.length;a++)for(var s=0;s<e;s++)i[a*e+s]=t[a][s]||0}return r?Object(S.d)(i,{size:e,gridResolution:r}):n?Object(S.e)(i,{size:e}):i}(t,this.positionSize,this.opts.resolution,this.opts.wrapLongitude):t}},{key:"get",value:function(t){return this.attributes[t]}},{key:"getGeometrySize",value:function(t){if(Array.isArray(t[0])){var e,r=0,n=O(t);try{for(n.s();!(e=n.n()).done;){var i=e.value;r+=this.getGeometrySize(i)}}catch(t){n.e(t)}finally{n.f()}return r}var o=this.getPathLength(t);return o<2?0:this.isClosed(t)?o<3?0:o+2:o}},{key:"updateGeometryAttributes",value:function(t,e){if(0!==e.geometrySize)if(t&&Array.isArray(t[0])){var r,n=O(t);try{for(n.s();!(r=n.n()).done;){var i=r.value,o=this.getGeometrySize(i);e.geometrySize=o,this.updateGeometryAttributes(i,e),e.vertexStart+=o}}catch(t){n.e(t)}finally{n.f()}}else this._updateSegmentTypes(t,e),this._updatePositions(t,e)}},{key:"_updateSegmentTypes",value:function(t,e){var r=this.attributes.segmentTypes,n=this.isClosed(t),i=e.vertexStart,o=e.geometrySize;r.fill(0,i,i+o),n?(r[i]=4,r[i+o-2]=4):(r[i]+=1,r[i+o-2]+=2),r[i+o-1]=4}},{key:"_updatePositions",value:function(t,e){var r=this.attributes.positions;if(r)for(var n=e.vertexStart,i=e.geometrySize,o=new Array(3),a=n,s=0;s<i;a++,s++)this.getPointOnPath(t,s,o),r[3*a]=o[0],r[3*a+1]=o[1],r[3*a+2]=o[2]}},{key:"getPathLength",value:function(t){return t.length/this.positionSize}},{key:"getPointOnPath",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=this.positionSize;e*n>=t.length&&(e+=1-t.length/n);var i=e*n;return r[0]=t[i],r[1]=t[i+1],r[2]=3===n&&t[i+2]||0,r}},{key:"isClosed",value:function(t){if(!this.normalize)return this.opts.loop;var e=this.positionSize,r=t.length-e;return t[0]===t[r]&&t[1]===t[r+1]&&(2===e||t[2]===t[r+2])}}]),r}(E.a);function k(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function R(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?k(Object(r),!0).forEach((function(e){i()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):k(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function L(t){var e=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(t){return!1}}();return function(){var r,n=g()(t);if(e){var i=g()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d()(this,r)}}r.d(e,"a",(function(){return F}));var j=[0,0,0,255],D={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:function(t){return t.path}},getColor:{type:"accessor",value:j},getWidth:{type:"accessor",value:1},rounded:{deprecatedFor:["jointRounded","capRounded"]}},B={enter:function(t,e){return e.length?e.subarray(e.length-t.length):t}},F=function(t){f()(r,t);var e=L(r);function r(){return a()(this,r),e.apply(this,arguments)}return u()(r,[{key:"getShaders",value:function(){return l()(g()(r.prototype),"getShaders",this).call(this,{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:[m.a,y.a]})}},{key:"initializeState",value:function(){var t=this;this.getAttributeManager().addInstanced({positions:{size:3,vertexOffset:1,type:5130,fp64:this.use64bitPositions(),transition:B,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:B,defaultValue:1},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,accessor:"getColor",transition:B,defaultValue:j},instancePickingColors:{size:3,type:5121,accessor:function(e,r){var n=r.index,i=r.target;return t.encodePickingColor(e&&e.__source?e.__source.index:n,i)}}}),this.setState({pathTesselator:new I({fp64:this.use64bitPositions()})}),this.props.getDashArray&&!this.props.extensions.length&&v.a.removed("getDashArray","PathStyleExtension")()}},{key:"updateState",value:function(t){var e=t.oldProps,n=t.props,i=t.changeFlags;l()(g()(r.prototype),"updateState",this).call(this,{props:n,oldProps:e,changeFlags:i});var o=this.getAttributeManager();if(i.dataChanged||i.updateTriggersChanged&&(i.updateTriggersChanged.all||i.updateTriggersChanged.getPath)){var a=this.state.pathTesselator,s=n.data.attributes||{};a.updateGeometry({data:n.data,geometryBuffer:s.getPath,buffers:s,normalize:!n._pathType,loop:"loop"===n._pathType,getGeometry:n.getPath,positionFormat:n.positionFormat,wrapLongitude:n.wrapLongitude,resolution:this.context.viewport.resolution,dataChanged:i.dataChanged}),this.setState({numInstances:a.instanceCount,startIndices:a.vertexStarts}),i.dataChanged||o.invalidateAll()}if(i.extensionsChanged){var u,c=this.context.gl;null===(u=this.state.model)||void 0===u||u.delete(),this.state.model=this._getModel(c),o.invalidateAll()}}},{key:"getPickingInfo",value:function(t){var e=l()(g()(r.prototype),"getPickingInfo",this).call(this,t),n=e.index,i=this.props.data;return i[0]&&i[0].__source&&(e.object=i.find((function(t){return t.__source.index===n}))),e}},{key:"disablePickingIndex",value:function(t){var e=this.props.data;if(e[0]&&e[0].__source)for(var r=0;r<e.length;r++)e[r].__source.index===t&&this._disablePickingIndex(r);else this._disablePickingIndex(t)}},{key:"draw",value:function(t){var e=t.uniforms,r=this.props,n=r.jointRounded,i=r.capRounded,o=r.billboard,a=r.miterLimit,s=r.widthUnits,u=r.widthScale,c=r.widthMinPixels,l=r.widthMaxPixels;this.state.model.setUniforms(e).setUniforms({jointType:Number(n),capType:Number(i),billboard:o,widthUnits:_.d[s],widthScale:u,miterLimit:a,widthMinPixels:c,widthMaxPixels:l}).draw()}},{key:"_getModel",value:function(t){return new x.a(t,R(R({},this.getShaders()),{},{id:this.props.id,geometry:new w.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}))}},{key:"calculatePositions",value:function(t){var e=this.state.pathTesselator;t.startIndices=e.vertexStarts,t.value=e.get("positions")}},{key:"calculateSegmentTypes",value:function(t){var e=this.state.pathTesselator;t.startIndices=e.vertexStarts,t.value=e.get("segmentTypes")}},{key:"wrapLongitude",get:function(){return!1}}]),r}(b.a);F.layerName="PathLayer",F.defaultProps=D},function(t,e,r){"use strict";var n,i=r(0),o=r.n(i),a=r(2),s=r.n(a),u=r(3),c=r.n(u),l=r(8),h=r.n(l),f=r(5),p=r.n(f),d=r(6),A=r.n(d),g=r(1),m=r.n(g),y=r(207),v=r(226),_=r(14),b=r(18),x=r(155),w=r(176),E=r(62),S=r(230),O=r(197),T=r(98),P=r(292),M=r(206),C=r(53);function I(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return k(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return k(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function k(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function R(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function L(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?R(Object(r),!0).forEach((function(e){o()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):R(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var j=function(){},D=(n={},o()(n,10241,9987),o()(n,10240,9729),o()(n,10242,33071),o()(n,10243,33071),n);function B(t){return t&&(t.id||t.url)}function F(t,e,r){for(var n=0;n<e.length;n++){var i=e[n],o=i.icon,a=i.xOffset;t[B(o)]=L(L({},o),{},{x:a,y:r})}}var z=function(){function t(e,r){var n=r.onUpdate,i=void 0===n?j:n,o=r.onError,a=void 0===o?j:o;s()(this,t),this.gl=e,this.onUpdate=i,this.onError=a,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}return c()(t,[{key:"finalize",value:function(){var t;null===(t=this._texture)||void 0===t||t.delete()}},{key:"getTexture",value:function(){return this._texture||this._externalTexture}},{key:"getIconMapping",value:function(t){var e=this._autoPacking?B(t):t;return this._mapping[e]||{}}},{key:"setProps",value:function(t){var e=t.loadOptions,r=t.autoPacking,n=t.iconAtlas,i=t.iconMapping,o=t.data,a=t.getIcon;e&&(this._loadOptions=e),void 0!==r&&(this._autoPacking=r),a&&(this._getIcon=a),i&&(this._mapping=i),n&&this._updateIconAtlas(n),this._autoPacking&&(o||a)&&"undefined"!=typeof document&&(this._canvas=this._canvas||document.createElement("canvas"),this._updateAutoPacking(o))}},{key:"_updateIconAtlas",value:function(t){var e;null===(e=this._texture)||void 0===e||e.delete(),this._texture=null,this._externalTexture=t,this.onUpdate()}},{key:"_updateAutoPacking",value:function(t){var e,r,n,i,o,a,s=Object.values(function(t,e,r){if(!t||!e)return null;r=r||{};var n,i={},o=Object(C.a)(t),a=o.iterable,s=o.objectInfo,u=I(a);try{for(u.s();!(n=u.n()).done;){var c=n.value;s.index++;var l=e(c,s),h=B(l);if(!l)throw new Error("Icon is missing.");if(!l.url)throw new Error("Icon url is missing.");i[h]||r[h]&&l.url===r[h].url||(i[h]=L(L({},l),{},{source:c,sourceIndex:s.index}))}}catch(t){u.e(t)}finally{u.f()}return i}(t,this._getIcon,this._mapping)||{});if(s.length>0){var u=function(t){for(var e,r=t.icons,n=t.buffer,i=t.mapping,o=void 0===i?{}:i,a=t.xOffset,s=void 0===a?0:a,u=t.yOffset,c=void 0===u?0:u,l=t.rowHeight,h=void 0===l?0:l,f=t.canvasWidth,p=[],d=0;d<r.length;d++){var A=r[d];if(!o[B(A)]){var g=A.height,m=A.width;s+m+n>f&&(F(o,p,c),s=0,c=h+c+n,h=0,p=[]),p.push({icon:A,xOffset:s}),s=s+m+n,h=Math.max(h,g)}}return p.length>0&&F(o,p,c),{mapping:o,rowHeight:h,xOffset:s,yOffset:c,canvasWidth:f,canvasHeight:(e=h+c+n,Math.pow(2,Math.ceil(Math.log2(e))))}}({icons:s,buffer:this._buffer,canvasWidth:this._canvasWidth,mapping:this._mapping,rowHeight:this._rowHeight,xOffset:this._xOffset,yOffset:this._yOffset}),c=u.mapping,l=u.xOffset,h=u.yOffset,f=u.rowHeight,p=u.canvasHeight;this._rowHeight=f,this._mapping=c,this._xOffset=l,this._yOffset=h,this._canvasHeight=p,this._texture||(this._texture=new T.a(this.gl,{width:this._canvasWidth,height:this._canvasHeight,parameters:D})),this._texture.height!==this._canvasHeight&&(this._texture=(this.gl,e=this._texture,r=this._canvasWidth,n=this._canvasHeight,i=e.width,o=e.height,a=Object(S.a)(e,{width:r,height:n}),Object(O.b)(e,a,{targetY:0,width:i,height:o}),e.delete(),a)),this.onUpdate(),this._loadIcons(s)}}},{key:"_loadIcons",value:function(t){var e,r=this,n=this._canvas.getContext("2d"),i=I(t);try{var o=function(){var t=e.value;r._pendingCount++,Object(M.a)(t.url,P.a,r._loadOptions).then((function(e){var i=B(t),o=r._mapping[i],a=o.x,s=o.y,u=o.width,c=o.height,l=function(t,e,r,n){return r===e.width&&n===e.height?e:(t.canvas.height=n,t.canvas.width=r,t.clearRect(0,0,t.canvas.width,t.canvas.height),t.drawImage(e,0,0,e.width,e.height,0,0,r,n),t.canvas)}(n,e,u,c);r._texture.setSubImageData({data:l,x:a,y:s,width:u,height:c}),r._texture.generateMipmap(),r.onUpdate()})).catch((function(e){r.onError({url:t.url,source:t.source,sourceIndex:t.sourceIndex,loadOptions:r._loadOptions,error:e})})).finally((function(){r._pendingCount--}))};for(i.s();!(e=i.n()).done;)o()}catch(t){i.e(t)}finally{i.f()}}},{key:"isLoaded",get:function(){return 0===this._pendingCount}}]),t}();function N(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function U(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?N(Object(r),!0).forEach((function(e){o()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):N(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function V(t){var e=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(t){return!1}}();return function(){var r,n=m()(t);if(e){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return A()(this,r)}}r.d(e,"a",(function(){return H}));var G=[0,0,0,255],W={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:function(t){return t.position}},getIcon:{type:"accessor",value:function(t){return t.icon}},getColor:{type:"accessor",value:G},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}},H=function(t){p()(r,t);var e=V(r);function r(){return s()(this,r),e.apply(this,arguments)}return c()(r,[{key:"getShaders",value:function(){return h()(m()(r.prototype),"getShaders",this).call(this,{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:[y.a,v.a]})}},{key:"initializeState",value:function(){this.state={iconManager:new z(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:G},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instancePixelOffset:{size:2,transition:!0,accessor:"getPixelOffset"}})}},{key:"updateState",value:function(t){var e=t.oldProps,n=t.props,i=t.changeFlags;h()(m()(r.prototype),"updateState",this).call(this,{props:n,oldProps:e,changeFlags:i});var o=this.getAttributeManager(),a=n.iconAtlas,s=n.iconMapping,u=n.data,c=n.getIcon,l=this.state.iconManager;l.setProps({loadOptions:n.loadOptions});var f=!1;if(a||this.internalState.isAsyncPropLoading("iconAtlas")?(e.iconAtlas!==n.iconAtlas&&l.setProps({iconAtlas:a,autoPacking:!1}),e.iconMapping!==n.iconMapping&&(l.setProps({iconMapping:s}),f=!0)):l.setProps({autoPacking:!0}),(i.dataChanged||i.updateTriggersChanged&&(i.updateTriggersChanged.all||i.updateTriggersChanged.getIcon))&&l.setProps({data:u,getIcon:c}),f&&(o.invalidate("instanceOffsets"),o.invalidate("instanceIconFrames"),o.invalidate("instanceColorModes")),i.extensionsChanged){var p,d=this.context.gl;null===(p=this.state.model)||void 0===p||p.delete(),this.state.model=this._getModel(d),o.invalidateAll()}}},{key:"finalizeState",value:function(){h()(m()(r.prototype),"finalizeState",this).call(this),this.state.iconManager.finalize()}},{key:"draw",value:function(t){var e=t.uniforms,r=this.props,n=r.sizeScale,i=r.sizeMinPixels,o=r.sizeMaxPixels,a=r.sizeUnits,s=r.billboard,u=r.alphaCutoff,c=this.state.iconManager.getTexture();c&&this.state.model.setUniforms(e).setUniforms({iconsTexture:c,iconsTextureDim:[c.width,c.height],sizeUnits:_.d[a],sizeScale:n,sizeMinPixels:i,sizeMaxPixels:o,billboard:s,alphaCutoff:u}).draw()}},{key:"_getModel",value:function(t){return new w.a(t,U(U({},this.getShaders()),{},{id:this.props.id,geometry:new E.a({drawMode:6,attributes:{positions:{size:2,value:new Float32Array([-1,-1,-1,1,1,1,1,-1])}}}),isInstanced:!0}))}},{key:"_onUpdate",value:function(){this.setNeedsRedraw()}},{key:"_onError",value:function(t){var e=this.getCurrentLayer().props.onIconError;e?e(t):b.a.error(t.error)()}},{key:"getInstanceOffset",value:function(t){var e=this.state.iconManager.getIconMapping(t);return[e.width/2-e.anchorX||0,e.height/2-e.anchorY||0]}},{key:"getInstanceColorMode",value:function(t){return this.state.iconManager.getIconMapping(t).mask?1:0}},{key:"getInstanceIconFrame",value:function(t){var e=this.state.iconManager.getIconMapping(t);return[e.x||0,e.y||0,e.width||0,e.height||0]}},{key:"isLoaded",get:function(){return h()(m()(r.prototype),"isLoaded",this)&&this.state.iconManager.isLoaded}}]),r}(x.a);H.layerName="IconLayer",H.defaultProps=W},function(t,e,r){"use strict";r.d(e,"a",(function(){return o}));var n=r(13),i=r(42);class o extends(function(t){function e(){var e=Reflect.construct(t,Array.from(arguments));return Object.setPrototypeOf(e,Object.getPrototypeOf(this)),e}return e.prototype=Object.create(t.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t,e}(Array)){get ELEMENTS(){return Object(i.a)(!1),0}clone(){return(new this.constructor).copy(this)}from(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}fromArray(t,e=0){for(let r=0;r<this.ELEMENTS;++r)this[r]=t[r+e];return this.check()}to(t){return t===this?this:Object(n.f)(t)?this.toArray(t):this.toObject(t)}toTarget(t){return t?this.to(t):this}toArray(t=[],e=0){for(let r=0;r<this.ELEMENTS;++r)t[e+r]=this[r];return t}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(n.b)}formatString(t){let e="";for(let r=0;r<this.ELEMENTS;++r)e+=(r>0?", ":"")+Object(n.e)(this[r],t);return`${t.printTypes?this.constructor.name:""}[${e}]`}equals(t){if(!t||this.length!==t.length)return!1;for(let e=0;e<this.ELEMENTS;++e)if(!Object(n.d)(this[e],t[e]))return!1;return!0}exactEquals(t){if(!t||this.length!==t.length)return!1;for(let e=0;e<this.ELEMENTS;++e)if(this[e]!==t[e])return!1;return!0}negate(){for(let t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}lerp(t,e,r){void 0===r&&(r=e,e=t,t=this);for(let n=0;n<this.ELEMENTS;++n){const i=t[n];this[n]=i+r*(e[n]-i)}return this.check()}min(t){for(let e=0;e<this.ELEMENTS;++e)this[e]=Math.min(t[e],this[e]);return this.check()}max(t){for(let e=0;e<this.ELEMENTS;++e)this[e]=Math.max(t[e],this[e]);return this.check()}clamp(t,e){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(Math.max(this[r],t[r]),e[r]);return this.check()}add(...t){for(const e of t)for(let t=0;t<this.ELEMENTS;++t)this[t]+=e[t];return this.check()}subtract(...t){for(const e of t)for(let t=0;t<this.ELEMENTS;++t)this[t]-=e[t];return this.check()}scale(t){if(Array.isArray(t))return this.multiply(t);for(let e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}sub(t){return this.subtract(t)}setScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]=t;return this.check()}addScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]+=t;return this.check()}subScalar(t){return this.addScalar(-t)}multiplyScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}divideScalar(t){return this.scale(1/t)}clampScalar(t,e){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(Math.max(this[r],t),e);return this.check()}multiplyByScalar(t){return this.scale(t)}get elements(){return this}check(){if(n.b.debug&&!this.validate())throw new Error(`math.gl: ${this.constructor.name} some fields set to invalid numbers'`);return this}validate(){let t=this.length===this.ELEMENTS;for(let e=0;e<this.ELEMENTS;++e)t=t&&Number.isFinite(this[e]);return t}}},function(t,e,r){"use strict";var n=r(44),i=r.n(n),o=r(10),a=r.n(o),s=r(14),u=r(95),c=r(11),l=r(80),h=r(22);function f(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return p(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return p(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function p(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var d=Object(l.a)((function(t){var e=t.viewport,r=t.center;return new c.a(e.viewProjectionMatrix).invert().transform(r)})),A=Object(l.a)((function(t){var e,r=t.viewport,n=t.shadowMatrices,o=[],s=r.pixelUnprojectionMatrix,u=r.isGeospatial?void 0:1,l=[[0,0,u],[r.width,0,u],[0,r.height,u],[r.width,r.height,u],[0,0,-1],[r.width,0,-1],[0,r.height,-1],[r.width,r.height,-1]].map((function(t){return function(t,e){var r=a()(t,3),n=r[0],i=r[1],o=r[2],s=Object(h.n)([n,i,o],e);if(Number.isFinite(o))return s;return[s[0],s[1],0]}(t,s)})),p=f(n);try{var d=function(){var t=e.value,n=t.clone().translate(new c.b(r.center).negate()),a=l.map((function(t){return n.transform(t)})),s=(new c.a).ortho({left:Math.min.apply(Math,i()(a.map((function(t){return t[0]})))),right:Math.max.apply(Math,i()(a.map((function(t){return t[0]})))),bottom:Math.min.apply(Math,i()(a.map((function(t){return t[1]})))),top:Math.max.apply(Math,i()(a.map((function(t){return t[1]})))),near:Math.min.apply(Math,i()(a.map((function(t){return-t[2]})))),far:Math.max.apply(Math,i()(a.map((function(t){return-t[2]}))))});o.push(s.multiplyRight(t))};for(p.s();!(e=p.n()).done;)d()}catch(t){p.e(t)}finally{p.f()}return o})),g=[0,0,0,1],m=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0];function y(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={shadow_uDrawShadowMap:Boolean(t.drawToShadowMap),shadow_uUseShadowMap:!!t.shadowMaps&&t.shadowMaps.length>0,shadow_uColor:t.shadowColor||g,shadow_uLightId:t.shadowLightId||0,shadow_uLightCount:t.shadowMatrices.length},n=d({viewport:t.viewport,center:e.project_uCenter}),i=[],o=A({shadowMatrices:t.shadowMatrices,viewport:t.viewport}).slice(),a=0;a<t.shadowMatrices.length;a++){var u=o[a],l=u.clone().translate(new c.b(t.viewport.center).negate());e.project_uCoordinateSystem===s.a.LNGLAT&&e.project_uProjectionMode===s.c.WEB_MERCATOR?(o[a]=l,i[a]=n):(o[a]=u.clone().multiplyRight(m),i[a]=l.transform(n))}for(var h=0;h<o.length;h++)r["shadow_uViewProjectionMatrices[".concat(h,"]")]=o[h],r["shadow_uProjectCenters[".concat(h,"]")]=i[h],t.shadowMaps&&t.shadowMaps.length>0?r["shadow_uShadowMap".concat(h)]=t.shadowMaps[h]:r["shadow_uShadowMap".concat(h)]=t.dummyShadowMap;return r}e.a={name:"shadow",dependencies:[u.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:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t.drawToShadowMap||t.shadowMaps&&t.shadowMaps.length>0){var r=t.shadowEnabled,n=void 0===r||r;return n&&t.shadowMatrices&&t.shadowMatrices.length>0?y(t,e):{shadow_uDrawShadowMap:!1,shadow_uUseShadowMap:!1}}return{}}}},function(t,e,r){"use strict";r.d(e,"a",(function(){return p})),r.d(e,"b",(function(){return d}));var n=r(17),i=r(28),o=r(14),a=r(80),s=[0,0,0,0],u=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],c=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],l=[0,0,0],h=[0,0,0],f=Object(a.a)((function(t){var e=t.viewport,r=t.devicePixelRatio,a=t.coordinateSystem,c=t.coordinateOrigin,h=function(t,e,r){var o=t.viewMatrixUncentered,a=t.projectionMatrix,c=t.viewMatrix,l=t.viewProjectionMatrix,h=s,f=s,d=t.cameraPosition,A=p(t,e,r),g=A.geospatialOrigin,m=A.shaderCoordinateOrigin;A.offsetMode&&(f=t.projectPosition(g||m),d=[d[0]-f[0],d[1]-f[1],d[2]-f[2]],f[3]=1,h=i.n([],f,l),c=o||c,l=n.h([],a,c),l=n.h([],l,u));return{viewMatrix:c,viewProjectionMatrix:l,projectionCenter:h,originCommon:f,cameraPosCommon:d,shaderCoordinateOrigin:m,geospatialOrigin:g}}(e,a,c),f=h.projectionCenter,d=h.viewProjectionMatrix,A=h.originCommon,g=h.cameraPosCommon,m=h.shaderCoordinateOrigin,y=h.geospatialOrigin,v=e.getDistanceScales(),_=[e.width*r,e.height*r],b=e.projectionMatrix.transform([0,0,-e.focalDistance,1])[3]||1,x={project_uCoordinateSystem:a,project_uProjectionMode:e.projectionMode,project_uCoordinateOrigin:m,project_uCommonOrigin:A.slice(0,3),project_uCenter:f,project_uPseudoMeters:Boolean(e._pseudoMeters),project_uViewportSize:_,project_uDevicePixelRatio:r,project_uFocalDistance:b,project_uCommonUnitsPerMeter:v.unitsPerMeter,project_uCommonUnitsPerWorldUnit:v.unitsPerMeter,project_uCommonUnitsPerWorldUnit2:l,project_uScale:e.scale,project_uViewProjectionMatrix:d,project_uCameraPosition:g};if(y){var w=e.getDistanceScales(y);switch(a){case o.a.METER_OFFSETS:x.project_uCommonUnitsPerWorldUnit=w.unitsPerMeter,x.project_uCommonUnitsPerWorldUnit2=w.unitsPerMeter2;break;case o.a.LNGLAT:case o.a.LNGLAT_OFFSETS:e._pseudoMeters||(x.project_uCommonUnitsPerMeter=w.unitsPerMeter),x.project_uCommonUnitsPerWorldUnit=w.unitsPerDegree,x.project_uCommonUnitsPerWorldUnit2=w.unitsPerDegree2;break;case o.a.CARTESIAN:x.project_uCommonUnitsPerWorldUnit=[1,1,w.unitsPerMeter[2]],x.project_uCommonUnitsPerWorldUnit2=[0,0,w.unitsPerMeter2[2]]}}return x}));function p(t,e){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h,i=n,a=!0;switch(r=e===o.a.LNGLAT_OFFSETS||e===o.a.METER_OFFSETS?n:t.isGeospatial?[Math.fround(t.longitude),Math.fround(t.latitude),0]:null,t.projectionMode){case o.c.WEB_MERCATOR:e!==o.a.LNGLAT&&e!==o.a.CARTESIAN||(r=[0,0,0],a=!1);break;case o.c.WEB_MERCATOR_AUTO_OFFSET:e===o.a.LNGLAT?i=r:e===o.a.CARTESIAN&&(i=[Math.fround(t.center[0]),Math.fround(t.center[1]),0],r=t.unprojectPosition(i),i[0]-=n[0],i[1]-=n[1],i[2]-=n[2]);break;case o.c.IDENTITY:i=t.position.map(Math.fround);break;case o.c.GLOBE:a=!1,r=null;break;default:a=!1}return i[2]=i[2]||0,{geospatialOrigin:r,shaderCoordinateOrigin:i,offsetMode:a}}function d(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.viewport,r=t.devicePixelRatio,n=void 0===r?1:r,i=t.modelMatrix,a=void 0===i?null:i,s=t.coordinateSystem,u=void 0===s?o.a.DEFAULT:s,l=t.coordinateOrigin,h=t.autoWrapLongitude,p=void 0!==h&&h;u===o.a.DEFAULT&&(u=e.isGeospatial?o.a.LNGLAT:o.a.CARTESIAN);var d=f({viewport:e,devicePixelRatio:n,coordinateSystem:u,coordinateOrigin:l});return d.project_uWrapLongitude=p,d.project_uModelMatrix=a||c,d}},function(t,e,r){"use strict";r.d(e,"a",(function(){return s}));var n=r(2),i=r.n(n),o=r(3),a=r.n(o),s=function(){function t(e){i()(this,t),this._viewportProps=this._applyConstraints(e)}return a()(t,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getState",value:function(){return this._state}},{key:"shortestPathFrom",value:function(t){return this._viewportProps}},{key:"_applyConstraints",value:function(t){return t}}]),t}()},function(t,e,r){"use strict";r.d(e,"b",(function(){return u})),r.d(e,"a",(function(){return c})),r.d(e,"c",(function(){return l}));var n=r(151),i=r(19),o=r(116),a=r(99);const s="Cannot convert supplied data type";function u(t,e,r){if(e.text&&"string"==typeof t)return t;if(Object(i.c)(t)&&(t=t.buffer),t instanceof ArrayBuffer){const r=t;if(e.text&&!e.binary){return new TextDecoder("utf8").decode(r)}return r}if(ArrayBuffer.isView(t)){if(e.text&&!e.binary){return new TextDecoder("utf8").decode(t)}let r=t.buffer;const n=t.byteLength||t.length;return 0===t.byteOffset&&n===r.byteLength||(r=r.slice(t.byteOffset,t.byteOffset+n)),r}throw new Error(s)}async function c(t,e,r){const c=t instanceof ArrayBuffer||ArrayBuffer.isView(t);if("string"==typeof t||c)return u(t,e);if(Object(i.b)(t)&&(t=await Object(a.b)(t)),Object(i.j)(t)){const r=t;return await Object(a.a)(r),e.binary?await r.arrayBuffer():await r.text()}if(Object(i.i)(t)&&(t=Object(o.a)(t,r)),Object(i.d)(t)||Object(i.a)(t))return Object(n.a)(t);throw new Error(s)}async function l(t,e){if(Object(i.e)(t))return t;if(Object(i.j)(t)){const r=t;await Object(a.a)(r);const n=await r.body;return Object(o.a)(n,e)}return Object(i.b)(t)||Object(i.i)(t)?Object(o.a)(t,e):Object(i.a)(t)?t[Symbol.asyncIterator]():function(t){if(ArrayBuffer.isView(t))return function*(){yield t.buffer}();if(t instanceof ArrayBuffer)return function*(){yield t}();if(Object(i.e)(t))return t;if(Object(i.d)(t))return t[Symbol.iterator]();throw new Error(s)}(t)}},function(t,e,r){"use strict";const n=262144;var i=r(83),o=r(78);function a(t,e){return i.c?async function*(t,e){const r=t.getReader();let n;try{for(;;){const t=n||r.read();null!=e&&e._streamReadAhead&&(n=r.read());const{done:i,value:a}=await t;if(i)return;yield Object(o.d)(a)}}catch(t){r.releaseLock()}}(t,e):async function*(t,e){for await(const e of t)yield Object(o.d)(e)}(t)}var s=r(19);function u(t,e){if("string"==typeof t)return function*(t,e){const r=(null==e?void 0:e.chunkSize)||262144;let n=0;const i=new TextEncoder;for(;n<t.length;){const e=Math.min(t.length-n,r),o=t.slice(n,n+e);n+=e,yield i.encode(o)}}(t,e);if(t instanceof ArrayBuffer)return function*(t,e={}){const{chunkSize:r=n}=e;let i=0;for(;i<t.byteLength;){const e=Math.min(t.byteLength-i,r),n=new ArrayBuffer(e),o=new Uint8Array(t,i,e);new Uint8Array(n).set(o),i+=e,yield n}}(t,e);if(Object(s.b)(t))return async function*(t,e){const r=(null==e?void 0:e.chunkSize)||1048576;let n=0;for(;n<t.size;){const e=n+r,i=await t.slice(n,e).arrayBuffer();n=e,yield i}}(t,e);if(Object(s.i)(t))return a(t,e);if(Object(s.j)(t)){return a(t.body,e)}throw new Error("makeIterator")}r.d(e,"a",(function(){return u}))},function(t,e,r){"use strict";r.r(e),r.d(e,"MODULE_VERSION",(function(){return n})),r.d(e,"MODULE_NAME",(function(){return i}));var n="8.6.0-beta.1",i="@deck.gl/jupyter-widget"},function(t,e,r){var n,i,o;
/**
* @license long.js (c) 2013 Daniel Wirtz <dcode@dcode.io>
* Released under the Apache License, Version 2.0
* see: https://github.com/dcodeIO/long.js for details
*/i=[],void 0===(o="function"==typeof(n=function(){"use strict";function t(t,e,r){this.low=0|t,this.high=0|e,this.unsigned=!!r}function e(t){return!0===(t&&t.__isLong__)}t.prototype.__isLong__,Object.defineProperty(t.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),t.isLong=e;var r={},n={};function i(t,e){var i,o,s;return e?(s=0<=(t>>>=0)&&t<256)&&(o=n[t])?o:(i=a(t,(0|t)<0?-1:0,!0),s&&(n[t]=i),i):(s=-128<=(t|=0)&&t<128)&&(o=r[t])?o:(i=a(t,t<0?-1:0,!1),s&&(r[t]=i),i)}function o(t,e){if(isNaN(t)||!isFinite(t))return e?A:d;if(e){if(t<0)return A;if(t>=h)return _}else{if(t<=-f)return b;if(t+1>=f)return v}return t<0?o(-t,e).neg():a(t%l|0,t/l|0,e)}function a(e,r,n){return new t(e,r,n)}t.fromInt=i,t.fromNumber=o,t.fromBits=a;var s=Math.pow;function u(t,e,r){if(0===t.length)throw Error("empty string");if("NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return d;if("number"==typeof e?(r=e,e=!1):e=!!e,(r=r||10)<2||36<r)throw RangeError("radix");var n;if((n=t.indexOf("-"))>0)throw Error("interior hyphen");if(0===n)return u(t.substring(1),e,r).neg();for(var i=o(s(r,8)),a=d,c=0;c<t.length;c+=8){var l=Math.min(8,t.length-c),h=parseInt(t.substring(c,c+l),r);if(l<8){var f=o(s(r,l));a=a.mul(f).add(o(h))}else a=(a=a.mul(i)).add(o(h))}return a.unsigned=e,a}function c(e){return e instanceof t?e:"number"==typeof e?o(e):"string"==typeof e?u(e):a(e.low,e.high,e.unsigned)}t.fromString=u,t.fromValue=c;var l=4294967296,h=l*l,f=h/2,p=i(1<<24),d=i(0);t.ZERO=d;var A=i(0,!0);t.UZERO=A;var g=i(1);t.ONE=g;var m=i(1,!0);t.UONE=m;var y=i(-1);t.NEG_ONE=y;var v=a(-1,2147483647,!1);t.MAX_VALUE=v;var _=a(-1,-1,!0);t.MAX_UNSIGNED_VALUE=_;var b=a(0,-2147483648,!1);t.MIN_VALUE=b;var x=t.prototype;return x.toInt=function(){return this.unsigned?this.low>>>0:this.low},x.toNumber=function(){return this.unsigned?(this.high>>>0)*l+(this.low>>>0):this.high*l+(this.low>>>0)},x.toString=function(t){if((t=t||10)<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(b)){var e=o(t),r=this.div(e),n=r.mul(e).sub(this);return r.toString(t)+n.toInt().toString(t)}return"-"+this.neg().toString(t)}for(var i=o(s(t,6),this.unsigned),a=this,u="";;){var c=a.div(i),l=(a.sub(c.mul(i)).toInt()>>>0).toString(t);if((a=c).isZero())return l+u;for(;l.length<6;)l="0"+l;u=""+l+u}},x.getHighBits=function(){return this.high},x.getHighBitsUnsigned=function(){return this.high>>>0},x.getLowBits=function(){return this.low},x.getLowBitsUnsigned=function(){return this.low>>>0},x.getNumBitsAbs=function(){if(this.isNegative())return this.eq(b)?64:this.neg().getNumBitsAbs();for(var t=0!=this.high?this.high:this.low,e=31;e>0&&0==(t&1<<e);e--);return 0!=this.high?e+33:e+1},x.isZero=function(){return 0===this.high&&0===this.low},x.isNegative=function(){return!this.unsigned&&this.high<0},x.isPositive=function(){return this.unsigned||this.high>=0},x.isOdd=function(){return 1==(1&this.low)},x.isEven=function(){return 0==(1&this.low)},x.equals=function(t){return e(t)||(t=c(t)),(this.unsigned===t.unsigned||this.high>>>31!=1||t.high>>>31!=1)&&this.high===t.high&&this.low===t.low},x.eq=x.equals,x.notEquals=function(t){return!this.eq(t)},x.neq=x.notEquals,x.lessThan=function(t){return this.comp(t)<0},x.lt=x.lessThan,x.lessThanOrEqual=function(t){return this.comp(t)<=0},x.lte=x.lessThanOrEqual,x.greaterThan=function(t){return this.comp(t)>0},x.gt=x.greaterThan,x.greaterThanOrEqual=function(t){return this.comp(t)>=0},x.gte=x.greaterThanOrEqual,x.compare=function(t){if(e(t)||(t=c(t)),this.eq(t))return 0;var r=this.isNegative(),n=t.isNegative();return r&&!n?-1:!r&&n?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},x.comp=x.compare,x.negate=function(){return!this.unsigned&&this.eq(b)?b:this.not().add(g)},x.neg=x.negate,x.add=function(t){e(t)||(t=c(t));var r=this.high>>>16,n=65535&this.high,i=this.low>>>16,o=65535&this.low,s=t.high>>>16,u=65535&t.high,l=t.low>>>16,h=0,f=0,p=0,d=0;return p+=(d+=o+(65535&t.low))>>>16,f+=(p+=i+l)>>>16,h+=(f+=n+u)>>>16,h+=r+s,a((p&=65535)<<16|(d&=65535),(h&=65535)<<16|(f&=65535),this.unsigned)},x.subtract=function(t){return e(t)||(t=c(t)),this.add(t.neg())},x.sub=x.subtract,x.multiply=function(t){if(this.isZero())return d;if(e(t)||(t=c(t)),t.isZero())return d;if(this.eq(b))return t.isOdd()?b:d;if(t.eq(b))return this.isOdd()?b:d;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(p)&&t.lt(p))return o(this.toNumber()*t.toNumber(),this.unsigned);var r=this.high>>>16,n=65535&this.high,i=this.low>>>16,s=65535&this.low,u=t.high>>>16,l=65535&t.high,h=t.low>>>16,f=65535&t.low,A=0,g=0,m=0,y=0;return m+=(y+=s*f)>>>16,g+=(m+=i*f)>>>16,m&=65535,g+=(m+=s*h)>>>16,A+=(g+=n*f)>>>16,g&=65535,A+=(g+=i*h)>>>16,g&=65535,A+=(g+=s*l)>>>16,A+=r*f+n*h+i*l+s*u,a((m&=65535)<<16|(y&=65535),(A&=65535)<<16|(g&=65535),this.unsigned)},x.mul=x.multiply,x.divide=function(t){if(e(t)||(t=c(t)),t.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?A:d;var r,n,i;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return A;if(t.gt(this.shru(1)))return m;i=A}else{if(this.eq(b))return t.eq(g)||t.eq(y)?b:t.eq(b)?g:(r=this.shr(1).div(t).shl(1)).eq(d)?t.isNegative()?g:y:(n=this.sub(t.mul(r)),i=r.add(n.div(t)));if(t.eq(b))return this.unsigned?A:d;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();i=d}for(n=this;n.gte(t);){r=Math.max(1,Math.floor(n.toNumber()/t.toNumber()));for(var a=Math.ceil(Math.log(r)/Math.LN2),u=a<=48?1:s(2,a-48),l=o(r),h=l.mul(t);h.isNegative()||h.gt(n);)h=(l=o(r-=u,this.unsigned)).mul(t);l.isZero()&&(l=g),i=i.add(l),n=n.sub(h)}return i},x.div=x.divide,x.modulo=function(t){return e(t)||(t=c(t)),this.sub(this.div(t).mul(t))},x.mod=x.modulo,x.not=function(){return a(~this.low,~this.high,this.unsigned)},x.and=function(t){return e(t)||(t=c(t)),a(this.low&t.low,this.high&t.high,this.unsigned)},x.or=function(t){return e(t)||(t=c(t)),a(this.low|t.low,this.high|t.high,this.unsigned)},x.xor=function(t){return e(t)||(t=c(t)),a(this.low^t.low,this.high^t.high,this.unsigned)},x.shiftLeft=function(t){return e(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?a(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):a(0,this.low<<t-32,this.unsigned)},x.shl=x.shiftLeft,x.shiftRight=function(t){return e(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?a(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):a(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},x.shr=x.shiftRight,x.shiftRightUnsigned=function(t){if(e(t)&&(t=t.toInt()),0==(t&=63))return this;var r=this.high;return t<32?a(this.low>>>t|r<<32-t,r>>>t,this.unsigned):a(32===t?r:r>>>t-32,0,this.unsigned)},x.shru=x.shiftRightUnsigned,x.toSigned=function(){return this.unsigned?a(this.low,this.high,!1):this},x.toUnsigned=function(){return this.unsigned?this:a(this.low,this.high,!0)},x.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},x.toBytesLE=function(){var t=this.high,e=this.low;return[255&e,e>>>8&255,e>>>16&255,e>>>24&255,255&t,t>>>8&255,t>>>16&255,t>>>24&255]},x.toBytesBE=function(){var t=this.high,e=this.low;return[t>>>24&255,t>>>16&255,t>>>8&255,255&t,e>>>24&255,e>>>16&255,e>>>8&255,255&e]},t})?n.apply(e,i):n)||(t.exports=o)},function(t,e,r){"use strict";r.d(e,"a",(function(){return f})),r.d(e,"b",(function(){return p}));var n=r(53),i=r(14);function o(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return a(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,s=!0,u=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return s=t.done,t},e:function(t){u=!0,o=t},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw o}}}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var s=Math.PI/180,u=new Float32Array(16),c=new Float32Array(12);function l(t,e,r){var n=e[0]*s,i=e[1]*s,o=e[2]*s,a=Math.sin(o),u=Math.sin(n),c=Math.sin(i),l=Math.cos(o),h=Math.cos(n),f=Math.cos(i),p=r[0],d=r[1],A=r[2];t[0]=p*f*h,t[1]=p*c*h,t[2]=p*-u,t[3]=d*(-c*l+f*u*a),t[4]=d*(f*l+c*u*a),t[5]=d*h*a,t[6]=A*(c*a+f*u*l),t[7]=A*(-f*a+c*u*l),t[8]=A*h*l}function h(t){return t[0]=t[0],t[1]=t[1],t[2]=t[2],t[3]=t[4],t[4]=t[5],t[5]=t[6],t[6]=t[8],t[7]=t[9],t[8]=t[10],t[9]=t[12],t[10]=t[13],t[11]=t[14],t.subarray(0,12)}var f={size:12,accessor:["getOrientation","getScale","getTranslation","getTransformMatrix"],shaderAttributes:{instanceModelMatrix__LOCATION_0:{size:3,elementOffset:0},instanceModelMatrix__LOCATION_1:{size:3,elementOffset:3},instanceModelMatrix__LOCATION_2:{size:3,elementOffset:6},instanceTranslation:{size:3,elementOffset:9}},update:function(t,e){var r=e.startRow,i=e.endRow,a=this.props,s=a.data,f=a.getOrientation,p=a.getScale,d=a.getTranslation,A=a.getTransformMatrix,g=Array.isArray(A),m=g&&16===A.length,y=Array.isArray(p),v=Array.isArray(f),_=Array.isArray(d),b=m||!g&&Boolean(A(s[0]));t.constant=b?m:v&&y&&_;var x=t.value;if(t.constant){var w;if(b)u.set(A),w=h(u);else l(w=c,f,p),w.set(d,9);t.value=new Float32Array(w)}else{var E,S=r*t.size,O=Object(n.a)(s,r,i),T=O.iterable,P=O.objectInfo,M=o(T);try{for(M.s();!(E=M.n()).done;){var C=E.value;P.index++;var I=void 0;if(b)u.set(m?A:A(C,P)),I=h(u);else l(I=c,v?f:f(C,P),y?p:p(C,P)),I.set(_?d:d(C,P),9);x[S++]=I[0],x[S++]=I[1],x[S++]=I[2],x[S++]=I[3],x[S++]=I[4],x[S++]=I[5],x[S++]=I[6],x[S++]=I[7],x[S++]=I[8],x[S++]=I[9],x[S++]=I[10],x[S++]=I[11]}}catch(t){M.e(t)}finally{M.f()}}}};function p(t,e){return e===i.a.CARTESIAN||e===i.a.METER_OFFSETS||e===i.a.DEFAULT&&!t.isGeospatial}},function(t,e){
/* @license
Papa Parse
v5.0.0-beta.0
https://github.com/mholt/PapaParse
License: MIT
*/
var r="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==r?r:{},n={};function i(t){this._handle=null,this._finished=!1,this._completed=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},function(t){var e=c(t);e.chunkSize=parseInt(e.chunkSize),t.step||t.chunk||(e.chunkSize=null);this._handle=new a(e),this._handle.streamer=this,this._config=e}.call(this,t),this.parseChunk=function(t,e){if(this.isFirstChunk&&l(this._config.beforeFirstChunk)){var r=this._config.beforeFirstChunk(t);void 0!==r&&(t=r)}this.isFirstChunk=!1;var n=this._partialLine+t;this._partialLine="";var i=this._handle.parse(n,this._baseIndex,!this._finished);if(!this._handle.paused()&&!this._handle.aborted()){var o=i.meta.cursor;this._finished||(this._partialLine=n.substring(o-this._baseIndex),this._baseIndex=o),i&&i.data&&(this._rowCount+=i.data.length);var a=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(l(this._config.chunk)&&!e){if(this._config.chunk(i,this._handle),this._handle.paused()||this._handle.aborted())return;i=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(i.data),this._completeResults.errors=this._completeResults.errors.concat(i.errors),this._completeResults.meta=i.meta),this._completed||!a||!l(this._config.complete)||i&&i.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),a||i&&i.meta.paused||this._nextChunk(),i}},this._sendError=function(t){l(this._config.error)&&this._config.error(t)}}function o(t){var e;t=t||{},i.call(this,t),this.stream=function(t){return e=t,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var t=this._config.chunkSize,r=t?e.substr(0,t):e;return e=t?e.substr(t):"",this._finished=!e,this.parseChunk(r)}}}function a(t){var e,r,i,o=/^\s*-?(\d*\.?\d+|\d+\.?\d*)(e[-+]?\d+)?\s*$/i,a=/(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))/,h=this,f=0,p=0,d=!1,A=!1,g=[],m={data:[],errors:[],meta:{}};if(l(t.step)){var y=t.step;t.step=function(e){if(m=e,b())_();else{if(_(),!m.data||0===m.data.length)return;f+=e.data.length,t.preview&&f>t.preview?r.abort():y(m,h)}}}function v(e){return"greedy"===t.skipEmptyLines?""===e.join("").trim():1===e.length&&0===e[0].length}function _(){if(m&&i&&(w("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+n.DefaultDelimiter+"'"),i=!1),t.skipEmptyLines)for(var e=0;e<m.data.length;e++)v(m.data[e])&&m.data.splice(e--,1);return b()&&function(){if(!m)return;function e(e){l(t.transformHeader)&&(e=t.transformHeader(e)),g.push(e)}if(Array.isArray(m.data[0])){for(var r=0;b()&&r<m.data.length;r++)m.data[r].forEach(e);m.data.splice(0,1)}else m.data.forEach(e)}(),function(){if(!m||!m.data||!t.header&&!t.dynamicTyping&&!t.transform)return m;function e(e,r){var n,i=t.header?{}:[];for(n=0;n<e.length;n++){var o=n,a=e[n];t.header&&(o=n>=g.length?"__parsed_extra":g[n]),t.transform&&(a=t.transform(a,o)),a=x(o,a),"__parsed_extra"===o?(i[o]=i[o]||[],i[o].push(a)):i[o]=a}return t.header&&(n>g.length?w("FieldMismatch","TooManyFields","Too many fields: expected "+g.length+" fields but parsed "+n,p+r):n<g.length&&w("FieldMismatch","TooFewFields","Too few fields: expected "+g.length+" fields but parsed "+n,p+r)),i}var r=1;!m.data[0]||Array.isArray(m.data[0])?(m.data=m.data.map(e),r=m.data.length):m.data=e(m.data,0);t.header&&m.meta&&(m.meta.fields=g);return p+=r,m}()}function b(){return t.header&&0===g.length}function x(e,r){return function(e){return t.dynamicTypingFunction&&void 0===t.dynamicTyping[e]&&(t.dynamicTyping[e]=t.dynamicTypingFunction(e)),!0===(t.dynamicTyping[e]||t.dynamicTyping)}(e)?"true"===r||"TRUE"===r||"false"!==r&&"FALSE"!==r&&(o.test(r)?parseFloat(r):a.test(r)?new Date(r):""===r?null:r):r}function w(t,e,r,n){m.errors.push({type:t,code:e,message:r,row:n})}this.parse=function(o,a,h){var f=t.quoteChar||'"';if(t.newline||(t.newline=function(t,e){t=t.substr(0,1048576);var r=new RegExp(s(e)+"([^]*?)"+s(e),"gm"),n=(t=t.replace(r,"")).split("\r"),i=t.split("\n"),o=i.length>1&&i[0].length<n[0].length;if(1===n.length||o)return"\n";for(var a=0,u=0;u<n.length;u++)"\n"===n[u][0]&&a++;return a>=n.length/2?"\r\n":"\r"}(o,f)),i=!1,t.delimiter)l(t.delimiter)&&(t.delimiter=t.delimiter(o),m.meta.delimiter=t.delimiter);else{var p=function(e,r,i,o,a){var s,c,l;a=a||[",","\t","|",";",n.RECORD_SEP,n.UNIT_SEP];for(var h=0;h<a.length;h++){var f=a[h],p=0,d=0,A=0;l=void 0;for(var g=new u({comments:o,delimiter:f,newline:r,preview:10}).parse(e),m=0;m<g.data.length;m++)if(i&&v(g.data[m]))A++;else{var y=g.data[m].length;d+=y,void 0!==l?y>1&&(p+=Math.abs(y-l),l=y):l=0}g.data.length>0&&(d/=g.data.length-A),(void 0===c||p>c)&&d>1.99&&(c=p,s=f)}return t.delimiter=s,{successful:!!s,bestDelimiter:s}}(o,t.newline,t.skipEmptyLines,t.comments,t.delimitersToGuess);p.successful?t.delimiter=p.bestDelimiter:(i=!0,t.delimiter=n.DefaultDelimiter),m.meta.delimiter=t.delimiter}var A=c(t);return t.preview&&t.header&&A.preview++,e=o,r=new u(A),m=r.parse(e,a,h),_(),d?{meta:{paused:!0}}:m||{meta:{paused:!1}}},this.paused=function(){return d},this.pause=function(){d=!0,r.abort(),e=e.substr(r.getCharIndex())},this.resume=function(){d=!1,h.streamer.parseChunk(e,!0)},this.aborted=function(){return A},this.abort=function(){A=!0,r.abort(),m.meta.aborted=!0,l(t.complete)&&t.complete(m),e=""}}function s(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function u(t){var e,r=(t=t||{}).delimiter,i=t.newline,o=t.comments,a=t.step,u=t.preview,c=t.fastMode,h=e=void 0===t.quoteChar?'"':t.quoteChar;if(void 0!==t.escapeChar&&(h=t.escapeChar),("string"!=typeof r||n.BAD_DELIMITERS.indexOf(r)>-1)&&(r=","),o===r)throw new Error("Comment character same as delimiter");!0===o?o="#":("string"!=typeof o||n.BAD_DELIMITERS.indexOf(o)>-1)&&(o=!1),"\n"!==i&&"\r"!==i&&"\r\n"!==i&&(i="\n");var f=0,p=!1;this.parse=function(t,n,d){if("string"!=typeof t)throw new Error("Input must be a string");var A=t.length,g=r.length,m=i.length,y=o.length,v=l(a);f=0;var _=[],b=[],x=[],w=0;if(!t)return D();if(c||!1!==c&&-1===t.indexOf(e)){for(var E=t.split(i),S=0;S<E.length;S++){if(x=E[S],f+=x.length,S!==E.length-1)f+=i.length;else if(d)return D();if(!o||x.substr(0,y)!==o){if(v){if(_=[],k(x.split(r)),B(),p)return D()}else k(x.split(r));if(u&&S>=u)return _=_.slice(0,u),D(!0)}}return D()}for(var O,T=t.indexOf(r,f),P=t.indexOf(i,f),M=new RegExp(s(h)+s(e),"g");;)if(t[f]!==e)if(o&&0===x.length&&t.substr(f,y)===o){if(-1===P)return D();f=P+m,P=t.indexOf(i,f),T=t.indexOf(r,f)}else if(-1!==T&&(T<P||-1===P))x.push(t.substring(f,T)),f=T+g,T=t.indexOf(r,f);else{if(-1===P)break;if(x.push(t.substring(f,P)),j(P+m),v&&(B(),p))return D();if(u&&_.length>=u)return D(!0)}else{for(O=f,f++;;){if(-1===(O=t.indexOf(e,O+1)))return d||b.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:_.length,index:f}),L();if(O===A-1)return L(t.substring(f,O).replace(M,e));if(e!==h||t[O+1]!==h){if(e===h||0===O||t[O-1]!==h){var C=R(-1===P?T:Math.min(T,P));if(t[O+1+C]===r){if(x.push(t.substring(f,O).replace(M,e)),f=O+1+C+g,T=t.indexOf(r,f),P=t.indexOf(i,f),v&&(B(),p))return D();if(u&&_.length>=u)return D(!0);break}var I=R(P);if(t.substr(O+1+I,m)===i){if(x.push(t.substring(f,O).replace(M,e)),j(O+1+I+m),T=t.indexOf(r,f),v&&(B(),p))return D();if(u&&_.length>=u)return D(!0);break}b.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:_.length,index:f}),O++}}else O++}if(v&&(B(),p))return D();if(u&&_.length>=u)return D(!0)}return L();function k(t){_.push(t),w=f}function R(e){var r=0;if(-1!==e){var n=t.substring(O+1,e);n&&""===n.trim()&&(r=n.length)}return r}function L(e){return d?D():(void 0===e&&(e=t.substr(f)),x.push(e),f=A,k(x),v&&B(),D())}function j(e){f=e,k(x),x=[],P=t.indexOf(i,f)}function D(t,e){return{data:e||!1?_[0]:_,errors:b,meta:{delimiter:r,linebreak:i,aborted:p,truncated:!!t,cursor:w+(n||0)}}}function B(){a(D(void 0,!0)),_=[],b=[]}},this.abort=function(){p=!0},this.getCharIndex=function(){return f}}function c(t){if("object"!=typeof t||null===t)return t;var e=Array.isArray(t)?[]:{};for(var r in t)e[r]=c(t[r]);return e}function l(t){return"function"==typeof t}t.exports=n,n.parse=function(t,e,r){var i=(e=e||{}).dynamicTyping||!1;l(i)&&(e.dynamicTypingFunction=i,i={});if(e.dynamicTyping=i,e.transform=!!l(e.transform)&&e.transform,e.worker&&n.WORKERS_SUPPORTED){var a=newWorker();return a.userStep=e.step,a.userChunk=e.chunk,a.userComplete=e.complete,a.userError=e.error,e.step=l(e.step),e.chunk=l(e.chunk),e.complete=l(e.complete),e.error=l(e.error),delete e.worker,void a.postMessage({input:t,config:e,workerId:a.id})}var s=null;"string"==typeof t&&(s=new o(e));s||(s=new r(e));return s.stream(t)},n.unparse=function(t,e){var r=!1,i=!0,o=",",a="\r\n",u='"',c=u+u,l=!1,h=null;!function(){if("object"!=typeof e)return;"string"!=typeof e.delimiter||n.BAD_DELIMITERS.filter((function(t){return-1!==e.delimiter.indexOf(t)})).length||(o=e.delimiter);("boolean"==typeof e.quotes||Array.isArray(e.quotes))&&(r=e.quotes);"boolean"!=typeof e.skipEmptyLines&&"string"!=typeof e.skipEmptyLines||(l=e.skipEmptyLines);"string"==typeof e.newline&&(a=e.newline);"string"==typeof e.quoteChar&&(u=e.quoteChar);"boolean"==typeof e.header&&(i=e.header);if(Array.isArray(e.columns)){if(0===e.columns.length)throw new Error("Option columns is empty");h=e.columns}void 0!==e.escapeChar&&(c=e.escapeChar+u)}();var f=new RegExp(s(u),"g");"string"==typeof t&&(t=JSON.parse(t));if(Array.isArray(t)){if(!t.length||Array.isArray(t[0]))return d(null,t,l);if("object"==typeof t[0])return d(h||p(t[0]),t,l)}else if("object"==typeof t)return"string"==typeof t.data&&(t.data=JSON.parse(t.data)),Array.isArray(t.data)&&(t.fields||(t.fields=t.meta&&t.meta.fields),t.fields||(t.fields=Array.isArray(t.data[0])?t.fields:p(t.data[0])),Array.isArray(t.data[0])||"object"==typeof t.data[0]||(t.data=[t.data])),d(t.fields||[],t.data||[],l);throw new Error("Unable to serialize unrecognized input");function p(t){if("object"!=typeof t)return[];var e=[];for(var r in t)e.push(r);return e}function d(t,e,r){var n="";"string"==typeof t&&(t=JSON.parse(t)),"string"==typeof e&&(e=JSON.parse(e));var s=Array.isArray(t)&&t.length>0,u=!Array.isArray(e[0]);if(s&&i){for(var c=0;c<t.length;c++)c>0&&(n+=o),n+=A(t[c],c);e.length>0&&(n+=a)}for(var l=0;l<e.length;l++){var h=s?t.length:e[l].length,f=!1,p=s?0===Object.keys(e[l]).length:0===e[l].length;if(r&&!s&&(f="greedy"===r?""===e[l].join("").trim():1===e[l].length&&0===e[l][0].length),"greedy"===r&&s){for(var d=[],g=0;g<h;g++){var m=u?t[g]:g;d.push(e[l][m])}f=""===d.join("").trim()}if(!f){for(var y=0;y<h;y++){y>0&&!p&&(n+=o);var v=s&&u?t[y]:y;n+=A(e[l][v],y)}l<e.length-1&&(!r||h>0&&!p)&&(n+=a)}}return n}function A(t,e){return null==t?"":t.constructor===Date?JSON.stringify(t).slice(1,25):(t=t.toString().replace(f,c),"boolean"==typeof r&&r||Array.isArray(r)&&r[e]||function(t,e){for(var r=0;r<e.length;r++)if(t.indexOf(e[r])>-1)return!0;return!1}(t,n.BAD_DELIMITERS)||t.indexOf(o)>-1||" "===t.charAt(0)||" "===t.charAt(t.length-1)?u+t+u:t)}},n.RECORD_SEP=String.fromCharCode(30),n.UNIT_SEP=String.fromCharCode(31),n.BYTE_ORDER_MARK="\ufeff",n.BAD_DELIMITERS=["\r","\n",'"',n.BYTE_ORDER_MARK],n.WORKERS_SUPPORTED=!1,n.NODE_STREAM_INPUT=1,n.LocalChunkSize=10485760,n.RemoteChunkSize=5242880,n.DefaultDelimiter=",",n.Parser=u,n.ParserHandle=a,n.ChunkStreamer=i,n.StringStreamer=o,o.prototype=Object.create(o.prototype),o.prototype.constructor=o},function(t,e,r){"use strict";(function(t){r.d(e,"b",(function(){return a})),r.d(e,"c",(function(){return s}));var n,i=r(174);t.browser&&(n=r(268));var o="https://api.tiles.mapbox.com/mapbox-gl-js/v1.2.1/mapbox-gl.css";function a(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o;Object(i.b)(t)}function s(){for(var t=0,e=["mapboxgl-missing-css"];t<e.length;t++){var r=e[t],n=document.getElementsByClassName(r)[0];n&&n.style&&(n.style.display="none")}}e.a=n}).call(this,r(57))},function(t,e,r){"use strict";var n=r(36),i=r(31);const o=t=>Object(i.e)(t)?void 0:0,a={3074:t=>Object(i.e)(t)?void 0:36064,35723:t=>Object(i.e)(t)?void 0:4352,35977:o,32937:o,36795:(t,e)=>{const r=Object(i.e)(t)?t.getExtension("EXT_disjoint_timer_query_webgl2"):t.getExtension("EXT_disjoint_timer_query");return r&&r.GPU_DISJOINT_EXT?e(r.GPU_DISJOINT_EXT):0},37445:(t,e)=>{const r=t.getExtension("WEBGL_debug_renderer_info");return e(r&&r.UNMASKED_VENDOR_WEBGL||7936)},37446:(t,e)=>{const r=t.getExtension("WEBGL_debug_renderer_info");return e(r&&r.UNMASKED_RENDERER_WEBGL||7937)},34047:(t,e)=>{const r=t.luma.extensions.EXT_texture_filter_anisotropic;return r?e(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1},32883:o,35071:o,37447:o,36063:(t,e)=>{if(!Object(i.e)(t)){const r=t.getExtension("WEBGL_draw_buffers");return r?e(r.MAX_COLOR_ATTACHMENTS_WEBGL):0}},35379:o,35374:o,35377:o,34852:t=>{if(!Object(i.e)(t)){const e=t.getExtension("WEBGL_draw_buffers");return e?e.MAX_DRAW_BUFFERS_WEBGL:0}},36203:t=>t.getExtension("OES_element_index")?2147483647:65535,33001:t=>t.getExtension("OES_element_index")?16777216:65535,33e3:t=>16777216,37157:o,35373:o,35657:o,36183:o,37137:o,34045:o,35978:o,35979:o,35968:o,35376:o,35375:o,35659:o,37154:o,35371:o,35658:o,35076:o,35077:o,35380:o};r.d(e,"b",(function(){return s})),r.d(e,"a",(function(){return u}));const s={OES_vertex_array_object:{meta:{suffix:"OES"},createVertexArray:()=>{Object(n.a)(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:()=>{},bindVertexArray:()=>{},isVertexArray:()=>!1},ANGLE_instanced_arrays:{meta:{suffix:"ANGLE"},vertexAttribDivisor(t,e){Object(n.a)(0===e,"WebGL instanced rendering not supported")},drawElementsInstanced:()=>{},drawArraysInstanced:()=>{}},WEBGL_draw_buffers:{meta:{suffix:"WEBGL"},drawBuffers:()=>{Object(n.a)(!1)}},EXT_disjoint_timer_query:{meta:{suffix:"EXT"},createQuery:()=>{Object(n.a)(!1)},deleteQuery:()=>{Object(n.a)(!1)},beginQuery:()=>{Object(n.a)(!1)},endQuery:()=>{},getQuery(t,e){return this.getQueryObject(t,e)},getQueryParameter(t,e){return this.getQueryObject(t,e)},getQueryObject:()=>{}}},u={readBuffer:(t,e,r)=>{Object(i.e)(t)&&e(r)},getVertexAttrib:(t,e,r,n)=>{const{webgl2:o,ext:a}=function(t,e){return{webgl2:Object(i.e)(t),ext:t.getExtension(e)}}(t,"ANGLE_instanced_arrays");let s;switch(n){case 35069:s=!!o&&void 0;break;case 35070:s=o||a?void 0:0}return void 0!==s?s:e(r,n)},getProgramParameter:(t,e,r,n)=>{if(!Object(i.e)(t))switch(n){case 35967:return 35981;case 35971:case 35382:return 0}return e(r,n)},getInternalformatParameter:(t,e,r,n,o)=>{if(!Object(i.e)(t))switch(o){case 32937:return new Int32Array([0])}return t.getInternalformatParameter(r,n,o)},getTexParameter(t,e,r,n){switch(n){case 34046:const{extensions:e}=t.luma,r=e.EXT_texture_filter_anisotropic;n=r&&r.TEXTURE_MAX_ANISOTROPY_EXT||34046}return e(r,n)},getParameter:function(t,e,r){const n=a[r],i="function"==typeof n?n(t,e,r):n;return void 0!==i?i:e(r)},hint:(t,e,r,n)=>e(r,n)}},function(t,e){t.exports=function(t){return t&&t.__esModule?t:{default:t}}},function(t,e,r){"use strict";async function*n(t,e={}){const r=new TextDecoder(void 0,e);for await(const e of t)yield"string"==typeof e?e:r.decode(e,{stream:!0})}async function*i(t){const e=new TextEncoder;for await(const r of t)yield"string"==typeof r?e.encode(r):r}async function*o(t){let e="";for await(const r of t){let t;for(e+=r;(t=e.indexOf("\n"))>=0;){const r=e.slice(0,t+1);e=e.slice(t+1),yield r}}e.length>0&&(yield e)}async function*a(t){let e=1;for await(const r of t)yield{counter:e,line:r},e++}r.d(e,"c",(function(){return n})),r.d(e,"d",(function(){return i})),r.d(e,"a",(function(){return o})),r.d(e,"b",(function(){return a}))},function(t,e,r){"use strict";function n(t,e=5){if("string"==typeof t)return t.slice(0,e);if(ArrayBuffer.isView(t))return i(t.buffer,t.byteOffset,e);if(t instanceof ArrayBuffer){return i(t,0,e)}return""}function i(t,e,r){if(t.byteLength<=e+r)return"";const n=new DataView(t);let i="";for(let t=0;t<r;t++)i+=String.fromCharCode(n.getUint8(e+t));return i}r.d(e,"a",(function(){return n}))},function(t,e,r){"use strict";(function(t){function n(){let e;if("undefined"!=typeof window&&window.performance)e=window.performance.now();else if(void 0!==t&&t.hrtime){const r=t.hrtime();e=1e3*r[0]+r[1]/1e6}else e=Date.now();return e}r.d(e,"a",(function(){return n}))}).call(this,r(57))},function(t,e,r){"use strict";r.d(e,"a",(function(){return p})),r.d(e,"b",(function(){return A}));var n=r(0),i=r.n(n),o=r(2),a=r.n(o),s=r(3),u=r.n(s),c=r(73);function l(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function h(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?l(Object(r),!0).forEach((function(e){i()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var f=function(){},p={BREAK:1,SNAP_TO_END:2,IGNORE:3},d={transitionEasing:function(t){return t},transitionInterruption:p.BREAK,onTransitionStart:f,onTransitionInterrupt:f,onTransitionEnd:f},A=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};a()(this,t),this.ControllerState=e,this.props=h(h({},d),r),this.propsInTransition=null,this.transition=new c.a(r.timeline),this.onViewStateChange=r.onViewStateChange||f,this.onStateChange=r.onStateChange||f,this._onTransitionUpdate=this._onTransitionUpdate.bind(this)}return u()(t,[{key:"finalize",value:function(){this.transition.cancel()}},{key:"getViewportInTransition",value:function(){return this.propsInTransition}},{key:"processViewStateChange",value:function(t){var e=!1,r=this.props;if(t=h(h({},d),t),this.props=t,this._shouldIgnoreViewportChange(r,t))return e;if(this._isTransitionEnabled(t)){var n=this.transition.settings,i=n.interruption,o=n.endProps,a=h(h({},r),i===p.SNAP_TO_END?o:this.propsInTransition||r);this._triggerTransition(a,t),e=!0}else this.transition.cancel();return e}},{key:"updateTransition",value:function(){this.transition.update()}},{key:"_isTransitionEnabled",value:function(t){var e=t.transitionDuration,r=t.transitionInterpolator;return(e>0||"auto"===e)&&Boolean(r)}},{key:"_isUpdateDueToCurrentTransition",value:function(t){return!!this.transition.inProgress&&this.transition.settings.interpolator.arePropsEqual(t,this.propsInTransition)}},{key:"_shouldIgnoreViewportChange",value:function(t,e){return this.transition.inProgress?this.transition.settings.interruption===p.IGNORE||this._isUpdateDueToCurrentTransition(e):!this._isTransitionEnabled(e)||e.transitionInterpolator.arePropsEqual(t,e)}},{key:"_triggerTransition",value:function(t,e){var r=new this.ControllerState(t),n=new this.ControllerState(e).shortestPathFrom(r),i=e.transitionInterpolator,o=i.getDuration?i.getDuration(t,e):e.transitionDuration;if(0!==o){var a=e.transitionInterpolator.initializeProps(t,n);this.propsInTransition={},this.duration=o,this.transition.start({duration:o,easing:e.transitionEasing,interpolator:e.transitionInterpolator,interruption:e.transitionInterruption,startProps:a.start,endProps:a.end,onStart:e.onTransitionStart,onUpdate:this._onTransitionUpdate,onInterrupt:this._onTransitionEnd(e.onTransitionInterrupt),onEnd:this._onTransitionEnd(e.onTransitionEnd)}),this.onStateChange({inTransition:!0}),this.updateTransition()}}},{key:"_onTransitionEnd",value:function(t){var e=this;return function(r){e.propsInTransition=null,e.onStateChange({inTransition:!1,isZooming:!1,isPanning:!1,isRotating:!1}),t(r)}}},{key:"_onTransitionUpdate",value:function(t){var e=t.time,r=t.settings,n=r.interpolator,i=r.startProps,o=r.endProps,a=r.duration,s=(0,r.easing)(e/a),u=n.interpolateProps(i,o,s);this.propsInTransition=new this.ControllerState(h(h({},this.props),u)).getViewportProps(),this.onViewStateChange({viewState:this.propsInTransition,oldViewState:this.props})}}]),t}()},function(t,e,r){"use strict";r.d(e,"a",(function(){return O}));var n=r(0),i=r.n(n),o=r(2),a=r.n(o),s=r(3),u=r.n(s),c=r(8),l=r.n(c),h=r(5),f=r.n(h),p=r(6),d=r.n(p),A=r(1),g=r.n(A),m=r(107),y=r(11);function v(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function _(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?v(Object(r),!0).forEach((function(e){i()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function b(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return x(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return x(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function x(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function w(t){var e=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(t){return!1}}();return function(){var r,n=g()(t);if(e){var i=g()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d()(this,r)}}var E=["longitude","latitude","zoom","bearing","pitch"],S=["longitude","latitude","zoom"],O=function(t){f()(r,t);var e=w(r);function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};a()(this,r);var i=Array.isArray(n)?n:n.transitionProps;return(t=e.call(this,i||{compare:E,extract:E,required:S})).opts=n,t}return u()(r,[{key:"initializeProps",value:function(t,e){var n=l()(g()(r.prototype),"initializeProps",this).call(this,t,e),i=this.opts,o=i.makeViewport,a=i.around;if(o&&a){var s=o(t),u=o(e),c=s.unproject(a);n.start.around=a,Object.assign(n.end,{around:u.project(c),aroundPosition:c,width:e.width,height:e.height})}return n}},{key:"interpolateProps",value:function(t,e,r){var n,i={},o=b(this._propsToExtract);try{for(o.s();!(n=o.n()).done;){var a=n.value;i[a]=Object(y.f)(t[a]||0,e[a]||0,r)}}catch(t){o.e(t)}finally{o.f()}if(e.aroundPosition){var s=this.opts.makeViewport(_(_({},e),i));Object.assign(i,s.panByPosition(e.aroundPosition,Object(y.f)(t.around,e.around,r)))}return i}}]),r}(m.a)},function(t,e,r){"use strict";r.d(e,"c",(function(){return a})),r.d(e,"b",(function(){return s})),r.d(e,"a",(function(){return c}));var n=r(24),i=r.n(n),o=r(33).b.COMPONENT;function a(t){var e=p(t);for(var r in e){var n=e[r],i=n.validate;if(i&&!i(t[r],n))throw new Error("Invalid prop ".concat(r,": ").concat(t[r]))}}function s(t,e){var r=c({newProps:t,oldProps:e,propTypes:p(t),ignoreProps:{data:null,updateTriggers:null,extensions:null,transitions:null}}),n=function(t,e){if(null===e)return"oldProps is null, initial diff";var r=null,n=t.dataComparator,i=t._dataDiff;n?n(t.data,e.data)||(r="Data comparator detected a change"):t.data!==e.data&&(r="A new data container was supplied");r&&i&&(r=i(t.data,e.data)||r);return r}(t,e),i=!1;return n||(i=function(t,e){if(null===e)return"oldProps is null, initial diff";if("all"in t.updateTriggers){if(f(t,e,"all"))return{all:!0}}var r={},n=!1;for(var i in t.updateTriggers){if("all"!==i)f(t,e,i)&&(r[i]=!0,n=r)}return n}(t,e)),{dataChanged:n,propsChanged:r,updateTriggersChanged:i,extensionsChanged:h(t,e),transitionsChanged:u(t,e)}}function u(t,e){if(!t.transitions)return null;var r={},n=p(t);for(var i in t.transitions){var o=n[i],a=o&&o.type;("number"===a||"color"===a||"array"===a)&&l(t[i],e[i],o)&&(r[i]=!0)}return r}function c(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.newProps,r=t.oldProps,n=t.ignoreProps,o=void 0===n?{}:n,a=t.propTypes,s=void 0===a?{}:a,u=t.triggerName,c=void 0===u?"props":u;if(r===e)return null;if("object"!==i()(e)||null===e)return"".concat(c," changed shallowly");if("object"!==i()(r)||null===r)return"".concat(c," changed shallowly");for(var h=0,f=Object.keys(e);h<f.length;h++){var p=f[h];if(!(p in o)){if(!(p in r))return"".concat(c,".").concat(p," added");var d=l(e[p],r[p],s[p]);if(d)return"".concat(c,".").concat(p," ").concat(d)}}for(var A=0,g=Object.keys(r);A<g.length;A++){var m=g[A];if(!(m in o)){if(!(m in e))return"".concat(c,".").concat(m," dropped");if(!Object.hasOwnProperty.call(e,m)){var y=l(e[m],r[m],s[m]);if(y)return"".concat(c,".").concat(m," ").concat(y)}}}return null}function l(t,e,r){var n=r&&r.equal;return n&&!n(t,e,r)?"changed deeply":n||!(n=t&&e&&t.equals)||n.call(t,e)?n||e===t?null:"changed shallowly":"changed deeply"}function h(t,e){if(null===e)return"oldProps is null, initial diff";var r=e.extensions,n=t.extensions;if(n===r)return!1;if(n.length!==r.length)return!0;for(var i=0;i<n.length;i++)if(!n[i].equals(r[i]))return!0;return!1}function f(t,e,r){var n=t.updateTriggers[r];n=null==n?{}:n;var i=e.updateTriggers[r];return c({oldProps:i=null==i?{}:i,newProps:n,triggerName:r})}function p(t){var e=t[o],r=e&&e.constructor;return r?r._propTypes:{}}},function(t,e,r){"use strict";var n=r(2),i=r.n(n),o=r(3),a=r.n(o),s=r(5),u=r.n(s),c=r(6),l=r.n(c),h=r(1),f=r.n(h),p=r(195),d=r(98),A=r(148),g=r(93),m=r(86),y=r(11),v=r(0),_=r.n(v),b=r(8),x=r.n(b),w=r(85),E=r(100),S=r(71),O=r(7);function T(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function P(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?T(Object(r),!0).forEach((function(e){_()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):T(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function M(t){var e=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(t){return!1}}();return function(){var r,n=f()(t);if(e){var i=f()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return l()(this,r)}}var C=function(t){u()(r,t);var e=M(r);function r(t,n){var o,a,s;return i()(this,r),(s=e.call(this,t,n)).shadowMap=new d.a(t,{width:1,height:1,parameters:(o={},_()(o,10241,9729),_()(o,10240,9729),_()(o,10242,33071),_()(o,10243,33071),o)}),s.depthBuffer=new E.a(t,{format:33189,width:1,height:1}),s.fbo=new S.a(t,{id:"shadowmap",width:1,height:1,attachments:(a={},_()(a,36064,s.shadowMap),_()(a,36096,s.depthBuffer),a)}),s}return a()(r,[{key:"render",value:function(t){var e=this,n=this.fbo;Object(O.o)(this.gl,{depthRange:[0,1],depthTest:!0,blend:!1,clearColor:[1,1,1,1]},(function(){var i=t.viewports[0],o=Object(O.e)(e.gl),a=i.width*o,s=i.height*o;a===n.width&&s===n.height||n.resize({width:a,height:s}),x()(f()(r.prototype),"render",e).call(e,P(P({},t),{},{target:n,pass:"shadow"}))}))}},{key:"shouldDrawLayer",value:function(t){return!1!==t.props.shadowEnabled}},{key:"getModuleParameters",value:function(){return{drawToShadowMap:!0}}},{key:"delete",value:function(){this.fbo&&(this.fbo.delete(),this.fbo=null),this.shadowMap&&(this.shadowMap.delete(),this.shadowMap=null),this.depthBuffer&&(this.depthBuffer.delete(),this.depthBuffer=null)}}]),r}(w.a),I=r(112);function k(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return R(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return R(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function R(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function L(t){var e=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(t){return!1}}();return function(){var r,n=f()(t);if(e){var i=f()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return l()(this,r)}}r.d(e,"a",(function(){return F}));var j={color:[255,255,255],intensity:1},D=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],B=[0,0,0,200/255],F=function(t){u()(r,t);var e=L(r);function r(t){var n;for(var o in i()(this,r),(n=e.call(this,t)).ambientLight=null,n.directionalLights=[],n.pointLights=[],n.shadowColor=B,n.shadowPasses=[],n.shadowMaps=[],n.dummyShadowMap=null,n.shadow=!1,n.programManager=null,t){var a=t[o];switch(a.type){case"ambient":n.ambientLight=a;break;case"directional":n.directionalLights.push(a);break;case"point":n.pointLights.push(a)}}return n._applyDefaultLights(),n.shadow=n.directionalLights.some((function(t){return t.shadow})),n}return a()(r,[{key:"preRender",value:function(t,e){var r=e.layers,n=e.layerFilter,i=e.viewports,o=e.onViewportActive,a=e.views;if(this.shadow){this.shadowMatrices=this._createLightMatrix(),0===this.shadowPasses.length&&this._createShadowPasses(t),this.programManager||(this.programManager=p.a.getDefaultProgramManager(t),I.a&&this.programManager.addDefaultModule(I.a)),this.dummyShadowMap||(this.dummyShadowMap=new d.a(t,{width:1,height:1}));for(var s=0;s<this.shadowPasses.length;s++){this.shadowPasses[s].render({layers:r,layerFilter:n,viewports:i,onViewportActive:o,views:a,moduleParameters:{shadowLightId:s,dummyShadowMap:this.dummyShadowMap,shadowMatrices:this.shadowMatrices}})}}}},{key:"getModuleParameters",value:function(t){var e=this.shadow?{shadowMaps:this.shadowMaps,dummyShadowMap:this.dummyShadowMap,shadowColor:this.shadowColor,shadowMatrices:this.shadowMatrices}:{};return e.lightSources={ambientLight:this.ambientLight,directionalLights:this.directionalLights.map((function(e){return e.getProjectedLight({layer:t})})),pointLights:this.pointLights.map((function(e){return e.getProjectedLight({layer:t})}))},e}},{key:"cleanup",value:function(){var t,e=k(this.shadowPasses);try{for(e.s();!(t=e.n()).done;){t.value.delete()}}catch(t){e.e(t)}finally{e.f()}this.shadowPasses.length=0,this.shadowMaps.length=0,this.dummyShadowMap&&(this.dummyShadowMap.delete(),this.dummyShadowMap=null),this.shadow&&this.programManager&&(this.programManager.removeDefaultModule(I.a),this.programManager=null)}},{key:"_createLightMatrix",value:function(){var t,e=[],r=k(this.directionalLights);try{for(r.s();!(t=r.n()).done;){var n=t.value,i=(new y.a).lookAt({eye:new y.b(n.direction).negate()});e.push(i)}}catch(t){r.e(t)}finally{r.f()}return e}},{key:"_createShadowPasses",value:function(t){for(var e=0;e<this.directionalLights.length;e++){var r=new C(t);this.shadowPasses[e]=r,this.shadowMaps[e]=r.shadowMap}}},{key:"_applyDefaultLights",value:function(){var t=this.ambientLight,e=this.pointLights,r=this.directionalLights;t||0!==e.length||0!==r.length||(this.ambientLight=new A.a(j),this.directionalLights.push(new g.a(D[0]),new g.a(D[1])))}}]),r}(m.a)},function(e,r){e.exports=t},function(t,e,r){"use strict";function n(t){for(const e in t)return!1;return!0}function i(t,e){if(t===e)return!0;const r=Array.isArray(t)||ArrayBuffer.isView(t),n=Array.isArray(e)||ArrayBuffer.isView(e);if(r&&n&&t.length===e.length){for(let r=0;r<t.length;++r)if(t[r]!==e[r])return!1;return!0}return!1}r.d(e,"b",(function(){return n})),r.d(e,"a",(function(){return i}))},function(t,e,r){"use strict";r.d(e,"a",(function(){return i}));var n=r(7);function i(t,e,r){const{removedProps:i={},deprecatedProps:o={},replacedProps:a={}}=r;for(const r in i)if(r in e){const e=i[r]?`${t}.${i[r]}`:"N/A";n.k.removed(`${t}.${r}`,e)()}for(const r in o)if(r in e){const e=o[r];n.k.deprecated(`${t}.${r}`,`${t}.${e}`)()}let s=null;for(const r in a)if(r in e){const i=a[r];n.k.deprecated(`${t}.${r}`,`${t}.${i}`)(),s=s||Object.assign({},e),s[i]=e[r],delete s[r]}return s||e}},function(t,e,r){"use strict";r.d(e,"a",(function(){return g})),r.d(e,"b",(function(){return m}));var n=r(0),i=r.n(n),o=r(10),a=r.n(o),s=r(14),u=r(113),c=r(105),l=r(28),h=r(21),f=r(22);function p(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function d(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=e.projectPosition(t);if(r&&e instanceof c.a){var i=a()(t,3),o=i[0],s=i[1],u=i[2],l=void 0===u?0:u,h=e.getDistanceScales([o,s]);n[2]=l*h.unitsPerMeter[2]}return n}function A(t){var e=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?p(Object(r),!0).forEach((function(e){i()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},t),r=t.coordinateSystem,n=t.viewport,o=t.coordinateOrigin,a=t.fromCoordinateSystem,u=t.fromCoordinateOrigin;return r===s.a.DEFAULT&&(r=n.isGeospatial?s.a.LNGLAT:s.a.CARTESIAN),void 0===a&&(e.fromCoordinateSystem=r),void 0===u&&(e.fromCoordinateOrigin=o),e.coordinateSystem=r,e}function g(t,e){var r=e.viewport,n=e.modelMatrix,i=e.coordinateSystem,o=e.coordinateOrigin,u=e.offsetMode,c=a()(t,3),h=c[0],p=c[1],A=c[2],g=void 0===A?0:A;if(n){var m=l.n([],[h,p,g,1],n),y=a()(m,3);h=y[0],p=y[1],g=y[2]}switch(i){case s.a.LNGLAT:return d([h,p,g],r,u);case s.a.LNGLAT_OFFSETS:return d([h+o[0],p+o[1],g+(o[2]||0)],r,u);case s.a.METER_OFFSETS:return d(Object(f.a)(o,[h,p,g]),r,u);case s.a.CARTESIAN:default:return r.isGeospatial?[h+o[0],p+o[1],g+o[2]]:r.projectPosition([h,p,g])}}function m(t,e){var r=A(e),n=r.viewport,i=r.coordinateSystem,o=r.coordinateOrigin,a=r.modelMatrix,s=r.fromCoordinateSystem,c=r.fromCoordinateOrigin,l=Object(u.a)(n,i,o),f=l.geospatialOrigin,p=l.shaderCoordinateOrigin,d=l.offsetMode,m=g(t,{viewport:n,modelMatrix:a,coordinateSystem:s,coordinateOrigin:c,offsetMode:d});if(d){var y=n.projectPosition(f||p);h.q(m,m,y)}return m}},function(t,e,r){"use strict";(function(t,n){r.d(e,"a",(function(){return o})),r.d(e,"b",(function(){return a}));const i={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==t&&t,document:"undefined"!=typeof document&&document},o=i.global||i.self||i.window,a="object"!=typeof n||"[object process]"!==String(n)||n.browser,s=void 0!==n&&n.version&&/v([0-9]*)/.exec(n.version);s&&parseFloat(s[1])}).call(this,r(65),r(57))},function(t,e,r){"use strict";r.d(e,"b",(function(){return g})),r.d(e,"a",(function(){return m}));var n=r(10),i=r.n(n),o=r(237),a=r.n(o),s=r(38);function u(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return c(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return c(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var l=s.a.CLOCKWISE,h=s.a.COUNTER_CLOCKWISE,f={isClosed:!0};function p(t,e,r,n){for(var i=0;i<e;i++)if(t[r+i]!==t[n-e+i])return!1;return!0}function d(t,e,r,n,i){for(var o=e,a=r.length,u=0;u<a;u++)for(var c=0;c<n;c++)t[o++]=r[u][c]||0;if(!function(t){var e=t[0],r=t[t.length-1];return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]}(r))for(var l=0;l<n;l++)t[o++]=r[0][l]||0;return f.start=e,f.end=o,f.size=n,Object(s.h)(t,i,f),o}function A(t,e,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5?arguments[5]:void 0,a=arguments.length>6?arguments[6]:void 0,u=(o=o||r.length)-i;if(u<=0)return e;for(var c=e,l=0;l<u;l++)t[c++]=r[i+l];if(!p(r,n,i,o))for(var h=0;h<n;h++)t[c++]=r[i+h];return f.start=e,f.end=c,f.size=n,Object(s.h)(t,a,f),c}function g(t,e){!function(t){if(t=t&&t.positions||t,!Array.isArray(t)&&!ArrayBuffer.isView(t))throw new Error("invalid polygon")}(t);var r=[],n=[];if(t.positions){var o=t,a=o.positions,s=o.holeIndices;if(s){for(var c=0,f=0;f<=s.length;f++)c=A(r,c,a,e,s[f-1],s[f],0===f?l:h),n.push(c);return n.pop(),{positions:r,holeIndices:n}}t=a}if(Number.isFinite(t[0]))return A(r,0,t,e,0,r.length,l),r;if(!function(t){return t.length>=1&&t[0].length>=2&&Number.isFinite(t[0][0])}(t)){var p,g=0,m=u(t.entries());try{for(m.s();!(p=m.n()).done;){var y=i()(p.value,2),v=y[0];g=d(r,g,y[1],e,0===v?l:h),n.push(g)}}catch(t){m.e(t)}finally{m.f()}return n.pop(),{positions:r,holeIndices:n}}return d(r,0,t,e,l),r}function m(t,e,r){var n=null;t.holeIndices&&(n=t.holeIndices.map((function(t){return t/e})));var i=t.positions||t;if(r){var o=i.length;i=i.slice();for(var s=[],u=0;u<o;u+=e){s[0]=i[u],s[1]=i[u+1];var c=r(s);i[u]=c[0],i[u+1]=c[1]}}return a()(i,n,e)}},function(t,e,r){"use strict";var n=r(126);class i{constructor(t,e){this.name=t,this.type=e,this.sampleSize=1,this.reset()}setSampleSize(t){return this.sampleSize=t,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(t){return this._count+=t,this._samples++,this._checkSampling(),this}subtractCount(t){return this._count-=t,this._samples++,this._checkSampling(),this}addTime(t){return this._time+=t,this.lastTiming=t,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=Object(n.a)(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(Object(n.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 o{constructor({id:t,stats:e}){this.id=t,this.stats={},this._initializeStats(e),Object.seal(this)}get(t,e="count"){return this._getOrCreate({name:t,type:e})}get size(){return Object.keys(this.stats).length}reset(){for(const t in this.stats)this.stats[t].reset();return this}forEach(t){for(const e in this.stats)t(this.stats[e])}getTable(){const t={};return this.forEach(e=>{t[e.name]={time:e.time||0,count:e.count||0,average:e.getAverageTime()||0,hz:e.getHz()||0}}),t}_initializeStats(t=[]){t.forEach(t=>this._getOrCreate(t))}_getOrCreate(t){if(!t||!t.name)return null;const{name:e,type:r}=t;return this.stats[e]||(this.stats[e]=t instanceof i?t:new i(e,r)),this.stats[e]}}r.d(e,"a",(function(){return o}))},function(t,e,r){"use strict";var n="#if (defined(SHADER_TYPE_FRAGMENT) && defined(LIGHTING_FRAGMENT)) || (defined(SHADER_TYPE_VERTEX) && defined(LIGHTING_VERTEX))\n\nstruct AmbientLight {\n vec3 color;\n};\n\nstruct PointLight {\n vec3 color;\n vec3 position;\n vec3 attenuation;\n};\n\nstruct DirectionalLight {\n vec3 color;\n vec3 direction;\n};\n\nuniform AmbientLight lighting_uAmbientLight;\nuniform PointLight lighting_uPointLight[MAX_LIGHTS];\nuniform DirectionalLight lighting_uDirectionalLight[MAX_LIGHTS];\nuniform int lighting_uPointLightCount;\nuniform int lighting_uDirectionalLightCount;\n\nuniform bool lighting_uEnabled;\n\nfloat getPointLightAttenuation(PointLight pointLight, float distance) {\n return pointLight.attenuation.x\n + pointLight.attenuation.y * distance\n + pointLight.attenuation.z * distance * distance;\n}\n\n#endif\n";r.d(e,"a",(function(){return a}));const i={lightSources:{}};function o({color:t=[0,0,0],intensity:e=1}={}){return t.map(t=>t*e/255)}const a={name:"lights",vs:n,fs:n,getUniforms:function t(e=i){if("lightSources"in e){const{ambientLight:t,pointLights:r,directionalLights:n}=e.lightSources||{};return t||r&&r.length>0||n&&n.length>0?Object.assign({},function({ambientLight:t,pointLights:e=[],directionalLights:r=[]}){const n={};return n["lighting_uAmbientLight.color"]=t?o(t):[0,0,0],e.forEach((t,e)=>{n[`lighting_uPointLight[${e}].color`]=o(t),n[`lighting_uPointLight[${e}].position`]=t.position,n[`lighting_uPointLight[${e}].attenuation`]=t.attenuation||[1,0,0]}),n.lighting_uPointLightCount=e.length,r.forEach((t,e)=>{n[`lighting_uDirectionalLight[${e}].color`]=o(t),n[`lighting_uDirectionalLight[${e}].direction`]=t.direction}),n.lighting_uDirectionalLightCount=r.length,n}({ambientLight:t,pointLights:r,directionalLights:n}),{lighting_uEnabled:!0}):{lighting_uEnabled:!1}}if("lights"in e){const r={pointLights:[],directionalLights:[]};for(const t of e.lights||[])switch(t.type){case"ambient":r.ambientLight=t;break;case"directional":r.directionalLights.push(t);break;case"point":r.pointLights.push(t)}return t({lightSources:r})}return{}},defines:{MAX_LIGHTS:3}}},function(t,e,r){"use strict";r.d(e,"a",(function(){return a}));var n=r(7),i=r(137),o=r(26);const a=new class{constructor(){this.stats=new Map}get(t){return this.stats.has(t)||this.stats.set(t,new i.a({id:t})),this.stats.get(t)}};if(o.global.luma&&"8.5.10"!==o.global.luma.VERSION)throw new Error(`luma.gl - multiple VERSIONs detected: ${o.global.luma.VERSION} vs 8.5.10`);o.global.luma||(Object(o.isBrowser)()&&n.k.log(1,"luma.gl 8.5.10 - set luma.log.level=1 (or higher) to trace rendering")(),o.global.luma=o.global.luma||{VERSION:"8.5.10",version:"8.5.10",log:n.k,stats:a,globals:{modules:{},nodeIO:{}}});o.global.luma},function(t,e,r){var n;
/*! Hammer.JS - v2.0.7 - 2016-04-22
* http://hammerjs.github.io/
*
* Copyright (c) 2016 Jorik Tangelder;
* Licensed under the MIT license */!function(i,o,a,s){"use strict";var u,c=["","webkit","Moz","MS","ms","o"],l=o.createElement("div"),h=Math.round,f=Math.abs,p=Date.now;function d(t,e,r){return setTimeout(b(t,r),e)}function A(t,e,r){return!!Array.isArray(t)&&(g(t,r[e],r),!0)}function g(t,e,r){var n;if(t)if(t.forEach)t.forEach(e,r);else if(void 0!==t.length)for(n=0;n<t.length;)e.call(r,t[n],n,t),n++;else for(n in t)t.hasOwnProperty(n)&&e.call(r,t[n],n,t)}function m(t,e,r){var n="DEPRECATED METHOD: "+e+"\n"+r+" AT \n";return function(){var e=new Error("get-stack-trace"),r=e&&e.stack?e.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=i.console&&(i.console.warn||i.console.log);return o&&o.call(i.console,n,r),t.apply(this,arguments)}}u="function"!=typeof Object.assign?function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),r=1;r<arguments.length;r++){var n=arguments[r];if(null!=n)for(var i in n)n.hasOwnProperty(i)&&(e[i]=n[i])}return e}:Object.assign;var y=m((function(t,e,r){for(var n=Object.keys(e),i=0;i<n.length;)(!r||r&&void 0===t[n[i]])&&(t[n[i]]=e[n[i]]),i++;return t}),"extend","Use `assign`."),v=m((function(t,e){return y(t,e,!0)}),"merge","Use `assign`.");function _(t,e,r){var n,i=e.prototype;(n=t.prototype=Object.create(i)).constructor=t,n._super=i,r&&u(n,r)}function b(t,e){return function(){return t.apply(e,arguments)}}function x(t,e){return"function"==typeof t?t.apply(e&&e[0]||void 0,e):t}function w(t,e){return void 0===t?e:t}function E(t,e,r){g(P(e),(function(e){t.addEventListener(e,r,!1)}))}function S(t,e,r){g(P(e),(function(e){t.removeEventListener(e,r,!1)}))}function O(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function T(t,e){return t.indexOf(e)>-1}function P(t){return t.trim().split(/\s+/g)}function M(t,e,r){if(t.indexOf&&!r)return t.indexOf(e);for(var n=0;n<t.length;){if(r&&t[n][r]==e||!r&&t[n]===e)return n;n++}return-1}function C(t){return Array.prototype.slice.call(t,0)}function I(t,e,r){for(var n=[],i=[],o=0;o<t.length;){var a=e?t[o][e]:t[o];M(i,a)<0&&n.push(t[o]),i[o]=a,o++}return r&&(n=e?n.sort((function(t,r){return t[e]>r[e]})):n.sort()),n}function k(t,e){for(var r,n,i=e[0].toUpperCase()+e.slice(1),o=0;o<c.length;){if((n=(r=c[o])?r+i:e)in t)return n;o++}}var R=1;function L(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow||i}var j="ontouchstart"in i,D=void 0!==k(i,"PointerEvent"),B=j&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),F=["x","y"],z=["clientX","clientY"];function N(t,e){var r=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){x(t.options.enable,[t])&&r.handler(e)},this.init()}function U(t,e,r){var n=r.pointers.length,i=r.changedPointers.length,o=1&e&&n-i==0,a=12&e&&n-i==0;r.isFirst=!!o,r.isFinal=!!a,o&&(t.session={}),r.eventType=e,function(t,e){var r=t.session,n=e.pointers,i=n.length;r.firstInput||(r.firstInput=V(e));i>1&&!r.firstMultiple?r.firstMultiple=V(e):1===i&&(r.firstMultiple=!1);var o=r.firstInput,a=r.firstMultiple,s=a?a.center:o.center,u=e.center=G(n);e.timeStamp=p(),e.deltaTime=e.timeStamp-o.timeStamp,e.angle=Z(s,u),e.distance=q(s,u),function(t,e){var r=e.center,n=t.offsetDelta||{},i=t.prevDelta||{},o=t.prevInput||{};1!==e.eventType&&4!==o.eventType||(i=t.prevDelta={x:o.deltaX||0,y:o.deltaY||0},n=t.offsetDelta={x:r.x,y:r.y});e.deltaX=i.x+(r.x-n.x),e.deltaY=i.y+(r.y-n.y)}(r,e),e.offsetDirection=H(e.deltaX,e.deltaY);var c=W(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=c.x,e.overallVelocityY=c.y,e.overallVelocity=f(c.x)>f(c.y)?c.x:c.y,e.scale=a?(l=a.pointers,h=n,q(h[0],h[1],z)/q(l[0],l[1],z)):1,e.rotation=a?function(t,e){return Z(e[1],e[0],z)+Z(t[1],t[0],z)}(a.pointers,n):0,e.maxPointers=r.prevInput?e.pointers.length>r.prevInput.maxPointers?e.pointers.length:r.prevInput.maxPointers:e.pointers.length,function(t,e){var r,n,i,o,a=t.lastInterval||e,s=e.timeStamp-a.timeStamp;if(8!=e.eventType&&(s>25||void 0===a.velocity)){var u=e.deltaX-a.deltaX,c=e.deltaY-a.deltaY,l=W(s,u,c);n=l.x,i=l.y,r=f(l.x)>f(l.y)?l.x:l.y,o=H(u,c),t.lastInterval=e}else r=a.velocity,n=a.velocityX,i=a.velocityY,o=a.direction;e.velocity=r,e.velocityX=n,e.velocityY=i,e.direction=o}(r,e);var l,h;var d=t.element;O(e.srcEvent.target,d)&&(d=e.srcEvent.target);e.target=d}(t,r),t.emit("hammer.input",r),t.recognize(r),t.session.prevInput=r}function V(t){for(var e=[],r=0;r<t.pointers.length;)e[r]={clientX:h(t.pointers[r].clientX),clientY:h(t.pointers[r].clientY)},r++;return{timeStamp:p(),pointers:e,center:G(e),deltaX:t.deltaX,deltaY:t.deltaY}}function G(t){var e=t.length;if(1===e)return{x:h(t[0].clientX),y:h(t[0].clientY)};for(var r=0,n=0,i=0;i<e;)r+=t[i].clientX,n+=t[i].clientY,i++;return{x:h(r/e),y:h(n/e)}}function W(t,e,r){return{x:e/t||0,y:r/t||0}}function H(t,e){return t===e?1:f(t)>=f(e)?t<0?2:4:e<0?8:16}function q(t,e,r){r||(r=F);var n=e[r[0]]-t[r[0]],i=e[r[1]]-t[r[1]];return Math.sqrt(n*n+i*i)}function Z(t,e,r){r||(r=F);var n=e[r[0]]-t[r[0]],i=e[r[1]]-t[r[1]];return 180*Math.atan2(i,n)/Math.PI}N.prototype={handler:function(){},init:function(){this.evEl&&E(this.element,this.evEl,this.domHandler),this.evTarget&&E(this.target,this.evTarget,this.domHandler),this.evWin&&E(L(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&S(this.element,this.evEl,this.domHandler),this.evTarget&&S(this.target,this.evTarget,this.domHandler),this.evWin&&S(L(this.element),this.evWin,this.domHandler)}};var X={mousedown:1,mousemove:2,mouseup:4};function Q(){this.evEl="mousedown",this.evWin="mousemove mouseup",this.pressed=!1,N.apply(this,arguments)}_(Q,N,{handler:function(t){var e=X[t.type];1&e&&0===t.button&&(this.pressed=!0),2&e&&1!==t.which&&(e=4),this.pressed&&(4&e&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:"mouse",srcEvent:t}))}});var Y={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},K={2:"touch",3:"pen",4:"mouse",5:"kinect"},$="pointerdown",J="pointermove pointerup pointercancel";function tt(){this.evEl=$,this.evWin=J,N.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}i.MSPointerEvent&&!i.PointerEvent&&($="MSPointerDown",J="MSPointerMove MSPointerUp MSPointerCancel"),_(tt,N,{handler:function(t){var e=this.store,r=!1,n=t.type.toLowerCase().replace("ms",""),i=Y[n],o=K[t.pointerType]||t.pointerType,a="touch"==o,s=M(e,t.pointerId,"pointerId");1&i&&(0===t.button||a)?s<0&&(e.push(t),s=e.length-1):12&i&&(r=!0),s<0||(e[s]=t,this.callback(this.manager,i,{pointers:e,changedPointers:[t],pointerType:o,srcEvent:t}),r&&e.splice(s,1))}});var et={touchstart:1,touchmove:2,touchend:4,touchcancel:8};function rt(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,N.apply(this,arguments)}function nt(t,e){var r=C(t.touches),n=C(t.changedTouches);return 12&e&&(r=I(r.concat(n),"identifier",!0)),[r,n]}_(rt,N,{handler:function(t){var e=et[t.type];if(1===e&&(this.started=!0),this.started){var r=nt.call(this,t,e);12&e&&r[0].length-r[1].length==0&&(this.started=!1),this.callback(this.manager,e,{pointers:r[0],changedPointers:r[1],pointerType:"touch",srcEvent:t})}}});var it={touchstart:1,touchmove:2,touchend:4,touchcancel:8};function ot(){this.evTarget="touchstart touchmove touchend touchcancel",this.targetIds={},N.apply(this,arguments)}function at(t,e){var r=C(t.touches),n=this.targetIds;if(3&e&&1===r.length)return n[r[0].identifier]=!0,[r,r];var i,o,a=C(t.changedTouches),s=[],u=this.target;if(o=r.filter((function(t){return O(t.target,u)})),1===e)for(i=0;i<o.length;)n[o[i].identifier]=!0,i++;for(i=0;i<a.length;)n[a[i].identifier]&&s.push(a[i]),12&e&&delete n[a[i].identifier],i++;return s.length?[I(o.concat(s),"identifier",!0),s]:void 0}_(ot,N,{handler:function(t){var e=it[t.type],r=at.call(this,t,e);r&&this.callback(this.manager,e,{pointers:r[0],changedPointers:r[1],pointerType:"touch",srcEvent:t})}});function st(){N.apply(this,arguments);var t=b(this.handler,this);this.touch=new ot(this.manager,t),this.mouse=new Q(this.manager,t),this.primaryTouch=null,this.lastTouches=[]}function ut(t,e){1&t?(this.primaryTouch=e.changedPointers[0].identifier,ct.call(this,e)):12&t&&ct.call(this,e)}function ct(t){var e=t.changedPointers[0];if(e.identifier===this.primaryTouch){var r={x:e.clientX,y:e.clientY};this.lastTouches.push(r);var n=this.lastTouches;setTimeout((function(){var t=n.indexOf(r);t>-1&&n.splice(t,1)}),2500)}}function lt(t){for(var e=t.srcEvent.clientX,r=t.srcEvent.clientY,n=0;n<this.lastTouches.length;n++){var i=this.lastTouches[n],o=Math.abs(e-i.x),a=Math.abs(r-i.y);if(o<=25&&a<=25)return!0}return!1}_(st,N,{handler:function(t,e,r){var n="touch"==r.pointerType,i="mouse"==r.pointerType;if(!(i&&r.sourceCapabilities&&r.sourceCapabilities.firesTouchEvents)){if(n)ut.call(this,e,r);else if(i&&lt.call(this,r))return;this.callback(t,e,r)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var ht=k(l.style,"touchAction"),ft=void 0!==ht,pt=function(){if(!ft)return!1;var t={},e=i.CSS&&i.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(r){t[r]=!e||i.CSS.supports("touch-action",r)})),t}();function dt(t,e){this.manager=t,this.set(e)}dt.prototype={set:function(t){"compute"==t&&(t=this.compute()),ft&&this.manager.element.style&&pt[t]&&(this.manager.element.style[ht]=t),this.actions=t.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var t=[];return g(this.manager.recognizers,(function(e){x(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))})),function(t){if(T(t,"none"))return"none";var e=T(t,"pan-x"),r=T(t,"pan-y");if(e&&r)return"none";if(e||r)return e?"pan-x":"pan-y";if(T(t,"manipulation"))return"manipulation";return"auto"}(t.join(" "))},preventDefaults:function(t){var e=t.srcEvent,r=t.offsetDirection;if(this.manager.session.prevented)e.preventDefault();else{var n=this.actions,i=T(n,"none")&&!pt.none,o=T(n,"pan-y")&&!pt["pan-y"],a=T(n,"pan-x")&&!pt["pan-x"];if(i){var s=1===t.pointers.length,u=t.distance<2,c=t.deltaTime<250;if(s&&u&&c)return}if(!a||!o)return i||o&&6&r||a&&24&r?this.preventSrc(e):void 0}},preventSrc:function(t){this.manager.session.prevented=!0,t.preventDefault()}};function At(t){this.options=u({},this.defaults,t||{}),this.id=R++,this.manager=null,this.options.enable=w(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function gt(t){return 16&t?"cancel":8&t?"end":4&t?"move":2&t?"start":""}function mt(t){return 16==t?"down":8==t?"up":2==t?"left":4==t?"right":""}function yt(t,e){var r=e.manager;return r?r.get(t):t}function vt(){At.apply(this,arguments)}function _t(){vt.apply(this,arguments),this.pX=null,this.pY=null}function bt(){vt.apply(this,arguments)}function xt(){At.apply(this,arguments),this._timer=null,this._input=null}function wt(){vt.apply(this,arguments)}function Et(){vt.apply(this,arguments)}function St(){At.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function Ot(t,e){return(e=e||{}).recognizers=w(e.recognizers,Ot.defaults.preset),new Tt(t,e)}At.prototype={defaults:{},set:function(t){return u(this.options,t),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(t){if(A(t,"recognizeWith",this))return this;var e=this.simultaneous;return e[(t=yt(t,this)).id]||(e[t.id]=t,t.recognizeWith(this)),this},dropRecognizeWith:function(t){return A(t,"dropRecognizeWith",this)?this:(t=yt(t,this),delete this.simultaneous[t.id],this)},requireFailure:function(t){if(A(t,"requireFailure",this))return this;var e=this.requireFail;return-1===M(e,t=yt(t,this))&&(e.push(t),t.requireFailure(this)),this},dropRequireFailure:function(t){if(A(t,"dropRequireFailure",this))return this;t=yt(t,this);var e=M(this.requireFail,t);return e>-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){var e=this,r=this.state;function n(r){e.manager.emit(r,t)}r<8&&n(e.options.event+gt(r)),n(e.options.event),t.additionalEvent&&n(t.additionalEvent),r>=8&&n(e.options.event+gt(r))},tryEmit:function(t){if(this.canEmit())return this.emit(t);this.state=32},canEmit:function(){for(var t=0;t<this.requireFail.length;){if(!(33&this.requireFail[t].state))return!1;t++}return!0},recognize:function(t){var e=u({},t);if(!x(this.options.enable,[this,e]))return this.reset(),void(this.state=32);56&this.state&&(this.state=1),this.state=this.process(e),30&this.state&&this.tryEmit(e)},process:function(t){},getTouchAction:function(){},reset:function(){}},_(vt,At,{defaults:{pointers:1},attrTest:function(t){var e=this.options.pointers;return 0===e||t.pointers.length===e},process:function(t){var e=this.state,r=t.eventType,n=6&e,i=this.attrTest(t);return n&&(8&r||!i)?16|e:n||i?4&r?8|e:2&e?4|e:2:32}}),_(_t,vt,{defaults:{event:"pan",threshold:10,pointers:1,direction:30},getTouchAction:function(){var t=this.options.direction,e=[];return 6&t&&e.push("pan-y"),24&t&&e.push("pan-x"),e},directionTest:function(t){var e=this.options,r=!0,n=t.distance,i=t.direction,o=t.deltaX,a=t.deltaY;return i&e.direction||(6&e.direction?(i=0===o?1:o<0?2:4,r=o!=this.pX,n=Math.abs(t.deltaX)):(i=0===a?1:a<0?8:16,r=a!=this.pY,n=Math.abs(t.deltaY))),t.direction=i,r&&n>e.threshold&&i&e.direction},attrTest:function(t){return vt.prototype.attrTest.call(this,t)&&(2&this.state||!(2&this.state)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=mt(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),_(bt,vt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return["none"]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||2&this.state)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),_(xt,At,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(t){var e=this.options,r=t.pointers.length===e.pointers,n=t.distance<e.threshold,i=t.deltaTime>e.time;if(this._input=t,!n||!r||12&t.eventType&&!i)this.reset();else if(1&t.eventType)this.reset(),this._timer=d((function(){this.state=8,this.tryEmit()}),e.time,this);else if(4&t.eventType)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(t){8===this.state&&(t&&4&t.eventType?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=p(),this.manager.emit(this.options.event,this._input)))}}),_(wt,vt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return["none"]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||2&this.state)}}),_(Et,vt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return _t.prototype.getTouchAction.call(this)},attrTest:function(t){var e,r=this.options.direction;return 30&r?e=t.overallVelocity:6&r?e=t.overallVelocityX:24&r&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&r&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&f(e)>this.options.velocity&&4&t.eventType},emit:function(t){var e=mt(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),_(St,At,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return["manipulation"]},process:function(t){var e=this.options,r=t.pointers.length===e.pointers,n=t.distance<e.threshold,i=t.deltaTime<e.time;if(this.reset(),1&t.eventType&&0===this.count)return this.failTimeout();if(n&&i&&r){if(4!=t.eventType)return this.failTimeout();var o=!this.pTime||t.timeStamp-this.pTime<e.interval,a=!this.pCenter||q(this.pCenter,t.center)<e.posThreshold;if(this.pTime=t.timeStamp,this.pCenter=t.center,a&&o?this.count+=1:this.count=1,this._input=t,0===this.count%e.taps)return this.hasRequireFailures()?(this._timer=d((function(){this.state=8,this.tryEmit()}),e.interval,this),2):8}return 32},failTimeout:function(){return this._timer=d((function(){this.state=32}),this.options.interval,this),32},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),Ot.VERSION="2.0.7",Ot.defaults={domEvents:!1,touchAction:"compute",enable:!0,inputTarget:null,inputClass:null,preset:[[wt,{enable:!1}],[bt,{enable:!1},["rotate"]],[Et,{direction:6}],[_t,{direction:6},["swipe"]],[St],[St,{event:"doubletap",taps:2},["tap"]],[xt]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function Tt(t,e){var r;this.options=u({},Ot.defaults,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=new((r=this).options.inputClass||(D?tt:B?ot:j?st:Q))(r,U),this.touchAction=new dt(this,this.options.touchAction),Pt(this,!0),g(this.options.recognizers,(function(t){var e=this.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])}),this)}function Pt(t,e){var r,n=t.element;n.style&&(g(t.options.cssProps,(function(i,o){r=k(n.style,o),e?(t.oldCssProps[r]=n.style[r],n.style[r]=i):n.style[r]=t.oldCssProps[r]||""})),e||(t.oldCssProps={}))}Tt.prototype={set:function(t){return u(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},stop:function(t){this.session.stopped=t?2:1},recognize:function(t){var e=this.session;if(!e.stopped){var r;this.touchAction.preventDefaults(t);var n=this.recognizers,i=e.curRecognizer;(!i||i&&8&i.state)&&(i=e.curRecognizer=null);for(var o=0;o<n.length;)r=n[o],2===e.stopped||i&&r!=i&&!r.canRecognizeWith(i)?r.reset():r.recognize(t),!i&&14&r.state&&(i=e.curRecognizer=r),o++}},get:function(t){if(t instanceof At)return t;for(var e=this.recognizers,r=0;r<e.length;r++)if(e[r].options.event==t)return e[r];return null},add:function(t){if(A(t,"add",this))return this;var e=this.get(t.options.event);return e&&this.remove(e),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t},remove:function(t){if(A(t,"remove",this))return this;if(t=this.get(t)){var e=this.recognizers,r=M(e,t);-1!==r&&(e.splice(r,1),this.touchAction.update())}return this},on:function(t,e){if(void 0!==t&&void 0!==e){var r=this.handlers;return g(P(t),(function(t){r[t]=r[t]||[],r[t].push(e)})),this}},off:function(t,e){if(void 0!==t){var r=this.handlers;return g(P(t),(function(t){e?r[t]&&r[t].splice(M(r[t],e),1):delete r[t]})),this}},emit:function(t,e){this.options.domEvents&&function(t,e){var r=o.createEvent("Event");r.initEvent(t,!0,!0),r.gesture=e,e.target.dispatchEvent(r)}(t,e);var r=this.handlers[t]&&this.handlers[t].slice();if(r&&r.length){e.type=t,e.preventDefault=function(){e.srcEvent.preventDefault()};for(var n=0;n<r.length;)r[n](e),n++}},destroy:function(){this.element&&Pt(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},u(Ot,{INPUT_START:1,INPUT_MOVE:2,INPUT_END:4,INPUT_CANCEL:8,STATE_POSSIBLE:1,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:32,DIRECTION_NONE:1,DIRECTION_LEFT:2,DIRECTION_RIGHT:4,DIRECTION_UP:8,DIRECTION_DOWN:16,DIRECTION_HORIZONTAL:6,DIRECTION_VERTICAL:24,DIRECTION_ALL:30,Manager:Tt,Input:N,TouchAction:dt,TouchInput:ot,MouseInput:Q,PointerEventInput:tt,TouchMouseInput:st,SingleTouchInput:rt,Recognizer:At,AttrRecognizer:vt,Tap:St,Pan:_t,Swipe:Et,Pinch:bt,Rotate:wt,Press:xt,on:E,off:S,each:g,merge:v,extend:y,assign:u,inherit:_,bindFn:b,prefixed:k}),(void 0!==i?i:"undefined"!=typeof self?self:{}).Hammer=Ot,void 0===(n=function(){return Ot}.call(e,r,e,t))||(t.exports=n)}(window,document)},function(t,e){},,function(t,e,r){"use strict";r.d(e,"a",(function(){return a}));var n=r(13),i=r(147),o=r(21);class a{constructor({phi:t=0,theta:e=0,radius:r=1,bearing:n,pitch:i,altitude:o,radiusScale:a=6371e3}={}){this.phi=t,this.theta=e,this.radius=r||o||1,this.radiusScale=a||1,void 0!==n&&(this.bearing=n),void 0!==i&&(this.pitch=i),this.check()}toString(){return this.formatString(n.b)}formatString({printTypes:t=!1}){const e=n.e;return`${t?"Spherical":""}[rho:${e(this.radius)},theta:${e(this.theta)},phi:${e(this.phi)}]`}equals(t){return Object(n.d)(this.radius,t.radius)&&Object(n.d)(this.theta,t.theta)&&Object(n.d)(this.phi,t.phi)}exactEquals(t){return this.radius===t.radius&&this.theta===t.theta&&this.phi===t.phi}get bearing(){return 180-Object(n.c)(this.phi)}set bearing(t){this.phi=Math.PI-Object(n.h)(t)}get pitch(){return Object(n.c)(this.theta)}set pitch(t){this.theta=Object(n.h)(t)}get longitude(){return Object(n.c)(this.phi)}get latitude(){return Object(n.c)(this.theta)}get lng(){return Object(n.c)(this.phi)}get lat(){return Object(n.c)(this.theta)}get z(){return(this.radius-1)*this.radiusScale}set(t,e,r){return this.radius=t,this.phi=e,this.theta=r,this.check()}clone(){return(new a).copy(this)}copy(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this.check()}fromLngLatZ([t,e,r]){this.radius=1+r/this.radiusScale,this.phi=Object(n.h)(e),this.theta=Object(n.h)(t)}fromVector3(t){return this.radius=o.h(t),this.radius>0&&(this.theta=Math.atan2(t[0],t[1]),this.phi=Math.acos(Object(n.a)(t[2]/this.radius,-1,1))),this.check()}toVector3(){return new i.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}}},function(t,e,r){"use strict";r.d(e,"a",(function(){return i}));var n=r(89);function i(t){return n.toBuffer?n.toBuffer(t):t}},function(t,e,r){"use strict";r.d(e,"b",(function(){return i})),r.d(e,"a",(function(){return o}));var n=r(97);function i(t,e){return Object(n.a)(t>=0),Object(n.a)(e>0),t+(e-1)&~(e-1)}function o(t,e,r){let n;if(t instanceof ArrayBuffer)n=new Uint8Array(t);else{const e=t.byteOffset,r=t.byteLength;n=new Uint8Array(t.buffer||t.arrayBuffer,e,r)}return e.set(n,r),r+i(n.byteLength,4)}},function(t,e,r){"use strict";r.r(e);var n=r(225);r.d(e,"SimpleMeshLayer",(function(){return n.a}));var i=r(220);r.d(e,"ScenegraphLayer",(function(){return i.a}))},function(t,e,r){"use strict";r.d(e,"a",(function(){return l}));var n=r(168),i=r(13),o=r(23),a=r(21),s=r(74);const u=[0,0,0],c={};class l extends n.a{static get ZERO(){return c.ZERO=c.ZERO||Object.freeze(new l(0,0,0,0))}constructor(t=0,e=0,r=0){super(-0,-0,-0),1===arguments.length&&Object(i.f)(t)?this.copy(t):(i.b.debug&&(Object(o.a)(t),Object(o.a)(e),Object(o.a)(r)),this[0]=t,this[1]=e,this[2]=r)}set(t,e,r){return this[0]=t,this[1]=e,this[2]=r,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}fromObject(t){return i.b.debug&&(Object(o.a)(t.x),Object(o.a)(t.y),Object(o.a)(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}get ELEMENTS(){return 3}get z(){return this[2]}set z(t){this[2]=Object(o.a)(t)}angle(t){return a.b(this,t)}cross(t){return a.d(this,this,t),this.check()}rotateX({radians:t,origin:e=u}){return a.m(this,this,e,t),this.check()}rotateY({radians:t,origin:e=u}){return a.n(this,this,e,t),this.check()}rotateZ({radians:t,origin:e=u}){return a.o(this,this,e,t),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return a.s(this,this,t),this.check()}transformAsVector(t){return Object(s.c)(this,this,t),this.check()}transformByMatrix3(t){return a.r(this,this,t),this.check()}transformByMatrix2(t){return Object(s.b)(this,this,t),this.check()}transformByQuaternion(t){return a.t(this,this,t),this.check()}}},function(t,e,r){"use strict";r.d(e,"a",(function(){return s}));var n=r(2),i=r.n(n),o=[255,255,255],a=0,s=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i()(this,t);var r=e.color,n=void 0===r?o:r,s=e.intensity,u=void 0===s?1:s;this.id=e.id||"ambient-".concat(a++),this.color=n,this.intensity=u,this.type="ambient"}},function(t,e,r){"use strict";r.d(e,"a",(function(){return b}));var n=r(0),i=r.n(n),o=r(2),a=r.n(o),s=r(3),u=r.n(s),c=r(5),l=r.n(c),h=r(6),f=r.n(h),p=r(1),d=r.n(p),A=r(61),g=r(105),m=r(106);function y(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function v(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?y(Object(r),!0).forEach((function(e){i()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function _(t){var e=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(t){return!1}}();return function(){var r,n=d()(t);if(e){var i=d()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return f()(this,r)}}var b=function(t){l()(r,t);var e=_(r);function r(t){return a()(this,r),e.call(this,v(v({},t),{},{type:g.a}))}return u()(r,[{key:"controller",get:function(){return this._getControllerProps({type:m.b})}}]),r}(A.a);b.displayName="MapView"},function(t,e,r){"use strict";r.d(e,"a",(function(){return n}));const n="3.0.8"},function(t,e,r){"use strict";r.d(e,"b",(function(){return i})),r.d(e,"a",(function(){return o}));var n=r(78);async function i(t,e){for(;;){const{done:r,value:n}=await t.next();if(r)return void t.return();if(e(n))return}}async function o(t){const e=[];for await(const r of t)e.push(r);return Object(n.b)(...e)}},function(t,e,r){"use strict";r.d(e,"a",(function(){return u}));var n=r(195);function i(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return o(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return o(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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 a,s=!0,u=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return s=t.done,t},e:function(t){u=!0,a=t},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw a}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var a=[r(95).a],s=["vs:DECKGL_FILTER_SIZE(inout vec3 size, VertexGeometry geometry)","vs:DECKGL_FILTER_GL_POSITION(inout vec4 position, VertexGeometry geometry)","vs:DECKGL_FILTER_COLOR(inout vec4 color, VertexGeometry geometry)","fs:DECKGL_FILTER_COLOR(inout vec4 color, FragmentGeometry geometry)"];function u(t){var e,r=n.a.getDefaultProgramManager(t),o=i(a);try{for(o.s();!(e=o.n()).done;){var u=e.value;r.addDefaultModule(u)}}catch(t){o.e(t)}finally{o.f()}var c,l=i(s);try{for(l.s();!(c=l.n()).done;){var h=c.value;r.addShaderHook(h)}}catch(t){l.e(t)}finally{l.f()}return r}},function(t,e,r){"use strict";r.d(e,"a",(function(){return s}));var n=r(0),i=r.n(n);function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function a(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach((function(e){i()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function s(t,e){if(!e)return t;var r=a(a({},t),e);if("defines"in e&&(r.defines=a(a({},t.defines),e.defines)),"modules"in e&&(r.modules=(t.modules||[]).concat(e.modules),e.modules.some((function(t){return"project64"===t.name})))){var n=r.modules.findIndex((function(t){return"project32"===t.name}));n>=0&&r.modules.splice(n,1)}if("inject"in e)if(t.inject){var i=a({},t.inject);for(var o in e.inject)i[o]=(i[o]||"")+e.inject[o];r.inject=i}else r.inject=e.inject;return r}},function(t,e,r){"use strict";r.d(e,"a",(function(){return o}));var n=r(24),i=r.n(n);function o(t){if(null===(e=t)||"object"!==i()(e))throw new Error("count(): argument not an object");var e;if("function"==typeof t.count)return t.count();if(Number.isFinite(t.size))return t.size;if(Number.isFinite(t.length))return t.length;if(function(t){return null!==t&&"object"===i()(t)&&t.constructor===Object}(t))return Object.keys(t).length;throw new Error("count(): argument not a container")}},function(t,e,r){"use strict";var n=r(10),i=r.n(n),o=r(2),a=r.n(o),s=r(3),u=r.n(s),c=r(5),l=r.n(c),h=r(6),f=r.n(h),p=r(1),d=r.n(p),A=r(0),g=r.n(A),m=r(14),y=r(156),v=r(46),_=r(11),b=r(73);function x(t){var e=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(t){return!1}}();return function(){var r,n=d()(t);if(e){var i=d()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return f()(this,r)}}var w=function(t){l()(r,t);var e=x(r);function r(){return a()(this,r),e.apply(this,arguments)}return u()(r,[{key:"_onUpdate",value:function(){var t=this.time,e=this.settings,r=e.fromValue,n=e.toValue,i=e.duration,o=(0,e.easing)(t/i);this._value=Object(_.f)(r,n,o)}},{key:"value",get:function(){return this._value}}]),r}(b.a);function E(t){var e=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(t){return!1}}();return function(){var r,n=d()(t);if(e){var i=d()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return f()(this,r)}}function S(t,e,r,n,i){var o=e-t;return(r-e)*i+-o*n+o+e}function O(t,e){if(Array.isArray(t)){for(var r=0,n=0;n<t.length;n++){var i=t[n]-e[n];r+=i*i}return Math.sqrt(r)}return Math.abs(t-e)}var T=function(t){l()(r,t);var e=E(r);function r(){return a()(this,r),e.apply(this,arguments)}return u()(r,[{key:"_onUpdate",value:function(){var t=this.settings,e=t.fromValue,r=t.toValue,n=t.damping,i=t.stiffness,o=this._prevValue,a=void 0===o?e:o,s=this._currValue,u=void 0===s?e:s,c=function(t,e,r,n,i){if(Array.isArray(r)){for(var o=[],a=0;a<r.length;a++)o[a]=S(t[a],e[a],r[a],n,i);return o}return S(t,e,r,n,i)}(a,u,r,n,i),l=O(c,r),h=O(c,u);l<1e-5&&h<1e-5&&(c=r,this.end()),this._prevValue=u,this._currValue=c}},{key:"value",get:function(){return this._currValue}}]),r}(b.a),P=r(18);function M(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return C(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return C(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function C(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function I(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function k(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?I(Object(r),!0).forEach((function(e){g()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):I(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var R,L={interpolation:w,spring:T},j=function(){function t(e){a()(this,t),this.transitions=new Map,this.timeline=e}return u()(t,[{key:"add",value:function(t,e,r,n){var i=this.transitions;if(i.has(t)){var o=i.get(t),a=o.value;e=void 0===a?o.settings.fromValue:a,this.remove(t)}if(n=Object(v.e)(n)){var s=L[n.type];if(s){var u=new s(this.timeline);u.start(k(k({},n),{},{fromValue:e,toValue:r})),i.set(t,u)}else P.a.error("unsupported transition type '".concat(n.type,"'"))()}}},{key:"remove",value:function(t){var e=this.transitions;e.has(t)&&(e.get(t).cancel(),e.delete(t))}},{key:"update",value:function(){var t,e={},r=M(this.transitions);try{for(r.s();!(t=r.n()).done;){var n=i()(t.value,2),o=n[0],a=n[1];a.update(),e[o]=a.value,a.inProgress||this.remove(o)}}catch(t){r.e(t)}finally{r.f()}return e}},{key:"clear",value:function(){var t,e=M(this.transitions.keys());try{for(e.s();!(t=e.n()).done;){var r=t.value;this.remove(r)}}catch(t){e.e(t)}finally{e.f()}}},{key:"active",get:function(){return this.transitions.size>0}}]),t}(),D=r(129),B=r(154),F=r(32),z=r(7),N=r(37),U=r(80),V=r(153),G=r(134),W=r(67),H=r(33),q=r(53),Z=r(24),X=r.n(Z),Q=r(98);function Y(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function K(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Y(Object(r),!0).forEach((function(e){g()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Y(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var $=(R={},g()(R,10241,9987),g()(R,10240,9729),g()(R,10242,33071),g()(R,10243,33071),R),J={};function tt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function et(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?tt(Object(r),!0).forEach((function(e){g()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):tt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var rt={boolean:{validate:function(t,e){return!0},equal:function(t,e,r){return Boolean(t)===Boolean(e)}},number:{validate:function(t,e){return Number.isFinite(t)&&(!("max"in e)||t<=e.max)&&(!("min"in e)||t>=e.min)}},color:{validate:function(t,e){return e.optional&&!t||at(t)&&(3===t.length||4===t.length)},equal:function(t,e,r){return nt(t,e)}},accessor:{validate:function(t,e){var r=st(t);return"function"===r||r===st(e.value)},equal:function(t,e,r){return"function"==typeof e||nt(t,e)}},array:{validate:function(t,e){return e.optional&&!t||at(t)},equal:function(t,e,r){return r.compare?nt(t,e):t===e}},function:{validate:function(t,e){return e.optional&&!t||"function"==typeof t},equal:function(t,e,r){return!r.compare||t===e}},data:{transform:function(t,e,r){var n=(r?r.props:{}).dataTransform;return n&&t?n(t):t}},image:{transform:function(t,e,r){return function(t,e){var r=t.context&&t.context.gl;if(!r||!e)return null;if(e instanceof Q.a)return e;e.constructor&&"Object"!==e.constructor.name&&(e={data:e});var n=null;e.compressed&&(n=g()({},10241,e.data.length>1?9985:9729));var i=new Q.a(r,K(K({},e),{},{parameters:K(K(K({},$),n),t.props.textureParameters)}));return J[i.id]=!0,i}(r,t)},release:function(t){var e;(e=t)&&e instanceof Q.a&&J[e.id]&&(e.delete(),delete J[e.id])}}};function nt(t,e){if(t===e)return!0;if(!at(t)||!at(e))return!1;var r=t.length;if(r!==e.length)return!1;for(var n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}function it(t,e){switch(st(e)){case"object":return ot(t,e);case"array":return ot(t,{type:"array",value:e,compare:!1});case"boolean":return ot(t,{type:"boolean",value:e});case"number":return ot(t,{type:"number",value:e});case"function":return ot(t,{type:"function",value:e,compare:!0});default:return{name:t,type:"unknown",value:e}}}function ot(t,e){return"type"in e?et(et({name:t},rt[e.type]),e):"value"in e?et({name:t,type:st(e.value)},e):{name:t,type:"object",value:e}}function at(t){return Array.isArray(t)||ArrayBuffer.isView(t)}function st(t){return at(t)?"array":null===t?"null":X()(t)}function ut(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return ct(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ct(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function ct(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function lt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ht(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?lt(Object(r),!0).forEach((function(e){g()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):lt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var ft=H.b.COMPONENT,pt=H.b.ASYNC_ORIGINAL,dt=H.b.ASYNC_RESOLVED,At=H.b.ASYNC_DEFAULTS;function gt(){var t=this,e=mt(t.constructor),r=Object.create(e);r[ft]=t,r[pt]={},r[dt]={};for(var n=0;n<arguments.length;++n){var i=arguments[n];for(var o in i)r[o]=i[o]}return Object.freeze(r),r}function mt(t){var e=_t(t,"_mergedDefaultProps");return e||(function(t){if(!t.prototype)return;var e=Object.getPrototypeOf(t),r=mt(e),n=function(t){for(var e={},r={},n={},o=0,a=Object.entries(t);o<a.length;o++){var s=i()(a[o],2),u=s[0],c=s[1];if(c&&c.deprecatedFor)n[u]=Array.isArray(c.deprecatedFor)?c.deprecatedFor:[c.deprecatedFor];else{var l=it(u,c);e[u]=l,r[u]=l.value}}return{propTypes:e,defaultProps:r,deprecatedProps:n}}(_t(t,"defaultProps")||{}),o=function(t,e,r){var n=Object.create(null);Object.assign(n,e,t);var i=function(t){var e=_t(t,"layerName")||_t(t,"componentName");e||P.a.once(0,"".concat(t.name,".componentName not specified"))();return e||t.name}(r);return delete t.id,Object.defineProperties(n,{id:{writable:!0,value:i}}),n}(n.defaultProps,r,t),a=ht(ht({},e._propTypes),n.propTypes);!function(t,e){var r={},n={};for(var i in e){var o=e[i],a=o.name,s=o.value;o.async&&(r[a]=s,n[a]=yt(a))}t[At]=r,t[pt]={},Object.defineProperties(t,n)}(o,a);var s=ht(ht({},e._deprecatedProps),n.deprecatedProps);(function(t,e){var r=function(r){Object.defineProperty(t,r,{enumerable:!1,set:function(t){var n,i="".concat(this.id,": ").concat(r),o=ut(e[r]);try{for(o.s();!(n=o.n()).done;){var a=n.value;vt(this,a)||(this[a]=t)}}catch(t){o.e(t)}finally{o.f()}P.a.deprecated(i,e[r].join("/"))()}})};for(var n in e)r(n)})(o,s),t._mergedDefaultProps=o,t._propTypes=a,t._deprecatedProps=s}(t),t._mergedDefaultProps)}function yt(t){return{enumerable:!0,set:function(e){"string"==typeof e||e instanceof Promise||Object(q.c)(e)?this[pt][t]=e:this[dt][t]=e},get:function(){if(this[dt]){if(t in this[dt])return this[dt][t]||this[At][t];if(t in this[pt]){var e=this[ft]&&this[ft].internalState;if(e&&e.hasAsyncProp(t))return e.getAsyncProp(t)||this[At][t]}}return this[At][t]}}}function vt(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function _t(t,e){return vt(t,e)&&t[e]}var bt=r(43),xt=r.n(bt),wt=r(68),Et=r.n(wt),St=r(234),Ot=r.n(St),Tt=H.b.ASYNC_ORIGINAL,Pt=H.b.ASYNC_RESOLVED,Mt=H.b.ASYNC_DEFAULTS,Ct=Object.freeze({}),It=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;a()(this,t),this.component=e,this.asyncProps={},this.onAsyncPropUpdated=function(){},this.oldProps=Ct,this.oldAsyncProps=null}var e;return u()(t,[{key:"finalize",value:function(){for(var t in this.asyncProps){var e=this.asyncProps[t];e.type&&e.type.release&&e.type.release(e.resolvedValue,e.type,this.component)}}},{key:"getOldProps",value:function(){return this.oldAsyncProps||this.oldProps}},{key:"resetOldProps",value:function(){this.oldAsyncProps=null,this.oldProps=this.component.props}},{key:"freezeAsyncOldProps",value:function(){if(!this.oldAsyncProps)for(var t in this.oldProps=this.oldProps||this.component.props,this.oldAsyncProps=Object.create(this.oldProps),this.asyncProps)Object.defineProperty(this.oldAsyncProps,t,{enumerable:!0,value:this.oldProps[t]})}},{key:"hasAsyncProp",value:function(t){return t in this.asyncProps}},{key:"getAsyncProp",value:function(t){var e=this.asyncProps[t];return e&&e.resolvedValue}},{key:"isAsyncPropLoading",value:function(t){if(t){var e=this.asyncProps[t];return Boolean(e&&e.pendingLoadCount>0&&e.pendingLoadCount!==e.resolvedLoadCount)}for(var r in this.asyncProps)if(this.isAsyncPropLoading(r))return!0;return!1}},{key:"reloadAsyncProp",value:function(t,e){this._watchPromise(t,Promise.resolve(e))}},{key:"setAsyncProps",value:function(t){var e=t[Pt]||{},r=t[Tt]||t,n=t[Mt]||{};for(var i in e){var o=e[i];this._createAsyncPropData(i,n[i]),this._updateAsyncProp(i,o),e[i]=this.getAsyncProp(i)}for(var a in r){var s=r[a];this._createAsyncPropData(a,n[a]),this._updateAsyncProp(a,s)}}},{key:"_updateAsyncProp",value:function(t,e){if(this._didAsyncInputValueChange(t,e)){if("string"==typeof e){var r,n=null===(r=this.layer)||void 0===r?void 0:r.props.fetch;n&&(e=n(e,{propName:t,layer:this.layer}))}e instanceof Promise?this._watchPromise(t,e):Object(q.c)(e)?this._resolveAsyncIterable(t,e):this._setPropValue(t,e)}}},{key:"_didAsyncInputValueChange",value:function(t,e){var r=this.asyncProps[t];return e!==r.resolvedValue&&e!==r.lastValue&&(r.lastValue=e,!0)}},{key:"_setPropValue",value:function(t,e){this.freezeAsyncOldProps();var r=this.asyncProps[t];e=this._postProcessValue(r,e),r.resolvedValue=e,r.pendingLoadCount++,r.resolvedLoadCount=r.pendingLoadCount}},{key:"_setAsyncPropValue",value:function(t,e,r){var n=this.asyncProps[t];n&&r>=n.resolvedLoadCount&&void 0!==e&&(this.freezeAsyncOldProps(),n.resolvedValue=e,n.resolvedLoadCount=r,this.onAsyncPropUpdated(t,e))}},{key:"_watchPromise",value:function(t,e){var r=this,n=this.asyncProps[t];n.pendingLoadCount++;var i=n.pendingLoadCount;e.then((function(e){var o;e=r._postProcessValue(n,e),r._setAsyncPropValue(t,e,i);var a=null===(o=r.layer)||void 0===o?void 0:o.props.onDataLoad;"data"===t&&a&&a(e,{propName:t,layer:r.layer})})).catch((function(e){var n;null===(n=r.layer)||void 0===n||n.raiseError(e,"loading ".concat(t," of ").concat(r.layer))}))}},{key:"_resolveAsyncIterable",value:(e=Et()(xt.a.mark((function t(e,r){var n,i,o,a,s,u,c,l,h,f,p,d,A,g,m;return xt.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:"data"!==e&&this._setPropValue(e,r),(i=this.asyncProps[e]).pendingLoadCount++,o=i.pendingLoadCount,a=[],s=0,u=!0,c=!1,t.prev=8,h=Ot()(r);case 10:return t.next=12,h.next();case 12:return f=t.sent,u=f.done,t.next=16,f.value;case 16:if(p=t.sent,u){t.next=27;break}d=p,A=this.component?this.component.props:{},g=A.dataTransform,a=g?g(d,a):a.concat(d),Object.defineProperty(a,"__diff",{enumerable:!1,value:[{startRow:s,endRow:a.length}]}),s=a.length,this._setAsyncPropValue(e,a,o);case 24:u=!0,t.next=10;break;case 27:t.next=33;break;case 29:t.prev=29,t.t0=t.catch(8),c=!0,l=t.t0;case 33:if(t.prev=33,t.prev=34,u||null==h.return){t.next=38;break}return t.next=38,h.return();case 38:if(t.prev=38,!c){t.next=41;break}throw l;case 41:return t.finish(38);case 42:return t.finish(33);case 43:(m=null===(n=this.layer)||void 0===n?void 0:n.props.onDataLoad)&&m(a,{propName:e,layer:this.layer});case 45:case"end":return t.stop()}}),t,this,[[8,29,33,43],[34,,38,42]])}))),function(t,r){return e.apply(this,arguments)})},{key:"_postProcessValue",value:function(t,e){var r=t.type;return r&&(r.release&&r.release(t.resolvedValue,r,this.component),r.transform)?r.transform(e,r,this.component):e}},{key:"_createAsyncPropData",value:function(t,e){if(!this.asyncProps[t]){var r=this.component&&this.component.constructor._propTypes;this.asyncProps[t]={type:r&&r[t],lastValue:null,resolvedValue:e,pendingLoadCount:0,resolvedLoadCount:0}}}}]),t}();function kt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Rt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?kt(Object(r),!0).forEach((function(e){g()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):kt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var Lt=H.b.ASYNC_ORIGINAL,jt=H.b.ASYNC_RESOLVED,Dt=H.b.ASYNC_DEFAULTS,Bt=0,Ft=function(){function t(){a()(this,t),this.props=gt.apply(this,arguments),this.id=this.props.id,this.count=Bt++,this.lifecycle=H.a.NO_STATE,this.parent=null,this.context=null,this.state=null,this.internalState=null,Object.seal(this)}return u()(t,[{key:"clone",value:function(t){var e=this.props,r={};for(var n in e[Dt])n in e[jt]?r[n]=e[jt][n]:n in e[Lt]&&(r[n]=e[Lt][n]);return new this.constructor(Rt(Rt(Rt({},e),r),t))}},{key:"_initState",value:function(){this.internalState=new It({})}},{key:"root",get:function(){for(var t=this;t.parent;)t=t.parent;return t}},{key:"stats",get:function(){return this.internalState.stats}}]),t}();function zt(t){var e=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(t){return!1}}();return function(){var r,n=d()(t);if(e){var i=d()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return f()(this,r)}}Ft.componentName="Component",Ft.defaultProps={};var Nt=function(t){l()(r,t);var e=zt(r);function r(t){var n,i=t.attributeManager,o=t.layer;return a()(this,r),(n=e.call(this,o)).attributeManager=i,n.model=null,n.needsRedraw=!0,n.subLayers=null,n.usesPickingColorCache=!1,n}return u()(r,[{key:"layer",get:function(){return this.component},set:function(t){this.component=t}}]),r}(It),Ut=r(22),Vt=r(206);function Gt(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Wt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Wt(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Wt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ht(t){var e=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(t){return!1}}();return function(){var r,n=d()(t);if(e){var i=d()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return f()(this,r)}}function qt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Zt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?qt(Object(r),!0).forEach((function(e){g()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):qt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}r.d(e,"a",(function(){return Jt}));var Xt=Math.pow(2,24)-1,Qt=Object.freeze([]),Yt=Object(U.a)((function(t){var e=t.oldViewport,r=t.viewport;return e.equals(r)})),Kt=new Uint8ClampedArray(0),$t={data:{type:"data",value:Qt,async:!0},dataComparator:null,_dataDiff:{type:"function",value:function(t){return t&&t.__diff},compare:!1,optional:!0},dataTransform:{type:"function",value:null,compare:!1,optional:!0},onDataLoad:{type:"function",value:null,compare:!1,optional:!0},onError:{type:"function",value:null,compare:!1,optional:!0},fetch:{type:"function",value:function(t,e){var r,n=e.propName,i=e.layer,o=e.loaders,a=e.loadOptions,s=e.signal,u=i.context.resourceManager;(a=a||i.getLoadOptions(),o=o||i.props.loaders,s)&&(a=Zt(Zt({},a),{},{fetch:Zt(Zt({},null===(r=a)||void 0===r?void 0:r.fetch),{},{signal:s})}));var c=u.contains(t);return c||a||(u.add({resourceId:t,data:Object(Vt.a)(t,o),persistent:!1}),c=!0),c?u.subscribe({resourceId:t,onChange:function(t){return i.internalState.reloadAsyncProp(n,t)},consumerId:i.id,requestId:n}):Object(Vt.a)(t,o,a)},compare:!1},updateTriggers:{},visible:!0,pickable:!1,opacity:{type:"number",min:0,max:1,value:1},onHover:{type:"function",value:null,compare:!1,optional:!0},onClick:{type:"function",value:null,compare:!1,optional:!0},onDragStart:{type:"function",value:null,compare:!1,optional:!0},onDrag:{type:"function",value:null,compare:!1,optional:!0},onDragEnd:{type:"function",value:null,compare:!1,optional:!0},coordinateSystem:m.a.DEFAULT,coordinateOrigin:{type:"array",value:[0,0,0],compare:!0},modelMatrix:{type:"array",value:null,compare:!0,optional:!0},wrapLongitude:!1,positionFormat:"XYZ",colorFormat:"RGBA",parameters:{},transitions:null,extensions:[],loaders:{type:"array",value:[],optional:!0,compare:!0},getPolygonOffset:{type:"function",value:function(t){return[0,100*-t.layerIndex]},compare:!1},highlightedObjectIndex:-1,autoHighlight:!1,highlightColor:{type:"accessor",value:[0,0,128,128]}},Jt=function(t){l()(r,t);var e=Ht(r);function r(){return a()(this,r),e.apply(this,arguments)}return u()(r,[{key:"toString",value:function(){var t=this.constructor.layerName||this.constructor.name;return"".concat(t,"({id: '").concat(this.props.id,"'})")}},{key:"raiseError",value:function(t,e){var r,n,i,o;(e&&(t.message="".concat(e,": ").concat(t.message)),null===(r=(n=this.props).onError)||void 0===r?void 0:r.call(n,t))||(null===(i=this.context)||void 0===i||null===(o=i.onError)||void 0===o||o.call(i,t,this))}},{key:"setState",value:function(t){this.setChangeFlags({stateChanged:!0}),Object.assign(this.state,t),this.setNeedsRedraw()}},{key:"setNeedsRedraw",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.internalState&&(this.internalState.needsRedraw=t)}},{key:"setNeedsUpdate",value:function(){this.context.layerManager.setNeedsUpdate(String(this)),this.internalState.needsUpdate=!0}},{key:"getNeedsRedraw",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};return this._getNeedsRedraw(t)}},{key:"needsUpdate",value:function(){return this.internalState.needsUpdate||this.hasUniformTransition()||this.shouldUpdateState(this._getUpdateParams())}},{key:"hasUniformTransition",value:function(){return this.internalState.uniformTransitions.active}},{key:"isPickable",value:function(){return this.props.pickable&&this.props.visible}},{key:"getModels",value:function(){return this.state&&(this.state.models||(this.state.model?[this.state.model]:[]))}},{key:"getAttributeManager",value:function(){return this.internalState&&this.internalState.attributeManager}},{key:"getCurrentLayer",value:function(){return this.internalState&&this.internalState.layer}},{key:"getLoadOptions",value:function(){return this.props.loadOptions}},{key:"project",value:function(t){var e=this.context.viewport,r=Object(G.a)(t,{viewport:e,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),n=Object(Ut.p)(r,e.pixelProjectionMatrix),o=i()(n,3),a=o[0],s=o[1],u=o[2];return 2===t.length?[a,s]:[a,s,u]}},{key:"unproject",value:function(t){return this.context.viewport.unproject(t)}},{key:"projectPosition",value:function(t){return Object(G.b)(t,{viewport:this.context.viewport,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem})}},{key:"use64bitPositions",value:function(){var t=this.props.coordinateSystem;return t===m.a.DEFAULT||t===m.a.LNGLAT||t===m.a.CARTESIAN}},{key:"onHover",value:function(t,e){return!!this.props.onHover&&this.props.onHover(t,e)}},{key:"onClick",value:function(t,e){return!!this.props.onClick&&this.props.onClick(t,e)}},{key:"nullPickingColor",value:function(){return[0,0,0]}},{key:"encodePickingColor",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e[0]=t+1&255,e[1]=t+1>>8&255,e[2]=t+1>>8>>8&255,e}},{key:"decodePickingColor",value:function(t){Object(N.a)(t instanceof Uint8Array);var e=i()(t,3);return e[0]+256*e[1]+65536*e[2]-1}},{key:"initializeState",value:function(){throw new Error("Layer ".concat(this," has not defined initializeState"))}},{key:"getShaders",value:function(t){var e,r=Gt(this.props.extensions);try{for(r.s();!(e=r.n()).done;){var n=e.value;t=Object(V.a)(t,n.getShaders.call(this,n))}}catch(t){r.e(t)}finally{r.f()}return t}},{key:"shouldUpdateState",value:function(t){t.oldProps,t.props,t.context;return t.changeFlags.propsOrDataChanged}},{key:"updateState",value:function(t){var e=t.oldProps,r=t.props,n=(t.context,t.changeFlags),i=this.getAttributeManager();if(n.dataChanged&&i){var o=n.dataChanged;if(Array.isArray(o)){var a,s=Gt(o);try{for(s.s();!(a=s.n()).done;){var u=a.value;i.invalidateAll(u)}}catch(t){s.e(t)}finally{s.f()}}else i.invalidateAll()}var c=e.highlightedObjectIndex>=0||e.pickable,l=r.highlightedObjectIndex>=0||r.pickable;if(c!==l&&i){var h=i.attributes,f=h.pickingColors,p=h.instancePickingColors,d=f||p;d&&(l&&d.constant&&(d.constant=!1,i.invalidate(d.id)),d.value||l||(d.constant=!0,d.value=[0,0,0]))}}},{key:"finalizeState",value:function(){var t,e=Gt(this.getModels());try{for(e.s();!(t=e.n()).done;){t.value.delete()}}catch(t){e.e(t)}finally{e.f()}var r=this.getAttributeManager();r&&r.finalize(),this.context.resourceManager.unsubscribe({consumerId:this.id}),this.internalState.uniformTransitions.clear(),this.internalState.finalize()}},{key:"draw",value:function(t){var e,r=Gt(this.getModels());try{for(r.s();!(e=r.n()).done;){e.value.draw(t)}}catch(t){r.e(t)}finally{r.f()}}},{key:"getPickingInfo",value:function(t){var e=t.info,r=(t.mode,e.index);return r>=0&&Array.isArray(this.props.data)&&(e.object=this.props.data[r]),e}},{key:"activateViewport",value:function(t){var e=this.internalState.viewport;this.internalState.viewport=t,e&&Yt({oldViewport:e,viewport:t})||(this.setChangeFlags({viewportChanged:!0}),this.isComposite?this.needsUpdate()&&this.setNeedsUpdate():this._update())}},{key:"invalidateAttribute",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all",e=(arguments.length>1&&void 0!==arguments[1]&&arguments[1],this.getAttributeManager());e&&("all"===t?e.invalidateAll():e.invalidate(t))}},{key:"updateAttributes",value:function(t){var e,r=Gt(this.getModels());try{for(r.s();!(e=r.n()).done;){var n=e.value;this._setModelAttributes(n,t)}}catch(t){r.e(t)}finally{r.f()}}},{key:"_updateAttributes",value:function(t){var e=this.getAttributeManager();if(e){var r=this.getNumInstances(t),n=this.getStartIndices(t);e.update({data:t.data,numInstances:r,startIndices:n,props:t,transitions:t.transitions,buffers:t.data.attributes,context:this,ignoreUnknownAttributes:!0});var i=e.getChangedAttributes({clearChangedFlags:!0});this.updateAttributes(i)}}},{key:"_updateAttributeTransition",value:function(){var t=this.getAttributeManager();t&&t.updateTransition()}},{key:"_updateUniformTransition",value:function(){var t=this.internalState.uniformTransitions;if(t.active){var e=t.update(),r=Object.create(this.props);for(var n in e)Object.defineProperty(r,n,{value:e[n]});return r}return this.props}},{key:"calculateInstancePickingColors",value:function(t,e){var r=e.numInstances;if(!t.constant){var n=Math.floor(Kt.length/3);if(this.internalState.usesPickingColorCache=!0,n<r){r>Xt&&P.a.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),Kt=W.a.allocate(Kt,r,{size:3,copy:!0,maxCount:Math.max(r,Xt)});for(var i=Math.floor(Kt.length/3),o=[],a=n;a<i;a++)this.encodePickingColor(a,o),Kt[3*a+0]=o[0],Kt[3*a+1]=o[1],Kt[3*a+2]=o[2]}t.value=Kt.subarray(0,3*r)}}},{key:"_setModelAttributes",value:function(t,e){var r=this.getAttributeManager(),n=t.userData.excludeAttributes||{},i=r.getShaderAttributes(e,n);t.setAttributes(i)}},{key:"disablePickingIndex",value:function(t){this._disablePickingIndex(t)}},{key:"_disablePickingIndex",value:function(t){var e=this.getAttributeManager().attributes,r=e.pickingColors,n=e.instancePickingColors,i=r||n,o=i.getVertexOffset(t),a=i.getVertexOffset(t+1);i.buffer.subData({data:new Uint8Array(a-o),offset:o})}},{key:"restorePickingColors",value:function(){var t=this.getAttributeManager().attributes,e=t.pickingColors,r=t.instancePickingColors,n=e||r;this.internalState.usesPickingColorCache&&n.value.buffer!==Kt.buffer&&(n.value=Kt.subarray(0,n.value.length)),n.updateSubBuffer({startOffset:0})}},{key:"getNumInstances",value:function(t){return void 0!==(t=t||this.props).numInstances?t.numInstances:this.state&&void 0!==this.state.numInstances?this.state.numInstances:Object(B.a)(t.data)}},{key:"getStartIndices",value:function(t){return void 0!==(t=t||this.props).startIndices?t.startIndices:this.state&&this.state.startIndices?this.state.startIndices:null}},{key:"_initialize",value:function(){Object(F.a)("layer.initialize",this),this._initState(),this.initializeState(this.context);var t,e=Gt(this.props.extensions);try{for(e.s();!(t=e.n()).done;){var r=t.value;r.initializeState.call(this,this.context,r)}}catch(t){e.e(t)}finally{e.f()}this.setChangeFlags({dataChanged:!0,propsChanged:!0,viewportChanged:!0,extensionsChanged:!0}),this._updateState()}},{key:"_update",value:function(){var t=this.needsUpdate();Object(F.a)("layer.update",this,t),t&&this._updateState()}},{key:"_updateState",value:function(){var t=this.props,e=this.context.viewport,r=this._updateUniformTransition();this.internalState.propsInTransition=r,this.context.viewport=this.internalState.viewport||e,this.props=r;try{var n=this._getUpdateParams(),i=this.getModels();if(this.context.gl)this.updateState(n);else try{this.updateState(n)}catch(t){}var o,a=Gt(this.props.extensions);try{for(a.s();!(o=a.n()).done;){var s=o.value;s.updateState.call(this,n,s)}}catch(t){a.e(t)}finally{a.f()}var u=this.getModels()[0]!==i[0];this._updateModules(n,u),this.isComposite?this._renderLayers(n):(this.setNeedsRedraw(),this._updateAttributes(this.props),this.state.model&&this.state.model.setInstanceCount(this.getNumInstances()))}finally{this.context.viewport=e,this.props=t,this.clearChangeFlags(),this.internalState.needsUpdate=!1,this.internalState.resetOldProps()}}},{key:"_finalize",value:function(){Object(F.a)("layer.finalize",this),this.finalizeState(this.context);var t,e=Gt(this.props.extensions);try{for(e.s();!(t=e.n()).done;){var r=t.value;r.finalizeState.call(this,r)}}catch(t){e.e(t)}finally{e.f()}}},{key:"drawLayer",value:function(t){var e=this,r=t.moduleParameters,n=void 0===r?null:r,i=t.uniforms,o=void 0===i?{}:i,a=t.parameters,s=void 0===a?{}:a;this._updateAttributeTransition();var u=this.props;this.props=this.internalState.propsInTransition||u;var c=this.props.opacity;o.opacity=Math.pow(c,1/2.2);try{n&&this.setModuleParameters(n);var l=this.props.getPolygonOffset,h=l&&l(o)||[0,0];Object(z.n)(this.context.gl,{polygonOffset:h}),Object(z.o)(this.context.gl,s,(function(){var t,r={moduleParameters:n,uniforms:o,parameters:s,context:e.context},i=Gt(e.props.extensions);try{for(i.s();!(t=i.n()).done;){var a=t.value;a.draw.call(e,r,a)}}catch(t){i.e(t)}finally{i.f()}e.draw(r)}))}finally{this.props=u}}},{key:"getChangeFlags",value:function(){return this.internalState.changeFlags}},{key:"setChangeFlags",value:function(t){var e=this.internalState.changeFlags;for(var r in t)if(t[r]){var n=!1;switch(r){case"dataChanged":Array.isArray(e[r])&&(e[r]=Array.isArray(t[r])?e[r].concat(t[r]):t[r],n=!0);default:e[r]||(e[r]=t[r],n=!0)}n&&Object(F.a)("layer.changeFlag",this,r,t)}var i=e.dataChanged||e.updateTriggersChanged||e.propsChanged||e.extensionsChanged;e.propsOrDataChanged=i,e.somethingChanged=i||t.viewportChanged||t.stateChanged}},{key:"clearChangeFlags",value:function(){this.internalState.changeFlags={dataChanged:!1,propsChanged:!1,updateTriggersChanged:!1,viewportChanged:!1,stateChanged:!1,extensionsChanged:!1,propsOrDataChanged:!1,somethingChanged:!1}}},{key:"diffProps",value:function(t,e){var r=Object(D.b)(t,e);if(r.updateTriggersChanged)for(var n in r.updateTriggersChanged)r.updateTriggersChanged[n]&&this.invalidateAttribute(n);if(r.transitionsChanged)for(var i in r.transitionsChanged)this.internalState.uniformTransitions.add(i,e[i],t[i],t.transitions[i]);return this.setChangeFlags(r)}},{key:"validateProps",value:function(){Object(D.c)(this.props)}},{key:"setModuleParameters",value:function(t){var e,r=Gt(this.getModels());try{for(r.s();!(e=r.n()).done;){e.value.updateModuleSettings(t)}}catch(t){r.e(t)}finally{r.f()}}},{key:"updateAutoHighlight",value:function(t){this.props.autoHighlight&&this._updateAutoHighlight(t)}},{key:"_updateAutoHighlight",value:function(t){var e={pickingSelectedColor:t.picked?t.color:null},r=this.props.highlightColor;t.picked&&"function"==typeof r&&(e.pickingHighlightColor=r(t)),this.setModuleParameters(e),this.setNeedsRedraw()}},{key:"_updateModules",value:function(t,e){var r=t.props,n=t.oldProps,i=r.autoHighlight,o=r.highlightedObjectIndex,a=r.highlightColor;if(e||n.autoHighlight!==i||n.highlightedObjectIndex!==o||n.highlightColor!==a){var s={};i||(s.pickingSelectedColor=null),Array.isArray(a)&&(s.pickingHighlightColor=a),Number.isInteger(o)&&(s.pickingSelectedColor=o>=0?this.encodePickingColor(o):null),this.setModuleParameters(s)}}},{key:"_getUpdateParams",value:function(){return{props:this.props,oldProps:this.internalState.getOldProps(),context:this.context,changeFlags:this.internalState.changeFlags}}},{key:"_getNeedsRedraw",value:function(t){if(!this.internalState)return!1;var e=!1;e=e||this.internalState.needsRedraw&&this.id,this.internalState.needsRedraw=this.internalState.needsRedraw&&!t.clearRedrawFlags;var r=this.getAttributeManager(),n=r&&r.getNeedsRedraw(t);return e=e||n}},{key:"_getAttributeManager",value:function(){return new y.a(this.context.gl,{id:this.props.id,stats:this.context.stats,timeline:this.context.timeline})}},{key:"_initState",value:function(){Object(N.a)(!this.internalState&&!this.state),Object(N.a)(isFinite(this.props.coordinateSystem));var t=this._getAttributeManager();t&&t.addInstanced({instancePickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new Nt({attributeManager:t,layer:this}),this.clearChangeFlags(),this.state={},Object.defineProperty(this.state,"attributeManager",{get:function(){return P.a.deprecated("layer.state.attributeManager","layer.getAttributeManager()"),t}}),this.internalState.layer=this,this.internalState.uniformTransitions=new j(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props)}},{key:"_transferState",value:function(t){Object(F.a)("layer.matched",this,this===t);var e=t.state,r=t.internalState;this!==t&&(this.internalState=r,this.internalState.layer=this,this.state=e,this.internalState.setAsyncProps(this.props),this.diffProps(this.props,this.internalState.getOldProps()))}},{key:"_onAsyncPropUpdated",value:function(){this.diffProps(this.props,this.internalState.getOldProps()),this.setNeedsUpdate()}},{key:"isLoaded",get:function(){return this.internalState&&!this.internalState.isAsyncPropLoading()}},{key:"wrapLongitude",get:function(){return this.props.wrapLongitude}}]),r}(Ft);Jt.layerName="Layer",Jt.defaultProps=$t},function(t,e,r){"use strict";var n=r(0),i=r.n(n),o=r(2),a=r.n(o),s=r(3),u=r.n(s),c=r(10),l=r.n(c),h=r(8),f=r.n(h),p=r(5),d=r.n(p),A=r(6),g=r.n(A),m=r(1),y=r.n(m),v=r(240),_=r(179),b=r(34);function x(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function w(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?x(Object(r),!0).forEach((function(e){i()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var E=function(){function t(e,r){a()(this,t),this.opts=r,this.source=e}return u()(t,[{key:"getValue",value:function(){var t=this.source.getBuffer(),e=this.getAccessor();if(t)return[t,e];var r=this.source.value,n=e.size,i=r;if(r&&r.length!==n){i=new Float32Array(n);for(var o=e.elementOffset||0,a=0;a<n;++a)i[a]=r[o+a]}return i}},{key:"getAccessor",value:function(){return w(w({},this.source.getAccessor()),this.opts)}},{key:"value",get:function(){return this.source.value}}]),t}();var S=r(67),O=r(35),T=r(18);function P(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function M(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?P(Object(r),!0).forEach((function(e){i()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):P(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function C(t){return t.stride||t.size*t.bytesPerElement}function I(t,e){e.offset&&T.a.removed("shaderAttribute.offset","vertexOffset, elementOffset")();var r=C(t),n=("vertexOffset"in e?e.vertexOffset:t.vertexOffset||0)*r+(e.elementOffset||0)*t.bytesPerElement+(t.offset||0);return M(M({},e),{},{offset:n,stride:r})}var k=function(){function t(e,r){a()(this,t),this.gl=e,this.id=r.id,this.size=r.size;var n=r.logicalType||r.type,i=5130===n,o=r.defaultValue;o=Number.isFinite(o)?[o]:o||new Array(this.size).fill(0),r.defaultValue=o;var s=n;i?s=5126:!s&&r.isIndexed?s=e&&Object(v.b)(e,_.a.ELEMENT_INDEX_UINT32)?5125:5123:s||(s=5126),r.logicalType=n,r.type=s;var u=function(t){switch(t){case 5126:return Float32Array;case 5130:return Float64Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return Uint8ClampedArray;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Unknown GL type")}}(n||s||5126);this.shaderAttributes={},this.doublePrecision=i,i&&!1===r.fp64&&(u=Float32Array),r.bytesPerElement=u.BYTES_PER_ELEMENT,this.defaultType=u,this.value=null,this.settings=r,this.state={externalBuffer:null,bufferAccessor:r,allocatedValue:null,constant:!1},this._buffer=null,this.setData(r)}return u()(t,[{key:"delete",value:function(){this._buffer&&(this._buffer.delete(),this._buffer=null),S.a.release(this.state.allocatedValue)}},{key:"getShaderAttributes",value:function(t,e){if(this.doublePrecision){var r={},n=this.value instanceof Float64Array,o=(a=this.getAccessor(),{high:s=I(a,e||{}),low:M(M({},s),{},{offset:s.offset+4*a.size})});return r[t]=new E(this,o.high),r["".concat(t,"64Low")]=n?new E(this,o.low):new Float32Array(this.size),r}var a,s;if(e){var u=I(this.getAccessor(),e);return i()({},t,new E(this,u))}return i()({},t,this)}},{key:"getBuffer",value:function(){return this.state.constant?null:this.state.externalBuffer||this._buffer}},{key:"getValue",value:function(){return this.state.constant?this.value:[this.getBuffer(),this.getAccessor()]}},{key:"getAccessor",value:function(){return this.state.bufferAccessor}},{key:"setData",value:function(t){var e=this.state;ArrayBuffer.isView(t)?t={value:t}:t instanceof b.a&&(t={buffer:t});var r=M(M({},this.settings),t);if(e.bufferAccessor=r,t.constant){var n=t.value;if(n=this._normalizeValue(n,[],0),this.settings.normalized&&(n=this._normalizeConstant(n)),!(!e.constant||!this._areValuesEqual(n,this.value)))return!1;e.externalBuffer=null,e.constant=!0,this.value=n}else if(t.buffer){var i=t.buffer;e.externalBuffer=i,e.constant=!1,this.value=t.value;var o=t.value instanceof Float64Array;r.type=t.type||i.accessor.type,r.bytesPerElement=i.accessor.BYTES_PER_ELEMENT*(o?2:1),r.stride=C(r)}else if(t.value){this._checkExternalBuffer(t);var a=t.value;e.externalBuffer=null,e.constant=!1,this.value=a,r.bytesPerElement=a.BYTES_PER_ELEMENT,r.stride=C(r);var s=this.buffer,u=this.byteOffset;this.doublePrecision&&a instanceof Float64Array&&(a=Object(O.f)(a,r));var c=a.byteLength+u+2*r.stride;s.byteLength<c&&s.reallocate(c),s.setAccessor(null),s.subData({data:a,offset:u}),r.type=t.type||s.accessor.type}return!0}},{key:"updateSubBuffer",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.value,r=t.startOffset,n=void 0===r?0:r,i=t.endOffset;this.buffer.subData({data:this.doublePrecision&&e instanceof Float64Array?Object(O.f)(e,{size:this.size,startIndex:n,endIndex:i}):e.subarray(n,i),offset:n*e.BYTES_PER_ELEMENT+this.byteOffset})}},{key:"allocate",value:function(t){var e=t.numInstances,r=t.copy,n=void 0!==r&&r,i=this.state,o=i.allocatedValue,a=S.a.allocate(o,e+1,{size:this.size,type:this.defaultType,copy:n});this.value=a;var s=this.buffer,u=this.byteOffset;return s.byteLength<a.byteLength+u&&(s.reallocate(a.byteLength+u),n&&o&&s.subData({data:o instanceof Float64Array?Object(O.f)(o,this):o,offset:u})),i.allocatedValue=a,i.constant=!1,i.externalBuffer=null,i.bufferAccessor=this.settings,!0}},{key:"_checkExternalBuffer",value:function(t){var e=t.value;if(!t.constant&&e){var r=this.defaultType,n=!1;if(this.doublePrecision&&(n=e.BYTES_PER_ELEMENT<4),n)throw new Error("Attribute ".concat(this.id," does not support ").concat(e.constructor.name));e instanceof r||!this.settings.normalized||"normalized"in t||T.a.warn("Attribute ".concat(this.id," is normalized"))()}}},{key:"_normalizeConstant",value:function(t){switch(this.settings.type){case 5120:return new Float32Array(t).map((function(t){return(t+128)/255*2-1}));case 5122:return new Float32Array(t).map((function(t){return(t+32768)/65535*2-1}));case 5121:return new Float32Array(t).map((function(t){return t/255}));case 5123:return new Float32Array(t).map((function(t){return t/65535}));default:return t}}},{key:"_normalizeValue",value:function(t,e,r){var n=this.settings,i=n.defaultValue,o=n.size;if(Number.isFinite(t))return e[r]=t,e;if(!t)return e[r]=i[0],e;switch(o){case 4:e[r+3]=Number.isFinite(t[3])?t[3]:i[3];case 3:e[r+2]=Number.isFinite(t[2])?t[2]:i[2];case 2:e[r+1]=Number.isFinite(t[1])?t[1]:i[1];case 1:e[r+0]=Number.isFinite(t[0])?t[0]:i[0];break;default:for(var a=o;--a>=0;)e[r+a]=Number.isFinite(t[a])?t[a]:i[a]}return e}},{key:"_areValuesEqual",value:function(t,e){if(!t||!e)return!1;for(var r=this.size,n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}},{key:"buffer",get:function(){if(!this._buffer){var t=this.settings,e=t.isIndexed,r=t.type;this._buffer=new b.a(this.gl,{id:this.id,target:e?34963:34962,accessor:{type:r}})}return this._buffer}},{key:"byteOffset",get:function(){var t=this.getAccessor();return t.vertexOffset?t.vertexOffset*C(t):0}}]),t}(),R=r(37),L=r(53),j=r(66),D=[],B=[[0,1/0]];function F(t,e){if(t===B)return t;if(e[0]<0&&(e[0]=0),e[0]>=e[1])return t;for(var r=[],n=t.length,i=0,o=0;o<n;o++){var a=t[o];a[1]<e[0]?(r.push(a),i=o+1):a[0]>e[1]?r.push(a):e=[Math.min(a[0],e[0]),Math.max(a[1],e[1])]}return r.splice(i,0,e),r}var z=r(46);function N(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return U(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return U(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function U(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function V(t){var e=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(t){return!1}}();return function(){var r,n=y()(t);if(e){var i=y()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return g()(this,r)}}var G=function(t){d()(r,t);var e=V(r);function r(t){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};a()(this,r),n=e.call(this,t,i);var o=i.transition,s=void 0!==o&&o,u=i.noAlloc,c=void 0!==u&&u,l=i.update,h=void 0===l?null:l,f=i.accessor,p=void 0===f?null:f,d=i.transform,A=void 0===d?null:d,g=i.startIndices,m=void 0===g?null:g;return Object.assign(n.settings,{transition:s,noAlloc:c,update:h||p&&n._autoUpdater,accessor:p,transform:A}),Object.assign(n.state,{lastExternalBuffer:null,binaryValue:null,binaryAccessor:null,needsUpdate:!0,needsRedraw:!1,updateRanges:B,startIndices:m}),Object.seal(n.settings),Object.seal(n.state),n._validateAttributeUpdaters(),n}return u()(r,[{key:"needsUpdate",value:function(){return this.state.needsUpdate}},{key:"needsRedraw",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.clearChangedFlags,r=void 0!==e&&e,n=this.state.needsRedraw;return this.state.needsRedraw=n&&!r,n}},{key:"getUpdateTriggers",value:function(){var t=this.settings.accessor;return[this.id].concat("function"!=typeof t&&t||[])}},{key:"supportsTransition",value:function(){return Boolean(this.settings.transition)}},{key:"getTransitionSetting",value:function(t){if(!t||!this.supportsTransition())return null;var e=this.settings.accessor,r=this.settings.transition,n=Array.isArray(e)?t[e.find((function(e){return t[e]}))]:t[e];return Object(z.e)(n,r)}},{key:"setNeedsUpdate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.id,e=arguments.length>1?arguments[1]:void 0;if(this.state.needsUpdate=this.state.needsUpdate||t,this.setNeedsRedraw(t),e){var r=e.startRow,n=void 0===r?0:r,i=e.endRow,o=void 0===i?1/0:i;this.state.updateRanges=F(this.state.updateRanges,[n,o])}else this.state.updateRanges=B}},{key:"clearNeedsUpdate",value:function(){this.state.needsUpdate=!1,this.state.updateRanges=D}},{key:"setNeedsRedraw",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.id;this.state.needsRedraw=this.state.needsRedraw||t}},{key:"update",value:function(t){this.setData(t)}},{key:"allocate",value:function(t){var e=this.state,n=this.settings;return!n.noAlloc&&(!!n.update&&(f()(y()(r.prototype),"allocate",this).call(this,{numInstances:t,copy:e.updateRanges!==B}),!0))}},{key:"updateBuffer",value:function(t){var e=t.numInstances,n=t.data,i=t.props,o=t.context;if(!this.needsUpdate())return!1;var a=this.state.updateRanges,s=this.settings,u=s.update,c=s.noAlloc,h=!0;if(u){var p,d=N(a);try{for(d.s();!(p=d.n()).done;){var A=l()(p.value,2),g=A[0],m=A[1];u.call(o,this,{data:n,startRow:g,endRow:m,props:i,numInstances:e})}}catch(t){d.e(t)}finally{d.f()}if(this.value)if(this.constant||this.buffer.byteLength<this.value.byteLength+this.byteOffset)this.setData({value:this.value,constant:this.constant}),this.constant=!1;else{var v,_=N(a);try{for(_.s();!(v=_.n()).done;){var b=l()(v.value,2),x=b[0],w=b[1],E=Number.isFinite(x)?this.getVertexOffset(x):0,S=Number.isFinite(w)?this.getVertexOffset(w):c||!Number.isFinite(e)?this.value.length:e*this.size;f()(y()(r.prototype),"updateSubBuffer",this).call(this,{startOffset:E,endOffset:S})}}catch(t){_.e(t)}finally{_.f()}}else;this._checkAttributeArray()}else h=!1;return this.clearNeedsUpdate(),this.setNeedsRedraw(),h}},{key:"setConstantValue",value:function(t){return void 0!==t&&"function"!=typeof t&&(this.setData({constant:!0,value:t})&&this.setNeedsRedraw(),this.clearNeedsUpdate(),!0)}},{key:"setExternalBuffer",value:function(t){var e=this.state;return t?(this.clearNeedsUpdate(),e.lastExternalBuffer===t||(e.lastExternalBuffer=t,this.setNeedsRedraw(),this.setData(t),!0)):(e.lastExternalBuffer=null,!1)}},{key:"setBinaryValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=this.state,n=this.settings;if(!t)return r.binaryValue=null,r.binaryAccessor=null,!1;if(n.noAlloc)return!1;if(r.binaryValue===t)return this.clearNeedsUpdate(),!0;r.binaryValue=t,this.setNeedsRedraw(),ArrayBuffer.isView(t)&&(t={value:t});var i=n.transform||e!==this.startIndices;if(i){Object(R.a)(ArrayBuffer.isView(t.value),"invalid ".concat(n.accessor));var o=t.size&&t.size!==this.size;return r.binaryAccessor=Object(L.b)(t.value,{size:t.size||this.size,stride:t.stride,offset:t.offset,startIndices:e,nested:o}),!1}return this.clearNeedsUpdate(),this.setData(t),!0}},{key:"getVertexOffset",value:function(t){var e=this.startIndices;return(e?e[t]:t)*this.size}},{key:"getShaderAttributes",value:function(){var t=this.settings.shaderAttributes||i()({},this.id,null),e={};for(var n in t)Object.assign(e,f()(y()(r.prototype),"getShaderAttributes",this).call(this,n,t[n]));return e}},{key:"_autoUpdater",value:function(t,e){var r=e.data,n=e.startRow,i=e.endRow,o=e.props,a=e.numInstances;if(!t.constant){var s=t.settings,u=t.state,c=t.value,l=t.size,h=t.startIndices,f=s.accessor,p=s.transform,d=u.binaryAccessor||("function"==typeof f?f:o[f]);Object(R.a)("function"==typeof d,'accessor "'.concat(f,'" is not a function'));var A,g=t.getVertexOffset(n),m=Object(L.a)(r,n,i),y=m.iterable,v=m.objectInfo,_=N(y);try{for(_.s();!(A=_.n()).done;){var b=A.value;v.index++;var x=d(b,v);if(p&&(x=p.call(this,x)),h){var w=(v.index<h.length-1?h[v.index+1]:a)-h[v.index];if(x&&Array.isArray(x[0])){var E,S=g,O=N(x);try{for(O.s();!(E=O.n()).done;){var T=E.value;t._normalizeValue(T,c,S),S+=l}}catch(t){O.e(t)}finally{O.f()}}else x&&x.length>l?c.set(x,g):(t._normalizeValue(x,v.target,0),Object(j.a)({target:c,source:v.target,start:g,count:w}));g+=w*l}else t._normalizeValue(x,c,g),g+=l}}catch(t){_.e(t)}finally{_.f()}}}},{key:"_validateAttributeUpdaters",value:function(){var t=this.settings;if(!(t.noAlloc||"function"==typeof t.update))throw new Error("Attribute ".concat(this.id," missing update or accessor"))}},{key:"_checkAttributeArray",value:function(){var t=this.value,e=Math.min(4,this.size);if(t&&t.length>=e){var r=!0;switch(e){case 4:r=r&&Number.isFinite(t[3]);case 3:r=r&&Number.isFinite(t[2]);case 2:r=r&&Number.isFinite(t[1]);case 1:r=r&&Number.isFinite(t[0]);break;default:r=!1}if(!r)throw new Error("Illegal attribute generated for ".concat(this.id))}}},{key:"startIndices",get:function(){return this.state.startIndices},set:function(t){this.state.startIndices=t}}]),r}(k),W=r(32),H=r(294),q=r(73);function Z(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function X(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Z(Object(r),!0).forEach((function(e){i()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Z(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Q(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Y(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Y(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Y(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var K=function(){function t(e){var r=e.gl,n=e.attribute,i=e.timeline;a()(this,t),this.gl=r,this.type="interpolation",this.transition=new q.a(i),this.attribute=n,this.attributeInTransition=new G(r,n.settings),this.currentStartIndices=n.startIndices,this.currentLength=0,this.transform=function(t,e){var r=Object(z.c)(e.size);return new H.a(t,{vs:"\n#define SHADER_NAME interpolation-transition-vertex-shader\n\nuniform float time;\nattribute ATTRIBUTE_TYPE aFrom;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vCurrent;\n\nvoid main(void) {\n vCurrent = mix(aFrom, aTo, time);\n gl_Position = vec4(0.0);\n}\n",defines:{ATTRIBUTE_TYPE:r},varyings:["vCurrent"]})}(r,n);var o={byteLength:0,usage:35050};this.buffers=[new b.a(r,o),new b.a(r,o)]}return u()(t,[{key:"start",value:function(t,e){if(t.duration<=0)this.transition.cancel();else{var r=this.gl,n=this.buffers,i=this.attribute;Object(z.a)(n);var o,a={numInstances:e,attribute:i,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:t.enter},s=Q(n);try{for(s.s();!(o=s.n()).done;){var u=o.value;Object(z.f)(X({buffer:u},a))}}catch(t){s.e(t)}finally{s.f()}this.currentStartIndices=i.startIndices,this.currentLength=Object(z.b)(i,e),this.attributeInTransition.update({buffer:n[1],value:i.value}),this.transition.start(t),this.transform.update({elementCount:Math.floor(this.currentLength/i.size),sourceBuffers:{aFrom:n[0],aTo:Object(z.d)(r,i)},feedbackBuffers:{vCurrent:n[1]}})}}},{key:"update",value:function(){var t=this.transition.update();if(t){var e=this.transition,r=e.time,n=e.settings,i=n.duration,o=(0,n.easing)(r/i);this.transform.run({uniforms:{time:o}})}return t}},{key:"cancel",value:function(){for(this.transition.cancel(),this.transform.delete();this.buffers.length;)this.buffers.pop().delete()}},{key:"inProgress",get:function(){return this.transition.inProgress}}]),t}();var $=r(197),J=r(98),tt=r(71);function et(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return rt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return rt(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function rt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function nt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function it(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?nt(Object(r),!0).forEach((function(e){i()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):nt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var ot={interpolation:K,spring:function(){function t(e){var r=e.gl,n=e.attribute,o=e.timeline;a()(this,t),this.gl=r,this.type="spring",this.transition=new q.a(o),this.attribute=n,this.attributeInTransition=new G(r,it(it({},n.settings),{},{normalized:!1})),this.currentStartIndices=n.startIndices,this.currentLength=0,this.texture=function(t){return new J.a(t,{data:new Uint8Array(4),format:6408,type:5121,border:0,mipmaps:!1,dataFormat:6408,width:1,height:1})}(r),this.framebuffer=function(t,e){return new tt.a(t,{id:"spring-transition-is-transitioning-framebuffer",width:1,height:1,attachments:i()({},36064,e)})}(r,this.texture),this.transform=function(t,e,r){var n=Object(z.c)(e.size);return new H.a(t,{framebuffer:r,vs:"\n#define SHADER_NAME spring-transition-vertex-shader\n\n#define EPSILON 0.00001\n\nuniform float stiffness;\nuniform float damping;\nattribute ATTRIBUTE_TYPE aPrev;\nattribute ATTRIBUTE_TYPE aCur;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vNext;\nvarying float vIsTransitioningFlag;\n\nATTRIBUTE_TYPE getNextValue(ATTRIBUTE_TYPE cur, ATTRIBUTE_TYPE prev, ATTRIBUTE_TYPE dest) {\n ATTRIBUTE_TYPE velocity = cur - prev;\n ATTRIBUTE_TYPE delta = dest - cur;\n ATTRIBUTE_TYPE spring = delta * stiffness;\n ATTRIBUTE_TYPE damper = velocity * -1.0 * damping;\n return spring + damper + velocity + cur;\n}\n\nvoid main(void) {\n bool isTransitioning = length(aCur - aPrev) > EPSILON || length(aTo - aCur) > EPSILON;\n vIsTransitioningFlag = isTransitioning ? 1.0 : 0.0;\n\n vNext = getNextValue(aCur, aPrev, aTo);\n gl_Position = vec4(0, 0, 0, 1);\n gl_PointSize = 100.0;\n}\n",fs:"\n#define SHADER_NAME spring-transition-is-transitioning-fragment-shader\n\nvarying float vIsTransitioningFlag;\n\nvoid main(void) {\n if (vIsTransitioningFlag == 0.0) {\n discard;\n }\n gl_FragColor = vec4(1.0);\n}",defines:{ATTRIBUTE_TYPE:n},varyings:["vNext"]})}(r,n,this.framebuffer);var s={byteLength:0,usage:35050};this.buffers=[new b.a(r,s),new b.a(r,s),new b.a(r,s)]}return u()(t,[{key:"start",value:function(t,e){var r,n=this.gl,i=this.buffers,o=this.attribute,a={numInstances:e,attribute:o,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:t.enter},s=et(i);try{for(s.s();!(r=s.n()).done;){var u=r.value;Object(z.f)(it({buffer:u},a))}}catch(t){s.e(t)}finally{s.f()}this.currentStartIndices=o.startIndices,this.currentLength=Object(z.b)(o,e),this.attributeInTransition.update({buffer:i[1],value:o.value}),this.transition.start(t),this.transform.update({elementCount:Math.floor(this.currentLength/o.size),sourceBuffers:{aTo:Object(z.d)(n,o)}})}},{key:"update",value:function(){var t=this.buffers,e=this.transform,r=this.framebuffer,n=this.transition;return!!n.update()&&(e.update({sourceBuffers:{aPrev:t[0],aCur:t[1]},feedbackBuffers:{vNext:t[2]}}),e.run({framebuffer:r,discard:!1,clearRenderTarget:!0,uniforms:{stiffness:n.settings.stiffness,damping:n.settings.damping},parameters:{depthTest:!1,blend:!0,viewport:[0,0,1,1],blendFunc:[1,1],blendEquation:[32776,32776]}}),Object(z.a)(t),this.attributeInTransition.update({buffer:t[1],value:this.attribute.value}),Object($.c)(r)[0]>0||n.end(),!0)}},{key:"cancel",value:function(){for(this.transition.cancel(),this.transform.delete();this.buffers.length;)this.buffers.pop().delete();this.texture.delete(),this.texture=null,this.framebuffer.delete(),this.framebuffer=null}},{key:"inProgress",get:function(){return this.transition.inProgress}}]),t}()},at=function(){function t(e,r){var n=r.id,i=r.timeline;a()(this,t),this.id=n,this.gl=e,this.timeline=i,this.transitions={},this.needsRedraw=!1,this.numInstances=1,this.isSupported=H.a.isSupported(e)}return u()(t,[{key:"finalize",value:function(){for(var t in this.transitions)this._removeTransition(t)}},{key:"update",value:function(t){var e=t.attributes,r=t.transitions,n=t.numInstances;for(var i in this.numInstances=n||1,e){var o=e[i],a=o.getTransitionSetting(r);a&&this._updateAttribute(i,o,a)}for(var s in this.transitions){var u=e[s];u&&u.getTransitionSetting(r)||this._removeTransition(s)}}},{key:"hasAttribute",value:function(t){var e=this.transitions[t];return e&&e.inProgress}},{key:"getAttributes",value:function(){var t={};for(var e in this.transitions){var r=this.transitions[e];r.inProgress&&(t[e]=r.attributeInTransition)}return t}},{key:"run",value:function(){if(!this.isSupported||0===this.numInstances)return!1;for(var t in this.transitions){this.transitions[t].update()&&(this.needsRedraw=!0)}var e=this.needsRedraw;return this.needsRedraw=!1,e}},{key:"_removeTransition",value:function(t){this.transitions[t].cancel(),delete this.transitions[t]}},{key:"_updateAttribute",value:function(t,e,r){var n=this.transitions[t],i=!n||n.type!==r.type;if(i){if(!this.isSupported)return void T.a.warn("WebGL2 not supported by this browser. Transition for ".concat(t," is disabled."))();n&&this._removeTransition(t);var o=ot[r.type];o?this.transitions[t]=new o({attribute:e,timeline:this.timeline,gl:this.gl}):(T.a.error("unsupported transition type '".concat(r.type,"'"))(),i=!1)}(i||e.needsRedraw())&&(this.needsRedraw=!0,this.transitions[t].start(r,this.numInstances))}}]),t}();function st(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ut(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?st(Object(r),!0).forEach((function(e){i()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):st(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}r.d(e,"a",(function(){return ct}));var ct=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.id,i=void 0===n?"attribute-manager":n,o=r.stats,s=r.timeline;a()(this,t),this.id=i,this.gl=e,this.attributes={},this.updateTriggers={},this.accessors={},this.needsRedraw=!0,this.userData={},this.stats=o,this.attributeTransitionManager=new at(e,{id:"".concat(i,"-transitions"),timeline:s}),Object.seal(this)}return u()(t,[{key:"finalize",value:function(){for(var t in this.attributes)this.attributes[t].delete();this.attributeTransitionManager.finalize()}},{key:"getNeedsRedraw",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},e=this.needsRedraw;return this.needsRedraw=this.needsRedraw&&!t.clearRedrawFlags,e&&this.id}},{key:"setNeedsRedraw",value:function(){!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.needsRedraw=!0,this}},{key:"add",value:function(t,e){this._add(t,e)}},{key:"addInstanced",value:function(t,e){this._add(t,e,{instanced:1})}},{key:"remove",value:function(t){for(var e=0;e<t.length;e++){var r=t[e];void 0!==this.attributes[r]&&(this.attributes[r].delete(),delete this.attributes[r])}}},{key:"invalidate",value:function(t,e){var r=this._invalidateTrigger(t,e);Object(W.a)("attributeManager.invalidate",this,t,r)}},{key:"invalidateAll",value:function(t){for(var e in this.attributes)this.attributes[e].setNeedsUpdate(e,t);Object(W.a)("attributeManager.invalidate",this,"all")}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.data,r=t.numInstances,n=t.startIndices,i=void 0===n?null:n,o=t.transitions,a=t.props,s=void 0===a?{}:a,u=t.buffers,c=void 0===u?{}:u,l=t.context,h=void 0===l?{}:l,f=!1;for(var p in Object(W.a)("attributeManager.updateStart",this),this.stats&&this.stats.get("Update Attributes").timeStart(),this.attributes){var d=this.attributes[p],A=d.settings.accessor;d.startIndices=i,s[p]&&T.a.removed("props.".concat(p),"data.attributes.".concat(p))(),d.setExternalBuffer(c[p])||d.setBinaryValue(c[A],e.startIndices)||!c[A]&&d.setConstantValue(s[A])||d.needsUpdate()&&(f=!0,this._updateAttribute({attribute:d,numInstances:r,data:e,props:s,context:h})),this.needsRedraw|=d.needsRedraw()}f&&Object(W.a)("attributeManager.updateEnd",this,r),this.stats&&this.stats.get("Update Attributes").timeEnd(),this.attributeTransitionManager.update({attributes:this.attributes,numInstances:r,transitions:o})}},{key:"updateTransition",value:function(){var t=this.attributeTransitionManager.run();return this.needsRedraw=this.needsRedraw||t,t}},{key:"getAttributes",value:function(){return this.attributes}},{key:"getChangedAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearChangedFlags:!1},e=this.attributes,r=this.attributeTransitionManager,n=ut({},r.getAttributes());for(var i in e){var o=e[i];o.needsRedraw(t)&&!r.hasAttribute(i)&&(n[i]=o)}return n}},{key:"getShaderAttributes",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t||(t=this.getAttributes());var r={};for(var n in t)e[n]||Object.assign(r,t[n].getShaderAttributes());return r}},{key:"getAccessors",value:function(){return this.updateTriggers}},{key:"_add",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};for(var n in e&&T.a.warn("AttributeManager.add({updaters}) - updater map no longer supported")(),t){var i=t[n];this.attributes[n]=this._createAttribute(n,i,r)}this._mapUpdateTriggersToAttributes()}},{key:"_createAttribute",value:function(t,e,r){var n=ut(ut({},e),{},{id:t,isIndexed:e.isIndexed||e.elements||!1,constant:e.constant||!1,size:(e.elements?1:e.size)||1,value:e.value||null,divisor:e.instanced||r.instanced?1:e.divisor||0});return new G(this.gl,n)}},{key:"_mapUpdateTriggersToAttributes",value:function(){var t=this,e={},r=function(r){t.attributes[r].getUpdateTriggers().forEach((function(t){e[t]||(e[t]=[]),e[t].push(r)}))};for(var n in this.attributes)r(n);this.updateTriggers=e}},{key:"_invalidateTrigger",value:function(t,e){var r=this.attributes,n=this.updateTriggers[t];return n&&n.forEach((function(t){var n=r[t];n&&n.setNeedsUpdate(n.id,e)})),n}},{key:"_updateAttribute",value:function(t){var e=t.attribute,r=t.numInstances;(Object(W.a)("attribute.updateStart",e),e.constant)?e.setConstantValue(e.value):(e.allocate(r)&&Object(W.a)("attribute.allocate",e,r),e.updateBuffer(t)&&(this.needsRedraw=!0,Object(W.a)("attribute.updateEnd",e,r)))}}]),t}()},function(t,e,r){"use strict";var n=r(0),i=r.n(n),o=r(2),a=r.n(o),s=r(3),u=r.n(s),c=r(8),l=r.n(c),h=r(5),f=r.n(h),p=r(6),d=r.n(p),A=r(1),g=r.n(A),m=r(207),y=r(227),v=r(226),_=r(14),b=r(155),x=r(176),w=r(18),E=r(48),S=r(62),O=r(38);function T(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function P(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?T(Object(r),!0).forEach((function(e){i()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):T(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function M(t){var e=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(t){return!1}}();return function(){var r,n=g()(t);if(e){var i=g()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d()(this,r)}}var C=function(t){f()(r,t);var e=M(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};a()(this,r);var n=t.id,i=void 0===n?Object(E.c)("column-geometry"):n,o=I(t),s=o.indices,u=o.attributes;return e.call(this,P(P({},t),{},{id:i,indices:s,attributes:u}))}return r}(S.a);function I(t){var e=t.radius,r=t.height,n=void 0===r?1:r,i=t.nradial,o=void 0===i?10:i,a=t.vertices;a&&(w.a.assert(a.length>=o),a=a.flatMap((function(t){return[t[0],t[1]]})),Object(O.h)(a,O.a.COUNTER_CLOCKWISE));var s=n>0,u=o+1,c=s?3*u+1:o,l=2*Math.PI/o,h=new Uint16Array(s?3*o*2:0),f=new Float32Array(3*c),p=new Float32Array(3*c),d=0;if(s){for(var A=0;A<u;A++)for(var g=A*l,m=A%o,y=Math.sin(g),v=Math.cos(g),_=0;_<2;_++)f[d+0]=a?a[2*m]:v*e,f[d+1]=a?a[2*m+1]:y*e,f[d+2]=(.5-_)*n,p[d+0]=a?a[2*m]:v,p[d+1]=a?a[2*m+1]:y,d+=3;f[d+0]=f[d-3],f[d+1]=f[d-2],f[d+2]=f[d-1],d+=3}for(var b=s?0:1;b<u;b++){var x=Math.floor(b/2)*Math.sign(.5-b%2),E=x*l,S=(x+o)%o,T=Math.sin(E),P=Math.cos(E);f[d+0]=a?a[2*S]:P*e,f[d+1]=a?a[2*S+1]:T*e,f[d+2]=n/2,p[d+2]=1,d+=3}if(s)for(var M=0,C=0;C<o;C++)h[M++]=2*C+0,h[M++]=2*C+2,h[M++]=2*C+0,h[M++]=2*C+1,h[M++]=2*C+1,h[M++]=2*C+3;return{indices:h,attributes:{POSITION:{size:3,value:f},NORMAL:{size:3,value:p}}}}function k(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function R(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?k(Object(r),!0).forEach((function(e){i()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):k(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function L(t){var e=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(t){return!1}}();return function(){var r,n=g()(t);if(e){var i=g()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d()(this,r)}}r.d(e,"a",(function(){return B}));var j=[0,0,0,255],D={diskResolution:{type:"number",min:4,value:20},vertices:null,radius:{type:"number",min:0,value:1e3},angle:{type:"number",value:0},offset:{type:"array",value:[0,0]},coverage:{type:"number",min:0,max:1,value:1},elevationScale:{type:"number",min:0,value:1},radiusUnits:"meters",lineWidthUnits:"meters",lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,extruded:!0,wireframe:!1,filled:!0,stroked:!1,getPosition:{type:"accessor",value:function(t){return t.position}},getFillColor:{type:"accessor",value:j},getLineColor:{type:"accessor",value:j},getLineWidth:{type:"accessor",value:1},getElevation:{type:"accessor",value:1e3},material:!0,getColor:{deprecatedFor:["getFillColor","getLineColor"]}},B=function(t){f()(r,t);var e=L(r);function r(){return a()(this,r),e.apply(this,arguments)}return u()(r,[{key:"getShaders",value:function(){return l()(g()(r.prototype),"getShaders",this).call(this,{vs:"\n#define SHADER_NAME column-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 normals;\n\nattribute vec3 instancePositions;\nattribute float instanceElevations;\nattribute vec3 instancePositions64Low;\nattribute vec4 instanceFillColors;\nattribute vec4 instanceLineColors;\nattribute float instanceStrokeWidths;\n\nattribute vec3 instancePickingColors;\nuniform float opacity;\nuniform float radius;\nuniform float angle;\nuniform vec2 offset;\nuniform bool extruded;\nuniform bool isStroke;\nuniform float coverage;\nuniform float elevationScale;\nuniform float edgeDistance;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\nuniform int radiusUnits;\nuniform int widthUnits;\nvarying vec4 vColor;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n\n vec4 color = isStroke ? instanceLineColors : instanceFillColors;\n mat2 rotationMatrix = mat2(cos(angle), sin(angle), -sin(angle), cos(angle));\n float elevation = 0.0;\n float strokeOffsetRatio = 1.0;\n\n if (extruded) {\n elevation = instanceElevations * (positions.z + 1.0) / 2.0 * elevationScale;\n } else if (isStroke) {\n float widthPixels = clamp(\n project_size_to_pixel(instanceStrokeWidths * widthScale, widthUnits),\n widthMinPixels, widthMaxPixels) / 2.0;\n strokeOffsetRatio -= sign(positions.z) * project_pixel_size(widthPixels) / project_size(edgeDistance * coverage * radius);\n }\n float shouldRender = float(color.a > 0.0 && instanceElevations >= 0.0);\n float dotRadius = radius * coverage * shouldRender;\n\n geometry.normal = project_normal(vec3(rotationMatrix * normals.xy, normals.z));\n geometry.pickingColor = instancePickingColors;\n vec3 centroidPosition = vec3(instancePositions.xy, instancePositions.z + elevation);\n vec3 centroidPosition64Low = instancePositions64Low;\n vec2 offset = (rotationMatrix * positions.xy * strokeOffsetRatio + offset) * dotRadius;\n if (radiusUnits == UNIT_METERS) {\n offset = project_size(offset);\n }\n vec3 pos = vec3(offset, 0.);\n DECKGL_FILTER_SIZE(pos, geometry);\n\n gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64Low, pos, geometry.position);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n if (extruded && !isStroke) {\n vec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, geometry.position.xyz, geometry.normal);\n vColor = vec4(lightColor, color.a * opacity);\n } else {\n vColor = vec4(color.rgb, color.a * opacity);\n }\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#define SHADER_NAME column-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\n\nvoid main(void) {\n gl_FragColor = vColor;\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[m.a,y.a,v.a]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceElevations:{size:1,transition:!0,accessor:"getElevation"},instanceFillColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getFillColor",defaultValue:j},instanceLineColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getLineColor",defaultValue:j},instanceStrokeWidths:{size:1,accessor:"getLineWidth",transition:!0}})}},{key:"updateState",value:function(t){var e=t.props,n=t.oldProps,i=t.changeFlags;l()(g()(r.prototype),"updateState",this).call(this,{props:e,oldProps:n,changeFlags:i});var o=i.extensionsChanged;if(o){var a,s=this.context.gl;null===(a=this.state.model)||void 0===a||a.delete(),this.state.model=this._getModel(s),this.getAttributeManager().invalidateAll()}(o||e.diskResolution!==n.diskResolution||e.vertices!==n.vertices||(e.extruded||e.stroked)!==(n.extruded||n.stroked))&&this._updateGeometry(e)}},{key:"getGeometry",value:function(t,e,r){var n=new C({radius:1,height:r?2:0,vertices:e,nradial:t}),i=0;if(e)for(var o=0;o<t;o++){var a=e[o];i+=Math.sqrt(a[0]*a[0]+a[1]*a[1])/t}else i=1;return this.setState({edgeDistance:Math.cos(Math.PI/t)*i}),n}},{key:"_getModel",value:function(t){return new x.a(t,R(R({},this.getShaders()),{},{id:this.props.id,isInstanced:!0}))}},{key:"_updateGeometry",value:function(t){var e=t.diskResolution,r=t.vertices,n=t.extruded,i=t.stroked,o=this.getGeometry(e,r,n||i);this.setState({fillVertexCount:o.attributes.POSITION.value.length/3,wireframeVertexCount:o.indices.value.length}),this.state.model.setProps({geometry:o})}},{key:"draw",value:function(t){var e=t.uniforms,r=this.props,n=r.lineWidthUnits,i=r.lineWidthScale,o=r.lineWidthMinPixels,a=r.lineWidthMaxPixels,s=r.radiusUnits,u=r.elevationScale,c=r.extruded,l=r.filled,h=r.stroked,f=r.wireframe,p=r.offset,d=r.coverage,A=r.radius,g=r.angle,m=this.state,y=m.model,v=m.fillVertexCount,b=m.wireframeVertexCount,x=m.edgeDistance;y.setUniforms(e).setUniforms({radius:A,angle:g/180*Math.PI,offset:p,extruded:c,coverage:d,elevationScale:u,edgeDistance:x,radiusUnits:_.d[s],widthUnits:_.d[n],widthScale:i,widthMinPixels:o,widthMaxPixels:a}),c&&f&&(y.setProps({isIndexed:!0}),y.setVertexCount(b).setDrawMode(1).setUniforms({isStroke:!0}).draw()),l&&(y.setProps({isIndexed:!1}),y.setVertexCount(v).setDrawMode(5).setUniforms({isStroke:!1}).draw()),!c&&h&&(y.setProps({isIndexed:!1}),y.setVertexCount(2*v/3).setDrawMode(5).setUniforms({isStroke:!0}).draw())}}]),r}(b.a);B.layerName="ColumnLayer",B.defaultProps=D},function(t,e,r){"use strict";var n=r(10),i=r.n(n),o=r(0),a=r.n(o),s=r(2),u=r.n(s),c=r(3),l=r.n(c),h=r(5),f=r.n(h),p=r(6),d=r.n(p),A=r(1),g=r.n(A),m=r(53),y=r(190),v=r(162),_=r(238),b=r.n(_),x=r(18);function w(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return E(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return E(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function E(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var S=[];function O(t,e,r,n){for(var i=0,o=e;o<r;o++){var a=t[o],s=null,u=n&&n[a];u&&(s=u.width),i+=s}return i}function T(t,e,r,n,i,o){for(var a=e,s=0,u=e;u<r;u++){var c=O(t,u,u+1,i);s+c>n&&(a<u&&o.push(u),a=u,s=0),s+=c}return s}function P(t,e,r,n,i,o){for(var a=e,s=e,u=e,c=0,l=e;l<r;l++)if(" "===t[l]?u=l+1:" "!==t[l+1]&&l+1!==r||(u=l+1),u>s){var h=O(t,s,u,i);c+h>n&&(a<s&&(o.push(s),a=s,c=0),h>n&&(h=T(t,s,u,n,i,o),a=o[o.length-1])),s=u,c+=h}return c}function M(t,e,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5?arguments[5]:void 0;void 0===o&&(o=t.length);var a=[];return"break-all"===e?T(t,i,o,r,n,a):P(t,i,o,r,n,a),a}function C(t,e,r,n,i,o){for(var a=0,s=0,u=e;u<r;u++){var c=t[u],l=n[c];l?(s||(s=l.height),i[u]=a+l.width/2,a+=l.width):(x.a.warn("Missing character: ".concat(c," (").concat(c.codePointAt(0),")"))(),i[u]=a,a+=32)}o[0]=a,o[1]=s}function I(t,e,r,n,i){for(var o=(t=Array.from(t)).length,a=new Array(o),s=new Array(o),u=new Array(o),c=("break-word"===r||"break-all"===r)&&isFinite(n)&&n>0,l=[0,0],h=[],f=0,p=0,d=0,A=0;A<=o;A++){var g=t[A];if("\n"!==g&&A!==o||(d=A),d>p){for(var m=c?M(t,r,n,i,p,d):S,y=0;y<=m.length;y++){var v=0===y?p:m[y-1],_=y<m.length?m[y]:d;C(t,v,_,i,a,h);for(var b=v;b<_;b++)s[b]=f+h[1]/2,u[b]=h[0];f+=h[1]*e,l[0]=Math.max(l[0],h[0])}p=d}"\n"===g&&(a[p]=0,s[p]=0,u[p]=0,p++)}return l[1]=f,{x:a,y:s,rowWidth:u,size:l}}var k=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5;u()(this,t),this.limit=e,this.clear()}return l()(t,[{key:"clear",value:function(){this._cache={},this._order=[]}},{key:"get",value:function(t){var e=this._cache[t];return e&&(this._deleteOrder(t),this._appendOrder(t)),e}},{key:"set",value:function(t,e){this._cache[t]?(this.delete(t),this._cache[t]=e,this._appendOrder(t)):(Object.keys(this._cache).length===this.limit&&this.delete(this._order[0]),this._cache[t]=e,this._appendOrder(t))}},{key:"delete",value:function(t){this._cache[t]&&(this._deleteCache(t),this._deleteOrder(t))}},{key:"_deleteCache",value:function(t){delete this._cache[t]}},{key:"_deleteOrder",value:function(t){var e=this._order.findIndex((function(e){return e===t}));e>=0&&this._order.splice(e,1)}},{key:"_appendOrder",value:function(t){this._order.push(t)}}]),t}();function R(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return L(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return L(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function L(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function j(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}var D=function(){for(var t=[],e=32;e<128;e++)t.push(String.fromCharCode(e));return t}(),B=new k(3),F=["fontFamily","fontWeight","characterSet","fontSize","sdf","buffer","cutoff","radius"];function z(t,e){var r=B.get(t);if(!r)return e;var n=[],i=r.mapping,o=Object.keys(i);o=new Set(o);var a=e;return a instanceof Array&&(a=new Set(a)),a.forEach((function(t){o.has(t)||n.push(t)})),n}function N(t,e){for(var r=0;r<t.length;r++)e.data[4*r+3]=t[r]}function U(t,e,r,n){t.font="".concat(n," ").concat(r,"px ").concat(e),t.fillStyle="#000",t.textBaseline="baseline",t.textAlign="left"}var V=function(){function t(){u()(this,t),this.props={fontFamily:"Monaco, monospace",fontWeight:"normal",characterSet:D,fontSize:64,buffer:4,sdf:!1,cutoff:.25,radius:12},this._key=null,this._atlas=null}return l()(t,[{key:"setProps",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};F.forEach((function(r){r in e&&(t.props[r]=e[r])}));var r=this._key;this._key=this._getKey();var n=z(this._key,this.props.characterSet),i=B.get(this._key);if(i&&0===n.length)this._key!==r&&(this._atlas=i);else{var o=this._generateFontAtlas(this._key,n,i);this._atlas=o,B.set(this._key,o)}}},{key:"_generateFontAtlas",value:function(t,e,r){var n=this.props,i=n.fontFamily,o=n.fontWeight,s=n.fontSize,u=n.buffer,c=n.sdf,l=n.radius,h=n.cutoff,f=r&&r.data;f||((f=document.createElement("canvas")).width=1024);var p=f.getContext("2d");U(p,i,s,o);var d=function(t){var e,r=t.characterSet,n=t.getFontWidth,i=t.fontHeight,o=t.buffer,a=t.maxCanvasWidth,s=t.mapping,u=void 0===s?{}:s,c=t.xOffset,l=void 0===c?0:c,h=t.yOffset,f=void 0===h?0:h,p=0,d=l,A=0,g=w(r);try{for(g.s();!(e=g.n()).done;){var m=e.value;if(!u[m]){var y=n(m,A++);d+y+2*o>a&&(d=0,p++),u[m]={x:d+o,y:f+p*(i+2*o)+o,width:y,height:i},d+=y+2*o}}}catch(t){g.e(t)}finally{g.f()}var v,_=i+2*o;return{mapping:u,xOffset:d,yOffset:f+p*_,canvasHeight:(v=f+(p+1)*_,Math.pow(2,Math.ceil(Math.log2(v))))}}(function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?j(Object(r),!0).forEach((function(e){a()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({getFontWidth:function(t){return p.measureText(t).width},fontHeight:1.2*s,buffer:u,characterSet:e,maxCanvasWidth:1024},r&&{mapping:r.mapping,xOffset:r.xOffset,yOffset:r.yOffset})),A=d.mapping,g=d.canvasHeight,m=d.xOffset,y=d.yOffset;if(f.height!==g){var v=p.getImageData(0,0,f.width,f.height);f.height=g,p.putImageData(v,0,0)}if(U(p,i,s,o),c){var _,x=new b.a(s,u,l,h,i,o),E=p.getImageData(0,0,x.size,x.size),S=R(e);try{for(S.s();!(_=S.n()).done;){var O=_.value;N(x.draw(O),E),p.putImageData(E,A[O].x-u,A[O].y+u)}}catch(t){S.e(t)}finally{S.f()}}else{var T,P=R(e);try{for(P.s();!(T=P.n()).done;){var M=T.value;p.fillText(M,A[M].x,A[M].y+.9*s)}}catch(t){P.e(t)}finally{P.f()}}return{xOffset:m,yOffset:y,mapping:A,data:f,width:f.width,height:f.height}}},{key:"_getKey",value:function(){var t=this.props,e=t.fontFamily,r=t.fontWeight,n=t.fontSize,i=t.buffer,o=t.sdf,a=t.radius,s=t.cutoff;return o?"".concat(e," ").concat(r," ").concat(n," ").concat(i," ").concat(a," ").concat(s):"".concat(e," ").concat(r," ").concat(n," ").concat(i)}},{key:"texture",get:function(){return this._atlas}},{key:"mapping",get:function(){return this._atlas&&this._atlas.mapping}},{key:"scale",get:function(){return 1.2}}]),t}(),G=r(160);function W(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return H(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return H(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function H(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function q(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Z(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?q(Object(r),!0).forEach((function(e){a()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):q(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function X(t){var e=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(t){return!1}}();return function(){var r,n=g()(t);if(e){var i=g()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d()(this,r)}}r.d(e,"a",(function(){return et}));var Q={fontSize:64,buffer:4,sdf:!1,radius:12,cutoff:.25,smoothing:.1},Y={start:1,middle:0,end:-1},K={top:1,center:0,bottom:-1},$=[0,0,0,255],J=["fontSize","buffer","sdf","radius","cutoff"],tt={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,background:!1,getBackgroundColor:{type:"accessor",value:[255,255,255,255]},getBorderColor:{type:"accessor",value:$},getBorderWidth:{type:"accessor",value:0},backgroundPadding:{type:"array",value:[0,0,0,0]},characterSet:{type:"object",value:D},fontFamily:"Monaco, monospace",fontWeight:"normal",lineHeight:1,outlineWidth:{type:"number",value:0,min:0},outlineColor:{type:"color",value:$},fontSettings:{},wordBreak:"break-word",maxWidth:{type:"number",value:-1},getText:{type:"accessor",value:function(t){return t.text}},getPosition:{type:"accessor",value:function(t){return t.position}},getColor:{type:"accessor",value:$},getSize:{type:"accessor",value:32},getAngle:{type:"accessor",value:0},getTextAnchor:{type:"accessor",value:"middle"},getAlignmentBaseline:{type:"accessor",value:"center"},getPixelOffset:{type:"accessor",value:[0,0]},backgroundColor:{deprecatedFor:["background","getBackgroundColor"]}},et=function(t){f()(r,t);var e=X(r);function r(){return u()(this,r),e.apply(this,arguments)}return l()(r,[{key:"initializeState",value:function(){this.state={styleVersion:0,fontAtlasManager:new V}}},{key:"updateState",value:function(t){var e=t.props,r=t.oldProps,n=t.changeFlags,i=n.dataChanged||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getText),o=this.state.characterSet;i&&this._updateText();var a=o!==this.state.characterSet||this._fontChanged(r,e);a&&this._updateFontAtlas(r,e),(a||e.lineHeight!==r.lineHeight||e.wordBreak!==r.wordBreak||e.maxWidth!==r.maxWidth)&&this.setState({styleVersion:this.state.styleVersion+1})}},{key:"getPickingInfo",value:function(t){var e=t.info;return e.object=e.index>=0?this.props.data[e.index]:null,e}},{key:"_updateFontAtlas",value:function(t,e){var r=e.fontSettings,n=e.fontFamily,i=e.fontWeight,o=this.state,a=o.fontAtlasManager,s=o.characterSet;a.setProps(Z(Z(Z({},Q),r),{},{characterSet:s,fontFamily:n,fontWeight:i}))}},{key:"_fontChanged",value:function(t,e){if(t.fontFamily!==e.fontFamily||t.fontWeight!==e.fontWeight)return!0;if(t.fontSettings===e.fontSettings)return!1;var r=t.fontSettings||{},n=e.fontSettings||{};return J.some((function(t){return r[t]!==n[t]}))}},{key:"_updateText",value:function(){var t,e=this.props,r=e.data,n=e.characterSet,i=r.attributes&&r.attributes.getText,o=this.props.getText,a=r.startIndices,s="auto"===n&&new Set;if(i&&a){var u=function(t){var e=t.value,r=t.length,n=t.stride,i=t.offset,o=t.startIndices,a=t.characterSet,s=e.BYTES_PER_ELEMENT,u=n?n/s:1,c=i?i/s:0,l=o[r]||Math.ceil((e.length-c)/u),h=a&&new Set,f=new Array(r),p=e;if(u>1||c>0){p=new e.constructor(l);for(var d=0;d<l;d++)p[d]=e[d*u+c]}for(var A=0;A<r;A++){var g=o[A],m=o[A+1]||l,y=p.subarray(g,m);f[A]=String.fromCodePoint.apply(null,y),h&&y.forEach(h.add,h)}if(h){var v,_=w(h);try{for(_.s();!(v=_.n()).done;){var b=v.value;a.add(String.fromCodePoint(b))}}catch(t){_.e(t)}finally{_.f()}}return{texts:f,characterCount:l}}(Z(Z({},ArrayBuffer.isView(i)?{value:i}:i),{},{length:r.length,startIndices:a,characterSet:s})),c=u.texts;t=u.characterCount,o=function(t,e){var r=e.index;return c[r]}}else{var l=Object(m.a)(r),h=l.iterable,f=l.objectInfo;a=[0],t=0;var p,d=W(h);try{for(d.s();!(p=d.n()).done;){var A=p.value;f.index++;var g=Array.from(o(A,f)||"");s&&g.forEach(s.add,s),t+=g.length,a.push(t)}}catch(t){d.e(t)}finally{d.f()}}this.setState({getText:o,startIndices:a,numInstances:t,characterSet:s||n})}},{key:"getBoundingRect",value:function(t,e){var r=this.state.fontAtlasManager.mapping,n=this.state.getText,o=this.props,a=o.wordBreak,s=o.maxWidth,u=o.lineHeight,c=o.getTextAnchor,l=o.getAlignmentBaseline,h=I(n(t,e)||"",u,a,s,r),f=i()(h.size,2),p=f[0],d=f[1];return[(Y["function"==typeof c?c(t,e):c]-1)*p/2,(K["function"==typeof l?l(t,e):l]-1)*d/2,p,d]}},{key:"getIconOffsets",value:function(t,e){for(var r=this.state.fontAtlasManager.mapping,n=this.state.getText,o=this.props,a=o.wordBreak,s=o.maxWidth,u=o.lineHeight,c=o.getTextAnchor,l=o.getAlignmentBaseline,h=I(n(t,e)||"",u,a,s,r),f=h.x,p=h.y,d=h.rowWidth,A=i()(h.size,2),g=A[0],m=A[1],y=Y["function"==typeof c?c(t,e):c],v=K["function"==typeof l?l(t,e):l],_=f.length,b=new Array(2*_),x=0,w=0;w<_;w++){var E=(1-y)*(g-d[w])/2;b[x++]=(y-1)*g/2+E+f[w],b[x++]=(v-1)*m/2+p[w]}return b}},{key:"renderLayers",value:function(){var t=this.state,e=t.startIndices,r=t.numInstances,n=t.getText,i=t.fontAtlasManager,o=i.scale,a=i.texture,s=i.mapping,u=t.styleVersion,c=this.props,l=c.data,h=c._dataDiff,f=c.getPosition,p=c.getColor,d=c.getSize,A=c.getAngle,g=c.getPixelOffset,m=c.getBackgroundColor,y=c.getBorderColor,_=c.getBorderWidth,b=c.backgroundPadding,x=c.background,w=c.billboard,E=c.fontSettings,S=c.outlineWidth,O=c.outlineColor,T=c.sizeScale,P=c.sizeUnits,M=c.sizeMinPixels,C=c.sizeMaxPixels,I=c.transitions,k=c.updateTriggers,R=this.getSubLayerClass("characters",v.a),L=this.getSubLayerClass("background",G.a);return[x&&new L({getFillColor:m,getLineColor:y,getLineWidth:_,padding:b,getPosition:f,getSize:d,getAngle:A,getPixelOffset:g,billboard:w,sizeScale:T/this.state.fontAtlasManager.props.fontSize,sizeUnits:P,sizeMinPixels:M,sizeMaxPixels:C,transitions:I&&{getPosition:I.getPosition,getAngle:I.getAngle,getSize:I.getSize,getFillColor:I.getBackgroundColor,getLineColor:I.getBorderColor,getLineWidth:I.getBorderWidth,getPixelOffset:I.getPixelOffset}},this.getSubLayerProps({id:"background",updateTriggers:{getPosition:k.getPosition,getAngle:k.getAngle,getSize:k.getSize,getFillColor:k.getBackgroundColor,getLineColor:k.getBorderColor,getLineWidth:k.getBorderWidth,getPixelOffset:k.getPixelOffset,getBoundingRect:{getText:k.getText,getTextAnchor:k.getTextAnchor,getAlignmentBaseline:k.getAlignmentBaseline,styleVersion:u}}}),{data:l.attributes?{length:l.length,attributes:l.attributes.background||{}}:l,_dataDiff:h,autoHighlight:!1,getBoundingRect:this.getBoundingRect.bind(this)}),new R({sdf:E.sdf,smoothing:Number.isFinite(E.smoothing)?E.smoothing:Q.smoothing,outlineWidth:S,outlineColor:O,iconAtlas:a,iconMapping:s,getPosition:f,getColor:p,getSize:d,getAngle:A,getPixelOffset:g,billboard:w,sizeScale:T*o,sizeUnits:P,sizeMinPixels:M*o,sizeMaxPixels:C*o,transitions:I&&{getPosition:I.getPosition,getAngle:I.getAngle,getColor:I.getColor,getSize:I.getSize,getPixelOffset:I.getPixelOffset}},this.getSubLayerProps({id:"characters",updateTriggers:{getIcon:k.getText,getPosition:k.getPosition,getAngle:k.getAngle,getColor:k.getColor,getSize:k.getSize,getPixelOffset:k.getPixelOffset,getIconOffsets:{getText:k.getText,getTextAnchor:k.getTextAnchor,getAlignmentBaseline:k.getAlignmentBaseline,styleVersion:u}}}),{data:l,_dataDiff:h,startIndices:e,numInstances:r,getIconOffsets:this.getIconOffsets.bind(this),getIcon:n})]}}]),r}(y.a);et.layerName="TextLayer",et.defaultProps=tt},function(t,e,r){"use strict";var n=r(0),i=r.n(n),o=r(2),a=r.n(o),s=r(3),u=r.n(s),c=r(8),l=r.n(c),h=r(5),f=r.n(h),p=r(6),d=r.n(p),A=r(1),g=r.n(A),m=r(207),y=r(226),v=r(14),_=r(155),b=r(176),x=r(62);function w(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function E(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?w(Object(r),!0).forEach((function(e){i()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):w(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function S(t){var e=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(t){return!1}}();return function(){var r,n=g()(t);if(e){var i=g()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d()(this,r)}}r.d(e,"a",(function(){return P}));var O=[0,0,0,255],T={radiusUnits:"meters",radiusScale:{type:"number",min:0,value:1},radiusMinPixels:{type:"number",min:0,value:0},radiusMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},lineWidthUnits:"meters",lineWidthScale:{type:"number",min:0,value:1},lineWidthMinPixels:{type:"number",min:0,value:0},lineWidthMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},stroked:!1,filled:!0,billboard:!1,antialiasing:!0,getPosition:{type:"accessor",value:function(t){return t.position}},getRadius:{type:"accessor",value:1},getFillColor:{type:"accessor",value:O},getLineColor:{type:"accessor",value:O},getLineWidth:{type:"accessor",value:1},strokeWidth:{deprecatedFor:"getLineWidth"},outline:{deprecatedFor:"stroked"},getColor:{deprecatedFor:["getFillColor","getLineColor"]}},P=function(t){f()(r,t);var e=S(r);function r(){return a()(this,r),e.apply(this,arguments)}return u()(r,[{key:"getShaders",value:function(){return l()(g()(r.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME scatterplot-layer-vertex-shader\n\nattribute vec3 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute float instanceRadius;\nattribute float instanceLineWidths;\nattribute vec4 instanceFillColors;\nattribute vec4 instanceLineColors;\nattribute vec3 instancePickingColors;\n\nuniform float opacity;\nuniform float radiusScale;\nuniform float radiusMinPixels;\nuniform float radiusMaxPixels;\nuniform float lineWidthScale;\nuniform float lineWidthMinPixels;\nuniform float lineWidthMaxPixels;\nuniform float stroked;\nuniform bool filled;\nuniform bool billboard;\nuniform int radiusUnits;\nuniform int lineWidthUnits;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying vec2 unitPosition;\nvarying float innerUnitRadius;\nvarying float outerRadiusPixels;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n outerRadiusPixels = clamp(\n project_size_to_pixel(radiusScale * instanceRadius, radiusUnits),\n radiusMinPixels, radiusMaxPixels\n );\n float lineWidthPixels = clamp(\n project_size_to_pixel(lineWidthScale * instanceLineWidths, lineWidthUnits),\n lineWidthMinPixels, lineWidthMaxPixels\n );\n outerRadiusPixels += stroked * lineWidthPixels / 2.0;\n unitPosition = positions.xy;\n geometry.uv = unitPosition;\n geometry.pickingColor = instancePickingColors;\n\n innerUnitRadius = 1.0 - stroked * lineWidthPixels / outerRadiusPixels;\n \n if (billboard) {\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n vec3 offset = positions * outerRadiusPixels;\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n } else {\n vec3 offset = positions * project_pixel_size(outerRadiusPixels);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset, geometry.position);\n }\n\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n vFillColor = vec4(instanceFillColors.rgb, instanceFillColors.a * opacity);\n DECKGL_FILTER_COLOR(vFillColor, geometry);\n vLineColor = vec4(instanceLineColors.rgb, instanceLineColors.a * opacity);\n DECKGL_FILTER_COLOR(vLineColor, geometry);\n}\n",fs:"#define SHADER_NAME scatterplot-layer-fragment-shader\n\nprecision highp float;\n\nuniform bool filled;\nuniform float stroked;\nuniform bool antialiasing;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying vec2 unitPosition;\nvarying float innerUnitRadius;\nvarying float outerRadiusPixels;\n\nvoid main(void) {\n geometry.uv = unitPosition;\n\n float distToCenter = length(unitPosition) * outerRadiusPixels;\n float inCircle = antialiasing ? \n smoothedge(distToCenter, outerRadiusPixels) : \n step(distToCenter, outerRadiusPixels);\n\n if (inCircle == 0.0) {\n discard;\n }\n\n if (stroked > 0.5) {\n float isLine = antialiasing ? \n smoothedge(innerUnitRadius * outerRadiusPixels, distToCenter) :\n step(innerUnitRadius * outerRadiusPixels, distToCenter);\n\n if (filled) {\n gl_FragColor = mix(vFillColor, vLineColor, isLine);\n } else {\n if (isLine == 0.0) {\n discard;\n }\n gl_FragColor = vec4(vLineColor.rgb, vLineColor.a * isLine);\n }\n } else if (filled) {\n gl_FragColor = vFillColor;\n } else {\n discard;\n }\n\n gl_FragColor.a *= inCircle;\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[m.a,y.a]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceRadius:{size:1,transition:!0,accessor:"getRadius",defaultValue:1},instanceFillColors:{size:this.props.colorFormat.length,transition:!0,normalized:!0,type:5121,accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:this.props.colorFormat.length,transition:!0,normalized:!0,type:5121,accessor:"getLineColor",defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:"getLineWidth",defaultValue:1}})}},{key:"updateState",value:function(t){var e=t.props,n=t.oldProps,i=t.changeFlags;if(l()(g()(r.prototype),"updateState",this).call(this,{props:e,oldProps:n,changeFlags:i}),i.extensionsChanged){var o,a=this.context.gl;null===(o=this.state.model)||void 0===o||o.delete(),this.state.model=this._getModel(a),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(t){var e=t.uniforms,r=this.props,n=r.radiusUnits,i=r.radiusScale,o=r.radiusMinPixels,a=r.radiusMaxPixels,s=r.stroked,u=r.filled,c=r.billboard,l=r.antialiasing,h=r.lineWidthUnits,f=r.lineWidthScale,p=r.lineWidthMinPixels,d=r.lineWidthMaxPixels;this.state.model.setUniforms(e).setUniforms({stroked:s?1:0,filled:u,billboard:c,antialiasing:l,radiusUnits:v.d[n],radiusScale:i,radiusMinPixels:o,radiusMaxPixels:a,lineWidthUnits:v.d[h],lineWidthScale:f,lineWidthMinPixels:p,lineWidthMaxPixels:d}).draw()}},{key:"_getModel",value:function(t){return new b.a(t,E(E({},this.getShaders()),{},{id:this.props.id,geometry:new x.a({drawMode:6,vertexCount:4,attributes:{positions:{size:3,value:new Float32Array([-1,-1,0,1,-1,0,1,1,0,-1,1,0])}}}),isInstanced:!0}))}}]),r}(_.a);P.layerName="ScatterplotLayer",P.defaultProps=T},function(t,e,r){"use strict";var n=r(0),i=r.n(n),o=r(2),a=r.n(o),s=r(3),u=r.n(s),c=r(8),l=r.n(c),h=r(5),f=r.n(h),p=r(6),d=r.n(p),A=r(1),g=r.n(A),m=r(207),y=r(226),v=r(14),_=r(155),b=r(176),x=r(62);function w(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function E(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?w(Object(r),!0).forEach((function(e){i()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):w(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function S(t){var e=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(t){return!1}}();return function(){var r,n=g()(t);if(e){var i=g()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d()(this,r)}}r.d(e,"a",(function(){return T}));var O={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,padding:{type:"array",value:[0,0,0,0]},getPosition:{type:"accessor",value:function(t){return t.position}},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},getBoundingRect:{type:"accessor",value:[0,0,0,0]},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:[0,0,0,255]},getLineWidth:{type:"accessor",value:1}},T=function(t){f()(r,t);var e=S(r);function r(){return a()(this,r),e.apply(this,arguments)}return u()(r,[{key:"getShaders",value:function(){return l()(g()(r.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME text-background-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute vec4 instanceRects;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec2 instancePixelOffsets;\nattribute float instanceLineWidths;\nattribute vec4 instanceFillColors;\nattribute vec4 instanceLineColors;\nattribute vec3 instancePickingColors;\n\nuniform bool billboard;\nuniform float opacity;\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform vec4 padding;\nuniform int sizeUnits;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying float vLineWidth;\nvarying vec2 uv;\nvarying vec2 dimensions;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = radians(angle);\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 vLineWidth = instanceLineWidths;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale, sizeUnits),\n sizeMinPixels, sizeMaxPixels\n );\n\n dimensions = instanceRects.zw * sizePixels + padding.xy + padding.zw;\n\n vec2 pixelOffset = (positions * instanceRects.zw + instanceRects.xy) * sizePixels + mix(-padding.xy, padding.zw, positions);\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles);\n pixelOffset += instancePixelOffsets;\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 } 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 vFillColor = vec4(instanceFillColors.rgb, instanceFillColors.a * opacity);\n DECKGL_FILTER_COLOR(vFillColor, geometry);\n vLineColor = vec4(instanceLineColors.rgb, instanceLineColors.a * opacity);\n DECKGL_FILTER_COLOR(vLineColor, geometry);\n}\n",fs:"#define SHADER_NAME text-background-layer-fragment-shader\n\nprecision highp float;\n\nuniform bool stroked;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying float vLineWidth;\nvarying vec2 uv;\nvarying vec2 dimensions;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec2 pixelPosition = uv * dimensions;\n if (stroked) {\n float distToEdge = min(\n min(pixelPosition.x, dimensions.x - pixelPosition.x),\n min(pixelPosition.y, dimensions.y - pixelPosition.y)\n );\n float isBorder = smoothedge(distToEdge, vLineWidth);\n gl_FragColor = mix(vFillColor, vLineColor, isBorder);\n } else {\n gl_FragColor = vFillColor;\n }\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[m.a,y.a]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instanceRects:{size:4,accessor:"getBoundingRect"},instancePixelOffsets:{size:2,transition:!0,accessor:"getPixelOffset"},instanceFillColors:{size:4,transition:!0,normalized:!0,type:5121,accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:4,transition:!0,normalized:!0,type:5121,accessor:"getLineColor",defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:"getLineWidth",defaultValue:1}})}},{key:"updateState",value:function(t){var e=t.props,n=t.oldProps,i=t.changeFlags;if(l()(g()(r.prototype),"updateState",this).call(this,{props:e,oldProps:n,changeFlags:i}),i.extensionsChanged){var o,a=this.context.gl;null===(o=this.state.model)||void 0===o||o.delete(),this.state.model=this._getModel(a),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(t){var e=t.uniforms,r=this.props,n=r.billboard,i=r.sizeScale,o=r.sizeUnits,a=r.sizeMinPixels,s=r.sizeMaxPixels,u=r.getLineWidth,c=this.props.padding;c.length<4&&(c=[c[0],c[1],c[0],c[1]]),this.state.model.setUniforms(e).setUniforms({billboard:n,stroked:Boolean(u),padding:c,sizeUnits:v.d[o],sizeScale:i,sizeMinPixels:a,sizeMaxPixels:s}).draw()}},{key:"_getModel",value:function(t){return new b.a(t,E(E({},this.getShaders()),{},{id:this.props.id,geometry:new x.a({drawMode:6,vertexCount:4,attributes:{positions:{size:2,value:new Float32Array([0,0,1,0,1,1,0,1])}}}),isInstanced:!0}))}}]),r}(_.a);T.layerName="TextBackgroundLayer",T.defaultProps=O},function(t,e,r){"use strict";var n=r(0),i=r.n(n),o=r(2),a=r.n(o),s=r(3),u=r.n(s),c=r(290),l=r(33),h=r(18),f=r(32),p=r(66),d=r(137),A=r(206);function g(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return m(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return m(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function m(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var y=function(){function t(e,r,n){a()(this,t),this.id=e,this.context=n,this._loadCount=0,this._subscribers=new Set,this.setData(r)}return u()(t,[{key:"subscribe",value:function(t){this._subscribers.add(t)}},{key:"unsubscribe",value:function(t){this._subscribers.delete(t)}},{key:"inUse",value:function(){return this._subscribers.size>0}},{key:"delete",value:function(){}},{key:"getData",value:function(){var t=this;return this.isLoaded?this._error?Promise.reject(this._error):this._content:this._loader.then((function(){return t.getData()}))}},{key:"setData",value:function(t,e){var r=this;if(t!==this._data||e){this._data=t;var n=++this._loadCount,i=t;"string"==typeof t&&(i=Object(A.a)(t)),i instanceof Promise?(this.isLoaded=!1,this._loader=i.then((function(t){r._loadCount===n&&(r.isLoaded=!0,r._error=null,r._content=t)})).catch((function(t){r._loadCount===n&&(r.isLoaded=!0,r._error=t||!0)}))):(this.isLoaded=!0,this._error=null,this._content=t);var o,a=g(this._subscribers);try{for(a.s();!(o=a.n()).done;){o.value.onChange(this.getData())}}catch(t){a.e(t)}finally{a.f()}}}}]),t}(),v=function(){function t(e){var r=e.gl,n=e.protocol;a()(this,t),this.protocol=n||"resource://",this._context={gl:r,resourceManager:this},this._resources={},this._consumers={},this._pruneRequest=null}return u()(t,[{key:"contains",value:function(t){return!!t.startsWith(this.protocol)||t in this._resources}},{key:"add",value:function(t){var e=t.resourceId,r=t.data,n=t.forceUpdate,i=void 0!==n&&n,o=t.persistent,a=void 0===o||o,s=this._resources[e];s?s.setData(r,i):(s=new y(e,r,this._context),this._resources[e]=s),s.persistent=a}},{key:"remove",value:function(t){var e=this._resources[t];e&&(e.delete(),delete this._resources[t])}},{key:"unsubscribe",value:function(t){var e=t.consumerId,r=this._consumers[e];if(r){for(var n in r){var i=r[n];i.resource&&i.resource.unsubscribe(i)}delete this._consumers[e],this.prune()}}},{key:"subscribe",value:function(t){var e=t.resourceId,r=t.onChange,n=t.consumerId,i=t.requestId,o=void 0===i?"default":i,a=this._resources,s=this.protocol;e.startsWith(s)&&(a[e=e.replace(s,"")]||this.add({resourceId:e,data:null,persistent:!1}));var u=a[e];if(this._track(n,o,u,r),u)return u.getData()}},{key:"prune",value:function(){var t=this;this._pruneRequest||(this._pruneRequest=setTimeout((function(){return t._prune()}),0))}},{key:"finalize",value:function(){for(var t in this._resources)this._resources[t].delete()}},{key:"_track",value:function(t,e,r,n){var i=this._consumers,o=i[t]=i[t]||{},a=o[e]||{};a.resource&&(a.resource.unsubscribe(a),a.resource=null,this.prune()),r&&(o[e]=a,a.onChange=n,a.resource=r,r.subscribe(a))}},{key:"_prune",value:function(){this._pruneRequest=null;for(var t=0,e=Object.keys(this._resources);t<e.length;t++){var r=e[t],n=this._resources[r];n.persistent||n.inUse()||(n.delete(),delete this._resources[r])}}}]),t}(),_=r(40),b=r(152);function x(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return w(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return w(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function w(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function E(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function S(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?E(Object(r),!0).forEach((function(e){i()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}r.d(e,"a",(function(){return T}));var O=Object.seal({layerManager:null,resourceManager:null,deck:null,gl:null,stats:null,shaderCache:null,pickingFBO:null,mousePosition:null,userData:{}}),T=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.deck,i=r.stats,o=r.viewport,s=r.timeline;a()(this,t),this.lastRenderedLayers=[],this.layers=[],this.resourceManager=new v({gl:e,protocol:"deck://"}),this.context=S(S({},O),{},{layerManager:this,gl:e,deck:n,programManager:e&&Object(b.a)(e),stats:i||new d.a({id:"deck.gl"}),viewport:o||new _.a({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:s||new c.a,resourceManager:this.resourceManager}),this._nextLayers=null,this._needsRedraw="Initial render",this._needsUpdate=!1,this._debug=!1,this.activateViewport=this.activateViewport.bind(this),Object.seal(this)}return u()(t,[{key:"finalize",value:function(){this.resourceManager.finalize();var t,e=x(this.layers);try{for(e.s();!(t=e.n()).done;){var r=t.value;this._finalizeLayer(r)}}catch(t){e.e(t)}finally{e.f()}}},{key:"needsRedraw",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},e=this._needsRedraw;t.clearRedrawFlags&&(this._needsRedraw=!1);var r,n=x(this.layers);try{for(n.s();!(r=n.n()).done;){var i=r.value,o=i.getNeedsRedraw(t);e=e||o}}catch(t){n.e(t)}finally{n.f()}return e}},{key:"needsUpdate",value:function(){return this._nextLayers&&this._nextLayers!==this.lastRenderedLayers?"layers changed":this._needsUpdate}},{key:"setNeedsRedraw",value:function(t){this._needsRedraw=this._needsRedraw||t}},{key:"setNeedsUpdate",value:function(t){this._needsUpdate=this._needsUpdate||t}},{key:"getLayers",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.layerIds,r=void 0===e?null:e;return r?this.layers.filter((function(t){return r.find((function(e){return 0===t.id.indexOf(e)}))})):this.layers}},{key:"setProps",value:function(t){"debug"in t&&(this._debug=t.debug),"userData"in t&&(this.context.userData=t.userData),"layers"in t&&(this._nextLayers=t.layers),"onError"in t&&(this.context.onError=t.onError)}},{key:"setLayers",value:function(t,e){Object(f.a)("layerManager.setLayers",this,e,t),this.lastRenderedLayers=t;var r,n=x(t=Object(p.b)(t,Boolean));try{for(n.s();!(r=n.n()).done;){r.value.context=this.context}}catch(t){n.e(t)}finally{n.f()}return this._updateLayers(this.layers,t),this}},{key:"updateLayers",value:function(){var t=this.needsUpdate();t&&(this.setNeedsRedraw("updating layers: ".concat(t)),this.setLayers(this._nextLayers||this.lastRenderedLayers,t)),this._nextLayers=null}},{key:"activateViewport",value:function(t){return Object(f.a)("layerManager.activateViewport",this,t),t&&(this.context.viewport=t),this}},{key:"_handleError",value:function(t,e,r){r.raiseError(e,"".concat(t," of ").concat(r))}},{key:"_updateLayers",value:function(t,e){var r,n={},i=x(t);try{for(i.s();!(r=i.n()).done;){var o=r.value;n[o.id]?h.a.warn("Multiple old layers with same id ".concat(o.id))():n[o.id]=o}}catch(t){i.e(t)}finally{i.f()}var a=[];this._updateSublayersRecursively(e,n,a),this._finalizeOldLayers(n);for(var s=!1,u=0,c=a;u<c.length;u++){if(c[u].hasUniformTransition()){s=!0;break}}this._needsUpdate=s,this.layers=a}},{key:"_updateSublayersRecursively",value:function(t,e,r){var n,i=x(t);try{for(i.s();!(n=i.n()).done;){var o=n.value;o.context=this.context;var a=e[o.id];null===a&&h.a.warn("Multiple new layers with same id ".concat(o.id))(),e[o.id]=null;var s=null;try{this._debug&&a!==o&&o.validateProps(),a?(this._transferLayerState(a,o),this._updateLayer(o)):this._initializeLayer(o),r.push(o),s=o.isComposite&&o.getSubLayers()}catch(t){this._handleError("matching",t,o)}s&&this._updateSublayersRecursively(s,e,r)}}catch(t){i.e(t)}finally{i.f()}}},{key:"_finalizeOldLayers",value:function(t){for(var e in t){var r=t[e];r&&this._finalizeLayer(r)}}},{key:"_initializeLayer",value:function(t){try{t._initialize(),t.lifecycle=l.a.INITIALIZED}catch(e){this._handleError("initialization",e,t)}}},{key:"_transferLayerState",value:function(t,e){e._transferState(t),e.lifecycle=l.a.MATCHED,e!==t&&(t.lifecycle=l.a.AWAITING_GC)}},{key:"_updateLayer",value:function(t){try{t._update()}catch(e){this._handleError("update",e,t)}}},{key:"_finalizeLayer",value:function(t){this._needsRedraw=this._needsRedraw||"finalized ".concat(t),t.lifecycle=l.a.AWAITING_FINALIZATION;try{t._finalize(),t.lifecycle=l.a.FINALIZED}catch(e){this._handleError("finalization",e,t)}}}]),t}()},function(t,e,r){"use strict";var n=r(0),i=r.n(n),o=r(2),a=r.n(o),s=r(3),u=r.n(s),c=r(8),l=r.n(c),h=r(5),f=r.n(h),p=r(6),d=r.n(p),A=r(1),g=r.n(A),m=r(18),y=r(110);function v(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function _(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?v(Object(r),!0).forEach((function(e){i()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function b(t){var e=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(t){return!1}}();return function(){var r,n=g()(t);if(e){var i=g()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d()(this,r)}}r.d(e,"a",(function(){return w}));var x=[],w=function(t){f()(r,t);var e=b(r);function r(){return a()(this,r),e.apply(this,arguments)}return u()(r,[{key:"getShaders",value:function(){return _(_({},l()(g()(r.prototype),"getShaders",this).call(this)),{},{fs:"#define SHADER_NAME multi-icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float gamma;\nuniform bool sdf;\nuniform float alphaCutoff;\nuniform float buffer;\nuniform float outlineBuffer;\nuniform vec4 outlineColor;\n\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n if (!picking_uActive) {\n float alpha = texture2D(iconsTexture, vTextureCoords).a;\n vec4 color = vColor;\n if (sdf) {\n float distance = alpha;\n alpha = smoothstep(buffer - gamma, buffer + gamma, distance);\n\n if (outlineBuffer > 0.0) {\n float inFill = alpha;\n float inBorder = smoothstep(outlineBuffer - gamma, outlineBuffer + gamma, distance);\n color = mix(outlineColor, vColor, inFill);\n alpha = inBorder;\n }\n }\n float a = alpha * color.a;\n \n if (a < alphaCutoff) {\n discard;\n }\n\n gl_FragColor = vec4(color.rgb, a * opacity);\n }\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n"})}},{key:"initializeState",value:function(){var t=this;l()(g()(r.prototype),"initializeState",this).call(this),this.getAttributeManager().addInstanced({instanceOffsets:{size:2,accessor:"getIconOffsets"},instancePickingColors:{type:5121,size:3,accessor:function(e,r){var n=r.index,i=r.target;return t.encodePickingColor(n,i)}}})}},{key:"updateState",value:function(t){l()(g()(r.prototype),"updateState",this).call(this,t);var e=t.props,n=t.oldProps,i=e.outlineColor;i!==n.outlineColor&&((i=i.map((function(t){return t/255})))[3]=Number.isFinite(i[3])?i[3]:1,this.setState({outlineColor:i})),!e.sdf&&e.outlineWidth&&m.a.warn("".concat(this.id,": fontSettings.sdf is required to render outline"))()}},{key:"draw",value:function(t){var e=this.props,n=e.sdf,i=e.smoothing,o=e.outlineWidth,a=this.state.outlineColor;t.uniforms=_(_({},t.uniforms),{},{buffer:.75,outlineBuffer:o?Math.max(i,.75*(1-o)):-1,gamma:i,sdf:Boolean(n),outlineColor:a}),l()(g()(r.prototype),"draw",this).call(this,t)}},{key:"getInstanceOffset",value:function(t){var e=this;return t?Array.from(t).map((function(t){return l()(g()(r.prototype),"getInstanceOffset",e).call(e,t)})):x}},{key:"getInstanceColorMode",value:function(t){return 1}},{key:"getInstanceIconFrame",value:function(t){var e=this;return t?Array.from(t).map((function(t){return l()(g()(r.prototype),"getInstanceIconFrame",e).call(e,t)})):x}}]),r}(y.a);w.layerName="MultiIconLayer",w.defaultProps={getIconOffsets:{type:"accessor",value:function(t){return t.offsets}},alphaCutoff:.001,smoothing:.1,outlineWidth:0,outlineColor:{type:"color",value:[0,0,0,255]}}},function(t,e,r){"use strict";var n=r(0),i=r.n(n),o=r(2),a=r.n(o),s=r(3),u=r.n(s),c=r(32),l=r(5),h=r.n(l),f=r(6),p=r.n(f),d=r(1),A=r.n(d);function g(t){var e=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(t){return!1}}();return function(){var r,n=A()(t);if(e){var i=A()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return p()(this,r)}}var m=function(t){h()(r,t);var e=g(r);function r(){return a()(this,r),e.apply(this,arguments)}return r}(r(85).a),y=r(171),v=r(71);function _(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return b(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return b(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function b(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function x(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function w(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?x(Object(r),!0).forEach((function(e){i()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}r.d(e,"a",(function(){return E}));var E=function(){function t(e){a()(this,t),this.gl=e,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new m(e),this.pickLayersPass=new y.a(e),this.renderCount=0,this._needsRedraw="Initial render",this.renderBuffers=[],this.lastPostProcessEffect=null}return u()(t,[{key:"setProps",value:function(t){"layerFilter"in t&&this.layerFilter!==t.layerFilter&&(this.layerFilter=t.layerFilter,this._needsRedraw="layerFilter changed"),"drawPickingColors"in t&&this.drawPickingColors!==t.drawPickingColors&&(this.drawPickingColors=t.drawPickingColors,this._needsRedraw="drawPickingColors changed")}},{key:"renderLayers",value:function(t){var e=this.drawPickingColors?this.pickLayersPass:this.drawLayersPass;t.layerFilter=t.layerFilter||this.layerFilter,t.effects=t.effects||[],t.target=t.target||v.a.getDefaultFramebuffer(this.gl),this._preRender(t.effects,t);var r=this.lastPostProcessEffect?this.renderBuffers[0]:t.target,n=e.render(w(w({},t),{},{target:r}));this._postRender(t.effects,t),this.renderCount++,Object(c.a)("deckRenderer.renderLayers",this,n,t)}},{key:"needsRedraw",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},e=this._needsRedraw;return t.clearRedrawFlags&&(this._needsRedraw=!1),e}},{key:"finalize",value:function(){var t,e=this.renderBuffers,r=_(e);try{for(r.s();!(t=r.n()).done;){t.value.delete()}}catch(t){r.e(t)}finally{r.f()}e.length=0}},{key:"_preRender",value:function(t,e){var r,n=null,i=_(t);try{for(i.s();!(r=i.n()).done;){var o=r.value;o.preRender(this.gl,e),o.postRender&&(n=o)}}catch(t){i.e(t)}finally{i.f()}n&&this._resizeRenderBuffers(),this.lastPostProcessEffect=n}},{key:"_resizeRenderBuffers",value:function(){var t=this.renderBuffers;0===t.length&&t.push(new v.a(this.gl),new v.a(this.gl));var e,r=_(t);try{for(r.s();!(e=r.n()).done;){e.value.resize()}}catch(t){r.e(t)}finally{r.f()}}},{key:"_postRender",value:function(t,e){var r,n=this.renderBuffers,i={inputBuffer:n[0],swapBuffer:n[1],target:null},o=_(t);try{for(o.s();!(r=o.n()).done;){var a=r.value;if(a.postRender){if(a===this.lastPostProcessEffect){i.target=e.target,a.postRender(this.gl,i);break}var s=a.postRender(this.gl,i);i.inputBuffer=s,i.swapBuffer=s===n[0]?n[1]:n[0]}}}catch(t){o.e(t)}finally{o.f()}}}]),t}()},function(t,e,r){"use strict";r.d(e,"a",(function(){return d}));var n=r(24),i=r.n(n),o=r(0),a=r.n(o),s=r(2),u=r.n(s),c=r(3),l=r.n(c);function h(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function f(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?h(Object(r),!0).forEach((function(e){a()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var p={onIninitialize:function(t){return t},onFinalize:function(t){return t},onMessage:null},d=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Transport";u()(this,t),this.name=e,this._messageQueue=[],this.userData={}}return l()(t,null,[{key:"setCallbacks",value:function(t){var e=t.onInitialize,r=t.onFinalize,n=t.onMessage;e&&(p.onInitialize=e),r&&(p.onFinalize=r),n&&(p.onMessage=n)}}]),l()(t,[{key:"getRootDOMElement",value:function(){return"undefined"!=typeof document?document.body:null}},{key:"sendJSONMessage",value:function(){console.error("Back-channel not implemented for this transport")}},{key:"sendBinaryMessage",value:function(){console.error("Back-channel not implemented for this transport")}},{key:"_initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=f({transport:this},t);p.onInitialize(e)}},{key:"_finalize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=f({transport:this},t);p.onFinalize(e),this._destroyed=!0}},{key:"_messageReceived",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t=f({transport:this},t),console.debug("Delivering transport message",t),p.onMessage(t)}}],[{key:"_stringifyJSONSafe",value:function(t){var e=new Set;return JSON.stringify(t,(function(t,r){if("object"===i()(r)&&null!==r){if(e.has(r))try{return JSON.parse(JSON.stringify(r))}catch(t){return}e.add(r)}return r}))}}]),t}()},function(t,e,r){"use strict";(function(t){r.d(e,"a",(function(){return i}));var n=r(166);function i(){return!("object"==typeof t&&"[object process]"===String(t)&&!t.browser)||Object(n.a)()}}).call(this,r(57))},function(t,e,r){"use strict";(function(t){function n(e){if("undefined"!=typeof window&&"object"==typeof window.process&&"renderer"===window.process.type)return!0;if(void 0!==t&&"object"==typeof t.versions&&Boolean(t.versions.electron))return!0;const r="object"==typeof navigator&&"string"==typeof navigator.userAgent&&navigator.userAgent,n=e||r;return!!(n&&n.indexOf("Electron")>=0)}r.d(e,"a",(function(){return n}))}).call(this,r(57))},function(t,e,r){"use strict";r.d(e,"a",(function(){return i}));var n=r(7);function i(t,e,r,i){const o=`See luma.gl ${r} Upgrade Guide at https://luma.gl/docs/upgrade-guide`,a=Object.getPrototypeOf(t);i.forEach(t=>{a.methodName||(a[t]=()=>{throw n.k.removed(`Calling removed method ${e}.${t}: `,o)(),new Error(t)})})}},function(t,e,r){"use strict";r.d(e,"a",(function(){return a}));var n=r(111),i=r(23),o=r(42);class a extends n.a{get ELEMENTS(){return Object(o.a)(!1),0}copy(t){return Object(o.a)(!1),this}get x(){return this[0]}set x(t){this[0]=Object(i.a)(t)}get y(){return this[1]}set y(t){this[1]=Object(i.a)(t)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let t=0;for(let e=0;e<this.ELEMENTS;++e)t+=this[e]*this[e];return t}magnitudeSquared(){return this.lengthSquared()}distance(t){return Math.sqrt(this.distanceSquared(t))}distanceSquared(t){let e=0;for(let r=0;r<this.ELEMENTS;++r){const n=this[r]-t[r];e+=n*n}return Object(i.a)(e)}dot(t){let e=0;for(let r=0;r<this.ELEMENTS;++r)e+=this[r]*t[r];return Object(i.a)(e)}normalize(){const t=this.magnitude();if(0!==t)for(let e=0;e<this.ELEMENTS;++e)this[e]/=t;return this.check()}multiply(...t){for(const e of t)for(let t=0;t<this.ELEMENTS;++t)this[t]*=e[t];return this.check()}divide(...t){for(const e of t)for(let t=0;t<this.ELEMENTS;++t)this[t]/=e[t];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(t){return this.distance(t)}distanceToSquared(t){return this.distanceSquared(t)}getComponent(t){return Object(o.a)(t>=0&&t<this.ELEMENTS,"index is out of range"),Object(i.a)(this[t])}setComponent(t,e){return Object(o.a)(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=e,this.check()}addVectors(t,e){return this.copy(t).add(e)}subVectors(t,e){return this.copy(t).subtract(e)}multiplyVectors(t,e){return this.copy(t).multiply(e)}addScaledVector(t,e){return this.add(new this.constructor(t).multiplyScalar(e))}}},function(t,e,r){"use strict";r.d(e,"a",(function(){return s}));var n=r(111),i=r(23),o=r(13),a=r(42);class s extends n.a{get ELEMENTS(){return Object(a.a)(!1),0}get RANK(){return Object(a.a)(!1),0}toString(){let t="[";if(o.b.printRowMajor){t+="row-major:";for(let e=0;e<this.RANK;++e)for(let r=0;r<this.RANK;++r)t+=` ${this[r*this.RANK+e]}`}else{t+="column-major:";for(let e=0;e<this.ELEMENTS;++e)t+=` ${this[e]}`}return t+="]",t}getElementIndex(t,e){return e*this.RANK+t}getElement(t,e){return this[e*this.RANK+t]}setElement(t,e,r){return this[e*this.RANK+t]=Object(i.a)(r),this}getColumn(t,e=new Array(this.RANK).fill(-0)){const r=t*this.RANK;for(let t=0;t<this.RANK;++t)e[t]=this[r+t];return e}setColumn(t,e){const r=t*this.RANK;for(let t=0;t<this.RANK;++t)this[r+t]=e[t];return this}}},function(t,e,r){"use strict";r.d(e,"a",(function(){return h}));var n=r(0),i=r.n(n),o=r(2),a=r.n(o),s=r(3),u=r.n(s);function c(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function l(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?c(Object(r),!0).forEach((function(e){i()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var h=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};a()(this,t);var n=r.id,i=void 0===n?"pass":n;this.id=i,this.gl=e,this.props=l({},r)}return u()(t,[{key:"setProps",value:function(t){Object.assign(this.props,t)}},{key:"render",value:function(){}},{key:"cleanup",value:function(){}}]),t}()},function(t,e,r){"use strict";r.d(e,"a",(function(){return E}));var n=r(0),i=r.n(n),o=r(2),a=r.n(o),s=r(3),u=r.n(s),c=r(8),l=r.n(c),h=r(5),f=r.n(h),p=r(6),d=r.n(p),A=r(1),g=r.n(A),m=r(85),y=r(7),v=r(18);function _(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function b(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?_(Object(r),!0).forEach((function(e){i()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function x(t){var e=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(t){return!1}}();return function(){var r,n=g()(t);if(e){var i=g()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d()(this,r)}}var w={blendFunc:[1,0,32771,0],blendEquation:32774},E=function(t){f()(r,t);var e=x(r);function r(){return a()(this,r),e.apply(this,arguments)}return u()(r,[{key:"render",value:function(t){return t.pickingFBO?this._drawPickingBuffer(t):l()(g()(r.prototype),"render",this).call(this,t)}},{key:"_drawPickingBuffer",value:function(t){var e=this,n=t.layers,i=t.layerFilter,o=t.views,a=t.viewports,s=t.onViewportActive,u=t.pickingFBO,c=t.deviceRect,h=c.x,f=c.y,p=c.width,d=c.height,A=t.pass,m=void 0===A?"picking":A,v=t.redrawReason,_=t.pickZ,x=this.gl;this.pickZ=_;var E=!_&&{byLayer:new Map,byAlpha:[]};this._colors=E;var O=Object(y.o)(x,b(b({scissorTest:!0,scissor:[h,f,p,d],clearColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]},w),{},{blend:!_}),(function(){return l()(g()(r.prototype),"render",e).call(e,{target:u,layers:n,layerFilter:i,views:o,viewports:a,onViewportActive:s,pass:m,redrawReason:v})}));return this._colors=null,{decodePickingColor:E&&S.bind(null,E),stats:O}}},{key:"shouldDrawLayer",value:function(t){return t.props.pickable}},{key:"getModuleParameters",value:function(){return{pickingActive:1,pickingAttribute:this.pickZ,lightSources:{}}}},{key:"getLayerParameters",value:function(t,e,r){var n=b({},t.props.parameters);return this.pickZ?n.blend=!1:(Object.assign(n,w),n.blend=!0,n.blendColor=function(t,e,r){var n,i=t.byLayer,o=t.byAlpha;if(i.has(e)){var a=i.get(e);a.viewports.push(r),n=a.a}else if((n=i.size+1)<=255){var s={a:n,layer:e,viewports:[r]};i.set(e,s),o[n]=s}else v.a.warn("Too many pickable layers, only picking the first 255")(),n=0;return[0,0,0,n/255]}(this._colors,t,r)),n}}]),r}(m.a);function S(t,e){var r=t.byAlpha[e[3]];return r&&{pickedLayer:r.layer,pickedViewports:r.viewports,pickedObjectIndex:r.layer.decodePickingColor(e)}}},function(t,e,r){"use strict";r.d(e,"a",(function(){return n}));function n(t){const e=i(t);return function(t){const e=i(t);if(!(e.byteLength>=24&&2303741511===e.getUint32(0,!1)))return null;return{mimeType:"image/png",width:e.getUint32(16,!1),height:e.getUint32(20,!1)}}(e)||function(t){const e=i(t);if(!(e.byteLength>=3&&65496===e.getUint16(0,!1)&&255===e.getUint8(2)))return null;const{tableMarkers:r,sofMarkers:n}=function(){const t=new Set([65499,65476,65484,65501,65534]);for(let e=65504;e<65520;++e)t.add(e);const e=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:t,sofMarkers:e}}();let o=2;for(;o+9<e.byteLength;){const t=e.getUint16(o,!1);if(n.has(t))return{mimeType:"image/jpeg",height:e.getUint16(o+5,!1),width:e.getUint16(o+7,!1)};if(!r.has(t))return null;o+=2,o+=e.getUint16(o,!1)}return null}(e)||function(t){const e=i(t);if(!(e.byteLength>=10&&1195984440===e.getUint32(0,!1)))return null;return{mimeType:"image/gif",width:e.getUint16(6,!0),height:e.getUint16(8,!0)}}(e)||function(t){const e=i(t);if(!(e.byteLength>=14&&16973===e.getUint16(0,!1)&&e.getUint32(2,!0)===e.byteLength))return null;return{mimeType:"image/bmp",width:e.getUint32(18,!0),height:e.getUint32(22,!0)}}(e)}function i(t){if(t instanceof DataView)return t;if(ArrayBuffer.isView(t))return new DataView(t.buffer);if(t instanceof ArrayBuffer)return new DataView(t);throw new Error("toDataView")}},function(t,e,r){"use strict";function n(t){for(var e=t.data,r=t.getIndex,n=t.dataRange,i=t.replace,o=n.startRow,a=void 0===o?0:o,s=n.endRow,u=void 0===s?1/0:s,c=e.length,l=c,h=c,f=0;f<c;f++){var p=r(e[f]);if(l>f&&p>=a&&(l=f),p>=u){h=f;break}}for(var d=l,A=h-l!==i.length,g=A&&e.slice(h),m=0;m<i.length;m++)e[d++]=i[m];if(A){for(var y=0;y<g.length;y++)e[d++]=g[y];e.length=d}return{startRow:l,endRow:l+i.length}}r.d(e,"a",(function(){return n}))},function(t,e,r){"use strict";function n(t){var e=document.createElement("link");e.type="text/css",e.rel="stylesheet",e.href=t,document.getElementsByTagName("head")[0].appendChild(e)}function i(t,e){var r=document.createElement("div");return r.style.width=Number.isFinite(t)?"".concat(t,"px"):t,r.style.height="".concat(e,"px"),r.style.position="relative",r}r.d(e,"b",(function(){return n})),r.d(e,"a",(function(){return i}))},function(t,e,r){"use strict";const n={name:"Draco",id:"draco",module:"draco",version:"3.0.8",worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:{draco:{decoderType:"object"==typeof WebAssembly?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}}};var i=r(4);class o{constructor(t,e){Object(i.a)(this,"fields",void 0),Object(i.a)(this,"metadata",void 0),function(t,e){if(!t)throw new Error(e||"loader assertion failed.")}(Array.isArray(t)),function(t){const e={};for(const r of t)e[r.name]&&console.warn("Schema: duplicated field name",r.name,r),e[r.name]=!0}(t),this.fields=t,this.metadata=e||new Map}compareTo(t){if(this.metadata!==t.metadata)return!1;if(this.fields.length!==t.fields.length)return!1;for(let e=0;e<this.fields.length;++e)if(!this.fields[e].compareTo(t.fields[e]))return!1;return!0}select(...t){const e=Object.create(null);for(const r of t)e[r]=!0;const r=this.fields.filter(t=>e[t.name]);return new o(r,this.metadata)}selectAt(...t){const e=t.map(t=>this.fields[t]).filter(Boolean);return new o(e,this.metadata)}assign(t){let e,r=this.metadata;if(t instanceof o){const n=t;e=n.fields,r=a(a(new Map,this.metadata),n.metadata)}else e=t;const n=Object.create(null);for(const t of this.fields)n[t.name]=t;for(const t of e)n[t.name]=t;const i=Object.values(n);return new o(i,r)}}function a(t,e){return new Map([...t||new Map,...e||new Map])}let s,u,c,l,h,f,p,d;!function(t){t[t.NONE=0]="NONE",t[t.Null=1]="Null",t[t.Int=2]="Int",t[t.Float=3]="Float",t[t.Binary=4]="Binary",t[t.Utf8=5]="Utf8",t[t.Bool=6]="Bool",t[t.Decimal=7]="Decimal",t[t.Date=8]="Date",t[t.Time=9]="Time",t[t.Timestamp=10]="Timestamp",t[t.Interval=11]="Interval",t[t.List=12]="List",t[t.Struct=13]="Struct",t[t.Union=14]="Union",t[t.FixedSizeBinary=15]="FixedSizeBinary",t[t.FixedSizeList=16]="FixedSizeList",t[t.Map=17]="Map",t[t.Dictionary=-1]="Dictionary",t[t.Int8=-2]="Int8",t[t.Int16=-3]="Int16",t[t.Int32=-4]="Int32",t[t.Int64=-5]="Int64",t[t.Uint8=-6]="Uint8",t[t.Uint16=-7]="Uint16",t[t.Uint32=-8]="Uint32",t[t.Uint64=-9]="Uint64",t[t.Float16=-10]="Float16",t[t.Float32=-11]="Float32",t[t.Float64=-12]="Float64",t[t.DateDay=-13]="DateDay",t[t.DateMillisecond=-14]="DateMillisecond",t[t.TimestampSecond=-15]="TimestampSecond",t[t.TimestampMillisecond=-16]="TimestampMillisecond",t[t.TimestampMicrosecond=-17]="TimestampMicrosecond",t[t.TimestampNanosecond=-18]="TimestampNanosecond",t[t.TimeSecond=-19]="TimeSecond",t[t.TimeMillisecond=-20]="TimeMillisecond",t[t.TimeMicrosecond=-21]="TimeMicrosecond",t[t.TimeNanosecond=-22]="TimeNanosecond",t[t.DenseUnion=-23]="DenseUnion",t[t.SparseUnion=-24]="SparseUnion",t[t.IntervalDayTime=-25]="IntervalDayTime",t[t.IntervalYearMonth=-26]="IntervalYearMonth"}(s||(s={}));class A{static isNull(t){return t&&t.typeId===s.Null}static isInt(t){return t&&t.typeId===s.Int}static isFloat(t){return t&&t.typeId===s.Float}static isBinary(t){return t&&t.typeId===s.Binary}static isUtf8(t){return t&&t.typeId===s.Utf8}static isBool(t){return t&&t.typeId===s.Bool}static isDecimal(t){return t&&t.typeId===s.Decimal}static isDate(t){return t&&t.typeId===s.Date}static isTime(t){return t&&t.typeId===s.Time}static isTimestamp(t){return t&&t.typeId===s.Timestamp}static isInterval(t){return t&&t.typeId===s.Interval}static isList(t){return t&&t.typeId===s.List}static isStruct(t){return t&&t.typeId===s.Struct}static isUnion(t){return t&&t.typeId===s.Union}static isFixedSizeBinary(t){return t&&t.typeId===s.FixedSizeBinary}static isFixedSizeList(t){return t&&t.typeId===s.FixedSizeList}static isMap(t){return t&&t.typeId===s.Map}static isDictionary(t){return t&&t.typeId===s.Dictionary}get typeId(){return s.NONE}compareTo(t){return this===t}}u=Symbol.toStringTag;class g extends A{constructor(t,e){super(),Object(i.a)(this,"isSigned",void 0),Object(i.a)(this,"bitWidth",void 0),this.isSigned=t,this.bitWidth=e}get typeId(){return s.Int}get[u](){return"Int"}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}class m extends g{constructor(){super(!0,8)}}class y extends g{constructor(){super(!0,16)}}class v extends g{constructor(){super(!0,32)}}class _ extends g{constructor(){super(!1,8)}}class b extends g{constructor(){super(!1,16)}}class x extends g{constructor(){super(!1,32)}}const w=32,E=64;c=Symbol.toStringTag;class S extends A{constructor(t){super(),Object(i.a)(this,"precision",void 0),this.precision=t}get typeId(){return s.Float}get[c](){return"Float"}toString(){return`Float${this.precision}`}}class O extends S{constructor(){super(w)}}class T extends S{constructor(){super(E)}}l=Symbol.toStringTag;h=Symbol.toStringTag;f=Symbol.toStringTag;p=Symbol.toStringTag;d=Symbol.toStringTag;class P extends A{constructor(t,e){super(),Object(i.a)(this,"listSize",void 0),Object(i.a)(this,"children",void 0),this.listSize=t,this.children=[e]}get typeId(){return s.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[d](){return"FixedSizeList"}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}}class M{constructor(t,e,r=!1,n=new Map){Object(i.a)(this,"name",void 0),Object(i.a)(this,"type",void 0),Object(i.a)(this,"nullable",void 0),Object(i.a)(this,"metadata",void 0),this.name=t,this.type=e,this.nullable=r,this.metadata=n}get typeId(){return this.type&&this.type.typeId}clone(){return new M(this.name,this.type,this.nullable,this.metadata)}compareTo(t){return this.name===t.name&&this.type===t.type&&this.nullable===t.nullable&&this.metadata===t.metadata}toString(){return`${this.type}${this.nullable?", nullable":""}${this.metadata?`, metadata: ${this.metadata}`:""}`}}function C(t,e,r){const n=r?I(r.metadata):void 0,i=function(t){switch(t.constructor){case Int8Array:return new m;case Uint8Array:return new _;case Int16Array:return new y;case Uint16Array:return new b;case Int32Array:return new v;case Uint32Array:return new x;case Float32Array:return new O;case Float64Array:return new T;default:throw new Error("array type not supported")}}(e.value);return new M(t,new P(e.size,new M("value",i)),!1,n)}function I(t){const e=new Map;for(const r in t)e.set(`${r}.string`,JSON.stringify(t[r]));return e}const k={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},R={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class L{constructor(t){Object(i.a)(this,"draco",void 0),Object(i.a)(this,"decoder",void 0),Object(i.a)(this,"metadataQuerier",void 0),this.draco=t,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(t,e={}){const r=new this.draco.DecoderBuffer;r.Init(new Int8Array(t),t.byteLength),this._disableAttributeTransforms(e);const n=this.decoder.GetEncodedGeometryType(r),i=n===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let t;switch(n){case this.draco.TRIANGULAR_MESH:t=this.decoder.DecodeBufferToMesh(r,i);break;case this.draco.POINT_CLOUD:t=this.decoder.DecodeBufferToPointCloud(r,i);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!t.ok()||!i.ptr){const e=`DRACO decompression failed: ${t.error_msg()}`;throw new Error(e)}const a=this._getDracoLoaderData(i,n,e),s=this._getMeshData(i,a,e),u=function(t){let e=1/0,r=1/0,n=1/0,i=-1/0,o=-1/0,a=-1/0;const s=t.POSITION?t.POSITION.value:[],u=s&&s.length;for(let t=0;t<u;t+=3){const u=s[t],c=s[t+1],l=s[t+2];e=u<e?u:e,r=c<r?c:r,n=l<n?l:n,i=u>i?u:i,o=c>o?c:o,a=l>a?l:a}return[[e,r,n],[i,o,a]]}(s.attributes),c=function(t,e,r){const n=I(e.metadata),i=[],a=function(t){const e={};for(const r in t){const n=t[r];e[n.name||"undefined"]=n}return e}(e.attributes);for(const e in t){const r=C(e,t[e],a[e]);i.push(r)}if(r){const t=C("indices",r);i.push(t)}return new o(i,n)}(s.attributes,a,s.indices);return{loader:"draco",loaderData:a,header:{vertexCount:i.num_points(),boundingBox:u},...s,schema:c}}finally{this.draco.destroy(r),i&&this.draco.destroy(i)}}_getDracoLoaderData(t,e,r){const n=this._getTopLevelMetadata(t),i=this._getDracoAttributes(t,r);return{geometry_type:e,num_attributes:t.num_attributes(),num_points:t.num_points(),num_faces:t instanceof this.draco.Mesh?t.num_faces():0,metadata:n,attributes:i}}_getDracoAttributes(t,e){const r={};for(let n=0;n<t.num_attributes();n++){const i=this.decoder.GetAttribute(t,n),o=this._getAttributeMetadata(t,n);r[i.unique_id()]={unique_id:i.unique_id(),attribute_type:i.attribute_type(),data_type:i.data_type(),num_components:i.num_components(),byte_offset:i.byte_offset(),byte_stride:i.byte_stride(),normalized:i.normalized(),attribute_index:n,metadata:o};const a=this._getQuantizationTransform(i,e);a&&(r[i.unique_id()].quantization_transform=a);const s=this._getOctahedronTransform(i,e);s&&(r[i.unique_id()].octahedron_transform=s)}return r}_getMeshData(t,e,r){const n=this._getMeshAttributes(e,t,r);if(!n.POSITION)throw new Error("DRACO: No position attribute found.");if(t instanceof this.draco.Mesh)switch(r.topology){case"triangle-strip":return{topology:"triangle-strip",mode:4,attributes:n,indices:{value:this._getTriangleStripIndices(t),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:n,indices:{value:this._getTriangleListIndices(t),size:1}}}return{topology:"point-list",mode:0,attributes:n}}_getMeshAttributes(t,e,r){const n={};for(const i of Object.values(t.attributes)){const t=this._deduceAttributeName(i,r);i.name=t;const{value:o,size:a}=this._getAttributeValues(e,i);n[t]={value:o,size:a,byteOffset:i.byte_offset,byteStride:i.byte_stride,normalized:i.normalized}}return n}_getTriangleListIndices(t){const e=3*t.num_faces(),r=4*e,n=this.draco._malloc(r);try{return this.decoder.GetTrianglesUInt32Array(t,r,n),new Uint32Array(this.draco.HEAPF32.buffer,n,e).slice()}finally{this.draco._free(n)}}_getTriangleStripIndices(t){const e=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(t,e),function(t){const e=t.size(),r=new Int32Array(e);for(let n=0;n<e;n++)r[n]=t.GetValue(n);return r}(e)}finally{this.draco.destroy(e)}}_getAttributeValues(t,e){const r=R[e.data_type],n=e.num_components,i=t.num_points()*n,o=i*r.BYTES_PER_ELEMENT,a=function(t,e){switch(e){case Float32Array:return t.DT_FLOAT32;case Int8Array:return t.DT_INT8;case Int16Array:return t.DT_INT16;case Int32Array:return t.DT_INT32;case Uint8Array:return t.DT_UINT8;case Uint16Array:return t.DT_UINT16;case Uint32Array:return t.DT_UINT32;default:return t.DT_INVALID}}(this.draco,r);let s;const u=this.draco._malloc(o);try{const n=this.decoder.GetAttribute(t,e.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(t,n,a,o,u),s=new r(this.draco.HEAPF32.buffer,u,i).slice()}finally{this.draco._free(u)}return{value:s,size:n}}_deduceAttributeName(t,e){const r=t.unique_id;for(const[t,n]of Object.entries(e.extraAttributes||{}))if(n===r)return t;const n=t.attribute_type;for(const t in k){if(this.draco[t]===n)return k[t]}const i=e.attributeNameEntry||"name";return t.metadata[i]?t.metadata[i].string:`CUSTOM_ATTRIBUTE_${r}`}_getTopLevelMetadata(t){const e=this.decoder.GetMetadata(t);return this._getDracoMetadata(e)}_getAttributeMetadata(t,e){const r=this.decoder.GetAttributeMetadata(t,e);return this._getDracoMetadata(r)}_getDracoMetadata(t){if(!t||!t.ptr)return{};const e={},r=this.metadataQuerier.NumEntries(t);for(let n=0;n<r;n++){const r=this.metadataQuerier.GetEntryName(t,n);e[r]=this._getDracoMetadataField(t,r)}return e}_getDracoMetadataField(t,e){const r=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(t,e,r);const n=function(t){const e=t.size(),r=new Int32Array(e);for(let n=0;n<e;n++)r[n]=t.GetValue(n);return r}(r);return{int:this.metadataQuerier.GetIntEntry(t,e),string:this.metadataQuerier.GetStringEntry(t,e),double:this.metadataQuerier.GetDoubleEntry(t,e),intArray:n}}finally{this.draco.destroy(r)}}_disableAttributeTransforms(t){const{quantizedAttributes:e=[],octahedronAttributes:r=[]}=t,n=[...e,...r];for(const t of n)this.decoder.SkipAttributeTransform(this.draco[t])}_getQuantizationTransform(t,e){const{quantizedAttributes:r=[]}=e,n=t.attribute_type();if(r.map(t=>this.decoder[t]).includes(n)){const e=new this.draco.AttributeQuantizationTransform;try{if(e.InitFromAttribute(t))return{quantization_bits:e.quantization_bits(),range:e.range(),min_values:new Float32Array([1,2,3]).map(t=>e.min_value(t))}}finally{this.draco.destroy(e)}}return null}_getOctahedronTransform(t,e){const{octahedronAttributes:r=[]}=e,n=t.attribute_type();if(r.map(t=>this.decoder[t]).includes(n)){const e=new this.draco.AttributeQuantizationTransform;try{if(e.InitFromAttribute(t))return{quantization_bits:e.quantization_bits()}}finally{this.draco.destroy(e)}}return null}}var j=r(76),D=r(141),B=r(52);const F={};async function z(t,e=null,r={}){return e&&(t=function(t,e,r){if(t.startsWith("http"))return t;const n=r.modules||{};if(n[t])return n[t];if(!j.b)return`modules/${e}/dist/libs/${t}`;if(r.CDN)return Object(B.a)(r.CDN.startsWith("http")),`${r.CDN}/${e}@3.0.8/dist/libs/${t}`;if(j.d)return`../src/libs/${t}`;return`modules/${e}/src/libs/${t}`}(t,e,r)),F[t]=F[t]||async function(t){if(t.endsWith("wasm")){const e=await fetch(t);return await e.arrayBuffer()}if(!j.b)return D.requireFromFile&&await D.requireFromFile(t);if(j.d)return importScripts(t);const e=await fetch(t);return function(t,e){if(!j.b)return D.requireFromString&&D.requireFromString(t,e);if(j.d)return eval.call(j.a,t),null;const r=document.createElement("script");r.id=e;try{r.appendChild(document.createTextNode(t))}catch(e){r.text=t}return document.body.appendChild(r),null}(await e.text(),t)}(t),await F[t]}let N;async function U(t){const e=t.modules||{};return N=e.draco3d?N||e.draco3d.createDecoderModule({}).then(t=>({draco:t})):N||async function(t){let e,r;switch(t.draco&&t.draco.decoderType){case"js":e=await z("https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.js","draco",t);break;case"wasm":default:[e,r]=await Promise.all([await z("https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_wasm_wrapper.js","draco",t),await z("https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.wasm","draco",t)])}return e=e||globalThis.DracoDecoderModule,await function(t,e){const r={};e&&(r.wasmBinary=e);return new Promise(e=>{t({...r,onModuleLoaded:t=>e({draco:t})})})}(e,r)}(t),await N}r.d(e,"a",(function(){return V}));const V={...n,parse:async function(t,e){const{draco:r}=await U(e),n=new L(r);try{return n.parseSync(t,null==e?void 0:e.draco)}finally{n.destroy()}}}},function(t,e,r){"use strict";var n=r(7),i=r(195),o=r(48),a=r(9),s=r(178),u=r(293),c=r(64),l=r(34),h=r(39);let f=null;function p(t,e){var r;return new t((r=t.BYTES_PER_ELEMENT*e,(!f||f.byteLength<r)&&(f=new ArrayBuffer(r)),f),0,e)}var d=r(59),A=r(165),g=r(166);class m extends h.a{static isSupported(t,e={}){return!e.constantAttributeZero||(Object(n.j)(t)||"Chrome"===function(t){if(!t&&!Object(A.a)())return"Node";if(Object(g.a)(t))return"Electron";const e="undefined"!=typeof navigator?navigator:{},r=t||e.userAgent||"";if(r.indexOf("Edge")>-1)return"Edge";const n=-1!==r.indexOf("MSIE "),i=-1!==r.indexOf("Trident/");return n||i?"IE":d.b.chrome?"Chrome":d.b.safari?"Safari":d.b.mozInnerScreenX?"Firefox":"Unknown"}())}static getDefaultArray(t){return t.luma=t.luma||{},t.luma.defaultVertexArray||(t.luma.defaultVertexArray=new m(t,{handle:null,isDefaultArray:!0})),t.luma.defaultVertexArray}static getMaxAttributes(t){return m.MAX_ATTRIBUTES=m.MAX_ATTRIBUTES||t.getParameter(34921),m.MAX_ATTRIBUTES}static setConstant(t,e,r){switch(r.constructor){case Float32Array:m._setConstantFloatArray(t,e,r);break;case Int32Array:m._setConstantIntArray(t,e,r);break;case Uint32Array:m._setConstantUintArray(t,e,r);break;default:Object(a.a)(!1)}}constructor(t,e={}){const r=e.id||e.program&&e.program.id;super(t,Object.assign({},e,{id:r})),this.buffer=null,this.bufferValue=null,this.isDefaultArray=e.isDefaultArray||!1,this.gl2=t,this.initialize(e),Object.seal(this)}delete(){return super.delete(),this.buffer&&this.buffer.delete(),this}get MAX_ATTRIBUTES(){return m.getMaxAttributes(this.gl)}initialize(t={}){return this.setProps(t)}setProps(t){return this}setElementBuffer(t=null,e={}){return Object(a.a)(!t||34963===t.target,"elements must be GL.ELEMENT_ARRAY_BUFFER"),this.bind(()=>{this.gl.bindBuffer(34963,t?t.handle:null)}),this}setBuffer(t,e,r){if(34963===e.target)return this.setElementBuffer(e,r);const{size:i,type:o,stride:s,offset:u,normalized:c,integer:l,divisor:h}=r,{gl:f,gl2:p}=this;return t=Number(t),this.bind(()=>{f.bindBuffer(34962,e.handle),l?(Object(a.a)(Object(n.j)(f)),p.vertexAttribIPointer(t,i,o,s,u)):f.vertexAttribPointer(t,i,o,c,s,u),f.enableVertexAttribArray(t),p.vertexAttribDivisor(t,h||0)}),this}enable(t,e=!0){return!e&&0===t&&!m.isSupported(this.gl,{constantAttributeZero:!0})||(t=Number(t),this.bind(()=>e?this.gl.enableVertexAttribArray(t):this.gl.disableVertexAttribArray(t))),this}getConstantBuffer(t,e){const r=this._normalizeConstantArrayValue(e),n=r.byteLength*t,i=r.length*t;let o=!this.buffer;if(this.buffer=this.buffer||new l.a(this.gl,n),o=o||this.buffer.reallocate(n),o=o||!this._compareConstantArrayValues(r,this.bufferValue),o){const t=p(e.constructor,i);!function({target:t,source:e,start:r=0,count:n=1}){const i=e.length,o=n*i;let a=0;for(let n=r;a<i;a++)t[n++]=e[a];for(;a<o;)a<o-a?(t.copyWithin(r+a,r,r+a),a*=2):(t.copyWithin(r+a,r,r+o-a),a=o)}({target:t,source:r,start:0,count:i}),this.buffer.subData(t),this.bufferValue=e}return this.buffer}_normalizeConstantArrayValue(t){return Array.isArray(t)?new Float32Array(t):t}_compareConstantArrayValues(t,e){if(!t||!e||t.length!==e.length||t.constructor!==e.constructor)return!1;for(let r=0;r<t.length;++r)if(t[r]!==e[r])return!1;return!0}static _setConstantFloatArray(t,e,r){switch(r.length){case 1:t.vertexAttrib1fv(e,r);break;case 2:t.vertexAttrib2fv(e,r);break;case 3:t.vertexAttrib3fv(e,r);break;case 4:t.vertexAttrib4fv(e,r);break;default:Object(a.a)(!1)}}static _setConstantIntArray(t,e,r){switch(Object(a.a)(Object(n.j)(t)),r.length){case 1:t.vertexAttribI1iv(e,r);break;case 2:t.vertexAttribI2iv(e,r);break;case 3:t.vertexAttribI3iv(e,r);break;case 4:t.vertexAttribI4iv(e,r);break;default:Object(a.a)(!1)}}static _setConstantUintArray(t,e,r){switch(Object(a.a)(Object(n.j)(t)),r.length){case 1:t.vertexAttribI1uiv(e,r);break;case 2:t.vertexAttribI2uiv(e,r);break;case 3:t.vertexAttribI3uiv(e,r);break;case 4:t.vertexAttribI4uiv(e,r);break;default:Object(a.a)(!1)}}_createHandle(){return this.gl.createVertexArray()}_deleteHandle(t){return this.gl2.deleteVertexArray(t),[this.elements]}_bindHandle(t){this.gl2.bindVertexArray(t)}_getParameter(t,{location:e}){return Object(a.a)(Number.isFinite(e)),this.bind(()=>{switch(t){case 34373:return this.gl.getVertexAttribOffset(e,t);default:return this.gl.getVertexAttrib(e,t)}})}}var y=r(167);const v=/^(.+)__LOCATION_([0-9]+)$/,_=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"];class b{constructor(t,e={}){const r=e.id||e.program&&e.program.id;this.id=r,this.gl=t,this.configuration=null,this.elements=null,this.elementsAccessor=null,this.values=null,this.accessors=null,this.unused=null,this.drawParams=null,this.buffer=null,this.attributes={},this.vertexArrayObject=new m(t),Object(y.a)(this,"VertexArray","v6.0",_),this.initialize(e),Object.seal(this)}delete(){this.buffer&&this.buffer.delete(),this.vertexArrayObject.delete()}initialize(t={}){return this.reset(),this.configuration=null,this.bindOnUse=!1,this.setProps(t)}reset(){this.elements=null,this.elementsAccessor=null;const{MAX_ATTRIBUTES:t}=this.vertexArrayObject;return this.values=new Array(t).fill(null),this.accessors=new Array(t).fill(null),this.unused={},this.drawParams=null,this}setProps(t){return"program"in t&&(this.configuration=t.program&&t.program.configuration),"configuration"in t&&(this.configuration=t.configuration),"attributes"in t&&this.setAttributes(t.attributes),"elements"in t&&this.setElementBuffer(t.elements),"bindOnUse"in t&&(t=t.bindOnUse),this}clearDrawParams(){this.drawParams=null}getDrawParams(){return this.drawParams=this.drawParams||this._updateDrawParams(),this.drawParams}setAttributes(t){return Object.assign(this.attributes,t),this.vertexArrayObject.bind(()=>{for(const e in t){const r=t[e];this._setAttribute(e,r)}this.gl.bindBuffer(34962,null)}),this}setElementBuffer(t=null,e={}){return this.elements=t,this.elementsAccessor=e,this.clearDrawParams(),this.vertexArrayObject.setElementBuffer(t,e),this}setBuffer(t,e,r={}){if(34963===e.target)return this.setElementBuffer(e,r);const{location:n,accessor:i}=this._resolveLocationAndAccessor(t,e,e.accessor,r);return n>=0&&(this.values[n]=e,this.accessors[n]=i,this.clearDrawParams(),this.vertexArrayObject.setBuffer(n,e,i)),this}setConstant(t,e,r={}){const{location:n,accessor:i}=this._resolveLocationAndAccessor(t,e,Object.assign({size:e.length},r));return n>=0&&(e=this.vertexArrayObject._normalizeConstantArrayValue(e),this.values[n]=e,this.accessors[n]=i,this.clearDrawParams(),this.vertexArrayObject.enable(n,!1)),this}unbindBuffers(){return this.vertexArrayObject.bind(()=>{this.elements&&this.vertexArrayObject.setElementBuffer(null),this.buffer=this.buffer||new l.a(this.gl,{accessor:{size:4}});for(let t=0;t<this.vertexArrayObject.MAX_ATTRIBUTES;t++)this.values[t]instanceof l.a&&(this.gl.disableVertexAttribArray(t),this.gl.bindBuffer(34962,this.buffer.handle),this.gl.vertexAttribPointer(t,1,5126,!1,0,0))}),this}bindBuffers(){return this.vertexArrayObject.bind(()=>{this.elements&&this.setElementBuffer(this.elements);for(let t=0;t<this.vertexArrayObject.MAX_ATTRIBUTES;t++){const e=this.values[t];e instanceof l.a&&this.setBuffer(t,e)}}),this}bindForDraw(t,e,r){let n;return this.vertexArrayObject.bind(()=>{this._setConstantAttributes(t,e),n=r()}),n}_resolveLocationAndAccessor(t,e,r,i){const o={location:-1,accessor:null},{location:s,name:u}=this._getAttributeIndex(t);if(!Number.isFinite(s)||s<0)return this.unused[t]=e,n.k.once(3,()=>`unused value ${t} in ${this.id}`)(),o;const l=this._getAttributeInfo(u||s);if(!l)return o;const h=this.accessors[s]||{},f=c.a.resolve(l.accessor,h,r,i),{size:p,type:d}=f;return Object(a.a)(Number.isFinite(p)&&Number.isFinite(d)),{location:s,accessor:f}}_getAttributeInfo(t){return this.configuration&&this.configuration.getAttributeInfo(t)}_getAttributeIndex(t){const e=Number(t);if(Number.isFinite(e))return{location:e};const r=v.exec(t),n=r?r[1]:t,i=r?Number(r[2]):0;return this.configuration?{location:this.configuration.getAttributeLocation(n)+i,name:n}:{location:-1}}_setAttribute(t,e){if(e instanceof l.a)this.setBuffer(t,e);else if(Array.isArray(e)&&e.length&&e[0]instanceof l.a){const r=e[0],n=e[1];this.setBuffer(t,r,n)}else if(ArrayBuffer.isView(e)||Array.isArray(e)){const r=e;this.setConstant(t,r)}else{if(!(e.buffer instanceof l.a))throw new Error("VertexArray: attributes must be Buffers or constants (i.e. typed array)");{const r=e;this.setBuffer(t,r.buffer,r)}}}_setConstantAttributes(t,e){const r=Math.max(0|t,0|e);let n=this.values[0];ArrayBuffer.isView(n)&&this._setConstantAttributeZero(n,r);for(let t=1;t<this.vertexArrayObject.MAX_ATTRIBUTES;t++)n=this.values[t],ArrayBuffer.isView(n)&&this._setConstantAttribute(t,n)}_setConstantAttributeZero(t,e){if(m.isSupported(this.gl,{constantAttributeZero:!0}))return void this._setConstantAttribute(0,t);const r=this.vertexArrayObject.getConstantBuffer(e,t);this.vertexArrayObject.setBuffer(0,r,this.accessors[0])}_setConstantAttribute(t,e){m.setConstant(this.gl,t,e)}_updateDrawParams(){const t={isIndexed:!1,isInstanced:!1,indexCount:1/0,vertexCount:1/0,instanceCount:1/0};for(let e=0;e<this.vertexArrayObject.MAX_ATTRIBUTES;e++)this._updateDrawParamsForLocation(t,e);return this.elements&&(t.elementCount=this.elements.getElementCount(this.elements.accessor),t.isIndexed=!0,t.indexType=this.elementsAccessor.type||this.elements.accessor.type,t.indexOffset=this.elementsAccessor.offset||0),t.indexCount===1/0&&(t.indexCount=0),t.vertexCount===1/0&&(t.vertexCount=0),t.instanceCount===1/0&&(t.instanceCount=0),t}_updateDrawParamsForLocation(t,e){const r=this.values[e],n=this.accessors[e];if(!r)return;const{divisor:i}=n,o=i>0;if(t.isInstanced=t.isInstanced||o,r instanceof l.a){const e=r;if(o){const r=e.getVertexCount(n);t.instanceCount=Math.min(t.instanceCount,r)}else{const r=e.getVertexCount(n);t.vertexCount=Math.min(t.vertexCount,r)}}}setElements(t=null,e={}){return n.k.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(t,e)}}var x=r(289),w=r(49),E=r(81);function S(t,e={}){const{isInteger:r=!1}=e;if(Array.isArray(t)||ArrayBuffer.isView(t))return function(t,e){const{maxElts:r=16,size:n=1}=e;let i="[";for(let o=0;o<t.length&&o<r;++o)o>0&&(i+=`,${o%n==0?" ":""}`),i+=S(t[o],e);return`${i}${t.length>r?"...":"]"}`}(t,e);if(!Number.isFinite(t))return String(t);if(Math.abs(t)<1e-16)return r?"0":"0.";if(r)return t.toFixed(0);if(Math.abs(t)>100&&Math.abs(t)<1e4)return t.toFixed(0);const n=t.toPrecision(2);return n.indexOf(".0")===n.length-2?n.slice(0,-1):n}function O(t,e,r,n){const{gl:i}=t;if(!e)return{[n]:"null","Format ":"N/A"};let o,a,s,u="NOT PROVIDED",c=1,h=0,f=0;if(r&&(u=r.type,c=r.size,u=String(u).replace("Array",""),o=-1!==u.indexOf("nt")),e instanceof l.a){const t=e,{data:l,changed:p}=t.getDebugData();let d;if(a=p?"*":"",s=l,f=t.byteLength,h=f/l.BYTES_PER_ELEMENT/c,r){d=`${r.divisor>0?"I ":"P "} ${h} (x${c}=${f} bytes ${Object(w.a)(i,u)})`}else o=!0,d=`${f} bytes`;return{[n]:`${a}${S(s,{size:c,isInteger:o})}`,"Format ":d}}return s=e,c=e.length,u=String(e.constructor.name).replace("Array",""),o=-1!==u.indexOf("nt"),{[n]:`${S(s,{size:c,isInteger:o})} (constant)`,"Format ":`${c}x${u} (constant)`}}function T(t,e){const{type:r,size:n}=e,i=Object(E.b)(r,n);return i?`${t} (${i.name})`:t}function P({header:t="Uniforms",program:e,uniforms:r,undefinedOnly:n=!1}){Object(a.a)(e);const i=e._uniformSetters,o={},s=Object.keys(i).sort();let u=0;for(const e of s)e.match(".*_.*")||e.match(".*Matrix")||M({table:o,header:t,uniforms:r,uniformName:e,undefinedOnly:n})&&u++;for(const e of s)e.match(".*Matrix")&&M({table:o,header:t,uniforms:r,uniformName:e,undefinedOnly:n})&&u++;for(const e of s)o[e]||M({table:o,header:t,uniforms:r,uniformName:e,undefinedOnly:n})&&u++;let c=0;const l={};if(!n)for(const e in r){const n=r[e];o[e]||(c++,l[e]={Type:`NOT USED: ${n}`,[t]:S(n)})}return{table:o,count:u,unusedTable:l,unusedCount:c}}function M({table:t,header:e,uniforms:r,uniformName:n,undefinedOnly:i}){const o=r[n],a=function(t){return null!=t}(o);return(!i||!a)&&(t[n]={[e]:a?S(o):"N/A","Uniform Type":a?o:"NOT PROVIDED"},!0)}function C(t){const{type:e,size:r}=t.accessor,n=Object(E.b)(e,r);return n?`${n.name} ${t.name}`:t.name}const I={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function k(t,e){const{attributeMap:r=I}=e||{};return r&&r[t]||t}function R(t,e){let r;switch(t){case"texCoords":case"texCoord1":case"texCoord2":case"texCoord3":r="uvs";break;case"vertices":case"positions":case"normals":case"pickingColors":r="vectors"}switch(r){case"vectors":e.size=e.size||3;break;case"uvs":e.size=e.size||2}Object(a.a)(Number.isFinite(e.size),`attribute ${t} needs size`)}r.d(e,"a",(function(){return D}));const L=()=>{},j={};class D{constructor(t,e={}){const{id:r=Object(o.c)("model")}=e;Object(a.a)(Object(n.i)(t)),this.id=r,this.gl=t,this.id=e.id||Object(o.c)("Model"),this.lastLogTime=0,this.animated=!1,this.initialize(e)}initialize(t){this.props={},this.programManager=t.programManager||i.a.getDefaultProgramManager(this.gl),this._programManagerState=-1,this._managedProgram=!1;const{program:e=null,vs:r,fs:n,modules:o,defines:s,inject:u,varyings:c,bufferMode:l,transpileToGLSL100:h}=t;this.programProps={program:e,vs:r,fs:n,modules:o,defines:s,inject:u,varyings:c,bufferMode:l,transpileToGLSL100:h},this.program=null,this.vertexArray=null,this._programDirty=!0,this.userData={},this.needsRedraw=!0,this._attributes={},this.attributes={},this.uniforms={},this.pickable=!0,this._checkProgram(),this.setUniforms(Object.assign({},this.getModuleUniforms(t.moduleSettings))),this.drawMode=void 0!==t.drawMode?t.drawMode:4,this.vertexCount=t.vertexCount||0,this.geometryBuffers={},this.isInstanced=t.isInstanced||t.instanced||t.instanceCount>0,this._setModelProps(t),this.geometry={},Object(a.a)(void 0!==this.drawMode&&Number.isFinite(this.vertexCount),"Model needs drawMode and vertexCount")}setProps(t){this._setModelProps(t)}delete(){for(const t in this._attributes)this._attributes[t]!==this.attributes[t]&&this._attributes[t].delete();this._managedProgram&&(this.programManager.release(this.program),this._managedProgram=!1),this.vertexArray.delete(),this._deleteGeometryBuffers()}getDrawMode(){return this.drawMode}getVertexCount(){return this.vertexCount}getInstanceCount(){return this.instanceCount}getAttributes(){return this.attributes}getProgram(){return this.program}setProgram(t){const{program:e,vs:r,fs:n,modules:i,defines:o,inject:a,varyings:s,bufferMode:u,transpileToGLSL100:c}=t;this.programProps={program:e,vs:r,fs:n,modules:i,defines:o,inject:a,varyings:s,bufferMode:u,transpileToGLSL100:c},this._programDirty=!0}getUniforms(){return this.uniforms}setDrawMode(t){return this.drawMode=t,this}setVertexCount(t){return Object(a.a)(Number.isFinite(t)),this.vertexCount=t,this}setInstanceCount(t){return Object(a.a)(Number.isFinite(t)),this.instanceCount=t,this}setGeometry(t){return this.drawMode=t.drawMode,this.vertexCount=t.getVertexCount(),this._deleteGeometryBuffers(),this.geometryBuffers=function(t,e,r){const n={};let i=e.indices;for(const o in e.attributes){const a=e.attributes[o],s=k(o,r);if("indices"===o)i=a;else if(a.constant)n[s]=a.value;else{const e=a.value,r={...a};delete r.value,n[s]=[new l.a(t,e),r],R(o,r)}}if(i){const e=i.value||i;Object(a.a)(e instanceof Uint16Array||e instanceof Uint32Array,'attribute array for "indices" must be of integer type');const r={size:1,isIndexed:void 0===i.isIndexed||i.isIndexed};n.indices=[new l.a(t,{data:e,target:34963}),r]}return n}(this.gl,t),this.vertexArray.setAttributes(this.geometryBuffers),this}setAttributes(t={}){if(Object(o.a)(t))return this;const e={};for(const r in t){const n=t[r];e[r]=n.getValue?n.getValue():n}return this.vertexArray.setAttributes(e),this}setUniforms(t={}){return Object.assign(this.uniforms,t),this}getModuleUniforms(t){this._checkProgram();const e=this.programManager.getUniforms(this.program);return e?e(t):{}}updateModuleSettings(t){const e=this.getModuleUniforms(t||{});return this.setUniforms(e)}clear(t){return Object(s.a)(this.program.gl,t),this}draw(t={}){this._checkProgram();const{moduleSettings:e=null,framebuffer:r,uniforms:i={},attributes:o={},transformFeedback:a=this.transformFeedback,parameters:s={},vertexArray:u=this.vertexArray}=t;let c;this.setAttributes(o),this.updateModuleSettings(e),this.setUniforms(i),n.k.priority>=2&&(c=this._logDrawCallStart(2));const l=this.vertexArray.getDrawParams(),{isIndexed:h=l.isIndexed,indexType:f=l.indexType,indexOffset:p=l.indexOffset,vertexArrayInstanced:d=l.isInstanced}=this.props;d&&!this.isInstanced&&n.k.warn("Found instanced attributes on non-instanced model",this.id)();const{isInstanced:A,instanceCount:g}=this,{onBeforeRender:m=L,onAfterRender:y=L}=this.props;m(),this.program.setUniforms(this.uniforms);const v=this.program.draw(Object.assign(j,t,{logPriority:c,uniforms:null,framebuffer:r,parameters:s,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:u,transformFeedback:a,isIndexed:h,indexType:f,isInstanced:A,instanceCount:g,offset:h?p:0}));return y(),n.k.priority>=2&&this._logDrawCallEnd(c,u,r),v}transform(t={}){const{discard:e=!0,feedbackBuffers:r,unbindModels:n=[]}=t;let{parameters:i}=t;r&&this._setFeedbackBuffers(r),e&&(i=Object.assign({},i,{35977:e})),n.forEach(t=>t.vertexArray.unbindBuffers());try{this.draw(Object.assign({},t,{parameters:i}))}finally{n.forEach(t=>t.vertexArray.bindBuffers())}return this}render(t={}){return n.k.warn("Model.render() is deprecated. Use Model.setUniforms() and Model.draw()")(),this.setUniforms(t).draw()}_setModelProps(t){Object.assign(this.props,t),"uniforms"in t&&this.setUniforms(t.uniforms),"pickable"in t&&(this.pickable=t.pickable),"instanceCount"in t&&(this.instanceCount=t.instanceCount),"geometry"in t&&this.setGeometry(t.geometry),"attributes"in t&&this.setAttributes(t.attributes),"_feedbackBuffers"in t&&this._setFeedbackBuffers(t._feedbackBuffers)}_checkProgram(){if(!(this._programDirty||this.programManager.stateHash!==this._programManagerState))return;let{program:t}=this.programProps;if(t)this._managedProgram=!1;else{const{vs:e,fs:r,modules:n,inject:i,defines:o,varyings:a,bufferMode:s,transpileToGLSL100:u}=this.programProps;t=this.programManager.get({vs:e,fs:r,modules:n,inject:i,defines:o,varyings:a,bufferMode:s,transpileToGLSL100:u}),this.program&&this._managedProgram&&this.programManager.release(this.program),this._programManagerState=this.programManager.stateHash,this._managedProgram=!0}Object(a.a)(t instanceof u.a,"Model needs a program"),this._programDirty=!1,t!==this.program&&(this.program=t,this.vertexArray?this.vertexArray.setProps({program:this.program,attributes:this.vertexArray.attributes}):this.vertexArray=new b(this.gl,{program:this.program}),this.setUniforms(Object.assign({},this.getModuleUniforms())))}_deleteGeometryBuffers(){for(const t in this.geometryBuffers){const e=this.geometryBuffers[t][0]||this.geometryBuffers[t];e instanceof l.a&&e.delete()}}_setAnimationProps(t){this.animated&&Object(a.a)(t,"Model.draw(): animated uniforms but no animationProps")}_setFeedbackBuffers(t={}){if(Object(o.a)(t))return this;const{gl:e}=this.program;return this.transformFeedback=this.transformFeedback||new x.a(e,{program:this.program}),this.transformFeedback.setBuffers(t),this}_logDrawCallStart(t){const e=t>3?0:1e4;if(!(Date.now()-this.lastLogTime<e))return this.lastLogTime=Date.now(),n.k.group(2,`>>> DRAWING MODEL ${this.id}`,{collapsed:n.k.level<=2})(),t}_logDrawCallEnd(t,e,r,i){if(void 0===t)return;const o=function({vertexArray:t,header:e="Attributes"}){if(!t.configuration)return{};const r={};t.elements&&(r.ELEMENT_ARRAY_BUFFER=O(t,t.elements,null,e));const n=t.values;for(const i in n){const o=t._getAttributeInfo(i);if(o){let a=`${i}: ${o.name}`;const s=t.accessors[o.location];s&&(a=`${i}: ${T(o.name,s)}`),r[a]=O(t,n[i],s,e)}}return r}({vertexArray:e,header:`${this.id} attributes`,attributes:this._attributes}),{table:a,unusedTable:s,unusedCount:u}=P({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,r)}),{table:c,count:l}=P({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,r),undefinedOnly:!0});l>0&&n.k.log("MISSING UNIFORMS",Object.keys(c))(),u>0&&n.k.log("UNUSED UNIFORMS",Object.keys(s))();const h=function(t){const e={},r=`Accessors for ${t.id}`;for(const n of t.attributeInfos)if(n){e[`in ${C(n)}`]={[r]:JSON.stringify(n.accessor)}}for(const n of t.varyingInfos)if(n){e[`out ${C(n)}`]={[r]:JSON.stringify(n.accessor)}}return e}(this.vertexArray.configuration);n.k.table(t,o)(),n.k.table(t,a)(),n.k.table(t+1,h)(),i&&i.log({logLevel:2,message:`Rendered to ${i.id}`}),n.k.groupEnd(2,`>>> DRAWING MODEL ${this.id}`)()}}},function(t,e,r){"use strict";function n(t,e){if(!t)throw new Error(e||"shadertools: assertion failed.")}r.d(e,"a",(function(){return n}))},function(t,e,r){"use strict";r.d(e,"a",(function(){return o})),r.d(e,"b",(function(){return a}));var n=r(7),i=r(9);function o(t,{framebuffer:e=null,color:r=null,depth:o=null,stencil:a=null}={}){const s={};e&&(s.framebuffer=e);let u=0;r&&(u|=16384,!0!==r&&(s.clearColor=r)),o&&(u|=256,!0!==o&&(s.clearDepth=o)),a&&(u|=1024,!0!==o&&(s.clearStencil=o)),Object(i.a)(0!==u,"clear: bad arguments"),Object(n.o)(t,s,()=>{t.clear(u)})}function a(t,{framebuffer:e=null,buffer:r=6144,drawBuffer:o=0,value:a=[0,0,0,0]}={}){Object(n.a)(t),Object(n.o)(t,{framebuffer:e},()=>{switch(r){case 6144:switch(a.constructor){case Int32Array:t.clearBufferiv(r,o,a);break;case Uint32Array:t.clearBufferuiv(r,o,a);break;case Float32Array:default:t.clearBufferfv(r,o,a)}break;case 6145:t.clearBufferfv(6145,0,[a]);break;case 6146:t.clearBufferiv(6146,0,[a]);break;case 34041:const[e,n]=a;t.clearBufferfi(34041,0,e,n);break;default:Object(i.a)(!1,"clear: bad arguments")}})}},function(t,e,r){"use strict";r.d(e,"a",(function(){return o}));var n=r(71),i=r(98);const o={WEBGL2:"WEBGL2",VERTEX_ARRAY_OBJECT:"VERTEX_ARRAY_OBJECT",TIMER_QUERY:"TIMER_QUERY",INSTANCED_RENDERING:"INSTANCED_RENDERING",MULTIPLE_RENDER_TARGETS:"MULTIPLE_RENDER_TARGETS",ELEMENT_INDEX_UINT32:"ELEMENT_INDEX_UINT32",BLEND_EQUATION_MINMAX:"BLEND_EQUATION_MINMAX",FLOAT_BLEND:"FLOAT_BLEND",COLOR_ENCODING_SRGB:"COLOR_ENCODING_SRGB",TEXTURE_DEPTH:"TEXTURE_DEPTH",TEXTURE_FLOAT:"TEXTURE_FLOAT",TEXTURE_HALF_FLOAT:"TEXTURE_HALF_FLOAT",TEXTURE_FILTER_LINEAR_FLOAT:"TEXTURE_FILTER_LINEAR_FLOAT",TEXTURE_FILTER_LINEAR_HALF_FLOAT:"TEXTURE_FILTER_LINEAR_HALF_FLOAT",TEXTURE_FILTER_ANISOTROPIC:"TEXTURE_FILTER_ANISOTROPIC",COLOR_ATTACHMENT_RGBA32F:"COLOR_ATTACHMENT_RGBA32F",COLOR_ATTACHMENT_FLOAT:"COLOR_ATTACHMENT_FLOAT",COLOR_ATTACHMENT_HALF_FLOAT:"COLOR_ATTACHMENT_HALF_FLOAT",GLSL_FRAG_DATA:"GLSL_FRAG_DATA",GLSL_FRAG_DEPTH:"GLSL_FRAG_DEPTH",GLSL_DERIVATIVES:"GLSL_DERIVATIVES",GLSL_TEXTURE_LOD:"GLSL_TEXTURE_LOD"};e.b={[o.WEBGL2]:[!1,!0],[o.VERTEX_ARRAY_OBJECT]:["OES_vertex_array_object",!0],[o.TIMER_QUERY]:["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"],[o.INSTANCED_RENDERING]:["ANGLE_instanced_arrays",!0],[o.MULTIPLE_RENDER_TARGETS]:["WEBGL_draw_buffers",!0],[o.ELEMENT_INDEX_UINT32]:["OES_element_index_uint",!0],[o.BLEND_EQUATION_MINMAX]:["EXT_blend_minmax",!0],[o.FLOAT_BLEND]:["EXT_float_blend"],[o.COLOR_ENCODING_SRGB]:["EXT_sRGB",!0],[o.TEXTURE_DEPTH]:["WEBGL_depth_texture",!0],[o.TEXTURE_FLOAT]:["OES_texture_float",!0],[o.TEXTURE_HALF_FLOAT]:["OES_texture_half_float",!0],[o.TEXTURE_FILTER_LINEAR_FLOAT]:["OES_texture_float_linear"],[o.TEXTURE_FILTER_LINEAR_HALF_FLOAT]:["OES_texture_half_float_linear"],[o.TEXTURE_FILTER_ANISOTROPIC]:["EXT_texture_filter_anisotropic"],[o.COLOR_ATTACHMENT_RGBA32F]:[function(t){const e=new i.a(t,{format:6408,type:5126,dataFormat:6408}),r=new n.a(t,{id:"test-framebuffer",check:!1,attachments:{36064:e}}),o=r.getStatus();return e.delete(),r.delete(),36053===o},"EXT_color_buffer_float"],[o.COLOR_ATTACHMENT_FLOAT]:[!1,"EXT_color_buffer_float"],[o.COLOR_ATTACHMENT_HALF_FLOAT]:["EXT_color_buffer_half_float"],[o.GLSL_FRAG_DATA]:["WEBGL_draw_buffers",!0],[o.GLSL_FRAG_DEPTH]:["EXT_frag_depth",!0],[o.GLSL_DERIVATIVES]:["OES_standard_derivatives",!0],[o.GLSL_TEXTURE_LOD]:["EXT_shader_texture_lod",!0]}},function(t,e,r){"use strict";var n=r(75),i=r(177);r.d(e,"a",(function(){return a})),r.d(e,"c",(function(){return l})),r.d(e,"b",(function(){return h}));const o={[n.b]:"#ifdef MODULE_LOGDEPTH\n logdepth_adjustPosition(gl_Position);\n#endif\n",[n.a]:"#ifdef MODULE_MATERIAL\n gl_FragColor = material_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n gl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_FOG\n gl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_PICKING\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n logdepth_setFragDepth();\n#endif\n"},a="__LUMA_INJECT_DECLARATIONS__",s=/void\s+main\s*\([^)]*\)\s*\{\n?/,u=/}\n?[^{}]*$/,c=[];function l(t,e,r,i=!1){const l=e===n.b;for(const e in r){const n=r[e];n.sort((t,e)=>t.order-e.order),c.length=n.length;for(let t=0,e=n.length;t<e;++t)c[t]=n[t].injection;const i=`${c.join("\n")}\n`;switch(e){case"vs:#decl":l&&(t=t.replace(a,i));break;case"vs:#main-start":l&&(t=t.replace(s,t=>t+i));break;case"vs:#main-end":l&&(t=t.replace(u,t=>i+t));break;case"fs:#decl":l||(t=t.replace(a,i));break;case"fs:#main-start":l||(t=t.replace(s,t=>t+i));break;case"fs:#main-end":l||(t=t.replace(u,t=>i+t));break;default:t=t.replace(e,t=>t+i)}}return t=t.replace(a,""),i&&(t=t.replace(/\}\s*$/,t=>t+o[e])),t}function h(t){const e={};return Object(i.a)(Array.isArray(t)&&t.length>1),t.forEach(t=>{for(const r in t)e[r]=e[r]?`${e[r]}\n${t[r]}`:t[r]}),e}},,,,,function(t,e,r){"use strict";(function(t){var n=r(123);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){if("undefined"!=typeof window&&"object"===(0,i.default)(window.process)&&"renderer"===window.process.type)return!0;if(void 0!==t&&"object"===(0,i.default)(t.versions)&&Boolean(t.versions.electron))return!0;var r="object"===("undefined"==typeof navigator?"undefined":(0,i.default)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,n=e||r;if(n&&n.indexOf("Electron")>=0)return!0;return!1};var i=n(r(24))}).call(this,r(57))},function(t,e,r){"use strict";r.r(e);var n=r(10),i=r.n(n),o=r(0),a=r.n(o),s=r(2),u=r.n(s),c=r(3),l=r.n(c),h=r(24),f=r.n(h);function p(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(!t)throw new Error("JSON conversion error ".concat(e))}function d(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return A(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return A(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function A(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function g(t,e){var r,n=t,i=d(function(t){if("string"==typeof t){var e=y[t];return e||(e=t.split("."),y[t]=e),e}return Array.isArray(t)?t:[t]}(e));try{for(i.s();!(r=i.n()).done;){var o=r.value;n=m(n)?n[o]:void 0}}catch(t){i.e(t)}finally{i.f()}return n}function m(t){return null!==t&&"object"===f()(t)}var y={};var v=r(194),_=r.n(v),b={"-":function(t){return t}};function x(t,e){if(t in b)return b[t];var r,n=_.a.parse(t);return n.right||n.left||"Identifier"!==n.type?(!function t(e,r){if(Array.isArray(e))e.forEach((function(e){return t(e,r)}));else if(e&&"object"===f()(e))for(var n in e.type&&r(e),e)t(e[n],r)}(n,(function(t){if("CallExpression"===t.type)throw new Error("Function calls not allowed in JSON expressions")})),r=function(t){return _.a.eval(n,t)}):r=function(e){return g(e,t)},b[t]=r,r}var w=function(t){return t&&"object"===f()(t)},E=function(){function t(){u()(this,t),this.typeKey="@@type",this.functionKey="@@function",this.log=console,this.classes={},this.reactComponents={},this.enumerations={},this.constants={},this.functions={},this.convertFunction=x,this.preProcessClassProps=function(t,e){return e},this.postProcessConvertedJson=function(t){return t};for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];for(var i=0,o=r;i<o.length;i++){var a=o[i];this.merge(a)}}return l()(t,[{key:"merge",value:function(t){for(var e in t)switch(e){case"layers":case"views":Object.assign(this.classes,t[e]);break;default:if(e in this){var r=t[e];this[e]=w(this[e])?Object.assign(this[e],r):r}}}},{key:"validate",value:function(t){return p(!this.typeKey||"string"==typeof this.typeKey),p(w(this.classes)),!0}}]),t}();function S(t){return t.replace("@@=","")}function O(t,e){var r,n={};for(var i in t){var o=t[i];"string"==typeof(r=o)&&r.startsWith("@@=")&&(o=x(o=S(o))),n[i]=o}return n}function T(t,e,r){var n=r.classes[t],i=r.reactComponents[t];if(!n&&!i){var o=r.log,a=JSON.stringify(e,null,0).slice(0,40);return o&&o.warn("JSON converter: No registered class of type ".concat(t,"(").concat(a,"...) ")),null}return n?function(t,e,r){r.preProcessClassProps&&(e=r.preProcessClassProps(t,e,r));return e=O(e),new t(e)}(n,e,r):function(t,e,r){var n=r.React,i=e.children,o=void 0===i?[]:i;delete e.children,r.preProcessClassProps&&(e=r.preProcessClassProps(t,e,r));return e=O(e),n.createElement(t,e,o)}(i,e,r)}function P(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function M(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?P(Object(r),!0).forEach((function(e){a()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):P(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var C=function(t){return t&&"object"===f()(t)},I=function(){function t(e){u()(this,t),this.log=console,this.configuration={},this.onJSONChange=function(){},this.json=null,this.convertedJson=null,this.setProps(e)}return l()(t,[{key:"finalize",value:function(){}},{key:"setProps",value:function(t){"configuration"in t&&(this.configuration=t.configuration instanceof E?t.configuration:new E(t.configuration)),"onJSONChange"in t&&(this.onJSONChange=t.onJSONChange)}},{key:"mergeConfiguration",value:function(t){this.configuration.merge(t)}},{key:"convert",value:function(t){if(!t||t===this.json)return this.convertedJson;this.json=t;var e=function(t,e){return e=new E(e),k(t,"",e)}(function(t){return"string"==typeof t?JSON.parse(t):t}(t),this.configuration);return e=this.configuration.postProcessConvertedJson(e),this.convertedJson=e,e}},{key:"convertJson",value:function(t){return this.convert(t)}}]),t}();function k(t,e,r){return Array.isArray(t)?t.map((function(t,e){return k(t,String(e),r)})):function(t,e){var r=e.typeKey;return C(t)&&Boolean(t[r])}(t,r)?function(t,e){var r=e.typeKey,n=t[r],i=M({},t);return delete i[r],i=R(i,e),T(n,i,e)}(t,r):C(t)?"@@function"in t?function(t,e){var r=e.functionKey,n=M({},t);delete n[r],n=R(n,e);var i=t[r],o=e.functions[i];return p(o,"Function ".concat(i," not found.")),o(n)}(t,r):R(t,r):"string"==typeof t?function(t,e,r){if(t.startsWith("@@=")&&r.convertFunction)return t=t.replace("@@=",""),r.convertFunction(t,r);if(t.startsWith("@@#")){if(t=t.replace("@@#",""),r.constants[t])return r.constants[t];var n=t.split("."),o=i()(n,2),a=o[0],s=o[1];return r.enumerations[a][s]}return t}(t,0,r):t}function R(t,e){p(C(t));var r={};for(var n in t){var i=t[n];r[n]=k(i,0,e)}return r}var L=r(164);function j(t,e){if(t===e)return!0;if("object"!==f()(t)||null===t||"object"!==f()(e)||null===e)return!1;if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var r in t)if(!(r in e)||t[r]!==e[r])return!1;for(var n in e)if(!(n in t))return!1;return!0}r.d(e,"JSONConverter",(function(){return I})),r.d(e,"JSONConfiguration",(function(){return E})),r.d(e,"Transport",(function(){return L.a})),r.d(e,"_convertFunctions",(function(){return O})),r.d(e,"_parseExpressionString",(function(){return x})),r.d(e,"_shallowEqualObjects",(function(){return j}))},function(t,e,r){"use strict";var n=r(4),i=r(76),o=r(52);const a=new Map;function s(t){Object(o.a)(t.source&&!t.url||!t.source&&t.url);let e=a.get(t.source||t.url);return e||(t.url&&(e=function(t){if(!t.startsWith("http"))return t;return u((e=t,`try {\n importScripts('${e}');\n} catch (error) {\n console.error(error);\n throw error;\n}`));var e}(t.url),a.set(t.url,e)),t.source&&(e=u(t.source),a.set(t.source,e))),Object(o.a)(e),e}function u(t){const e=new Blob([t],{type:"application/javascript"});return URL.createObjectURL(e)}function c(t){return!!t&&(t instanceof ArrayBuffer||("undefined"!=typeof MessagePort&&t instanceof MessagePort||("undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas)))}const l=()=>{};class h{static isSupported(){return"undefined"!=typeof Worker}constructor(t){Object(n.a)(this,"name",void 0),Object(n.a)(this,"source",void 0),Object(n.a)(this,"url",void 0),Object(n.a)(this,"terminated",!1),Object(n.a)(this,"worker",void 0),Object(n.a)(this,"onMessage",void 0),Object(n.a)(this,"onError",void 0),Object(n.a)(this,"_loadableURL","");const{name:e,source:r,url:i}=t;Object(o.a)(r||i),this.name=e,this.source=r,this.url=i,this.onMessage=l,this.onError=t=>console.log(t),this.worker=this._createBrowserWorker()}destroy(){this.onMessage=l,this.onError=l,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(t,e){e=e||function t(e,r=!0,n){const i=n||new Set;if(e){if(c(e))i.add(e);else if(c(e.buffer))i.add(e.buffer);else if(ArrayBuffer.isView(e));else if(r&&"object"==typeof e)for(const n in e)t(e[n],r,i)}else;return void 0===n?Array.from(i):[]}(t),this.worker.postMessage(t,e)}_getErrorFromErrorEvent(t){let e="Failed to load ";return e+=`worker ${this.name}. `,t.message&&(e+=`${t.message} in `),t.lineno&&(e+=`:${t.lineno}:${t.colno}`),new Error(e)}_createBrowserWorker(){this._loadableURL=s({source:this.source,url:this.url});const t=new Worker(this._loadableURL,{name:this.name});return t.onmessage=t=>{t.data?this.onMessage(t.data):this.onError(new Error("No data received"))},t.onerror=t=>{this.onError(this._getErrorFromErrorEvent(t)),this.terminated=!0},t.onmessageerror=t=>console.error(t),t}}class f{constructor(t,e){Object(n.a)(this,"name",void 0),Object(n.a)(this,"workerThread",void 0),Object(n.a)(this,"isRunning",void 0),Object(n.a)(this,"result",void 0),Object(n.a)(this,"_resolve",void 0),Object(n.a)(this,"_reject",void 0),this.name=t,this.workerThread=e,this.isRunning=!0,this._resolve=()=>{},this._reject=()=>{},this.result=new Promise((t,e)=>{this._resolve=t,this._reject=e})}postMessage(t,e){this.workerThread.postMessage({source:"loaders.gl",type:t,payload:e})}done(t){Object(o.a)(this.isRunning),this.isRunning=!1,this._resolve(t)}error(t){Object(o.a)(this.isRunning),this.isRunning=!1,this._reject(t)}}class p{constructor(t){Object(n.a)(this,"name","unnamed"),Object(n.a)(this,"source",void 0),Object(n.a)(this,"url",void 0),Object(n.a)(this,"maxConcurrency",1),Object(n.a)(this,"maxMobileConcurrency",1),Object(n.a)(this,"onDebug",()=>{}),Object(n.a)(this,"reuseWorkers",!0),Object(n.a)(this,"props",{}),Object(n.a)(this,"jobQueue",[]),Object(n.a)(this,"idleQueue",[]),Object(n.a)(this,"count",0),Object(n.a)(this,"isDestroyed",!1),this.source=t.source,this.url=t.url,this.setProps(t)}destroy(){this.idleQueue.forEach(t=>t.destroy()),this.isDestroyed=!0}setProps(t){this.props={...this.props,...t},void 0!==t.name&&(this.name=t.name),void 0!==t.maxConcurrency&&(this.maxConcurrency=t.maxConcurrency),void 0!==t.maxMobileConcurrency&&(this.maxMobileConcurrency=t.maxMobileConcurrency),void 0!==t.reuseWorkers&&(this.reuseWorkers=t.reuseWorkers),void 0!==t.onDebug&&(this.onDebug=t.onDebug)}async startJob(t,e=((t,e,r)=>t.done(r)),r=((t,e)=>t.error(e))){const n=new Promise(n=>(this.jobQueue.push({name:t,onMessage:e,onError:r,onStart:n}),this));return this._startQueuedJob(),await n}async _startQueuedJob(){if(!this.jobQueue.length)return;const t=this._getAvailableWorker();if(!t)return;const e=this.jobQueue.shift();if(e){this.onDebug({message:"Starting job",name:e.name,workerThread:t,backlog:this.jobQueue.length});const r=new f(e.name,t);t.onMessage=t=>e.onMessage(r,t.type,t.payload),t.onError=t=>e.onError(r,t),e.onStart(r);try{await r.result}finally{this.returnWorkerToQueue(t)}}}returnWorkerToQueue(t){this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(t.destroy(),this.count--):this.idleQueue.push(t),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;const t=`${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;return new h({name:t,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return i.c?this.maxMobileConcurrency:this.maxConcurrency}}const d={maxConcurrency:3,maxMobileConcurrency:1,onDebug:()=>{},reuseWorkers:!0};class A{static isSupported(){return h.isSupported()}static getWorkerFarm(t={}){return A._workerFarm=A._workerFarm||new A({}),A._workerFarm.setProps(t),A._workerFarm}constructor(t){Object(n.a)(this,"props",void 0),Object(n.a)(this,"workerPools",new Map),this.props={...d},this.setProps(t),this.workerPools=new Map}destroy(){for(const t of this.workerPools.values())t.destroy()}setProps(t){this.props={...this.props,...t};for(const t of this.workerPools.values())t.setProps(this._getWorkerPoolProps())}getWorkerPool(t){const{name:e,source:r,url:n}=t;let i=this.workerPools.get(e);return i||(i=new p({name:e,source:r,url:n}),i.setProps(this._getWorkerPoolProps()),this.workerPools.set(e,i)),i}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}Object(n.a)(A,"_workerFarm",void 0);function g(t,e){return!!A.isSupported()&&(t.worker&&(null==e?void 0:e.worker))}async function m(t,e,r,n,i){const a=t.id,s=function(t,e={}){const r=e[t.id]||{},n=`${t.id}-worker.js`;let i=r.workerUrl;if("test"===e._workerType&&(i=`modules/${t.module}/dist/${n}`),!i){let e=t.version;"latest"===e&&(e="latest");const r=e?`@${e}`:"";i=`https://unpkg.com/@loaders.gl/${t.module}${r}/dist/${n}`}return Object(o.a)(i),i}(t,r),u=A.getWorkerFarm(r).getWorkerPool({name:a,url:s});r=JSON.parse(JSON.stringify(r));const c=await u.startJob("process-on-worker",y.bind(null,i));c.postMessage("process",{input:e,options:r});const l=await c.result;return await l.result}async function y(t,e,r,n){switch(r){case"done":e.done(n);break;case"error":e.error(n.error);break;case"process":const{id:i,input:o,options:a}=n;try{const r=await t(o,a);e.postMessage("done",{id:i,result:r})}catch(t){const r=t instanceof Error?t.message:"unknown error";e.postMessage("error",{id:i,error:r})}break;default:console.warn(`parse-with-worker unknown message ${r}`)}}r.d(e,"a",(function(){return g})),r.d(e,"b",(function(){return m}))},function(t,e,r){"use strict";r.r(e),r.d(e,"default",(function(){return A}));var n=r(2),i=r.n(n),o=r(3),a=r.n(o),s=r(5),u=r.n(s),c=r(6),l=r.n(c),h=r(1),f=r.n(h),p=r(164);function d(t){var e=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(t){return!1}}();return function(){var r,n=f()(t);if(e){var i=f()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return l()(this,r)}}var A=function(t){u()(r,t);var e=d(r);function r(){var t;return i()(this,r),(t=e.call(this,"Jupyter Transport (JavaScript <=> Jupyter Kernel)")).jupyterModel=null,t.jupyterView=null,t}return a()(r,[{key:"getRootDOMElement",value:function(){return this.jupyterView.el}},{key:"sendJSONMessage",value:function(t,e){var r=p.a._stringifyJSONSafe({type:t,data:e});this.jupyterModel.send(r)}}]),r}(p.a)},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}},function(t,e,r){"use strict";r.d(e,"a",(function(){return S}));var n=r(0),i=r.n(n),o=r(2),a=r.n(o),s=r(3),u=r.n(s),c=r(8),l=r.n(c),h=r(5),f=r.n(h),p=r(6),d=r.n(p),A=r(1),g=r.n(A),m=r(155),y=r(32),v=r(66);function _(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return b(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return b(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function b(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function x(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function w(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?x(Object(r),!0).forEach((function(e){i()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function E(t){var e=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(t){return!1}}();return function(){var r,n=g()(t);if(e){var i=g()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d()(this,r)}}var S=function(t){f()(r,t);var e=E(r);function r(){return a()(this,r),e.apply(this,arguments)}return u()(r,[{key:"getSubLayers",value:function(){return this.internalState&&this.internalState.subLayers||[]}},{key:"initializeState",value:function(){}},{key:"setState",value:function(t){l()(g()(r.prototype),"setState",this).call(this,t),this.setNeedsUpdate()}},{key:"getPickingInfo",value:function(t){var e=t.info,r=e.object;return r&&r.__source&&r.__source.parent&&r.__source.parent.id===this.id?(e.object=r.__source.object,e.index=r.__source.index,e):e}},{key:"renderLayers",value:function(){return null}},{key:"filterSubLayer",value:function(t){return!0}},{key:"shouldRenderSubLayer",value:function(t,e){return e&&e.length}},{key:"getSubLayerClass",value:function(t,e){var r=this.props._subLayerProps;return r&&r[t]&&r[t].type||e}},{key:"getSubLayerRow",value:function(t,e,r){return t.__source={parent:this,object:e,index:r},t}},{key:"getSubLayerAccessor",value:function(t){if("function"==typeof t){var e={data:this.props.data,target:[]};return function(r,n){return r&&r.__source?(e.index=r.__source.index,t(r.__source.object,e)):t(r,n)}}return t}},{key:"getSubLayerProps",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.props,r=e.opacity,n=e.pickable,i=e.visible,o=e.parameters,a=e.getPolygonOffset,s=e.highlightedObjectIndex,u=e.autoHighlight,c=e.highlightColor,l=e.coordinateSystem,h=e.coordinateOrigin,f=e.wrapLongitude,p=e.positionFormat,d=e.modelMatrix,A=e.extensions,g=e.fetch,m=e._subLayerProps,y={opacity:r,pickable:n,visible:i,parameters:o,getPolygonOffset:a,highlightedObjectIndex:s,autoHighlight:u,highlightColor:c,coordinateSystem:l,coordinateOrigin:h,wrapLongitude:f,positionFormat:p,modelMatrix:d,extensions:A,fetch:g},v=m&&m[t.id],b=v&&v.updateTriggers,x=t.id||"sublayer";if(v){var E=this.constructor._propTypes,S=t.type?t.type._propTypes:{};for(var O in v){var T=S[O]||E[O];T&&"accessor"===T.type&&(v[O]=this.getSubLayerAccessor(v[O]))}}Object.assign(y,t,v),y.id="".concat(this.props.id,"-").concat(x),y.updateTriggers=w(w({all:this.props.updateTriggers.all},t.updateTriggers),b);var P,M=_(A);try{for(M.s();!(P=M.n()).done;){var C=P.value,I=C.getSubLayerProps.call(this,C);I&&Object.assign(y,I,{updateTriggers:Object.assign(y.updateTriggers,I.updateTriggers)})}}catch(t){M.e(t)}finally{M.f()}return y}},{key:"_updateAutoHighlight",value:function(t){var e,r=_(this.getSubLayers());try{for(r.s();!(e=r.n()).done;){e.value.updateAutoHighlight(t)}}catch(t){r.e(t)}finally{r.f()}}},{key:"_getAttributeManager",value:function(){return null}},{key:"_renderLayers",value:function(){var t=this.internalState.subLayers,e=!t||this.needsUpdate();e&&(t=this.renderLayers(),t=Object(v.b)(t,Boolean),this.internalState.subLayers=t),Object(y.a)("compositeLayer.renderLayers",this,e,t);var r,n=_(t);try{for(n.s();!(r=n.n()).done;){r.value.parent=this}}catch(t){n.e(t)}finally{n.f()}}},{key:"isComposite",get:function(){return!0}},{key:"isLoaded",get:function(){return l()(g()(r.prototype),"isLoaded",this)&&this.getSubLayers().every((function(t){return t.isLoaded}))}}]),r}(m.a);S.layerName="CompositeLayer"},function(t,e,r){"use strict";var n=r(0),i=r.n(n),o=r(2),a=r.n(o),s=r(3),u=r.n(s),c=r(161),l=r(72),h=r(18),f=r(66);function p(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function d(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?p(Object(r),!0).forEach((function(e){i()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var A=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};a()(this,t),this.views=[],this.width=100,this.height=100,this.viewState={},this.controllers={},this.timeline=e.timeline,this._viewports=[],this._viewportMap={},this._isUpdating=!1,this._needsRedraw="Initial render",this._needsUpdate=!0,this._eventManager=e.eventManager,this._eventCallbacks={onViewStateChange:e.onViewStateChange,onInteractionStateChange:e.onInteractionStateChange},Object.seal(this),this.setProps(e)}return u()(t,[{key:"finalize",value:function(){for(var t in this.controllers)this.controllers[t]&&this.controllers[t].finalize();this.controllers={}}},{key:"needsRedraw",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},e=this._needsRedraw;return t.clearRedrawFlags&&(this._needsRedraw=!1),e}},{key:"setNeedsUpdate",value:function(t){this._needsUpdate=this._needsUpdate||t,this._needsRedraw=this._needsRedraw||t}},{key:"updateViewStates",value:function(){for(var t in this.controllers){var e=this.controllers[t];e&&e.updateTransition()}}},{key:"getViewports",value:function(t){return t?this._viewports.filter((function(e){return e.containsPixel(t)})):this._viewports}},{key:"getViews",value:function(){var t={};return this.views.forEach((function(e){t[e.id]=e})),t}},{key:"getView",value:function(t){return"string"==typeof t?this.views.find((function(e){return e.id===t})):t}},{key:"getViewState",value:function(t){var e=this.getView(t),r=e&&this.viewState[e.getViewStateId()]||this.viewState;return e?e.filterViewState(r):r}},{key:"getViewport",value:function(t){return this._viewportMap[t]}},{key:"unproject",value:function(t,e){for(var r=this.getViewports(),n={x:t[0],y:t[1]},i=r.length-1;i>=0;--i){var o=r[i];if(o.containsPixel(n)){var a=t.slice();return a[0]-=o.x,a[1]-=o.y,o.unproject(a,e)}}return null}},{key:"setProps",value:function(t){"views"in t&&this._setViews(t.views),"viewState"in t&&this._setViewState(t.viewState),("width"in t||"height"in t)&&this._setSize(t.width,t.height),this._isUpdating||this._update()}},{key:"_update",value:function(){this._isUpdating=!0,this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._isUpdating=!1}},{key:"_setSize",value:function(t,e){t===this.width&&e===this.height||(this.width=t,this.height=e,this.setNeedsUpdate("Size changed"))}},{key:"_setViews",value:function(t){t=Object(f.b)(t,Boolean),this._diffViews(t,this.views)&&this.setNeedsUpdate("views changed"),this.views=t}},{key:"_setViewState",value:function(t){t?(!Object(l.a)(t,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=t):h.a.warn("missing `viewState` or `initialViewState`")()}},{key:"_onViewStateChange",value:function(t,e){e.viewId=t,this._eventCallbacks.onViewStateChange&&this._eventCallbacks.onViewStateChange(e)}},{key:"_createController",value:function(t,e){return new(0,e.type)(d({timeline:this.timeline,eventManager:this._eventManager,onViewStateChange:this._onViewStateChange.bind(this,e.id),onStateChange:this._eventCallbacks.onInteractionStateChange,makeViewport:function(e){return t._getViewport(e,{width:e.width,height:e.height})}},e))}},{key:"_updateController",value:function(t,e,r,n){var i=t.controller;return i?(i=d(d(d(d({},e),t.props),i),{},{id:t.id,x:r.x,y:r.y,width:r.width,height:r.height}),n?n.setProps(i):n=this._createController(t,i),n):null}},{key:"_rebuildViewports",value:function(){var t=this.width,e=this.height,r=this.views,n=this.controllers;this._viewports=[],this.controllers={};for(var i=!1,o=r.length;o--;){var a=r[o],s=this.getViewState(a),u=a.makeViewport({width:t,height:e,viewState:s}),c=n[a.id];a.controller&&!c&&(i=!0),!i&&a.controller||!c||(c.finalize(),c=null),this.controllers[a.id]=this._updateController(a,s,u,c),this._viewports.unshift(u)}for(var l in n)n[l]&&!this.controllers[l]&&n[l].finalize();this._buildViewportMap()}},{key:"_buildViewportMap",value:function(){var t=this;this._viewportMap={},this._viewports.forEach((function(e){e.id&&(t._viewportMap[e.id]=t._viewportMap[e.id]||e)}))}},{key:"_diffViews",value:function(t,e){return t.length!==e.length||t.some((function(r,n){return!t[n].equals(e[n])}))}}]),t}(),g=r(149),m=r(130);function y(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return v(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return v(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function v(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var _=new m.a,b=function(){function t(){a()(this,t),this.effects=[],this._internalEffects=[],this._needsRedraw="Initial render",this.setEffects()}return u()(t,[{key:"setProps",value:function(t){"effects"in t&&(t.effects.length===this.effects.length&&Object(l.a)(t.effects,this.effects)||(this.setEffects(t.effects),this._needsRedraw="effects changed"))}},{key:"needsRedraw",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},e=this._needsRedraw;return t.clearRedrawFlags&&(this._needsRedraw=!1),e}},{key:"getEffects",value:function(){return this._internalEffects}},{key:"finalize",value:function(){this.cleanup()}},{key:"setEffects",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.cleanup(),this.effects=t,this._createInternalEffects()}},{key:"cleanup",value:function(){var t,e=y(this.effects);try{for(e.s();!(t=e.n()).done;){t.value.cleanup()}}catch(t){e.e(t)}finally{e.f()}var r,n=y(this._internalEffects);try{for(n.s();!(r=n.n()).done;){r.value.cleanup()}}catch(t){n.e(t)}finally{n.f()}this.effects.length=0,this._internalEffects.length=0}},{key:"_createInternalEffects",value:function(){this._internalEffects=this.effects.slice(),this.effects.some((function(t){return t instanceof m.a}))||this._internalEffects.push(_)}}]),t}(),x=r(86),w=r(163),E=r(71),S=r(98),O=r(7),T=r(197),P=r(171);function M(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function C(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?M(Object(r),!0).forEach((function(e){i()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):M(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var I={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function k(t){var e=t.pickedColors,r=t.decodePickingColor,n=t.deviceX,i=t.deviceY,o=t.deviceRadius,a=t.deviceRect;if(e){for(var s=a.x,u=a.y,c=a.width,l=a.height,f=o*o,p=-1,d=0,A=0;A<l;A++){var g=A+u-i,m=g*g;if(m>f)d+=4*c;else for(var y=0;y<c;y++){if(e[d+3]-1>=0){var v=y+s-n,_=v*v+m;_<=f&&(f=_,p=d)}d+=4}}if(p>=0){var b=e.slice(p,p+4),x=r(b);if(x){var w=Math.floor(p/4/c),E=p/4-w*c;return C(C({},x),{},{pickedColor:b,pickedX:s+E,pickedY:u+w})}h.a.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return I}function R(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function L(t){var e=t.pickInfo,r=t.viewports,n=t.pixelRatio,i=t.x,o=t.y,a=t.z,s=r[0];r.length>1&&(s=function(t,e){for(var r=t.length-1;r>=0;r--){var n=t[r];if(n.containsPixel(e))return n}return t[0]}((null==e?void 0:e.pickedViewports)||r,{x:i,y:o}));var u=s&&s.unproject([i-s.x,o-s.y],{targetZ:a});return{color:null,layer:null,viewport:s,index:-1,picked:!1,x:i,y:o,pixel:[i,o],coordinate:u,devicePixel:e&&"pickedX"in e?[e.pickedX,e.pickedY]:null,pixelRatio:n}}function j(t){var e=t.pickInfo,r=t.lastPickedInfo,n=t.mode,o=t.layers,a=e.pickedColor,s=e.pickedLayer,u=e.pickedObjectIndex,c=s?[s]:[];if("hover"===n){var l=r.index,h=r.layerId,f=s&&s.props.id;if(f!==h||u!==l){if(f!==h){var p=o.find((function(t){return t.props.id===h}));p&&c.unshift(p)}r.layerId=f,r.index=u,r.info=null}}var d=L(t),A=new Map;return A.set(null,d),c.forEach((function(t){var e=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?R(Object(r),!0).forEach((function(e){i()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):R(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},d);t===s&&(e.color=a,e.index=u,e.picked=!0),e=D({layer:t,info:e,mode:n}),t===s&&"hover"===n&&(r.info=e),A.set(e.layer.id,e),"hover"===n&&e.layer.updateAutoHighlight(e)})),A}function D(t){for(var e=t.layer,r=t.info,n=t.mode;e&&r;){var i=r.layer||null;r.sourceLayer=i,r.layer=e,r=e.getPickingInfo({info:r,mode:n,sourceLayer:i}),e=e.parent}return r}function B(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return F(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return F(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function F(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function z(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function N(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?z(Object(r),!0).forEach((function(e){i()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):z(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var U=function(){function t(e){a()(this,t),this.gl=e,this.pickingFBO=null,this.pickLayersPass=new P.a(e),this.layerFilter=null,this.lastPickedInfo={index:-1,layerId:null,info:null}}return u()(t,[{key:"setProps",value:function(t){"layerFilter"in t&&(this.layerFilter=t.layerFilter),"_pickable"in t&&(this._pickable=t._pickable)}},{key:"finalize",value:function(){this.pickingFBO&&this.pickingFBO.delete(),this.depthFBO&&(this.depthFBO.color.delete(),this.depthFBO.delete())}},{key:"pickObject",value:function(t){return this._pickClosestObject(t)}},{key:"pickObjects",value:function(t){return this._pickVisibleObjects(t)}},{key:"getLastPickedObject",value:function(t){var e=t.x,r=t.y,n=t.layers,i=t.viewports,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.lastPickedInfo.info,a=o&&o.layer&&o.layer.id,s=o&&o.viewport&&o.viewport.id,u=a?n.find((function(t){return t.id===a})):null,c=s&&i.find((function(t){return t.id===s}))||i[0],l=c&&c.unproject([e-c.x,r-c.y]),h={x:e,y:r,viewport:c,coordinate:l,layer:u};return N(N({},o),h)}},{key:"_resizeBuffer",value:function(){var t=this.gl;return this.pickingFBO||(this.pickingFBO=new E.a(t),E.a.isSupported(t,{colorBufferFloat:!0})&&(this.depthFBO=new E.a(t),this.depthFBO.attach(i()({},36064,new S.a(t,{format:Object(O.j)(t)?34836:6408,type:5126}))))),this.pickingFBO.resize({width:t.canvas.width,height:t.canvas.height}),this.depthFBO&&this.depthFBO.resize({width:t.canvas.width,height:t.canvas.height}),this.pickingFBO}},{key:"_getPickable",value:function(t){if(!1===this._pickable)return null;var e=t.filter((function(t){return t.isPickable()&&!t.isComposite}));return e.length?e:null}},{key:"_pickClosestObject",value:function(t){var e=t.layers,r=t.views,n=t.viewports,i=t.x,o=t.y,a=t.radius,s=void 0===a?0:a,u=t.depth,c=void 0===u?1:u,l=t.mode,h=void 0===l?"query":l,f=t.unproject3D,p=t.onViewportActive;if(!(e=this._getPickable(e)))return{result:[],emptyInfo:L({viewports:n,x:i,y:o})};this._resizeBuffer();for(var d,A=Object(O.e)(this.gl),g=Object(O.d)(this.gl,[i,o],!0),m=[g.x+Math.floor(g.width/2),g.y+Math.floor(g.height/2)],y=Math.round(s*A),v=this.pickingFBO,_=v.width,b=v.height,x=this._getPickingRect({deviceX:m[0],deviceY:m[1],deviceRadius:y,deviceWidth:_,deviceHeight:b}),w=[],E={},S=0;S<c;S++){var T=k(N(N({},x&&this._drawAndSample({layers:e,views:r,viewports:n,onViewportActive:p,deviceRect:x,pass:"picking:".concat(h),redrawReason:h})),{},{deviceX:m[0],deviceY:m[1],deviceRadius:y,deviceRect:x})),P=void 0;if(T.pickedLayer&&f&&this.depthFBO)P=this._drawAndSample({layers:[T.pickedLayer],views:r,viewports:n,onViewportActive:p,deviceRect:{x:T.pickedX,y:T.pickedY,width:1,height:1},pass:"picking:".concat(h),redrawReason:"pick-z",pickZ:!0}).pickedColors[0]*n[0].distanceScales.metersPerUnit[2]+n[0].position[2];if(T.pickedColor&&S+1<c){var M=T.pickedColor[3]-1;E[M]=!0,e[M].disablePickingIndex(T.pickedObjectIndex)}var C,I=B((d=j({pickInfo:T,lastPickedInfo:this.lastPickedInfo,mode:h,layers:e,viewports:n,x:i,y:o,z:P,pixelRatio:A})).values());try{for(I.s();!(C=I.n()).done;){var R=C.value;R.layer&&w.push(R)}}catch(t){I.e(t)}finally{I.f()}if(!T.pickedColor)break}for(var D in E)e[D].restorePickingColors();return{result:w,emptyInfo:d&&d.get(null)}}},{key:"_pickVisibleObjects",value:function(t){var e=t.layers,r=t.views,n=t.viewports,i=t.x,o=t.y,a=t.width,s=void 0===a?1:a,u=t.height,c=void 0===u?1:u,l=t.mode,f=void 0===l?"query":l,p=t.maxObjects,d=void 0===p?null:p,A=t.onViewportActive;if(!(e=this._getPickable(e)))return[];this._resizeBuffer();for(var g=Object(O.e)(this.gl),m=Object(O.d)(this.gl,[i,o],!0),y=m.x,v=m.y+m.height,_=Object(O.d)(this.gl,[i+s,o+c],!0),b=_.x+_.width,x=_.y,w={x:y,y:x,width:b-y,height:v-x},E=function(t){var e=t.pickedColors,r=t.decodePickingColor,n=new Map;if(e)for(var i=0;i<e.length;i+=4){if(e[i+3]-1>=0){var o=e.slice(i,i+4),a=o.join(",");if(!n.has(a)){var s=r(o);s?n.set(a,C(C({},s),{},{pickedColor:o})):h.a.error("Picked non-existent layer. Is picking buffer corrupt?")()}}}return Array.from(n.values())}(this._drawAndSample({layers:e,views:r,viewports:n,onViewportActive:A,deviceRect:w,pass:"picking:".concat(f),redrawReason:f})),S=new Map,T=Number.isFinite(d),P=0;P<E.length&&!(T&&S.size>=d);P++){var M=E[P],I={color:M.pickedColor,layer:null,index:M.pickedObjectIndex,picked:!0,x:i,y:o,width:s,height:c,pixelRatio:g};I=D({layer:M.pickedLayer,info:I,mode:f}),S.has(I.object)||S.set(I.object,I)}return Array.from(S.values())}},{key:"_drawAndSample",value:function(t){var e=t.layers,r=t.views,n=t.viewports,i=t.onViewportActive,o=t.deviceRect,a=t.pass,s=t.redrawReason,u=t.pickZ,c=u?this.depthFBO:this.pickingFBO,l=this.pickLayersPass.render({layers:e,layerFilter:this.layerFilter,views:r,viewports:n,onViewportActive:i,pickingFBO:c,deviceRect:o,pass:a,redrawReason:s,pickZ:u}).decodePickingColor,h=o.x,f=o.y,p=o.width,d=o.height,A=new(u?Float32Array:Uint8Array)(p*d*4);return Object(T.c)(c,{sourceX:h,sourceY:f,sourceWidth:p,sourceHeight:d,target:A}),{pickedColors:A,decodePickingColor:l}}},{key:"_getPickingRect",value:function(t){var e=t.deviceX,r=t.deviceY,n=t.deviceRadius,i=t.deviceWidth,o=t.deviceHeight,a=Math.max(0,e-n),s=Math.max(0,r-n),u=Math.min(i,e+n+1)-a,c=Math.min(o,r+n+1)-s;return u<=0||c<=0?null:{x:a,y:s,width:u,height:c}}}]),t}(),V={zIndex:1,position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:0,left:0,display:"none"},G=function(){function t(e){a()(this,t);var r=e.parentElement;r&&(this.el=document.createElement("div"),this.el.className="deck-tooltip",Object.assign(this.el.style,V),r.appendChild(this.el)),this.isVisible=!1}return u()(t,[{key:"setTooltip",value:function(t,e,r){var n=this.el;if("string"==typeof t)n.innerText=t;else{if(!t)return this.isVisible=!1,void(n.style.display="none");"text"in t&&(n.innerText=t.text),"html"in t&&(n.innerHTML=t.html),"className"in t&&(n.className=t.className),Object.assign(n.style,t.style)}this.isVisible=!0,n.style.display="block",n.style.transform="translate(".concat(e,"px, ").concat(r,"px)")}},{key:"remove",value:function(){this.el&&this.el.remove()}}]),t}(),W=r(67),H=r(192),q=r(26),Z=r(139),X=r(9),Q=r(39),Y=r(240),K=r(179);class $ extends Q.a{static isSupported(t,e=[]){const r=Object(O.j)(t),n=Object(Y.c)(t,K.a.TIMER_QUERY);let i=r||n;for(const t of e)switch(t){case"queries":i=i&&r;break;case"timers":i=i&&n;break;default:Object(X.a)(!1)}return i}constructor(t,e={}){super(t,e),this.target=null,this._queryPending=!1,this._pollingPromise=null,Object.seal(this)}beginTimeElapsedQuery(){return this.begin(35007)}beginOcclusionQuery({conservative:t=!1}={}){return this.begin(t?36202:35887)}beginTransformFeedbackQuery(){return this.begin(35976)}begin(t){return this._queryPending?this:(this.target=t,this.gl2.beginQuery(this.target,this.handle),this)}end(){return this._queryPending?this:(this.target&&(this.gl2.endQuery(this.target),this.target=null,this._queryPending=!0),this)}isResultAvailable(){if(!this._queryPending)return!1;const t=this.gl2.getQueryParameter(this.handle,34919);return t&&(this._queryPending=!1),t}isTimerDisjoint(){return this.gl2.getParameter(36795)}getResult(){return this.gl2.getQueryParameter(this.handle,34918)}getTimerMilliseconds(){return this.getResult()/1e6}createPoll(t=Number.POSITIVE_INFINITY){if(this._pollingPromise)return this._pollingPromise;let e=0;return this._pollingPromise=new Promise((r,n)=>{const i=()=>{this.isResultAvailable()?(r(this.getResult()),this._pollingPromise=null):e++>t?(n("Timed out"),this._pollingPromise=null):requestAnimationFrame(i)};requestAnimationFrame(i)}),this._pollingPromise}_createHandle(){return $.isSupported(this.gl)?this.gl2.createQuery():null}_deleteHandle(){this.gl2.deleteQuery(this.handle)}}const J=Object(q.isBrowser)()&&"undefined"!=typeof document;let tt=0;class et{constructor(t={}){const{onCreateContext:e=(t=>Object(O.c)(t)),onAddHTML:r=null,onInitialize:n=(()=>{}),onRender:i=(()=>{}),onFinalize:o=(()=>{}),onError:a,gl:s=null,glOptions:u={},debug:c=!1,createFramebuffer:l=!1,autoResizeViewport:h=!0,autoResizeDrawingBuffer:f=!0,stats:p=Z.a.get(`animation-loop-${tt++}`)}=t;let{useDevicePixels:d=!0}=t;"useDevicePixelRatio"in t&&(O.k.deprecated("useDevicePixelRatio","useDevicePixels")(),d=t.useDevicePixelRatio),this.props={onCreateContext:e,onAddHTML:r,onInitialize:n,onRender:i,onFinalize:o,onError:a,gl:s,glOptions:u,debug:c,createFramebuffer:l},this.gl=s,this.needsRedraw=null,this.timeline=null,this.stats=p,this.cpuTime=this.stats.get("CPU Time"),this.gpuTime=this.stats.get("GPU Time"),this.frameRate=this.stats.get("Frame Rate"),this._initialized=!1,this._running=!1,this._animationFrameId=null,this._nextFramePromise=null,this._resolveNextFrame=null,this._cpuStartTime=0,this.setProps({autoResizeViewport:h,autoResizeDrawingBuffer:f,useDevicePixels:d}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._pageLoadPromise=null,this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}delete(){this.stop(),this._setDisplay(null)}setNeedsRedraw(t){return Object(X.a)("string"==typeof t),this.needsRedraw=this.needsRedraw||t,this}setProps(t){return"autoResizeViewport"in t&&(this.autoResizeViewport=t.autoResizeViewport),"autoResizeDrawingBuffer"in t&&(this.autoResizeDrawingBuffer=t.autoResizeDrawingBuffer),"useDevicePixels"in t&&(this.useDevicePixels=t.useDevicePixels),this}start(t={}){if(this._running)return this;this._running=!0;const e=this._getPageLoadPromise().then(()=>!this._running||this._initialized?null:(this._createWebGLContext(t),this._createFramebuffer(),this._startEventHandling(),this._initializeCallbackData(),this._updateCallbackData(),this._resizeCanvasDrawingBuffer(),this._resizeViewport(),this._gpuTimeQuery=$.isSupported(this.gl,["timers"])?new $(this.gl):null,this._initialized=!0,this.onInitialize(this.animationProps))).then(t=>{this._running&&(this._addCallbackData(t||{}),!1!==t&&this._startLoop())});return this.props.onError&&e.catch(this.props.onError),this}redraw(){return this.isContextLost()?this:(this._beginTimers(),this._setupFrame(),this._updateCallbackData(),this._renderFrame(this.animationProps),this._clearNeedsRedraw(),this.offScreen&&this.gl.commit&&this.gl.commit(),this._resolveNextFrame&&(this._resolveNextFrame(this),this._nextFramePromise=null,this._resolveNextFrame=null),this._endTimers(),this)}stop(){return this._running&&(this._finalizeCallbackData(),this._cancelAnimationFrame(this._animationFrameId),this._nextFramePromise=null,this._resolveNextFrame=null,this._animationFrameId=null,this._running=!1),this}attachTimeline(t){return this.timeline=t,this.timeline}detachTimeline(){this.timeline=null}waitForRender(){return this.setNeedsRedraw("waitForRender"),this._nextFramePromise||(this._nextFramePromise=new Promise(t=>{this._resolveNextFrame=t})),this._nextFramePromise}async toDataURL(){return this.setNeedsRedraw("toDataURL"),await this.waitForRender(),this.gl.canvas.toDataURL()}isContextLost(){return this.gl.isContextLost()}onCreateContext(...t){return this.props.onCreateContext(...t)}onInitialize(...t){return this.props.onInitialize(...t)}onRender(...t){return this.props.onRender(...t)}onFinalize(...t){return this.props.onFinalize(...t)}getHTMLControlValue(t,e=1){const r=document.getElementById(t);return r?Number(r.value):e}setViewParameters(){return O.k.removed("AnimationLoop.setViewParameters","AnimationLoop.setProps")(),this}_startLoop(){const t=()=>{this._running&&(this.redraw(),this._animationFrameId=this._requestAnimationFrame(t))};this._cancelAnimationFrame(this._animationFrameId),this._animationFrameId=this._requestAnimationFrame(t)}_getPageLoadPromise(){return this._pageLoadPromise||(this._pageLoadPromise=J?new Promise((t,e)=>{J&&"complete"===document.readyState?t(document):window.addEventListener("load",()=>{t(document)})}):Promise.resolve({})),this._pageLoadPromise}_setDisplay(t){this.display&&(this.display.delete(),this.display.animationLoop=null),t&&(t.animationLoop=this),this.display=t}_cancelAnimationFrame(t){return this.display&&this.display.cancelAnimationFrame?this.display.cancelAnimationFrame(t):(e=t,"undefined"!=typeof window&&window.cancelAnimationFrame?window.cancelAnimationFrame(e):clearTimeout(e));var e}_requestAnimationFrame(t){if(this._running)return this.display&&this.display.requestAnimationFrame?this.display.requestAnimationFrame(t):(e=t,"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame(e):setTimeout(e,1e3/60));var e}_renderFrame(...t){this.display?this.display._renderFrame(...t):this.onRender(...t)}_clearNeedsRedraw(){this.needsRedraw=null}_setupFrame(){this._resizeCanvasDrawingBuffer(),this._resizeViewport(),this._resizeFramebuffer()}_initializeCallbackData(){this.animationProps={gl:this.gl,stop:this.stop,canvas:this.gl.canvas,framebuffer:this.framebuffer,useDevicePixels:this.useDevicePixels,needsRedraw:null,startTime:Date.now(),engineTime:0,tick:0,tock:0,time:0,_timeline:this.timeline,_loop:this,_animationLoop:this,_mousePosition:null}}_updateCallbackData(){const{width:t,height:e,aspect:r}=this._getSizeAndAspect();t===this.animationProps.width&&e===this.animationProps.height||this.setNeedsRedraw("drawing buffer resized"),r!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=t,this.animationProps.height=e,this.animationProps.aspect=r,this.animationProps.needsRedraw=this.needsRedraw,this.animationProps.engineTime=Date.now()-this.animationProps.startTime,this.timeline&&this.timeline.update(this.animationProps.engineTime),this.animationProps.tick=Math.floor(this.animationProps.time/1e3*60),this.animationProps.tock++,this.animationProps.time=this.timeline?this.timeline.getTime():this.animationProps.engineTime,this.animationProps._offScreen=this.offScreen}_finalizeCallbackData(){this.onFinalize(this.animationProps)}_addCallbackData(t){"object"==typeof t&&null!==t&&(this.animationProps=Object.assign({},this.animationProps,t))}_createWebGLContext(t){if(this.offScreen=t.canvas&&"undefined"!=typeof OffscreenCanvas&&t.canvas instanceof OffscreenCanvas,t=Object.assign({},t,this.props.glOptions),this.gl=this.props.gl?Object(O.h)(this.props.gl,t):this.onCreateContext(t),!Object(O.i)(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");Object(O.l)(this.gl),this._createInfoDiv()}_createInfoDiv(){if(this.gl.canvas&&this.props.onAddHTML){const t=document.createElement("div");document.body.appendChild(t),t.style.position="relative";const e=document.createElement("div");e.style.position="absolute",e.style.left="10px",e.style.bottom="10px",e.style.width="300px",e.style.background="white",t.appendChild(this.gl.canvas),t.appendChild(e);const r=this.props.onAddHTML(e);r&&(e.innerHTML=r)}}_getSizeAndAspect(){const t=this.gl.drawingBufferWidth,e=this.gl.drawingBufferHeight;let r=1;const{canvas:n}=this.gl;return n&&n.clientHeight?r=n.clientWidth/n.clientHeight:t>0&&e>0&&(r=t/e),{width:t,height:e,aspect:r}}_resizeViewport(){this.autoResizeViewport&&this.gl.viewport(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight)}_resizeCanvasDrawingBuffer(){this.autoResizeDrawingBuffer&&Object(O.m)(this.gl,{useDevicePixels:this.useDevicePixels})}_createFramebuffer(){this.props.createFramebuffer&&(this.framebuffer=new E.a(this.gl))}_resizeFramebuffer(){this.framebuffer&&this.framebuffer.resize({width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight})}_beginTimers(){this.frameRate.timeEnd(),this.frameRate.timeStart(),this._gpuTimeQuery&&this._gpuTimeQuery.isResultAvailable()&&!this._gpuTimeQuery.isTimerDisjoint()&&this.stats.get("GPU Time").addTime(this._gpuTimeQuery.getTimerMilliseconds()),this._gpuTimeQuery&&this._gpuTimeQuery.beginTimeElapsedQuery(),this.cpuTime.timeStart()}_endTimers(){this.cpuTime.timeEnd(),this._gpuTimeQuery&&this._gpuTimeQuery.end()}_startEventHandling(){const{canvas:t}=this.gl;t&&(t.addEventListener("mousemove",this._onMousemove),t.addEventListener("mouseleave",this._onMouseleave))}_onMousemove(t){this.animationProps._mousePosition=[t.offsetX,t.offsetY]}_onMouseleave(t){this.animationProps._mousePosition=null}}var rt=r(290),nt=r(137);function it(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){i=!0,o=t}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var ot,at,st=r(50),ut=r(51),ct=r(140),lt=r.n(ct),ht={mousedown:1,mousemove:2,mouseup:4};ot=lt.a.PointerEventInput,at=ot.prototype.handler,ot.prototype.handler=function(t){var e=this.store;t.button>0&&(function(t,e){for(var r=0;r<t.length;r++)if(e(t[r]))return!0;return!1}(e,(function(e){return e.pointerId===t.pointerId}))||e.push(t)),at.call(this,t)},lt.a.MouseInput.prototype.handler=function(t){var e=ht[t.type];1&e&&t.button>=0&&(this.pressed=!0),2&e&&0===t.which&&(e=4),this.pressed&&(4&e&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:"mouse",srcEvent:t}))};var ft=lt.a.Manager,pt=lt.a,dt=pt?[[pt.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[pt.Rotate,{enable:!1}],[pt.Pinch,{enable:!1}],[pt.Swipe,{enable:!1}],[pt.Pan,{threshold:0,enable:!1}],[pt.Press,{enable:!1}],[pt.Tap,{event:"doubletap",taps:2,enable:!1}],[pt.Tap,{event:"anytap",enable:!1}],[pt.Tap,{enable:!1}]]:null,At={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},gt={doubletap:["tap"]},mt={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},yt=["keydown","keyup"],vt=["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],_t=["wheel","mousewheel","DOMMouseScroll"],bt={tap:"tap",anytap:"anytap",doubletap:"doubletap",press:"press",pinch:"pinch",pinchin:"pinch",pinchout:"pinch",pinchstart:"pinch",pinchmove:"pinch",pinchend:"pinch",pinchcancel:"pinch",rotate:"rotate",rotatestart:"rotate",rotatemove:"rotate",rotateend:"rotate",rotatecancel:"rotate",tripan:"tripan",tripanstart:"tripan",tripanmove:"tripan",tripanup:"tripan",tripandown:"tripan",tripanleft:"tripan",tripanright:"tripan",tripanend:"tripan",tripancancel:"tripan",pan:"pan",panstart:"pan",panmove:"pan",panup:"pan",pandown:"pan",panleft:"pan",panright:"pan",panend:"pan",pancancel:"pan",swipe:"swipe",swipeleft:"swipe",swiperight:"swipe",swipeup:"swipe",swipedown:"swipe"},xt={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},wt=r(101),Et=-1!==wt.b.indexOf("firefox"),St=_t,Ot=function(){function t(e,r){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(st.a)(this,t),this.element=e,this.callback=r,this.options=Object.assign({enable:!0},i),this.events=St.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach((function(t){return e.addEventListener(t,n.handleEvent,!!wt.a&&{passive:!1})}))}return Object(ut.a)(t,[{key:"destroy",value:function(){var t=this;this.events.forEach((function(e){return t.element.removeEventListener(e,t.handleEvent)}))}},{key:"enableEventType",value:function(t,e){"wheel"===t&&(this.options.enable=e)}},{key:"handleEvent",value:function(t){if(this.options.enable){var e=t.deltaY;wt.c.WheelEvent&&(Et&&t.deltaMode===wt.c.WheelEvent.DOM_DELTA_PIXEL&&(e/=wt.c.devicePixelRatio),t.deltaMode===wt.c.WheelEvent.DOM_DELTA_LINE&&(e*=40));var r={x:t.clientX,y:t.clientY};0!==e&&e%4.000244140625==0&&(e=Math.floor(e/4.000244140625)),t.shiftKey&&e&&(e*=.25),this._onWheel(t,-e,r)}}},{key:"_onWheel",value:function(t,e,r){this.callback({type:"wheel",center:r,delta:e,srcEvent:t,pointerType:"mouse",target:t.target})}}]),t}(),Tt=vt,Pt=function(){function t(e,r){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(st.a)(this,t),this.element=e,this.callback=r,this.pressed=!1,this.options=Object.assign({enable:!0},i),this.enableMoveEvent=this.options.enable,this.enableLeaveEvent=this.options.enable,this.enableOutEvent=this.options.enable,this.enableOverEvent=this.options.enable,this.events=Tt.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach((function(t){return e.addEventListener(t,n.handleEvent)}))}return Object(ut.a)(t,[{key:"destroy",value:function(){var t=this;this.events.forEach((function(e){return t.element.removeEventListener(e,t.handleEvent)}))}},{key:"enableEventType",value:function(t,e){"pointermove"===t&&(this.enableMoveEvent=e),"pointerover"===t&&(this.enableOverEvent=e),"pointerout"===t&&(this.enableOutEvent=e),"pointerleave"===t&&(this.enableLeaveEvent=e)}},{key:"handleEvent",value:function(t){this.handleOverEvent(t),this.handleOutEvent(t),this.handleLeaveEvent(t),this.handleMoveEvent(t)}},{key:"handleOverEvent",value:function(t){this.enableOverEvent&&"mouseover"===t.type&&this.callback({type:"pointerover",srcEvent:t,pointerType:"mouse",target:t.target})}},{key:"handleOutEvent",value:function(t){this.enableOutEvent&&"mouseout"===t.type&&this.callback({type:"pointerout",srcEvent:t,pointerType:"mouse",target:t.target})}},{key:"handleLeaveEvent",value:function(t){this.enableLeaveEvent&&"mouseleave"===t.type&&this.callback({type:"pointerleave",srcEvent:t,pointerType:"mouse",target:t.target})}},{key:"handleMoveEvent",value:function(t){if(this.enableMoveEvent)switch(t.type){case"mousedown":t.button>=0&&(this.pressed=!0);break;case"mousemove":0===t.which&&(this.pressed=!1),this.pressed||this.callback({type:"pointermove",srcEvent:t,pointerType:"mouse",target:t.target});break;case"mouseup":this.pressed=!1}}}]),t}(),Mt=yt,Ct=function(){function t(e,r){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(st.a)(this,t),this.element=e,this.callback=r,this.options=Object.assign({enable:!0},i),this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=Mt.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),e.tabIndex=i.tabIndex||0,e.style.outline="none",this.events.forEach((function(t){return e.addEventListener(t,n.handleEvent)}))}return Object(ut.a)(t,[{key:"destroy",value:function(){var t=this;this.events.forEach((function(e){return t.element.removeEventListener(e,t.handleEvent)}))}},{key:"enableEventType",value:function(t,e){"keydown"===t&&(this.enableDownEvent=e),"keyup"===t&&(this.enableUpEvent=e)}},{key:"handleEvent",value:function(t){var e=t.target||t.srcElement;"INPUT"===e.tagName&&"text"===e.type||"TEXTAREA"===e.tagName||(this.enableDownEvent&&"keydown"===t.type&&this.callback({type:"keydown",srcEvent:t,key:t.key,target:t.target}),this.enableUpEvent&&"keyup"===t.type&&this.callback({type:"keyup",srcEvent:t,key:t.key,target:t.target}))}}]),t}(),It=function(){function t(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(st.a)(this,t),this.element=e,this.callback=r,this.options=Object.assign({enable:!0},n),this.handleEvent=this.handleEvent.bind(this),e.addEventListener("contextmenu",this.handleEvent)}return Object(ut.a)(t,[{key:"destroy",value:function(){this.element.removeEventListener("contextmenu",this.handleEvent)}},{key:"enableEventType",value:function(t,e){"contextmenu"===t&&(this.options.enable=e)}},{key:"handleEvent",value:function(t){this.options.enable&&this.callback({type:"contextmenu",center:{x:t.clientX,y:t.clientY},srcEvent:t,pointerType:"mouse",target:t.target})}}]),t}();function kt(t){return(kt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var Rt={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4};var Lt={srcElement:"root",priority:0},jt=function(){function t(e){Object(st.a)(this,t),this.eventManager=e,this.handlers=[],this.handlersByElement=new Map,this.handleEvent=this.handleEvent.bind(this),this._active=!1}return Object(ut.a)(t,[{key:"isEmpty",value:function(){return!this._active}},{key:"add",value:function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=this.handlers,a=this.handlersByElement;r&&("object"!==kt(r)||r.addEventListener)&&(r={srcElement:r}),r=r?Object.assign({},Lt,r):Lt;var s=a.get(r.srcElement);s||(s=[],a.set(r.srcElement,s));var u={type:t,handler:e,srcElement:r.srcElement,priority:r.priority};n&&(u.once=!0),i&&(u.passive=!0),o.push(u),this._active=this._active||!u.passive;for(var c=s.length-1;c>=0&&!(s[c].priority>=u.priority);)c--;s.splice(c+1,0,u)}},{key:"remove",value:function(t,e){for(var r=this.handlers,n=this.handlersByElement,i=r.length-1;i>=0;i--){var o=r[i];if(o.type===t&&o.handler===e){r.splice(i,1);var a=n.get(o.srcElement);a.splice(a.indexOf(o),1),0===a.length&&n.delete(o.srcElement)}}this._active=r.some((function(t){return!t.passive}))}},{key:"handleEvent",value:function(t){if(!this.isEmpty()){for(var e=this._normalizeEvent(t),r=t.srcEvent.target;r&&r!==e.rootElement;){if(this._emit(e,r),e.handled)return;r=r.parentNode}this._emit(e,"root")}}},{key:"_emit",value:function(t,e){var r=this.handlersByElement.get(e);if(r){for(var n=!1,i=function(){t.handled=!0},o=function(){t.handled=!0,n=!0},a=[],s=0;s<r.length;s++){var u=r[s],c=u.type,l=u.handler,h=u.once;if(l(Object.assign({},t,{type:c,stopPropagation:i,stopImmediatePropagation:o})),h&&a.push(r[s]),n)break}for(var f=0;f<a.length;f++){var p=a[f],d=p.type,A=p.handler;this.remove(d,A)}}}},{key:"_normalizeEvent",value:function(t){var e=this.eventManager.element;return Object.assign({},t,function(t){var e=Rt[t.srcEvent.type];if(!e)return null;var r=t.srcEvent,n=r.buttons,i=r.button,o=r.which,a=!1,s=!1,u=!1;return 4===e||2===e&&!Number.isFinite(n)?(a=1===o,s=2===o,u=3===o):2===e?(a=Boolean(1&n),s=Boolean(4&n),u=Boolean(2&n)):1===e&&(a=0===i,s=1===i,u=2===i),{leftButton:a,middleButton:s,rightButton:u}}(t),function(t,e){var r=t.srcEvent;if(!t.center&&!Number.isFinite(r.clientX))return null;var n=t.center||{x:r.clientX,y:r.clientY},i=e.getBoundingClientRect(),o=i.width/e.offsetWidth,a=i.height/e.offsetHeight;return{center:n,offsetCenter:{x:(n.x-i.left-e.clientLeft)/o,y:(n.y-i.top-e.clientTop)/a}}}(t,e),{handled:!1,rootElement:e})}}]),t}();function Dt(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Bt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Bt(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Bt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var Ft={events:null,recognizers:null,recognizerOptions:{},Manager:ft,touchAction:"none",tabIndex:0},zt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(st.a)(this,t),this.options=Object.assign({},Ft,r),this.events=new Map,this._onBasicInput=this._onBasicInput.bind(this),this._onOtherEvent=this._onOtherEvent.bind(this),this.setElement(e);var n=r.events;n&&this.on(n)}return Object(ut.a)(t,[{key:"setElement",value:function(t){var e=this;if(this.element&&this.destroy(),this.element=t,t){var r=this.options,n=r.Manager;for(var i in this.manager=new n(t,{touchAction:r.touchAction,recognizers:r.recognizers||dt}).on("hammer.input",this._onBasicInput),r.recognizers||Object.keys(At).forEach((function(t){var r=e.manager.get(t);r&&At[t].forEach((function(t){r.recognizeWith(t)}))})),r.recognizerOptions){var o=this.manager.get(i);if(o){var a=r.recognizerOptions[i];delete a.enable,o.set(a)}}this.wheelInput=new Ot(t,this._onOtherEvent,{enable:!1}),this.moveInput=new Pt(t,this._onOtherEvent,{enable:!1}),this.keyInput=new Ct(t,this._onOtherEvent,{enable:!1,tabIndex:r.tabIndex}),this.contextmenuInput=new It(t,this._onOtherEvent,{enable:!1});var s,u=Dt(this.events);try{for(u.s();!(s=u.n()).done;){var c=it(s.value,2),l=c[0],h=c[1];h.isEmpty()||(this._toggleRecognizer(h.recognizerName,!0),this.manager.on(l,h.handleEvent))}}catch(t){u.e(t)}finally{u.f()}}}},{key:"destroy",value:function(){this.element&&(this.wheelInput.destroy(),this.moveInput.destroy(),this.keyInput.destroy(),this.contextmenuInput.destroy(),this.manager.destroy(),this.wheelInput=null,this.moveInput=null,this.keyInput=null,this.contextmenuInput=null,this.manager=null,this.element=null)}},{key:"on",value:function(t,e,r){this._addEventHandler(t,e,r,!1)}},{key:"once",value:function(t,e,r){this._addEventHandler(t,e,r,!0)}},{key:"watch",value:function(t,e,r){this._addEventHandler(t,e,r,!1,!0)}},{key:"off",value:function(t,e){this._removeEventHandler(t,e)}},{key:"_toggleRecognizer",value:function(t,e){var r=this.manager;if(r){var n=r.get(t);if(n&&n.options.enable!==e){n.set({enable:e});var i=gt[t];i&&!this.options.recognizers&&i.forEach((function(i){var o=r.get(i);e?(o.requireFailure(t),n.dropRequireFailure(i)):o.dropRequireFailure(t)}))}this.wheelInput.enableEventType(t,e),this.moveInput.enableEventType(t,e),this.keyInput.enableEventType(t,e),this.contextmenuInput.enableEventType(t,e)}}},{key:"_addEventHandler",value:function(t,e,r,n,i){if("string"==typeof t){var o=this.manager,a=this.events,s=xt[t]||t,u=a.get(s);u||(u=new jt(this),a.set(s,u),u.recognizerName=bt[s]||s,o&&o.on(s,u.handleEvent)),u.add(t,e,r,n,i),u.isEmpty()||this._toggleRecognizer(u.recognizerName,!0)}else for(var c in r=e,t)this._addEventHandler(c,t[c],r,n,i)}},{key:"_removeEventHandler",value:function(t,e){if("string"==typeof t){var r=this.events,n=xt[t]||t,i=r.get(n);if(i&&(i.remove(t,e),i.isEmpty())){var o,a=i.recognizerName,s=!1,u=Dt(r.values());try{for(u.s();!(o=u.n()).done;){var c=o.value;if(c.recognizerName===a&&!c.isEmpty()){s=!0;break}}}catch(t){u.e(t)}finally{u.f()}s||this._toggleRecognizer(a,!1)}}else for(var l in t)this._removeEventHandler(l,t[l])}},{key:"_onBasicInput",value:function(t){var e=t.srcEvent,r=mt[e.type];r&&this.manager.emit(r,t)}},{key:"_onOtherEvent",value:function(t){this.manager.emit(t.type,t)}}]),t}(),Nt=r(37),Ut=r(14);function Vt(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Gt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Gt(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Gt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Wt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Ht(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Wt(Object(r),!0).forEach((function(e){i()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Wt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function qt(){}r.d(e,"a",(function(){return Xt}));var Zt={id:"",width:"100%",height:"100%",pickingRadius:0,layerFilter:null,glOptions:{},gl:null,layers:[],effects:[],views:null,controller:null,useDevicePixels:!0,touchAction:"none",eventRecognizerOptions:{},_framebuffer:null,_animate:!1,_pickable:!0,_typedArrayManagerProps:{},onWebGLInitialized:qt,onResize:qt,onViewStateChange:qt,onInteractionStateChange:qt,onBeforeRender:qt,onAfterRender:qt,onLoad:qt,onError:function(t,e){return h.a.error(t)()},_onMetrics:null,getCursor:function(t){return t.isDragging?"grabbing":"grab"},debug:!1,drawPickingColors:!1},Xt=function(){function t(e){a()(this,t),e=Ht(Ht({},Zt),e),this.props={},this.width=0,this.height=0,this.viewManager=null,this.layerManager=null,this.effectManager=null,this.deckRenderer=null,this.deckPicker=null,this._needsRedraw=!0,this._pickRequest={},this._lastPointerDownInfo=null,this.viewState=null,this.interactiveState={isHovering:!1,isDragging:!1},this._onEvent=this._onEvent.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),e.viewState&&e.initialViewState&&h.a.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),"IE"===Object(q.getBrowser)()&&h.a.warn("IE 11 support will be deprecated in v8.0")(),e.gl||"undefined"!=typeof document&&(this.canvas=this._createCanvas(e)),this.animationLoop=this._createAnimationLoop(e),this.stats=new nt.a({id:"deck.gl"}),this.metrics={fps:0,setPropsTime:0,updateAttributesTime:0,framesRedrawn:0,pickTime:0,pickCount:0,gpuTime:0,gpuTimePerFrame:0,cpuTime:0,cpuTimePerFrame:0,bufferMemory:0,textureMemory:0,renderbufferMemory:0,gpuMemory:0},this._metricsCounter=0,this.setProps(e),e._typedArrayManagerProps&&W.a.setProps(e._typedArrayManagerProps),this.animationLoop.start()}return u()(t,[{key:"finalize",value:function(){this.animationLoop.stop(),this.animationLoop=null,this._lastPointerDownInfo=null,this.layerManager&&(this.layerManager.finalize(),this.layerManager=null,this.viewManager.finalize(),this.viewManager=null,this.effectManager.finalize(),this.effectManager=null,this.deckRenderer.finalize(),this.deckRenderer=null,this.deckPicker.finalize(),this.deckPicker=null,this.eventManager.destroy(),this.eventManager=null,this.tooltip.remove(),this.tooltip=null),this.props.canvas||this.props.gl||!this.canvas||(this.canvas.parentElement.removeChild(this.canvas),this.canvas=null)}},{key:"setProps",value:function(t){this.stats.get("setProps Time").timeStart(),"onLayerHover"in t&&h.a.removed("onLayerHover","onHover")(),"onLayerClick"in t&&h.a.removed("onLayerClick","onClick")(),t.initialViewState&&!Object(l.a)(this.props.initialViewState,t.initialViewState)&&(this.viewState=t.initialViewState),Object.assign(this.props,t),this._setCanvasSize(this.props);var e=Object.create(this.props);Object.assign(e,{views:this._getViews(),width:this.width,height:this.height,viewState:this._getViewState()}),this.animationLoop.setProps(e),this.layerManager&&(this.viewManager.setProps(e),this.layerManager.activateViewport(this.getViewports()[0]),this.layerManager.setProps(e),this.effectManager.setProps(e),this.deckRenderer.setProps(e),this.deckPicker.setProps(e)),this.stats.get("setProps Time").timeEnd()}},{key:"needsRedraw",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};if(this.props._animate)return"Deck._animate";var e=this._needsRedraw;t.clearRedrawFlags&&(this._needsRedraw=!1);var r=this.viewManager.needsRedraw(t),n=this.layerManager.needsRedraw(t),i=this.effectManager.needsRedraw(t),o=this.deckRenderer.needsRedraw(t);return e=e||r||n||i||o}},{key:"redraw",value:function(t){if(this.layerManager){var e=t||this.needsRedraw({clearRedrawFlags:!0});e&&(this.stats.get("Redraw Count").incrementCount(),this.props._customRender?this.props._customRender(e):this._drawLayers(e))}}},{key:"getViews",value:function(){return this.viewManager.views}},{key:"getViewports",value:function(t){return this.viewManager.getViewports(t)}},{key:"pickObject",value:function(t){var e=this._pick("pickObject","pickObject Time",t).result;return e.length?e[0]:null}},{key:"pickMultipleObjects",value:function(t){return t.depth=t.depth||10,this._pick("pickObject","pickMultipleObjects Time",t).result}},{key:"pickObjects",value:function(t){return this._pick("pickObjects","pickObjects Time",t)}},{key:"_addResources",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];for(var r in t)this.layerManager.resourceManager.add({resourceId:r,data:t[r],forceUpdate:e})}},{key:"_removeResources",value:function(t){var e,r=Vt(t);try{for(r.s();!(e=r.n()).done;){var n=e.value;this.layerManager.resourceManager.remove(n)}}catch(t){r.e(t)}finally{r.f()}}},{key:"_pick",value:function(t,e,r){var n=this.stats;n.get("Pick Count").incrementCount(),n.get(e).timeStart();var i=this.deckPicker[t](Ht({layers:this.layerManager.getLayers(r),views:this.viewManager.getViews(),viewports:this.getViewports(r),onViewportActive:this.layerManager.activateViewport},r));return n.get(e).timeEnd(),i}},{key:"_createCanvas",value:function(t){var e=t.canvas;("string"==typeof e&&(e=document.getElementById(e),Object(Nt.a)(e)),e)||((e=document.createElement("canvas")).id=t.id||"deckgl-overlay",(t.parent||document.body).appendChild(e));return Object.assign(e.style,t.style),e}},{key:"_setCanvasSize",value:function(t){if(this.canvas){var e=t.width,r=t.height;(e||0===e)&&(e=Number.isFinite(e)?"".concat(e,"px"):e,this.canvas.style.width=e),(r||0===r)&&(r=Number.isFinite(r)?"".concat(r,"px"):r,this.canvas.style.position="absolute",this.canvas.style.height=r)}}},{key:"_updateCanvasSize",value:function(){if(this._checkForCanvasSizeChange()){var t=this.width,e=this.height;this.viewManager.setProps({width:t,height:e}),this.props.onResize({width:this.width,height:this.height})}}},{key:"_checkForCanvasSizeChange",value:function(){var t=this.canvas;if(!t)return!1;var e=t.clientWidth||t.width,r=t.clientHeight||t.height;return(e!==this.width||r!==this.height)&&(this.width=e,this.height=r,!0)}},{key:"_createAnimationLoop",value:function(t){var e=this,r=t.width,n=t.height,i=t.gl,o=t.glOptions,a=t.debug,s=t.onError,u=t.onBeforeRender,c=t.onAfterRender,l=t.useDevicePixels,h=t.autoResizeDrawingBuffer;return new et({width:r,height:n,useDevicePixels:l,autoResizeDrawingBuffer:h,autoResizeViewport:!1,gl:i,onCreateContext:function(t){return Object(O.c)(Ht(Ht(Ht({},o),t),{},{canvas:e.canvas,debug:a,onContextLost:function(){return e._onContextLost()}}))},onInitialize:function(t){return e._setGLContext(t.gl)},onRender:this._onRenderFrame.bind(this),onBeforeRender:u,onAfterRender:c,onError:s})}},{key:"_getViewState",value:function(){return this.props.viewState||this.viewState}},{key:"_getViews",value:function(){var t=this.props.views||[new g.a({id:"default-view"})];return(t=Array.isArray(t)?t:[t]).length&&this.props.controller&&(t[0].props.controller=this.props.controller),t}},{key:"_onContextLost",value:function(){var t=this.props.onError;this.animationLoop&&t&&t(new Error("WebGL context is lost"))}},{key:"_onPointerMove",value:function(t){var e=this._pickRequest;if("pointerleave"===t.type)e.x=-1,e.y=-1,e.radius=0;else{if(t.leftButton||t.rightButton)return;var r=t.offsetCenter;if(!r)return;e.x=r.x,e.y=r.y,e.radius=this.props.pickingRadius}this.layerManager&&(this.layerManager.context.mousePosition={x:e.x,y:e.y}),e.event=t,e.mode="hover"}},{key:"_pickAndCallback",value:function(){var t=this._pickRequest;if(t.event){var e=this._pick("pickObject","pickObject Time",t),r=e.result,n=e.emptyInfo;this.interactiveState.isHovering=r.length>0;var i,o=n,a=!1,s=Vt(r);try{for(s.s();!(i=s.n()).done;){var u=i.value;o=u,a=u.layer.onHover(u,t.event)}}catch(t){s.e(t)}finally{s.f()}if(!a&&this.props.onHover&&this.props.onHover(o,t.event),this.props.getTooltip){var c=this.props.getTooltip(o);this.tooltip.setTooltip(c,o.x,o.y)}t.event=null}}},{key:"_updateCursor",value:function(){var t=this.props.parent||this.canvas;t&&(t.style.cursor=this.props.getCursor(this.interactiveState))}},{key:"_setGLContext",value:function(t){if(!this.layerManager){this.canvas||(this.canvas=t.canvas,Object(O.h)(t,{enable:!0,copyState:!0})),this.tooltip=new G(this.canvas),Object(O.n)(t,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(t);var e=new rt.a;for(var r in e.play(),this.animationLoop.attachTimeline(e),this.eventManager=new zt(this.props.parent||t.canvas,{touchAction:this.props.touchAction,recognizerOptions:this.props.eventRecognizerOptions,events:{pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerleave:this._onPointerMove}}),Ut.b)this.eventManager.on(r,this._onEvent);this.viewManager=new A({timeline:e,eventManager:this.eventManager,onViewStateChange:this._onViewStateChange.bind(this),onInteractionStateChange:this._onInteractionStateChange.bind(this),views:this._getViews(),viewState:this._getViewState(),width:this.width,height:this.height});var n=this.viewManager.getViewports()[0];this.layerManager=new c.a(t,{deck:this,stats:this.stats,viewport:n,timeline:e}),this.effectManager=new b,this.deckRenderer=new w.a(t),this.deckPicker=new U(t),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}}},{key:"_drawLayers",value:function(t,e){var r=this.layerManager.context.gl;Object(O.n)(r,this.props.parameters),this.props.onBeforeRender({gl:r}),this.deckRenderer.renderLayers(Ht({target:this.props._framebuffer,layers:this.layerManager.getLayers(),viewports:this.viewManager.getViewports(),onViewportActive:this.layerManager.activateViewport,views:this.viewManager.getViews(),pass:"screen",redrawReason:t,effects:this.effectManager.getEffects()},e)),this.props.onAfterRender({gl:r})}},{key:"_onRenderFrame",value:function(t){this._getFrameStats(),this._metricsCounter++%60==0&&(this._getMetrics(),this.stats.reset(),h.a.table(4,this.metrics)(),this.props._onMetrics&&this.props._onMetrics(this.metrics)),this._updateCanvasSize(),this._updateCursor(),this.tooltip.isVisible&&this.viewManager.needsRedraw()&&this.tooltip.setTooltip(null),this.layerManager.updateLayers(),this._pickAndCallback(),this.redraw(!1),this.viewManager&&this.viewManager.updateViewStates()}},{key:"_onViewStateChange",value:function(t){var e=this.props.onViewStateChange(t)||t.viewState;this.viewState&&(this.viewState=Ht(Ht({},this.viewState),{},i()({},t.viewId,e)),this.props.viewState||this.viewManager&&this.viewManager.setProps({viewState:this.viewState}))}},{key:"_onInteractionStateChange",value:function(t){this.interactiveState.isDragging=t.isDragging,this.props.onInteractionStateChange(t)}},{key:"_onEvent",value:function(t){var e=Ut.b[t.type],r=t.offsetCenter;if(e&&r){var n=this.layerManager.getLayers(),i=this.deckPicker.getLastPickedObject({x:r.x,y:r.y,layers:n,viewports:this.getViewports(r)},this._lastPointerDownInfo),o=i.layer,a=o&&(o[e.handler]||o.props[e.handler]),s=this.props[e.handler],u=!1;a&&(u=a.call(o,i,t)),!u&&s&&s(i,t)}}},{key:"_onPointerDown",value:function(t){var e=t.offsetCenter,r=this._pick("pickObject","pickObject Time",{x:e.x,y:e.y,radius:this.props.pickingRadius});this._lastPointerDownInfo=r.result[0]||r.emptyInfo}},{key:"_getFrameStats",value:function(){var t=this.stats;t.get("frameRate").timeEnd(),t.get("frameRate").timeStart();var e=this.animationLoop.stats;t.get("GPU Time").addTime(e.get("GPU Time").lastTiming),t.get("CPU Time").addTime(e.get("CPU Time").lastTiming)}},{key:"_getMetrics",value:function(){var t=this.metrics,e=this.stats;t.fps=e.get("frameRate").getHz(),t.setPropsTime=e.get("setProps Time").time,t.updateAttributesTime=e.get("Update Attributes").time,t.framesRedrawn=e.get("Redraw Count").count,t.pickTime=e.get("pickObject Time").time+e.get("pickMultipleObjects Time").time+e.get("pickObjects Time").time,t.pickCount=e.get("Pick Count").count,t.gpuTime=e.get("GPU Time").time,t.cpuTime=e.get("CPU Time").time,t.gpuTimePerFrame=e.get("GPU Time").getAverageTime(),t.cpuTimePerFrame=e.get("CPU Time").getAverageTime();var r=Z.a.get("Memory Usage");t.bufferMemory=r.get("Buffer Memory").count,t.textureMemory=r.get("Texture Memory").count,t.renderbufferMemory=r.get("Renderbuffer Memory").count,t.gpuMemory=r.get("GPU Memory").count}}]),t}();Xt.getPropTypes=function(t){return{id:t.string,width:t.oneOfType([t.number,t.string]),height:t.oneOfType([t.number,t.string]),layers:t.oneOfType([t.object,t.array]),layerFilter:t.func,views:t.oneOfType([t.object,t.array]),viewState:t.object,effects:t.arrayOf(t.instanceOf(x.a)),controller:t.oneOfType([t.func,t.bool,t.object]),gl:t.object,glOptions:t.object,parameters:t.object,pickingRadius:t.number,useDevicePixels:t.oneOfType([t.bool,t.number]),touchAction:t.string,eventRecognizerOptions:t.object,onWebGLInitialized:t.func,onResize:t.func,onViewStateChange:t.func,onInteractionStateChange:t.func,onBeforeRender:t.func,onAfterRender:t.func,onLoad:t.func,onError:t.func,debug:t.bool,drawPickingColors:t.bool,_framebuffer:t.object,_animate:t.bool,_pickable:t.bool,_typedArrayManagerProps:t.object}},Xt.defaultProps=Zt,Xt.VERSION=H.a.VERSION},function(t,e,r){"use strict";var n=r(104),i=r(292),o=r(26),a=r(18),s=r(32);var u={name:"JSON",extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:function(t){var e=t[0],r=t[t.length-1];return"{"===e&&"}"===r||"["===e&&"]"===r},parseTextSync:JSON.parse},c="8.6.0-beta.1",l=o.global.deck&&o.global.deck.VERSION;if(l&&l!==c)throw new Error("deck.gl - multiple versions detected: ".concat(l," vs ").concat(c));l||(a.a.log(1,"deck.gl ".concat(c))(),o.global.deck=Object.assign(o.global.deck||{},{VERSION:c,version:c,log:a.a,_registerLoggers:s.b}),Object(n.c)([u,[i.a,{imagebitmap:{premultiplyAlpha:"none"}}]]));e.a=o.global.deck},function(t,e,r){"use strict";t.exports=i;var n=r(266);function i(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}i.Varint=0,i.Fixed64=1,i.Bytes=2,i.Fixed32=5;var o="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function a(t){return t.type===i.Bytes?t.readVarint()+t.pos:t.pos+1}function s(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function u(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function c(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function l(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function h(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function f(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function p(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function d(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function A(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function g(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function m(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}function y(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function v(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function _(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}i.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,o=this.pos;this.type=7&n,t(i,e,this),this.pos===o&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=y(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=_(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=y(this.buf,this.pos)+4294967296*y(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=y(this.buf,this.pos)+4294967296*_(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=n.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=n.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,i,o=r.buf;if(i=o[r.pos++],n=(112&i)>>4,i<128)return s(t,n,e);if(i=o[r.pos++],n|=(127&i)<<3,i<128)return s(t,n,e);if(i=o[r.pos++],n|=(127&i)<<10,i<128)return s(t,n,e);if(i=o[r.pos++],n|=(127&i)<<17,i<128)return s(t,n,e);if(i=o[r.pos++],n|=(127&i)<<24,i<128)return s(t,n,e);if(i=o[r.pos++],n|=(1&i)<<31,i<128)return s(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&o?function(t,e,r){return o.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){var n="",i=e;for(;i<r;){var o,a,s,u=t[i],c=null,l=u>239?4:u>223?3:u>191?2:1;if(i+l>r)break;1===l?u<128&&(c=u):2===l?128==(192&(o=t[i+1]))&&(c=(31&u)<<6|63&o)<=127&&(c=null):3===l?(o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&((c=(15&u)<<12|(63&o)<<6|63&a)<=2047||c>=55296&&c<=57343)&&(c=null)):4===l&&(o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&((c=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,l=1):c>65535&&(c-=65536,n+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),n+=String.fromCharCode(c),i+=l}return n}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==i.Bytes)return t.push(this.readVarint(e));var r=a(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==i.Bytes)return t.push(this.readSVarint());var e=a(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==i.Bytes)return t.push(this.readBoolean());var e=a(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==i.Bytes)return t.push(this.readFloat());var e=a(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==i.Bytes)return t.push(this.readDouble());var e=a(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==i.Bytes)return t.push(this.readFixed32());var e=a(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==i.Bytes)return t.push(this.readSFixed32());var e=a(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==i.Bytes)return t.push(this.readFixed64());var e=a(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==i.Bytes)return t.push(this.readSFixed64());var e=a(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===i.Varint)for(;this.buf[this.pos++]>127;);else if(e===i.Bytes)this.pos=this.readVarint()+this.pos;else if(e===i.Fixed32)this.pos+=4;else{if(e!==i.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var r=new Uint8Array(e);r.set(this.buf),this.buf=r,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),v(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),v(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),v(this.buf,-1&t,this.pos),v(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),v(this.buf,-1&t,this.pos),v(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var r,n;t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos]=127&t}(r,0,e),function(t,e){var r=(7&t)<<4;if(e.buf[e.pos++]|=r|((t>>>=3)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;e.buf[e.pos++]=127&t}(n,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var n,i,o=0;o<e.length;o++){if((n=e.charCodeAt(o))>55295&&n<57344){if(!i){n>56319||o+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):i=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(t[r++]=239,t[r++]=191,t[r++]=189,i=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&u(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),n.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),n.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r<e;r++)this.buf[this.pos++]=t[r]},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this);var n=this.pos-r;n>=128&&u(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,i.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,c,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,l,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,p,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,h,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,f,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,d,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,A,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,g,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,m,e)},writeBytesField:function(t,e){this.writeTag(t,i.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,i.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,i.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,i.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,i.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,i.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,i.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,i.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,i.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,i.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}},function(t,e,r){const n=r(267),i={"||":function(t,e){return t||e},"&&":function(t,e){return t&&e},"|":function(t,e){return t|e},"^":function(t,e){return t^e},"&":function(t,e){return t&e},"==":function(t,e){return t==e},"!=":function(t,e){return t!=e},"===":function(t,e){return t===e},"!==":function(t,e){return t!==e},"<":function(t,e){return t<e},">":function(t,e){return t>e},"<=":function(t,e){return t<=e},">=":function(t,e){return t>=e},"<<":function(t,e){return t<<e},">>":function(t,e){return t>>e},">>>":function(t,e){return t>>>e},"+":function(t,e){return t+e},"-":function(t,e){return t-e},"*":function(t,e){return t*e},"/":function(t,e){return t/e},"%":function(t,e){return t%e}},o={"-":function(t){return-t},"+":function(t){return+t},"~":function(t){return~t},"!":function(t){return!t}};function a(t,e){return t.map((function(t){return l(t,e)}))}async function s(t,e){return await Promise.all(t.map(t=>h(t,e)))}function u(t,e){const r=l(t.object,e);return t.computed?[r,r[l(t.property,e)]]:[r,r[t.property.name]]}async function c(t,e){const r=await h(t.object,e);return t.computed?[r,r[await h(t.property,e)]]:[r,r[t.property.name]]}function l(t,e){switch(t.type){case"ArrayExpression":return a(t.elements,e);case"BinaryExpression":return i[t.operator](l(t.left,e),l(t.right,e));case"CallExpression":let r,n,s;if("MemberExpression"===t.callee.type?(s=u(t.callee,e),r=s[0],n=s[1]):n=l(t.callee,e),"function"!=typeof n)return;return n.apply(r,a(t.arguments,e));case"ConditionalExpression":return l(t.test,e)?l(t.consequent,e):l(t.alternate,e);case"Identifier":return e[t.name];case"Literal":return t.value;case"LogicalExpression":return"||"===t.operator?l(t.left,e)||l(t.right,e):"&&"===t.operator?l(t.left,e)&&l(t.right,e):i[t.operator](l(t.left,e),l(t.right,e));case"MemberExpression":return u(t,e)[1];case"ThisExpression":return e;case"UnaryExpression":return o[t.operator](l(t.argument,e));default:return}}async function h(t,e){switch(t.type){case"ArrayExpression":return await s(t.elements,e);case"BinaryExpression":{const[r,n]=await Promise.all([h(t.left,e),h(t.right,e)]);return i[t.operator](r,n)}case"CallExpression":let r,n,a;if("MemberExpression"===t.callee.type?(a=await c(t.callee,e),r=a[0],n=a[1]):n=await h(t.callee,e),"function"!=typeof n)return;return await n.apply(r,await s(t.arguments,e));case"ConditionalExpression":return await h(t.test,e)?await h(t.consequent,e):await h(t.alternate,e);case"Identifier":return e[t.name];case"Literal":return t.value;case"LogicalExpression":{if("||"===t.operator)return await h(t.left,e)||await h(t.right,e);if("&&"===t.operator)return await h(t.left,e)&&await h(t.right,e);const[r,n]=await Promise.all([h(t.left,e),h(t.right,e)]);return i[t.operator](r,n)}case"MemberExpression":return(await c(t,e))[1];case"ThisExpression":return e;case"UnaryExpression":return o[t.operator](await h(t.argument,e));default:return}}t.exports={parse:n,eval:l,evalAsync:h,compile:function(t){return l.bind(null,n(t))},compileAsync:function(t){return h.bind(null,n(t))}}},function(t,e,r){"use strict";var n=r(75),i=r(196),o=r(177);function a(t){return s(function t(e,r){return e.map(e=>e instanceof i.a?e:(Object(o.a)("string"!=typeof e,`Shader module use by name is deprecated. Import shader module '${e}' and use it directly.`),Object(o.a)(e.name,"shader module has no name"),(e=new i.a(e)).dependencies=t(e.dependencies),e))}(t))}function s(t){const e={},r={};return u({modules:t,level:0,moduleMap:e,moduleDepth:r}),Object.keys(r).sort((t,e)=>r[e]-r[t]).map(t=>e[t])}function u({modules:t,level:e,moduleMap:r,moduleDepth:n}){if(e>=5)throw new Error("Possible loop in shader dependency graph");for(const i of t)r[i.name]=i,(void 0===n[i.name]||n[i.name]<e)&&(n[i.name]=e);for(const i of t)i.dependencies&&u({modules:i.dependencies,level:e+1,moduleMap:r,moduleDepth:n})}const c={GLSL_FRAG_DATA:["WEBGL_draw_buffers",!0],GLSL_FRAG_DEPTH:["EXT_frag_depth",!0],GLSL_DERIVATIVES:["OES_standard_derivatives",!0],GLSL_TEXTURE_LOD:["EXT_shader_texture_lod",!0]},l={};Object.keys(c).forEach(t=>{l[t]=t});const h={};function f(t,e,r={}){const n=c[e];if(Object(o.a)(n,e),!function(t={}){const e="undefined"!=typeof window&&window.navigator||{},r=t.userAgent||e.userAgent||"",n=-1!==r.indexOf("MSIE "),i=-1!==r.indexOf("Trident/");return n||i}(r))return!0;if(e in h)return h[e];const i=`#extension GL_${n[0]} : ${r.behavior||"enable"}\nvoid main(void) {}`,a=t.createShader(35633);t.shaderSource(a,i),t.compileShader(a);const s=t.getShaderParameter(a,35713);return t.deleteShader(a),h[e]=s,s}function p(t,e){const r=c[e];Object(o.a)(r,e);const n=function(t){return"undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||Boolean(t&&2===t._version)}(t)&&r[1]||r[0],i="string"==typeof n?Boolean(t.getExtension(n)):n;return Object(o.a)(!1===i||!0===i),i}function d(t,e){return(e=Array.isArray(e)?e:[e]).every(e=>p(t,e))}var A=r(180);function g(t){return new RegExp(`\\b${t}[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)`,"g")}const m=[[/^(#version[ \t]+(100|300[ \t]+es))?[ \t]*\n/,"#version 300 es\n"],[/\btexture(2D|2DProj|Cube)Lod(EXT)?\(/g,"textureLod("],[/\btexture(2D|2DProj|Cube)(EXT)?\(/g,"texture("]],y=[...m,[g("attribute"),"in $1"],[g("varying"),"out $1"]],v=[...m,[g("varying"),"in $1"]],_=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]],b=[..._,[g("in"),"attribute $1"],[g("out"),"varying $1"]],x=[..._,[g("in"),"varying $1"]],w=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/,E=/void\s+main\s*\([^)]*\)\s*\{\n?/;function S(t,e,r){switch(e){case 300:return r?O(t,y):function(t){const e=(t=O(t,v)).match(w);if(e){const r=e[1];t=t.replace(new RegExp("\\bgl_FragColor\\b","g"),r)}else{const e="fragmentColor";t=t.replace(E,t=>`out vec4 ${e};\n${t}`).replace(new RegExp("\\bgl_FragColor\\b","g"),e)}return t}(t);case 100:return r?O(t,b):function(t){const e=(t=O(t,x)).match(w);if(e){const r=e[1];t=t.replace(w,"").replace(new RegExp(`\\b${r}\\b`,"g"),"gl_FragColor")}return t}(t);default:throw new Error(`unknown GLSL version ${e}`)}}function O(t,e){for(const[r,n]of e)t=t.replace(r,n);return t}const T=`\n\n${A.a}\n\n`,P={[n.b]:"vertex",[n.a]:"fragment"};function M(t,{id:e,source:r,type:i,modules:a,defines:s={},hookFunctions:u=[],inject:c={},transpileToGLSL100:h=!1,prologue:p=!0,log:g}){Object(o.a)("string"==typeof r,"shader source must be a string");const m=i===n.b,y=r.split("\n");let v=100,_="",b=r;0===y[0].indexOf("#version ")?(v=300,_=y[0],b=y.slice(1).join("\n")):_=`#version ${v}`;const x={};a.forEach(t=>{Object.assign(x,t.getDefines())}),Object.assign(x,s);let w=p?`${_}\n${function({id:t,source:e,type:r}){return t&&"string"==typeof t&&-1===e.indexOf("SHADER_NAME")?`\n#define SHADER_NAME ${t}_${P[r]}\n\n`:""}({id:e,source:r,type:i})}\n${function({type:t}){return`\n#define SHADER_TYPE_${P[t].toUpperCase()}\n`}({type:i})}\n${function(t){switch(function(t){const e=t.getExtension("WEBGL_debug_renderer_info"),r=t.getParameter(e&&e.UNMASKED_VENDOR_WEBGL||7936),n=t.getParameter(e&&e.UNMASKED_RENDERER_WEBGL||7937);return{gpuVendor:function(t,e){if(t.match(/NVIDIA/i)||e.match(/NVIDIA/i))return"NVIDIA";if(t.match(/INTEL/i)||e.match(/INTEL/i))return"INTEL";if(t.match(/AMD/i)||e.match(/AMD/i)||t.match(/ATI/i)||e.match(/ATI/i))return"AMD";return"UNKNOWN GPU"}(r,n),vendor:r,renderer:n,version:t.getParameter(7938),shadingLanguageVersion:t.getParameter(35724)}}(t).gpuVendor.toLowerCase()){case"nvidia":return"#define NVIDIA_GPU\n// Nvidia optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n";case"intel":return"#define INTEL_GPU\n// Intel optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n";case"amd":return"#define AMD_GPU\n";default:return"#define DEFAULT_GPU\n// Prevent driver from optimizing away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n"}}(t)}\n${function(t,e,r){let n="#if (__VERSION__ > 120)\n\n# define FEATURE_GLSL_DERIVATIVES\n# define FEATURE_GLSL_DRAW_BUFFERS\n# define FEATURE_GLSL_FRAG_DEPTH\n# define FEATURE_GLSL_TEXTURE_LOD\n\n// DEPRECATED FLAGS, remove in v9\n# define FRAG_DEPTH\n# define DERIVATIVES\n# define DRAW_BUFFERS\n# define TEXTURE_LOD\n\n#endif // __VERSION\n";return d(t,l.GLSL_FRAG_DEPTH)&&(n+="\n// FRAG_DEPTH => gl_FragDepth is available\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n# define FEATURE_GLSL_FRAG_DEPTH\n# define FRAG_DEPTH\n# define gl_FragDepth gl_FragDepthEXT\n#endif\n"),d(t,l.GLSL_DERIVATIVES)&&f(t,l.GLSL_DERIVATIVES)&&(n+="\n// DERIVATIVES => dxdF, dxdY and fwidth are available\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n# define FEATURE_GLSL_DERIVATIVES\n# define DERIVATIVES\n#endif\n"),d(t,l.GLSL_FRAG_DATA)&&f(t,l.GLSL_FRAG_DATA,{behavior:"require"})&&(n+="\n// DRAW_BUFFERS => gl_FragData[] is available\n#ifdef GL_EXT_draw_buffers\n#extension GL_EXT_draw_buffers : require\n#define FEATURE_GLSL_DRAW_BUFFERS\n#define DRAW_BUFFERS\n#endif\n"),d(t,l.GLSL_TEXTURE_LOD)&&(n+="// TEXTURE_LOD => texture2DLod etc are available\n#ifdef GL_EXT_shader_texture_lod\n#extension GL_EXT_shader_texture_lod : enable\n\n# define FEATURE_GLSL_TEXTURE_LOD\n# define TEXTURE_LOD\n\n#endif\n"),n}(t)}\n${function(t={}){let e=0,r="";for(const n in t){0===e&&(r+="\n// APPLICATION DEFINES\n"),e++;const i=t[n];(i||Number.isFinite(i))&&(r+=`#define ${n.toUpperCase()} ${t[n]}\n`)}0===e&&(r+="\n");return r}(x)}\n${m?"":"precision highp float;\n\n"}\n`:`${_}\n`;const E=function(t){const e={vs:{},fs:{}};return t.forEach(t=>{let r;"string"!=typeof t?(r=t,t=r.hook):r={},t=t.trim();const[n,i]=t.split(":"),o=t.replace(/\(.+/,"");e[n][o]=Object.assign(r,{signature:i})}),e}(u),O={},M={},C={};for(const t in c){const e="string"==typeof c[t]?{injection:c[t],order:0}:c[t],r=t.match(/^(v|f)s:(#)?([\w-]+)$/);if(r){const n=r[2],i=r[3];n?"decl"===i?M[t]=[e]:C[t]=[e]:O[t]=[e]}else C[t]=[e]}for(const t of a){g&&t.checkDeprecations(b,g),w+=t.getModuleSource(i,v);const e=t.injections[i];for(const t in e){const r=t.match(/^(v|f)s:#([\w-]+)$/);if(r){const n="decl"===r[2]?M:C;n[t]=n[t]||[],n[t].push(e[t])}else O[t]=O[t]||[],O[t].push(e[t])}}return w+=T,w=Object(A.c)(w,i,M),w+=function(t,e){let r="";for(const n in t){const i=t[n];if(r+=`void ${i.signature} {\n`,i.header&&(r+=` ${i.header}`),e[n]){const t=e[n];t.sort((t,e)=>t.order-e.order);for(const e of t)r+=` ${e.injection}\n`}i.footer&&(r+=` ${i.footer}`),r+="}\n"}return r}(E[i],O),w+=b,w=Object(A.c)(w,i,C),w=S(w,h?100:v,m),w}function C(t){return function(e){const r={};for(const n of t){const t=n.getUniforms(e,r);Object.assign(r,t)}return r}}var I=r(293);r.d(e,"a",(function(){return k}));class k{static getDefaultProgramManager(t){return t.luma=t.luma||{},t.luma.defaultProgramManager=t.luma.defaultProgramManager||new k(t),t.luma.defaultProgramManager}constructor(t){this.gl=t,this._programCache={},this._getUniforms={},this._registeredModules={},this._hookFunctions=[],this._defaultModules=[],this._hashes={},this._hashCounter=0,this.stateHash=0,this._useCounts={}}addDefaultModule(t){this._defaultModules.find(e=>e.name===t.name)||this._defaultModules.push(t),this.stateHash++}removeDefaultModule(t){const e="string"==typeof t?t:t.name;this._defaultModules=this._defaultModules.filter(t=>t.name!==e),this.stateHash++}addShaderHook(t,e){e&&(t=Object.assign(e,{hook:t})),this._hookFunctions.push(t),this.stateHash++}get(t={}){const{vs:e="",fs:r="",defines:i={},inject:o={},varyings:s=[],bufferMode:u=35981,transpileToGLSL100:c=!1}=t,l=this._getModuleList(t.modules),h=this._getHash(e),f=this._getHash(r),p=l.map(t=>this._getHash(t.name)).sort(),d=s.map(t=>this._getHash(t)),A=Object.keys(i).sort(),g=Object.keys(o).sort(),m=[],y=[];for(const t of A)m.push(this._getHash(t)),m.push(this._getHash(i[t]));for(const t of g)y.push(this._getHash(t)),y.push(this._getHash(o[t]));const v=`${h}/${f}D${m.join("/")}M${p.join("/")}I${y.join("/")}V${d.join("/")}H${this.stateHash}B${u}${c?"T":""}`;if(!this._programCache[v]){const t=function(t,e){const{vs:r,fs:i}=e,o=a(e.modules||[]);return{gl:t,vs:M(t,Object.assign({},e,{source:r,type:n.b,modules:o})),fs:M(t,Object.assign({},e,{source:i,type:n.a,modules:o})),getUniforms:C(o)}}(this.gl,{vs:e,fs:r,modules:l,inject:o,defines:i,hookFunctions:this._hookFunctions,transpileToGLSL100:c});this._programCache[v]=new I.a(this.gl,{hash:v,vs:t.vs,fs:t.fs,varyings:s,bufferMode:u}),this._getUniforms[v]=t.getUniforms||(t=>{}),this._useCounts[v]=0}return this._useCounts[v]++,this._programCache[v]}getUniforms(t){return this._getUniforms[t.hash]||null}release(t){const e=t.hash;this._useCounts[e]--,0===this._useCounts[e]&&(this._programCache[e].delete(),delete this._programCache[e],delete this._getUniforms[e],delete this._useCounts[e])}_getHash(t){return void 0===this._hashes[t]&&(this._hashes[t]=this._hashCounter++),this._hashes[t]}_getModuleList(t=[]){const e=new Array(this._defaultModules.length+t.length),r={};let n=0;for(let t=0,i=this._defaultModules.length;t<i;++t){const i=this._defaultModules[t],o=i.name;e[n++]=i,r[o]=!0}for(let i=0,o=t.length;i<o;++i){const o=t[i],a=o.name;r[a]||(e[n++]=o,r[a]=!0)}return e.length=n,e}}},function(t,e,r){"use strict";var n=r(177);const i={number:{validate:(t,e)=>Number.isFinite(t)&&(!("max"in e)||t<=e.max)&&(!("min"in e)||t>=e.min)},array:{validate:(t,e)=>Array.isArray(t)||ArrayBuffer.isView(t)}};function o(t){let e=a(t);return"object"===e?t?"type"in t?Object.assign({},t,i[t.type]):"value"in t?(e=a(t.value),Object.assign({type:e},t,i[e])):{type:"object",value:t}:{type:"object",value:null}:Object.assign({type:e,value:t},i[e])}function a(t){return Array.isArray(t)||ArrayBuffer.isView(t)?"array":typeof t}r.d(e,"a",(function(){return s})),r.d(e,"b",(function(){return u}));class s{constructor({name:t,vs:e,fs:r,dependencies:i=[],uniforms:a,getUniforms:s,deprecations:u=[],defines:c={},inject:l={},vertexShader:h,fragmentShader:f}){Object(n.a)("string"==typeof t),this.name=t,this.vs=e||h,this.fs=r||f,this.getModuleUniforms=s,this.dependencies=i,this.deprecations=this._parseDeprecationDefinitions(u),this.defines=c,this.injections=function(t){const e={vs:{},fs:{}};for(const r in t){let n=t[r];const i=r.slice(0,2);"string"==typeof n&&(n={order:0,injection:n}),e[i][r]=n}return e}(l),a&&(this.uniforms=function(t){const e={};for(const r in t){const n=o(t[r]);e[r]=n}return e}(a))}getModuleSource(t){let e;switch(t){case"vs":e=this.vs||"";break;case"fs":e=this.fs||"";break;default:Object(n.a)(!1)}return`#define MODULE_${this.name.toUpperCase().replace(/[^0-9a-z]/gi,"_")}\n${e}// END MODULE_${this.name}\n\n`}getUniforms(t,e){return this.getModuleUniforms?this.getModuleUniforms(t,e):this.uniforms?this._defaultGetUniforms(t):{}}getDefines(){return this.defines}checkDeprecations(t,e){this.deprecations.forEach(r=>{r.regex.test(t)&&(r.deprecated?e.deprecated(r.old,r.new)():e.removed(r.old,r.new)())})}_parseDeprecationDefinitions(t){return t.forEach(t=>{switch(t.type){case"function":t.regex=new RegExp(`\\b${t.old}\\(`);break;default:t.regex=new RegExp(`${t.type} ${t.old};`)}}),t}_defaultGetUniforms(t={}){const e={},r=this.uniforms;for(const i in r){const o=r[i];i in t&&!o.private?(o.validate&&Object(n.a)(o.validate(t[i],o),`${this.name}: invalid ${i}`),e[i]=t[i]):e[i]=o.value}return e}}function u(t){if(!t.normalized&&(t.normalized=!0,t.uniforms&&!t.getUniforms)){const e=new s(t);t.getUniforms=e.getUniforms.bind(e)}return t}},function(t,e,r){"use strict";var n=r(34),i=r(71),o=r(55),a=r(7),s=r(54),u=r(9);function c(t){switch(t){case 6406:case 33326:case 6403:return 1;case 33328:case 33319:return 2;case 6407:case 34837:return 3;case 6408:case 34836:return 4;default:return Object(u.a)(!1),0}}var l=r(230);function h(t,e={}){const{sourceX:r=0,sourceY:n=0,sourceFormat:i=6408}=e;let{sourceAttachment:o=36064,target:a=null,sourceWidth:l,sourceHeight:h,sourceType:f}=e;const{framebuffer:p,deleteFramebuffer:d}=A(t);Object(u.a)(p);const{gl:g,handle:m,attachments:y}=p;l=l||p.width,h=h||p.height,36064===o&&null===m&&(o=1028),Object(u.a)(y[o]),f=f||y[o].type,a=function(t,e,r,n,i){if(t)return t;e=e||5121;const o=Object(s.c)(e,{clamped:!1}),a=c(r);return new o(n*i*a)}(a,f,i,l,h),f=f||Object(s.b)(a);const v=g.bindFramebuffer(36160,m);return g.readPixels(r,n,l,h,i,f,a),g.bindFramebuffer(36160,v||null),d&&p.delete(),a}function f(t,{sourceX:e=0,sourceY:r=0,sourceFormat:i=6408,target:o=null,targetByteOffset:s=0,sourceWidth:l,sourceHeight:h,sourceType:f}){const{framebuffer:p,deleteFramebuffer:d}=A(t);Object(u.a)(p),l=l||p.width,h=h||p.height;const g=Object(a.a)(p.gl);if(f=f||(o?o.type:5121),!o){const t=c(i),e=function(t){switch(t){case 5121:return 1;case 33635:case 32819:case 32820:return 2;case 5126:return 4;default:return Object(u.a)(!1),0}}(f),r=s+l*h*t*e;o=new n.a(g,{byteLength:r,accessor:{type:f,size:t}})}return o.bind({target:35051}),Object(a.o)(g,{framebuffer:p},()=>{g.readPixels(e,r,l,h,i,f,s)}),o.unbind({target:35051}),d&&p.delete(),o}function p(t,{sourceAttachment:e=36064,targetMaxHeight:r=Number.MAX_SAFE_INTEGER}={}){let n=h(t,{sourceAttachment:e}),{width:i,height:o}=t;for(;o>r;)({data:n,width:i,height:o}=Object(s.d)({data:n,width:i,height:o}));Object(s.a)({data:n,width:i,height:o});const a=document.createElement("canvas");a.width=i,a.height=o;const u=a.getContext("2d"),c=u.createImageData(i,o);return c.data.set(n),u.putImageData(c,0,0),a.toDataURL()}function d(t,e,r={}){const{sourceX:n=0,sourceY:i=0,targetMipmaplevel:s=0,targetInternalFormat:c=6408}=r;let{targetX:l,targetY:h,targetZ:f,width:p,height:d}=r;const{framebuffer:g,deleteFramebuffer:m}=A(t);Object(u.a)(g);const{gl:y,handle:v}=g,_=void 0!==l||void 0!==h||void 0!==f;l=l||0,h=h||0,f=f||0;const b=y.bindFramebuffer(36160,v);Object(u.a)(e);let x=null;if(e instanceof o.a&&(x=e,p=Number.isFinite(p)?p:x.width,d=Number.isFinite(d)?d:x.height,x.bind(0),e=x.target),_)switch(e){case 3553:case 34067:y.copyTexSubImage2D(e,s,l,h,n,i,p,d);break;case 35866:case 32879:Object(a.a)(y).copyTexSubImage3D(e,s,l,h,f,n,i,p,d)}else y.copyTexImage2D(e,s,c,n,i,p,d,0);return x&&x.unbind(),y.bindFramebuffer(36160,b||null),m&&g.delete(),x}function A(t){return t instanceof i.a?{framebuffer:t,deleteFramebuffer:!1}:{framebuffer:Object(l.b)(t),deleteFramebuffer:!0}}r.d(e,"c",(function(){return h})),r.d(e,"d",(function(){return f})),r.d(e,"a",(function(){return p})),r.d(e,"b",(function(){return d}))},,,,,function(t,e,r){"use strict";(function(t){var e=r(229),n=r(36),i=r(122);function o(t,{extension:e,target:r,target2:o}){const a=i.b[e];Object(n.a)(a);const{meta:s={}}=a,{suffix:u=""}=s,c=t.getExtension(e);for(const e of Object.keys(a)){const n=`${e}${u}`;let i=null;"meta"===e||"function"==typeof t[e]||(c&&"function"==typeof c[n]?i=(...t)=>c[n](...t):"function"==typeof a[e]&&(i=a[e].bind(r))),i&&(r[e]=i,o[e]=i)}}(void 0!==t?t:window).polyfillContext=function(t){t.luma=t.luma||{};const{luma:r}=t;return r.polyfilled||(Object(e.a)(t),function(t){t.luma.extensions={};const e=t.getSupportedExtensions()||[];for(const r of e)t.luma[r]=t.getExtension(r)}(t),function(t,e){for(const r of Object.getOwnPropertyNames(e))"overrides"!==r&&o(t,{extension:r,target:t.luma,target2:t})}(t,i.b),function(t,{target:e,target2:r}){Object.keys(i.a).forEach(n=>{if("function"==typeof i.a[n]){const o=t[n]?t[n].bind(t):()=>{},a=i.a[n].bind(null,t,o);e[n]=a,r[n]=a}})}(t,{target:r,target2:t}),r.polyfilled=!0),t}}).call(this,r(65))},function(t,e,r){"use strict";(function(t,n){var i=r(123);Object.defineProperty(e,"__esModule",{value:!0}),e.console=e.process=e.document=e.global=e.window=e.self=void 0;var o=i(r(24)),a={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==t&&t,document:"undefined"!=typeof document&&document,process:"object"===(void 0===n?"undefined":(0,o.default)(n))&&n},s=a.self||a.window||a.global;e.self=s;var u=a.window||a.self||a.global;e.window=u;var c=a.global||a.self||a.window;e.global=c;var l=a.document||{};e.document=l;var h=a.process||{};e.process=h;var f=console;e.console=f}).call(this,r(65),r(57))},function(t,e,r){"use strict";(function(t){var n=r(123);Object.defineProperty(e,"__esModule",{value:!0}),e.default=a,e.isBrowserMainThread=function(){return a()&&"undefined"!=typeof document};var i=n(r(24)),o=n(r(185));function a(){return!("object"===(void 0===t?"undefined":(0,i.default)(t))&&"[object process]"===String(t)&&!t.browser)||(0,o.default)()}}).call(this,r(57))},function(t,e,r){"use strict";r.d(e,"a",(function(){return d}));var n=r(23),i=r(169),o=r(74),a=r(17),s=r(27),u=r(21),c=r(28);const l=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]),f=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}),p={};class d extends i.a{static get IDENTITY(){return p.IDENTITY=p.IDENTITY||Object.freeze(new d(l)),p.IDENTITY}static get ZERO(){return p.ZERO=p.ZERO||Object.freeze(new d(h)),p.ZERO}get INDICES(){return f}get ELEMENTS(){return 16}get RANK(){return 4}constructor(t){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(t)?this.copy(t):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15],this.check()}set(t,e,r,n,i,o,a,s,u,c,l,h,f,p,d,A){return this[0]=t,this[1]=e,this[2]=r,this[3]=n,this[4]=i,this[5]=o,this[6]=a,this[7]=s,this[8]=u,this[9]=c,this[10]=l,this[11]=h,this[12]=f,this[13]=p,this[14]=d,this[15]=A,this.check()}setRowMajor(t,e,r,n,i,o,a,s,u,c,l,h,f,p,d,A){return this[0]=t,this[1]=i,this[2]=u,this[3]=f,this[4]=e,this[5]=o,this[6]=c,this[7]=p,this[8]=r,this[9]=a,this[10]=l,this[11]=d,this[12]=n,this[13]=s,this[14]=h,this[15]=A,this.check()}toRowMajor(t){return t[0]=this[0],t[1]=this[4],t[2]=this[8],t[3]=this[12],t[4]=this[1],t[5]=this[5],t[6]=this[9],t[7]=this[13],t[8]=this[2],t[9]=this[6],t[10]=this[10],t[11]=this[14],t[12]=this[3],t[13]=this[7],t[14]=this[11],t[15]=this[15],t}identity(){return this.copy(l)}fromQuaternion(t){return a.c(this,t),this.check()}frustum({left:t,right:e,bottom:r,top:n,near:i,far:o}){return o===1/0?d._computeInfinitePerspectiveOffCenter(this,t,e,r,n,i):a.d(this,t,e,r,n,i,o),this.check()}static _computeInfinitePerspectiveOffCenter(t,e,r,n,i,o){const a=2*o/(r-e),s=2*o/(i-n),u=(r+e)/(r-e),c=(i+n)/(i-n),l=-2*o;return t[0]=a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=u,t[9]=c,t[10]=-1,t[11]=-1,t[12]=0,t[13]=0,t[14]=l,t[15]=0,t}lookAt(t,e,r){return 1===arguments.length&&({eye:t,center:e,up:r}=t),e=e||[0,0,0],r=r||[0,1,0],a.g(this,t,e,r),this.check()}ortho({left:t,right:e,bottom:r,top:n,near:i=.1,far:o=500}){return a.i(this,t,e,r,n,i,o),this.check()}orthographic({fovy:t=45*Math.PI/180,aspect:e=1,focalDistance:r=1,near:n=.1,far:i=500}){if(t>2*Math.PI)throw Error("radians");const o=t/2,a=r*Math.tan(o),s=a*e;return(new d).ortho({left:-s,right:s,bottom:-a,top:a,near:n,far:i})}perspective({fovy:t,fov:e=45*Math.PI/180,aspect:r=1,near:n=.1,far:i=500}={}){if((t=t||e)>2*Math.PI)throw Error("radians");return a.j(this,t,r,n,i),this.check()}determinant(){return a.a(this)}getScale(t=[-0,-0,-0]){return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}getTranslation(t=[-0,-0,-0]){return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}getRotation(t=[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],e=null){const r=this.getScale(e||[-0,-0,-0]),n=1/r[0],i=1/r[1],o=1/r[2];return t[0]=this[0]*n,t[1]=this[1]*i,t[2]=this[2]*o,t[3]=0,t[4]=this[4]*n,t[5]=this[5]*i,t[6]=this[6]*o,t[7]=0,t[8]=this[8]*n,t[9]=this[9]*i,t[10]=this[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}getRotationMatrix3(t=[-0,-0,-0,-0,-0,-0,-0,-0,-0],e=null){const r=this.getScale(e||[-0,-0,-0]),n=1/r[0],i=1/r[1],o=1/r[2];return t[0]=this[0]*n,t[1]=this[1]*i,t[2]=this[2]*o,t[3]=this[4]*n,t[4]=this[5]*i,t[5]=this[6]*o,t[6]=this[8]*n,t[7]=this[9]*i,t[8]=this[10]*o,t}transpose(){return a.q(this,this),this.check()}invert(){return a.f(this,this),this.check()}multiplyLeft(t){return a.h(this,t,this),this.check()}multiplyRight(t){return a.h(this,this,t),this.check()}rotateX(t){return a.l(this,this,t),this.check()}rotateY(t){return a.m(this,this,t),this.check()}rotateZ(t){return a.n(this,this,t),this.check()}rotateXYZ([t,e,r]){return this.rotateX(t).rotateY(e).rotateZ(r)}rotateAxis(t,e){return a.k(this,this,t,e),this.check()}scale(t){return Array.isArray(t)?a.o(this,this,t):a.o(this,this,[t,t,t]),this.check()}translate(t){return a.p(this,this,t),this.check()}transform(t,e){return 4===t.length?(e=c.n(e||[-0,-0,-0,-0],t,this),Object(n.b)(e,4),e):this.transformAsPoint(t,e)}transformAsPoint(t,e){const{length:r}=t;switch(r){case 2:e=s.j(e||[-0,-0],t,this);break;case 3:e=u.s(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Object(n.b)(e,t.length),e}transformAsVector(t,e){switch(t.length){case 2:e=Object(o.a)(e||[-0,-0],t,this);break;case 3:e=Object(o.c)(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Object(n.b)(e,t.length),e}makeRotationX(t){return this.identity().rotateX(t)}makeTranslation(t,e,r){return this.identity().translate([t,e,r])}transformPoint(t,e){return Object(n.c)("Matrix4.transformPoint","3.0"),this.transformAsPoint(t,e)}transformVector(t,e){return Object(n.c)("Matrix4.transformVector","3.0"),this.transformAsPoint(t,e)}transformDirection(t,e){return Object(n.c)("Matrix4.transformDirection","3.0"),this.transformAsVector(t,e)}}},function(t,e,r){"use strict";r.d(e,"a",(function(){return s}));var n=r(19),i=r(47),o=r(41),a=r(96);async function s(t,e,r,s){Array.isArray(e)||Object(i.a)(e)||(void 0,r=e,e=void 0);const u=Object(o.a)(r);let c=t;return"string"==typeof t&&(c=await u(t)),Object(n.b)(t)&&(c=await u(t)),await Object(a.a)(c,e,r)}},function(t,e,r){"use strict";var n=r(95);e.a={name:"project32",dependencies:[n.a],vs:"\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset, out vec4 commonPosition\n) {\n vec3 projectedPosition = project_position(position, position64Low);\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n // offset is specified as ENU\n // when in globe projection, rotate offset so that the ground alighs with the surface of the globe\n mat3 rotation = project_get_orientation_matrix(projectedPosition);\n offset = rotation * offset;\n }\n commonPosition = vec4(projectedPosition + offset, 1.0);\n return project_common_position_to_clipspace(commonPosition);\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset\n) {\n vec4 commonPosition;\n return project_position_to_clipspace(position, position64Low, offset, commonPosition);\n}\n"}},function(t,e,r){"use strict";r.d(e,"a",(function(){return u}));var n=r(2),i=r.n(n),o=r(3),a=r.n(o),s=r(72),u=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i()(this,t),this.opts=e}return a()(t,[{key:"equals",value:function(t){return this===t||this.constructor===t.constructor&&Object(s.a)(this.opts,t.opts)}},{key:"getShaders",value:function(t){return null}},{key:"getSubLayerProps",value:function(t){var e=t.constructor.defaultProps,r=void 0===e?{}:e,n={updateTriggers:{}};for(var i in r)if(i in this.props){var o=r[i],a=this.props[i];n[i]=a,o&&"accessor"===o.type&&(n.updateTriggers[i]=this.props.updateTriggers[i],"function"==typeof a&&(n[i]=this.getSubLayerAccessor(a,!0)))}return n}},{key:"initializeState",value:function(t,e){}},{key:"updateState",value:function(t,e){}},{key:"draw",value:function(t,e){}},{key:"finalizeState",value:function(t){}}]),t}()},function(t,e,r){"use strict";r.d(e,"a",(function(){return p}));var n=r(2),i=r.n(n),o=r(3),a=r.n(o),s=r(53),u=r(67),c=r(37),l=r(34);function h(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return f(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return f(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var p=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i()(this,t);var r=e.attributes,n=void 0===r?{}:r;this.typedArrayManager=u.a,this.indexStarts=null,this.vertexStarts=null,this.vertexCount=0,this.instanceCount=0,this.attributes={},this._attributeDefs=n,this.opts=e,this.updateGeometry(e),Object.seal(this)}return a()(t,[{key:"updateGeometry",value:function(t){Object.assign(this.opts,t);var e=this.opts,r=e.data,n=e.buffers,i=void 0===n?{}:n,o=e.getGeometry,a=e.geometryBuffer,s=e.positionFormat,u=e.dataChanged,l=e.normalize,f=void 0===l||l;if(this.data=r,this.getGeometry=o,this.positionSize=a&&a.size||("XY"===s?2:3),this.buffers=i,this.normalize=f,a&&(Object(c.a)(r.startIndices),this.getGeometry=this.getGeometryFromBuffer(a),f||(i.positions=a)),this.geometryBuffer=i.positions,Array.isArray(u)){var p,d=h(u);try{for(d.s();!(p=d.n()).done;){var A=p.value;this._rebuildGeometry(A)}}catch(t){d.e(t)}finally{d.f()}}else this._rebuildGeometry()}},{key:"updatePartialGeometry",value:function(t){var e=t.startRow,r=t.endRow;this._rebuildGeometry({startRow:e,endRow:r})}},{key:"normalizeGeometry",value:function(t){return t}},{key:"updateGeometryAttributes",value:function(t,e,r){throw new Error("Not implemented")}},{key:"getGeometrySize",value:function(t){throw new Error("Not implemented")}},{key:"getGeometryFromBuffer",value:function(t){var e=t.value||t;return Object(c.a)(ArrayBuffer.isView(e)),Object(s.b)(e,{size:this.positionSize,offset:t.offset,stride:t.stride,startIndices:this.data.startIndices})}},{key:"_allocate",value:function(t,e){var r=this.attributes,n=this.buffers,i=this._attributeDefs,o=this.typedArrayManager;for(var a in i)if(a in n)o.release(r[a]),r[a]=null;else{var s=i[a];s.copy=e,r[a]=o.allocate(r[a],t,s)}}},{key:"_forEachGeometry",value:function(t,e,r){var n,i=this.data,o=this.getGeometry,a=Object(s.a)(i,e,r),u=a.iterable,c=a.objectInfo,l=h(u);try{for(l.s();!(n=l.n()).done;){var f=n.value;c.index++,t(o(f,c),c.index)}}catch(t){l.e(t)}finally{l.f()}}},{key:"_rebuildGeometry",value:function(t){var e=this;if(this.data&&this.getGeometry){var r=this.indexStarts,n=this.vertexStarts,i=this.instanceCount,o=this.data,a=this.geometryBuffer,s=t||{},u=s.startRow,c=void 0===u?0:u,h=s.endRow,f=void 0===h?1/0:h,p={};if(t||(r=[0],n=[0]),this.normalize||!a)this._forEachGeometry((function(t,r){t=e.normalizeGeometry(t),p[r]=t,n[r+1]=n[r]+e.getGeometrySize(t)}),c,f),i=n[n.length-1];else if(a.buffer instanceof l.a){var d=a.stride||4*this.positionSize;n=o.startIndices,i=n[o.length]||a.buffer.byteLength/d}else{var A=a.value||a,g=a.stride/A.BYTES_PER_ELEMENT||this.positionSize;n=o.startIndices,i=n[o.length]||A.length/g}this._allocate(i,Boolean(t)),this.indexStarts=r,this.vertexStarts=n,this.instanceCount=i;var m={};this._forEachGeometry((function(t,o){t=p[o]||t,m.vertexStart=n[o],m.indexStart=r[o];var a=o<n.length-1?n[o+1]:i;m.geometrySize=a-n[o],m.geometryIndex=o,e.updateGeometryAttributes(t,m)}),c,f),this.vertexCount=r[r.length-1]}}}]),t}()},function(t,e){},function(t,e,r){"use strict";r.d(e,"a",(function(){return a}));var n=r(4),i=r(137);const o={id:"request-scheduler",throttleRequests:!0,maxRequests:6};class a{constructor(t={}){Object(n.a)(this,"props",void 0),Object(n.a)(this,"stats",void 0),Object(n.a)(this,"activeRequestCount",0),Object(n.a)(this,"requestQueue",[]),Object(n.a)(this,"requestMap",new Map),Object(n.a)(this,"deferredUpdate",null),this.props={...o,...t},this.stats=new i.a({id:this.props.id}),this.stats.get("Queued Requests"),this.stats.get("Active Requests"),this.stats.get("Cancelled Requests"),this.stats.get("Queued Requests Ever"),this.stats.get("Active Requests Ever")}scheduleRequest(t,e=(()=>0)){if(!this.props.throttleRequests)return Promise.resolve({done:()=>{}});if(this.requestMap.has(t))return this.requestMap.get(t);const r={handle:t,priority:0,getPriority:e},n=new Promise(t=>(r.resolve=t,r));return this.requestQueue.push(r),this.requestMap.set(t,n),this._issueNewRequests(),n}_issueRequest(t){const{handle:e,resolve:r}=t;let n=!1;const i=()=>{n||(n=!0,this.requestMap.delete(e),this.activeRequestCount--,this._issueNewRequests())};return this.activeRequestCount++,r?r({done:i}):Promise.resolve({done:i})}_issueNewRequests(){this.deferredUpdate||(this.deferredUpdate=setTimeout(()=>this._issueNewRequestsAsync(),0))}_issueNewRequestsAsync(){this.deferredUpdate=null;const t=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(0!==t){this._updateAllRequests();for(let e=0;e<t;++e){const t=this.requestQueue.shift();t&&this._issueRequest(t)}}}_updateAllRequests(){const t=this.requestQueue;for(let e=0;e<t.length;++e){const r=t[e];this._updateRequest(r)||(t.splice(e,1),this.requestMap.delete(r.handle),e--)}t.sort((t,e)=>t.priority-e.priority)}_updateRequest(t){return t.priority=t.getPriority(t.handle),!(t.priority<0)||(t.resolve(null),!1)}}},function(t,e){},function(t,e,r){"use strict";r.d(e,"a",(function(){return n}));const n={name:"JSON",id:"json",module:"json",version:"3.0.8",extensions:["json","geojson"],mimeTypes:["application/json"],category:"json",text:!0,parseTextSync:i,parse:async t=>i((new TextDecoder).decode(t)),options:{}};function i(t){return JSON.parse(t)}},function(t,e,r){"use strict";r.d(e,"a",(function(){return g}));var n=r(2),i=r.n(n),o=r(3),a=r.n(o),s=r(5),u=r.n(s),c=r(6),l=r.n(c),h=r(1),f=r.n(h),p=r(275),d=r(14);function A(t){var e=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(t){return!1}}();return function(){var r,n=f()(t);if(e){var i=f()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return l()(this,r)}}var g=function(t){u()(r,t);var e=A(r);function r(){return i()(this,r),e.apply(this,arguments)}return a()(r,[{key:"getGeometry",value:function(t){return new p.a}},{key:"draw",value:function(t){var e=t.uniforms,r=this.props,n=r.elevationScale,i=r.extruded,o=r.offset,a=r.coverage,s=r.cellSize,u=r.angle,c=r.radiusUnits;this.state.model.setUniforms(e).setUniforms({radius:s/2,radiusUnits:d.d[c],angle:u,offset:o,extruded:i,coverage:a,elevationScale:n,edgeDistance:1,isWireframe:!1}).draw()}}]),r}(r(157).a);g.layerName="GridCellLayer",g.defaultProps={cellSize:{type:"number",min:0,value:1e3},offset:{type:"array",min:0,value:[1,1]}}},function(t,e,r){"use strict";r.d(e,"a",(function(){return S}));var n=r(2),i=r.n(n),o=r(3),a=r.n(o),s=r(5),u=r.n(s),c=r(6),l=r.n(c),h=r(1),f=r.n(h),p=r(18),d=r(53),A=r(190),g=r(108),m=r(109),y=r(136),v=r(173);function _(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return b(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return b(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function b(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function x(t){var e=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(t){return!1}}();return function(){var r,n=f()(t);if(e){var i=f()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return l()(this,r)}}var w=[0,0,0,255],E={stroked:!0,filled:!0,extruded:!1,elevationScale:1,wireframe:!1,_normalize:!0,_windingOrder:"CW",lineWidthUnits:"meters",lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,lineJointRounded:!1,lineMiterLimit:4,getPolygon:{type:"accessor",value:function(t){return t.polygon}},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:w},getLineWidth:{type:"accessor",value:1},getElevation:{type:"accessor",value:1e3},material:!0},S=function(t){u()(r,t);var e=x(r);function r(){return i()(this,r),e.apply(this,arguments)}return a()(r,[{key:"initializeState",value:function(){this.state={paths:[]},this.props.getLineDashArray&&p.a.removed("getLineDashArray","PathStyleExtension")()}},{key:"updateState",value:function(t){var e=this,r=(t.oldProps,t.props,t.changeFlags),n=r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getPolygon);if(n&&Array.isArray(r.dataChanged)){var i=this.state.paths.slice(),o=r.dataChanged.map((function(t){return Object(v.a)({data:i,getIndex:function(t){return t.__source.index},dataRange:t,replace:e._getPaths(t)})}));this.setState({paths:i,pathsDiff:o})}else n&&this.setState({paths:this._getPaths(),pathsDiff:null})}},{key:"_getPaths",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=this.props,n=r.data,i=r.getPolygon,o=r.positionFormat,a=r._normalize,s=[],u="XY"===o?2:3,c=e.startRow,l=e.endRow,h=Object(d.a)(n,c,l),f=h.iterable,p=h.objectInfo,A=_(f);try{for(A.s();!(t=A.n()).done;){var g=t.value;p.index++;var m=i(g,p);a&&(m=y.b(m,u));var v=m,b=v.holeIndices,x=m.positions||m;if(b)for(var w=0;w<=b.length;w++){var E=x.slice(b[w-1]||0,b[w]||x.length);s.push(this.getSubLayerRow({path:E},g,p.index))}else s.push(this.getSubLayerRow({path:x},g,p.index))}}catch(t){A.e(t)}finally{A.f()}return s}},{key:"renderLayers",value:function(){var t=this.props,e=t.data,r=t._dataDiff,n=t.stroked,i=t.filled,o=t.extruded,a=t.wireframe,s=t._normalize,u=t._windingOrder,c=t.elevationScale,l=t.transitions,h=t.positionFormat,f=this.props,p=f.lineWidthUnits,d=f.lineWidthScale,A=f.lineWidthMinPixels,y=f.lineWidthMaxPixels,v=f.lineJointRounded,_=f.lineMiterLimit,b=f.lineDashJustified,x=this.props,E=x.getFillColor,S=x.getLineColor,O=x.getLineWidth,T=x.getLineDashArray,P=x.getElevation,M=x.getPolygon,C=x.updateTriggers,I=x.material,k=this.state,R=k.paths,L=k.pathsDiff,j=this.getSubLayerClass("fill",g.a),D=this.getSubLayerClass("stroke",m.a),B=this.shouldRenderSubLayer("fill",R)&&new j({_dataDiff:r,extruded:o,elevationScale:c,filled:i,wireframe:a,_normalize:s,_windingOrder:u,getElevation:P,getFillColor:E,getLineColor:o&&a?S:w,material:I,transitions:l},this.getSubLayerProps({id:"fill",updateTriggers:{getPolygon:C.getPolygon,getElevation:C.getElevation,getFillColor:C.getFillColor,lineColors:o&&a,getLineColor:C.getLineColor}}),{data:e,positionFormat:h,getPolygon:M});return[!o&&B,!o&&n&&this.shouldRenderSubLayer("stroke",R)&&new D({_dataDiff:L&&function(){return L},widthUnits:p,widthScale:d,widthMinPixels:A,widthMaxPixels:y,jointRounded:v,miterLimit:_,dashJustified:b,_pathType:"loop",transitions:l&&{getWidth:l.getLineWidth,getColor:l.getLineColor,getPath:l.getPolygon},getColor:this.getSubLayerAccessor(S),getWidth:this.getSubLayerAccessor(O),getDashArray:this.getSubLayerAccessor(T)},this.getSubLayerProps({id:"stroke",updateTriggers:{getWidth:C.getLineWidth,getColor:C.getLineColor,getDashArray:C.getLineDashArray}}),{data:R,positionFormat:h,getPath:function(t){return t.path}}),o&&B]}}]),r}(A.a);S.layerName="PolygonLayer",S.defaultProps=E},function(t,e,r){"use strict";r.d(e,"a",(function(){return p}));var n=r(169),i=r(23),o=r(74),a=r(56),s=r(27),u=r(21);const c=Object.freeze([1,0,0,0,1,0,0,0,1]),l=Object.freeze([0,0,0,0,0,0,0,0,0]),h=Object.freeze({COL0ROW0:0,COL0ROW1:1,COL0ROW2:2,COL1ROW0:3,COL1ROW1:4,COL1ROW2:5,COL2ROW0:6,COL2ROW1:7,COL2ROW2:8}),f={};class p extends n.a{static get IDENTITY(){return f.IDENTITY=f.IDENTITY||Object.freeze(new p(c)),f.IDENTITY}static get ZERO(){return f.ZERO=f.ZERO||Object.freeze(new p(l)),f.ZERO}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return h}constructor(t){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(t)?this.copy(t):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this.check()}set(t,e,r,n,i,o,a,s,u){return this[0]=t,this[1]=e,this[2]=r,this[3]=n,this[4]=i,this[5]=o,this[6]=a,this[7]=s,this[8]=u,this.check()}setRowMajor(t,e,r,n,i,o,a,s,u){return this[0]=t,this[1]=n,this[2]=a,this[3]=e,this[4]=i,this[5]=s,this[6]=r,this[7]=o,this[8]=u,this.check()}determinant(){return a.b(this)}identity(){return this.copy(c)}fromQuaternion(t){return a.c(this,t),this.check()}transpose(){return a.i(this,this),this.check()}invert(){return a.d(this,this),this.check()}multiplyLeft(t){return a.e(this,t,this),this.check()}multiplyRight(t){return a.e(this,this,t),this.check()}rotate(t){return a.f(this,this,t),this.check()}scale(t){return Array.isArray(t)?a.g(this,this,t):a.g(this,this,[t,t,t]),this.check()}translate(t){return a.h(this,this,t),this.check()}transform(t,e){switch(t.length){case 2:e=s.i(e||[-0,-0],t,this);break;case 3:e=u.r(e||[-0,-0,-0],t,this);break;case 4:e=Object(o.d)(e||[-0,-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Object(i.b)(e,t.length),e}transformVector(t,e){return Object(i.c)("Matrix3.transformVector"),this.transform(t,e)}transformVector2(t,e){return Object(i.c)("Matrix3.transformVector"),this.transform(t,e)}transformVector3(t,e){return Object(i.c)("Matrix3.transformVector"),this.transform(t,e)}}},function(t,e,r){"use strict";e.a={EPSILON1:.1,EPSILON2:.01,EPSILON3:.001,EPSILON4:1e-4,EPSILON5:1e-5,EPSILON6:1e-6,EPSILON7:1e-7,EPSILON8:1e-8,EPSILON9:1e-9,EPSILON10:1e-10,EPSILON11:1e-11,EPSILON12:1e-12,EPSILON13:1e-13,EPSILON14:1e-14,EPSILON15:1e-15,EPSILON16:1e-16,EPSILON17:1e-17,EPSILON18:1e-18,EPSILON19:1e-19,EPSILON20:1e-20,PI_OVER_TWO:Math.PI/2,PI_OVER_FOUR:Math.PI/4,PI_OVER_SIX:Math.PI/6,TWO_PI:2*Math.PI}},function(t,e,r){"use strict";r.d(e,"a",(function(){return i}));var n=r(125);function i(t){try{return JSON.parse(t)}catch(e){throw new Error(`Failed to parse JSON from data starting with "${Object(n.a)(t)}"`)}}},function(t,e,r){"use strict";r.d(e,"a",(function(){return u}));var n=r(168),i=r(13),o=r(23),a=r(27),s=r(74);class u extends n.a{constructor(t=0,e=0){super(2),Object(i.f)(t)&&1===arguments.length?this.copy(t):(i.b.debug&&(Object(o.a)(t),Object(o.a)(e)),this[0]=t,this[1]=e)}set(t,e){return this[0]=t,this[1]=e,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this.check()}fromObject(t){return i.b.debug&&(Object(o.a)(t.x),Object(o.a)(t.y)),this[0]=t.x,this[1]=t.y,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t}get ELEMENTS(){return 2}horizontalAngle(){return Math.atan2(this.y,this.x)}verticalAngle(){return Math.atan2(this.x,this.y)}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return a.j(this,this,t),this.check()}transformAsVector(t){return Object(s.a)(this,this,t),this.check()}transformByMatrix3(t){return a.i(this,this,t),this.check()}transformByMatrix2x3(t){return a.h(this,this,t),this.check()}transformByMatrix2(t){return a.g(this,this,t),this.check()}}},function(t,e,r){"use strict";var n=r(0),i=r.n(n),o=r(2),a=r.n(o),s=r(3),u=r.n(s),c=r(8),l=r.n(c),h=r(5),f=r.n(h),p=r(6),d=r.n(p),A=r(1),g=r.n(A),m=r(24),y=r.n(m),v=r(207),_=r(226),b=r(18),x=r(155),w=r(7),E=r(295),S=r(147),O=r(205),T=r(48),P=r(9);class M{constructor(t={}){const{id:e}=t;this.id=e||Object(T.c)(this.constructor.name),this.display=!0,this.position=new S.a,this.rotation=new S.a,this.scale=new S.a(1,1,1),this.matrix=new O.a,this.userData={},this.props={},this._setScenegraphNodeProps(t)}delete(){}setProps(t){return this._setScenegraphNodeProps(t),this}toString(){return`{type: ScenegraphNode, id: ${this.id})}`}setPosition(t){return Object(P.a)(3===t.length,"setPosition requires vector argument"),this.position=t,this}setRotation(t){return Object(P.a)(3===t.length,"setRotation requires vector argument"),this.rotation=t,this}setScale(t){return Object(P.a)(3===t.length,"setScale requires vector argument"),this.scale=t,this}setMatrix(t,e=!0){e?this.matrix.copy(t):this.matrix=t}setMatrixComponents({position:t,rotation:e,scale:r,update:n=!0}){return t&&this.setPosition(t),e&&this.setRotation(e),r&&this.setScale(r),n&&this.updateMatrix(),this}updateMatrix(){const t=this.position,e=this.rotation,r=this.scale;return this.matrix.identity(),this.matrix.translate(t),this.matrix.rotateXYZ(e),this.matrix.scale(r),this}update(t={}){const{position:e,rotation:r,scale:n}=t;return e&&this.setPosition(e),r&&this.setRotation(r),n&&this.setScale(n),this.updateMatrix(),this}getCoordinateUniforms(t,e){Object(P.a)(t),e=e||this.matrix;const r=new O.a(t).multiplyRight(e),n=r.invert(),i=n.transpose();return{viewMatrix:t,modelMatrix:e,objectMatrix:e,worldMatrix:r,worldInverseMatrix:n,worldInverseTransposeMatrix:i}}_setScenegraphNodeProps(t){"display"in t&&(this.display=t.display),"position"in t&&this.setPosition(t.position),"rotation"in t&&this.setRotation(t.rotation),"scale"in t&&this.setScale(t.scale),"matrix"in t&&this.setMatrix(t.matrix),Object.assign(this.props,t)}}var C=r(34),I=r(64);class k extends M{constructor(t={}){t=Array.isArray(t)?{children:t}:t;const{children:e=[]}=t;w.k.assert(e.every(t=>t instanceof M),"every child must an instance of ScenegraphNode"),super(t),this.children=e}add(...t){for(const e of t)Array.isArray(e)?this.add(...e):this.children.push(e);return this}remove(t){const e=this.children,r=e.indexOf(t);return r>-1&&e.splice(r,1),this}removeAll(){return this.children=[],this}delete(){this.children.forEach(t=>t.delete()),this.removeAll(),super.delete()}traverse(t,{worldMatrix:e=new O.a}={}){const r=new O.a(e).multiplyRight(this.matrix);for(const e of this.children)e instanceof k?e.traverse(t,{worldMatrix:r}):t(e,{worldMatrix:r})}}var R=r(228);const L={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},j={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function D(t){if(!t._animation){const e=j[t.componentType],r=L[t.type],n=r*t.count,{buffer:i,byteOffset:o}=t.bufferView.data,a=new e(i,o+(t.byteOffset||0),n);if(1===r)t._animation=Array.from(a);else{const e=[];for(let t=0;t<a.length;t+=r)e.push(Array.from(a.slice(t,t+r)));t._animation=e}}return t._animation}const B=new O.a;const F=new R.a;function z(t,{input:e,interpolation:r,output:n},i,o){const a=t%e[e.length-1],s=e.findIndex(t=>t>=a),u=Math.max(0,s-1);if(!Array.isArray(i[o]))switch(o){case"translation":i[o]=[0,0,0];break;case"rotation":i[o]=[0,0,0,1];break;case"scale":i[o]=[1,1,1];break;default:w.k.warn(`Bad animation path ${o}`)()}Object(P.a)(i[o].length===n[u].length);const c=e[u],l=e[s];switch(r){case"STEP":!function(t,e,r){for(let n=0;n<r.length;n++)t[e][n]=r[n]}(i,o,n[u]);break;case"LINEAR":if(l>c){const t=(a-c)/(l-c);!function(t,e,r,n,i){if("rotation"===e){F.slerp({start:r,target:n,ratio:i});for(let r=0;r<F.length;r++)t[e][r]=F[r]}else for(let o=0;o<r.length;o++)t[e][o]=i*n[o]+(1-i)*r[o]}(i,o,n[u],n[s],t)}break;case"CUBICSPLINE":if(l>c){const t=(a-c)/(l-c),e=l-c;!function(t,e,{p0:r,outTangent0:n,inTangent1:i,p1:o,tDiff:a,ratio:s}){for(let u=0;u<t[e].length;u++){const c=n[u]*a,l=i[u]*a;t[e][u]=(2*Math.pow(s,3)-3*Math.pow(s,2)+1)*r[u]+(Math.pow(s,3)-2*Math.pow(s,2)+s)*c+(-2*Math.pow(s,3)+3*Math.pow(s,2))*o[u]+(Math.pow(s,3)-Math.pow(s,2))*l}}(i,o,{p0:n[3*u+1],outTangent0:n[3*u+2],inTangent1:n[3*s+0],p1:n[3*s+1],tDiff:e,ratio:t})}break;default:w.k.warn(`Interpolation ${r} not supported`)()}}class N{constructor(t){this.startTime=0,this.playing=!0,this.speed=1,this.channels=[],Object.assign(this,t)}animate(t){if(!this.playing)return;const e=(t/1e3-this.startTime)*this.speed;this.channels.forEach(({sampler:t,target:r,path:n})=>{z(e,t,r,n),function(t,e){if(e.matrix.identity(),t.translation&&e.matrix.translate(t.translation),t.rotation){const r=B.fromQuaternion(t.rotation);e.matrix.multiplyRight(r)}t.scale&&e.matrix.scale(t.scale)}(r,r._node)})}}class U{constructor(t){this.animations=t.animations.map((e,r)=>{const n=e.name||`Animation-${r}`,i=e.samplers.map(({input:e,interpolation:r="LINEAR",output:n})=>({input:D(t.accessors[e]),interpolation:r,output:D(t.accessors[n])})),o=e.channels.map(({sampler:e,target:r})=>({sampler:i[e],target:t.nodes[r.node],path:r.path}));return new N({name:n,channels:o})})}animate(t){this.setTime(t)}setTime(t){this.animations.forEach(e=>e.animate(t))}getAnimations(){return this.animations}}var V=r(176);class G extends M{constructor(t,e={}){super(e),this.onBeforeRender=null,this.AfterRender=null,t instanceof V.a?(this.model=t,this._setModelNodeProps(e)):this.model=new V.a(t,e),this.managedResources=e.managedResources||[]}setProps(t){return super.setProps(t),this._setModelNodeProps(t),this}delete(){this.model&&(this.model.delete(),this.model=null),this.managedResources.forEach(t=>t.delete()),this.managedResources=[]}draw(...t){return this.model.draw(...t)}setUniforms(...t){return this.model.setUniforms(...t),this}setAttributes(...t){return this.model.setAttributes(...t),this}updateModuleSettings(...t){return this.model.updateModuleSettings(...t),this}_setModelNodeProps(t){this.model.setProps(t)}}var W=r(239);function H(t,e){return Object(w.j)(t)?`#version 300 es\n${e}`:e}const q={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Z={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1};class X{constructor(t,e={}){this.gl=t,this.options=Object.assign({},Z,e)}instantiate(t){return this.gltf=t,(t.scenes||[]).map(t=>this.createScene(t))}createAnimator(){return Array.isArray(this.gltf.animations)?new U(this.gltf):null}createScene(t){const e=(t.nodes||[]).map(t=>this.createNode(t));return new k({id:t.name||t.id,children:e})}createNode(t){if(!t._node){const e=(t.children||[]).map(t=>this.createNode(t));t.mesh&&e.push(this.createMesh(t.mesh));const r=new k({id:t.name||t.id,children:e});if(t.matrix)r.setMatrix(t.matrix);else{if(r.matrix.identity(),t.translation&&r.matrix.translate(t.translation),t.rotation){const e=(new O.a).fromQuaternion(t.rotation);r.matrix.multiplyRight(e)}t.scale&&r.matrix.scale(t.scale)}t._node=r}return t._node}createMesh(t){if(!t._mesh){const e=(t.primitives||[]).map((e,r)=>this.createPrimitive(e,r,t)),r=new k({id:t.name||t.id,children:e});t._mesh=r}return t._mesh}getVertexCount(t){w.k.warn("getVertexCount() not found")()}createPrimitive(t,e,r){return function(t,e){const{id:r,drawMode:n,vertexCount:i,attributes:o,modelOptions:a}=e,s=new W.a(t,e);w.k.info(4,"createGLTFModel defines: ",s.defines)();const u=[];u.push(...s.generatedTextures),u.push(...Object.values(o).map(t=>t.buffer));const c=new G(t,Object.assign({id:r,drawMode:n,vertexCount:i,modules:[E.a],defines:s.defines,parameters:s.parameters,vs:H(t,"\n#if (__VERSION__ < 300)\n #define _attr attribute\n#else\n #define _attr in\n#endif\n\n _attr vec4 POSITION;\n\n #ifdef HAS_NORMALS\n _attr vec4 NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _attr vec4 TANGENT;\n #endif\n\n #ifdef HAS_UV\n _attr vec2 TEXCOORD_0;\n #endif\n\n void main(void) {\n vec4 _NORMAL = vec4(0.);\n vec4 _TANGENT = vec4(0.);\n vec2 _TEXCOORD_0 = vec2(0.);\n\n #ifdef HAS_NORMALS\n _NORMAL = NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _TANGENT = TANGENT;\n #endif\n\n #ifdef HAS_UV\n _TEXCOORD_0 = TEXCOORD_0;\n #endif\n\n pbr_setPositionNormalTangentUV(POSITION, _NORMAL, _TANGENT, _TEXCOORD_0);\n gl_Position = u_MVPMatrix * POSITION;\n }\n"),fs:H(t,"\n#if (__VERSION__ < 300)\n #define fragmentColor gl_FragColor\n#else\n out vec4 fragmentColor;\n#endif\n\n void main(void) {\n fragmentColor = pbr_filterColor(vec4(0));\n }\n"),managedResources:u},a));return c.setProps({attributes:o}),c.setUniforms(s.uniforms),c}(this.gl,Object.assign({id:t.name||`${r.name||r.id}-primitive-${e}`,drawMode:t.mode||4,vertexCount:t.indices?t.indices.count:this.getVertexCount(t.attributes),attributes:this.createAttributes(t.attributes,t.indices),material:t.material},this.options))}createAttributes(t,e){const r={};return Object.keys(t).forEach(e=>{r[e]=this.createAccessor(t[e],this.createBuffer(t[e],this.gl.ARRAY_BUFFER))}),e&&(r.indices=this.createAccessor(e,this.createBuffer(e,this.gl.ELEMENT_ARRAY_BUFFER))),w.k.info(4,"glTF Attributes",{attributes:t,indices:e,generated:r})(),r}createBuffer(t,e){t.bufferView||(t.bufferView={});const{bufferView:r}=t;return r.lumaBuffers||(r.lumaBuffers={}),r.lumaBuffers[e]||(r.lumaBuffers[e]=new C.a(this.gl,{id:`from-${r.id}`,data:r.data||t.value,target:e})),r.lumaBuffers[e]}createAccessor(t,e){return new I.a({buffer:e,offset:t.byteOffset||0,stride:t.bufferView.byteStride||0,type:t.componentType,size:q[t.type]})}createSampler(t){return t}needsPOT(){return!1}}var Q=r(291),Y=r(43),K=r.n(Y),$=r(68),J=r.n($);function tt(){return(tt=J()(K.a.mark((function t(e){var r;return K.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=[],e.scenes.forEach((function(t){t.traverse((function(t){Object.values(t.model.getUniforms()).forEach((function(t){!1===t.loaded&&r.push(t)}))}))})),t.next=4,et((function(){return r.some((function(t){return!t.loaded}))}));case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function et(t){return rt.apply(this,arguments)}function rt(){return(rt=J()(K.a.mark((function t(e){return K.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e()){t.next=5;break}return t.next=3,new Promise((function(t){return requestAnimationFrame(t)}));case 3:t.next=0;break;case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var nt=r(119);function it(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ot(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?it(Object(r),!0).forEach((function(e){i()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):it(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function at(t){var e=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(t){return!1}}();return function(){var r,n=g()(t);if(e){var i=g()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d()(this,r)}}r.d(e,"a",(function(){return ct}));var st=[255,255,255,255],ut={scenegraph:{type:"object",value:null,async:!0},getScene:function(t){return t&&t.scenes?"object"===y()(t.scene)?t.scene:t.scenes[t.scene||0]:t},getAnimator:function(t){return t&&t.animator},_animations:null,sizeScale:{type:"number",value:1,min:0},sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},getPosition:{type:"accessor",value:function(t){return t.position}},getColor:{type:"accessor",value:st},_lighting:"flat",_imageBasedLightingEnvironment:null,getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]},loaders:[Q.a]},ct=function(t){f()(r,t);var e=at(r);function r(){return a()(this,r),e.apply(this,arguments)}return u()(r,[{key:"getShaders",value:function(){var t=[v.a,_.a];return"pbr"===this.props._lighting&&t.push(E.a),{vs:"#version 300 es\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform mat4 sceneModelMatrix;\nuniform bool composeModelMatrix;\nin vec4 POSITION;\n\n#ifdef HAS_UV\n in vec2 TEXCOORD_0;\n#endif\n\n#ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n in vec4 NORMAL;\n #endif\n#endif\nout vec4 vColor;\n#ifndef MODULE_PBR\n #ifdef HAS_UV\n out vec2 vTEXCOORD_0;\n #endif\n#endif\nvoid main(void) {\n #if defined(HAS_UV) && !defined(MODULE_PBR)\n vTEXCOORD_0 = TEXCOORD_0;\n geometry.uv = vTEXCOORD_0;\n #endif\n\n geometry.worldPosition = instancePositions;\n geometry.pickingColor = instancePickingColors;\n\n #ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n pbr_vNormal = project_normal(instanceModelMatrix * (sceneModelMatrix * vec4(NORMAL.xyz, 0.0)).xyz);\n geometry.normal = pbr_vNormal;\n #endif\n\n #ifdef HAS_UV\n pbr_vUV = TEXCOORD_0;\n #else\n pbr_vUV = vec2(0., 0.);\n #endif\n geometry.uv = pbr_vUV;\n #endif\n\n float originalSize = project_size_to_pixel(sizeScale);\n float clampedSize = clamp(originalSize, sizeMinPixels, sizeMaxPixels);\n\n vec3 pos = (instanceModelMatrix * (sceneModelMatrix * POSITION).xyz) * sizeScale * (clampedSize / originalSize) + instanceTranslation;\n if(composeModelMatrix) {\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n }\n else {\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, geometry.position);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n #ifdef MODULE_PBR\n pbr_vPosition = geometry.position.xyz;\n #endif\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\nuniform float opacity;\nin vec4 vColor;\n\nout vec4 fragmentColor;\n#ifndef MODULE_PBR\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n in vec2 vTEXCOORD_0;\n uniform sampler2D u_BaseColorSampler;\n #endif\n#endif\n\nvoid main(void) {\n #ifdef MODULE_PBR\n fragmentColor = vColor * pbr_filterColor(vec4(0));\n geometry.uv = pbr_vUV;\n #else\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n fragmentColor = vColor * texture2D(u_BaseColorSampler, vTEXCOORD_0);\n geometry.uv = vTEXCOORD_0;\n #else\n fragmentColor = vColor;\n #endif\n #endif\n\n fragmentColor.a *= opacity;\n DECKGL_FILTER_COLOR(fragmentColor, geometry);\n}\n",modules:t}}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),accessor:"getPosition",transition:!0},instanceColors:{type:5121,size:this.props.colorFormat.length,accessor:"getColor",normalized:!0,defaultValue:st,transition:!0},instanceModelMatrix:nt.a})}},{key:"updateState",value:function(t){l()(g()(r.prototype),"updateState",this).call(this,t);var e=t.props,n=t.oldProps;e.scenegraph!==n.scenegraph?this._updateScenegraph(e):e._animations!==n._animations&&this._applyAnimationsProp(this.state.scenegraph,this.state.animator,e._animations)}},{key:"finalizeState",value:function(){l()(g()(r.prototype),"finalizeState",this).call(this),this._deleteScenegraph()}},{key:"_updateScenegraph",value:function(t){var e=this,r=this.context.gl,n=null;if(t.scenegraph instanceof M)n={scenes:[t.scenegraph]};else if(t.scenegraph&&!t.scenegraph.gltf){var i=t.scenegraph,o=function(t,e,r){const n=new X(t,r);return{scenes:n.instantiate(e),animator:n.createAnimator()}}(r,i,this._getModelOptions());n=ot({gltf:i},o),function(t){return tt.apply(this,arguments)}(o).then((function(){return e.setNeedsRedraw()}))}else t.scenegraph&&(b.a.deprecated("ScenegraphLayer.props.scenegraph","Use GLTFLoader instead of GLTFScenegraphLoader")(),n=t.scenegraph);var a={layer:this,gl:r},s=t.getScene(n,a),u=t.getAnimator(n,a);s instanceof M?(this._deleteScenegraph(),this._applyAllAttributes(s),this._applyAnimationsProp(s,u,t._animations),this.setState({scenegraph:s,animator:u})):null!==s&&b.a.warn("invalid scenegraph:",s)()}},{key:"_applyAllAttributes",value:function(t){var e=this;if(this.state.attributesAvailable){var r=this.getAttributeManager().getAttributes();t.traverse((function(t){e._setModelAttributes(t.model,r)}))}}},{key:"_applyAnimationsProp",value:function(t,e,r){if(t&&e&&r){var n=e.getAnimations();Object.keys(r).sort().forEach((function(t){var e=r[t];if("*"===t)n.forEach((function(t){Object.assign(t,e)}));else if(Number.isFinite(Number(t))){var i=Number(t);i>=0&&i<n.length?Object.assign(n[i],e):b.a.warn("animation ".concat(t," not found"))()}else{var o=n.find((function(e){return e.name===t}));o?Object.assign(o,e):b.a.warn("animation ".concat(t," not found"))()}}))}}},{key:"_deleteScenegraph",value:function(){var t=this.state.scenegraph;t instanceof M&&t.delete()}},{key:"_getModelOptions",value:function(){var t=this.props._imageBasedLightingEnvironment,e=null;return t&&(e="function"==typeof t?t({gl:this.context.gl,layer:this}):t),{gl:this.context.gl,waitForFullLoad:!0,imageBasedLightingEnvironment:e,modelOptions:ot({isInstanced:!0,transpileToGLSL100:!Object(w.j)(this.context.gl)},this.getShaders()),useTangents:!1}}},{key:"updateAttributes",value:function(t){var e=this;this.setState({attributesAvailable:!0}),this.state.scenegraph&&this.state.scenegraph.traverse((function(r){e._setModelAttributes(r.model,t)}))}},{key:"draw",value:function(t){var e=t.moduleParameters,r=void 0===e?null:e,n=t.parameters,i=void 0===n?{}:n,o=t.context;if(this.state.scenegraph){this.props._animations&&this.state.animator&&(this.state.animator.animate(o.timeline.getTime()),this.setNeedsRedraw());var a=this.context.viewport,s=this.props,u=s.sizeScale,c=s.sizeMinPixels,l=s.sizeMaxPixels,h=s.opacity,f=s.coordinateSystem,p=this.getNumInstances();this.state.scenegraph.traverse((function(t,e){var n=e.worldMatrix;t.model.setInstanceCount(p),t.updateModuleSettings(r),t.draw({parameters:i,uniforms:{sizeScale:u,opacity:h,sizeMinPixels:c,sizeMaxPixels:l,composeModelMatrix:Object(nt.b)(a,f),sceneModelMatrix:n,u_Camera:t.model.getUniforms().project_uCameraPosition}})}))}}}]),r}(x.a);ct.layerName="ScenegraphLayer",ct.defaultProps=ut},function(t,e,r){"use strict";var n=r(2),i=r.n(n),o=r(3),a=r.n(o),s=r(8),u=r.n(s),c=r(5),l=r.n(c),h=r(6),f=r.n(h),p=r(1),d=r.n(p),A=r(0),g=r.n(A),m=r(18),y=r(190),v=r(173);function _(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function b(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?_(Object(r),!0).forEach((function(e){g()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function x(t,e){if(!t)return null;var r="startIndices"in t?t.startIndices[e]:e,n=t.featureIds.value[r];return-1!==r?function(t,e,r){var n={properties:b({},t.properties[e])};for(var i in t.numericProps)n.properties[i]=t.numericProps[i].value[r];return n}(t,n,r):null}var w=r(110),E=r(159),S=r(158),O=r(109),T=r(108),P={circle:{type:E.a,props:{filled:"filled",stroked:"stroked",lineWidthMaxPixels:"lineWidthMaxPixels",lineWidthMinPixels:"lineWidthMinPixels",lineWidthScale:"lineWidthScale",lineWidthUnits:"lineWidthUnits",pointRadiusMaxPixels:"radiusMaxPixels",pointRadiusMinPixels:"radiusMinPixels",pointRadiusScale:"radiusScale",pointRadiusUnits:"radiusUnits",pointAntialiasing:"antialiasing",getFillColor:"getFillColor",getLineColor:"getLineColor",getLineWidth:"getLineWidth",getPointRadius:"getRadius"}},icon:{type:w.a,props:{iconAtlas:"iconAtlas",iconMapping:"iconMapping",iconSizeMaxPixels:"sizeMaxPixels",iconSizeMinPixels:"sizeMinPixels",iconSizeScale:"sizeScale",iconSizeUnits:"sizeUnits",getIcon:"getIcon",getIconAngle:"getAngle",getIconColor:"getColor",getIconPixelOffset:"getPixelOffset",getIconSize:"getSize"}},text:{type:S.a,props:{textSizeMaxPixels:"sizeMaxPixels",textSizeMinPixels:"sizeMinPixels",textSizeScale:"sizeScale",textSizeUnits:"sizeUnits",textBackground:"background",textBackgroundPadding:"backgroundPadding",textFontFamily:"fontFamily",textFontWeight:"fontWeight",textLineHeight:"lineHeight",textMaxWidth:"maxWidth",textOutlineColor:"outlineColor",textOutlineWidth:"outlineWidth",textWordBreak:"wordBreak",textCharacterSet:"characterSet",getText:"getText",getTextAngle:"getAngle",getTextColor:"getColor",getTextPixelOffset:"getPixelOffset",getTextSize:"getSize",getTextAnchor:"getTextAnchor",getTextAlignmentBaseline:"getAlignmentBaseline",getTextBackgroundColor:"getBackgroundColor",getTextBorderColor:"getBorderColor",getTextBorderWidth:"getBorderWidth"}}},M={type:O.a,props:{lineWidthUnits:"widthUnits",lineWidthScale:"widthScale",lineWidthMinPixels:"widthMinPixels",lineWidthMaxPixels:"widthMaxPixels",lineJointRounded:"jointRounded",lineCapRounded:"capRounded",lineMiterLimit:"miterLimit",getLineColor:"getColor",getLineWidth:"getWidth"}},C={type:T.a,props:{extruded:"extruded",filled:"filled",wireframe:"wireframe",elevationScale:"elevationScale",material:"material",getElevation:"getElevation",getFillColor:"getFillColor",getLineColor:"getLineColor"}};function I(t){var e=t.type,r=t.props,n={};for(var i in r)n[i]=e.defaultProps[r[i]];return n}function k(t,e){var r=t.props,n=r.transitions,i=r.updateTriggers,o={updateTriggers:{},transitions:n&&{getPosition:n.geometry}};for(var a in e){var s=e[a],u=t.props[a];a.startsWith("get")&&(u=t.getSubLayerAccessor(u),o.updateTriggers[s]=i[a],n&&(o.transitions[s]=n[a])),o[s]=u}return o}function R(t,e){for(var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={pointFeatures:[],lineFeatures:[],polygonFeatures:[],polygonOutlineFeatures:[]},i=r.startRow,o=void 0===i?0:i,a=r.endRow,s=void 0===a?t.length:a,u=o;u<s;u++){var c=t[u];m.a.assert(c&&c.geometry,"GeoJSON does not have geometry");var l=c.geometry;if("GeometryCollection"===l.type){m.a.assert(Array.isArray(l.geometries),"GeoJSON does not have geometries array");for(var h=l.geometries,f=0;f<h.length;f++){var p=h[f];L(p,n,e,c,u)}}else L(l,n,e,c,u)}return n}function L(t,e,r,n,i){var o=t.type,a=t.coordinates,s=e.pointFeatures,u=e.lineFeatures,c=e.polygonFeatures,l=e.polygonOutlineFeatures;if(function(t,e){var r=j[t];m.a.assert(r,"Unknown GeoJSON type ".concat(t));for(;e&&--r>0;)e=e[0];return e&&Number.isFinite(e[0])}(o,a))switch(o){case"Point":s.push(r({geometry:t},n,i));break;case"MultiPoint":a.forEach((function(t){s.push(r({geometry:{type:"Point",coordinates:t}},n,i))}));break;case"LineString":u.push(r({geometry:t},n,i));break;case"MultiLineString":a.forEach((function(t){u.push(r({geometry:{type:"LineString",coordinates:t}},n,i))}));break;case"Polygon":c.push(r({geometry:t},n,i)),a.forEach((function(t){l.push(r({geometry:{type:"LineString",coordinates:t}},n,i))}));break;case"MultiPolygon":a.forEach((function(t){c.push(r({geometry:{type:"Polygon",coordinates:t}},n,i)),t.forEach((function(t){l.push(r({geometry:{type:"LineString",coordinates:t}},n,i))}))}))}else m.a.warn("".concat(o," coordinates are malformed"))()}var j={Point:1,MultiPoint:2,LineString:2,MultiLineString:3,Polygon:3,MultiPolygon:4};function D(t){return t.geometry.coordinates}function B(t,e){var r={points:{},lines:{},polygons:{},polygonsOutline:{}},n=t.points,i=t.lines,o=t.polygons,a=function(t,e){var r={points:null,lines:null,polygons:null};for(var n in r){var i=t[n].globalFeatureIds.value;r[n]=new Uint8ClampedArray(3*i.length);for(var o=[],a=0;a<i.length;a++)e(i[a],o),r[n][3*a+0]=o[0],r[n][3*a+1]=o[1],r[n][3*a+2]=o[2]}return r}(t,e);return r.points.data={length:n.positions.value.length/n.positions.size,attributes:{getPosition:n.positions,instancePickingColors:{size:3,value:a.points}},properties:n.properties,numericProps:n.numericProps,featureIds:n.featureIds},r.lines.data={length:i.pathIndices.value.length-1,startIndices:i.pathIndices.value,attributes:{getPath:i.positions,instancePickingColors:{size:3,value:a.lines}},properties:i.properties,numericProps:i.numericProps,featureIds:i.featureIds},r.lines._pathType="open",r.polygons.data={length:o.polygonIndices.value.length-1,startIndices:o.polygonIndices.value,attributes:{getPolygon:o.positions,pickingColors:{size:3,value:a.polygons}},properties:o.properties,numericProps:o.numericProps,featureIds:o.featureIds},r.polygons._normalize=!1,o.triangles&&(r.polygons.data.attributes.indices=o.triangles.value),r.polygonsOutline.data={length:o.primitivePolygonIndices.value.length-1,startIndices:o.primitivePolygonIndices.value,attributes:{getPath:o.positions,instancePickingColors:{size:3,value:a.polygons}},properties:o.properties,numericProps:o.numericProps,featureIds:o.featureIds},r.polygonsOutline._pathType="open",r}function F(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return z(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return z(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function z(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function N(t){var e=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(t){return!1}}();return function(){var r,n=d()(t);if(e){var i=d()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return f()(this,r)}}function U(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function V(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?U(Object(r),!0).forEach((function(e){g()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):U(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}r.d(e,"a",(function(){return W}));var G=V(V(V(V(V(V({},I(P.circle)),I(P.icon)),I(P.text)),I(M)),I(C)),{},{stroked:!0,filled:!0,extruded:!1,wireframe:!1,iconAtlas:{type:"object",value:null},iconMapping:{type:"object",value:{}},getIcon:{type:"accessor",value:function(t){return t.properties.icon}},getText:{type:"accessor",value:function(t){return t.properties.text}},pointType:"circle",getRadius:{deprecatedFor:"getPointRadius"}}),W=function(t){l()(r,t);var e=N(r);function r(){return i()(this,r),e.apply(this,arguments)}return a()(r,[{key:"initializeState",value:function(){this.state={layerProps:{},features:{}},this.props.getLineDashArray&&m.a.removed("getLineDashArray","PathStyleExtension")()}},{key:"updateState",value:function(t){var e=t.props,r=t.changeFlags;if(r.dataChanged){var n=this.props.data,i=n&&"points"in n&&"polygons"in n&&"lines"in n;this.setState({binary:i}),i?this._updateStateBinary({props:e,changeFlags:r}):this._updateStateJSON({props:e,changeFlags:r})}}},{key:"_updateStateBinary",value:function(t){var e=t.props,r=(t.changeFlags,B(e.data,this.encodePickingColor));this.setState({layerProps:r})}},{key:"_updateStateJSON",value:function(t){var e=t.props,r=t.changeFlags,n=function(t){if(Array.isArray(t))return t;switch(m.a.assert(t.type,"GeoJSON does not have type"),t.type){case"Feature":return[t];case"FeatureCollection":return m.a.assert(Array.isArray(t.features),"GeoJSON does not have features array"),t.features;default:return[{geometry:t}]}}(e.data),i=this.getSubLayerRow.bind(this),o={},a={};if(Array.isArray(r.dataChanged)){var s=this.state.features;for(var u in s)o[u]=s[u].slice(),a[u]=[];var c,l=F(r.dataChanged);try{for(l.s();!(c=l.n()).done;){var h=c.value,f=R(n,i,h);for(var p in s)a[p].push(Object(v.a)({data:o[p],getIndex:function(t){return t.__source.index},dataRange:h,replace:f[p]}))}}catch(t){l.e(t)}finally{l.f()}}else o=R(n,i);var d=function(t,e){var r={points:{},lines:{},polygons:{},polygonsOutline:{}},n=t.pointFeatures,i=t.lineFeatures,o=t.polygonFeatures,a=t.polygonOutlineFeatures;return r.points.data=n,r.points._dataDiff=e.pointFeatures&&function(){return e.pointFeatures},r.points.getPosition=D,r.lines.data=i,r.lines._dataDiff=e.lineFeatures&&function(){return e.lineFeatures},r.lines.getPath=D,r.polygons.data=o,r.polygons._dataDiff=e.polygonFeatures&&function(){return e.polygonFeatures},r.polygons.getPolygon=D,r.polygonsOutline.data=a,r.polygonsOutline._dataDiff=e.polygonOutlineFeatures&&function(){return e.polygonOutlineFeatures},r.polygonsOutline.getPath=D,r}(o,a);this.setState({features:o,featuresDiff:a,layerProps:d})}},{key:"_updateAutoHighlight",value:function(t){var e,r="".concat(this.id,"-points-"),n=t.sourceLayer.id.startsWith(r),i=F(this.getSubLayers());try{for(i.s();!(e=i.n()).done;){var o=e.value;o.id.startsWith(r)===n&&o.updateAutoHighlight(t)}}catch(t){i.e(t)}finally{i.f()}}},{key:"_renderPolygonLayer",value:function(){var t=this.props,e=t.extruded,r=t.wireframe,n=this.state.layerProps,i="polygons-fill",o=this.shouldRenderSubLayer(i,n.polygons.data)&&this.getSubLayerClass(i,C.type);if(o){var a=k(this,C.props),s=e&&r;return s||delete a.getLineColor,a.updateTriggers.lineColors=s,new o(a,this.getSubLayerProps({id:i,updateTriggers:a.updateTriggers}),n.polygons)}return null}},{key:"_renderLineLayers",value:function(){var t=this.props,e=t.extruded,r=t.stroked,n=this.state.layerProps,i=!e&&r&&this.shouldRenderSubLayer("polygons-stroke",n.polygonsOutline.data)&&this.getSubLayerClass("polygons-stroke",M.type),o=this.shouldRenderSubLayer("linestrings",n.lines.data)&&this.getSubLayerClass("linestrings",M.type);if(i||o){var a=k(this,M.props);return[i&&new i(a,this.getSubLayerProps({id:"polygons-stroke",updateTriggers:a.updateTriggers}),n.polygonsOutline),o&&new o(a,this.getSubLayerProps({id:"linestrings",updateTriggers:a.updateTriggers}),n.lines)]}return null}},{key:"_renderPointLayers",value:function(){var t=this.props.pointType,e=this.state,r=e.layerProps,n=e.binary,i=this.props.highlightedObjectIndex;!n&&Number.isFinite(i)&&(i=r.points.data.findIndex((function(t){return t.__source.index===i})));var o,a=[],s=F(new Set(t.split("+")));try{for(s.s();!(o=s.n()).done;){var u=o.value,c="points-".concat(u),l=P[u],h=l&&this.shouldRenderSubLayer(c,r.points.data)&&this.getSubLayerClass(c,l.type);if(h){var f=k(this,l.props);a.push(new h(f,this.getSubLayerProps({id:c,updateTriggers:f.updateTriggers,highlightedObjectIndex:i}),r.points))}}}catch(t){s.e(t)}finally{s.f()}return a}},{key:"renderLayers",value:function(){var t=this.props.extruded,e=this._renderPolygonLayer();return[!t&&e,this._renderLineLayers(),this._renderPointLayers(),t&&e]}},{key:"getSubLayerAccessor",value:function(t){return this.state.binary&&"function"==typeof t?function(e,r){var n=x(r.data,r.index);return t(n,r)}:u()(d()(r.prototype),"getSubLayerAccessor",this).call(this,t)}}]),r}(y.a);W.layerName="GeoJsonLayer",W.defaultProps=G},function(t,e,r){"use strict";var n=r(0),i=r.n(n),o=r(2),a=r.n(o),s=r(3),u=r.n(s),c=r(8),l=r.n(c),h=r(5),f=r.n(h),p=r(6),d=r.n(p),A=r(1),g=r.n(A),m=r(207),y=r(226),v=r(14),_=r(155),b=r(176),x=r(62);function w(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function E(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?w(Object(r),!0).forEach((function(e){i()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):w(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function S(t){var e=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(t){return!1}}();return function(){var r,n=g()(t);if(e){var i=g()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d()(this,r)}}r.d(e,"a",(function(){return P}));var O=[0,0,0,255],T={getSourcePosition:{type:"accessor",value:function(t){return t.sourcePosition}},getTargetPosition:{type:"accessor",value:function(t){return t.targetPosition}},getSourceColor:{type:"accessor",value:O},getTargetColor:{type:"accessor",value:O},getWidth:{type:"accessor",value:1},getHeight:{type:"accessor",value:1},getTilt:{type:"accessor",value:0},greatCircle:!1,widthUnits:"pixels",widthScale:{type:"number",value:1,min:0},widthMinPixels:{type:"number",value:0,min:0},widthMaxPixels:{type:"number",value:Number.MAX_SAFE_INTEGER,min:0}},P=function(t){f()(r,t);var e=S(r);function r(){return a()(this,r),e.apply(this,arguments)}return u()(r,[{key:"getShaders",value:function(){return l()(g()(r.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME arc-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec4 instanceSourceColors;\nattribute vec4 instanceTargetColors;\nattribute vec3 instanceSourcePositions;\nattribute vec3 instanceSourcePositions64Low;\nattribute vec3 instanceTargetPositions;\nattribute vec3 instanceTargetPositions64Low;\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\nattribute float instanceHeights;\nattribute float instanceTilts;\n\nuniform bool greatCircle;\nuniform bool useShortestPath;\nuniform float numSegments;\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\nuniform int widthUnits;\n\nvarying vec4 vColor;\nvarying vec2 uv;\nvarying float isValid;\n\nfloat paraboloid(float distance, float sourceZ, float targetZ, float ratio) {\n\n float deltaZ = targetZ - sourceZ;\n float dh = distance * instanceHeights;\n if (dh == 0.0) {\n return sourceZ + deltaZ * ratio;\n }\n float unitZ = deltaZ / dh;\n float p2 = unitZ * unitZ + 1.0;\n float dir = step(deltaZ, 0.0);\n float z0 = mix(sourceZ, targetZ, dir);\n float r = mix(ratio, 1.0 - ratio, dir);\n return sqrt(r * (p2 - r)) * dh + z0;\n}\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\n vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n return dir_screenspace * offset_direction * width / 2.0;\n}\n\nfloat getSegmentRatio(float index) {\n return smoothstep(0.0, 1.0, index / (numSegments - 1.0));\n}\n\nvec3 interpolateFlat(vec3 source, vec3 target, float segmentRatio) {\n float distance = length(source.xy - target.xy);\n float z = paraboloid(distance, source.z, target.z, segmentRatio);\n\n float tiltAngle = radians(instanceTilts);\n vec2 tiltDirection = normalize(target.xy - source.xy);\n vec2 tilt = vec2(-tiltDirection.y, tiltDirection.x) * z * sin(tiltAngle);\n\n return vec3(\n mix(source.xy, target.xy, segmentRatio) + tilt,\n z * cos(tiltAngle)\n );\n}\nfloat getAngularDist (vec2 source, vec2 target) {\n vec2 sourceRadians = radians(source);\n vec2 targetRadians = radians(target);\n vec2 sin_half_delta = sin((sourceRadians - targetRadians) / 2.0);\n vec2 shd_sq = sin_half_delta * sin_half_delta;\n\n float a = shd_sq.y + cos(sourceRadians.y) * cos(targetRadians.y) * shd_sq.x;\n return 2.0 * asin(sqrt(a));\n}\n\nvec3 interpolateGreatCircle(vec3 source, vec3 target, vec3 source3D, vec3 target3D, float angularDist, float t) {\n vec2 lngLat;\n if(abs(angularDist - PI) < 0.001) {\n lngLat = (1.0 - t) * source.xy + t * target.xy;\n } else {\n float a = sin((1.0 - t) * angularDist);\n float b = sin(t * angularDist);\n vec3 p = source3D.yxz * a + target3D.yxz * b;\n lngLat = degrees(vec2(atan(p.y, -p.x), atan(p.z, length(p.xy))));\n }\n\n float z = paraboloid(angularDist * EARTH_RADIUS, source.z, target.z, t);\n\n return vec3(lngLat, z);\n}\n\nvoid main(void) {\n geometry.worldPosition = instanceSourcePositions;\n geometry.worldPositionAlt = instanceTargetPositions;\n\n float segmentIndex = positions.x;\n float segmentRatio = getSegmentRatio(segmentIndex);\n float prevSegmentRatio = getSegmentRatio(max(0.0, segmentIndex - 1.0));\n float nextSegmentRatio = getSegmentRatio(min(numSegments - 1.0, segmentIndex + 1.0));\n float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\n isValid = 1.0;\n\n uv = vec2(segmentRatio, positions.y);\n geometry.uv = uv;\n geometry.pickingColor = instancePickingColors;\n\n vec4 curr;\n vec4 next;\n vec3 source;\n vec3 target;\n\n if ((greatCircle || project_uProjectionMode == PROJECTION_MODE_GLOBE) && project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n source = project_globe_(vec3(instanceSourcePositions.xy, 0.0));\n target = project_globe_(vec3(instanceTargetPositions.xy, 0.0));\n float angularDist = getAngularDist(instanceSourcePositions.xy, instanceTargetPositions.xy);\n\n vec3 prevPos = interpolateGreatCircle(instanceSourcePositions, instanceTargetPositions, source, target, angularDist, prevSegmentRatio);\n vec3 currPos = interpolateGreatCircle(instanceSourcePositions, instanceTargetPositions, source, target, angularDist, segmentRatio);\n vec3 nextPos = interpolateGreatCircle(instanceSourcePositions, instanceTargetPositions, source, target, angularDist, nextSegmentRatio);\n\n if (abs(currPos.x - prevPos.x) > 180.0) {\n indexDir = -1.0;\n isValid = 0.0;\n } else if (abs(currPos.x - nextPos.x) > 180.0) {\n indexDir = 1.0;\n isValid = 0.0;\n }\n nextPos = indexDir < 0.0 ? prevPos : nextPos;\n nextSegmentRatio = indexDir < 0.0 ? prevSegmentRatio : nextSegmentRatio;\n\n if (isValid == 0.0) {\n nextPos.x += nextPos.x > 0.0 ? -360.0 : 360.0;\n float t = ((currPos.x > 0.0 ? 180.0 : -180.0) - currPos.x) / (nextPos.x - currPos.x);\n currPos = mix(currPos, nextPos, t);\n segmentRatio = mix(segmentRatio, nextSegmentRatio, t);\n }\n\n vec3 currPos64Low = mix(instanceSourcePositions64Low, instanceTargetPositions64Low, segmentRatio);\n vec3 nextPos64Low = mix(instanceSourcePositions64Low, instanceTargetPositions64Low, nextSegmentRatio);\n \n curr = project_position_to_clipspace(currPos, currPos64Low, vec3(0.0), geometry.position);\n next = project_position_to_clipspace(nextPos, nextPos64Low, vec3(0.0));\n \n } else {\n vec3 source_world = instanceSourcePositions;\n vec3 target_world = instanceTargetPositions;\n if (useShortestPath) {\n source_world.x = mod(source_world.x + 180., 360.0) - 180.;\n target_world.x = mod(target_world.x + 180., 360.0) - 180.;\n\n float deltaLng = target_world.x - source_world.x;\n if (deltaLng > 180.) target_world.x -= 360.;\n if (deltaLng < -180.) source_world.x -= 360.;\n }\n source = project_position(source_world, instanceSourcePositions64Low);\n target = project_position(target_world, instanceTargetPositions64Low);\n float antiMeridianX = 0.0;\n\n if (useShortestPath) {\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {\n antiMeridianX = -(project_uCoordinateOrigin.x + 180.) / 360. * TILE_SIZE;\n }\n float thresholdRatio = (antiMeridianX - source.x) / (target.x - source.x);\n\n if (prevSegmentRatio <= thresholdRatio && nextSegmentRatio > thresholdRatio) {\n isValid = 0.0;\n indexDir = sign(segmentRatio - thresholdRatio);\n segmentRatio = thresholdRatio;\n }\n }\n\n nextSegmentRatio = indexDir < 0.0 ? prevSegmentRatio : nextSegmentRatio;\n vec3 currPos = interpolateFlat(source, target, segmentRatio);\n vec3 nextPos = interpolateFlat(source, target, nextSegmentRatio);\n\n if (useShortestPath) {\n if (nextPos.x < antiMeridianX) {\n currPos.x += TILE_SIZE;\n nextPos.x += TILE_SIZE;\n }\n }\n\n curr = project_common_position_to_clipspace(vec4(currPos, 1.0));\n next = project_common_position_to_clipspace(vec4(nextPos, 1.0));\n geometry.position = vec4(currPos, 1.0);\n }\n float widthPixels = clamp(\n project_size_to_pixel(instanceWidths * widthScale, widthUnits),\n widthMinPixels, widthMaxPixels\n );\n vec3 offset = vec3(\n getExtrusionOffset((next.xy - curr.xy) * indexDir, positions.y, widthPixels),\n 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position = curr + vec4(project_pixel_size_to_clipspace(offset.xy), 0.0, 0.0);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vec4 color = mix(instanceSourceColors, instanceTargetColors, segmentRatio);\n vColor = vec4(color.rgb, color.a * opacity);\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#define SHADER_NAME arc-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying vec2 uv;\nvarying float isValid;\n\nvoid main(void) {\n if (isValid == 0.0) {\n discard;\n }\n\n gl_FragColor = vColor;\n geometry.uv = uv;\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[m.a,y.a]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instanceSourcePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getSourcePosition"},instanceTargetPositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getTargetPosition"},instanceSourceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getSourceColor",defaultValue:O},instanceTargetColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getTargetColor",defaultValue:O},instanceWidths:{size:1,transition:!0,accessor:"getWidth",defaultValue:1},instanceHeights:{size:1,transition:!0,accessor:"getHeight",defaultValue:1},instanceTilts:{size:1,transition:!0,accessor:"getTilt",defaultValue:0}})}},{key:"updateState",value:function(t){var e=t.props,n=t.oldProps,i=t.changeFlags;if(l()(g()(r.prototype),"updateState",this).call(this,{props:e,oldProps:n,changeFlags:i}),i.extensionsChanged){var o,a=this.context.gl;null===(o=this.state.model)||void 0===o||o.delete(),this.state.model=this._getModel(a),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(t){var e=t.uniforms,r=this.props,n=r.widthUnits,i=r.widthScale,o=r.widthMinPixels,a=r.widthMaxPixels,s=r.greatCircle,u=r.wrapLongitude;this.state.model.setUniforms(e).setUniforms({greatCircle:s,widthUnits:v.d[n],widthScale:i,widthMinPixels:o,widthMaxPixels:a,useShortestPath:u}).draw()}},{key:"_getModel",value:function(t){for(var e=[],r=0;r<50;r++)e=e.concat([r,1,0,r,-1,0]);var n=new b.a(t,E(E({},this.getShaders()),{},{id:this.props.id,geometry:new x.a({drawMode:5,attributes:{positions:new Float32Array(e)}}),isInstanced:!0}));return n.setUniforms({numSegments:50}),n}},{key:"wrapLongitude",get:function(){return!1}}]),r}(_.a);P.layerName="ArcLayer",P.defaultProps=T},function(t,e,r){"use strict";var n=r(0),i=r.n(n),o=r(2),a=r.n(o),s=r(3),u=r.n(s),c=r(8),l=r.n(c),h=r(5),f=r.n(h),p=r(6),d=r.n(p),A=r(1),g=r.n(A),m=r(207),y=r(226),v=r(14),_=r(155),b=r(176),x=r(62);function w(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function E(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?w(Object(r),!0).forEach((function(e){i()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):w(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function S(t){var e=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(t){return!1}}();return function(){var r,n=g()(t);if(e){var i=g()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d()(this,r)}}r.d(e,"a",(function(){return T}));var O={getSourcePosition:{type:"accessor",value:function(t){return t.sourcePosition}},getTargetPosition:{type:"accessor",value:function(t){return t.targetPosition}},getColor:{type:"accessor",value:[0,0,0,255]},getWidth:{type:"accessor",value:1},widthUnits:"pixels",widthScale:{type:"number",value:1,min:0},widthMinPixels:{type:"number",value:0,min:0},widthMaxPixels:{type:"number",value:Number.MAX_SAFE_INTEGER,min:0}},T=function(t){f()(r,t);var e=S(r);function r(){return a()(this,r),e.apply(this,arguments)}return u()(r,[{key:"getShaders",value:function(){return l()(g()(r.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME line-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 instanceSourcePositions;\nattribute vec3 instanceTargetPositions;\nattribute vec3 instanceSourcePositions64Low;\nattribute vec3 instanceTargetPositions64Low;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\n\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\nuniform float useShortestPath;\nuniform int widthUnits;\n\nvarying vec4 vColor;\nvarying vec2 uv;\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\n vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n return dir_screenspace * offset_direction * width / 2.0;\n}\n\nvec3 splitLine(vec3 a, vec3 b, float x) {\n float t = (x - a.x) / (b.x - a.x);\n return vec3(x, mix(a.yz, b.yz, t));\n}\n\nvoid main(void) {\n geometry.worldPosition = instanceSourcePositions;\n geometry.worldPositionAlt = instanceTargetPositions;\n\n vec3 source_world = instanceSourcePositions;\n vec3 target_world = instanceTargetPositions;\n vec3 source_world_64low = instanceSourcePositions64Low;\n vec3 target_world_64low = instanceTargetPositions64Low;\n\n if (useShortestPath > 0.5 || useShortestPath < -0.5) {\n source_world.x = mod(source_world.x + 180., 360.0) - 180.;\n target_world.x = mod(target_world.x + 180., 360.0) - 180.;\n float deltaLng = target_world.x - source_world.x;\n\n if (deltaLng * useShortestPath > 180.) {\n source_world.x += 360. * useShortestPath;\n source_world = splitLine(source_world, target_world, 180. * useShortestPath);\n source_world_64low = vec3(0.0);\n } else if (deltaLng * useShortestPath < -180.) {\n target_world.x += 360. * useShortestPath;\n target_world = splitLine(source_world, target_world, 180. * useShortestPath);\n target_world_64low = vec3(0.0);\n } else if (useShortestPath < 0.) {\n gl_Position = vec4(0.);\n return;\n }\n }\n vec4 source_commonspace;\n vec4 target_commonspace;\n vec4 source = project_position_to_clipspace(source_world, source_world_64low, vec3(0.), source_commonspace);\n vec4 target = project_position_to_clipspace(target_world, target_world_64low, vec3(0.), target_commonspace);\n float segmentIndex = positions.x;\n vec4 p = mix(source, target, segmentIndex);\n geometry.position = mix(source_commonspace, target_commonspace, segmentIndex);\n uv = positions.xy;\n geometry.uv = uv;\n geometry.pickingColor = instancePickingColors;\n float widthPixels = clamp(\n project_size_to_pixel(instanceWidths * widthScale, widthUnits),\n widthMinPixels, widthMaxPixels\n );\n vec3 offset = vec3(\n getExtrusionOffset(target.xy - source.xy, positions.y, widthPixels),\n 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position = p + vec4(project_pixel_size_to_clipspace(offset.xy), 0.0, 0.0);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity);\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#define SHADER_NAME line-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n gl_FragColor = vColor;\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[m.a,y.a]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instanceSourcePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getSourcePosition"},instanceTargetPositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getTargetPosition"},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:[0,0,0,255]},instanceWidths:{size:1,transition:!0,accessor:"getWidth",defaultValue:1}})}},{key:"updateState",value:function(t){var e=t.props,n=t.oldProps,i=t.changeFlags;if(l()(g()(r.prototype),"updateState",this).call(this,{props:e,oldProps:n,changeFlags:i}),i.extensionsChanged){var o,a=this.context.gl;null===(o=this.state.model)||void 0===o||o.delete(),this.state.model=this._getModel(a),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(t){var e=t.uniforms,r=this.props,n=r.widthUnits,i=r.widthScale,o=r.widthMinPixels,a=r.widthMaxPixels,s=r.wrapLongitude;this.state.model.setUniforms(e).setUniforms({widthUnits:v.d[n],widthScale:i,widthMinPixels:o,widthMaxPixels:a,useShortestPath:s?1:0}).draw(),s&&this.state.model.setUniforms({useShortestPath:-1}).draw()}},{key:"_getModel",value:function(t){return new b.a(t,E(E({},this.getShaders()),{},{id:this.props.id,geometry:new x.a({drawMode:5,attributes:{positions:new Float32Array([0,-1,0,0,1,0,1,-1,0,1,1,0])}}),isInstanced:!0}))}},{key:"wrapLongitude",get:function(){return!1}}]),r}(_.a);T.layerName="LineLayer",T.defaultProps=O},function(t,e,r){"use strict";var n=r(0),i=r.n(n),o=r(2),a=r.n(o),s=r(3),u=r.n(s),c=r(8),l=r.n(c),h=r(5),f=r.n(h),p=r(6),d=r.n(p),A=r(1),g=r.n(A),m=r(207),y=r(227),v=r(226),_=r(14),b=r(155),x=r(176),w=r(62);function E(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function S(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?E(Object(r),!0).forEach((function(e){i()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function O(t){var e=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(t){return!1}}();return function(){var r,n=g()(t);if(e){var i=g()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d()(this,r)}}r.d(e,"a",(function(){return C}));var T=[0,0,0,255],P=[0,0,1],M={sizeUnits:"pixels",pointSize:{type:"number",min:0,value:10},getPosition:{type:"accessor",value:function(t){return t.position}},getNormal:{type:"accessor",value:P},getColor:{type:"accessor",value:T},material:!0,radiusPixels:{deprecatedFor:"pointSize"}};var C=function(t){f()(r,t);var e=O(r);function r(){return a()(this,r),e.apply(this,arguments)}return u()(r,[{key:"getShaders",value:function(){return l()(g()(r.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME point-cloud-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 instanceNormals;\nattribute vec4 instanceColors;\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute vec3 instancePickingColors;\n\nuniform float opacity;\nuniform float radiusPixels;\nuniform int sizeUnits;\n\nvarying vec4 vColor;\nvarying vec2 unitPosition;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.normal = project_normal(instanceNormals);\n unitPosition = positions.xy;\n geometry.uv = unitPosition;\n geometry.pickingColor = instancePickingColors;\n vec3 offset = vec3(positions.xy * project_size_to_pixel(radiusPixels, sizeUnits), 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.), geometry.position);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n vec3 lightColor = lighting_getLightColor(instanceColors.rgb, project_uCameraPosition, geometry.position.xyz, geometry.normal);\n vColor = vec4(lightColor, instanceColors.a * opacity);\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#define SHADER_NAME point-cloud-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying vec2 unitPosition;\n\nvoid main(void) {\n geometry.uv = unitPosition;\n\n float distToCenter = length(unitPosition);\n\n if (distToCenter > 1.0) {\n discard;\n }\n\n gl_FragColor = vColor;\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[m.a,y.a,v.a]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceNormals:{size:3,transition:!0,accessor:"getNormal",defaultValue:P},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:T}})}},{key:"updateState",value:function(t){var e,n,i,o=t.props,a=t.oldProps,s=t.changeFlags;if(l()(g()(r.prototype),"updateState",this).call(this,{props:o,oldProps:a,changeFlags:s}),s.extensionsChanged){var u,c=this.context.gl;null===(u=this.state.model)||void 0===u||u.delete(),this.state.model=this._getModel(c),this.getAttributeManager().invalidateAll()}s.dataChanged&&(e=o.data,n=e.header,i=e.attributes,n&&i&&(e.length=n.vertexCount,i.POSITION&&(i.instancePositions=i.POSITION),i.NORMAL&&(i.instanceNormals=i.NORMAL),i.COLOR_0&&(i.instanceColors=i.COLOR_0)))}},{key:"draw",value:function(t){var e=t.uniforms,r=this.props,n=r.pointSize,i=r.sizeUnits;this.state.model.setUniforms(e).setUniforms({sizeUnits:_.d[i],radiusPixels:n}).draw()}},{key:"_getModel",value:function(t){for(var e=[],r=0;r<3;r++){var n=r/3*Math.PI*2;e.push(2*Math.cos(n),2*Math.sin(n),0)}return new x.a(t,S(S({},this.getShaders()),{},{id:this.props.id,geometry:new w.a({drawMode:4,attributes:{positions:new Float32Array(e)}}),isInstanced:!0}))}}]),r}(b.a);C.layerName="PointCloudLayer",C.defaultProps=M},function(t,e,r){"use strict";var n=r(0),i=r.n(n),o=r(2),a=r.n(o),s=r(3),u=r.n(s),c=r(8),l=r.n(c),h=r(5),f=r.n(h),p=r(6),d=r.n(p),A=r(1),g=r.n(A),m=r(18),y=r(207),v=r(227),_=r(226),b=r(155),x=r(62),w=r(7),E=r(98),S=r(176),O=r(240),T=r(179),P=r(119);function M(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function C(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?M(Object(r),!0).forEach((function(e){i()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):M(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function I(t){var e=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(t){return!1}}();return function(){var r,n=g()(t);if(e){var i=g()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d()(this,r)}}function k(t,e){(t.COLOR_0||t.colors)&&e||(t.colors={constant:!0,value:new Float32Array([1,1,1])}),m.a.assert(t.positions||t.POSITION,'no "postions" or "POSITION" attribute in mesh')}function R(t,e){if(t.attributes)return k(t.attributes,e),t instanceof x.a?t:new x.a(t);if(t.positions||t.POSITION)return k(t,e),new x.a({attributes:t});throw Error("Invalid mesh")}r.d(e,"a",(function(){return j}));var L={mesh:{value:null,type:"object",async:!0},texture:{type:"image",value:null,async:!0},sizeScale:{type:"number",value:1,min:0},_useMeshColors:{type:"boolean",value:!1},_instanced:!0,wireframe:!1,material:!0,getPosition:{type:"accessor",value:function(t){return t.position}},getColor:{type:"accessor",value:[0,0,0,255]},getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]}},j=function(t){f()(r,t);var e=I(r);function r(){return a()(this,r),e.apply(this,arguments)}return u()(r,[{key:"getShaders",value:function(){var t=!Object(w.j)(this.context.gl),e={};return Object(O.b)(this.context.gl,T.a.GLSL_DERIVATIVES)&&(e.DERIVATIVES_AVAILABLE=1),l()(g()(r.prototype),"getShaders",this).call(this,{vs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\nuniform float sizeScale;\nuniform bool composeModelMatrix;\nin vec3 positions;\nin vec3 normals;\nin vec3 colors;\nin vec2 texCoords;\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = texCoords;\n geometry.pickingColor = instancePickingColors;\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = vec4(colors * instanceColors.rgb, instanceColors.a);\n geometry.normal = normals_commonspace;\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n\n if (composeModelMatrix) {\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), position_commonspace);\n }\n else {\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, position_commonspace);\n }\n\n geometry.position = position_commonspace;\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\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 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 DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n",modules:[y.a,v.b,_.a],transpileToGLSL100:t,defines:e})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{transition:!0,type:5130,fp64:this.use64bitPositions(),size:3,accessor:"getPosition"},instanceColors:{type:5121,transition:!0,size:this.props.colorFormat.length,normalized:!0,accessor:"getColor",defaultValue:[0,0,0,255]},instanceModelMatrix:P.a}),this.setState({emptyTexture:new E.a(this.context.gl,{data:new Uint8Array(4),width:1,height:1})})}},{key:"updateState",value:function(t){var e=t.props,n=t.oldProps,i=t.changeFlags;if(l()(g()(r.prototype),"updateState",this).call(this,{props:e,oldProps:n,changeFlags:i}),e.mesh!==n.mesh||i.extensionsChanged){var o;if(null===(o=this.state.model)||void 0===o||o.delete(),e.mesh){this.state.model=this.getModel(e.mesh);var a=e.mesh.attributes||e.mesh;this.setState({hasNormals:Boolean(a.NORMAL||a.normals)})}this.getAttributeManager().invalidateAll()}e.texture!==n.texture&&this.setTexture(e.texture),this.state.model&&this.state.model.setDrawMode(this.props.wireframe?3:4)}},{key:"finalizeState",value:function(){l()(g()(r.prototype),"finalizeState",this).call(this),this.state.emptyTexture.delete()}},{key:"draw",value:function(t){var e=t.uniforms;if(this.state.model){var r=this.context.viewport,n=this.props,i=n.sizeScale,o=n.coordinateSystem,a=n._instanced;this.state.model.setUniforms(e).setUniforms({sizeScale:i,composeModelMatrix:!a||Object(P.b)(r,o),flatShading:!this.state.hasNormals}).draw()}}},{key:"getModel",value:function(t){var e=new S.a(this.context.gl,C(C({},this.getShaders()),{},{id:this.props.id,geometry:R(t,this.props._useMeshColors),isInstanced:!0})),r=this.props.texture,n=this.state.emptyTexture;return e.setUniforms({sampler:r||n,hasTexture:Boolean(r)}),e}},{key:"setTexture",value:function(t){var e=this.state,r=e.emptyTexture,n=e.model;null==n||n.setUniforms({sampler:t||r,hasTexture:Boolean(t)})}}]),r}(b.a);j.layerName="SimpleMeshLayer",j.defaultProps=L},function(t,e,r){"use strict";var n=r(0),i=r.n(n);const o={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingActive:!1,pickingAttribute:!1};const a={name:"picking",vs:"uniform bool picking_uActive;\nuniform bool picking_uAttribute;\nuniform vec3 picking_uSelectedColor;\nuniform bool picking_uSelectedColorValid;\n\nout vec4 picking_vRGBcolor_Avalid;\n\nconst float COLOR_SCALE = 1. / 255.;\n\nbool picking_isColorValid(vec3 color) {\n return dot(color, vec3(1.0)) > 0.001;\n}\n\nbool isVertexPicked(vec3 vertexColor) {\n return\n picking_uSelectedColorValid &&\n !picking_isColorValid(abs(vertexColor - picking_uSelectedColor));\n}\n\nvoid picking_setPickingColor(vec3 pickingColor) {\n if (picking_uActive) {\n picking_vRGBcolor_Avalid.a = float(picking_isColorValid(pickingColor));\n\n if (!picking_uAttribute) {\n picking_vRGBcolor_Avalid.rgb = pickingColor * COLOR_SCALE;\n }\n } else {\n picking_vRGBcolor_Avalid.a = float(isVertexPicked(pickingColor));\n }\n}\n\nvoid picking_setPickingAttribute(float value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.r = value;\n }\n}\nvoid picking_setPickingAttribute(vec2 value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.rg = value;\n }\n}\nvoid picking_setPickingAttribute(vec3 value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.rgb = value;\n }\n}\n",fs:"uniform bool picking_uActive;\nuniform vec3 picking_uSelectedColor;\nuniform vec4 picking_uHighlightColor;\n\nin vec4 picking_vRGBcolor_Avalid;\nvec4 picking_filterHighlightColor(vec4 color) {\n if (picking_uActive) {\n return color;\n }\n bool selected = bool(picking_vRGBcolor_Avalid.a);\n\n if (selected) {\n float highLightAlpha = picking_uHighlightColor.a;\n float blendedAlpha = highLightAlpha + color.a * (1.0 - highLightAlpha);\n float highLightRatio = highLightAlpha / blendedAlpha;\n\n vec3 blendedRGB = mix(color.rgb, picking_uHighlightColor.rgb, highLightRatio);\n return vec4(blendedRGB, blendedAlpha);\n } else {\n return color;\n }\n}\nvec4 picking_filterPickingColor(vec4 color) {\n if (picking_uActive) {\n if (picking_vRGBcolor_Avalid.a == 0.0) {\n discard;\n }\n return picking_vRGBcolor_Avalid;\n }\n return color;\n}\nvec4 picking_filterColor(vec4 color) {\n vec4 highightColor = picking_filterHighlightColor(color);\n return picking_filterPickingColor(highightColor);\n}\n\n",getUniforms:function(t=o){const e={};if(void 0!==t.pickingSelectedColor)if(t.pickingSelectedColor){const r=t.pickingSelectedColor.slice(0,3);e.picking_uSelectedColorValid=1,e.picking_uSelectedColor=r}else e.picking_uSelectedColorValid=0;if(t.pickingHighlightColor){const r=Array.from(t.pickingHighlightColor,t=>t/255);Number.isFinite(r[3])||(r[3]=1),e.picking_uHighlightColor=r}return void 0!==t.pickingActive&&(e.picking_uActive=Boolean(t.pickingActive),e.picking_uAttribute=Boolean(t.pickingAttribute)),e}};function s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}e.a=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?s(Object(r),!0).forEach((function(e){i()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({inject:{"vs:DECKGL_FILTER_COLOR":"\n picking_setPickingColor(geometry.pickingColor);\n // for picking depth values\n picking_setPickingAttribute(geometry.position.z);\n ","fs:DECKGL_FILTER_COLOR":{order:99,injection:"\n // use highlight color if this fragment belongs to the selected object.\n color = picking_filterHighlightColor(color);\n\n // use picking color if rendering to picking FBO.\n color = picking_filterPickingColor(color);\n "}}},a)},function(t,e,r){"use strict";var n=r(138),i="\nuniform float lighting_uAmbient;\nuniform float lighting_uDiffuse;\nuniform float lighting_uShininess;\nuniform vec3 lighting_uSpecularColor;\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) {\n vec3 halfway_direction = normalize(light_direction + view_direction);\n float lambertian = dot(light_direction, normal_worldspace);\n float specular = 0.0;\n if (lambertian > 0.0) {\n float specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);\n specular = pow(specular_angle, lighting_uShininess);\n }\n lambertian = max(lambertian, 0.0);\n return (lambertian * lighting_uDiffuse * surfaceColor + specular * lighting_uSpecularColor) * color;\n}\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = surfaceColor;\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n lightColor = lighting_uAmbient * surfaceColor * lighting_uAmbientLight.color;\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n\nvec3 lighting_getSpecularLightColor(vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = vec3(0, 0, 0);\n vec3 surfaceColor = vec3(0, 0, 0);\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n";r.d(e,"a",(function(){return s})),r.d(e,"b",(function(){return u}));const o={};function a(t=o){if(!("material"in t))return{};const{material:e}=t;return e?function(t){const{ambient:e=.35,diffuse:r=.6,shininess:n=32,specularColor:i=[30,30,30]}=t;return{lighting_uAmbient:e,lighting_uDiffuse:r,lighting_uShininess:n,lighting_uSpecularColor:i.map(t=>t/255)}}(e):{lighting_uEnabled:!1}}const s={name:"gouraud-lighting",dependencies:[n.a],vs:i,defines:{LIGHTING_VERTEX:1},getUniforms:a},u={name:"phong-lighting",dependencies:[n.a],fs:i,defines:{LIGHTING_FRAGMENT:1},getUniforms:a}},function(t,e,r){"use strict";var n=r(111),i=r(23),o=r(42),a=r(12),s=r(56),u=r(21),c=r(28);function l(){var t=new a.a(4);return a.a!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function h(t,e,r){r*=.5;var n=Math.sin(r);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(r),t}function f(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=r[0],u=r[1],c=r[2],l=r[3];return t[0]=n*l+a*s+i*c-o*u,t[1]=i*l+a*u+o*s-n*c,t[2]=o*l+a*c+n*u-i*s,t[3]=a*l-n*s-i*u-o*c,t}function p(t,e,r,n){var i,o,s,u,c,l=e[0],h=e[1],f=e[2],p=e[3],d=r[0],A=r[1],g=r[2],m=r[3];return(o=l*d+h*A+f*g+p*m)<0&&(o=-o,d=-d,A=-A,g=-g,m=-m),1-o>a.b?(i=Math.acos(o),s=Math.sin(i),u=Math.sin((1-n)*i)/s,c=Math.sin(n*i)/s):(u=1-n,c=n),t[0]=u*l+c*d,t[1]=u*h+c*A,t[2]=u*f+c*g,t[3]=u*p+c*m,t}function d(t,e){var r,n=e[0]+e[4]+e[8];if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var o=(i+1)%3,a=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*o+o]-e[3*a+a]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*o+a]-e[3*a+o])*r,t[o]=(e[3*o+i]+e[3*i+o])*r,t[a]=(e[3*a+i]+e[3*i+a])*r}return t}c.b,c.g,c.c,c.l;var A,g,m,y,v,_,b=c.a,x=c.k,w=c.d,E=c.i,S=c.h,O=c.m,T=c.j,P=(c.f,c.e,A=u.c(),g=u.f(1,0,0),m=u.f(0,1,0),function(t,e,r){var n=u.e(e,r);return n<-.999999?(u.d(A,g,e),u.g(A)<1e-6&&u.d(A,m,e),u.l(A,A),h(t,A,Math.PI),t):n>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(u.d(A,e,r),t[0]=A[0],t[1]=A[1],t[2]=A[2],t[3]=1+n,T(t,t))});y=l(),v=l(),_=s.a();r.d(e,"a",(function(){return C}));const M=[0,0,0,1];class C extends n.a{constructor(t=0,e=0,r=0,n=1){super(-0,-0,-0,-0),Array.isArray(t)&&1===arguments.length?this.copy(t):this.set(t,e,r,n)}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}set(t,e,r,n){return this[0]=t,this[1]=e,this[2]=r,this[3]=n,this.check()}fromMatrix3(t){return d(this,t),this.check()}identity(){var t;return(t=this)[0]=0,t[1]=0,t[2]=0,t[3]=1,this.check()}fromAxisRotation(t,e){return h(this,t,e),this.check()}setAxisAngle(t,e){return this.fromAxisRotation(t,e)}get ELEMENTS(){return 4}get x(){return this[0]}set x(t){this[0]=Object(i.a)(t)}get y(){return this[1]}set y(t){this[1]=Object(i.a)(t)}get z(){return this[2]}set z(t){this[2]=Object(i.a)(t)}get w(){return this[3]}set w(t){this[3]=Object(i.a)(t)}len(){return S(this)}lengthSquared(){return O(this)}dot(t,e){if(void 0!==e)throw new Error("Quaternion.dot only takes one argument");return w(this,t)}rotationTo(t,e){return P(this,t,e),this.check()}add(t,e){if(void 0!==e)throw new Error("Quaternion.add only takes one argument");return b(this,this,t),this.check()}calculateW(){var t,e,r,n,i;return t=this,r=(e=this)[0],n=e[1],i=e[2],t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),this.check()}conjugate(){var t,e;return e=this,(t=this)[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],this.check()}invert(){var t,e,r,n,i,o,a,s;return t=this,r=(e=this)[0],n=e[1],i=e[2],o=e[3],s=(a=r*r+n*n+i*i+o*o)?1/a:0,t[0]=-r*s,t[1]=-n*s,t[2]=-i*s,t[3]=o*s,this.check()}lerp(t,e,r){return E(this,t,e,r),this.check()}multiplyRight(t,e){return Object(o.a)(!e),f(this,this,t),this.check()}multiplyLeft(t,e){return Object(o.a)(!e),f(this,t,this),this.check()}normalize(){const t=this.len(),e=t>0?1/t:0;return this[0]=this[0]*e,this[1]=this[1]*e,this[2]=this[2]*e,this[3]=this[3]*e,0===t&&(this[3]=1),this.check()}rotateX(t){return function(t,e,r){r*=.5;var n=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(r),u=Math.cos(r);t[0]=n*u+a*s,t[1]=i*u+o*s,t[2]=o*u-i*s,t[3]=a*u-n*s}(this,this,t),this.check()}rotateY(t){return function(t,e,r){r*=.5;var n=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(r),u=Math.cos(r);t[0]=n*u-o*s,t[1]=i*u+a*s,t[2]=o*u+n*s,t[3]=a*u-i*s}(this,this,t),this.check()}rotateZ(t){return function(t,e,r){r*=.5;var n=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(r),u=Math.cos(r);t[0]=n*u+i*s,t[1]=i*u-n*s,t[2]=o*u+a*s,t[3]=a*u-o*s}(this,this,t),this.check()}scale(t){return x(this,this,t),this.check()}slerp(t,e,r){switch(arguments.length){case 1:({start:t=M,target:e,ratio:r}=arguments[0]);break;case 2:[e,r]=arguments,t=this}return p(this,t,e,r),this.check()}transformVector4(t,e=t){return c.o(e,t,this),Object(i.b)(e,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(t,e){return this.setAxisAngle(t,e)}premultiply(t,e){return this.multiplyLeft(t,e)}multiply(t,e){return this.multiplyRight(t,e)}}},function(t,e,r){"use strict";r.d(e,"a",(function(){return u}));var n=r(26);const i={};function o(t,e){var r;i[t]=!0,void 0!==e&&(r=e,n.global.console&&n.global.console.error&&n.global.console.error(r))}const a=function t(e){const r=e.gl;this.ext=e,this.isAlive=!0,this.hasBeenBound=!1,this.elementArrayBuffer=null,this.attribs=new Array(e.maxVertexAttribs);for(let e=0;e<this.attribs.length;e++){const n=new t.VertexAttrib(r);this.attribs[e]=n}this.maxAttrib=0};(a.VertexAttrib=function(t){this.enabled=!1,this.buffer=null,this.size=4,this.type=5126,this.normalized=!1,this.stride=16,this.offset=0,this.cached="",this.recache()}).prototype.recache=function(){this.cached=[this.size,this.type,this.normalized,this.stride,this.offset].join(":")};const s=function(t){const e=this;this.gl=t,function(t){const e=t.getError;t.getError=function(){let r;do{r=e.apply(t),0!==r&&(i[r]=!0)}while(0!==r);for(r in i)if(i[r])return delete i[r],parseInt(r,10);return 0}}(t);const r=this.original={getParameter:t.getParameter,enableVertexAttribArray:t.enableVertexAttribArray,disableVertexAttribArray:t.disableVertexAttribArray,bindBuffer:t.bindBuffer,getVertexAttrib:t.getVertexAttrib,vertexAttribPointer:t.vertexAttribPointer};t.getParameter=function(t){return t===e.VERTEX_ARRAY_BINDING_OES?e.currentVertexArrayObject===e.defaultVertexArrayObject?null:e.currentVertexArrayObject:r.getParameter.apply(this,arguments)},t.enableVertexAttribArray=function(t){const n=e.currentVertexArrayObject;n.maxAttrib=Math.max(n.maxAttrib,t);const i=n.attribs[t];return i.enabled=!0,r.enableVertexAttribArray.apply(this,arguments)},t.disableVertexAttribArray=function(t){const n=e.currentVertexArrayObject;n.maxAttrib=Math.max(n.maxAttrib,t);const i=n.attribs[t];return i.enabled=!1,r.disableVertexAttribArray.apply(this,arguments)},t.bindBuffer=function(t,n){switch(t){case 34962:e.currentArrayBuffer=n;break;case 34963:e.currentVertexArrayObject.elementArrayBuffer=n}return r.bindBuffer.apply(this,arguments)},t.getVertexAttrib=function(t,n){const i=e.currentVertexArrayObject,o=i.attribs[t];switch(n){case 34975:return o.buffer;case 34338:return o.enabled;case 34339:return o.size;case 34340:return o.stride;case 34341:return o.type;case 34922:return o.normalized;default:return r.getVertexAttrib.apply(this,arguments)}},t.vertexAttribPointer=function(t,n,i,o,a,s){const u=e.currentVertexArrayObject;u.maxAttrib=Math.max(u.maxAttrib,t);const c=u.attribs[t];return c.buffer=e.currentArrayBuffer,c.size=n,c.type=i,c.normalized=o,c.stride=a,c.offset=s,c.recache(),r.vertexAttribPointer.apply(this,arguments)},t.instrumentExtension&&t.instrumentExtension(this,"OES_vertex_array_object"),t.canvas&&t.canvas.addEventListener("webglcontextrestored",()=>{var t;t="OESVertexArrayObject emulation library context restored",n.global.console&&n.global.console.log&&n.global.console.log(t),e.reset_()},!0),this.reset_()};function u(t){if("function"==typeof t.createVertexArray)return;const e=t.getSupportedExtensions;t.getSupportedExtensions=function(){const t=e.call(this)||[];return t.indexOf("OES_vertex_array_object")<0&&t.push("OES_vertex_array_object"),t};const r=t.getExtension;t.getExtension=function(e){const n=r.call(this,e);return n||("OES_vertex_array_object"!==e?null:(t.__OESVertexArrayObject||(this.__OESVertexArrayObject=new s(this)),this.__OESVertexArrayObject))}}s.prototype.VERTEX_ARRAY_BINDING_OES=34229,s.prototype.reset_=function(){if(void 0!==this.vertexArrayObjects)for(let t=0;t<this.vertexArrayObjects.length;++t)this.vertexArrayObjects.isAlive=!1;const t=this.gl;this.maxVertexAttribs=t.getParameter(34921),this.defaultVertexArrayObject=new a(this),this.currentVertexArrayObject=null,this.currentArrayBuffer=null,this.vertexArrayObjects=[this.defaultVertexArrayObject],this.bindVertexArrayOES(null)},s.prototype.createVertexArrayOES=function(){const t=new a(this);return this.vertexArrayObjects.push(t),t},s.prototype.deleteVertexArrayOES=function(t){t.isAlive=!1,this.vertexArrayObjects.splice(this.vertexArrayObjects.indexOf(t),1),this.currentVertexArrayObject===t&&this.bindVertexArrayOES(null)},s.prototype.isVertexArrayOES=function(t){return!!(t&&t instanceof a&&t.hasBeenBound&&t.ext===this)},s.prototype.bindVertexArrayOES=function(t){const e=this.gl;if(t&&!t.isAlive)return void o(1282,"bindVertexArrayOES: attempt to bind deleted arrayObject");const r=this.original,n=this.currentVertexArrayObject;this.currentVertexArrayObject=t||this.defaultVertexArrayObject,this.currentVertexArrayObject.hasBeenBound=!0;const i=this.currentVertexArrayObject;if(n===i)return;n&&i.elementArrayBuffer===n.elementArrayBuffer||r.bindBuffer.call(e,34963,i.elementArrayBuffer);let a=this.currentArrayBuffer;const s=Math.max(n?n.maxAttrib:0,i.maxAttrib);for(let t=0;t<=s;t++){const o=i.attribs[t],s=n?n.attribs[t]:null;if(n&&o.enabled===s.enabled||(o.enabled?r.enableVertexAttribArray.call(e,t):r.disableVertexAttribArray.call(e,t)),o.enabled){let i=!1;n&&o.buffer===s.buffer||(a!==o.buffer&&(r.bindBuffer.call(e,34962,o.buffer),a=o.buffer),i=!0),(i||o.cached!==s.cached)&&r.vertexAttribPointer.call(e,t,o.size,o.type,o.normalized,o.stride,o.offset)}}this.currentArrayBuffer!==a&&r.bindBuffer.call(e,34962,this.currentArrayBuffer)}},function(t,e,r){"use strict";r.d(e,"a",(function(){return u})),r.d(e,"b",(function(){return c}));var n=r(98),i=r(231),o=r(232),a=r(71),s=r(9);function u(t,e){Object(s.a)(t instanceof n.a||t instanceof i.a||t instanceof o.a);const r=t.constructor,{gl:a,width:u,height:c,format:l,type:h,dataFormat:f,border:p,mipmaps:d}=t;return new r(a,Object.assign({width:u,height:c,format:l,type:h,dataFormat:f,border:p,mipmaps:d},e))}function c(t,e){const{gl:r,width:n,height:i,id:o}=t;return new a.a(r,Object.assign({},e,{id:`framebuffer-for-${o}`,width:n,height:i,attachments:{36064:t}}))}},function(t,e,r){"use strict";r.d(e,"a",(function(){return a}));var n=r(7),i=r(55);const o=[34069,34070,34071,34072,34073,34074];class a extends i.a{constructor(t,e={}){Object(n.b)(t),super(t,Object.assign({},e,{target:34067})),this.initialize(e),Object.seal(this)}initialize(t={}){const{mipmaps:e=!0,parameters:r={}}=t;return this.opts=t,this.setCubeMapImageData(t).then(()=>{this.loaded=!0,e&&this.generateMipmap(t),this.setParameters(r)}),this}subImage({face:t,data:e,x:r=0,y:n=0,mipmapLevel:i=0}){return this._subImage({target:t,data:e,x:r,y:n,mipmapLevel:i})}async setCubeMapImageData({width:t,height:e,pixels:r,data:i,border:a=0,format:s=6408,type:u=5121}){const{gl:c}=this,l=r||i,h=await Promise.all(o.map(t=>{const e=l[t];return Promise.all(Array.isArray(e)?e:[e])}));this.bind(),o.forEach((r,i)=>{h[i].length>1&&!1!==this.opts.mipmaps&&n.k.warn(`${this.id} has mipmap and multiple LODs.`)(),h[i].forEach((n,i)=>{t&&e?c.texImage2D(r,i,s,t,e,a,s,u,n):c.texImage2D(r,i,s,s,u,n)})}),this.unbind()}setImageDataForFace(t){const{face:e,width:r,height:n,pixels:i,data:o,border:a=0,format:s=6408,type:u=5121}=t,{gl:c}=this,l=i||o;return this.bind(),l instanceof Promise?l.then(r=>this.setImageDataForFace(Object.assign({},t,{face:e,data:r,pixels:r}))):this.width||this.height?c.texImage2D(e,0,s,r,n,a,s,u,l):c.texImage2D(e,0,s,s,u,l),this}}a.FACES=o},function(t,e,r){"use strict";r.d(e,"a",(function(){return s}));var n=r(7),i=r(55),o=r(82),a=r(34);class s extends i.a{static isSupported(t){return Object(n.j)(t)}constructor(t,e={}){Object(n.a)(t),super(t,e=Object.assign({depth:1},e,{target:32879,unpackFlipY:!1})),this.initialize(e),Object.seal(this)}setImageData({level:t=0,dataFormat:e=6408,width:r,height:i,depth:s=1,border:u=0,format:c,type:l=5121,offset:h=0,data:f,parameters:p={}}){if(this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),Object(n.o)(this.gl,p,()=>{ArrayBuffer.isView(f)&&this.gl.texImage3D(this.target,t,e,r,i,s,u,c,l,f),f instanceof a.a&&(this.gl.bindBuffer(35052,f.handle),this.gl.texImage3D(this.target,t,e,r,i,s,u,c,l,h))}),f&&f.byteLength)this._trackAllocatedMemory(f.byteLength,"Texture");else{const t=o.a[this.dataFormat]||4,e=o.c[this.type]||1;this._trackAllocatedMemory(this.width*this.height*this.depth*t*e,"Texture")}return this.loaded=!0,this}}},function(t,e,r){var n=r(261);t.exports=function(t,e){if(null==t)return{};var r,i,o=n(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}},function(t,e){t.exports=function(t){var e;if("undefined"!=typeof Symbol){if(Symbol.asyncIterator&&null!=(e=t[Symbol.asyncIterator]))return e.call(t);if(Symbol.iterator&&null!=(e=t[Symbol.iterator]))return e.call(t)}throw new TypeError("Object is not async iterable")}},function(t,e,r){"use strict";(function(t){r.d(e,"a",(function(){return f}));var n=r(50),i=r(51),o=r(4),a=r(29),s=r.n(a),u=r(102);var c={container:s.a.object,gl:s.a.object,mapboxApiAccessToken:s.a.string,mapboxApiUrl:s.a.string,attributionControl:s.a.bool,preserveDrawingBuffer:s.a.bool,reuseMaps:s.a.bool,transformRequest:s.a.func,mapOptions:s.a.object,mapStyle:s.a.oneOfType([s.a.string,s.a.object]),visible:s.a.bool,asyncRender:s.a.bool,onLoad:s.a.func,onError:s.a.func,width:s.a.number,height:s.a.number,viewState:s.a.object,longitude:s.a.number,latitude:s.a.number,zoom:s.a.number,bearing:s.a.number,pitch:s.a.number,altitude:s.a.number},l={container:u.a.body,mapboxApiAccessToken:function(){var e=null;if("undefined"!=typeof window&&window.location){var r=window.location.search.match(/access_token=([^&\/]*)/);e=r&&r[1]}e||void 0===t||(e=e||t.env.MapboxAccessToken||t.env.REACT_APP_MAPBOX_ACCESS_TOKEN);return e||"no-token"}(),mapboxApiUrl:"https://api.mapbox.com",preserveDrawingBuffer:!1,attributionControl:!0,reuseMaps:!1,mapOptions:{},mapStyle:"mapbox://styles/mapbox/light-v8",visible:!0,asyncRender:!1,onLoad:function(){},onError:function(t){t&&console.error(t.error)},width:0,height:0,longitude:0,latitude:0,zoom:0,bearing:0,pitch:0,altitude:1.5};function h(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"component";t.debug&&s.a.checkPropTypes(c,t,"prop",e)}var f=function(){function t(e){var r=this;if(Object(n.a)(this,t),Object(o.a)(this,"mapboxgl",void 0),Object(o.a)(this,"props",l),Object(o.a)(this,"_map",null),Object(o.a)(this,"width",0),Object(o.a)(this,"height",0),Object(o.a)(this,"_fireLoadEvent",(function(){r.props.onLoad({type:"load",target:r._map})})),!e.mapboxgl)throw new Error("Mapbox not available");this.mapboxgl=e.mapboxgl,t.initialized||(t.initialized=!0,this._checkStyleSheet(this.mapboxgl.version)),this._initialize(e)}return Object(i.a)(t,[{key:"finalize",value:function(){return this._destroy(),this}},{key:"setProps",value:function(t){return this._update(this.props,t),this}},{key:"resize",value:function(){return this._map.resize(),this}},{key:"redraw",value:function(){var t=this._map;t.style&&(t._frame&&(t._frame.cancel(),t._frame=null),t._render())}},{key:"getMap",value:function(){return this._map}},{key:"_reuse",value:function(e){this._map=t.savedMap;var r=this._map.getContainer(),n=e.container;for(n.classList.add("mapboxgl-map");r.childNodes.length>0;)n.appendChild(r.childNodes[0]);this._map._container=n,t.savedMap=null,e.mapStyle&&this._map.setStyle(e.mapStyle,{diff:!1}),this._map.isStyleLoaded()?this._fireLoadEvent():this._map.once("styledata",this._fireLoadEvent)}},{key:"_create",value:function(e){if(e.reuseMaps&&t.savedMap)this._reuse(e);else{if(e.gl){var r=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=function(){return HTMLCanvasElement.prototype.getContext=r,e.gl}}var n={container:e.container,center:[0,0],zoom:8,pitch:0,bearing:0,maxZoom:24,style:e.mapStyle,interactive:!1,trackResize:!1,attributionControl:e.attributionControl,preserveDrawingBuffer:e.preserveDrawingBuffer};e.transformRequest&&(n.transformRequest=e.transformRequest),this._map=new this.mapboxgl.Map(Object.assign({},n,e.mapOptions)),this._map.once("load",e.onLoad),this._map.on("error",e.onError)}return this}},{key:"_destroy",value:function(){this._map&&(t.savedMap?this._map.remove():(t.savedMap=this._map,this._map.off("load",this.props.onLoad),this._map.off("error",this.props.onError),this._map.off("styledata",this._fireLoadEvent)),this._map=null)}},{key:"_initialize",value:function(t){var e=this;h(t=Object.assign({},l,t),"Mapbox"),this.mapboxgl.accessToken=t.mapboxApiAccessToken||l.mapboxApiAccessToken,this.mapboxgl.baseApiUrl=t.mapboxApiUrl,this._create(t);var r=t.container;Object.defineProperty(r,"offsetWidth",{get:function(){return e.width}}),Object.defineProperty(r,"clientWidth",{get:function(){return e.width}}),Object.defineProperty(r,"offsetHeight",{get:function(){return e.height}}),Object.defineProperty(r,"clientHeight",{get:function(){return e.height}});var n=this._map.getCanvas();n&&(n.style.outline="none"),this._updateMapViewport({},t),this._updateMapSize({},t),this.props=t}},{key:"_update",value:function(t,e){if(this._map){h(e=Object.assign({},this.props,e),"Mapbox");var r=this._updateMapViewport(t,e),n=this._updateMapSize(t,e);e.asyncRender||!r&&!n||this.redraw(),this.props=e}}},{key:"_updateMapSize",value:function(t,e){var r=t.width!==e.width||t.height!==e.height;return r&&(this.width=e.width,this.height=e.height,this.resize()),r}},{key:"_updateMapViewport",value:function(t,e){var r=this._getViewState(t),n=this._getViewState(e),i=n.latitude!==r.latitude||n.longitude!==r.longitude||n.zoom!==r.zoom||n.pitch!==r.pitch||n.bearing!==r.bearing||n.altitude!==r.altitude;return i&&(this._map.jumpTo(this._viewStateToMapboxProps(n)),n.altitude!==r.altitude&&(this._map.transform.altitude=n.altitude)),i}},{key:"_getViewState",value:function(t){var e=t.viewState||t,r=e.longitude,n=e.latitude,i=e.zoom,o=e.pitch,a=void 0===o?0:o,s=e.bearing,u=void 0===s?0:s,c=e.altitude;return{longitude:r,latitude:n,zoom:i,pitch:a,bearing:u,altitude:void 0===c?1.5:c}}},{key:"_checkStyleSheet",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"0.47.0";if(void 0!==u.a)try{var e=u.a.createElement("div");e.className="mapboxgl-map",e.style.display="none",u.a.body.append(e);var r="static"!==window.getComputedStyle(e).position;if(!r){var n=u.a.createElement("link");n.setAttribute("rel","stylesheet"),n.setAttribute("type","text/css"),n.setAttribute("href","https://api.tiles.mapbox.com/mapbox-gl-js/v".concat(t,"/mapbox-gl.css")),u.a.head.append(n)}}catch(t){}}},{key:"_viewStateToMapboxProps",value:function(t){return{center:[t.longitude,t.latitude],zoom:t.zoom,bearing:t.bearing,pitch:t.pitch}}}]),t}();Object(o.a)(f,"initialized",!1),Object(o.a)(f,"propTypes",c),Object(o.a)(f,"defaultProps",l),Object(o.a)(f,"savedMap",null)}).call(this,r(57))},function(t,e){},function(t,e,r){"use strict";function n(t,e,r){r=r||2;var n,s,u,c,l,p,d,g=e&&e.length,m=g?e[0]*r:t.length,y=i(t,0,m,r,!0),v=[];if(!y||y.next===y.prev)return v;if(g&&(y=function(t,e,r,n){var a,s,u,c,l,p=[];for(a=0,s=e.length;a<s;a++)u=e[a]*n,c=a<s-1?e[a+1]*n:t.length,(l=i(t,u,c,n,!1))===l.next&&(l.steiner=!0),p.push(A(l));for(p.sort(h),a=0;a<p.length;a++)f(p[a],r),r=o(r,r.next);return r}(t,e,y,r)),t.length>80*r){n=u=t[0],s=c=t[1];for(var _=r;_<m;_+=r)(l=t[_])<n&&(n=l),(p=t[_+1])<s&&(s=p),l>u&&(u=l),p>c&&(c=p);d=0!==(d=Math.max(u-n,c-s))?1/d:0}return a(y,v,r,n,s,d),v}function i(t,e,r,n,i){var o,a;if(i===P(t,e,r,n)>0)for(o=e;o<r;o+=n)a=S(o,t[o],t[o+1],a);else for(o=r-n;o>=e;o-=n)a=S(o,t[o],t[o+1],a);return a&&v(a,a.next)&&(O(a),a=a.next),a}function o(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!v(n,n.next)&&0!==y(n.prev,n,n.next))n=n.next;else{if(O(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function a(t,e,r,n,i,h,f){if(t){!f&&h&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=d(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,o,a,s,u,c=1;do{for(r=t,t=null,o=null,a=0;r;){for(a++,n=r,s=0,e=0;e<c&&(s++,n=n.nextZ);e++);for(u=c;s>0||u>0&&n;)0!==s&&(0===u||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,u--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;r=n}o.nextZ=null,c*=2}while(a>1)}(i)}(t,n,i,h);for(var p,A,g=t;t.prev!==t.next;)if(p=t.prev,A=t.next,h?u(t,n,i,h):s(t))e.push(p.i/r),e.push(t.i/r),e.push(A.i/r),O(t),t=A.next,g=A.next;else if((t=A)===g){f?1===f?a(t=c(o(t),e,r),e,r,n,i,h,2):2===f&&l(t,e,r,n,i,h):a(o(t),e,r,n,i,h,1);break}}}function s(t){var e=t.prev,r=t,n=t.next;if(y(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(g(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&y(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function u(t,e,r,n){var i=t.prev,o=t,a=t.next;if(y(i,o,a)>=0)return!1;for(var s=i.x<o.x?i.x<a.x?i.x:a.x:o.x<a.x?o.x:a.x,u=i.y<o.y?i.y<a.y?i.y:a.y:o.y<a.y?o.y:a.y,c=i.x>o.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,l=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,h=d(s,u,e,r,n),f=d(c,l,e,r,n),p=t.prevZ,A=t.nextZ;p&&p.z>=h&&A&&A.z<=f;){if(p!==t.prev&&p!==t.next&&g(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&y(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,A!==t.prev&&A!==t.next&&g(i.x,i.y,o.x,o.y,a.x,a.y,A.x,A.y)&&y(A.prev,A,A.next)>=0)return!1;A=A.nextZ}for(;p&&p.z>=h;){if(p!==t.prev&&p!==t.next&&g(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&y(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;A&&A.z<=f;){if(A!==t.prev&&A!==t.next&&g(i.x,i.y,o.x,o.y,a.x,a.y,A.x,A.y)&&y(A.prev,A,A.next)>=0)return!1;A=A.nextZ}return!0}function c(t,e,r){var n=t;do{var i=n.prev,a=n.next.next;!v(i,a)&&_(i,n,n.next,a)&&w(i,a)&&w(a,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(a.i/r),O(n),O(n.next),n=t=a),n=n.next}while(n!==t);return o(n)}function l(t,e,r,n,i,s){var u=t;do{for(var c=u.next.next;c!==u.prev;){if(u.i!==c.i&&m(u,c)){var l=E(u,c);return u=o(u,u.next),l=o(l,l.next),a(u,e,r,n,i,s),void a(l,e,r,n,i,s)}c=c.next}u=u.next}while(u!==t)}function h(t,e){return t.x-e.x}function f(t,e){if(e=function(t,e){var r,n=e,i=t.x,o=t.y,a=-1/0;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var s=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>a){if(a=s,s===i){if(o===n.y)return n;if(o===n.next.y)return n.next}r=n.x<n.next.x?n:n.next}}n=n.next}while(n!==e);if(!r)return null;if(i===a)return r;var u,c=r,l=r.x,h=r.y,f=1/0;n=r;do{i>=n.x&&n.x>=l&&i!==n.x&&g(o<h?i:a,o,l,h,o<h?a:i,o,n.x,n.y)&&(u=Math.abs(o-n.y)/(i-n.x),w(n,t)&&(u<f||u===f&&(n.x>r.x||n.x===r.x&&p(r,n)))&&(r=n,f=u)),n=n.next}while(n!==c);return r}(t,e)){var r=E(e,t);o(r,r.next)}}function p(t,e){return y(t.prev,t,e.prev)<0&&y(e.next,t,t.next)<0}function d(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function A(t){var e=t,r=t;do{(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next}while(e!==t);return r}function g(t,e,r,n,i,o,a,s){return(i-a)*(e-s)-(t-a)*(o-s)>=0&&(t-a)*(n-s)-(r-a)*(e-s)>=0&&(r-a)*(o-s)-(i-a)*(n-s)>=0}function m(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&_(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(w(t,e)&&w(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(y(t.prev,t,e.prev)||y(t,e.prev,e))||v(t,e)&&y(t.prev,t,t.next)>0&&y(e.prev,e,e.next)>0)}function y(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function v(t,e){return t.x===e.x&&t.y===e.y}function _(t,e,r,n){var i=x(y(t,e,r)),o=x(y(t,e,n)),a=x(y(r,n,t)),s=x(y(r,n,e));return i!==o&&a!==s||(!(0!==i||!b(t,r,e))||(!(0!==o||!b(t,n,e))||(!(0!==a||!b(r,t,n))||!(0!==s||!b(r,e,n)))))}function b(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function x(t){return t>0?1:t<0?-1:0}function w(t,e){return y(t.prev,t,t.next)<0?y(t,e,t.next)>=0&&y(t,t.prev,e)>=0:y(t,e,t.prev)<0||y(t,t.next,e)<0}function E(t,e){var r=new T(t.i,t.x,t.y),n=new T(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function S(t,e,r,n){var i=new T(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function O(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function T(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function P(t,e,r,n){for(var i=0,o=e,a=r-n;o<r;o+=n)i+=(t[a]-t[o])*(t[o+1]+t[a+1]),a=o;return i}t.exports=n,t.exports.default=n,n.deviation=function(t,e,r,n){var i=e&&e.length,o=i?e[0]*r:t.length,a=Math.abs(P(t,0,o,r));if(i)for(var s=0,u=e.length;s<u;s++){var c=e[s]*r,l=s<u-1?e[s+1]*r:t.length;a-=Math.abs(P(t,c,l,r))}var h=0;for(s=0;s<n.length;s+=3){var f=n[s]*r,p=n[s+1]*r,d=n[s+2]*r;h+=Math.abs((t[f]-t[d])*(t[p+1]-t[f+1])-(t[f]-t[p])*(t[d+1]-t[f+1]))}return 0===a&&0===h?0:Math.abs((h-a)/a)},n.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},n=0,i=0;i<t.length;i++){for(var o=0;o<t[i].length;o++)for(var a=0;a<e;a++)r.vertices.push(t[i][o][a]);i>0&&(n+=t[i-1].length,r.holes.push(n))}return r}},function(t,e,r){"use strict";t.exports=n,t.exports.default=n;function n(t,e,r,n,i,o){this.fontSize=t||24,this.buffer=void 0===e?3:e,this.cutoff=n||.25,this.fontFamily=i||"sans-serif",this.fontWeight=o||"normal",this.radius=r||8;var a=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=a,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(a*a),this.gridInner=new Float64Array(a*a),this.f=new Float64Array(a),this.d=new Float64Array(a),this.z=new Float64Array(a+1),this.v=new Int16Array(a),this.middle=Math.round(a/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function i(t,e,r,n,i,a,s){for(var u=0;u<e;u++){for(var c=0;c<r;c++)n[c]=t[c*e+u];for(o(n,i,a,s,r),c=0;c<r;c++)t[c*e+u]=i[c]}for(c=0;c<r;c++){for(u=0;u<e;u++)n[u]=t[c*e+u];for(o(n,i,a,s,e),u=0;u<e;u++)t[c*e+u]=Math.sqrt(i[u])}}function o(t,e,r,n,i){r[0]=0,n[0]=-1e20,n[1]=1e20;for(var o=1,a=0;o<i;o++){for(var s=(t[o]+o*o-(t[r[a]]+r[a]*r[a]))/(2*o-2*r[a]);s<=n[a];)a--,s=(t[o]+o*o-(t[r[a]]+r[a]*r[a]))/(2*o-2*r[a]);r[++a]=o,n[a]=s,n[a+1]=1e20}for(o=0,a=0;o<i;o++){for(;n[a+1]<o;)a++;e[o]=(o-r[a])*(o-r[a])+t[r[a]]}}n.prototype.draw=function(t){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(t,this.buffer,this.middle);for(var e=this.ctx.getImageData(0,0,this.size,this.size),r=new Uint8ClampedArray(this.size*this.size),n=0;n<this.size*this.size;n++){var o=e.data[4*n+3]/255;this.gridOuter[n]=1===o?0:0===o?1e20:Math.pow(Math.max(0,.5-o),2),this.gridInner[n]=1===o?1e20:0===o?0:Math.pow(Math.max(0,o-.5),2)}for(i(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),i(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),n=0;n<this.size*this.size;n++){var a=this.gridOuter[n]-this.gridInner[n];r[n]=Math.max(0,Math.min(255,Math.round(255-255*(a/this.radius+this.cutoff))))}return r}},function(t,e,r){"use strict";r.d(e,"a",(function(){return s}));var n=r(240),i=r(179),o=r(98),a=r(7);class s{constructor(t,{attributes:e,material:r,pbrDebug:o,imageBasedLightingEnvironment:a,lights:s,useTangents:u}){this.gl=t,this.defines={MANUAL_SRGB:1,SRGB_FAST_APPROXIMATION:1},Object(n.b)(t,i.a.GLSL_TEXTURE_LOD)&&(this.defines.USE_TEX_LOD=1),this.uniforms={u_Camera:[0,0,0],u_MetallicRoughnessValues:[1,1]},this.parameters={},this.generatedTextures=[],a&&(this.uniforms.u_DiffuseEnvSampler=a.getDiffuseEnvSampler(),this.uniforms.u_SpecularEnvSampler=a.getSpecularEnvSampler(),this.uniforms.u_brdfLUT=a.getBrdfTexture(),this.uniforms.u_ScaleIBLAmbient=[1,1]),o&&(this.uniforms.u_ScaleDiffBaseMR=[0,0,0,0],this.uniforms.u_ScaleFGDSpec=[0,0,0,0]),this.defineIfPresent(e.NORMAL,"HAS_NORMALS"),this.defineIfPresent(e.TANGENT&&u,"HAS_TANGENTS"),this.defineIfPresent(e.TEXCOORD_0,"HAS_UV"),this.defineIfPresent(a,"USE_IBL"),this.defineIfPresent(s,"USE_LIGHTS"),this.defineIfPresent(o,"PBR_DEBUG"),r&&this.parseMaterial(r)}defineIfPresent(t,e){t&&(this.defines[e]=1)}parseTexture(t,e,r=null){const n=t.texture&&t.texture.sampler&&t.texture.sampler.parameters||{},i=t.texture.source.image;let a,s={};i.compressed?(a=i,s={[this.gl.TEXTURE_MIN_FILTER]:i.data.length>1?this.gl.LINEAR_MIPMAP_NEAREST:this.gl.LINEAR}):a={data:i};const u=new o.a(this.gl,{id:t.name||t.id,parameters:{...n,...s},pixelStore:{[this.gl.UNPACK_FLIP_Y_WEBGL]:!1},...a});this.uniforms[e]=u,this.defineIfPresent(r,r),this.generatedTextures.push(u)}parsePbrMetallicRoughness(t){t.baseColorTexture&&this.parseTexture(t.baseColorTexture,"u_BaseColorSampler","HAS_BASECOLORMAP"),this.uniforms.u_BaseColorFactor=t.baseColorFactor||[1,1,1,1],t.metallicRoughnessTexture&&this.parseTexture(t.metallicRoughnessTexture,"u_MetallicRoughnessSampler","HAS_METALROUGHNESSMAP");const{metallicFactor:e=1,roughnessFactor:r=1}=t;this.uniforms.u_MetallicRoughnessValues=[e,r]}parseMaterial(t){if(this.uniforms.pbr_uUnlit=Boolean(t.unlit),t.pbrMetallicRoughness&&this.parsePbrMetallicRoughness(t.pbrMetallicRoughness),t.normalTexture){this.parseTexture(t.normalTexture,"u_NormalSampler","HAS_NORMALMAP");const{scale:e=1}=t.normalTexture;this.uniforms.u_NormalScale=e}if(t.occlusionTexture){this.parseTexture(t.occlusionTexture,"u_OcclusionSampler","HAS_OCCLUSIONMAP");const{strength:e=1}=t.occlusionTexture;this.uniforms.u_OcclusionStrength=e}if(t.emissiveTexture&&(this.parseTexture(t.emissiveTexture,"u_EmissiveSampler","HAS_EMISSIVEMAP"),this.uniforms.u_EmissiveFactor=t.emissiveFactor||[0,0,0]),"MASK"===t.alphaMode){const{alphaCutoff:e=.5}=t;this.defines.ALPHA_CUTOFF=1,this.uniforms.u_AlphaCutoff=e}else"BLEND"===t.alphaMode&&(a.k.warn("BLEND alphaMode might not work well because it requires mesh sorting")(),Object.assign(this.parameters,{blend:!0,blendEquation:this.gl.FUNC_ADD,blendFunc:[this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA,this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA]}))}}},function(t,e,r){"use strict";r.d(e,"b",(function(){return a})),r.d(e,"c",(function(){return s})),r.d(e,"a",(function(){return u}));var n=r(179),i=r(7),o=r(9);function a(t,e){return s(t,e)}function s(t,e){return(e=Array.isArray(e)?e:[e]).every(e=>c(t,e))}function u(t){t.luma=t.luma||{},t.luma.caps=t.luma.caps||{};for(const e in n.b)void 0===t.luma.caps[e]&&(t.luma.caps[e]=c(t,e));return t.luma.caps}function c(t,e){return t.luma=t.luma||{},t.luma.caps=t.luma.caps||{},void 0===t.luma.caps[e]&&(t.luma.caps[e]=function(t,e){const r=n.b[e];let a;Object(o.a)(r,e);const s=Object(i.j)(t)&&r[1]||r[0];if("function"==typeof s)a=s(t);else if(Array.isArray(s)){a=!0;for(const e of s)a=a&&Boolean(t.getExtension(e))}else"string"==typeof s?a=Boolean(t.getExtension(s)):"boolean"==typeof s?a=s:Object(o.a)(!1);return a}(t,e)),t.luma.caps[e]||i.k.log(2,`Feature: ${e} not supported`)(),t.luma.caps[e]}},,,,,,,function(t,e,r){var n=document.body&&document.body.getAttribute("data-base-url");n&&(window.__webpack_public_path__="".concat(n,"nbextensions/pydeck/nb_extension"));var i=r(188).default.jupyterTransport,o=null,a=null;try{o=r(273).default,a=r(250).default}catch(t){}var s=r(117),u=s.MODULE_VERSION,c=s.MODULE_NAME,l=r(87),h=l.createDeck,f=l.updateDeck,p=r(274).initPlayground;p(),t.exports={jupyterTransport:i,MODULE_VERSION:u,MODULE_NAME:c,JupyterTransportModel:o,JupyterTransportView:a,initPlayground:p,createDeck:h,updateDeck:f}},function(t,e){function r(e,n){return t.exports=r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},r(e,n)}t.exports=r},function(t,e,r){var n=r(1);t.exports=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=n(t)););return t}},function(t,e,r){"use strict";r.r(e),r.d(e,"default",(function(){return y}));var n=r(2),i=r.n(n),o=r(3),a=r.n(o),s=r(8),u=r.n(s),c=r(5),l=r.n(c),h=r(6),f=r.n(h),p=r(1),d=r.n(p),A=r(131),g=r(188);function m(t){var e=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(t){return!1}}();return function(){var r,n=d()(t);if(e){var i=d()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return f()(this,r)}}var y=function(t){l()(r,t);var e=m(r);function r(){return i()(this,r),e.apply(this,arguments)}return a()(r,[{key:"initialize",value:function(){this.listenTo(this.model,"destroy",this.remove),this.transport=new g.default,this.transport.jupyterModel=this.model,this.transport.jupyterView=this,this.transport._initialize(),u()(d()(r.prototype),"initialize",this).apply(this,arguments)}},{key:"remove",value:function(){this.transport&&(this.transport._finalize(),this.transport.jupyterModel=null,this.transport.jupyterView=null,this.transport=null)}},{key:"render",value:function(){u()(d()(r.prototype),"render",this).call(this),this.model.on("change:json_input",this.onJsonChanged.bind(this)),this.model.on("change:data_buffer",this.onDataBufferChanged.bind(this)),this.onDataBufferChanged()}},{key:"onJsonChanged",value:function(){var t=JSON.parse(this.model.get("json_input"));this.transport._messageReceived({type:"json",json:t})}},{key:"onDataBufferChanged",value:function(){var t=this.model.get("json_input"),e=this.model.get("data_buffer");t&&e?this.transport._messageReceived({type:"json-with-binary",json:t,binary:e}):this.transport._messageReceived({type:"json",json:t})}}]),r}(A.DOMWidgetView)},function(t,e,r){(function(e){const n=r(271),i=r(15),o=r(263).default,{registerLoaders:a,load:s,parse:u,fetchFile:c}=r(77),l="undefined"==typeof window?e:window;l.deck=l.deck||{},l.luma=l.luma||{},l.loaders=l.loaders||{},Object.assign(l.deck,i,{DeckGL:o}),Object.assign(l.luma,n),Object.assign(l.loaders,{registerLoaders:a,load:s,parse:u,fetchFile:c}),t.exports=l.deck}).call(this,r(65))},function(t,e){},function(t,e,r){"use strict";var n=r(123),i=r(24);Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"self",{enumerable:!0,get:function(){return o.self}}),Object.defineProperty(e,"window",{enumerable:!0,get:function(){return o.window}}),Object.defineProperty(e,"global",{enumerable:!0,get:function(){return o.global}}),Object.defineProperty(e,"document",{enumerable:!0,get:function(){return o.document}}),Object.defineProperty(e,"process",{enumerable:!0,get:function(){return o.process}}),Object.defineProperty(e,"console",{enumerable:!0,get:function(){return o.console}}),Object.defineProperty(e,"isBrowser",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"isBrowserMainThread",{enumerable:!0,get:function(){return a.isBrowserMainThread}}),Object.defineProperty(e,"getBrowser",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"isMobile",{enumerable:!0,get:function(){return s.isMobile}}),Object.defineProperty(e,"isElectron",{enumerable:!0,get:function(){return u.default}});var o=r(203),a=l(r(204)),s=l(r(254)),u=n(r(185));function c(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(c=function(t){return t?r:e})(t)}function l(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!==i(t)&&"function"!=typeof t)return{default:t};var r=c(e);if(r&&r.has(t))return r.get(t);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&Object.prototype.hasOwnProperty.call(t,a)){var s=o?Object.getOwnPropertyDescriptor(t,a):null;s&&(s.get||s.set)?Object.defineProperty(n,a,s):n[a]=t[a]}return n.default=t,r&&r.set(t,n),n}},function(t,e,r){"use strict";var n=r(123);Object.defineProperty(e,"__esModule",{value:!0}),e.isMobile=function(){return void 0!==i.window.orientation},e.default=function(t){if(!t&&!(0,o.default)())return"Node";if((0,a.default)(t))return"Electron";var e="undefined"!=typeof navigator?navigator:{},r=t||e.userAgent||"";if(r.indexOf("Edge")>-1)return"Edge";var n=-1!==r.indexOf("MSIE "),s=-1!==r.indexOf("Trident/");if(n||s)return"IE";if(i.window.chrome)return"Chrome";if(i.window.safari)return"Safari";if(i.window.mozInnerScreenX)return"Firefox";return"Unknown"};var i=r(203),o=n(r(204)),a=n(r(185))},function(t,e){t.exports=function(t){if(Array.isArray(t)){for(var e=0,r=new Array(t.length);e<t.length;e++)r[e]=t[e];return r}}},function(t,e){t.exports=function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},function(t,e){t.exports=function(t){if(Array.isArray(t))return t}},function(t,e){t.exports=function(t,e){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){i=!0,o=t}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(t,e){t.exports=function(t,e){if(null==t)return{};var r,n,i={},o=Object.keys(t);for(n=0;n<o.length;n++)r=o[n],e.indexOf(r)>=0||(i[r]=t[r]);return i}},function(t,e,r){var n=function(t){"use strict";var e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",o=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function s(t,e,r,n){var i=e&&e.prototype instanceof l?e:l,o=Object.create(i.prototype),a=new x(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return E()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=v(a,r);if(s){if(s===c)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(t,e,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===c)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}(t,r,a),o}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var c={};function l(){}function h(){}function f(){}var p={};p[i]=function(){return this};var d=Object.getPrototypeOf,A=d&&d(d(w([])));A&&A!==e&&r.call(A,i)&&(p=A);var g=f.prototype=l.prototype=Object.create(p);function m(t){["next","throw","return"].forEach((function(e){t[e]=function(t){return this._invoke(e,t)}}))}function y(t){var e;this._invoke=function(n,i){function o(){return new Promise((function(e,o){!function e(n,i,o,a){var s=u(t[n],t,i);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==typeof l&&r.call(l,"__await")?Promise.resolve(l.__await).then((function(t){e("next",t,o,a)}),(function(t){e("throw",t,o,a)})):Promise.resolve(l).then((function(t){c.value=t,o(c)}),(function(t){return e("throw",t,o,a)}))}a(s.arg)}(n,i,e,o)}))}return e=e?e.then(o,o):o()}}function v(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,v(t,e),"throw"===e.method))return c;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var n=u(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,c;var i=n.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,c):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,c)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function b(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function w(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:E}}function E(){return{value:void 0,done:!0}}return h.prototype=g.constructor=f,f.constructor=h,f[a]=h.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,a in t||(t[a]="GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(y.prototype),y.prototype[o]=function(){return this},t.AsyncIterator=y,t.async=function(e,r,n,i){var o=new y(s(e,r,n,i));return t.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},m(g),g[a]="Generator",g[i]=function(){return this},g.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=w,x.prototype={constructor:x,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(b),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(s&&u){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,c):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),c},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),b(r),c}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;b(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:w(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),c}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}},function(t,e,r){"use strict";r.r(e),r.d(e,"default",(function(){return a}));var n=r(235),i=r(191);const o={position:"absolute",left:0,top:0,width:"100%",height:"100%"};class a extends i.a{constructor(t={}){if("undefined"==typeof document)throw Error("Deck can only be used in the browser");const{mapCanvas:e,deckCanvas:r}=function(t){let{container:e=document.body}=t;if("string"==typeof e&&(e=document.getElementById(e)),!e)throw Error("Deck: container not found");"static"===window.getComputedStyle(e).position&&(e.style.position="relative");const r=document.createElement("div");e.appendChild(r),Object.assign(r.style,o);const n=document.createElement("canvas");return e.appendChild(n),Object.assign(n.style,o),{container:e,mapCanvas:r,deckCanvas:n}}(t),i=t.viewState||t.initialViewState,a=Number.isFinite(i&&i.latitude),{map:s=window.mapboxgl}=t;super({canvas:r,...t}),s&&s.Map?this._map=a&&new n.a({...t,viewState:i,container:e,mapboxgl:s}):this._map=s,this._onBeforeRender=t=>{if(this.onBeforeRender(t),this._map){const t=this.getViewports()[0];this._map.setProps({width:t.width,height:t.height,viewState:t})}}}getMapboxMap(){return this._map&&this._map.getMap()}finalize(){this._map&&this._map.finalize(),super.finalize()}setProps(t){"onBeforeRender"in t&&this._onBeforeRender&&t.onBeforeRender!==this._onBeforeRender&&(this.onBeforeRender=t.onBeforeRender,t.onBeforeRender=this._onBeforeRender),"mapStyle"in t&&this._map&&this._map._map.setStyle(t.mapStyle),super.setProps(t)}}},function(t,e,r){"use strict";var n=r(265);function i(){}function o(){}o.resetWarningCache=i,t.exports=function(){function t(t,e,r,i,o,a){if(a!==n){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function e(){return t}t.isRequired=t;var r={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:o,resetWarningCache:i};return r.PropTypes=r,r}},function(t,e,r){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(t,e){e.read=function(t,e,r,n,i){var o,a,s=8*i-n-1,u=(1<<s)-1,c=u>>1,l=-7,h=r?i-1:0,f=r?-1:1,p=t[e+h];for(h+=f,o=p&(1<<-l)-1,p>>=-l,l+=s;l>0;o=256*o+t[e+h],h+=f,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=n;l>0;a=256*a+t[e+h],h+=f,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),o-=c}return(p?-1:1)*a*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var a,s,u,c=8*o-i-1,l=(1<<c)-1,h=l>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,A=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+h>=1?f/u:f*Math.pow(2,1-h))*u>=2&&(a++,u/=2),a+h>=l?(s=0,a=l):a+h>=1?(s=(e*u-1)*Math.pow(2,i),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[r+p]=255&s,p+=d,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;t[r+p]=255&a,p+=d,a/=256,c-=8);t[r+p-d]|=128*A}},function(t,e,r){!function(r){"use strict";var n=function(t,e){var r=new Error(t+" at character "+e);throw r.index=e,r.description=t,r},i={"-":!0,"!":!0,"~":!0,"+":!0},o={"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},a=function(t){var e,r=0;for(var n in t)(e=n.length)>r&&t.hasOwnProperty(n)&&(r=e);return r},s=a(i),u=a(o),c={true:!0,false:!1,null:null},l=function(t){return o[t]||0},h=function(t,e,r){return{type:"||"===t||"&&"===t?"LogicalExpression":"BinaryExpression",operator:t,left:e,right:r}},f=function(t){return t>=48&&t<=57},p=function(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||t>=128&&!o[String.fromCharCode(t)]},d=function(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||t>=128&&!o[String.fromCharCode(t)]},A=function(t){for(var e,r,a=0,A=t.charAt,g=t.charCodeAt,m=function(e){return A.call(t,e)},y=function(e){return g.call(t,e)},v=t.length,_=function(){for(var t=y(a);32===t||9===t||10===t||13===t;)t=y(++a)},b=function(){var t,e,r=w();return _(),63!==y(a)?r:(a++,(t=b())||n("Expected expression",a),_(),58===y(a)?(a++,(e=b())||n("Expected expression",a),{type:"ConditionalExpression",test:r,consequent:t,alternate:e}):void n("Expected :",a))},x=function(){_();for(var e=t.substr(a,u),r=e.length;r>0;){if(o.hasOwnProperty(e)&&(!p(y(a))||a+e.length<t.length&&!d(y(a+e.length))))return a+=r,e;e=e.substr(0,--r)}return!1},w=function(){var t,e,r,i,o,s,u,c;if(s=E(),!(e=x()))return s;for(o={value:e,prec:l(e)},(u=E())||n("Expected expression after "+e,a),i=[s,o,u];(e=x())&&0!==(r=l(e));){for(o={value:e,prec:r};i.length>2&&r<=i[i.length-2].prec;)u=i.pop(),e=i.pop().value,s=i.pop(),t=h(e,s,u),i.push(t);(t=E())||n("Expected expression after "+e,a),i.push(o,t)}for(t=i[c=i.length-1];c>1;)t=h(i[c-1].value,i[c-2],t),c-=2;return t},E=function(){var e,r,n;if(_(),e=y(a),f(e)||46===e)return S();if(39===e||34===e)return O();if(91===e)return I();for(n=(r=t.substr(a,s)).length;n>0;){if(i.hasOwnProperty(r)&&(!p(y(a))||a+r.length<t.length&&!d(y(a+r.length))))return a+=n,{type:"UnaryExpression",operator:r,argument:E(),prefix:!0};r=r.substr(0,--n)}return!(!p(e)&&40!==e)&&M()},S=function(){for(var t,e,r="";f(y(a));)r+=m(a++);if(46===y(a))for(r+=m(a++);f(y(a));)r+=m(a++);if("e"===(t=m(a))||"E"===t){for(r+=m(a++),"+"!==(t=m(a))&&"-"!==t||(r+=m(a++));f(y(a));)r+=m(a++);f(y(a-1))||n("Expected exponent ("+r+m(a)+")",a)}return e=y(a),p(e)?n("Variable names cannot start with a number ("+r+m(a)+")",a):46===e&&n("Unexpected period",a),{type:"Literal",value:parseFloat(r),raw:r}},O=function(){for(var t,e="",r=m(a++),i=!1;a<v;){if((t=m(a++))===r){i=!0;break}if("\\"===t)switch(t=m(a++)){case"n":e+="\n";break;case"r":e+="\r";break;case"t":e+="\t";break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:e+=t}else e+=t}return i||n('Unclosed quote after "'+e+'"',a),{type:"Literal",value:e,raw:r+e+r}},T=function(){var e,r=y(a),i=a;for(p(r)?a++:n("Unexpected "+m(a),a);a<v&&(r=y(a),d(r));)a++;return e=t.slice(i,a),c.hasOwnProperty(e)?{type:"Literal",value:c[e],raw:e}:"this"===e?{type:"ThisExpression"}:{type:"Identifier",name:e}},P=function(t){for(var e,r,i=[],o=!1;a<v;){if(_(),(e=y(a))===t){o=!0,a++;break}44===e?a++:((r=b())&&"Compound"!==r.type||n("Expected comma",a),i.push(r))}return o||n("Expected "+String.fromCharCode(t),a),i},M=function(){var t,e;for(e=40===(t=y(a))?C():T(),_(),t=y(a);46===t||91===t||40===t;)a++,46===t?(_(),e={type:"MemberExpression",computed:!1,object:e,property:T()}):91===t?(e={type:"MemberExpression",computed:!0,object:e,property:b()},_(),93!==(t=y(a))&&n("Unclosed [",a),a++):40===t&&(e={type:"CallExpression",arguments:P(41),callee:e}),_(),t=y(a);return e},C=function(){a++;var t=b();if(_(),41===y(a))return a++,t;n("Unclosed (",a)},I=function(){return a++,{type:"ArrayExpression",elements:P(93)}},k=[];a<v;)59===(e=y(a))||44===e?a++:(r=b())?k.push(r):a<v&&n('Unexpected "'+m(a)+'"',a);return 1===k.length?k[0]:{type:"Compound",body:k}};A.version="0.3.4",A.toString=function(){return"JavaScript Expression Parser (JSEP) v"+A.version},A.addUnaryOp=function(t){return s=Math.max(t.length,s),i[t]=!0,this},A.addBinaryOp=function(t,e){return u=Math.max(t.length,u),o[t]=e,this},A.addLiteral=function(t,e){return c[t]=e,this},A.removeUnaryOp=function(t){return delete i[t],t.length===s&&(s=a(i)),this},A.removeAllUnaryOps=function(){return i={},s=0,this},A.removeBinaryOp=function(t){return delete o[t],t.length===u&&(u=a(o)),this},A.removeAllBinaryOps=function(){return o={},u=0,this},A.removeLiteral=function(t){return delete c[t],this},A.removeAllLiterals=function(){return c={},this},t.exports?e=t.exports=A:e.parse=A}()},function(t,e,r){t.exports=function(){"use strict";var t,e,r;function n(n,i){if(t)if(e){var o="var sharedChunk = {}; ("+t+")(sharedChunk); ("+e+")(sharedChunk);",a={};t(a),(r=i(a)).workerUrl=window.URL.createObjectURL(new Blob([o],{type:"text/javascript"}))}else e=i;else t=i}return n(0,(function(t){function e(t,e){return t(e={exports:{}},e.exports),e.exports}var r=n;function n(t,e,r,n){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=n,this.p2x=r,this.p2y=n}n.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},n.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},n.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},n.prototype.solveCurveX=function(t,e){var r,n,i,o,a;for(void 0===e&&(e=1e-6),i=t,a=0;a<8;a++){if(o=this.sampleCurveX(i)-t,Math.abs(o)<e)return i;var s=this.sampleCurveDerivativeX(i);if(Math.abs(s)<1e-6)break;i-=o/s}if((i=t)<(r=0))return r;if(i>(n=1))return n;for(;r<n;){if(o=this.sampleCurveX(i),Math.abs(o-t)<e)return i;t>o?r=i:n=i,i=.5*(n-r)+r}return i},n.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var i=o;function o(t,e){this.x=t,this.y=e}function a(t,e){if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(var r=0;r<t.length;r++)if(!a(t[r],e[r]))return!1;return!0}if("object"==typeof t&&null!==t&&null!==e){if("object"!=typeof e)return!1;if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var n in t)if(!a(t[n],e[n]))return!1;return!0}return t===e}function s(t,e,n,i){var o=new r(t,e,n,i);return function(t){return o.solve(t)}}o.prototype={clone:function(){return new o(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=e*this.x-r*this.y,i=r*this.x+e*this.y;return this.x=n,this.y=i,this},_rotateAround:function(t,e){var r=Math.cos(t),n=Math.sin(t),i=e.x+r*(this.x-e.x)-n*(this.y-e.y),o=e.y+n*(this.x-e.x)+r*(this.y-e.y);return this.x=i,this.y=o,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},o.convert=function(t){return t instanceof o?t:Array.isArray(t)?new o(t[0],t[1]):t};var u=s(.25,.1,.25,1);function c(t,e,r){return Math.min(r,Math.max(e,t))}function l(t,e,r){var n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i}function h(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n<i.length;n+=1){var o=i[n];for(var a in o)t[a]=o[a]}return t}var f=1;function p(){return f++}function d(){return function t(e){return e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function A(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function g(t,e){t.forEach((function(t){e[t]&&(e[t]=e[t].bind(e))}))}function m(t,e){return-1!==t.indexOf(e,t.length-e.length)}function y(t,e,r){var n={};for(var i in t)n[i]=e.call(r||this,t[i],i,t);return n}function v(t,e,r){var n={};for(var i in t)e.call(r||this,t[i],i,t)&&(n[i]=t[i]);return n}function _(t){return Array.isArray(t)?t.map(_):"object"==typeof t&&t?y(t,_):t}var b={};function x(t){b[t]||("undefined"!=typeof console&&console.warn(t),b[t]=!0)}function w(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function E(t){for(var e=0,r=0,n=t.length,i=n-1,o=void 0,a=void 0;r<n;i=r++)o=t[r],e+=((a=t[i]).x-o.x)*(o.y+a.y);return e}function S(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}function O(t){var e={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(t,r,n,i){var o=n||i;return e[r]=!o||o.toLowerCase(),""})),e["max-age"]){var r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e}var T=null;function P(t){if(null==T){var e=t.navigator?t.navigator.userAgent:null;T=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return T}function M(t){try{var e=self[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var C,I,k,R,L=self.performance&&self.performance.now?self.performance.now.bind(self.performance):Date.now.bind(Date),j=self.requestAnimationFrame||self.mozRequestAnimationFrame||self.webkitRequestAnimationFrame||self.msRequestAnimationFrame,D=self.cancelAnimationFrame||self.mozCancelAnimationFrame||self.webkitCancelAnimationFrame||self.msCancelAnimationFrame,B={now:L,frame:function(t){var e=j(t);return{cancel:function(){return D(e)}}},getImageData:function(t,e){void 0===e&&(e=0);var r=self.document.createElement("canvas"),n=r.getContext("2d");if(!n)throw new Error("failed to create canvas 2d context");return r.width=t.width,r.height=t.height,n.drawImage(t,0,0,t.width,t.height),n.getImageData(-e,-e,t.width+2*e,t.height+2*e)},resolveURL:function(t){return C||(C=self.document.createElement("a")),C.href=t,C.href},hardwareConcurrency:self.navigator.hardwareConcurrency||4,get devicePixelRatio(){return self.devicePixelRatio},get prefersReducedMotion(){return!!self.matchMedia&&(null==I&&(I=self.matchMedia("(prefers-reduced-motion: reduce)")),I.matches)}},F={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},z={supported:!1,testSupport:function(t){!N&&R&&(U?V(t):k=t)}},N=!1,U=!1;function V(t){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,R),t.isContextLost())return;z.supported=!0}catch(t){}t.deleteTexture(e),N=!0}self.document&&((R=self.document.createElement("img")).onload=function(){k&&V(k),k=null,U=!0},R.onerror=function(){N=!0,k=null},R.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var G="01",W=function(t,e){this._transformRequestFn=t,this._customAccessToken=e,this._createSkuToken()};function H(t){return 0===t.indexOf("mapbox:")}W.prototype._createSkuToken=function(){var t=function(){for(var t="",e=0;e<10;e++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",G,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt},W.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},W.prototype.transformRequest=function(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}},W.prototype.normalizeStyleURL=function(t,e){if(!H(t))return t;var r=Q(t);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},W.prototype.normalizeGlyphsURL=function(t,e){if(!H(t))return t;var r=Q(t);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},W.prototype.normalizeSourceURL=function(t,e){if(!H(t))return t;var r=Q(t);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||e)},W.prototype.normalizeSpriteURL=function(t,e,r,n){var i=Q(t);return H(t)?(i.path="/styles/v1"+i.path+"/sprite"+e+r,this._makeAPIURL(i,this._customAccessToken||n)):(i.path+=""+e+r,Y(i))},W.prototype.normalizeTileURL=function(t,e,r){if(this._isSkuTokenExpired()&&this._createSkuToken(),!e||!H(e))return t;var n=Q(t),i=B.devicePixelRatio>=2||512===r?"@2x":"",o=z.supported?".webp":"$1";return n.path=n.path.replace(/(\.(png|jpg)\d*)(?=$)/,""+i+o),n.path=n.path.replace(/^.+\/v4\//,"/"),n.path="/v4"+n.path,F.REQUIRE_ACCESS_TOKEN&&(F.ACCESS_TOKEN||this._customAccessToken)&&this._skuToken&&n.params.push("sku="+this._skuToken),this._makeAPIURL(n,this._customAccessToken)},W.prototype.canonicalizeTileURL=function(t){var e=Q(t);if(!e.path.match(/(^\/v4\/)/)||!e.path.match(/\.[\w]+$/))return t;var r="mapbox://tiles/";r+=e.path.replace("/v4/","");var n=e.params.filter((function(t){return!t.match(/^access_token=/)}));return n.length&&(r+="?"+n.join("&")),r},W.prototype.canonicalizeTileset=function(t,e){if(!H(e))return t.tiles||[];for(var r=[],n=0,i=t.tiles;n<i.length;n+=1){var o=i[n],a=this.canonicalizeTileURL(o);r.push(a)}return r},W.prototype._makeAPIURL=function(t,e){var r="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",n=Q(F.API_URL);if(t.protocol=n.protocol,t.authority=n.authority,"/"!==n.path&&(t.path=""+n.path+t.path),!F.REQUIRE_ACCESS_TOKEN)return Y(t);if(!(e=e||F.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+r);if("s"===e[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+r);return t.params=t.params.filter((function(t){return-1===t.indexOf("access_token")})),t.params.push("access_token="+e),Y(t)};var q=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function Z(t){return q.test(t)}var X=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Q(t){var e=t.match(X);if(!e)throw new Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}function Y(t){var e=t.params.length?"?"+t.params.join("&"):"";return t.protocol+"://"+t.authority+t.path+e}function K(t){if(!t)return null;var e,r=t.split(".");if(!r||3!==r.length)return null;try{return JSON.parse((e=r[1],decodeURIComponent(self.atob(e).split("").map((function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)})).join(""))))}catch(t){return null}}var $=function(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};$.prototype.getStorageKey=function(t){var e,r=K(F.ACCESS_TOKEN),n="";return r&&r.u?(e=r.u,n=self.btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(function(t,e){return String.fromCharCode(Number("0x"+e))})))):n=F.ACCESS_TOKEN||"",t?"mapbox.eventData."+t+":"+n:"mapbox.eventData:"+n},$.prototype.fetchEventData=function(){var t=M("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{var n=self.localStorage.getItem(e);n&&(this.eventData=JSON.parse(n));var i=self.localStorage.getItem(r);i&&(this.anonId=i)}catch(t){x("Unable to read from LocalStorage")}},$.prototype.saveEventData=function(){var t=M("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{self.localStorage.setItem(r,this.anonId),Object.keys(this.eventData).length>=1&&self.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){x("Unable to write to LocalStorage")}},$.prototype.processRequests=function(t){},$.prototype.postEvent=function(t,e,r,n){var i=this;if(F.EVENTS_URL){var o=Q(F.EVENTS_URL);o.params.push("access_token="+(n||F.ACCESS_TOKEN||""));var a={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.6.1",skuId:G,userId:this.anonId},s=e?h(a,e):a,u={url:Y(o),headers:{"Content-Type":"text/plain"},body:JSON.stringify([s])};this.pendingRequest=_t(u,(function(t){i.pendingRequest=null,r(t),i.saveEventData(),i.processRequests(n)}))}},$.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e)};var J,tt,et=function(t){function e(){t.call(this,"map.load"),this.success={},this.skuToken=""}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.postMapLoadEvent=function(t,e,r,n){this.skuToken=r,(F.EVENTS_URL&&n||F.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return H(t)||Z(t)})))&&this.queueRequest({id:e,timestamp:Date.now()},n)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){var r=this.queue.shift(),n=r.id,i=r.timestamp;n&&this.success[n]||(this.anonId||this.fetchEventData(),A(this.anonId)||(this.anonId=d()),this.postEvent(i,{skuToken:this.skuToken},(function(t){t||n&&(e.success[n]=!0)}),t))}},e}($),rt=new(function(t){function e(e){t.call(this,"appUserTurnstile"),this._customAccessToken=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.postTurnstileEvent=function(t,e){F.EVENTS_URL&&F.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return H(t)||Z(t)}))&&this.queueRequest(Date.now(),e)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var r=K(F.ACCESS_TOKEN),n=r?r.u:F.ACCESS_TOKEN,i=n!==this.eventData.tokenU;A(this.anonId)||(this.anonId=d(),i=!0);var o=this.queue.shift();if(this.eventData.lastSuccess){var a=new Date(this.eventData.lastSuccess),s=new Date(o),u=(o-this.eventData.lastSuccess)/864e5;i=i||u>=1||u<-1||a.getDate()!==s.getDate()}else i=!0;if(!i)return this.processRequests();this.postEvent(o,{"enabled.telemetry":!1},(function(t){t||(e.eventData.lastSuccess=o,e.eventData.tokenU=n)}),t)}},e}($)),nt=rt.postTurnstileEvent.bind(rt),it=new et,ot=it.postMapLoadEvent.bind(it),at="mapbox-tiles",st=500,ut=50;function ct(){self.caches&&!J&&(J=self.caches.open(at))}function lt(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}var ht=1/0,ft={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(ft);var pt=function(t){function e(e,r,n){401===r&&Z(n)&&(e+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),t.call(this,e),this.status=r,this.url=n,this.name=this.constructor.name,this.message=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},e}(Error),dt=S()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===self.location.protocol?self.parent:self).location.href};function At(t,e){var r,n=new self.AbortController,i=new self.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:dt(),signal:n.signal}),o=!1,a=!1,s=(r=i.url).indexOf("sku=")>0&&Z(r);"json"===t.type&&i.headers.set("Accept","application/json");var u=function(r,n,o){if(!a){if(r&&"SecurityError"!==r.message&&x(r),n&&o)return c(n);var u=Date.now();self.fetch(i).then((function(r){if(r.ok){var n=s?r.clone():null;return c(r,n,u)}return e(new pt(r.statusText,r.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message))}))}},c=function(r,n,s){("arrayBuffer"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text()).then((function(t){a||(n&&s&&function(t,e,r){if(ct(),J){var n={status:e.status,statusText:e.statusText,headers:new self.Headers};e.headers.forEach((function(t,e){return n.headers.set(e,t)}));var i=O(e.headers.get("Cache-Control")||"");i["no-store"]||(i["max-age"]&&n.headers.set("Expires",new Date(r+1e3*i["max-age"]).toUTCString()),new Date(n.headers.get("Expires")).getTime()-r<42e4||function(t,e){if(void 0===tt)try{new Response(new ReadableStream),tt=!0}catch(t){tt=!1}tt?e(t.body):t.blob().then(e)}(e,(function(e){var r=new self.Response(e,n);ct(),J&&J.then((function(e){return e.put(lt(t.url),r)})).catch((function(t){return x(t.message)}))})))}}(i,n,s),o=!0,e(null,t,r.headers.get("Cache-Control"),r.headers.get("Expires")))})).catch((function(t){a||e(new Error(t.message))}))};return s?function(t,e){if(ct(),!J)return e(null);var r=lt(t.url);J.then((function(t){t.match(r).then((function(n){var i=function(t){if(!t)return!1;var e=new Date(t.headers.get("Expires")||0),r=O(t.headers.get("Cache-Control")||"");return e>Date.now()&&!r["no-cache"]}(n);t.delete(r),i&&t.put(r,n.clone()),e(null,n,i)})).catch(e)})).catch(e)}(i,u):u(null,null),{cancel:function(){a=!0,o||n.abort()}}}var gt,mt,yt=function(t,e){if(r=t.url,!(/^file:/.test(r)||/^file:/.test(dt())&&!/^\w+:/.test(r))){if(self.fetch&&self.Request&&self.AbortController&&self.Request.prototype.hasOwnProperty("signal"))return At(t,e);if(S()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}var r;return function(t,e){var r=new self.XMLHttpRequest;for(var n in r.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(r.responseType="arraybuffer"),t.headers)r.setRequestHeader(n,t.headers[n]);return"json"===t.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===t.credentials,r.onerror=function(){e(new Error(r.statusText))},r.onload=function(){if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){var n=r.response;if("json"===t.type)try{n=JSON.parse(r.response)}catch(t){return e(t)}e(null,n,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else e(new pt(r.statusText,r.status,t.url))},r.send(t.body),{cancel:function(){return r.abort()}}}(t,e)},vt=function(t,e){return yt(h(t,{type:"arrayBuffer"}),e)},_t=function(t,e){return yt(h(t,{method:"POST"}),e)};gt=[],mt=0;var bt=function(t,e){if(z.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),mt>=F.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:t,callback:e,cancelled:!1,cancel:function(){this.cancelled=!0}};return gt.push(r),r}mt++;var n=!1,i=function(){if(!n)for(n=!0,mt--;gt.length&&mt<F.MAX_PARALLEL_IMAGE_REQUESTS;){var t=gt.shift(),e=t.requestParameters,r=t.callback;t.cancelled||(t.cancel=bt(e,r).cancel)}},o=vt(t,(function(t,r,n,o){if(i(),t)e(t);else if(r){var a=new self.Image;a.onload=function(){e(null,a),self.URL.revokeObjectURL(a.src)},a.onerror=function(){return e(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))};var s=new self.Blob([new Uint8Array(r)],{type:"image/png"});a.cacheControl=n,a.expires=o,a.src=r.byteLength?self.URL.createObjectURL(s):"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII="}}));return{cancel:function(){o.cancel(),i()}}};function xt(t,e,r){r[t]&&-1!==r[t].indexOf(e)||(r[t]=r[t]||[],r[t].push(e))}function wt(t,e,r){if(r&&r[t]){var n=r[t].indexOf(e);-1!==n&&r[t].splice(n,1)}}var Et=function(t,e){void 0===e&&(e={}),h(this,e),this.type=t},St=function(t){function e(e,r){void 0===r&&(r={}),t.call(this,"error",h({error:e},r))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Et),Ot=function(){};Ot.prototype.on=function(t,e){return this._listeners=this._listeners||{},xt(t,e,this._listeners),this},Ot.prototype.off=function(t,e){return wt(t,e,this._listeners),wt(t,e,this._oneTimeListeners),this},Ot.prototype.once=function(t,e){return this._oneTimeListeners=this._oneTimeListeners||{},xt(t,e,this._oneTimeListeners),this},Ot.prototype.fire=function(t,e){"string"==typeof t&&(t=new Et(t,e||{}));var r=t.type;if(this.listens(r)){t.target=this;for(var n=0,i=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];n<i.length;n+=1)i[n].call(this,t);for(var o=0,a=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];o<a.length;o+=1){var s=a[o];wt(r,s,this._oneTimeListeners),s.call(this,t)}var u=this._eventedParent;u&&(h(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),u.fire(t))}else t instanceof St&&console.error(t.error);return this},Ot.prototype.listens=function(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},Ot.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var Tt={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},expression_name:{type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},in:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},"interpolate-hcl":{group:"Ramps, scales, curves"},"interpolate-lab":{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},format:{group:"Types"},image:{group:"Types"},"number-format":{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Zoom"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Feature data"},accumulated:{group:"Feature data"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}}},Pt=function(t,e,r,n){this.message=(t?t+": ":"")+r,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__)};function Mt(t){var e=t.key,r=t.value;return r?[new Pt(e,r,"constants have been deprecated as of v8")]:[]}function Ct(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n<i.length;n+=1){var o=i[n];for(var a in o)t[a]=o[a]}return t}function It(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function kt(t){if(Array.isArray(t))return t.map(kt);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){var e={};for(var r in t)e[r]=kt(t[r]);return e}return It(t)}var Rt=function(t){function e(e,r){t.call(this,r),this.message=r,this.key=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),Lt=function(t,e){void 0===e&&(e=[]),this.parent=t,this.bindings={};for(var r=0,n=e;r<n.length;r+=1){var i=n[r],o=i[0],a=i[1];this.bindings[o]=a}};Lt.prototype.concat=function(t){return new Lt(this,t)},Lt.prototype.get=function(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(t+" not found in scope.")},Lt.prototype.has=function(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)};var jt={kind:"null"},Dt={kind:"number"},Bt={kind:"string"},Ft={kind:"boolean"},zt={kind:"color"},Nt={kind:"object"},Ut={kind:"value"},Vt={kind:"collator"},Gt={kind:"formatted"},Wt={kind:"resolvedImage"};function Ht(t,e){return{kind:"array",itemType:t,N:e}}function qt(t){if("array"===t.kind){var e=qt(t.itemType);return"number"==typeof t.N?"array<"+e+", "+t.N+">":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var Zt=[jt,Dt,Bt,Ft,zt,Gt,Nt,Ht(Ut),Wt];function Xt(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Xt(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var r=0,n=Zt;r<n.length;r+=1)if(!Xt(n[r],e))return null}return"Expected "+qt(t)+" but found "+qt(e)+" instead."}var Qt=e((function(t,e){var r={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function n(t){return(t=Math.round(t))<0?0:t>255?255:t}function i(t){return t<0?0:t>1?1:t}function o(t){return"%"===t[t.length-1]?n(parseFloat(t)/100*255):n(parseInt(t))}function a(t){return"%"===t[t.length-1]?i(parseFloat(t)/100):i(parseFloat(t))}function s(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}try{e.parseCSSColor=function(t){var e,i=t.replace(/ /g,"").toLowerCase();if(i in r)return r[i].slice();if("#"===i[0])return 4===i.length?(e=parseInt(i.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===i.length&&(e=parseInt(i.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var u=i.indexOf("("),c=i.indexOf(")");if(-1!==u&&c+1===i.length){var l=i.substr(0,u),h=i.substr(u+1,c-(u+1)).split(","),f=1;switch(l){case"rgba":if(4!==h.length)return null;f=a(h.pop());case"rgb":return 3!==h.length?null:[o(h[0]),o(h[1]),o(h[2]),f];case"hsla":if(4!==h.length)return null;f=a(h.pop());case"hsl":if(3!==h.length)return null;var p=(parseFloat(h[0])%360+360)%360/360,d=a(h[1]),A=a(h[2]),g=A<=.5?A*(d+1):A+d-A*d,m=2*A-g;return[n(255*s(m,g,p+1/3)),n(255*s(m,g,p)),n(255*s(m,g,p-1/3)),f];default:return null}}return null}}catch(t){}})).parseCSSColor,Yt=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n};Yt.parse=function(t){if(t){if(t instanceof Yt)return t;if("string"==typeof t){var e=Qt(t);if(e)return new Yt(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},Yt.prototype.toString=function(){var t=this.toArray(),e=t[0],r=t[1],n=t[2],i=t[3];return"rgba("+Math.round(e)+","+Math.round(r)+","+Math.round(n)+","+i+")"},Yt.prototype.toArray=function(){var t=this.r,e=this.g,r=this.b,n=this.a;return 0===n?[0,0,0,0]:[255*t/n,255*e/n,255*r/n,n]},Yt.black=new Yt(0,0,0,1),Yt.white=new Yt(1,1,1,1),Yt.transparent=new Yt(0,0,0,0),Yt.red=new Yt(1,0,0,1);var Kt=function(t,e,r){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};Kt.prototype.compare=function(t,e){return this.collator.compare(t,e)},Kt.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var $t=function(t,e,r,n,i){this.text=t,this.image=e,this.scale=r,this.fontStack=n,this.textColor=i},Jt=function(t){this.sections=t};Jt.fromString=function(t){return new Jt([new $t(t,null,null,null,null)])},Jt.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(t){return 0!==t.text.length||t.image&&0!==t.image.name.length}))},Jt.factory=function(t){return t instanceof Jt?t:Jt.fromString(t)},Jt.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},Jt.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e<r.length;e+=1){var n=r[e];if(n.image)t.push(["image",n.image.name]);else{t.push(n.text);var i={};n.fontStack&&(i["text-font"]=["literal",n.fontStack.split(",")]),n.scale&&(i["font-scale"]=n.scale),n.textColor&&(i["text-color"]=["rgba"].concat(n.textColor.toArray())),t.push(i)}}return t};var te=function(t){this.name=t.name,this.available=t.available};function ee(t,e,r,n){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:"Invalid rgba value ["+[t,e,r,n].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function re(t){if(null===t)return jt;if("string"==typeof t)return Bt;if("boolean"==typeof t)return Ft;if("number"==typeof t)return Dt;if(t instanceof Yt)return zt;if(t instanceof Kt)return Vt;if(t instanceof Jt)return Gt;if(t instanceof te)return Wt;if(Array.isArray(t)){for(var e,r=t.length,n=0,i=t;n<i.length;n+=1){var o=re(i[n]);if(e){if(e===o)continue;e=Ut;break}e=o}return Ht(e||Ut,r)}return Nt}function ne(t){var e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof Yt||t instanceof Jt||t instanceof te?t.toString():JSON.stringify(t)}te.prototype.toString=function(){return this.name},te.fromString=function(t){return new te({name:t,available:!1})},te.prototype.serialize=function(){return["image",this.name]};var ie=function(t,e){this.type=t,this.value=e};ie.parse=function(t,e){if(2!==t.length)return e.error("'literal' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(!function t(e){if(null===e)return!0;if("string"==typeof e)return!0;if("boolean"==typeof e)return!0;if("number"==typeof e)return!0;if(e instanceof Yt)return!0;if(e instanceof Kt)return!0;if(e instanceof Jt)return!0;if(e instanceof te)return!0;if(Array.isArray(e)){for(var r=0,n=e;r<n.length;r+=1)if(!t(n[r]))return!1;return!0}if("object"==typeof e){for(var i in e)if(!t(e[i]))return!1;return!0}return!1}(t[1]))return e.error("invalid value");var r=t[1],n=re(r),i=e.expectedType;return"array"!==n.kind||0!==n.N||!i||"array"!==i.kind||"number"==typeof i.N&&0!==i.N||(n=i),new ie(n,r)},ie.prototype.evaluate=function(){return this.value},ie.prototype.eachChild=function(){},ie.prototype.possibleOutputs=function(){return[this.value]},ie.prototype.serialize=function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof Yt?["rgba"].concat(this.value.toArray()):this.value instanceof Jt?this.value.serialize():this.value};var oe=function(t){this.name="ExpressionEvaluationError",this.message=t};oe.prototype.toJSON=function(){return this.message};var ae={string:Bt,number:Dt,boolean:Ft,object:Nt},se=function(t,e){this.type=t,this.args=e};se.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r,n=1,i=t[0];if("array"===i){var o,a;if(t.length>2){var s=t[1];if("string"!=typeof s||!(s in ae)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);o=ae[s],n++}else o=Ut;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);a=t[2],n++}r=Ht(o,a)}else r=ae[i];for(var u=[];n<t.length;n++){var c=e.parse(t[n],n,Ut);if(!c)return null;u.push(c)}return new se(r,u)},se.prototype.evaluate=function(t){for(var e=0;e<this.args.length;e++){var r=this.args[e].evaluate(t);if(!Xt(this.type,re(r)))return r;if(e===this.args.length-1)throw new oe("Expected value to be of type "+qt(this.type)+", but found "+qt(re(r))+" instead.")}return null},se.prototype.eachChild=function(t){this.args.forEach(t)},se.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.args.map((function(t){return t.possibleOutputs()})))},se.prototype.serialize=function(){var t=this.type,e=[t.kind];if("array"===t.kind){var r=t.itemType;if("string"===r.kind||"number"===r.kind||"boolean"===r.kind){e.push(r.kind);var n=t.N;("number"==typeof n||this.args.length>1)&&e.push(n)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var ue=function(t){this.type=Gt,this.sections=t};ue.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");for(var n=[],i=!1,o=1;o<=t.length-1;++o){var a=t[o];if(i&&"object"==typeof a&&!Array.isArray(a)){i=!1;var s=null;if(a["font-scale"]&&!(s=e.parse(a["font-scale"],1,Dt)))return null;var u=null;if(a["text-font"]&&!(u=e.parse(a["text-font"],1,Ht(Bt))))return null;var c=null;if(a["text-color"]&&!(c=e.parse(a["text-color"],1,zt)))return null;var l=n[n.length-1];l.scale=s,l.font=u,l.textColor=c}else{var h=e.parse(t[o],1,Ut);if(!h)return null;var f=h.type.kind;if("string"!==f&&"value"!==f&&"null"!==f&&"resolvedImage"!==f)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:h,scale:null,font:null,textColor:null})}}return new ue(n)},ue.prototype.evaluate=function(t){return new Jt(this.sections.map((function(e){var r=e.content.evaluate(t);return re(r)===Wt?new $t("",r,null,null,null):new $t(ne(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},ue.prototype.eachChild=function(t){for(var e=0,r=this.sections;e<r.length;e+=1){var n=r[e];t(n.content),n.scale&&t(n.scale),n.font&&t(n.font),n.textColor&&t(n.textColor)}},ue.prototype.possibleOutputs=function(){return[void 0]},ue.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e<r.length;e+=1){var n=r[e];t.push(n.content.serialize());var i={};n.scale&&(i["font-scale"]=n.scale.serialize()),n.font&&(i["text-font"]=n.font.serialize()),n.textColor&&(i["text-color"]=n.textColor.serialize()),t.push(i)}return t};var ce=function(t){this.type=Wt,this.input=t};ce.parse=function(t,e){if(2!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Bt);return r?new ce(r):e.error("No image name provided.")},ce.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=!1;return t.availableImages&&t.availableImages.indexOf(e)>-1&&(r=!0),new te({name:e,available:r})},ce.prototype.eachChild=function(t){t(this.input)},ce.prototype.possibleOutputs=function(){return[void 0]},ce.prototype.serialize=function(){return["image",this.input.serialize()]};var le={"to-boolean":Ft,"to-color":zt,"to-number":Dt,"to-string":Bt},he=function(t,e){this.type=t,this.args=e};he.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[0];if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");for(var n=le[r],i=[],o=1;o<t.length;o++){var a=e.parse(t[o],o,Ut);if(!a)return null;i.push(a)}return new he(n,i)},he.prototype.evaluate=function(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){for(var e,r,n=0,i=this.args;n<i.length;n+=1){if(r=null,(e=i[n].evaluate(t))instanceof Yt)return e;if("string"==typeof e){var o=t.parseColor(e);if(o)return o}else if(Array.isArray(e)&&!(r=e.length<3||e.length>4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":ee(e[0],e[1],e[2],e[3])))return new Yt(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new oe(r||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var a=null,s=0,u=this.args;s<u.length;s+=1){if(null===(a=u[s].evaluate(t)))return 0;var c=Number(a);if(!isNaN(c))return c}throw new oe("Could not convert "+JSON.stringify(a)+" to number.")}return"formatted"===this.type.kind?Jt.fromString(ne(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?te.fromString(ne(this.args[0].evaluate(t))):ne(this.args[0].evaluate(t))},he.prototype.eachChild=function(t){this.args.forEach(t)},he.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.args.map((function(t){return t.possibleOutputs()})))},he.prototype.serialize=function(){if("formatted"===this.type.kind)return new ue([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new ce(this.args[0]).serialize();var t=["to-"+this.type.kind];return this.eachChild((function(e){t.push(e.serialize())})),t};var fe=["Unknown","Point","LineString","Polygon"],pe=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null};pe.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},pe.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?fe[this.feature.type]:this.feature.type:null},pe.prototype.properties=function(){return this.feature&&this.feature.properties||{}},pe.prototype.parseColor=function(t){var e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=Yt.parse(t)),e};var de=function(t,e,r,n){this.name=t,this.type=e,this._evaluate=r,this.args=n};de.prototype.evaluate=function(t){return this._evaluate(t,this.args)},de.prototype.eachChild=function(t){this.args.forEach(t)},de.prototype.possibleOutputs=function(){return[void 0]},de.prototype.serialize=function(){return[this.name].concat(this.args.map((function(t){return t.serialize()})))},de.parse=function(t,e){var r,n=t[0],i=de.definitions[n];if(!i)return e.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0);for(var o=Array.isArray(i)?i[0]:i.type,a=Array.isArray(i)?[[i[1],i[2]]]:i.overloads,s=a.filter((function(e){var r=e[0];return!Array.isArray(r)||r.length===t.length-1})),u=null,c=0,l=s;c<l.length;c+=1){var h=l[c],f=h[0],p=h[1];u=new _e(e.registry,e.path,null,e.scope);for(var d=[],A=!1,g=1;g<t.length;g++){var m=t[g],y=Array.isArray(f)?f[g-1]:f.type,v=u.parse(m,1+d.length,y);if(!v){A=!0;break}d.push(v)}if(!A)if(Array.isArray(f)&&f.length!==d.length)u.error("Expected "+f.length+" arguments, but found "+d.length+" instead.");else{for(var _=0;_<d.length;_++){var b=Array.isArray(f)?f[_]:f.type,x=d[_];u.concat(_+1).checkSubtype(b,x.type)}if(0===u.errors.length)return new de(n,o,p,d)}}if(1===s.length)(r=e.errors).push.apply(r,u.errors);else{for(var w=(s.length?s:a).map((function(t){var e;return e=t[0],Array.isArray(e)?"("+e.map(qt).join(", ")+")":"("+qt(e.type)+"...)"})).join(" | "),E=[],S=1;S<t.length;S++){var O=e.parse(t[S],1+E.length);if(!O)return null;E.push(qt(O.type))}e.error("Expected arguments of type "+w+", but found ("+E.join(", ")+") instead.")}return null},de.register=function(t,e){for(var r in de.definitions=e,e)t[r]=de};var Ae=function(t,e,r){this.type=Vt,this.locale=r,this.caseSensitive=t,this.diacriticSensitive=e};function ge(t){if(t instanceof de){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}var e=!0;return t.eachChild((function(t){e&&!ge(t)&&(e=!1)})),e}function me(t){if(t instanceof de&&"feature-state"===t.name)return!1;var e=!0;return t.eachChild((function(t){e&&!me(t)&&(e=!1)})),e}function ye(t,e){if(t instanceof de&&e.indexOf(t.name)>=0)return!1;var r=!0;return t.eachChild((function(t){r&&!ye(t,e)&&(r=!1)})),r}Ae.parse=function(t,e){if(2!==t.length)return e.error("Expected one argument.");var r=t[1];if("object"!=typeof r||Array.isArray(r))return e.error("Collator options argument must be an object.");var n=e.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,Ft);if(!n)return null;var i=e.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,Ft);if(!i)return null;var o=null;return r.locale&&!(o=e.parse(r.locale,1,Bt))?null:new Ae(n,i,o)},Ae.prototype.evaluate=function(t){return new Kt(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},Ae.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)},Ae.prototype.possibleOutputs=function(){return[void 0]},Ae.prototype.serialize=function(){var t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]};var ve=function(t,e){this.type=e.type,this.name=t,this.boundExpression=e};ve.parse=function(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");var r=t[1];return e.scope.has(r)?new ve(r,e.scope.get(r)):e.error('Unknown variable "'+r+'". Make sure "'+r+'" has been bound in an enclosing "let" expression before using it.',1)},ve.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},ve.prototype.eachChild=function(){},ve.prototype.possibleOutputs=function(){return[void 0]},ve.prototype.serialize=function(){return["var",this.name]};var _e=function(t,e,r,n,i){void 0===e&&(e=[]),void 0===n&&(n=new Lt),void 0===i&&(i=[]),this.registry=t,this.path=e,this.key=e.map((function(t){return"["+t+"]"})).join(""),this.scope=n,this.errors=i,this.expectedType=r};function be(t,e){for(var r,n,i=t.length-1,o=0,a=i,s=0;o<=a;)if(r=t[s=Math.floor((o+a)/2)],n=t[s+1],r<=e){if(s===i||e<n)return s;o=s+1}else{if(!(r>e))throw new oe("Input is not a number.");a=s-1}return 0}_e.prototype.parse=function(t,e,r,n,i){return void 0===i&&(i={}),e?this.concat(e,r,n)._parse(t,i):this._parse(t,i)},_e.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new se(e,[t]):"coerce"===r?new he(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var n=t[0];if("string"!=typeof n)return this.error("Expression name must be a string, but found "+typeof n+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var i=this.registry[n];if(i){var o=i.parse(t,this);if(!o)return null;if(this.expectedType){var a=this.expectedType,s=o.type;if("string"!==a.kind&&"number"!==a.kind&&"boolean"!==a.kind&&"object"!==a.kind&&"array"!==a.kind||"value"!==s.kind)if("color"!==a.kind&&"formatted"!==a.kind&&"resolvedImage"!==a.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(a,s))return null}else o=r(o,a,e.typeAnnotation||"coerce");else o=r(o,a,e.typeAnnotation||"assert")}if(!(o instanceof ie)&&"resolvedImage"!==o.type.kind&&function t(e){if(e instanceof ve)return t(e.boundExpression);if(e instanceof de&&"error"===e.name)return!1;if(e instanceof Ae)return!1;var r=e instanceof he||e instanceof se,n=!0;return e.eachChild((function(e){n=r?n&&t(e):n&&e instanceof ie})),!!n&&ge(e)&&ye(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(o)){var u=new pe;try{o=new ie(o.type,o.evaluate(u))}catch(t){return this.error(t.message),null}}return o}return this.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"==typeof t?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof t+" instead.")},_e.prototype.concat=function(t,e,r){var n="number"==typeof t?this.path.concat(t):this.path,i=r?this.scope.concat(r):this.scope;return new _e(this.registry,n,e||null,i,this.errors)},_e.prototype.error=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];var n=""+this.key+e.map((function(t){return"["+t+"]"})).join("");this.errors.push(new Rt(n,t))},_e.prototype.checkSubtype=function(t,e){var r=Xt(t,e);return r&&this.error(r),r};var xe=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var n=0,i=r;n<i.length;n+=1){var o=i[n],a=o[0],s=o[1];this.labels.push(a),this.outputs.push(s)}};function we(t,e,r){return t*(1-r)+e*r}xe.parse=function(t,e){if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");var r=e.parse(t[1],1,Dt);if(!r)return null;var n=[],i=null;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);for(var o=1;o<t.length;o+=2){var a=1===o?-1/0:t[o],s=t[o+1],u=o,c=o+1;if("number"!=typeof a)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',u);if(n.length&&n[n.length-1][0]>=a)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',u);var l=e.parse(s,c,i);if(!l)return null;i=i||l.type,n.push([a,l])}return new xe(i,r,n)},xe.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;return n>=e[i-1]?r[i-1].evaluate(t):r[be(e,n)].evaluate(t)},xe.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1)t(r[e])},xe.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.outputs.map((function(t){return t.possibleOutputs()})))},xe.prototype.serialize=function(){for(var t=["step",this.input.serialize()],e=0;e<this.labels.length;e++)e>0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var Ee=Object.freeze({__proto__:null,number:we,color:function(t,e,r){return new Yt(we(t.r,e.r,r),we(t.g,e.g,r),we(t.b,e.b,r),we(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,n){return we(t,e[n],r)}))}}),Se=6/29,Oe=3*Se*Se,Te=Math.PI/180,Pe=180/Math.PI;function Me(t){return t>.008856451679035631?Math.pow(t,1/3):t/Oe+4/29}function Ce(t){return t>Se?t*t*t:Oe*(t-4/29)}function Ie(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function ke(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Re(t){var e=ke(t.r),r=ke(t.g),n=ke(t.b),i=Me((.4124564*e+.3575761*r+.1804375*n)/.95047),o=Me((.2126729*e+.7151522*r+.072175*n)/1);return{l:116*o-16,a:500*(i-o),b:200*(o-Me((.0193339*e+.119192*r+.9503041*n)/1.08883)),alpha:t.a}}function Le(t){var e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=1*Ce(e),r=.95047*Ce(r),n=1.08883*Ce(n),new Yt(Ie(3.2404542*r-1.5371385*e-.4985314*n),Ie(-.969266*r+1.8760108*e+.041556*n),Ie(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}function je(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var De={forward:Re,reverse:Le,interpolate:function(t,e,r){return{l:we(t.l,e.l,r),a:we(t.a,e.a,r),b:we(t.b,e.b,r),alpha:we(t.alpha,e.alpha,r)}}},Be={forward:function(t){var e=Re(t),r=e.l,n=e.a,i=e.b,o=Math.atan2(i,n)*Pe;return{h:o<0?o+360:o,c:Math.sqrt(n*n+i*i),l:r,alpha:t.a}},reverse:function(t){var e=t.h*Te,r=t.c;return Le({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:je(t.h,e.h,r),c:we(t.c,e.c,r),l:we(t.l,e.l,r),alpha:we(t.alpha,e.alpha,r)}}},Fe=Object.freeze({__proto__:null,lab:De,hcl:Be}),ze=function(t,e,r,n,i){this.type=t,this.operator=e,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(var o=0,a=i;o<a.length;o+=1){var s=a[o],u=s[0],c=s[1];this.labels.push(u),this.outputs.push(c)}};function Ne(t,e,r,n){var i=n-r,o=t-r;return 0===i?0:1===e?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}ze.interpolationFactor=function(t,e,n,i){var o=0;if("exponential"===t.name)o=Ne(e,t.base,n,i);else if("linear"===t.name)o=Ne(e,1,n,i);else if("cubic-bezier"===t.name){var a=t.controlPoints;o=new r(a[0],a[1],a[2],a[3]).solve(Ne(e,1,n,i))}return o},ze.parse=function(t,e){var r=t[0],n=t[1],i=t[2],o=t.slice(3);if(!Array.isArray(n)||0===n.length)return e.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){var a=n[1];if("number"!=typeof a)return e.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:a}}else{if("cubic-bezier"!==n[0])return e.error("Unknown interpolation type "+String(n[0]),1,0);var s=n.slice(1);if(4!==s.length||s.some((function(t){return"number"!=typeof t||t<0||t>1})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:s}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(i=e.parse(i,2,Dt)))return null;var u=[],c=null;"interpolate-hcl"===r||"interpolate-lab"===r?c=zt:e.expectedType&&"value"!==e.expectedType.kind&&(c=e.expectedType);for(var l=0;l<o.length;l+=2){var h=o[l],f=o[l+1],p=l+3,d=l+4;if("number"!=typeof h)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',p);if(u.length&&u[u.length-1][0]>=h)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',p);var A=e.parse(f,d,c);if(!A)return null;c=c||A.type,u.push([h,A])}return"number"===c.kind||"color"===c.kind||"array"===c.kind&&"number"===c.itemType.kind&&"number"==typeof c.N?new ze(c,r,n,i,u):e.error("Type "+qt(c)+" is not interpolatable.")},ze.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;if(n>=e[i-1])return r[i-1].evaluate(t);var o=be(e,n),a=e[o],s=e[o+1],u=ze.interpolationFactor(this.interpolation,n,a,s),c=r[o].evaluate(t),l=r[o+1].evaluate(t);return"interpolate"===this.operator?Ee[this.type.kind.toLowerCase()](c,l,u):"interpolate-hcl"===this.operator?Be.reverse(Be.interpolate(Be.forward(c),Be.forward(l),u)):De.reverse(De.interpolate(De.forward(c),De.forward(l),u))},ze.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1)t(r[e])},ze.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.outputs.map((function(t){return t.possibleOutputs()})))},ze.prototype.serialize=function(){var t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var e=[this.operator,t,this.input.serialize()],r=0;r<this.labels.length;r++)e.push(this.labels[r],this.outputs[r].serialize());return e};var Ue=function(t,e){this.type=t,this.args=e};Ue.parse=function(t,e){if(t.length<2)return e.error("Expectected at least one argument.");var r=null,n=e.expectedType;n&&"value"!==n.kind&&(r=n);for(var i=[],o=0,a=t.slice(1);o<a.length;o+=1){var s=a[o],u=e.parse(s,1+i.length,r,void 0,{typeAnnotation:"omit"});if(!u)return null;r=r||u.type,i.push(u)}var c=n&&i.some((function(t){return Xt(n,t.type)}));return new Ue(c?Ut:r,i)},Ue.prototype.evaluate=function(t){for(var e,r=null,n=0,i=0,o=this.args;i<o.length&&(n++,(r=o[i].evaluate(t))&&r instanceof te&&!r.available&&(e||(e=r.name),r=null,n===this.args.length&&(r=e)),null===r);i+=1);return r},Ue.prototype.eachChild=function(t){this.args.forEach(t)},Ue.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.args.map((function(t){return t.possibleOutputs()})))},Ue.prototype.serialize=function(){var t=["coalesce"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Ve=function(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e};Ve.prototype.evaluate=function(t){return this.result.evaluate(t)},Ve.prototype.eachChild=function(t){for(var e=0,r=this.bindings;e<r.length;e+=1)t(r[e][1]);t(this.result)},Ve.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found "+(t.length-1)+" instead.");for(var r=[],n=1;n<t.length-1;n+=2){var i=t[n];if("string"!=typeof i)return e.error("Expected string, but found "+typeof i+" instead.",n);if(/[^a-zA-Z0-9_]/.test(i))return e.error("Variable names must contain only alphanumeric characters or '_'.",n);var o=e.parse(t[n+1],n+1);if(!o)return null;r.push([i,o])}var a=e.parse(t[t.length-1],t.length-1,e.expectedType,r);return a?new Ve(r,a):null},Ve.prototype.possibleOutputs=function(){return this.result.possibleOutputs()},Ve.prototype.serialize=function(){for(var t=["let"],e=0,r=this.bindings;e<r.length;e+=1){var n=r[e],i=n[0],o=n[1];t.push(i,o.serialize())}return t.push(this.result.serialize()),t};var Ge=function(t,e,r){this.type=t,this.index=e,this.input=r};Ge.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Dt),n=e.parse(t[2],2,Ht(e.expectedType||Ut));if(!r||!n)return null;var i=n.type;return new Ge(i.itemType,r,n)},Ge.prototype.evaluate=function(t){var e=this.index.evaluate(t),r=this.input.evaluate(t);if(e<0)throw new oe("Array index out of bounds: "+e+" < 0.");if(e>=r.length)throw new oe("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new oe("Array index must be an integer, but found "+e+" instead.");return r[e]},Ge.prototype.eachChild=function(t){t(this.index),t(this.input)},Ge.prototype.possibleOutputs=function(){return[void 0]},Ge.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var We=function(t,e){this.type=Ft,this.needle=t,this.haystack=e};We.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r,n=e.parse(t[1],1,Ut),i=e.parse(t[2],2,Ut);return n&&i?"boolean"!==(r=n.type).kind&&"string"!==r.kind&&"number"!==r.kind&&"null"!==r.kind&&"value"!==r.kind?e.error("Expected first argument to be of type boolean, string, number or null, but found "+qt(n.type)+" instead"):new We(n,i):null},We.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!e||!r)return!1;if(!function(t){return"boolean"==typeof t||"string"==typeof t||"number"==typeof t}(e))throw new oe("Expected first argument to be of type boolean, string or number, but found "+qt(re(e))+" instead.");if(!function(t){return Array.isArray(t)||"string"==typeof t}(r))throw new oe("Expected second argument to be of type array or string, but found "+qt(re(r))+" instead.");return r.indexOf(e)>=0},We.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},We.prototype.possibleOutputs=function(){return[!0,!1]},We.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var He=function(t,e,r,n,i,o){this.inputType=t,this.type=e,this.input=r,this.cases=n,this.outputs=i,this.otherwise=o};He.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var r,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var i={},o=[],a=2;a<t.length-1;a+=2){var s=t[a],u=t[a+1];Array.isArray(s)||(s=[s]);var c=e.concat(a);if(0===s.length)return c.error("Expected at least one branch label.");for(var l=0,h=s;l<h.length;l+=1){var f=h[l];if("number"!=typeof f&&"string"!=typeof f)return c.error("Branch labels must be numbers or strings.");if("number"==typeof f&&Math.abs(f)>Number.MAX_SAFE_INTEGER)return c.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof f&&Math.floor(f)!==f)return c.error("Numeric branch labels must be integer values.");if(r){if(c.checkSubtype(r,re(f)))return null}else r=re(f);if(void 0!==i[String(f)])return c.error("Branch labels must be unique.");i[String(f)]=o.length}var p=e.parse(u,a,n);if(!p)return null;n=n||p.type,o.push(p)}var d=e.parse(t[1],1,Ut);if(!d)return null;var A=e.parse(t[t.length-1],t.length-1,n);return A?"value"!==d.type.kind&&e.concat(1).checkSubtype(r,d.type)?null:new He(r,n,d,i,o,A):null},He.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(re(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},He.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},He.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.outputs.map((function(t){return t.possibleOutputs()}))).concat(this.otherwise.possibleOutputs())},He.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],n={},i=0,o=Object.keys(this.cases).sort();i<o.length;i+=1){var a=o[i];void 0===(h=n[this.cases[a]])?(n[this.cases[a]]=r.length,r.push([this.cases[a],[a]])):r[h][1].push(a)}for(var s=function(e){return"number"===t.inputType.kind?Number(e):e},u=0,c=r;u<c.length;u+=1){var l=c[u],h=l[0],f=l[1];1===f.length?e.push(s(f[0])):e.push(f.map(s)),e.push(this.outputs[outputIndex$1].serialize())}return e.push(this.otherwise.serialize()),e};var qe=function(t,e,r){this.type=t,this.branches=e,this.otherwise=r};function Ze(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function Xe(t,e,r,n){return 0===n.compare(e,r)}function Qe(t,e,r){var n="=="!==t&&"!="!==t;return function(){function i(t,e,r){this.type=Ft,this.lhs=t,this.rhs=e,this.collator=r,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}return i.parse=function(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");var r=t[0],o=e.parse(t[1],1,Ut);if(!o)return null;if(!Ze(r,o.type))return e.concat(1).error('"'+r+"\" comparisons are not supported for type '"+qt(o.type)+"'.");var a=e.parse(t[2],2,Ut);if(!a)return null;if(!Ze(r,a.type))return e.concat(2).error('"'+r+"\" comparisons are not supported for type '"+qt(a.type)+"'.");if(o.type.kind!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return e.error("Cannot compare types '"+qt(o.type)+"' and '"+qt(a.type)+"'.");n&&("value"===o.type.kind&&"value"!==a.type.kind?o=new se(a.type,[o]):"value"!==o.type.kind&&"value"===a.type.kind&&(a=new se(o.type,[a])));var s=null;if(4===t.length){if("string"!==o.type.kind&&"string"!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return e.error("Cannot use collator to compare non-string types.");if(!(s=e.parse(t[3],3,Vt)))return null}return new i(o,a,s)},i.prototype.evaluate=function(i){var o=this.lhs.evaluate(i),a=this.rhs.evaluate(i);if(n&&this.hasUntypedArgument){var s=re(o),u=re(a);if(s.kind!==u.kind||"string"!==s.kind&&"number"!==s.kind)throw new oe('Expected arguments for "'+t+'" to be (string, string) or (number, number), but found ('+s.kind+", "+u.kind+") instead.")}if(this.collator&&!n&&this.hasUntypedArgument){var c=re(o),l=re(a);if("string"!==c.kind||"string"!==l.kind)return e(i,o,a)}return this.collator?r(i,o,a,this.collator.evaluate(i)):e(i,o,a)},i.prototype.eachChild=function(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)},i.prototype.possibleOutputs=function(){return[!0,!1]},i.prototype.serialize=function(){var e=[t];return this.eachChild((function(t){e.push(t.serialize())})),e},i}()}qe.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found only "+(t.length-1)+".");if(t.length%2!=0)return e.error("Expected an odd number of arguments.");var r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(var n=[],i=1;i<t.length-1;i+=2){var o=e.parse(t[i],i,Ft);if(!o)return null;var a=e.parse(t[i+1],i+1,r);if(!a)return null;n.push([o,a]),r=r||a.type}var s=e.parse(t[t.length-1],t.length-1,r);return s?new qe(r,n,s):null},qe.prototype.evaluate=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var n=r[e],i=n[0],o=n[1];if(i.evaluate(t))return o.evaluate(t)}return this.otherwise.evaluate(t)},qe.prototype.eachChild=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var n=r[e],i=n[0],o=n[1];t(i),t(o)}t(this.otherwise)},qe.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.branches.map((function(t){return t[0],t[1].possibleOutputs()}))).concat(this.otherwise.possibleOutputs())},qe.prototype.serialize=function(){var t=["case"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Ye=Qe("==",(function(t,e,r){return e===r}),Xe),Ke=Qe("!=",(function(t,e,r){return e!==r}),(function(t,e,r,n){return!Xe(0,e,r,n)})),$e=Qe("<",(function(t,e,r){return e<r}),(function(t,e,r,n){return n.compare(e,r)<0})),Je=Qe(">",(function(t,e,r){return e>r}),(function(t,e,r,n){return n.compare(e,r)>0})),tr=Qe("<=",(function(t,e,r){return e<=r}),(function(t,e,r,n){return n.compare(e,r)<=0})),er=Qe(">=",(function(t,e,r){return e>=r}),(function(t,e,r,n){return n.compare(e,r)>=0})),rr=function(t,e,r,n,i){this.type=Bt,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i};rr.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Dt);if(!r)return null;var n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");var i=null;if(n.locale&&!(i=e.parse(n.locale,1,Bt)))return null;var o=null;if(n.currency&&!(o=e.parse(n.currency,1,Bt)))return null;var a=null;if(n["min-fraction-digits"]&&!(a=e.parse(n["min-fraction-digits"],1,Dt)))return null;var s=null;return n["max-fraction-digits"]&&!(s=e.parse(n["max-fraction-digits"],1,Dt))?null:new rr(r,i,o,a,s)},rr.prototype.evaluate=function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))},rr.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)},rr.prototype.possibleOutputs=function(){return[void 0]},rr.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var nr=function(t){this.type=Dt,this.input=t};nr.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?e.error("Expected argument of type string or array, but found "+qt(r.type)+" instead."):new nr(r):null},nr.prototype.evaluate=function(t){var e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new oe("Expected value to be of type string or array, but found "+qt(re(e))+" instead.")},nr.prototype.eachChild=function(t){t(this.input)},nr.prototype.possibleOutputs=function(){return[void 0]},nr.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var ir={"==":Ye,"!=":Ke,">":Je,"<":$e,">=":er,"<=":tr,array:se,at:Ge,boolean:se,case:qe,coalesce:Ue,collator:Ae,format:ue,image:ce,in:We,interpolate:ze,"interpolate-hcl":ze,"interpolate-lab":ze,length:nr,let:Ve,literal:ie,match:He,number:se,"number-format":rr,object:se,step:xe,string:se,"to-boolean":he,"to-color":he,"to-number":he,"to-string":he,var:ve};function or(t,e){var r=e[0],n=e[1],i=e[2],o=e[3];r=r.evaluate(t),n=n.evaluate(t),i=i.evaluate(t);var a=o?o.evaluate(t):1,s=ee(r,n,i,a);if(s)throw new oe(s);return new Yt(r/255*a,n/255*a,i/255*a,a)}function ar(t,e){return t in e}function sr(t,e){var r=e[t];return void 0===r?null:r}function ur(t){return{type:t}}function cr(t){return{result:"success",value:t}}function lr(t){return{result:"error",value:t}}function hr(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function fr(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function pr(t){return!!t.expression&&t.expression.interpolated}function dr(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function Ar(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function gr(t){return t}function mr(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function yr(t,e,r,n,i){return mr(typeof r===i?n[r]:void 0,t.default,e.default)}function vr(t,e,r){if("number"!==dr(r))return mr(t.default,e.default);var n=t.stops.length;if(1===n)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];var i=be(t.stops.map((function(t){return t[0]})),r);return t.stops[i][1]}function _r(t,e,r){var n=void 0!==t.base?t.base:1;if("number"!==dr(r))return mr(t.default,e.default);var i=t.stops.length;if(1===i)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];var o=be(t.stops.map((function(t){return t[0]})),r),a=function(t,e,r,n){var i=n-r,o=t-r;return 0===i?0:1===e?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}(r,n,t.stops[o][0],t.stops[o+1][0]),s=t.stops[o][1],u=t.stops[o+1][1],c=Ee[e.type]||gr;if(t.colorSpace&&"rgb"!==t.colorSpace){var l=Fe[t.colorSpace];c=function(t,e){return l.reverse(l.interpolate(l.forward(t),l.forward(e),a))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=s.evaluate.apply(void 0,t),n=u.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==n)return c(r,n,a)}}:c(s,u,a)}function br(t,e,r){return"color"===e.type?r=Yt.parse(r):"formatted"===e.type?r=Jt.fromString(r.toString()):"resolvedImage"===e.type?r=te.fromString(r.toString()):dr(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),mr(r,t.default,e.default)}de.register(ir,{error:[{kind:"error"},[Bt],function(t,e){var r=e[0];throw new oe(r.evaluate(t))}],typeof:[Bt,[Ut],function(t,e){return qt(re(e[0].evaluate(t)))}],"to-rgba":[Ht(Dt,4),[zt],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[zt,[Dt,Dt,Dt],or],rgba:[zt,[Dt,Dt,Dt,Dt],or],has:{type:Ft,overloads:[[[Bt],function(t,e){return ar(e[0].evaluate(t),t.properties())}],[[Bt,Nt],function(t,e){var r=e[0],n=e[1];return ar(r.evaluate(t),n.evaluate(t))}]]},get:{type:Ut,overloads:[[[Bt],function(t,e){return sr(e[0].evaluate(t),t.properties())}],[[Bt,Nt],function(t,e){var r=e[0],n=e[1];return sr(r.evaluate(t),n.evaluate(t))}]]},"feature-state":[Ut,[Bt],function(t,e){return sr(e[0].evaluate(t),t.featureState||{})}],properties:[Nt,[],function(t){return t.properties()}],"geometry-type":[Bt,[],function(t){return t.geometryType()}],id:[Ut,[],function(t){return t.id()}],zoom:[Dt,[],function(t){return t.globals.zoom}],"heatmap-density":[Dt,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[Dt,[],function(t){return t.globals.lineProgress||0}],accumulated:[Ut,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[Dt,ur(Dt),function(t,e){for(var r=0,n=0,i=e;n<i.length;n+=1)r+=i[n].evaluate(t);return r}],"*":[Dt,ur(Dt),function(t,e){for(var r=1,n=0,i=e;n<i.length;n+=1)r*=i[n].evaluate(t);return r}],"-":{type:Dt,overloads:[[[Dt,Dt],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)-n.evaluate(t)}],[[Dt],function(t,e){return-e[0].evaluate(t)}]]},"/":[Dt,[Dt,Dt],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)/n.evaluate(t)}],"%":[Dt,[Dt,Dt],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)%n.evaluate(t)}],ln2:[Dt,[],function(){return Math.LN2}],pi:[Dt,[],function(){return Math.PI}],e:[Dt,[],function(){return Math.E}],"^":[Dt,[Dt,Dt],function(t,e){var r=e[0],n=e[1];return Math.pow(r.evaluate(t),n.evaluate(t))}],sqrt:[Dt,[Dt],function(t,e){var r=e[0];return Math.sqrt(r.evaluate(t))}],log10:[Dt,[Dt],function(t,e){var r=e[0];return Math.log(r.evaluate(t))/Math.LN10}],ln:[Dt,[Dt],function(t,e){var r=e[0];return Math.log(r.evaluate(t))}],log2:[Dt,[Dt],function(t,e){var r=e[0];return Math.log(r.evaluate(t))/Math.LN2}],sin:[Dt,[Dt],function(t,e){var r=e[0];return Math.sin(r.evaluate(t))}],cos:[Dt,[Dt],function(t,e){var r=e[0];return Math.cos(r.evaluate(t))}],tan:[Dt,[Dt],function(t,e){var r=e[0];return Math.tan(r.evaluate(t))}],asin:[Dt,[Dt],function(t,e){var r=e[0];return Math.asin(r.evaluate(t))}],acos:[Dt,[Dt],function(t,e){var r=e[0];return Math.acos(r.evaluate(t))}],atan:[Dt,[Dt],function(t,e){var r=e[0];return Math.atan(r.evaluate(t))}],min:[Dt,ur(Dt),function(t,e){return Math.min.apply(Math,e.map((function(e){return e.evaluate(t)})))}],max:[Dt,ur(Dt),function(t,e){return Math.max.apply(Math,e.map((function(e){return e.evaluate(t)})))}],abs:[Dt,[Dt],function(t,e){var r=e[0];return Math.abs(r.evaluate(t))}],round:[Dt,[Dt],function(t,e){var r=e[0].evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[Dt,[Dt],function(t,e){var r=e[0];return Math.floor(r.evaluate(t))}],ceil:[Dt,[Dt],function(t,e){var r=e[0];return Math.ceil(r.evaluate(t))}],"filter-==":[Ft,[Bt,Ut],function(t,e){var r=e[0],n=e[1];return t.properties()[r.value]===n.value}],"filter-id-==":[Ft,[Ut],function(t,e){var r=e[0];return t.id()===r.value}],"filter-type-==":[Ft,[Bt],function(t,e){var r=e[0];return t.geometryType()===r.value}],"filter-<":[Ft,[Bt,Ut],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i<o}],"filter-id-<":[Ft,[Ut],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<i}],"filter->":[Ft,[Bt,Ut],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i>o}],"filter-id->":[Ft,[Ut],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>i}],"filter-<=":[Ft,[Bt,Ut],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i<=o}],"filter-id-<=":[Ft,[Ut],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<=i}],"filter->=":[Ft,[Bt,Ut],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i>=o}],"filter-id->=":[Ft,[Ut],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>=i}],"filter-has":[Ft,[Ut],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[Ft,[],function(t){return null!==t.id()}],"filter-type-in":[Ft,[Ht(Bt)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[Ft,[Ht(Ut)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[Ft,[Bt,Ht(Ut)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[Ft,[Bt,Ht(Ut)],function(t,e){var r=e[0],n=e[1];return function(t,e,r,n){for(;r<=n;){var i=r+n>>1;if(e[i]===t)return!0;e[i]>t?n=i-1:r=i+1}return!1}(t.properties()[r.value],n.value,0,n.value.length-1)}],all:{type:Ft,overloads:[[[Ft,Ft],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)&&n.evaluate(t)}],[ur(Ft),function(t,e){for(var r=0,n=e;r<n.length;r+=1)if(!n[r].evaluate(t))return!1;return!0}]]},any:{type:Ft,overloads:[[[Ft,Ft],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)||n.evaluate(t)}],[ur(Ft),function(t,e){for(var r=0,n=e;r<n.length;r+=1)if(n[r].evaluate(t))return!0;return!1}]]},"!":[Ft,[Ft],function(t,e){return!e[0].evaluate(t)}],"is-supported-script":[Ft,[Bt],function(t,e){var r=e[0],n=t.globals&&t.globals.isSupportedScript;return!n||n(r.evaluate(t))}],upcase:[Bt,[Bt],function(t,e){return e[0].evaluate(t).toUpperCase()}],downcase:[Bt,[Bt],function(t,e){return e[0].evaluate(t).toLowerCase()}],concat:[Bt,ur(Ut),function(t,e){return e.map((function(e){return ne(e.evaluate(t))})).join("")}],"resolved-locale":[Bt,[Vt],function(t,e){return e[0].evaluate(t).resolvedLocale()}]});var xr=function(t,e){this.expression=t,this._warningHistory={},this._evaluator=new pe,this._defaultValue=e?function(t){return"color"===t.type&&Ar(t.default)?new Yt(0,0,0,0):"color"===t.type?Yt.parse(t.default)||null:void 0===t.default?null:t.default}(e):null,this._enumValues=e&&"enum"===e.type?e.values:null};function wr(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in ir}function Er(t,e){var r=new _e(ir,[],e?function(t){var e={color:zt,string:Bt,number:Dt,enum:Bt,boolean:Ft,formatted:Gt,resolvedImage:Wt};return"array"===t.type?Ht(e[t.value]||Ut,t.length):e[t.type]}(e):void 0),n=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?cr(new xr(n,e)):lr(r.errors)}xr.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=i,this.expression.evaluate(this._evaluator)},xr.prototype.evaluate=function(t,e,r,n,i){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=i||null;try{var o=this.expression.evaluate(this._evaluator);if(null==o||"number"==typeof o&&o!=o)return this._defaultValue;if(this._enumValues&&!(o in this._enumValues))throw new oe("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(o)+" instead.");return o}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var Sr=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!me(e.expression)};Sr.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i)},Sr.prototype.evaluate=function(t,e,r,n,i){return this._styleExpression.evaluate(t,e,r,n,i)};var Or=function(t,e,r,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!me(e.expression),this.interpolationType=n};function Tr(t,e){if("error"===(t=Er(t,e)).result)return t;var r=t.value.expression,n=ge(r);if(!n&&!hr(e))return lr([new Rt("","data expressions not supported")]);var i=ye(r,["zoom"]);if(!i&&!fr(e))return lr([new Rt("","zoom expressions not supported")]);var o=function t(e){var r=null;if(e instanceof Ve)r=t(e.result);else if(e instanceof Ue)for(var n=0,i=e.args;n<i.length;n+=1){var o=i[n];if(r=t(o))break}else(e instanceof xe||e instanceof ze)&&e.input instanceof de&&"zoom"===e.input.name&&(r=e);return r instanceof Rt?r:(e.eachChild((function(e){var n=t(e);n instanceof Rt?r=n:!r&&n?r=new Rt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):r&&n&&r!==n&&(r=new Rt("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),r)}(r);if(!o&&!i)return lr([new Rt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(o instanceof Rt)return lr([o]);if(o instanceof ze&&!pr(e))return lr([new Rt("",'"interpolate" expressions cannot be used with this property')]);if(!o)return cr(new Sr(n?"constant":"source",t.value));var a=o instanceof ze?o.interpolation:void 0;return cr(new Or(n?"camera":"composite",t.value,o.labels,a))}Or.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i)},Or.prototype.evaluate=function(t,e,r,n,i){return this._styleExpression.evaluate(t,e,r,n,i)},Or.prototype.interpolationFactor=function(t,e,r){return this.interpolationType?ze.interpolationFactor(this.interpolationType,t,e,r):0};var Pr=function(t,e){this._parameters=t,this._specification=e,Ct(this,function t(e,r){var n,i,o,a="color"===r.type,s=e.stops&&"object"==typeof e.stops[0][0],u=s||void 0!==e.property,c=s||!u,l=e.type||(pr(r)?"exponential":"interval");if(a&&((e=Ct({},e)).stops&&(e.stops=e.stops.map((function(t){return[t[0],Yt.parse(t[1])]}))),e.default?e.default=Yt.parse(e.default):e.default=Yt.parse(r.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!Fe[e.colorSpace])throw new Error("Unknown color space: "+e.colorSpace);if("exponential"===l)n=_r;else if("interval"===l)n=vr;else if("categorical"===l){n=yr,i=Object.create(null);for(var h=0,f=e.stops;h<f.length;h+=1){var p=f[h];i[p[0]]=p[1]}o=typeof e.stops[0][0]}else{if("identity"!==l)throw new Error('Unknown function type "'+l+'"');n=br}if(s){for(var d={},A=[],g=0;g<e.stops.length;g++){var m=e.stops[g],y=m[0].zoom;void 0===d[y]&&(d[y]={zoom:y,type:e.type,property:e.property,default:e.default,stops:[]},A.push(y)),d[y].stops.push([m[0].value,m[1]])}for(var v=[],_=0,b=A;_<b.length;_+=1){var x=b[_];v.push([d[x].zoom,t(d[x],r)])}var w={name:"linear"};return{kind:"composite",interpolationType:w,interpolationFactor:ze.interpolationFactor.bind(void 0,w),zoomStops:v.map((function(t){return t[0]})),evaluate:function(t,n){var i=t.zoom;return _r({stops:v,base:e.base},r,i).evaluate(i,n)}}}if(c){var E="exponential"===l?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:E,interpolationFactor:ze.interpolationFactor.bind(void 0,E),zoomStops:e.stops.map((function(t){return t[0]})),evaluate:function(t){var a=t.zoom;return n(e,r,a,i,o)}}}return{kind:"source",evaluate:function(t,a){var s=a&&a.properties?a.properties[e.property]:void 0;return void 0===s?mr(e.default,r.default):n(e,r,s,i,o)}}}(this._parameters,this._specification))};function Mr(t){var e=t.key,r=t.value,n=t.valueSpec||{},i=t.objectElementValidators||{},o=t.style,a=t.styleSpec,s=[],u=dr(r);if("object"!==u)return[new Pt(e,r,"object expected, "+u+" found")];for(var c in r){var l=c.split(".")[0],h=n[l]||n["*"],f=void 0;if(i[l])f=i[l];else if(n[l])f=Jr;else if(i["*"])f=i["*"];else{if(!n["*"]){s.push(new Pt(e,r[c],'unknown property "'+c+'"'));continue}f=Jr}s=s.concat(f({key:(e?e+".":e)+c,value:r[c],valueSpec:h,style:o,styleSpec:a,object:r,objectKey:c},r))}for(var p in n)i[p]||n[p].required&&void 0===n[p].default&&void 0===r[p]&&s.push(new Pt(e,r,'missing required property "'+p+'"'));return s}function Cr(t){var e=t.value,r=t.valueSpec,n=t.style,i=t.styleSpec,o=t.key,a=t.arrayElementValidator||Jr;if("array"!==dr(e))return[new Pt(o,e,"array expected, "+dr(e)+" found")];if(r.length&&e.length!==r.length)return[new Pt(o,e,"array length "+r.length+" expected, length "+e.length+" found")];if(r["min-length"]&&e.length<r["min-length"])return[new Pt(o,e,"array length at least "+r["min-length"]+" expected, length "+e.length+" found")];var s={type:r.value,values:r.values};i.$version<7&&(s.function=r.function),"object"===dr(r.value)&&(s=r.value);for(var u=[],c=0;c<e.length;c++)u=u.concat(a({array:e,arrayIndex:c,value:e[c],valueSpec:s,style:n,styleSpec:i,key:o+"["+c+"]"}));return u}function Ir(t){var e=t.key,r=t.value,n=t.valueSpec,i=dr(r);return"number"===i&&r!=r&&(i="NaN"),"number"!==i?[new Pt(e,r,"number expected, "+i+" found")]:"minimum"in n&&r<n.minimum?[new Pt(e,r,r+" is less than the minimum value "+n.minimum)]:"maximum"in n&&r>n.maximum?[new Pt(e,r,r+" is greater than the maximum value "+n.maximum)]:[]}function kr(t){var e,r,n,i=t.valueSpec,o=It(t.value.type),a={},s="categorical"!==o&&void 0===t.value.property,u=!s,c="array"===dr(t.value.stops)&&"array"===dr(t.value.stops[0])&&"object"===dr(t.value.stops[0][0]),l=Mr({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===o)return[new Pt(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;return e=e.concat(Cr({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:h})),"array"===dr(r)&&0===r.length&&e.push(new Pt(t.key,r,"array must have at least one stop")),e},default:function(t){return Jr({key:t.key,value:t.value,valueSpec:i,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===o&&s&&l.push(new Pt(t.key,t.value,'missing required property "property"')),"identity"===o||t.value.stops||l.push(new Pt(t.key,t.value,'missing required property "stops"')),"exponential"===o&&t.valueSpec.expression&&!pr(t.valueSpec)&&l.push(new Pt(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(u&&!hr(t.valueSpec)?l.push(new Pt(t.key,t.value,"property functions not supported")):s&&!fr(t.valueSpec)&&l.push(new Pt(t.key,t.value,"zoom functions not supported"))),"categorical"!==o&&!c||void 0!==t.value.property||l.push(new Pt(t.key,t.value,'"property" property is required')),l;function h(t){var e=[],o=t.value,s=t.key;if("array"!==dr(o))return[new Pt(s,o,"array expected, "+dr(o)+" found")];if(2!==o.length)return[new Pt(s,o,"array length 2 expected, length "+o.length+" found")];if(c){if("object"!==dr(o[0]))return[new Pt(s,o,"object expected, "+dr(o[0])+" found")];if(void 0===o[0].zoom)return[new Pt(s,o,"object stop key must have zoom")];if(void 0===o[0].value)return[new Pt(s,o,"object stop key must have value")];if(n&&n>It(o[0].zoom))return[new Pt(s,o[0].zoom,"stop zoom values must appear in ascending order")];It(o[0].zoom)!==n&&(n=It(o[0].zoom),r=void 0,a={}),e=e.concat(Mr({key:s+"[0]",value:o[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:Ir,value:f}}))}else e=e.concat(f({key:s+"[0]",value:o[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},o));return wr(kt(o[1]))?e.concat([new Pt(s+"[1]",o[1],"expressions are not allowed in function stops.")]):e.concat(Jr({key:s+"[1]",value:o[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function f(t,n){var s=dr(t.value),u=It(t.value),c=null!==t.value?t.value:n;if(e){if(s!==e)return[new Pt(t.key,c,s+" stop domain type must match previous stop domain type "+e)]}else e=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new Pt(t.key,c,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==o){var l="number expected, "+s+" found";return hr(i)&&void 0===o&&(l+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Pt(t.key,c,l)]}return"categorical"!==o||"number"!==s||isFinite(u)&&Math.floor(u)===u?"categorical"!==o&&"number"===s&&void 0!==r&&u<r?[new Pt(t.key,c,"stop domain values must appear in ascending order")]:(r=u,"categorical"===o&&u in a?[new Pt(t.key,c,"stop domain values must be unique")]:(a[u]=!0,[])):[new Pt(t.key,c,"integer expected, found "+u)]}}function Rr(t){var e=("property"===t.expressionContext?Tr:Er)(kt(t.value),t.valueSpec);if("error"===e.result)return e.value.map((function(e){return new Pt(""+t.key+e.key,t.value,e.message)}));var r=e.value.expression||e.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&-1!==r.possibleOutputs().indexOf(void 0))return[new Pt(t.key,t.value,'Invalid data expression for "'+t.propertyKey+'". Output values must be contained as literals within the expression.')];if("property"===t.expressionContext&&"layout"===t.propertyType&&!me(r))return[new Pt(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext&&!me(r))return[new Pt(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!ye(r,["zoom","feature-state"]))return[new Pt(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!ge(r))return[new Pt(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Lr(t){var e=t.key,r=t.value,n=t.valueSpec,i=[];return Array.isArray(n.values)?-1===n.values.indexOf(It(r))&&i.push(new Pt(e,r,"expected one of ["+n.values.join(", ")+"], "+JSON.stringify(r)+" found")):-1===Object.keys(n.values).indexOf(It(r))&&i.push(new Pt(e,r,"expected one of ["+Object.keys(n.values).join(", ")+"], "+JSON.stringify(r)+" found")),i}function jr(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&Array.isArray(t[2]);case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var e=0,r=t.slice(1);e<r.length;e+=1){var n=r[e];if(!jr(n)&&"boolean"!=typeof n)return!1}return!0;default:return!0}}Pr.deserialize=function(t){return new Pr(t._parameters,t._specification)},Pr.serialize=function(t){return{_parameters:t._parameters,_specification:t._specification}};var Dr={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Br(t){if(null==t)return function(){return!0};jr(t)||(t=zr(t));var e=Er(t,Dr);if("error"===e.result)throw new Error(e.value.map((function(t){return t.key+": "+t.message})).join(", "));return function(t,r){return e.value.evaluate(t,r)}}function Fr(t,e){return t<e?-1:t>e?1:0}function zr(t){if(!t)return!0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?Nr(t[1],t[2],"=="):"!="===r?Gr(Nr(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?Nr(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(zr))):"all"===r?["all"].concat(t.slice(1).map(zr)):"none"===r?["all"].concat(t.slice(1).map(zr).map(Gr)):"in"===r?Ur(t[1],t.slice(2)):"!in"===r?Gr(Ur(t[1],t.slice(2))):"has"===r?Vr(t[1]):"!has"!==r||Gr(Vr(t[1]))}function Nr(t,e,r){switch(t){case"$type":return["filter-type-"+r,e];case"$id":return["filter-id-"+r,e];default:return["filter-"+r,t,e]}}function Ur(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((function(t){return typeof t!=typeof e[0]}))?["filter-in-large",t,["literal",e.sort(Fr)]]:["filter-in-small",t,["literal",e]]}}function Vr(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function Gr(t){return["!",t]}function Wr(t){return jr(kt(t.value))?Rr(Ct({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var r=e.value,n=e.key;if("array"!==dr(r))return[new Pt(n,r,"array expected, "+dr(r)+" found")];var i,o=e.styleSpec,a=[];if(r.length<1)return[new Pt(n,r,"filter array must have at least 1 element")];switch(a=a.concat(Lr({key:n+"[0]",value:r[0],valueSpec:o.filter_operator,style:e.style,styleSpec:e.styleSpec})),It(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===It(r[1])&&a.push(new Pt(n,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&a.push(new Pt(n,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":r.length>=2&&"string"!==(i=dr(r[1]))&&a.push(new Pt(n+"[1]",r[1],"string expected, "+i+" found"));for(var s=2;s<r.length;s++)i=dr(r[s]),"$type"===It(r[1])?a=a.concat(Lr({key:n+"["+s+"]",value:r[s],valueSpec:o.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"!==i&&"number"!==i&&"boolean"!==i&&a.push(new Pt(n+"["+s+"]",r[s],"string, number, or boolean expected, "+i+" found"));break;case"any":case"all":case"none":for(var u=1;u<r.length;u++)a=a.concat(t({key:n+"["+u+"]",value:r[u],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":i=dr(r[1]),2!==r.length?a.push(new Pt(n,r,'filter array for "'+r[0]+'" operator must have 2 elements')):"string"!==i&&a.push(new Pt(n+"[1]",r[1],"string expected, "+i+" found"))}return a}(t)}function Hr(t,e){var r=t.key,n=t.style,i=t.styleSpec,o=t.value,a=t.objectKey,s=i[e+"_"+t.layerType];if(!s)return[];var u=a.match(/^(.*)-transition$/);if("paint"===e&&u&&s[u[1]]&&s[u[1]].transition)return Jr({key:r,value:o,valueSpec:i.transition,style:n,styleSpec:i});var c,l=t.valueSpec||s[a];if(!l)return[new Pt(r,o,'unknown property "'+a+'"')];if("string"===dr(o)&&hr(l)&&!l.tokens&&(c=/^{([^}]+)}$/.exec(o)))return[new Pt(r,o,'"'+a+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(c[1])+" }`.")];var h=[];return"symbol"===t.layerType&&("text-field"===a&&n&&!n.glyphs&&h.push(new Pt(r,o,'use of "text-field" requires a style "glyphs" property')),"text-font"===a&&Ar(kt(o))&&"identity"===It(o.type)&&h.push(new Pt(r,o,'"text-font" does not support identity functions'))),h.concat(Jr({key:t.key,value:o,valueSpec:l,style:n,styleSpec:i,expressionContext:"property",propertyType:e,propertyKey:a}))}function qr(t){return Hr(t,"paint")}function Zr(t){return Hr(t,"layout")}function Xr(t){var e=[],r=t.value,n=t.key,i=t.style,o=t.styleSpec;r.type||r.ref||e.push(new Pt(n,r,'either "type" or "ref" is required'));var a,s=It(r.type),u=It(r.ref);if(r.id)for(var c=It(r.id),l=0;l<t.arrayIndex;l++){var h=i.layers[l];It(h.id)===c&&e.push(new Pt(n,r.id,'duplicate layer id "'+r.id+'", previously used at line '+h.id.__line__))}if("ref"in r)["type","source","source-layer","filter","layout"].forEach((function(t){t in r&&e.push(new Pt(n,r[t],'"'+t+'" is prohibited for ref layers'))})),i.layers.forEach((function(t){It(t.id)===u&&(a=t)})),a?a.ref?e.push(new Pt(n,r.ref,"ref cannot reference another ref layer")):s=It(a.type):e.push(new Pt(n,r.ref,'ref layer "'+u+'" not found'));else if("background"!==s)if(r.source){var f=i.sources&&i.sources[r.source],p=f&&It(f.type);f?"vector"===p&&"raster"===s?e.push(new Pt(n,r.source,'layer "'+r.id+'" requires a raster source')):"raster"===p&&"raster"!==s?e.push(new Pt(n,r.source,'layer "'+r.id+'" requires a vector source')):"vector"!==p||r["source-layer"]?"raster-dem"===p&&"hillshade"!==s?e.push(new Pt(n,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==s||!r.paint||!r.paint["line-gradient"]||"geojson"===p&&f.lineMetrics||e.push(new Pt(n,r,'layer "'+r.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):e.push(new Pt(n,r,'layer "'+r.id+'" must specify a "source-layer"')):e.push(new Pt(n,r.source,'source "'+r.source+'" not found'))}else e.push(new Pt(n,r,'missing required property "source"'));return e=e.concat(Mr({key:n,value:r,valueSpec:o.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return Jr({key:n+".type",value:r.type,valueSpec:o.layer.type,style:t.style,styleSpec:t.styleSpec,object:r,objectKey:"type"})},filter:Wr,layout:function(t){return Mr({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return Zr(Ct({layerType:s},t))}}})},paint:function(t){return Mr({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return qr(Ct({layerType:s},t))}}})}}}))}function Qr(t){var e=t.value,r=t.key,n=t.styleSpec,i=t.style;if(!e.type)return[new Pt(r,e,'"type" is required')];var o,a=It(e.type);switch(a){case"vector":case"raster":case"raster-dem":return Mr({key:r,value:e,valueSpec:n["source_"+a.replace("-","_")],style:t.style,styleSpec:n});case"geojson":if(o=Mr({key:r,value:e,valueSpec:n.source_geojson,style:i,styleSpec:n}),e.cluster)for(var s in e.clusterProperties){var u=e.clusterProperties[s],c=u[0],l=u[1],h="string"==typeof c?[c,["accumulated"],["get",s]]:c;o.push.apply(o,Rr({key:r+"."+s+".map",value:l,expressionContext:"cluster-map"})),o.push.apply(o,Rr({key:r+"."+s+".reduce",value:h,expressionContext:"cluster-reduce"}))}return o;case"video":return Mr({key:r,value:e,valueSpec:n.source_video,style:i,styleSpec:n});case"image":return Mr({key:r,value:e,valueSpec:n.source_image,style:i,styleSpec:n});case"canvas":return[new Pt(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Lr({key:r+".type",value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:i,styleSpec:n})}}function Yr(t){var e=t.value,r=t.styleSpec,n=r.light,i=t.style,o=[],a=dr(e);if(void 0===e)return o;if("object"!==a)return o.concat([new Pt("light",e,"object expected, "+a+" found")]);for(var s in e){var u=s.match(/^(.*)-transition$/);o=u&&n[u[1]]&&n[u[1]].transition?o.concat(Jr({key:s,value:e[s],valueSpec:r.transition,style:i,styleSpec:r})):n[s]?o.concat(Jr({key:s,value:e[s],valueSpec:n[s],style:i,styleSpec:r})):o.concat([new Pt(s,e[s],'unknown property "'+s+'"')])}return o}function Kr(t){var e=t.value,r=t.key,n=dr(e);return"string"!==n?[new Pt(r,e,"string expected, "+n+" found")]:[]}var $r={"*":function(){return[]},array:Cr,boolean:function(t){var e=t.value,r=t.key,n=dr(e);return"boolean"!==n?[new Pt(r,e,"boolean expected, "+n+" found")]:[]},number:Ir,color:function(t){var e=t.key,r=t.value,n=dr(r);return"string"!==n?[new Pt(e,r,"color expected, "+n+" found")]:null===Qt(r)?[new Pt(e,r,'color expected, "'+r+'" found')]:[]},constants:Mt,enum:Lr,filter:Wr,function:kr,layer:Xr,object:Mr,source:Qr,light:Yr,string:Kr,formatted:function(t){return 0===Kr(t).length?[]:Rr(t)},resolvedImage:function(t){return 0===Kr(t).length?[]:Rr(t)}};function Jr(t){var e=t.value,r=t.valueSpec,n=t.styleSpec;return r.expression&&Ar(It(e))?kr(t):r.expression&&wr(kt(e))?Rr(t):r.type&&$r[r.type]?$r[r.type](t):Mr(Ct({},t,{valueSpec:r.type?n[r.type]:r}))}function tn(t){var e=t.value,r=t.key,n=Kr(t);return n.length?n:(-1===e.indexOf("{fontstack}")&&n.push(new Pt(r,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&n.push(new Pt(r,e,'"glyphs" url must include a "{range}" token')),n)}function en(t,e){void 0===e&&(e=Tt);var r=[];return r=r.concat(Jr({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:tn,"*":function(){return[]}}})),t.constants&&(r=r.concat(Mt({key:"constants",value:t.constants,style:t,styleSpec:e}))),rn(r)}function rn(t){return[].concat(t).sort((function(t,e){return t.line-e.line}))}function nn(t){return function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return rn(t.apply(this,e))}}en.source=nn(Qr),en.light=nn(Yr),en.layer=nn(Xr),en.filter=nn(Wr),en.paintProperty=nn(qr),en.layoutProperty=nn(Zr);var on=en,an=on.light,sn=on.paintProperty,un=on.layoutProperty;function cn(t,e){var r=!1;if(e&&e.length)for(var n=0,i=e;n<i.length;n+=1){var o=i[n];t.fire(new St(new Error(o.message))),r=!0}return r}var ln=hn;function hn(t,e,r){var n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var i=new Int32Array(this.arrayBuffer);t=i[0],e=i[1],r=i[2],this.d=e+2*r;for(var o=0;o<this.d*this.d;o++){var a=i[3+o],s=i[3+o+1];n.push(a===s?null:i.subarray(a,s))}var u=i[3+n.length],c=i[3+n.length+1];this.keys=i.subarray(u,c),this.bboxes=i.subarray(c),this.insert=this._insertReadonly}else{this.d=e+2*r;for(var l=0;l<this.d*this.d;l++)n.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=r,this.scale=e/t,this.uid=0;var h=r/e*t;this.min=-h,this.max=t+h}hn.prototype.insert=function(t,e,r,n,i){this._forEachCell(e,r,n,i,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)},hn.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},hn.prototype._insertCell=function(t,e,r,n,i,o){this.cells[i].push(o)},hn.prototype.query=function(t,e,r,n,i){var o=this.min,a=this.max;if(t<=o&&e<=o&&a<=r&&a<=n&&!i)return Array.prototype.slice.call(this.keys);var s=[];return this._forEachCell(t,e,r,n,this._queryCell,s,{},i),s},hn.prototype._queryCell=function(t,e,r,n,i,o,a,s){var u=this.cells[i];if(null!==u)for(var c=this.keys,l=this.bboxes,h=0;h<u.length;h++){var f=u[h];if(void 0===a[f]){var p=4*f;(s?s(l[p+0],l[p+1],l[p+2],l[p+3]):t<=l[p+2]&&e<=l[p+3]&&r>=l[p+0]&&n>=l[p+1])?(a[f]=!0,o.push(c[f])):a[f]=!1}}},hn.prototype._forEachCell=function(t,e,r,n,i,o,a,s){for(var u=this._convertToCellCoord(t),c=this._convertToCellCoord(e),l=this._convertToCellCoord(r),h=this._convertToCellCoord(n),f=u;f<=l;f++)for(var p=c;p<=h;p++){var d=this.d*p+f;if((!s||s(this._convertFromCellCoord(f),this._convertFromCellCoord(p),this._convertFromCellCoord(f+1),this._convertFromCellCoord(p+1)))&&i.call(this,t,e,r,n,d,o,a,s))return}},hn.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},hn.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},hn.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=3+this.cells.length+1+1,r=0,n=0;n<this.cells.length;n++)r+=this.cells[n].length;var i=new Int32Array(e+r+this.keys.length+this.bboxes.length);i[0]=this.extent,i[1]=this.n,i[2]=this.padding;for(var o=e,a=0;a<t.length;a++){var s=t[a];i[3+a]=o,i.set(s,o),o+=s.length}return i[3+t.length]=o,i.set(this.keys,o),o+=this.keys.length,i[3+t.length+1]=o,i.set(this.bboxes,o),o+=this.bboxes.length,i.buffer};var fn=self.ImageData,pn={};function dn(t,e,r){void 0===r&&(r={}),Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),pn[t]={klass:e,omit:r.omit||[],shallow:r.shallow||[]}}for(var An in dn("Object",Object),ln.serialize=function(t,e){var r=t.toArrayBuffer();return e&&e.push(r),{buffer:r}},ln.deserialize=function(t){return new ln(t.buffer)},dn("Grid",ln),dn("Color",Yt),dn("Error",Error),dn("ResolvedImage",te),dn("StylePropertyFunction",Pr),dn("StyleExpression",xr,{omit:["_evaluator"]}),dn("ZoomDependentExpression",Or),dn("ZoomConstantExpression",Sr),dn("CompoundExpression",de,{omit:["_evaluate"]}),ir)ir[An]._classRegistryKey||dn("Expression_"+An,ir[An]);function gn(t){return t&&"undefined"!=typeof ArrayBuffer&&(t instanceof ArrayBuffer||t.constructor&&"ArrayBuffer"===t.constructor.name)}function mn(t,e){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp)return t;if(gn(t))return e&&e.push(t),t;if(ArrayBuffer.isView(t)){var r=t;return e&&e.push(r.buffer),r}if(t instanceof fn)return e&&e.push(t.data.buffer),t;if(Array.isArray(t)){for(var n=[],i=0,o=t;i<o.length;i+=1){var a=o[i];n.push(mn(a,e))}return n}if("object"==typeof t){var s=t.constructor,u=s._classRegistryKey;if(!u)throw new Error("can't serialize object of unregistered class");var c=s.serialize?s.serialize(t,e):{};if(!s.serialize){for(var l in t)if(t.hasOwnProperty(l)&&!(pn[u].omit.indexOf(l)>=0)){var h=t[l];c[l]=pn[u].shallow.indexOf(l)>=0?h:mn(h,e)}t instanceof Error&&(c.message=t.message)}if(c.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==u&&(c.$name=u),c}throw new Error("can't serialize object of type "+typeof t)}function yn(t){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||gn(t)||ArrayBuffer.isView(t)||t instanceof fn)return t;if(Array.isArray(t))return t.map(yn);if("object"==typeof t){var e=t.$name||"Object",r=pn[e].klass;if(!r)throw new Error("can't deserialize unregistered class "+e);if(r.deserialize)return r.deserialize(t);for(var n=Object.create(r.prototype),i=0,o=Object.keys(t);i<o.length;i+=1){var a=o[i];if("$name"!==a){var s=t[a];n[a]=pn[e].shallow.indexOf(a)>=0?s:yn(s)}}return n}throw new Error("can't deserialize object of type "+typeof t)}var vn=function(){this.first=!0};vn.prototype.update=function(t,e){var r=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoom<r&&(this.lastIntegerZoom=r,this.lastIntegerZoomTime=e),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=r,!0))};var _n={"Latin-1 Supplement":function(t){return t>=128&&t<=255},Arabic:function(t){return t>=1536&&t<=1791},"Arabic Supplement":function(t){return t>=1872&&t<=1919},"Arabic Extended-A":function(t){return t>=2208&&t<=2303},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},Khmer:function(t){return t>=6016&&t<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Arabic Presentation Forms-A":function(t){return t>=64336&&t<=65023},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Arabic Presentation Forms-B":function(t){return t>=65136&&t<=65279},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}};function bn(t){for(var e=0,r=t;e<r.length;e+=1)if(wn(r[e].charCodeAt(0)))return!0;return!1}function xn(t){return!(_n.Arabic(t)||_n["Arabic Supplement"](t)||_n["Arabic Extended-A"](t)||_n["Arabic Presentation Forms-A"](t)||_n["Arabic Presentation Forms-B"](t))}function wn(t){return!(746!==t&&747!==t&&(t<4352||!(_n["Bopomofo Extended"](t)||_n.Bopomofo(t)||_n["CJK Compatibility Forms"](t)&&!(t>=65097&&t<=65103)||_n["CJK Compatibility Ideographs"](t)||_n["CJK Compatibility"](t)||_n["CJK Radicals Supplement"](t)||_n["CJK Strokes"](t)||!(!_n["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||_n["CJK Unified Ideographs Extension A"](t)||_n["CJK Unified Ideographs"](t)||_n["Enclosed CJK Letters and Months"](t)||_n["Hangul Compatibility Jamo"](t)||_n["Hangul Jamo Extended-A"](t)||_n["Hangul Jamo Extended-B"](t)||_n["Hangul Jamo"](t)||_n["Hangul Syllables"](t)||_n.Hiragana(t)||_n["Ideographic Description Characters"](t)||_n.Kanbun(t)||_n["Kangxi Radicals"](t)||_n["Katakana Phonetic Extensions"](t)||_n.Katakana(t)&&12540!==t||!(!_n["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!_n["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||_n["Unified Canadian Aboriginal Syllabics"](t)||_n["Unified Canadian Aboriginal Syllabics Extended"](t)||_n["Vertical Forms"](t)||_n["Yijing Hexagram Symbols"](t)||_n["Yi Syllables"](t)||_n["Yi Radicals"](t))))}function En(t){return!(wn(t)||function(t){return!!(_n["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||_n["General Punctuation"](t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||_n["Letterlike Symbols"](t)||_n["Number Forms"](t)||_n["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||_n["Control Pictures"](t)&&9251!==t||_n["Optical Character Recognition"](t)||_n["Enclosed Alphanumerics"](t)||_n["Geometric Shapes"](t)||_n["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||_n["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||_n["CJK Symbols and Punctuation"](t)||_n.Katakana(t)||_n["Private Use Area"](t)||_n["CJK Compatibility Forms"](t)||_n["Small Form Variants"](t)||_n["Halfwidth and Fullwidth Forms"](t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}function Sn(t){return t>=1424&&t<=2303||_n["Arabic Presentation Forms-A"](t)||_n["Arabic Presentation Forms-B"](t)}function On(t,e){return!(!e&&Sn(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||_n.Khmer(t))}function Tn(t){for(var e=0,r=t;e<r.length;e+=1)if(Sn(r[e].charCodeAt(0)))return!0;return!1}var Pn="deferred",Mn="loading",Cn="loaded",In=null,kn="unavailable",Rn=null,Ln=function(t){In&&In(t)};function jn(){Dn.fire(new Et("pluginStateChange",{pluginStatus:kn,pluginURL:Rn}))}var Dn=new Ot,Bn=function(){return kn},Fn=function(){if(kn!==Pn||!Rn)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");kn=Mn,jn(),Rn&&vt({url:Rn},(function(t){t?Ln(t):(kn=Cn,jn())}))},zn={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return kn===Cn||null!=zn.applyArabicShaping},isLoading:function(){return kn===Mn},setState:function(t){kn=t.pluginStatus,Rn=t.pluginURL},isParsed:function(){return null!=zn.applyArabicShaping&&null!=zn.processBidirectionalText&&null!=zn.processStyledBidirectionalText},getPluginURL:function(){return Rn}},Nn=function(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new vn,this.transition={})};Nn.prototype.isSupportedScript=function(t){return function(t,e){for(var r=0,n=t;r<n.length;r+=1)if(!On(n[r].charCodeAt(0),e))return!1;return!0}(t,zn.isLoaded())},Nn.prototype.crossFadingFactor=function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},Nn.prototype.getCrossfadeParameters=function(){var t=this.zoom,e=t-Math.floor(t),r=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}};var Un=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(Ar(t))return new Pr(t,e);if(wr(t)){var r=Tr(t,e);if("error"===r.result)throw new Error(r.value.map((function(t){return t.key+": "+t.message})).join(", "));return r.value}var n=t;return"string"==typeof t&&"color"===e.type&&(n=Yt.parse(t)),{kind:"constant",evaluate:function(){return n}}}(void 0===e?t.specification.default:e,t.specification)};Un.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},Un.prototype.possiblyEvaluate=function(t,e){return this.property.possiblyEvaluate(this,t,e)};var Vn=function(t){this.property=t,this.value=new Un(t,void 0)};Vn.prototype.transitioned=function(t,e){return new Wn(this.property,this.value,e,h({},t.transition,this.transition),t.now)},Vn.prototype.untransitioned=function(){return new Wn(this.property,this.value,null,{},0)};var Gn=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};Gn.prototype.getValue=function(t){return _(this._values[t].value.value)},Gn.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Vn(this._values[t].property)),this._values[t].value=new Un(this._values[t].property,null===e?void 0:_(e))},Gn.prototype.getTransition=function(t){return _(this._values[t].transition)},Gn.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Vn(this._values[t].property)),this._values[t].transition=_(e)||void 0},Gn.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);e<r.length;e+=1){var n=r[e],i=this.getValue(n);void 0!==i&&(t[n]=i);var o=this.getTransition(n);void 0!==o&&(t[n+"-transition"]=o)}return t},Gn.prototype.transitioned=function(t,e){for(var r=new Hn(this._properties),n=0,i=Object.keys(this._values);n<i.length;n+=1){var o=i[n];r._values[o]=this._values[o].transitioned(t,e._values[o])}return r},Gn.prototype.untransitioned=function(){for(var t=new Hn(this._properties),e=0,r=Object.keys(this._values);e<r.length;e+=1){var n=r[e];t._values[n]=this._values[n].untransitioned()}return t};var Wn=function(t,e,r,n,i){this.property=t,this.value=e,this.begin=i+n.delay||0,this.end=this.begin+n.duration||0,t.specification.transition&&(n.delay||n.duration)&&(this.prior=r)};Wn.prototype.possiblyEvaluate=function(t,e){var r=t.now||0,n=this.value.possiblyEvaluate(t,e),i=this.prior;if(i){if(r>this.end)return this.prior=null,n;if(this.value.isDataDriven())return this.prior=null,n;if(r<this.begin)return i.possiblyEvaluate(t,e);var o=(r-this.begin)/(this.end-this.begin);return this.property.interpolate(i.possiblyEvaluate(t,e),n,function(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}(o))}return n};var Hn=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};Hn.prototype.possiblyEvaluate=function(t,e){for(var r=new Xn(this._properties),n=0,i=Object.keys(this._values);n<i.length;n+=1){var o=i[n];r._values[o]=this._values[o].possiblyEvaluate(t,e)}return r},Hn.prototype.hasTransition=function(){for(var t=0,e=Object.keys(this._values);t<e.length;t+=1){var r=e[t];if(this._values[r].prior)return!0}return!1};var qn=function(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)};qn.prototype.getValue=function(t){return _(this._values[t].value)},qn.prototype.setValue=function(t,e){this._values[t]=new Un(this._values[t].property,null===e?void 0:_(e))},qn.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);e<r.length;e+=1){var n=r[e],i=this.getValue(n);void 0!==i&&(t[n]=i)}return t},qn.prototype.possiblyEvaluate=function(t,e){for(var r=new Xn(this._properties),n=0,i=Object.keys(this._values);n<i.length;n+=1){var o=i[n];r._values[o]=this._values[o].possiblyEvaluate(t,e)}return r};var Zn=function(t,e,r){this.property=t,this.value=e,this.parameters=r};Zn.prototype.isConstant=function(){return"constant"===this.value.kind},Zn.prototype.constantOr=function(t){return"constant"===this.value.kind?this.value.value:t},Zn.prototype.evaluate=function(t,e,r){return this.property.evaluate(this.value,this.parameters,t,e,r)};var Xn=function(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)};Xn.prototype.get=function(t){return this._values[t]};var Qn=function(t){this.specification=t};Qn.prototype.possiblyEvaluate=function(t,e){return t.expression.evaluate(e)},Qn.prototype.interpolate=function(t,e,r){var n=Ee[this.specification.type];return n?n(t,e,r):t};var Yn=function(t,e){this.specification=t,this.overrides=e};Yn.prototype.possiblyEvaluate=function(t,e,r){return"constant"===t.expression.kind||"camera"===t.expression.kind?new Zn(this,{kind:"constant",value:t.expression.evaluate(e,null,{},r)},e):new Zn(this,t.expression,e)},Yn.prototype.interpolate=function(t,e,r){if("constant"!==t.value.kind||"constant"!==e.value.kind)return t;if(void 0===t.value.value||void 0===e.value.value)return new Zn(this,{kind:"constant",value:void 0},t.parameters);var n=Ee[this.specification.type];return n?new Zn(this,{kind:"constant",value:n(t.value.value,e.value.value,r)},t.parameters):t},Yn.prototype.evaluate=function(t,e,r,n,i){return"constant"===t.kind?t.value:t.evaluate(e,r,n,i)};var Kn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.possiblyEvaluate=function(t,e,r){if(void 0===t.value)return new Zn(this,{kind:"constant",value:void 0},e);if("constant"===t.expression.kind){var n=t.expression.evaluate(e,null,{},r),i="resolvedImage"===t.property.specification.type&&"string"!=typeof n?n.name:n,o=this._calculate(i,i,i,e);return new Zn(this,{kind:"constant",value:o},e)}if("camera"===t.expression.kind){var a=this._calculate(t.expression.evaluate({zoom:e.zoom-1}),t.expression.evaluate({zoom:e.zoom}),t.expression.evaluate({zoom:e.zoom+1}),e);return new Zn(this,{kind:"constant",value:a},e)}return new Zn(this,t.expression,e)},e.prototype.evaluate=function(t,e,r,n,i){if("source"===t.kind){var o=t.evaluate(e,r,n,i);return this._calculate(o,o,o,e)}return"composite"===t.kind?this._calculate(t.evaluate({zoom:Math.floor(e.zoom)-1},r,n),t.evaluate({zoom:Math.floor(e.zoom)},r,n),t.evaluate({zoom:Math.floor(e.zoom)+1},r,n),e):t.value},e.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},e.prototype.interpolate=function(t){return t},e}(Yn),$n=function(t){this.specification=t};$n.prototype.possiblyEvaluate=function(t,e,r){if(void 0!==t.value){if("constant"===t.expression.kind){var n=t.expression.evaluate(e,null,{},r);return this._calculate(n,n,n,e)}return this._calculate(t.expression.evaluate(new Nn(Math.floor(e.zoom-1),e)),t.expression.evaluate(new Nn(Math.floor(e.zoom),e)),t.expression.evaluate(new Nn(Math.floor(e.zoom+1),e)),e)}},$n.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},$n.prototype.interpolate=function(t){return t};var Jn=function(t){this.specification=t};Jn.prototype.possiblyEvaluate=function(t,e,r){return!!t.expression.evaluate(e,null,{},r)},Jn.prototype.interpolate=function(){return!1};var ti=function(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],t){var r=t[e];r.specification.overridable&&this.overridableProperties.push(e);var n=this.defaultPropertyValues[e]=new Un(r,void 0),i=this.defaultTransitionablePropertyValues[e]=new Vn(r);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({})}};dn("DataDrivenProperty",Yn),dn("DataConstantProperty",Qn),dn("CrossFadedDataDrivenProperty",Kn),dn("CrossFadedProperty",$n),dn("ColorRampProperty",Jn);var ei=function(t){function e(e,r){if(t.call(this),this.id=e.id,this.type=e.type,this._featureFilter=function(){return!0},"custom"!==e.type&&(e=e,this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),r.layout&&(this._unevaluatedLayout=new qn(r.layout)),r.paint)){for(var n in this._transitionablePaint=new Gn(r.paint),e.paint)this.setPaintProperty(n,e.paint[n],{validate:!1});for(var i in e.layout)this.setLayoutProperty(i,e.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned()}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},e.prototype.getLayoutProperty=function(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)},e.prototype.setLayoutProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e){var n="layers."+this.id+".layout."+t;if(this._validate(un,n,t,e,r))return}"visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e},e.prototype.getPaintProperty=function(t){return m(t,"-transition")?this._transitionablePaint.getTransition(t.slice(0,-"-transition".length)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e){var n="layers."+this.id+".paint."+t;if(this._validate(sn,n,t,e,r))return!1}if(m(t,"-transition"))return this._transitionablePaint.setTransition(t.slice(0,-"-transition".length),e||void 0),!1;var i=this._transitionablePaint._values[t],o="cross-faded-data-driven"===i.property.specification["property-type"],a=i.value.isDataDriven(),s=i.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var u=this._transitionablePaint._values[t].value;return u.isDataDriven()||a||o||this._handleOverridablePaintPropertyUpdate(t,s,u)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype._handleOverridablePaintPropertyUpdate=function(t,e,r){return!1},e.prototype.isHidden=function(t){return!!(this.minzoom&&t<this.minzoom)||!!(this.maxzoom&&t>=this.maxzoom)||"none"===this.visibility},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,e)},e.prototype.serialize=function(){var t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),v(t,(function(t,e){return!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)}))},e.prototype._validate=function(t,e,r,n,i){return void 0===i&&(i={}),(!i||!1!==i.validate)&&cn(this,t.call(on,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:Tt,style:{glyphs:!0,sprite:!0}}))},e.prototype.is3D=function(){return!1},e.prototype.isTileClipped=function(){return!1},e.prototype.hasOffscreenPass=function(){return!1},e.prototype.resize=function(){},e.prototype.isStateDependent=function(){for(var t in this.paint._values){var e=this.paint.get(t);if(e instanceof Zn&&hr(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1},e}(Ot),ri={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},ni=function(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},ii=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function oi(t,e){void 0===e&&(e=1);var r=0,n=0;return{members:t.map((function(t){var i,o=(i=t.type,ri[i].BYTES_PER_ELEMENT),a=r=ai(r,Math.max(e,o)),s=t.components||1;return n=Math.max(n,o),r+=o*s,{name:t.name,type:t.type,components:s,offset:a}})),size:ai(r,Math.max(n,e)),alignment:e}}function ai(t,e){return Math.ceil(t/e)*e}ii.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},ii.deserialize=function(t){var e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e},ii.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},ii.prototype.clear=function(){this.length=0},ii.prototype.resize=function(t){this.reserve(t),this.length=t},ii.prototype.reserve=function(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},ii.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var si=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.int16[n+0]=e,this.int16[n+1]=r,t},e}(ii);si.prototype.bytesPerElement=4,dn("StructArrayLayout2i4",si);var ui=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var o=4*t;return this.int16[o+0]=e,this.int16[o+1]=r,this.int16[o+2]=n,this.int16[o+3]=i,t},e}(ii);ui.prototype.bytesPerElement=8,dn("StructArrayLayout4i8",ui);var ci=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,o)},e.prototype.emplace=function(t,e,r,n,i,o,a){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=o,this.int16[s+5]=a,t},e}(ii);ci.prototype.bytesPerElement=12,dn("StructArrayLayout2i4i12",ci);var li=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,o)},e.prototype.emplace=function(t,e,r,n,i,o,a){var s=4*t,u=8*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.uint8[u+4]=n,this.uint8[u+5]=i,this.uint8[u+6]=o,this.uint8[u+7]=a,t},e}(ii);li.prototype.bytesPerElement=8,dn("StructArrayLayout2i4ub8",li);var hi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s){var u=this.length;return this.resize(u+1),this.emplace(u,t,e,r,n,i,o,a,s)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u){var c=8*t;return this.uint16[c+0]=e,this.uint16[c+1]=r,this.uint16[c+2]=n,this.uint16[c+3]=i,this.uint16[c+4]=o,this.uint16[c+5]=a,this.uint16[c+6]=s,this.uint16[c+7]=u,t},e}(ii);hi.prototype.bytesPerElement=16,dn("StructArrayLayout8ui16",hi);var fi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s,u,c,l,h){var f=this.length;return this.resize(f+1),this.emplace(f,t,e,r,n,i,o,a,s,u,c,l,h)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,c,l,h,f){var p=12*t;return this.int16[p+0]=e,this.int16[p+1]=r,this.int16[p+2]=n,this.int16[p+3]=i,this.uint16[p+4]=o,this.uint16[p+5]=a,this.uint16[p+6]=s,this.uint16[p+7]=u,this.int16[p+8]=c,this.int16[p+9]=l,this.int16[p+10]=h,this.int16[p+11]=f,t},e}(ii);fi.prototype.bytesPerElement=24,dn("StructArrayLayout4i4ui4i24",fi);var pi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.float32[i+0]=e,this.float32[i+1]=r,this.float32[i+2]=n,t},e}(ii);pi.prototype.bytesPerElement=12,dn("StructArrayLayout3f12",pi);var di=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.uint32[r+0]=e,t},e}(ii);di.prototype.bytesPerElement=4,dn("StructArrayLayout1ul4",di);var Ai=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s,u,c,l){var h=this.length;return this.resize(h+1),this.emplace(h,t,e,r,n,i,o,a,s,u,c,l)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,c,l,h){var f=12*t,p=6*t;return this.int16[f+0]=e,this.int16[f+1]=r,this.int16[f+2]=n,this.int16[f+3]=i,this.int16[f+4]=o,this.int16[f+5]=a,this.uint32[p+3]=s,this.uint16[f+8]=u,this.uint16[f+9]=c,this.int16[f+10]=l,this.int16[f+11]=h,t},e}(ii);Ai.prototype.bytesPerElement=24,dn("StructArrayLayout6i1ul2ui2i24",Ai);var gi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,o)},e.prototype.emplace=function(t,e,r,n,i,o,a){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=o,this.int16[s+5]=a,t},e}(ii);gi.prototype.bytesPerElement=12,dn("StructArrayLayout2i2i2i12",gi);var mi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var o=12*t,a=3*t;return this.uint8[o+0]=e,this.uint8[o+1]=r,this.float32[a+1]=n,this.float32[a+2]=i,t},e}(ii);mi.prototype.bytesPerElement=12,dn("StructArrayLayout2ub2f12",mi);var yi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s,u,c,l,h,f,p,d,A,g){var m=this.length;return this.resize(m+1),this.emplace(m,t,e,r,n,i,o,a,s,u,c,l,h,f,p,d,A,g)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,c,l,h,f,p,d,A,g,m){var y=24*t,v=12*t,_=48*t;return this.int16[y+0]=e,this.int16[y+1]=r,this.uint16[y+2]=n,this.uint16[y+3]=i,this.uint32[v+2]=o,this.uint32[v+3]=a,this.uint32[v+4]=s,this.uint16[y+10]=u,this.uint16[y+11]=c,this.uint16[y+12]=l,this.float32[v+7]=h,this.float32[v+8]=f,this.uint8[_+36]=p,this.uint8[_+37]=d,this.uint8[_+38]=A,this.uint32[v+10]=g,this.int16[y+22]=m,t},e}(ii);yi.prototype.bytesPerElement=48,dn("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",yi);var vi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s,u,c,l,h,f,p,d,A,g,m,y,v,_,b,x,w,E,S){var O=this.length;return this.resize(O+1),this.emplace(O,t,e,r,n,i,o,a,s,u,c,l,h,f,p,d,A,g,m,y,v,_,b,x,w,E,S)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,c,l,h,f,p,d,A,g,m,y,v,_,b,x,w,E,S,O){var T=30*t,P=15*t;return this.int16[T+0]=e,this.int16[T+1]=r,this.int16[T+2]=n,this.int16[T+3]=i,this.int16[T+4]=o,this.int16[T+5]=a,this.int16[T+6]=s,this.int16[T+7]=u,this.uint16[T+8]=c,this.uint16[T+9]=l,this.uint16[T+10]=h,this.uint16[T+11]=f,this.uint16[T+12]=p,this.uint16[T+13]=d,this.uint16[T+14]=A,this.uint16[T+15]=g,this.uint16[T+16]=m,this.uint16[T+17]=y,this.uint16[T+18]=v,this.uint16[T+19]=_,this.uint16[T+20]=b,this.uint16[T+21]=x,this.uint32[P+11]=w,this.float32[P+12]=E,this.float32[P+13]=S,this.float32[P+14]=O,t},e}(ii);vi.prototype.bytesPerElement=60,dn("StructArrayLayout8i14ui1ul3f60",vi);var _i=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.float32[r+0]=e,t},e}(ii);_i.prototype.bytesPerElement=4,dn("StructArrayLayout1f4",_i);var bi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.int16[i+0]=e,this.int16[i+1]=r,this.int16[i+2]=n,t},e}(ii);bi.prototype.bytesPerElement=6,dn("StructArrayLayout3i6",bi);var xi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=2*t,o=4*t;return this.uint32[i+0]=e,this.uint16[o+2]=r,this.uint16[o+3]=n,t},e}(ii);xi.prototype.bytesPerElement=8,dn("StructArrayLayout1ul2ui8",xi);var wi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.uint16[i+0]=e,this.uint16[i+1]=r,this.uint16[i+2]=n,t},e}(ii);wi.prototype.bytesPerElement=6,dn("StructArrayLayout3ui6",wi);var Ei=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.uint16[n+0]=e,this.uint16[n+1]=r,t},e}(ii);Ei.prototype.bytesPerElement=4,dn("StructArrayLayout2ui4",Ei);var Si=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.uint16[r+0]=e,t},e}(ii);Si.prototype.bytesPerElement=2,dn("StructArrayLayout1ui2",Si);var Oi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.float32[n+0]=e,this.float32[n+1]=r,t},e}(ii);Oi.prototype.bytesPerElement=8,dn("StructArrayLayout2f8",Oi);var Ti=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var o=4*t;return this.float32[o+0]=e,this.float32[o+1]=r,this.float32[o+2]=n,this.float32[o+3]=i,t},e}(ii);Ti.prototype.bytesPerElement=16,dn("StructArrayLayout4f16",Ti);var Pi=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},radius:{configurable:!0},signedDistanceFromAnchor:{configurable:!0},anchorPoint:{configurable:!0}};return r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointX.set=function(t){this._structArray.int16[this._pos2+0]=t},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.anchorPointY.set=function(t){this._structArray.int16[this._pos2+1]=t},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.x1.set=function(t){this._structArray.int16[this._pos2+2]=t},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.y1.set=function(t){this._structArray.int16[this._pos2+3]=t},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.x2.set=function(t){this._structArray.int16[this._pos2+4]=t},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.y2.set=function(t){this._structArray.int16[this._pos2+5]=t},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.featureIndex.set=function(t){this._structArray.uint32[this._pos4+3]=t},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.sourceLayerIndex.set=function(t){this._structArray.uint16[this._pos2+8]=t},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.bucketIndex.set=function(t){this._structArray.uint16[this._pos2+9]=t},r.radius.get=function(){return this._structArray.int16[this._pos2+10]},r.radius.set=function(t){this._structArray.int16[this._pos2+10]=t},r.signedDistanceFromAnchor.get=function(){return this._structArray.int16[this._pos2+11]},r.signedDistanceFromAnchor.set=function(t){this._structArray.int16[this._pos2+11]=t},r.anchorPoint.get=function(){return new i(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,r),e}(ni);Pi.prototype.size=24;var Mi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new Pi(this,t)},e}(Ai);dn("CollisionBoxArray",Mi);var Ci=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorX.set=function(t){this._structArray.int16[this._pos2+0]=t},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.anchorY.set=function(t){this._structArray.int16[this._pos2+1]=t},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.glyphStartIndex.set=function(t){this._structArray.uint16[this._pos2+2]=t},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.numGlyphs.set=function(t){this._structArray.uint16[this._pos2+3]=t},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.vertexStartIndex.set=function(t){this._structArray.uint32[this._pos4+2]=t},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineStartIndex.set=function(t){this._structArray.uint32[this._pos4+3]=t},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.lineLength.set=function(t){this._structArray.uint32[this._pos4+4]=t},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.segment.set=function(t){this._structArray.uint16[this._pos2+10]=t},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.lowerSize.set=function(t){this._structArray.uint16[this._pos2+11]=t},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.upperSize.set=function(t){this._structArray.uint16[this._pos2+12]=t},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetX.set=function(t){this._structArray.float32[this._pos4+7]=t},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.lineOffsetY.set=function(t){this._structArray.float32[this._pos4+8]=t},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.writingMode.set=function(t){this._structArray.uint8[this._pos1+36]=t},r.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},r.placedOrientation.set=function(t){this._structArray.uint8[this._pos1+37]=t},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(t){this._structArray.uint8[this._pos1+38]=t},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+10]=t},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},r.associatedIconIndex.set=function(t){this._structArray.int16[this._pos2+22]=t},Object.defineProperties(e.prototype,r),e}(ni);Ci.prototype.size=48;var Ii=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new Ci(this,t)},e}(yi);dn("PlacedSymbolArray",Ii);var ki=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorX.set=function(t){this._structArray.int16[this._pos2+0]=t},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.anchorY.set=function(t){this._structArray.int16[this._pos2+1]=t},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.rightJustifiedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+2]=t},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.centerJustifiedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+3]=t},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.leftJustifiedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+4]=t},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.verticalPlacedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+5]=t},r.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},r.placedIconSymbolIndex.set=function(t){this._structArray.int16[this._pos2+6]=t},r.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},r.verticalPlacedIconSymbolIndex.set=function(t){this._structArray.int16[this._pos2+7]=t},r.key.get=function(){return this._structArray.uint16[this._pos2+8]},r.key.set=function(t){this._structArray.uint16[this._pos2+8]=t},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.textBoxStartIndex.set=function(t){this._structArray.uint16[this._pos2+9]=t},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.textBoxEndIndex.set=function(t){this._structArray.uint16[this._pos2+10]=t},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.verticalTextBoxStartIndex.set=function(t){this._structArray.uint16[this._pos2+11]=t},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.verticalTextBoxEndIndex.set=function(t){this._structArray.uint16[this._pos2+12]=t},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.iconBoxStartIndex.set=function(t){this._structArray.uint16[this._pos2+13]=t},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},r.iconBoxEndIndex.set=function(t){this._structArray.uint16[this._pos2+14]=t},r.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},r.verticalIconBoxStartIndex.set=function(t){this._structArray.uint16[this._pos2+15]=t},r.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},r.verticalIconBoxEndIndex.set=function(t){this._structArray.uint16[this._pos2+16]=t},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},r.featureIndex.set=function(t){this._structArray.uint16[this._pos2+17]=t},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},r.numHorizontalGlyphVertices.set=function(t){this._structArray.uint16[this._pos2+18]=t},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},r.numVerticalGlyphVertices.set=function(t){this._structArray.uint16[this._pos2+19]=t},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},r.numIconVertices.set=function(t){this._structArray.uint16[this._pos2+20]=t},r.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},r.numVerticalIconVertices.set=function(t){this._structArray.uint16[this._pos2+21]=t},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+11]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+11]=t},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+12]},r.textBoxScale.set=function(t){this._structArray.float32[this._pos4+12]=t},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset0.set=function(t){this._structArray.float32[this._pos4+13]=t},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+14]},r.textOffset1.set=function(t){this._structArray.float32[this._pos4+14]=t},Object.defineProperties(e.prototype,r),e}(ni);ki.prototype.size=60;var Ri=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new ki(this,t)},e}(vi);dn("SymbolInstanceArray",Ri);var Li=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={offsetX:{configurable:!0}};return r.offsetX.get=function(){return this._structArray.float32[this._pos4+0]},r.offsetX.set=function(t){this._structArray.float32[this._pos4+0]=t},Object.defineProperties(e.prototype,r),e}(ni);Li.prototype.size=4;var ji=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e.prototype.get=function(t){return new Li(this,t)},e}(_i);dn("GlyphOffsetArray",ji);var Di=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={x:{configurable:!0},y:{configurable:!0},tileUnitDistanceFromAnchor:{configurable:!0}};return r.x.get=function(){return this._structArray.int16[this._pos2+0]},r.x.set=function(t){this._structArray.int16[this._pos2+0]=t},r.y.get=function(){return this._structArray.int16[this._pos2+1]},r.y.set=function(t){this._structArray.int16[this._pos2+1]=t},r.tileUnitDistanceFromAnchor.get=function(){return this._structArray.int16[this._pos2+2]},r.tileUnitDistanceFromAnchor.set=function(t){this._structArray.int16[this._pos2+2]=t},Object.defineProperties(e.prototype,r),e}(ni);Di.prototype.size=6;var Bi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getx=function(t){return this.int16[3*t+0]},e.prototype.gety=function(t){return this.int16[3*t+1]},e.prototype.gettileUnitDistanceFromAnchor=function(t){return this.int16[3*t+2]},e.prototype.get=function(t){return new Di(this,t)},e}(bi);dn("SymbolLineVertexArray",Bi);var Fi=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.featureIndex.set=function(t){this._structArray.uint32[this._pos4+0]=t},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.sourceLayerIndex.set=function(t){this._structArray.uint16[this._pos2+2]=t},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},r.bucketIndex.set=function(t){this._structArray.uint16[this._pos2+3]=t},Object.defineProperties(e.prototype,r),e}(ni);Fi.prototype.size=8;var zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new Fi(this,t)},e}(xi);dn("FeatureIndexArray",zi);var Ni=oi([{name:"a_pos",components:2,type:"Int16"}],4).members,Ui=function(t){void 0===t&&(t=[]),this.segments=t};function Vi(t,e){return 256*(t=c(Math.floor(t),0,255))+c(Math.floor(e),0,255)}Ui.prototype.prepareSegment=function(t,e,r,n){var i=this.segments[this.segments.length-1];return t>Ui.MAX_VERTEX_ARRAY_LENGTH&&x("Max vertices per segment is "+Ui.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!i||i.vertexLength+t>Ui.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==n)&&(i={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==n&&(i.sortKey=n),this.segments.push(i)),i},Ui.prototype.get=function(){return this.segments},Ui.prototype.destroy=function(){for(var t=0,e=this.segments;t<e.length;t+=1){var r=e[t];for(var n in r.vaos)r.vaos[n].destroy()}},Ui.simpleSegment=function(t,e,r,n){return new Ui([{vertexOffset:t,primitiveOffset:e,vertexLength:r,primitiveLength:n,vaos:{},sortKey:0}])},Ui.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,dn("SegmentVector",Ui);var Gi=function(){this.ids=[],this.positions=[],this.indexed=!1};function Wi(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}Gi.prototype.add=function(t,e,r,n){this.ids.push(t),this.positions.push(e,r,n)},Gi.prototype.getPositions=function(t){for(var e=0,r=this.ids.length-1;e<r;){var n=e+r>>1;this.ids[n]>=t?r=n:e=n+1}for(var i=[];this.ids[e]===t;){var o=this.positions[3*e],a=this.positions[3*e+1],s=this.positions[3*e+2];i.push({index:o,start:a,end:s}),e++}return i},Gi.serialize=function(t,e){var r=new Float64Array(t.ids),n=new Uint32Array(t.positions);return function t(e,r,n,i){if(!(n>=i)){for(var o=e[n+i>>1],a=n-1,s=i+1;;){do{a++}while(e[a]<o);do{s--}while(e[s]>o);if(a>=s)break;Wi(e,a,s),Wi(r,3*a,3*s),Wi(r,3*a+1,3*s+1),Wi(r,3*a+2,3*s+2)}t(e,r,n,s),t(e,r,s+1,i)}}(r,n,0,r.length-1),e&&e.push(r.buffer,n.buffer),{ids:r,positions:n}},Gi.deserialize=function(t){var e=new Gi;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e},dn("FeaturePositionMap",Gi);var Hi=function(t,e){this.gl=t.gl,this.location=e},qi=function(t){function e(e,r){t.call(this,e,r),this.current=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1i(this.location,t))},e}(Hi),Zi=function(t){function e(e,r){t.call(this,e,r),this.current=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))},e}(Hi),Xi=function(t){function e(e,r){t.call(this,e,r),this.current=[0,0]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]||(this.current=t,this.gl.uniform2f(this.location,t[0],t[1]))},e}(Hi),Qi=function(t){function e(e,r){t.call(this,e,r),this.current=[0,0,0]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]||(this.current=t,this.gl.uniform3f(this.location,t[0],t[1],t[2]))},e}(Hi),Yi=function(t){function e(e,r){t.call(this,e,r),this.current=[0,0,0,0]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]&&t[3]===this.current[3]||(this.current=t,this.gl.uniform4f(this.location,t[0],t[1],t[2],t[3]))},e}(Hi),Ki=function(t){function e(e,r){t.call(this,e,r),this.current=Yt.transparent}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){t.r===this.current.r&&t.g===this.current.g&&t.b===this.current.b&&t.a===this.current.a||(this.current=t,this.gl.uniform4f(this.location,t.r,t.g,t.b,t.a))},e}(Hi),$i=new Float32Array(16),Ji=function(t){function e(e,r){t.call(this,e,r),this.current=$i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){if(t[12]!==this.current[12]||t[0]!==this.current[0])return this.current=t,void this.gl.uniformMatrix4fv(this.location,!1,t);for(var e=1;e<16;e++)if(t[e]!==this.current[e]){this.current=t,this.gl.uniformMatrix4fv(this.location,!1,t);break}},e}(Hi);function to(t){return[Vi(255*t.r,255*t.g),Vi(255*t.b,255*t.a)]}var eo=function(t,e,r){this.value=t,this.names=e,this.uniformNames=this.names.map((function(t){return"u_"+t})),this.type=r,this.maxValue=-1/0};eo.prototype.defines=function(){return this.names.map((function(t){return"#define HAS_UNIFORM_u_"+t}))},eo.prototype.setConstantPatternPositions=function(){},eo.prototype.populatePaintArray=function(){},eo.prototype.updatePaintArray=function(){},eo.prototype.upload=function(){},eo.prototype.destroy=function(){},eo.prototype.setUniforms=function(t,e,r,n){e.set(n.constantOr(this.value))},eo.prototype.getBinding=function(t,e){return"color"===this.type?new Ki(t,e):new Zi(t,e)},eo.serialize=function(t){var e=t.value,r=t.names,n=t.type;return{value:mn(e),names:r,type:n}},eo.deserialize=function(t){var e=t.value,r=t.names,n=t.type;return new eo(yn(e),r,n)};var ro=function(t,e,r){this.value=t,this.names=e,this.uniformNames=this.names.map((function(t){return"u_"+t})),this.type=r,this.maxValue=-1/0,this.patternPositions={patternTo:null,patternFrom:null}};ro.prototype.defines=function(){return this.names.map((function(t){return"#define HAS_UNIFORM_u_"+t}))},ro.prototype.populatePaintArray=function(){},ro.prototype.updatePaintArray=function(){},ro.prototype.upload=function(){},ro.prototype.destroy=function(){},ro.prototype.setConstantPatternPositions=function(t,e){this.patternPositions.patternTo=t.tlbr,this.patternPositions.patternFrom=e.tlbr},ro.prototype.setUniforms=function(t,e,r,n,i){var o=this.patternPositions;"u_pattern_to"===i&&o.patternTo&&e.set(o.patternTo),"u_pattern_from"===i&&o.patternFrom&&e.set(o.patternFrom)},ro.prototype.getBinding=function(t,e){return new Yi(t,e)};var no=function(t,e,r,n){this.expression=t,this.names=e,this.type=r,this.uniformNames=this.names.map((function(t){return"a_"+t})),this.maxValue=-1/0,this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Float32",components:"color"===r?2:1,offset:0}})),this.paintVertexArray=new n};no.prototype.defines=function(){return[]},no.prototype.setConstantPatternPositions=function(){},no.prototype.populatePaintArray=function(t,e,r,n){var i=this.paintVertexArray,o=i.length;i.reserve(t);var a=this.expression.evaluate(new Nn(0),e,{},[],n);if("color"===this.type)for(var s=to(a),u=o;u<t;u++)i.emplaceBack(s[0],s[1]);else{for(var c=o;c<t;c++)i.emplaceBack(a);this.maxValue=Math.max(this.maxValue,a)}},no.prototype.updatePaintArray=function(t,e,r,n){var i=this.paintVertexArray,o=this.expression.evaluate({zoom:0},r,n);if("color"===this.type)for(var a=to(o),s=t;s<e;s++)i.emplace(s,a[0],a[1]);else{for(var u=t;u<e;u++)i.emplace(u,o);this.maxValue=Math.max(this.maxValue,o)}},no.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},no.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},no.prototype.setUniforms=function(t,e){e.set(0)},no.prototype.getBinding=function(t,e){return new Zi(t,e)};var io=function(t,e,r,n,i,o){this.expression=t,this.names=e,this.uniformNames=this.names.map((function(t){return"u_"+t+"_t"})),this.type=r,this.useIntegerZoom=n,this.zoom=i,this.maxValue=-1/0;var a=o;this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Float32",components:"color"===r?4:2,offset:0}})),this.paintVertexArray=new a};io.prototype.defines=function(){return[]},io.prototype.setConstantPatternPositions=function(){},io.prototype.populatePaintArray=function(t,e,r,n){var i=this.paintVertexArray,o=i.length;i.reserve(t);var a=this.expression.evaluate(new Nn(this.zoom),e,{},[],n),s=this.expression.evaluate(new Nn(this.zoom+1),e,{},[],n);if("color"===this.type)for(var u=to(a),c=to(s),l=o;l<t;l++)i.emplaceBack(u[0],u[1],c[0],c[1]);else{for(var h=o;h<t;h++)i.emplaceBack(a,s);this.maxValue=Math.max(this.maxValue,a,s)}},io.prototype.updatePaintArray=function(t,e,r,n){var i=this.paintVertexArray,o=this.expression.evaluate({zoom:this.zoom},r,n),a=this.expression.evaluate({zoom:this.zoom+1},r,n);if("color"===this.type)for(var s=to(o),u=to(a),c=t;c<e;c++)i.emplace(c,s[0],s[1],u[0],u[1]);else{for(var l=t;l<e;l++)i.emplace(l,o,a);this.maxValue=Math.max(this.maxValue,o,a)}},io.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},io.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},io.prototype.interpolationFactor=function(t){return this.useIntegerZoom&&(t=Math.floor(t)),c(this.expression.interpolationFactor(t,this.zoom,this.zoom+1),0,1)},io.prototype.setUniforms=function(t,e,r){e.set(this.interpolationFactor(r.zoom))},io.prototype.getBinding=function(t,e){return new Zi(t,e)};var oo=function(t,e,r,n,i,o,a){this.expression=t,this.names=e,this.type=r,this.uniformNames=this.names.map((function(t){return"u_"+t+"_t"})),this.useIntegerZoom=n,this.zoom=i,this.maxValue=-1/0,this.layerId=a,this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Uint16",components:4,offset:0}})),this.zoomInPaintVertexArray=new o,this.zoomOutPaintVertexArray=new o};oo.prototype.defines=function(){return[]},oo.prototype.setConstantPatternPositions=function(){},oo.prototype.populatePaintArray=function(t,e,r){var n=this.zoomInPaintVertexArray,i=this.zoomOutPaintVertexArray,o=this.layerId,a=n.length;if(n.reserve(t),i.reserve(t),r&&e.patterns&&e.patterns[o]){var s=e.patterns[o],u=s.min,c=s.mid,l=s.max,h=r[u],f=r[c],p=r[l];if(!h||!f||!p)return;for(var d=a;d<t;d++)n.emplaceBack(f.tl[0],f.tl[1],f.br[0],f.br[1],h.tl[0],h.tl[1],h.br[0],h.br[1]),i.emplaceBack(f.tl[0],f.tl[1],f.br[0],f.br[1],p.tl[0],p.tl[1],p.br[0],p.br[1])}},oo.prototype.updatePaintArray=function(t,e,r,n,i){var o=this.zoomInPaintVertexArray,a=this.zoomOutPaintVertexArray,s=this.layerId;if(i&&r.patterns&&r.patterns[s]){var u=r.patterns[s],c=u.min,l=u.mid,h=u.max,f=i[c],p=i[l],d=i[h];if(!f||!p||!d)return;for(var A=t;A<e;A++)o.emplace(A,p.tl[0],p.tl[1],p.br[0],p.br[1],f.tl[0],f.tl[1],f.br[0],f.br[1]),a.emplace(A,p.tl[0],p.tl[1],p.br[0],p.br[1],d.tl[0],d.tl[1],d.br[0],d.br[1])}},oo.prototype.upload=function(t){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},oo.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()},oo.prototype.setUniforms=function(t,e){e.set(0)},oo.prototype.getBinding=function(t,e){return new Zi(t,e)};var ao=function(){this.binders={},this.cacheKey="",this._buffers=[]};ao.createDynamic=function(t,e,r){var n=new ao,i=[];for(var o in t.paint._values)if(r(o)){var a=t.paint.get(o);if(a instanceof Zn&&hr(a.property.specification)){var s=uo(o,t.type),u=a.property.specification.type,c=a.property.useIntegerZoom;if("cross-faded"===a.property.specification["property-type"]||"cross-faded-data-driven"===a.property.specification["property-type"])if("constant"===a.value.kind)n.binders[o]=new ro(a.value.value,s,u),i.push("/u_"+o);else{var l=co(o,u,"source");n.binders[o]=new oo(a.value,s,u,c,e,l,t.id),i.push("/a_"+o)}else if("constant"===a.value.kind)n.binders[o]=new eo(a.value.value,s,u),i.push("/u_"+o);else if("source"===a.value.kind){var h=co(o,u,"source");n.binders[o]=new no(a.value,s,u,h),i.push("/a_"+o)}else{var f=co(o,u,"composite");n.binders[o]=new io(a.value,s,u,c,e,f),i.push("/z_"+o)}}}return n.cacheKey=i.sort().join(""),n},ao.prototype.populatePaintArrays=function(t,e,r,n,i){for(var o in this.binders)this.binders[o].populatePaintArray(t,e,n,i)},ao.prototype.setConstantPatternPositions=function(t,e){for(var r in this.binders)this.binders[r].setConstantPatternPositions(t,e)},ao.prototype.updatePaintArrays=function(t,e,r,n,i){var o=!1;for(var a in t)for(var s=0,u=e.getPositions(+a);s<u.length;s+=1){var c=u[s],l=r.feature(c.index);for(var h in this.binders){var f=this.binders[h];if(!(f instanceof eo||f instanceof ro)&&!0===f.expression.isStateDependent){var p=n.paint.get(h);f.expression=p.value,f.updatePaintArray(c.start,c.end,l,t[a],i),o=!0}}}return o},ao.prototype.defines=function(){var t=[];for(var e in this.binders)t.push.apply(t,this.binders[e].defines());return t},ao.prototype.getPaintVertexBuffers=function(){return this._buffers},ao.prototype.getUniforms=function(t,e){var r=[];for(var n in this.binders)for(var i=this.binders[n],o=0,a=i.uniformNames;o<a.length;o+=1){var s=a[o];if(e[s]){var u=i.getBinding(t,e[s]);r.push({name:s,property:n,binding:u})}}return r},ao.prototype.setUniforms=function(t,e,r,n){for(var i=0,o=e;i<o.length;i+=1){var a=o[i],s=a.name,u=a.property,c=a.binding;this.binders[u].setUniforms(t,c,n,r.get(u),s)}},ao.prototype.updatePatternPaintBuffers=function(t){var e=[];for(var r in this.binders){var n=this.binders[r];if(n instanceof oo){var i=2===t.fromScale?n.zoomInPaintVertexBuffer:n.zoomOutPaintVertexBuffer;i&&e.push(i)}else(n instanceof no||n instanceof io)&&n.paintVertexBuffer&&e.push(n.paintVertexBuffer)}this._buffers=e},ao.prototype.upload=function(t){for(var e in this.binders)this.binders[e].upload(t);var r=[];for(var n in this.binders){var i=this.binders[n];(i instanceof no||i instanceof io)&&i.paintVertexBuffer&&r.push(i.paintVertexBuffer)}this._buffers=r},ao.prototype.destroy=function(){for(var t in this.binders)this.binders[t].destroy()};var so=function(t,e,r,n){void 0===n&&(n=function(){return!0}),this.programConfigurations={};for(var i=0,o=e;i<o.length;i+=1){var a=o[i];this.programConfigurations[a.id]=ao.createDynamic(a,r,n),this.programConfigurations[a.id].layoutAttributes=t}this.needsUpload=!1,this._featureMap=new Gi,this._bufferOffset=0};function uo(t,e){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from"],"fill-pattern":["pattern_to","pattern_from"],"fill-extrusion-pattern":["pattern_to","pattern_from"]}[t]||[t.replace(e+"-","").replace(/-/g,"_")]}function co(t,e,r){var n={color:{source:Oi,composite:Ti},number:{source:_i,composite:Oi}},i=function(t){return{"line-pattern":{source:hi,composite:hi},"fill-pattern":{source:hi,composite:hi},"fill-extrusion-pattern":{source:hi,composite:hi}}[t]}(t);return i&&i[r]||n[e][r]}so.prototype.populatePaintArrays=function(t,e,r,n,i){for(var o in this.programConfigurations)this.programConfigurations[o].populatePaintArrays(t,e,r,n,i);void 0!==e.id&&this._featureMap.add(+e.id,r,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0},so.prototype.updatePaintArrays=function(t,e,r,n){for(var i=0,o=r;i<o.length;i+=1){var a=o[i];this.needsUpload=this.programConfigurations[a.id].updatePaintArrays(t,this._featureMap,e,a,n)||this.needsUpload}},so.prototype.get=function(t){return this.programConfigurations[t]},so.prototype.upload=function(t){if(this.needsUpload){for(var e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}},so.prototype.destroy=function(){for(var t in this.programConfigurations)this.programConfigurations[t].destroy()},dn("ConstantBinder",eo),dn("CrossFadedConstantBinder",ro),dn("SourceExpressionBinder",no),dn("CrossFadedCompositeBinder",oo),dn("CompositeExpressionBinder",io),dn("ProgramConfiguration",ao,{omit:["_buffers"]}),dn("ProgramConfigurationSet",so);var lo=8192,ho={min:-1*Math.pow(2,14),max:Math.pow(2,14)-1};function fo(t){for(var e=lo/t.extent,r=t.loadGeometry(),n=0;n<r.length;n++)for(var i=r[n],o=0;o<i.length;o++){var a=i[o];a.x=Math.round(a.x*e),a.y=Math.round(a.y*e),(a.x<ho.min||a.x>ho.max||a.y<ho.min||a.y>ho.max)&&(x("Geometry exceeds allowed extent, reduce your vector tile buffer size"),a.x=c(a.x,ho.min,ho.max),a.y=c(a.y,ho.min,ho.max))}return r}function po(t,e,r,n,i){t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)}var Ao=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new si,this.indexArray=new wi,this.segments=new Ui,this.programConfigurations=new so(Ni,t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function go(t,e){for(var r=0;r<t.length;r++)if(So(e,t[r]))return!0;for(var n=0;n<e.length;n++)if(So(t,e[n]))return!0;return!!_o(t,e)}function mo(t,e,r){return!!So(t,e)||!!xo(e,t,r)}function yo(t,e){if(1===t.length)return Eo(e,t[0]);for(var r=0;r<e.length;r++)for(var n=e[r],i=0;i<n.length;i++)if(So(t,n[i]))return!0;for(var o=0;o<t.length;o++)if(Eo(e,t[o]))return!0;for(var a=0;a<e.length;a++)if(_o(t,e[a]))return!0;return!1}function vo(t,e,r){if(t.length>1){if(_o(t,e))return!0;for(var n=0;n<e.length;n++)if(xo(e[n],t,r))return!0}for(var i=0;i<t.length;i++)if(xo(t[i],e,r))return!0;return!1}function _o(t,e){if(0===t.length||0===e.length)return!1;for(var r=0;r<t.length-1;r++)for(var n=t[r],i=t[r+1],o=0;o<e.length-1;o++)if(bo(n,i,e[o],e[o+1]))return!0;return!1}function bo(t,e,r,n){return w(t,r,n)!==w(e,r,n)&&w(t,e,r)!==w(t,e,n)}function xo(t,e,r){var n=r*r;if(1===e.length)return t.distSqr(e[0])<n;for(var i=1;i<e.length;i++)if(wo(t,e[i-1],e[i])<n)return!0;return!1}function wo(t,e,r){var n=e.distSqr(r);if(0===n)return t.distSqr(e);var i=((t.x-e.x)*(r.x-e.x)+(t.y-e.y)*(r.y-e.y))/n;return i<0?t.distSqr(e):i>1?t.distSqr(r):t.distSqr(r.sub(e)._mult(i)._add(e))}function Eo(t,e){for(var r,n,i,o=!1,a=0;a<t.length;a++)for(var s=0,u=(r=t[a]).length-1;s<r.length;u=s++)n=r[s],i=r[u],n.y>e.y!=i.y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(o=!o);return o}function So(t,e){for(var r=!1,n=0,i=t.length-1;n<t.length;i=n++){var o=t[n],a=t[i];o.y>e.y!=a.y>e.y&&e.x<(a.x-o.x)*(e.y-o.y)/(a.y-o.y)+o.x&&(r=!r)}return r}function Oo(t,e,r){var n=r[0],i=r[2];if(t.x<n.x&&e.x<n.x||t.x>i.x&&e.x>i.x||t.y<n.y&&e.y<n.y||t.y>i.y&&e.y>i.y)return!1;var o=w(t,e,r[0]);return o!==w(t,e,r[1])||o!==w(t,e,r[2])||o!==w(t,e,r[3])}function To(t,e,r){var n=e.paint.get(t).value;return"constant"===n.kind?n.value:r.programConfigurations.get(e.id).binders[t].maxValue}function Po(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Mo(t,e,r,n,o){if(!e[0]&&!e[1])return t;var a=i.convert(e)._mult(o);"viewport"===r&&a._rotate(-n);for(var s=[],u=0;u<t.length;u++){var c=t[u];s.push(c.sub(a))}return s}Ao.prototype.populate=function(t,e){var r=this.layers[0],n=[],i=null;"circle"===r.type&&(i=r.layout.get("circle-sort-key"));for(var o=0,a=t;o<a.length;o+=1){var s=a[o],u=s.feature,c=s.index,l=s.sourceLayerIndex;if(this.layers[0]._featureFilter(new Nn(this.zoom),u)){var h=fo(u),f=i?i.evaluate(u,{}):void 0,p={id:u.id,properties:u.properties,type:u.type,sourceLayerIndex:l,index:c,geometry:h,patterns:{},sortKey:f};n.push(p)}}i&&n.sort((function(t,e){return t.sortKey-e.sortKey}));for(var d=0,A=n;d<A.length;d+=1){var g=A[d],m=g,y=m.geometry,v=m.index,_=m.sourceLayerIndex,b=t[v].feature;this.addFeature(g,y,v),e.featureIndex.insert(b,y,v,_,this.index)}},Ao.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},Ao.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Ao.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Ao.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ni),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},Ao.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Ao.prototype.addFeature=function(t,e,r){for(var n=0,i=e;n<i.length;n+=1)for(var o=0,a=i[n];o<a.length;o+=1){var s=a[o],u=s.x,c=s.y;if(!(u<0||u>=lo||c<0||c>=lo)){var l=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),h=l.vertexLength;po(this.layoutVertexArray,u,c,-1,-1),po(this.layoutVertexArray,u,c,1,-1),po(this.layoutVertexArray,u,c,1,1),po(this.layoutVertexArray,u,c,-1,1),this.indexArray.emplaceBack(h,h+1,h+2),this.indexArray.emplaceBack(h,h+3,h+2),l.vertexLength+=4,l.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{})},dn("CircleBucket",Ao,{omit:["layers"]});var Co,Io=new ti({"circle-sort-key":new Yn(Tt.layout_circle["circle-sort-key"])}),ko={paint:new ti({"circle-radius":new Yn(Tt.paint_circle["circle-radius"]),"circle-color":new Yn(Tt.paint_circle["circle-color"]),"circle-blur":new Yn(Tt.paint_circle["circle-blur"]),"circle-opacity":new Yn(Tt.paint_circle["circle-opacity"]),"circle-translate":new Qn(Tt.paint_circle["circle-translate"]),"circle-translate-anchor":new Qn(Tt.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Qn(Tt.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Qn(Tt.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Yn(Tt.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Yn(Tt.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Yn(Tt.paint_circle["circle-stroke-opacity"])}),layout:Io},Ro="undefined"!=typeof Float32Array?Float32Array:Array;function Lo(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*a,t[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*a,t[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*a,t[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*a,t}Math.hypot||(Math.hypot=function(){for(var t=arguments,e=0,r=arguments.length;r--;)e+=t[r]*t[r];return Math.sqrt(e)}),Co=new Ro(3),Ro!=Float32Array&&(Co[0]=0,Co[1]=0,Co[2]=0),function(){var t=new Ro(4);Ro!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0)}();var jo=function(t){function e(e){t.call(this,e,ko)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new Ao(t)},e.prototype.queryRadius=function(t){var e=t;return To("circle-radius",this,e)+To("circle-stroke-width",this,e)+Po(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,o,a,s){for(var u=Mo(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),o.angle,a),c=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),l="map"===this.paint.get("circle-pitch-alignment"),h=l?u:function(t,e){return t.map((function(t){return Do(t,e)}))}(u,s),f=l?c*a:c,p=0,d=n;p<d.length;p+=1)for(var A=0,g=d[p];A<g.length;A+=1){var m=g[A],y=l?m:Do(m,s),v=f,_=Lo([],[m.x,m.y,0,1],s);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?v*=_[3]/o.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(v*=o.cameraToCenterDistance/_[3]),mo(h,y,v))return!0}return!1},e}(ei);function Do(t,e){var r=Lo([],[t.x,t.y,0,1],e);return new i(r[0]/r[3],r[1]/r[3])}var Bo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Ao);function Fo(t,e,r,n){var i=e.width,o=e.height;if(n){if(n instanceof Uint8ClampedArray)n=new Uint8Array(n.buffer);else if(n.length!==i*o*r)throw new RangeError("mismatched image size")}else n=new Uint8Array(i*o*r);return t.width=i,t.height=o,t.data=n,t}function zo(t,e,r){var n=e.width,i=e.height;if(n!==t.width||i!==t.height){var o=Fo({},{width:n,height:i},r);No(t,o,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,n),height:Math.min(t.height,i)},r),t.width=n,t.height=i,t.data=o.data}}function No(t,e,r,n,i,o){if(0===i.width||0===i.height)return e;if(i.width>t.width||i.height>t.height||r.x>t.width-i.width||r.y>t.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>e.width||i.height>e.height||n.x>e.width-i.width||n.y>e.height-i.height)throw new RangeError("out of range destination coordinates for image copy");for(var a=t.data,s=e.data,u=0;u<i.height;u++)for(var c=((r.y+u)*t.width+r.x)*o,l=((n.y+u)*e.width+n.x)*o,h=0;h<i.width*o;h++)s[l+h]=a[c+h];return e}dn("HeatmapBucket",Bo,{omit:["layers"]});var Uo=function(t,e){Fo(this,t,1,e)};Uo.prototype.resize=function(t){zo(this,t,1)},Uo.prototype.clone=function(){return new Uo({width:this.width,height:this.height},new Uint8Array(this.data))},Uo.copy=function(t,e,r,n,i){No(t,e,r,n,i,1)};var Vo=function(t,e){Fo(this,t,4,e)};Vo.prototype.resize=function(t){zo(this,t,4)},Vo.prototype.replace=function(t,e){e?this.data.set(t):t instanceof Uint8ClampedArray?this.data=new Uint8Array(t.buffer):this.data=t},Vo.prototype.clone=function(){return new Vo({width:this.width,height:this.height},new Uint8Array(this.data))},Vo.copy=function(t,e,r,n,i){No(t,e,r,n,i,4)},dn("AlphaImage",Uo),dn("RGBAImage",Vo);var Go={paint:new ti({"heatmap-radius":new Yn(Tt.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Yn(Tt.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Qn(Tt.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Jn(Tt.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Qn(Tt.paint_heatmap["heatmap-opacity"])})};function Wo(t,e){for(var r=new Uint8Array(1024),n={},i=0,o=0;i<256;i++,o+=4){n[e]=i/255;var a=t.evaluate(n);r[o+0]=Math.floor(255*a.r/a.a),r[o+1]=Math.floor(255*a.g/a.a),r[o+2]=Math.floor(255*a.b/a.a),r[o+3]=Math.floor(255*a.a)}return new Vo({width:256,height:1},r)}var Ho=function(t){function e(e){t.call(this,e,Go),this._updateColorRamp()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new Bo(t)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){"heatmap-color"===t&&this._updateColorRamp()},e.prototype._updateColorRamp=function(){var t=this._transitionablePaint._values["heatmap-color"].value.expression;this.colorRamp=Wo(t,"heatmapDensity"),this.colorRampTexture=null},e.prototype.resize=function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return!1},e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility},e}(ei),qo={paint:new ti({"hillshade-illumination-direction":new Qn(Tt.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Qn(Tt.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Qn(Tt.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Qn(Tt.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Qn(Tt.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Qn(Tt.paint_hillshade["hillshade-accent-color"])})},Zo=function(t){function e(e){t.call(this,e,qo)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility},e}(ei),Xo=oi([{name:"a_pos",components:2,type:"Int16"}],4).members,Qo=Ko,Yo=Ko;function Ko(t,e,r){r=r||2;var n,i,o,a,s,u,c,l=e&&e.length,h=l?e[0]*r:t.length,f=$o(t,0,h,r,!0),p=[];if(!f||f.next===f.prev)return p;if(l&&(f=function(t,e,r,n){var i,o,a,s=[];for(i=0,o=e.length;i<o;i++)(a=$o(t,e[i]*n,i<o-1?e[i+1]*n:t.length,n,!1))===a.next&&(a.steiner=!0),s.push(ca(a));for(s.sort(oa),i=0;i<s.length;i++)aa(s[i],r),r=Jo(r,r.next);return r}(t,e,f,r)),t.length>80*r){n=o=t[0],i=a=t[1];for(var d=r;d<h;d+=r)(s=t[d])<n&&(n=s),(u=t[d+1])<i&&(i=u),s>o&&(o=s),u>a&&(a=u);c=0!==(c=Math.max(o-n,a-i))?1/c:0}return ta(f,p,r,n,i,c),p}function $o(t,e,r,n,i){var o,a;if(i===xa(t,e,r,n)>0)for(o=e;o<r;o+=n)a=va(o,t[o],t[o+1],a);else for(o=r-n;o>=e;o-=n)a=va(o,t[o],t[o+1],a);return a&&pa(a,a.next)&&(_a(a),a=a.next),a}function Jo(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!pa(n,n.next)&&0!==fa(n.prev,n,n.next))n=n.next;else{if(_a(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function ta(t,e,r,n,i,o,a){if(t){!a&&o&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=ua(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,o,a,s,u,c=1;do{for(r=t,t=null,o=null,a=0;r;){for(a++,n=r,s=0,e=0;e<c&&(s++,n=n.nextZ);e++);for(u=c;s>0||u>0&&n;)0!==s&&(0===u||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,u--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;r=n}o.nextZ=null,c*=2}while(a>1)}(i)}(t,n,i,o);for(var s,u,c=t;t.prev!==t.next;)if(s=t.prev,u=t.next,o?ra(t,n,i,o):ea(t))e.push(s.i/r),e.push(t.i/r),e.push(u.i/r),_a(t),t=u.next,c=u.next;else if((t=u)===c){a?1===a?ta(t=na(Jo(t),e,r),e,r,n,i,o,2):2===a&&ia(t,e,r,n,i,o):ta(Jo(t),e,r,n,i,o,1);break}}}function ea(t){var e=t.prev,r=t,n=t.next;if(fa(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(la(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&fa(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function ra(t,e,r,n){var i=t.prev,o=t,a=t.next;if(fa(i,o,a)>=0)return!1;for(var s=i.x<o.x?i.x<a.x?i.x:a.x:o.x<a.x?o.x:a.x,u=i.y<o.y?i.y<a.y?i.y:a.y:o.y<a.y?o.y:a.y,c=i.x>o.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,l=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,h=ua(s,u,e,r,n),f=ua(c,l,e,r,n),p=t.prevZ,d=t.nextZ;p&&p.z>=h&&d&&d.z<=f;){if(p!==t.prev&&p!==t.next&&la(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&fa(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,d!==t.prev&&d!==t.next&&la(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&fa(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(;p&&p.z>=h;){if(p!==t.prev&&p!==t.next&&la(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&fa(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;d&&d.z<=f;){if(d!==t.prev&&d!==t.next&&la(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&fa(d.prev,d,d.next)>=0)return!1;d=d.nextZ}return!0}function na(t,e,r){var n=t;do{var i=n.prev,o=n.next.next;!pa(i,o)&&da(i,n,n.next,o)&&ma(i,o)&&ma(o,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(o.i/r),_a(n),_a(n.next),n=t=o),n=n.next}while(n!==t);return Jo(n)}function ia(t,e,r,n,i,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&ha(a,s)){var u=ya(a,s);return a=Jo(a,a.next),u=Jo(u,u.next),ta(a,e,r,n,i,o),void ta(u,e,r,n,i,o)}s=s.next}a=a.next}while(a!==t)}function oa(t,e){return t.x-e.x}function aa(t,e){if(e=function(t,e){var r,n=e,i=t.x,o=t.y,a=-1/0;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var s=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>a){if(a=s,s===i){if(o===n.y)return n;if(o===n.next.y)return n.next}r=n.x<n.next.x?n:n.next}}n=n.next}while(n!==e);if(!r)return null;if(i===a)return r;var u,c=r,l=r.x,h=r.y,f=1/0;n=r;do{i>=n.x&&n.x>=l&&i!==n.x&&la(o<h?i:a,o,l,h,o<h?a:i,o,n.x,n.y)&&(u=Math.abs(o-n.y)/(i-n.x),ma(n,t)&&(u<f||u===f&&(n.x>r.x||n.x===r.x&&sa(r,n)))&&(r=n,f=u)),n=n.next}while(n!==c);return r}(t,e)){var r=ya(e,t);Jo(r,r.next)}}function sa(t,e){return fa(t.prev,t,e.prev)<0&&fa(e.next,t,t.next)<0}function ua(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function ca(t){var e=t,r=t;do{(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next}while(e!==t);return r}function la(t,e,r,n,i,o,a,s){return(i-a)*(e-s)-(t-a)*(o-s)>=0&&(t-a)*(n-s)-(r-a)*(e-s)>=0&&(r-a)*(o-s)-(i-a)*(n-s)>=0}function ha(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&da(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(ma(t,e)&&ma(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(fa(t.prev,t,e.prev)||fa(t,e.prev,e))||pa(t,e)&&fa(t.prev,t,t.next)>0&&fa(e.prev,e,e.next)>0)}function fa(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function pa(t,e){return t.x===e.x&&t.y===e.y}function da(t,e,r,n){var i=ga(fa(t,e,r)),o=ga(fa(t,e,n)),a=ga(fa(r,n,t)),s=ga(fa(r,n,e));return i!==o&&a!==s||!(0!==i||!Aa(t,r,e))||!(0!==o||!Aa(t,n,e))||!(0!==a||!Aa(r,t,n))||!(0!==s||!Aa(r,e,n))}function Aa(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function ga(t){return t>0?1:t<0?-1:0}function ma(t,e){return fa(t.prev,t,t.next)<0?fa(t,e,t.next)>=0&&fa(t,t.prev,e)>=0:fa(t,e,t.prev)<0||fa(t,t.next,e)<0}function ya(t,e){var r=new ba(t.i,t.x,t.y),n=new ba(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function va(t,e,r,n){var i=new ba(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function _a(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function ba(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function xa(t,e,r,n){for(var i=0,o=e,a=r-n;o<r;o+=n)i+=(t[a]-t[o])*(t[o+1]+t[a+1]),a=o;return i}function wa(t,e,r,n,i){!function t(e,r,n,i,o){for(;i>n;){if(i-n>600){var a=i-n+1,s=r-n+1,u=Math.log(a),c=.5*Math.exp(2*u/3),l=.5*Math.sqrt(u*c*(a-c)/a)*(s-a/2<0?-1:1);t(e,r,Math.max(n,Math.floor(r-s*c/a+l)),Math.min(i,Math.floor(r+(a-s)*c/a+l)),o)}var h=e[r],f=n,p=i;for(Ea(e,n,r),o(e[i],h)>0&&Ea(e,n,i);f<p;){for(Ea(e,f,p),f++,p--;o(e[f],h)<0;)f++;for(;o(e[p],h)>0;)p--}0===o(e[n],h)?Ea(e,n,p):Ea(e,++p,i),p<=r&&(n=p+1),r<=p&&(i=p-1)}}(t,e,r||0,n||t.length-1,i||Sa)}function Ea(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function Sa(t,e){return t<e?-1:t>e?1:0}function Oa(t,e){var r=t.length;if(r<=1)return[t];for(var n,i,o=[],a=0;a<r;a++){var s=E(t[a]);0!==s&&(t[a].area=Math.abs(s),void 0===i&&(i=s<0),i===s<0?(n&&o.push(n),n=[t[a]]):n.push(t[a]))}if(n&&o.push(n),e>1)for(var u=0;u<o.length;u++)o[u].length<=e||(wa(o[u],e,1,o[u].length-1,Ta),o[u]=o[u].slice(0,e));return o}function Ta(t,e){return e.area-t.area}function Pa(t,e,r){for(var n=r.patternDependencies,i=!1,o=0,a=e;o<a.length;o+=1){var s=a[o].paint.get(t+"-pattern");s.isConstant()||(i=!0);var u=s.constantOr(null);u&&(i=!0,n[u.to]=!0,n[u.from]=!0)}return i}function Ma(t,e,r,n,i){for(var o=i.patternDependencies,a=0,s=e;a<s.length;a+=1){var u=s[a],c=u.paint.get(t+"-pattern").value;if("constant"!==c.kind){var l=c.evaluate({zoom:n-1},r,{},i.availableImages),h=c.evaluate({zoom:n},r,{},i.availableImages),f=c.evaluate({zoom:n+1},r,{},i.availableImages);l=l&&l.name?l.name:l,h=h&&h.name?h.name:h,f=f&&f.name?f.name:f,o[l]=!0,o[h]=!0,o[f]=!0,r.patterns[u.id]={min:l,mid:h,max:f}}}return r}Ko.deviation=function(t,e,r,n){var i=e&&e.length,o=i?e[0]*r:t.length,a=Math.abs(xa(t,0,o,r));if(i)for(var s=0,u=e.length;s<u;s++){var c=e[s]*r,l=s<u-1?e[s+1]*r:t.length;a-=Math.abs(xa(t,c,l,r))}var h=0;for(s=0;s<n.length;s+=3){var f=n[s]*r,p=n[s+1]*r,d=n[s+2]*r;h+=Math.abs((t[f]-t[d])*(t[p+1]-t[f+1])-(t[f]-t[p])*(t[d+1]-t[f+1]))}return 0===a&&0===h?0:Math.abs((h-a)/a)},Ko.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},n=0,i=0;i<t.length;i++){for(var o=0;o<t[i].length;o++)for(var a=0;a<e;a++)r.vertices.push(t[i][o][a]);i>0&&(n+=t[i-1].length,r.holes.push(n))}return r},Qo.default=Yo;var Ca=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new si,this.indexArray=new wi,this.indexArray2=new Ei,this.programConfigurations=new so(Xo,t.layers,t.zoom),this.segments=new Ui,this.segments2=new Ui,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};Ca.prototype.populate=function(t,e){this.hasPattern=Pa("fill",this.layers,e);for(var r=this.layers[0].layout.get("fill-sort-key"),n=[],i=0,o=t;i<o.length;i+=1){var a=o[i],s=a.feature,u=a.index,c=a.sourceLayerIndex;if(this.layers[0]._featureFilter(new Nn(this.zoom),s)){var l=fo(s),h=r?r.evaluate(s,{},e.availableImages):void 0,f={id:s.id,properties:s.properties,type:s.type,sourceLayerIndex:c,index:u,geometry:l,patterns:{},sortKey:h};n.push(f)}}r&&n.sort((function(t,e){return t.sortKey-e.sortKey}));for(var p=0,d=n;p<d.length;p+=1){var A=d[p],g=A,m=g.geometry,y=g.index,v=g.sourceLayerIndex;if(this.hasPattern){var _=Ma("fill",this.layers,A,this.zoom,e);this.patternFeatures.push(_)}else this.addFeature(A,m,y,{});var b=t[y].feature;e.featureIndex.insert(b,m,y,v,this.index)}},Ca.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},Ca.prototype.addFeatures=function(t,e){for(var r=0,n=this.patternFeatures;r<n.length;r+=1){var i=n[r];this.addFeature(i,i.geometry,i.index,e)}},Ca.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Ca.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Ca.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Xo),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0},Ca.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},Ca.prototype.addFeature=function(t,e,r,n){for(var i=0,o=Oa(e,500);i<o.length;i+=1){for(var a=o[i],s=0,u=0,c=a;u<c.length;u+=1)s+=c[u].length;for(var l=this.segments.prepareSegment(s,this.layoutVertexArray,this.indexArray),h=l.vertexLength,f=[],p=[],d=0,A=a;d<A.length;d+=1){var g=A[d];if(0!==g.length){g!==a[0]&&p.push(f.length/2);var m=this.segments2.prepareSegment(g.length,this.layoutVertexArray,this.indexArray2),y=m.vertexLength;this.layoutVertexArray.emplaceBack(g[0].x,g[0].y),this.indexArray2.emplaceBack(y+g.length-1,y),f.push(g[0].x),f.push(g[0].y);for(var v=1;v<g.length;v++)this.layoutVertexArray.emplaceBack(g[v].x,g[v].y),this.indexArray2.emplaceBack(y+v-1,y+v),f.push(g[v].x),f.push(g[v].y);m.vertexLength+=g.length,m.primitiveLength+=g.length}}for(var _=Qo(f,p),b=0;b<_.length;b+=3)this.indexArray.emplaceBack(h+_[b],h+_[b+1],h+_[b+2]);l.vertexLength+=s,l.primitiveLength+=_.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,n)},dn("FillBucket",Ca,{omit:["layers","patternFeatures"]});var Ia=new ti({"fill-sort-key":new Yn(Tt.layout_fill["fill-sort-key"])}),ka={paint:new ti({"fill-antialias":new Qn(Tt.paint_fill["fill-antialias"]),"fill-opacity":new Yn(Tt.paint_fill["fill-opacity"]),"fill-color":new Yn(Tt.paint_fill["fill-color"]),"fill-outline-color":new Yn(Tt.paint_fill["fill-outline-color"]),"fill-translate":new Qn(Tt.paint_fill["fill-translate"]),"fill-translate-anchor":new Qn(Tt.paint_fill["fill-translate-anchor"]),"fill-pattern":new Kn(Tt.paint_fill["fill-pattern"])}),layout:Ia},Ra=function(t){function e(e){t.call(this,e,ka)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r);var n=this.paint._values["fill-outline-color"];"constant"===n.value.kind&&void 0===n.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},e.prototype.createBucket=function(t){return new Ca(t)},e.prototype.queryRadius=function(){return Po(this.paint.get("fill-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,o,a){return yo(Mo(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),o.angle,a),n)},e.prototype.isTileClipped=function(){return!0},e}(ei),La=oi([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,ja=Da;function Da(t,e,r,n,i){this.properties={},this.extent=r,this.type=0,this._pbf=t,this._geometry=-1,this._keys=n,this._values=i,t.readFields(Ba,this,e)}function Ba(t,e,r){1==t?e.id=r.readVarint():2==t?function(t,e){for(var r=t.readVarint()+t.pos;t.pos<r;){var n=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[n]=i}}(r,e):3==t?e.type=r.readVarint():4==t&&(e._geometry=r.pos)}function Fa(t){for(var e,r,n=0,i=0,o=t.length,a=o-1;i<o;a=i++)e=t[i],n+=((r=t[a]).x-e.x)*(e.y+r.y);return n}Da.types=["Unknown","Point","LineString","Polygon"],Da.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,r=t.readVarint()+t.pos,n=1,o=0,a=0,s=0,u=[];t.pos<r;){if(o<=0){var c=t.readVarint();n=7&c,o=c>>3}if(o--,1===n||2===n)a+=t.readSVarint(),s+=t.readSVarint(),1===n&&(e&&u.push(e),e=[]),e.push(new i(a,s));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&u.push(e),u},Da.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,o=0,a=1/0,s=-1/0,u=1/0,c=-1/0;t.pos<e;){if(n<=0){var l=t.readVarint();r=7&l,n=l>>3}if(n--,1===r||2===r)(i+=t.readSVarint())<a&&(a=i),i>s&&(s=i),(o+=t.readSVarint())<u&&(u=o),o>c&&(c=o);else if(7!==r)throw new Error("unknown command "+r)}return[a,u,s,c]},Da.prototype.toGeoJSON=function(t,e,r){var n,i,o=this.extent*Math.pow(2,r),a=this.extent*t,s=this.extent*e,u=this.loadGeometry(),c=Da.types[this.type];function l(t){for(var e=0;e<t.length;e++){var r=t[e],n=180-360*(r.y+s)/o;t[e]=[360*(r.x+a)/o-180,360/Math.PI*Math.atan(Math.exp(n*Math.PI/180))-90]}}switch(this.type){case 1:var h=[];for(n=0;n<u.length;n++)h[n]=u[n][0];l(u=h);break;case 2:for(n=0;n<u.length;n++)l(u[n]);break;case 3:for(u=function(t){var e=t.length;if(e<=1)return[t];for(var r,n,i=[],o=0;o<e;o++){var a=Fa(t[o]);0!==a&&(void 0===n&&(n=a<0),n===a<0?(r&&i.push(r),r=[t[o]]):r.push(t[o]))}return r&&i.push(r),i}(u),n=0;n<u.length;n++)for(i=0;i<u[n].length;i++)l(u[n][i])}1===u.length?u=u[0]:c="Multi"+c;var f={type:"Feature",geometry:{type:c,coordinates:u},properties:this.properties};return"id"in this&&(f.id=this.id),f};var za=Na;function Na(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(Ua,this,e),this.length=this._features.length}function Ua(t,e,r){15===t?e.version=r.readVarint():1===t?e.name=r.readString():5===t?e.extent=r.readVarint():2===t?e._features.push(r.pos):3===t?e._keys.push(r.readString()):4===t&&e._values.push(function(t){for(var e=null,r=t.readVarint()+t.pos;t.pos<r;){var n=t.readVarint()>>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}(r))}function Va(t,e,r){if(3===t){var n=new za(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}Na.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new ja(this._pbf,e,this.extent,this._keys,this._values)};var Ga={VectorTile:function(t,e){this.layers=t.readFields(Va,{},e)},VectorTileFeature:ja,VectorTileLayer:za},Wa=Ga.VectorTileFeature.types,Ha=Math.pow(2,13);function qa(t,e,r,n,i,o,a,s){t.emplaceBack(e,r,2*Math.floor(n*Ha)+a,i*Ha*2,o*Ha*2,Math.round(s))}var Za=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new ci,this.indexArray=new wi,this.programConfigurations=new so(La,t.layers,t.zoom),this.segments=new Ui,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Xa(t,e){return t.x===e.x&&(t.x<0||t.x>lo)||t.y===e.y&&(t.y<0||t.y>lo)}function Qa(t){return t.every((function(t){return t.x<0}))||t.every((function(t){return t.x>lo}))||t.every((function(t){return t.y<0}))||t.every((function(t){return t.y>lo}))}Za.prototype.populate=function(t,e){this.features=[],this.hasPattern=Pa("fill-extrusion",this.layers,e);for(var r=0,n=t;r<n.length;r+=1){var i=n[r],o=i.feature,a=i.index,s=i.sourceLayerIndex;if(this.layers[0]._featureFilter(new Nn(this.zoom),o)){var u=fo(o),c={sourceLayerIndex:s,index:a,geometry:u,properties:o.properties,type:o.type,patterns:{}};void 0!==o.id&&(c.id=o.id),this.hasPattern?this.features.push(Ma("fill-extrusion",this.layers,c,this.zoom,e)):this.addFeature(c,u,a,{}),e.featureIndex.insert(o,u,a,s,this.index,!0)}}},Za.prototype.addFeatures=function(t,e){for(var r=0,n=this.features;r<n.length;r+=1){var i=n[r],o=i.geometry;this.addFeature(i,o,i.index,e)}},Za.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},Za.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Za.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Za.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,La),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},Za.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Za.prototype.addFeature=function(t,e,r,n){for(var i=0,o=Oa(e,500);i<o.length;i+=1){for(var a=o[i],s=0,u=0,c=a;u<c.length;u+=1)s+=c[u].length;for(var l=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),h=0,f=a;h<f.length;h+=1){var p=f[h];if(0!==p.length&&!Qa(p))for(var d=0,A=0;A<p.length;A++){var g=p[A];if(A>=1){var m=p[A-1];if(!Xa(g,m)){l.vertexLength+4>Ui.MAX_VERTEX_ARRAY_LENGTH&&(l=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var y=g.sub(m)._perp()._unit(),v=m.dist(g);d+v>32768&&(d=0),qa(this.layoutVertexArray,g.x,g.y,y.x,y.y,0,0,d),qa(this.layoutVertexArray,g.x,g.y,y.x,y.y,0,1,d),d+=v,qa(this.layoutVertexArray,m.x,m.y,y.x,y.y,0,0,d),qa(this.layoutVertexArray,m.x,m.y,y.x,y.y,0,1,d);var _=l.vertexLength;this.indexArray.emplaceBack(_,_+2,_+1),this.indexArray.emplaceBack(_+1,_+2,_+3),l.vertexLength+=4,l.primitiveLength+=2}}}}if(l.vertexLength+s>Ui.MAX_VERTEX_ARRAY_LENGTH&&(l=this.segments.prepareSegment(s,this.layoutVertexArray,this.indexArray)),"Polygon"===Wa[t.type]){for(var b=[],x=[],w=l.vertexLength,E=0,S=a;E<S.length;E+=1){var O=S[E];if(0!==O.length){O!==a[0]&&x.push(b.length/2);for(var T=0;T<O.length;T++){var P=O[T];qa(this.layoutVertexArray,P.x,P.y,0,0,1,1,0),b.push(P.x),b.push(P.y)}}}for(var M=Qo(b,x),C=0;C<M.length;C+=3)this.indexArray.emplaceBack(w+M[C],w+M[C+2],w+M[C+1]);l.primitiveLength+=M.length/3,l.vertexLength+=s}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,n)},dn("FillExtrusionBucket",Za,{omit:["layers","features"]});var Ya={paint:new ti({"fill-extrusion-opacity":new Qn(Tt["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Yn(Tt["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Qn(Tt["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Qn(Tt["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Kn(Tt["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Yn(Tt["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Yn(Tt["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Qn(Tt["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})},Ka=function(t){function e(e){t.call(this,e,Ya)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new Za(t)},e.prototype.queryRadius=function(){return Po(this.paint.get("fill-extrusion-translate"))},e.prototype.is3D=function(){return!0},e.prototype.queryIntersectsFeature=function(t,e,r,n,o,a,s,u){var c=Mo(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),a.angle,s),l=this.paint.get("fill-extrusion-height").evaluate(e,r),h=this.paint.get("fill-extrusion-base").evaluate(e,r),f=function(t,e,r,n){for(var o=[],a=0,s=t;a<s.length;a+=1){var u=s[a],c=[u.x,u.y,0,1];Lo(c,c,e),o.push(new i(c[0]/c[3],c[1]/c[3]))}return o}(c,u),p=function(t,e,r,n){for(var o=[],a=[],s=n[8]*e,u=n[9]*e,c=n[10]*e,l=n[11]*e,h=n[8]*r,f=n[9]*r,p=n[10]*r,d=n[11]*r,A=0,g=t;A<g.length;A+=1){for(var m=[],y=[],v=0,_=g[A];v<_.length;v+=1){var b=_[v],x=b.x,w=b.y,E=n[0]*x+n[4]*w+n[12],S=n[1]*x+n[5]*w+n[13],O=n[2]*x+n[6]*w+n[14],T=n[3]*x+n[7]*w+n[15],P=O+c,M=T+l,C=E+h,I=S+f,k=O+p,R=T+d,L=new i((E+s)/M,(S+u)/M);L.z=P/M,m.push(L);var j=new i(C/R,I/R);j.z=k/R,y.push(j)}o.push(m),a.push(y)}return[o,a]}(n,h,l,u);return function(t,e,r){var n=1/0;yo(r,e)&&(n=Ja(r,e[0]));for(var i=0;i<e.length;i++)for(var o=e[i],a=t[i],s=0;s<o.length-1;s++){var u=o[s],c=o[s+1],l=a[s],h=[u,c,a[s+1],l,u];go(r,h)&&(n=Math.min(n,Ja(r,h)))}return n!==1/0&&n}(p[0],p[1],f)},e}(ei);function $a(t,e){return t.x*e.x+t.y*e.y}function Ja(t,e){if(1===t.length){var r=e[0],n=e[1],i=e[3],o=t[0],a=n.sub(r),s=i.sub(r),u=o.sub(r),c=$a(a,a),l=$a(a,s),h=$a(s,s),f=$a(u,a),p=$a(u,s),d=c*h-l*l,A=(h*f-l*p)/d,g=(c*p-l*f)/d,m=1-A-g;return r.z*m+n.z*A+i.z*g}for(var y=1/0,v=0,_=e;v<_.length;v+=1){var b=_[v];y=Math.min(y,b.z)}return y}var ts=oi([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,es=Ga.VectorTileFeature.types,rs=Math.cos(Math.PI/180*37.5),ns=Math.pow(2,14)/.5,is=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new li,this.indexArray=new wi,this.programConfigurations=new so(ts,t.layers,t.zoom),this.segments=new Ui,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};is.prototype.populate=function(t,e){this.hasPattern=Pa("line",this.layers,e);for(var r=this.layers[0].layout.get("line-sort-key"),n=[],i=0,o=t;i<o.length;i+=1){var a=o[i],s=a.feature,u=a.index,c=a.sourceLayerIndex;if(this.layers[0]._featureFilter(new Nn(this.zoom),s)){var l=fo(s),h=r?r.evaluate(s,{}):void 0,f={id:s.id,properties:s.properties,type:s.type,sourceLayerIndex:c,index:u,geometry:l,patterns:{},sortKey:h};n.push(f)}}r&&n.sort((function(t,e){return t.sortKey-e.sortKey}));for(var p=0,d=n;p<d.length;p+=1){var A=d[p],g=A,m=g.geometry,y=g.index,v=g.sourceLayerIndex;if(this.hasPattern){var _=Ma("line",this.layers,A,this.zoom,e);this.patternFeatures.push(_)}else this.addFeature(A,m,y,{});var b=t[y].feature;e.featureIndex.insert(b,m,y,v,this.index)}},is.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},is.prototype.addFeatures=function(t,e){for(var r=0,n=this.patternFeatures;r<n.length;r+=1){var i=n[r];this.addFeature(i,i.geometry,i.index,e)}},is.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},is.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},is.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ts),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},is.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},is.prototype.addFeature=function(t,e,r,n){for(var i=this.layers[0].layout,o=i.get("line-join").evaluate(t,{}),a=i.get("line-cap"),s=i.get("line-miter-limit"),u=i.get("line-round-limit"),c=0,l=e;c<l.length;c+=1){var h=l[c];this.addLine(h,t,o,a,s,u,r,n)}},is.prototype.addLine=function(t,e,r,n,i,o,a,s){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,e.properties&&e.properties.hasOwnProperty("mapbox_clip_start")&&e.properties.hasOwnProperty("mapbox_clip_end")){this.clipStart=+e.properties.mapbox_clip_start,this.clipEnd=+e.properties.mapbox_clip_end;for(var u=0;u<t.length-1;u++)this.totalDistance+=t[u].dist(t[u+1])}for(var c="Polygon"===es[e.type],l=t.length;l>=2&&t[l-1].equals(t[l-2]);)l--;for(var h=0;h<l-1&&t[h].equals(t[h+1]);)h++;if(!(l<(c?3:2))){"bevel"===r&&(i=1.05);var f,p=this.overscaling<=16?15*lo/(512*this.overscaling):0,d=this.segments.prepareSegment(10*l,this.layoutVertexArray,this.indexArray),A=void 0,g=void 0,m=void 0,y=void 0;this.e1=this.e2=-1,c&&(f=t[l-2],y=t[h].sub(f)._unit()._perp());for(var v=h;v<l;v++)if(!(g=c&&v===l-1?t[h+1]:t[v+1])||!t[v].equals(g)){y&&(m=y),f&&(A=f),f=t[v],y=g?g.sub(f)._unit()._perp():m;var _=(m=m||y).add(y);0===_.x&&0===_.y||_._unit();var b=m.x*y.x+m.y*y.y,x=_.x*y.x+_.y*y.y,w=0!==x?1/x:1/0,E=2*Math.sqrt(2-2*x),S=x<rs&&A&&g,O=m.x*y.y-m.y*y.x>0;if(S&&v>h){var T=f.dist(A);if(T>2*p){var P=f.sub(f.sub(A)._mult(p/T)._round());this.updateDistance(A,P),this.addCurrentVertex(P,m,0,0,d),A=P}}var M=A&&g,C=M?r:c?"butt":n;if(M&&"round"===C&&(w<o?C="miter":w<=2&&(C="fakeround")),"miter"===C&&w>i&&(C="bevel"),"bevel"===C&&(w>2&&(C="flipbevel"),w<i&&(C="miter")),A&&this.updateDistance(A,f),"miter"===C)_._mult(w),this.addCurrentVertex(f,_,0,0,d);else if("flipbevel"===C){if(w>100)_=y.mult(-1);else{var I=w*m.add(y).mag()/m.sub(y).mag();_._perp()._mult(I*(O?-1:1))}this.addCurrentVertex(f,_,0,0,d),this.addCurrentVertex(f,_.mult(-1),0,0,d)}else if("bevel"===C||"fakeround"===C){var k=-Math.sqrt(w*w-1),R=O?k:0,L=O?0:k;if(A&&this.addCurrentVertex(f,m,R,L,d),"fakeround"===C)for(var j=Math.round(180*E/Math.PI/20),D=1;D<j;D++){var B=D/j;if(.5!==B){var F=B-.5;B+=B*F*(B-1)*((1.0904+b*(b*(3.55645-1.43519*b)-3.2452))*F*F+(.848013+b*(.215638*b-1.06021)))}var z=y.sub(m)._mult(B)._add(m)._unit()._mult(O?-1:1);this.addHalfVertex(f,z.x,z.y,!1,O,0,d)}g&&this.addCurrentVertex(f,y,-R,-L,d)}else if("butt"===C)this.addCurrentVertex(f,_,0,0,d);else if("square"===C){var N=A?1:-1;this.addCurrentVertex(f,_,N,N,d)}else"round"===C&&(A&&(this.addCurrentVertex(f,m,0,0,d),this.addCurrentVertex(f,m,1,1,d,!0)),g&&(this.addCurrentVertex(f,y,-1,-1,d,!0),this.addCurrentVertex(f,y,0,0,d)));if(S&&v<l-1){var U=f.dist(g);if(U>2*p){var V=f.add(g.sub(f)._mult(p/U)._round());this.updateDistance(f,V),this.addCurrentVertex(V,y,0,0,d),f=V}}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,a,s)}},is.prototype.addCurrentVertex=function(t,e,r,n,i,o){void 0===o&&(o=!1);var a=e.x+e.y*r,s=e.y-e.x*r,u=-e.x+e.y*n,c=-e.y-e.x*n;this.addHalfVertex(t,a,s,o,!1,r,i),this.addHalfVertex(t,u,c,o,!0,-n,i),this.distance>ns/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,r,n,i,o))},is.prototype.addHalfVertex=function(t,e,r,n,i,o,a){var s=t.x,u=t.y,c=.5*this.scaledDistance;this.layoutVertexArray.emplaceBack((s<<1)+(n?1:0),(u<<1)+(i?1:0),Math.round(63*e)+128,Math.round(63*r)+128,1+(0===o?0:o<0?-1:1)|(63&c)<<2,c>>6);var l=a.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,l),a.primitiveLength++),i?this.e2=l:this.e1=l},is.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.scaledDistance=this.totalDistance>0?(this.clipStart+(this.clipEnd-this.clipStart)*this.distance/this.totalDistance)*(ns-1):this.distance},dn("LineBucket",is,{omit:["layers","patternFeatures"]});var os=new ti({"line-cap":new Qn(Tt.layout_line["line-cap"]),"line-join":new Yn(Tt.layout_line["line-join"]),"line-miter-limit":new Qn(Tt.layout_line["line-miter-limit"]),"line-round-limit":new Qn(Tt.layout_line["line-round-limit"]),"line-sort-key":new Yn(Tt.layout_line["line-sort-key"])}),as={paint:new ti({"line-opacity":new Yn(Tt.paint_line["line-opacity"]),"line-color":new Yn(Tt.paint_line["line-color"]),"line-translate":new Qn(Tt.paint_line["line-translate"]),"line-translate-anchor":new Qn(Tt.paint_line["line-translate-anchor"]),"line-width":new Yn(Tt.paint_line["line-width"]),"line-gap-width":new Yn(Tt.paint_line["line-gap-width"]),"line-offset":new Yn(Tt.paint_line["line-offset"]),"line-blur":new Yn(Tt.paint_line["line-blur"]),"line-dasharray":new $n(Tt.paint_line["line-dasharray"]),"line-pattern":new Kn(Tt.paint_line["line-pattern"]),"line-gradient":new Jn(Tt.paint_line["line-gradient"])}),layout:os},ss=new(function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.possiblyEvaluate=function(e,r){return r=new Nn(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),t.prototype.possiblyEvaluate.call(this,e,r)},e.prototype.evaluate=function(e,r,n,i){return r=h({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,n,i)},e}(Yn))(as.paint.properties["line-width"].specification);ss.useIntegerZoom=!0;var us=function(t){function e(e){t.call(this,e,as)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&this._updateGradient()},e.prototype._updateGradient=function(){var t=this._transitionablePaint._values["line-gradient"].value.expression;this.gradient=Wo(t,"lineProgress"),this.gradientTexture=null},e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r),this.paint._values["line-floorwidth"]=ss.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new is(t)},e.prototype.queryRadius=function(t){var e=t,r=cs(To("line-width",this,e),To("line-gap-width",this,e)),n=To("line-offset",this,e);return r/2+Math.abs(n)+Po(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,o,a,s){var u=Mo(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,s),c=s/2*cs(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),l=this.paint.get("line-offset").evaluate(e,r);return l&&(n=function(t,e){for(var r=[],n=new i(0,0),o=0;o<t.length;o++){for(var a=t[o],s=[],u=0;u<a.length;u++){var c=a[u-1],l=a[u],h=a[u+1],f=0===u?n:l.sub(c)._unit()._perp(),p=u===a.length-1?n:h.sub(l)._unit()._perp(),d=f._add(p)._unit(),A=d.x*p.x+d.y*p.y;d._mult(1/A),s.push(d._mult(e)._add(l))}r.push(s)}return r}(n,l*s)),function(t,e,r){for(var n=0;n<e.length;n++){var i=e[n];if(t.length>=3)for(var o=0;o<i.length;o++)if(So(t,i[o]))return!0;if(vo(t,i,r))return!0}return!1}(u,n,c)},e.prototype.isTileClipped=function(){return!0},e}(ei);function cs(t,e){return e>0?e+2*t:t}var ls=oi([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),hs=oi([{name:"a_projected_pos",components:3,type:"Float32"}],4),fs=(oi([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),oi([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),ps=(oi([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"},{type:"Int16",name:"radius"},{type:"Int16",name:"signedDistanceFromAnchor"}]),oi([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),ds=oi([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4);function As(t,e,r){return t.sections.forEach((function(t){t.text=function(t,e,r){var n=e.layout.get("text-transform").evaluate(r,{});return"uppercase"===n?t=t.toLocaleUpperCase():"lowercase"===n&&(t=t.toLocaleLowerCase()),zn.applyArabicShaping&&(t=zn.applyArabicShaping(t)),t}(t.text,e,r)})),t}oi([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),oi([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"}]),oi([{type:"Float32",name:"offsetX"}]),oi([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var gs={"!":"︕","#":"",$:"","%":"","&":"","(":"︵",")":"︶","*":"","+":"",",":"︐","-":"︲",".":"・","/":"",":":"︓",";":"︔","<":"︿","=":"",">":"﹀","?":"︖","@":"","[":"﹇","\\":"","]":"﹈","^":"",_:"︳","`":"","{":"︷","|":"―","}":"︸","~":"","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","":"︲","—":"︱","":"﹃","":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","":"︹","":"︺","〖":"︗","〗":"︘","":"︕","":"︵","":"︶","":"︐","":"︲","":"・","":"︓","":"︔","":"︿","":"﹀","":"︖","":"﹇","":"﹈","_":"︳","":"︷","":"―","":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},ms=function(t,e,r,n,i){var o,a,s=8*i-n-1,u=(1<<s)-1,c=u>>1,l=-7,h=r?i-1:0,f=r?-1:1,p=t[e+h];for(h+=f,o=p&(1<<-l)-1,p>>=-l,l+=s;l>0;o=256*o+t[e+h],h+=f,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=n;l>0;a=256*a+t[e+h],h+=f,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),o-=c}return(p?-1:1)*a*Math.pow(2,o-n)},ys=function(t,e,r,n,i,o){var a,s,u,c=8*o-i-1,l=(1<<c)-1,h=l>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,A=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+h>=1?f/u:f*Math.pow(2,1-h))*u>=2&&(a++,u/=2),a+h>=l?(s=0,a=l):a+h>=1?(s=(e*u-1)*Math.pow(2,i),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[r+p]=255&s,p+=d,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;t[r+p]=255&a,p+=d,a/=256,c-=8);t[r+p-d]|=128*A},vs=_s;function _s(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}_s.Varint=0,_s.Fixed64=1,_s.Bytes=2,_s.Fixed32=5;var bs="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function xs(t){return t.type===_s.Bytes?t.readVarint()+t.pos:t.pos+1}function ws(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Es(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function Ss(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function Os(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function Ts(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function Ps(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function Ms(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function Cs(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function Is(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function ks(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function Rs(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}function Ls(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function js(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function Ds(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function Bs(t,e,r){1===t&&r.readMessage(Fs,e)}function Fs(t,e,r){if(3===t){var n=r.readMessage(zs,{}),i=n.id,o=n.bitmap,a=n.width,s=n.height,u=n.left,c=n.top,l=n.advance;e.push({id:i,bitmap:new Uo({width:a+6,height:s+6},o),metrics:{width:a,height:s,left:u,top:c,advance:l}})}}function zs(t,e,r){1===t?e.id=r.readVarint():2===t?e.bitmap=r.readBytes():3===t?e.width=r.readVarint():4===t?e.height=r.readVarint():5===t?e.left=r.readSVarint():6===t?e.top=r.readSVarint():7===t&&(e.advance=r.readVarint())}function Ns(t){for(var e=0,r=0,n=0,i=t;n<i.length;n+=1){var o=i[n];e+=o.w*o.h,r=Math.max(r,o.w)}t.sort((function(t,e){return e.h-t.h}));for(var a=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}],s=0,u=0,c=0,l=t;c<l.length;c+=1)for(var h=l[c],f=a.length-1;f>=0;f--){var p=a[f];if(!(h.w>p.w||h.h>p.h)){if(h.x=p.x,h.y=p.y,u=Math.max(u,h.y+h.h),s=Math.max(s,h.x+h.w),h.w===p.w&&h.h===p.h){var d=a.pop();f<a.length&&(a[f]=d)}else h.h===p.h?(p.x+=h.w,p.w-=h.w):h.w===p.w?(p.y+=h.h,p.h-=h.h):(a.push({x:p.x+h.w,y:p.y,w:p.w-h.w,h:h.h}),p.y+=h.h,p.h-=h.h);break}}return{w:s,h:u,fill:e/(s*u)||0}}_s.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,o=this.pos;this.type=7&n,t(i,e,this),this.pos===o&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=Ls(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Ds(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Ls(this.buf,this.pos)+4294967296*Ls(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=Ls(this.buf,this.pos)+4294967296*Ds(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=ms(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=ms(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,i,o=r.buf;if(n=(112&(i=o[r.pos++]))>>4,i<128)return ws(t,n,e);if(n|=(127&(i=o[r.pos++]))<<3,i<128)return ws(t,n,e);if(n|=(127&(i=o[r.pos++]))<<10,i<128)return ws(t,n,e);if(n|=(127&(i=o[r.pos++]))<<17,i<128)return ws(t,n,e);if(n|=(127&(i=o[r.pos++]))<<24,i<128)return ws(t,n,e);if(n|=(1&(i=o[r.pos++]))<<31,i<128)return ws(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&bs?function(t,e,r){return bs.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){for(var n="",i=e;i<r;){var o,a,s,u=t[i],c=null,l=u>239?4:u>223?3:u>191?2:1;if(i+l>r)break;1===l?u<128&&(c=u):2===l?128==(192&(o=t[i+1]))&&(c=(31&u)<<6|63&o)<=127&&(c=null):3===l?(o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&((c=(15&u)<<12|(63&o)<<6|63&a)<=2047||c>=55296&&c<=57343)&&(c=null)):4===l&&(o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&((c=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,l=1):c>65535&&(c-=65536,n+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),n+=String.fromCharCode(c),i+=l}return n}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==_s.Bytes)return t.push(this.readVarint(e));var r=xs(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==_s.Bytes)return t.push(this.readSVarint());var e=xs(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==_s.Bytes)return t.push(this.readBoolean());var e=xs(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==_s.Bytes)return t.push(this.readFloat());var e=xs(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==_s.Bytes)return t.push(this.readDouble());var e=xs(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==_s.Bytes)return t.push(this.readFixed32());var e=xs(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==_s.Bytes)return t.push(this.readSFixed32());var e=xs(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==_s.Bytes)return t.push(this.readFixed64());var e=xs(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==_s.Bytes)return t.push(this.readSFixed64());var e=xs(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===_s.Varint)for(;this.buf[this.pos++]>127;);else if(e===_s.Bytes)this.pos=this.readVarint()+this.pos;else if(e===_s.Fixed32)this.pos+=4;else{if(e!==_s.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var r=new Uint8Array(e);r.set(this.buf),this.buf=r,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),js(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),js(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),js(this.buf,-1&t,this.pos),js(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),js(this.buf,-1&t,this.pos),js(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var r,n;if(t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos]=127&t}(r,0,e),function(t,e){var r=(7&t)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(n,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var n,i,o=0;o<e.length;o++){if((n=e.charCodeAt(o))>55295&&n<57344){if(!i){n>56319||o+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):i=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(t[r++]=239,t[r++]=191,t[r++]=189,i=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&Es(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),ys(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),ys(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r<e;r++)this.buf[this.pos++]=t[r]},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this);var n=this.pos-r;n>=128&&Es(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,_s.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Ss,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Os,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Ms,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Ts,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Ps,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Cs,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Is,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,ks,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Rs,e)},writeBytesField:function(t,e){this.writeTag(t,_s.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,_s.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,_s.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,_s.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,_s.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,_s.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,_s.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,_s.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,_s.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,_s.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var Us=function(t,e){var r=e.pixelRatio,n=e.version,i=e.stretchX,o=e.stretchY,a=e.content;this.paddedRect=t,this.pixelRatio=r,this.stretchX=i,this.stretchY=o,this.content=a,this.version=n},Vs={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};Vs.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},Vs.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},Vs.tlbr.get=function(){return this.tl.concat(this.br)},Vs.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(Us.prototype,Vs);var Gs=function(t,e){var r={},n={};this.haveRenderCallbacks=[];var i=[];this.addImages(t,r,i),this.addImages(e,n,i);var o=Ns(i),a=o.w,s=o.h,u=new Vo({width:a||1,height:s||1});for(var c in t){var l=t[c],h=r[c].paddedRect;Vo.copy(l.data,u,{x:0,y:0},{x:h.x+1,y:h.y+1},l.data)}for(var f in e){var p=e[f],d=n[f].paddedRect,A=d.x+1,g=d.y+1,m=p.data.width,y=p.data.height;Vo.copy(p.data,u,{x:0,y:0},{x:A,y:g},p.data),Vo.copy(p.data,u,{x:0,y:y-1},{x:A,y:g-1},{width:m,height:1}),Vo.copy(p.data,u,{x:0,y:0},{x:A,y:g+y},{width:m,height:1}),Vo.copy(p.data,u,{x:m-1,y:0},{x:A-1,y:g},{width:1,height:y}),Vo.copy(p.data,u,{x:0,y:0},{x:A+m,y:g},{width:1,height:y})}this.image=u,this.iconPositions=r,this.patternPositions=n};Gs.prototype.addImages=function(t,e,r){for(var n in t){var i=t[n],o={x:0,y:0,w:i.data.width+2,h:i.data.height+2};r.push(o),e[n]=new Us(o,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(n)}},Gs.prototype.patchUpdatedImages=function(t,e){for(var r in t.dispatchRenderCallbacks(this.haveRenderCallbacks),t.updatedImages)this.patchUpdatedImage(this.iconPositions[r],t.getImage(r),e),this.patchUpdatedImage(this.patternPositions[r],t.getImage(r),e)},Gs.prototype.patchUpdatedImage=function(t,e,r){if(t&&e&&t.version!==e.version){t.version=e.version;var n=t.tl,i=n[0],o=n[1];r.update(e.data,void 0,{x:i,y:o})}},dn("ImagePosition",Us),dn("ImageAtlas",Gs);var Ws={horizontal:1,vertical:2,horizontalOnly:3},Hs=function(){this.scale=1,this.fontStack="",this.imageName=null};Hs.forText=function(t,e){var r=new Hs;return r.scale=t||1,r.fontStack=e,r},Hs.forImage=function(t){var e=new Hs;return e.imageName=t,e};var qs=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function Zs(t,e,r,n,i,o,a,s,u,c,l,h,f,p,d,A){var g,m=qs.fromFeature(t,i);h===Ws.vertical&&m.verticalizePunctuation();var y=zn.processBidirectionalText,v=zn.processStyledBidirectionalText;if(y&&1===m.sections.length){g=[];for(var _=0,b=y(m.toString(),tu(m,c,o,e,n,p,d));_<b.length;_+=1){var x=b[_],w=new qs;w.text=x,w.sections=m.sections;for(var E=0;E<x.length;E++)w.sectionIndex.push(0);g.push(w)}}else if(v){g=[];for(var S=0,O=v(m.text,m.sectionIndex,tu(m,c,o,e,n,p,d));S<O.length;S+=1){var T=O[S],P=new qs;P.text=T[0],P.sectionIndex=T[1],P.sections=m.sections,g.push(P)}}else g=function(t,e){for(var r=[],n=t.text,i=0,o=0,a=e;o<a.length;o+=1){var s=a[o];r.push(t.substring(i,s)),i=s}return i<n.length&&r.push(t.substring(i,n.length)),r}(m,tu(m,c,o,e,n,p,d));var M=[],C={positionedLines:M,text:m.toString(),top:l[1],bottom:l[1],left:l[0],right:l[0],writingMode:h,iconsInText:!1,verticalizable:!1};return function(t,e,r,n,i,o,a,s,u,c,l,h){for(var f=0,p=-17,d=0,A=0,g="right"===s?1:"left"===s?0:.5,m=0,y=0,v=i;y<v.length;y+=1){var _=v[y];_.trim();var b=_.getMaxScale(),x=24*(b-1),w={positionedGlyphs:[],lineOffset:0};t.positionedLines[m]=w;var E=w.positionedGlyphs,S=0;if(_.length()){for(var O=0;O<_.length();O++){var T=_.getSection(O),P=_.getSectionIndex(O),M=_.getCharCode(O),C=0,I=null,k=null,R=null,L=24,j=!(u===Ws.horizontal||!l&&!wn(M)||l&&(Xs[M]||(H=M,_n.Arabic(H)||_n["Arabic Supplement"](H)||_n["Arabic Extended-A"](H)||_n["Arabic Presentation Forms-A"](H)||_n["Arabic Presentation Forms-B"](H))));if(T.imageName){var D=n[T.imageName];if(!D)continue;R=T.imageName,t.iconsInText=t.iconsInText||!0,k=D.paddedRect;var B=D.displaySize;T.scale=24*T.scale/h,I={width:B[0],height:B[1],left:1,top:-3,advance:j?B[1]:B[0]},C=x+(24-B[1]*T.scale),L=I.advance;var F=j?B[0]*T.scale-24*b:B[1]*T.scale-24*b;F>0&&F>S&&(S=F)}else{var z=r[T.fontStack],N=z&&z[M];if(N&&N.rect)k=N.rect,I=N.metrics;else{var U=e[T.fontStack],V=U&&U[M];if(!V)continue;I=V.metrics}C=24*(b-T.scale)}j?(t.verticalizable=!0,E.push({glyph:M,imageName:R,x:f,y:p+C,vertical:j,scale:T.scale,fontStack:T.fontStack,sectionIndex:P,metrics:I,rect:k}),f+=L*T.scale+c):(E.push({glyph:M,imageName:R,x:f,y:p+C,vertical:j,scale:T.scale,fontStack:T.fontStack,sectionIndex:P,metrics:I,rect:k}),f+=I.advance*T.scale+c)}if(0!==E.length){var G=f-c;d=Math.max(G,d),ru(E,0,E.length-1,g,S)}f=0;var W=o*b+S;w.lineOffset=Math.max(S,x),p+=W,A=Math.max(W,A),++m}else p+=o,++m}var H,q=p- -17,Z=eu(a),X=Z.horizontalAlign,Q=Z.verticalAlign;(function(t,e,r,n,i,o,a,s,u){var c,l=(e-r)*i;c=o!==a?-s*n- -17:(-n*u+.5)*a;for(var h=0,f=t;h<f.length;h+=1)for(var p=0,d=f[h].positionedGlyphs;p<d.length;p+=1){var A=d[p];A.x+=l,A.y+=c}})(t.positionedLines,g,X,Q,d,A,o,q,i.length),t.top+=-Q*q,t.bottom=t.top+q,t.left+=-X*d,t.right=t.left+d}(C,e,r,n,g,a,s,u,h,c,f,A),!function(t){for(var e=0,r=t;e<r.length;e+=1)if(0!==r[e].positionedGlyphs.length)return!1;return!0}(M)&&C}qs.fromFeature=function(t,e){for(var r=new qs,n=0;n<t.sections.length;n++){var i=t.sections[n];i.image?r.addImageSection(i):r.addTextSection(i,e)}return r},qs.prototype.length=function(){return this.text.length},qs.prototype.getSection=function(t){return this.sections[this.sectionIndex[t]]},qs.prototype.getSectionIndex=function(t){return this.sectionIndex[t]},qs.prototype.getCharCode=function(t){return this.text.charCodeAt(t)},qs.prototype.verticalizePunctuation=function(){this.text=function(t){for(var e="",r=0;r<t.length;r++){var n=t.charCodeAt(r+1)||null,i=t.charCodeAt(r-1)||null;n&&En(n)&&!gs[t[r+1]]||i&&En(i)&&!gs[t[r-1]]||!gs[t[r]]?e+=t[r]:e+=gs[t[r]]}return e}(this.text)},qs.prototype.trim=function(){for(var t=0,e=0;e<this.text.length&&Xs[this.text.charCodeAt(e)];e++)t++;for(var r=this.text.length,n=this.text.length-1;n>=0&&n>=t&&Xs[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)},qs.prototype.substring=function(t,e){var r=new qs;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},qs.prototype.toString=function(){return this.text},qs.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,r){return Math.max(e,t.sections[r].scale)}),0)},qs.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(Hs.forText(t.scale,t.fontStack||e));for(var r=this.sections.length-1,n=0;n<t.text.length;++n)this.sectionIndex.push(r)},qs.prototype.addImageSection=function(t){var e=t.image?t.image.name:"";if(0!==e.length){var r=this.getNextImageSectionCharCode();r?(this.text+=String.fromCharCode(r),this.sections.push(Hs.forImage(e)),this.sectionIndex.push(this.sections.length-1)):x("Reached maximum number of images 6401")}else x("Can't add FormattedSection with an empty image.")},qs.prototype.getNextImageSectionCharCode=function(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var Xs={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Qs={};function Ys(t,e,r,n,i,o){if(e.imageName){var a=n[e.imageName];return a?a.displaySize[0]*e.scale*24/o+i:0}var s=r[e.fontStack],u=s&&s[t];return u?u.metrics.advance*e.scale+i:0}function Ks(t,e,r,n){var i=Math.pow(t-e,2);return n?t<e?i/2:2*i:i+Math.abs(r)*r}function $s(t,e,r){var n=0;return 10===t&&(n-=1e4),r&&(n+=150),40!==t&&65288!==t||(n+=50),41!==e&&65289!==e||(n+=50),n}function Js(t,e,r,n,i,o){for(var a=null,s=Ks(e,r,i,o),u=0,c=n;u<c.length;u+=1){var l=c[u],h=Ks(e-l.x,r,i,o)+l.badness;h<=s&&(a=l,s=h)}return{index:t,x:e,priorBreak:a,badness:s}}function tu(t,e,r,n,i,o,a){if("point"!==o)return[];if(!t)return[];for(var s,u=[],c=function(t,e,r,n,i,o){for(var a=0,s=0;s<t.length();s++){var u=t.getSection(s);a+=Ys(t.getCharCode(s),u,n,i,e,o)}return a/Math.max(1,Math.ceil(a/r))}(t,e,r,n,i,a),l=t.text.indexOf("")>=0,h=0,f=0;f<t.length();f++){var p=t.getSection(f),d=t.getCharCode(f);if(Xs[d]||(h+=Ys(d,p,n,i,e,a)),f<t.length()-1){var A=!((s=d)<11904||!(_n["Bopomofo Extended"](s)||_n.Bopomofo(s)||_n["CJK Compatibility Forms"](s)||_n["CJK Compatibility Ideographs"](s)||_n["CJK Compatibility"](s)||_n["CJK Radicals Supplement"](s)||_n["CJK Strokes"](s)||_n["CJK Symbols and Punctuation"](s)||_n["CJK Unified Ideographs Extension A"](s)||_n["CJK Unified Ideographs"](s)||_n["Enclosed CJK Letters and Months"](s)||_n["Halfwidth and Fullwidth Forms"](s)||_n.Hiragana(s)||_n["Ideographic Description Characters"](s)||_n["Kangxi Radicals"](s)||_n["Katakana Phonetic Extensions"](s)||_n.Katakana(s)||_n["Vertical Forms"](s)||_n["Yi Radicals"](s)||_n["Yi Syllables"](s)));(Qs[d]||A||p.imageName)&&u.push(Js(f+1,h,c,u,$s(d,t.getCharCode(f+1),A&&l),!1))}}return function t(e){return e?t(e.priorBreak).concat(e.index):[]}(Js(t.length(),h,c,u,0,!0))}function eu(t){var e=.5,r=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(t){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:e,verticalAlign:r}}function ru(t,e,r,n,i){if(n||i)for(var o=t[r],a=o.metrics.advance*o.scale,s=(t[r].x+a)*n,u=e;u<=r;u++)t[u].x-=s,t[u].y+=i}function nu(t,e,r,n,i,o){var a,s=t.image;if(s.content){var u=s.content,c=s.pixelRatio||1;a=[u[0]/c,u[1]/c,s.displaySize[0]-u[2]/c,s.displaySize[1]-u[3]/c]}var l,h,f,p,d=e.left*o,A=e.right*o;"width"===r||"both"===r?(p=i[0]+d-n[3],h=i[0]+A+n[1]):h=(p=i[0]+(d+A-s.displaySize[0])/2)+s.displaySize[0];var g=e.top*o,m=e.bottom*o;return"height"===r||"both"===r?(l=i[1]+g-n[0],f=i[1]+m+n[2]):f=(l=i[1]+(g+m-s.displaySize[1])/2)+s.displaySize[1],{image:s,top:l,right:h,bottom:f,left:p,collisionPadding:a}}Qs[10]=!0,Qs[32]=!0,Qs[38]=!0,Qs[40]=!0,Qs[41]=!0,Qs[43]=!0,Qs[45]=!0,Qs[47]=!0,Qs[173]=!0,Qs[183]=!0,Qs[8203]=!0,Qs[8208]=!0,Qs[8211]=!0,Qs[8231]=!0;var iu=function(t){function e(e,r,n,i){t.call(this,e,r),this.angle=n,void 0!==i&&(this.segment=i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){return new e(this.x,this.y,this.angle,this.segment)},e}(i);dn("Anchor",iu);var ou=128;function au(t,e){var r=e.expression;if("constant"===r.kind)return{kind:"constant",layoutSize:r.evaluate(new Nn(t+1))};if("source"===r.kind)return{kind:"source"};for(var n=r.zoomStops,i=r.interpolationType,o=0;o<n.length&&n[o]<=t;)o++;for(var a=o=Math.max(0,o-1);a<n.length&&n[a]<t+1;)a++;a=Math.min(n.length-1,a);var s=n[o],u=n[a];return"composite"===r.kind?{kind:"composite",minZoom:s,maxZoom:u,interpolationType:i}:{kind:"camera",minZoom:s,maxZoom:u,minSize:r.evaluate(new Nn(s)),maxSize:r.evaluate(new Nn(u)),interpolationType:i}}function su(t,e,r){var n=e.uSize,i=e.uSizeT,o=r.lowerSize,a=r.upperSize;return"source"===t.kind?o/ou:"composite"===t.kind?we(o/ou,a/ou,i):n}function uu(t,e){var r=0,n=0;if("constant"===t.kind)n=t.layoutSize;else if("source"!==t.kind){var i=t.interpolationType,o=t.minZoom,a=t.maxZoom,s=i?c(ze.interpolationFactor(i,e,o,a),0,1):0;"camera"===t.kind?n=we(t.minSize,t.maxSize,s):r=s}return{uSizeT:r,uSize:n}}var cu=Object.freeze({__proto__:null,getSizeData:au,evaluateSizeForFeature:su,evaluateSizeForZoom:uu,SIZE_PACK_FACTOR:ou});function lu(t,e,r,n,i){if(void 0===e.segment)return!0;for(var o=e,a=e.segment+1,s=0;s>-r/2;){if(--a<0)return!1;s-=t[a].dist(o),o=t[a]}s+=t[a].dist(t[a+1]),a++;for(var u=[],c=0;s<r/2;){var l=t[a-1],h=t[a],f=t[a+1];if(!f)return!1;var p=l.angleTo(h)-h.angleTo(f);for(p=Math.abs((p+3*Math.PI)%(2*Math.PI)-Math.PI),u.push({distance:s,angleDelta:p}),c+=p;s-u[0].distance>n;)c-=u.shift().angleDelta;if(c>i)return!1;a++,s+=h.dist(f)}return!0}function hu(t){for(var e=0,r=0;r<t.length-1;r++)e+=t[r].dist(t[r+1]);return e}function fu(t,e,r){return t?.6*e*r:0}function pu(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function du(t,e,r,n,i,o){for(var a=fu(r,i,o),s=pu(r,n)*o,u=0,c=hu(t)/2,l=0;l<t.length-1;l++){var h=t[l],f=t[l+1],p=h.dist(f);if(u+p>c){var d=(c-u)/p,A=we(h.x,f.x,d),g=we(h.y,f.y,d),m=new iu(A,g,f.angleTo(h),l);return m._round(),!a||lu(t,m,s,a,e)?m:void 0}u+=p}}function Au(t,e,r,n,i,o,a,s,u){var c=fu(n,o,a),l=pu(n,i),h=l*a,f=0===t[0].x||t[0].x===u||0===t[0].y||t[0].y===u;return e-h<e/4&&(e=h+e/4),function t(e,r,n,i,o,a,s,u,c){for(var l=a/2,h=hu(e),f=0,p=r-n,d=[],A=0;A<e.length-1;A++){for(var g=e[A],m=e[A+1],y=g.dist(m),v=m.angleTo(g);p+n<f+y;){var _=((p+=n)-f)/y,b=we(g.x,m.x,_),x=we(g.y,m.y,_);if(b>=0&&b<c&&x>=0&&x<c&&p-l>=0&&p+l<=h){var w=new iu(b,x,v,A);w._round(),i&&!lu(e,w,a,i,o)||d.push(w)}}f+=y}return u||d.length||s||(d=t(e,f/2,n,i,o,a,s,!0,c)),d}(t,f?e/2*s%e:(l/2+2*o)*a*s%e,e,c,r,h,f,!1,u)}function gu(t,e,r,n){var o=[],a=t.image,s=a.pixelRatio,u=a.paddedRect.w-2,c=a.paddedRect.h-2,l=t.right-t.left,h=t.bottom-t.top,f=a.stretchX||[[0,u]],p=a.stretchY||[[0,c]],d=function(t,e){return t+e[1]-e[0]},A=f.reduce(d,0),g=p.reduce(d,0),m=u-A,y=c-g,v=0,_=A,b=0,x=g,w=0,E=m,S=0,O=y;if(a.content&&n){var T=a.content;v=mu(f,0,T[0]),b=mu(p,0,T[1]),_=mu(f,T[0],T[2]),x=mu(p,T[1],T[3]),w=T[0]-v,S=T[1]-b,E=T[2]-T[0]-_,O=T[3]-T[1]-x}var P=function(n,o,u,c){var f=vu(n.stretch-v,_,l,t.left),p=_u(n.fixed-w,E,n.stretch,A),d=vu(o.stretch-b,x,h,t.top),m=_u(o.fixed-S,O,o.stretch,g),y=vu(u.stretch-v,_,l,t.left),T=_u(u.fixed-w,E,u.stretch,A),P=vu(c.stretch-b,x,h,t.top),M=_u(c.fixed-S,O,c.stretch,g),C=new i(f,d),I=new i(y,d),k=new i(y,P),R=new i(f,P),L=new i(p/s,m/s),j=new i(T/s,M/s),D=e*Math.PI/180;if(D){var B=Math.sin(D),F=Math.cos(D),z=[F,-B,B,F];C._matMult(z),I._matMult(z),R._matMult(z),k._matMult(z)}var N=n.stretch+n.fixed,U=u.stretch+u.fixed,V=o.stretch+o.fixed,G=c.stretch+c.fixed;return{tl:C,tr:I,bl:R,br:k,tex:{x:a.paddedRect.x+1+N,y:a.paddedRect.y+1+V,w:U-N,h:G-V},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:L,pixelOffsetBR:j,minFontScaleX:E/s/l,minFontScaleY:O/s/h,isSDF:r}};if(n&&(a.stretchX||a.stretchY))for(var M=yu(f,m,A),C=yu(p,y,g),I=0;I<M.length-1;I++)for(var k=M[I],R=M[I+1],L=0;L<C.length-1;L++){var j=C[L],D=C[L+1];o.push(P(k,j,R,D))}else o.push(P({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:u+1},{fixed:0,stretch:c+1}));return o}function mu(t,e,r){for(var n=0,i=0,o=t;i<o.length;i+=1){var a=o[i];n+=Math.max(e,Math.min(r,a[1]))-Math.max(e,Math.min(r,a[0]))}return n}function yu(t,e,r){for(var n=[{fixed:-1,stretch:0}],i=0,o=t;i<o.length;i+=1){var a=o[i],s=a[0],u=a[1],c=n[n.length-1];n.push({fixed:s-c.stretch,stretch:c.stretch}),n.push({fixed:s-c.stretch,stretch:c.stretch+(u-s)})}return n.push({fixed:e+1,stretch:r}),n}function vu(t,e,r,n){return t/e*r+n}function _u(t,e,r,n){return t-e*r/n}var bu=function(t,e,r,n,o,a,s,u,c,l,h,f){var p=s.top*u-c,d=s.bottom*u+c,A=s.left*u-c,g=s.right*u+c,m=s.collisionPadding;if(m&&(A-=m[0]*u,p-=m[1]*u,g+=m[2]*u,d+=m[3]*u),this.boxStartIndex=t.length,l){var y=d-p,v=g-A;y>0&&(y=Math.max(10*u,y),this._addLineCollisionCircles(t,e,r,r.segment,v,y,n,o,a,h))}else{if(f){var _=new i(A,p),b=new i(g,p),x=new i(A,d),w=new i(g,d),E=f*Math.PI/180;_._rotate(E),b._rotate(E),x._rotate(E),w._rotate(E),A=Math.min(_.x,b.x,x.x,w.x),g=Math.max(_.x,b.x,x.x,w.x),p=Math.min(_.y,b.y,x.y,w.y),d=Math.max(_.y,b.y,x.y,w.y)}t.emplaceBack(r.x,r.y,A,p,g,d,n,o,a,0,0)}this.boxEndIndex=t.length};bu.prototype._addLineCollisionCircles=function(t,e,r,n,i,o,a,s,u,c){var l=o/2,h=Math.floor(i/l)||1,f=1+.4*Math.log(c)/Math.LN2,p=Math.floor(h*f/2),d=-o/2,A=r,g=n+1,m=d,y=-i/2,v=y-i/4;do{if(--g<0){if(m>y)return;g=0;break}m-=e[g].dist(A),A=e[g]}while(m>v);for(var _=e[g].dist(e[g+1]),b=-p;b<h+p;b++){var x=b*l,w=y+x;if(x<0&&(w+=x),x>i&&(w+=x-i),!(w<m)){for(;m+_<w;){if(m+=_,++g+1>=e.length)return;_=e[g].dist(e[g+1])}var E=w-m,S=e[g],O=e[g+1].sub(S)._unit()._mult(E)._add(S)._round(),T=Math.abs(w-d)<l?0:.8*(w-d);t.emplaceBack(O.x,O.y,-o/2,-o/2,o/2,o/2,a,s,u,o/2,T)}}};var xu=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=wu),this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)};function wu(t,e){return t<e?-1:t>e?1:0}function Eu(t,e,r){void 0===e&&(e=1),void 0===r&&(r=!1);for(var n=1/0,o=1/0,a=-1/0,s=-1/0,u=t[0],c=0;c<u.length;c++){var l=u[c];(!c||l.x<n)&&(n=l.x),(!c||l.y<o)&&(o=l.y),(!c||l.x>a)&&(a=l.x),(!c||l.y>s)&&(s=l.y)}var h=a-n,f=s-o,p=Math.min(h,f),d=p/2,A=new xu([],Su);if(0===p)return new i(n,o);for(var g=n;g<a;g+=p)for(var m=o;m<s;m+=p)A.push(new Ou(g+d,m+d,d,t));for(var y=function(t){for(var e=0,r=0,n=0,i=t[0],o=0,a=i.length,s=a-1;o<a;s=o++){var u=i[o],c=i[s],l=u.x*c.y-c.x*u.y;r+=(u.x+c.x)*l,n+=(u.y+c.y)*l,e+=3*l}return new Ou(r/e,n/e,0,t)}(t),v=A.length;A.length;){var _=A.pop();(_.d>y.d||!y.d)&&(y=_,r&&console.log("found best %d after %d probes",Math.round(1e4*_.d)/1e4,v)),_.max-y.d<=e||(d=_.h/2,A.push(new Ou(_.p.x-d,_.p.y-d,d,t)),A.push(new Ou(_.p.x+d,_.p.y-d,d,t)),A.push(new Ou(_.p.x-d,_.p.y+d,d,t)),A.push(new Ou(_.p.x+d,_.p.y+d,d,t)),v+=4)}return r&&(console.log("num probes: "+v),console.log("best distance: "+y.d)),y.p}function Su(t,e){return e.max-t.max}function Ou(t,e,r,n){this.p=new i(t,e),this.h=r,this.d=function(t,e){for(var r=!1,n=1/0,i=0;i<e.length;i++)for(var o=e[i],a=0,s=o.length,u=s-1;a<s;u=a++){var c=o[a],l=o[u];c.y>t.y!=l.y>t.y&&t.x<(l.x-c.x)*(t.y-c.y)/(l.y-c.y)+c.x&&(r=!r),n=Math.min(n,wo(t,c,l))}return(r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}xu.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},xu.prototype.pop=function(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}},xu.prototype.peek=function(){return this.data[0]},xu.prototype._up=function(t){for(var e=this.data,r=this.compare,n=e[t];t>0;){var i=t-1>>1,o=e[i];if(r(n,o)>=0)break;e[t]=o,t=i}e[t]=n},xu.prototype._down=function(t){for(var e=this.data,r=this.compare,n=this.length>>1,i=e[t];t<n;){var o=1+(t<<1),a=e[o],s=o+1;if(s<this.length&&r(e[s],a)<0&&(o=s,a=e[s]),r(a,i)>=0)break;e[t]=a,t=o}e[t]=i};var Tu=e((function(t){t.exports=function(t,e){var r,n,i,o,a,s,u,c;for(r=3&t.length,n=t.length-r,i=e,a=3432918353,s=461845907,c=0;c<n;)u=255&t.charCodeAt(c)|(255&t.charCodeAt(++c))<<8|(255&t.charCodeAt(++c))<<16|(255&t.charCodeAt(++c))<<24,++c,i=27492+(65535&(o=5*(65535&(i=(i^=u=(65535&(u=(u=(65535&u)*a+(((u>>>16)*a&65535)<<16)&4294967295)<<15|u>>>17))*s+(((u>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(u=0,r){case 3:u^=(255&t.charCodeAt(c+2))<<16;case 2:u^=(255&t.charCodeAt(c+1))<<8;case 1:i^=u=(65535&(u=(u=(65535&(u^=255&t.charCodeAt(c)))*a+(((u>>>16)*a&65535)<<16)&4294967295)<<15|u>>>17))*s+(((u>>>16)*s&65535)<<16)&4294967295}return i^=t.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0}})),Pu=e((function(t){t.exports=function(t,e){for(var r,n=t.length,i=e^n,o=0;n>=4;)r=1540483477*(65535&(r=255&t.charCodeAt(o)|(255&t.charCodeAt(++o))<<8|(255&t.charCodeAt(++o))<<16|(255&t.charCodeAt(++o))<<24))+((1540483477*(r>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++o;switch(n){case 3:i^=(255&t.charCodeAt(o+2))<<16;case 2:i^=(255&t.charCodeAt(o+1))<<8;case 1:i=1540483477*(65535&(i^=255&t.charCodeAt(o)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0}})),Mu=Tu,Cu=Tu,Iu=Pu;Mu.murmur3=Cu,Mu.murmur2=Iu;var ku=Number.POSITIVE_INFINITY;function Ru(t,e){return e[1]!==ku?function(t,e,r){var n=0,i=0;switch(e=Math.abs(e),r=Math.abs(r),t){case"top-right":case"top-left":case"top":i=r-7;break;case"bottom-right":case"bottom-left":case"bottom":i=7-r}switch(t){case"top-right":case"bottom-right":case"right":n=-e;break;case"top-left":case"bottom-left":case"left":n=e}return[n,i]}(t,e[0],e[1]):function(t,e){var r=0,n=0;e<0&&(e=0);var i=e/Math.sqrt(2);switch(t){case"top-right":case"top-left":n=i-7;break;case"bottom-right":case"bottom-left":n=7-i;break;case"bottom":n=7-e;break;case"top":n=e-7}switch(t){case"top-right":case"bottom-right":r=-i;break;case"top-left":case"bottom-left":r=i;break;case"left":r=e;break;case"right":r=-e}return[r,n]}(t,e[0])}function Lu(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}var ju=32640;function Du(t,e,r,n,o,a,s,u,c,l,h,f,p,d){var A=function(t,e,r,n,o,a,s,u){for(var c=n.layout.get("text-rotate").evaluate(a,{})*Math.PI/180,l=[],h=0,f=e.positionedLines;h<f.length;h+=1)for(var p=f[h],d=0,A=p.positionedGlyphs;d<A.length;d+=1){var g=A[d];if(g.rect){var m=g.rect||{},y=4,v=!0,_=1,b=0,x=(o||u)&&g.vertical,w=g.metrics.advance*g.scale/2;if(u&&e.verticalizable){var E=24*(g.scale-1),S=(24-g.metrics.width*g.scale)/2;b=p.lineOffset/2-(g.imageName?-S:E)}if(g.imageName){var O=s[g.imageName];v=O.sdf,y=1/(_=O.pixelRatio)}var T=o?[g.x+w,g.y]:[0,0],P=o?[0,0]:[g.x+w+r[0],g.y+r[1]-b],M=[0,0];x&&(M=P,P=[0,0]);var C=(g.metrics.left-y)*g.scale-w+P[0],I=(-g.metrics.top-y)*g.scale+P[1],k=C+m.w*g.scale/_,R=I+m.h*g.scale/_,L=new i(C,I),j=new i(k,I),D=new i(C,R),B=new i(k,R);if(x){var F=new i(-w,w- -17),z=-Math.PI/2,N=12-w,U=g.imageName?N:0,V=new i(22-N,-U),G=new(Function.prototype.bind.apply(i,[null].concat(M)));L._rotateAround(z,F)._add(V)._add(G),j._rotateAround(z,F)._add(V)._add(G),D._rotateAround(z,F)._add(V)._add(G),B._rotateAround(z,F)._add(V)._add(G)}if(c){var W=Math.sin(c),H=Math.cos(c),q=[H,-W,W,H];L._matMult(q),j._matMult(q),D._matMult(q),B._matMult(q)}var Z=new i(0,0),X=new i(0,0);l.push({tl:L,tr:j,bl:D,br:B,tex:m,writingMode:e.writingMode,glyphOffset:T,sectionIndex:g.sectionIndex,isSDF:v,pixelOffsetTL:Z,pixelOffsetBR:X,minFontScaleX:0,minFontScaleY:0})}}return l}(0,r,u,o,a,s,n,t.allowVerticalPlacement),g=t.textSizeData,m=null;"source"===g.kind?(m=[ou*o.layout.get("text-size").evaluate(s,{})])[0]>ju&&x(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):"composite"===g.kind&&((m=[ou*d.compositeTextSizes[0].evaluate(s,{}),ou*d.compositeTextSizes[1].evaluate(s,{})])[0]>ju||m[1]>ju)&&x(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),t.addSymbols(t.text,A,m,u,a,s,l,e,c.lineStartIndex,c.lineLength,p);for(var y=0,v=h;y<v.length;y+=1)f[v[y]]=t.text.placedSymbolArray.length-1;return 4*A.length}function Bu(t){for(var e in t)return t[e];return null}function Fu(t,e,r,n){var i=t.compareText;if(e in i){for(var o=i[e],a=o.length-1;a>=0;a--)if(n.dist(o[a])<r)return!0}else i[e]=[];return i[e].push(n),!1}var zu=Ga.VectorTileFeature.types,Nu=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Uu(t,e,r,n,i,o,a,s,u,c,l,h,f){var p=s?Math.min(ju,Math.round(s[0])):0,d=s?Math.min(ju,Math.round(s[1])):0;t.emplaceBack(e,r,Math.round(32*n),Math.round(32*i),o,a,(p<<1)+(u?1:0),d,16*c,16*l,256*h,256*f)}function Vu(t,e,r){t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r)}function Gu(t){for(var e=0,r=t.sections;e<r.length;e+=1)if(Tn(r[e].text))return!0;return!1}var Wu=function(t){this.layoutVertexArray=new fi,this.indexArray=new wi,this.programConfigurations=t,this.segments=new Ui,this.dynamicLayoutVertexArray=new pi,this.opacityVertexArray=new di,this.placedSymbolArray=new Ii};Wu.prototype.upload=function(t,e,r,n){r&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ls.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,hs.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,Nu,!0),this.opacityVertexBuffer.itemSize=1),(r||n)&&this.programConfigurations.upload(t)},Wu.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},dn("SymbolBuffers",Wu);var Hu=function(t,e,r){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new r,this.segments=new Ui,this.collisionVertexArray=new mi};Hu.prototype.upload=function(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,fs.members,!0)},Hu.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},dn("CollisionBuffers",Hu);var qu=function(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasPaintOverrides=!1,this.hasRTLText=!1;var e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=au(this.zoom,e["text-size"]),this.iconSizeData=au(this.zoom,e["icon-size"]);var r=this.layers[0].layout,n=r.get("symbol-sort-key"),i=r.get("symbol-z-order");this.sortFeaturesByKey="viewport-y"!==i&&void 0!==n.constantOr(1);var o="viewport-y"===i||"auto"===i&&!this.sortFeaturesByKey;this.sortFeaturesByY=o&&(r.get("text-allow-overlap")||r.get("icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement")),"point"===r.get("symbol-placement")&&(this.writingModes=r.get("text-writing-mode").map((function(t){return Ws[t]}))),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id})),this.sourceID=t.sourceID};qu.prototype.createArrays=function(){var t=this.layers[0].layout;this.hasPaintOverrides=Yu.hasPaintOverrides(t),this.text=new Wu(new so(ls.members,this.layers,this.zoom,(function(t){return/^text/.test(t)}))),this.icon=new Wu(new so(ls.members,this.layers,this.zoom,(function(t){return/^icon/.test(t)}))),this.textCollisionBox=new Hu(gi,ps.members,Ei),this.iconCollisionBox=new Hu(gi,ps.members,Ei),this.textCollisionCircle=new Hu(gi,ds.members,wi),this.iconCollisionCircle=new Hu(gi,ds.members,wi),this.glyphOffsetArray=new ji,this.lineVertexArray=new Bi,this.symbolInstances=new Ri},qu.prototype.calculateGlyphDependencies=function(t,e,r,n,i){for(var o=0;o<t.length;o++)if(e[t.charCodeAt(o)]=!0,(r||n)&&i){var a=gs[t.charAt(o)];a&&(e[a.charCodeAt(0)]=!0)}},qu.prototype.populate=function(t,e){var r=this.layers[0],n=r.layout,i=n.get("text-font"),o=n.get("text-field"),a=n.get("icon-image"),s=("constant"!==o.value.kind||o.value.value instanceof Jt&&!o.value.value.isEmpty()||o.value.value.toString().length>0)&&("constant"!==i.value.kind||i.value.value.length>0),u=("constant"!==a.value.kind||!!a.value.value)&&Object.keys(a.parameters).length>0,c=n.get("symbol-sort-key");if(this.features=[],s||u){for(var l=e.iconDependencies,h=e.glyphDependencies,f=e.availableImages,p=new Nn(this.zoom),d=0,A=t;d<A.length;d+=1){var g=A[d],m=g.feature,y=g.index,v=g.sourceLayerIndex;if(r._featureFilter(p,m)){var _=void 0;if(s){var b=r.getValueAndResolveTokens("text-field",m,f),x=Jt.factory(b);Gu(x)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===Bn()||this.hasRTLText&&zn.isParsed())&&(_=As(x,r,m))}var w=void 0;if(u){var E=r.getValueAndResolveTokens("icon-image",m,f);w=E instanceof te?E:te.fromString(E)}if(_||w){var S=this.sortFeaturesByKey?c.evaluate(m,{}):void 0,O={text:_,icon:w,index:y,sourceLayerIndex:v,geometry:fo(m),properties:m.properties,type:zu[m.type],sortKey:S};if(void 0!==m.id&&(O.id=m.id),this.features.push(O),w&&(l[w.name]=!0),_){var T=i.evaluate(m,{}).join(","),P="map"===n.get("text-rotation-alignment")&&"point"!==n.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(Ws.vertical)>=0;for(var M=0,C=_.sections;M<C.length;M+=1){var I=C[M];if(I.image)l[I.image.name]=!0;else{var k=bn(_.toString()),R=I.fontStack||T,L=h[R]=h[R]||{};this.calculateGlyphDependencies(I.text,L,P,this.allowVerticalPlacement,k)}}}}}}"line"===n.get("symbol-placement")&&(this.features=function(t){var e={},r={},n=[],i=0;function o(e){n.push(t[e]),i++}function a(t,e,i){var o=r[t];return delete r[t],r[e]=o,n[o].geometry[0].pop(),n[o].geometry[0]=n[o].geometry[0].concat(i[0]),o}function s(t,r,i){var o=e[r];return delete e[r],e[t]=o,n[o].geometry[0].shift(),n[o].geometry[0]=i[0].concat(n[o].geometry[0]),o}function u(t,e,r){var n=r?e[0][e[0].length-1]:e[0][0];return t+":"+n.x+":"+n.y}for(var c=0;c<t.length;c++){var l=t[c],h=l.geometry,f=l.text?l.text.toString():null;if(f){var p=u(f,h),d=u(f,h,!0);if(p in r&&d in e&&r[p]!==e[d]){var A=s(p,d,h),g=a(p,d,n[A].geometry);delete e[p],delete r[d],r[u(f,n[g].geometry,!0)]=g,n[A].geometry=null}else p in r?a(p,d,h):d in e?s(p,d,h):(o(c),e[p]=i-1,r[d]=i-1)}else o(c)}return n.filter((function(t){return t.geometry}))}(this.features)),this.sortFeaturesByKey&&this.features.sort((function(t,e){return t.sortKey-e.sortKey}))}},qu.prototype.update=function(t,e,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,r),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,r))},qu.prototype.isEmpty=function(){return 0===this.symbolInstances.length&&!this.hasRTLText},qu.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},qu.prototype.upload=function(t){this.uploaded||(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t),this.textCollisionCircle.upload(t),this.iconCollisionCircle.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0},qu.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.textCollisionBox.destroy(),this.iconCollisionBox.destroy(),this.textCollisionCircle.destroy(),this.iconCollisionCircle.destroy()},qu.prototype.addToLineVertexArray=function(t,e){var r=this.lineVertexArray.length;if(void 0!==t.segment){for(var n=t.dist(e[t.segment+1]),i=t.dist(e[t.segment]),o={},a=t.segment+1;a<e.length;a++)o[a]={x:e[a].x,y:e[a].y,tileUnitDistanceFromAnchor:n},a<e.length-1&&(n+=e[a+1].dist(e[a]));for(var s=t.segment||0;s>=0;s--)o[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:i},s>0&&(i+=e[s-1].dist(e[s]));for(var u=0;u<e.length;u++){var c=o[u];this.lineVertexArray.emplaceBack(c.x,c.y,c.tileUnitDistanceFromAnchor)}}return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}},qu.prototype.addSymbols=function(t,e,r,n,i,o,a,s,u,c,l){var h=this,f=t.indexArray,p=t.layoutVertexArray,d=t.dynamicLayoutVertexArray,A=t.segments.prepareSegment(4*e.length,t.layoutVertexArray,t.indexArray,o.sortKey),g=this.glyphOffsetArray.length,m=A.vertexLength,y=this.allowVerticalPlacement&&a===Ws.vertical?Math.PI/2:0,v=function(t){var e=t.tl,n=t.tr,i=t.bl,o=t.br,a=t.tex,u=t.pixelOffsetTL,c=t.pixelOffsetBR,l=t.minFontScaleX,g=t.minFontScaleY,m=A.vertexLength,v=t.glyphOffset[1];Uu(p,s.x,s.y,e.x,v+e.y,a.x,a.y,r,t.isSDF,u.x,u.y,l,g),Uu(p,s.x,s.y,n.x,v+n.y,a.x+a.w,a.y,r,t.isSDF,c.x,u.y,l,g),Uu(p,s.x,s.y,i.x,v+i.y,a.x,a.y+a.h,r,t.isSDF,u.x,c.y,l,g),Uu(p,s.x,s.y,o.x,v+o.y,a.x+a.w,a.y+a.h,r,t.isSDF,c.x,c.y,l,g),Vu(d,s,y),f.emplaceBack(m,m+1,m+2),f.emplaceBack(m+1,m+2,m+3),A.vertexLength+=4,A.primitiveLength+=2,h.glyphOffsetArray.emplaceBack(t.glyphOffset[0])};if(o.text&&o.text.sections){var _=o.text.sections;if(this.hasPaintOverrides){for(var b,x=function(e,r){void 0===b||b===e&&!r||t.programConfigurations.populatePaintArrays(t.layoutVertexArray.length,o,o.index,{},_[b]),b=e},w=0,E=e;w<E.length;w+=1){var S=E[w];x(S.sectionIndex,!1),v(S)}x(b,!0)}else{for(var O=0,T=e;O<T.length;O+=1)v(T[O]);t.programConfigurations.populatePaintArrays(t.layoutVertexArray.length,o,o.index,{},_[0])}}else{for(var P=0,M=e;P<M.length;P+=1)v(M[P]);t.programConfigurations.populatePaintArrays(t.layoutVertexArray.length,o,o.index,{})}t.placedSymbolArray.emplaceBack(s.x,s.y,g,this.glyphOffsetArray.length-g,m,u,c,s.segment,r?r[0]:0,r?r[1]:0,n[0],n[1],a,0,!1,0,l)},qu.prototype._addCollisionDebugVertex=function(t,e,r,n,i,o){return e.emplaceBack(0,0),t.emplaceBack(r.x,r.y,n,i,Math.round(o.x),Math.round(o.y))},qu.prototype.addCollisionDebugVertices=function(t,e,r,n,o,a,s,u){var c=o.segments.prepareSegment(4,o.layoutVertexArray,o.indexArray),l=c.vertexLength,h=o.layoutVertexArray,f=o.collisionVertexArray,p=s.anchorX,d=s.anchorY;if(this._addCollisionDebugVertex(h,f,a,p,d,new i(t,e)),this._addCollisionDebugVertex(h,f,a,p,d,new i(r,e)),this._addCollisionDebugVertex(h,f,a,p,d,new i(r,n)),this._addCollisionDebugVertex(h,f,a,p,d,new i(t,n)),c.vertexLength+=4,u){var A=o.indexArray;A.emplaceBack(l,l+1,l+2),A.emplaceBack(l,l+2,l+3),c.primitiveLength+=2}else{var g=o.indexArray;g.emplaceBack(l,l+1),g.emplaceBack(l+1,l+2),g.emplaceBack(l+2,l+3),g.emplaceBack(l+3,l),c.primitiveLength+=4}},qu.prototype.addDebugCollisionBoxes=function(t,e,r,n){for(var i=t;i<e;i++){var o=this.collisionBoxArray.get(i),a=o.x1,s=o.y1,u=o.x2,c=o.y2,l=o.radius>0;this.addCollisionDebugVertices(a,s,u,c,l?n?this.textCollisionCircle:this.iconCollisionCircle:n?this.textCollisionBox:this.iconCollisionBox,o.anchorPoint,r,l)}},qu.prototype.generateCollisionDebugBuffers=function(){for(var t=0;t<this.symbolInstances.length;t++){var e=this.symbolInstances.get(t);this.addDebugCollisionBoxes(e.textBoxStartIndex,e.textBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.verticalTextBoxStartIndex,e.verticalTextBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.iconBoxStartIndex,e.iconBoxEndIndex,e,!1),this.addDebugCollisionBoxes(e.verticalIconBoxStartIndex,e.verticalIconBoxEndIndex,e,!1)}},qu.prototype._deserializeCollisionBoxesForSymbol=function(t,e,r,n,i,o,a,s,u){for(var c={},l=e;l<r;l++){var h=t.get(l);if(0===h.radius){c.textBox={x1:h.x1,y1:h.y1,x2:h.x2,y2:h.y2,anchorPointX:h.anchorPointX,anchorPointY:h.anchorPointY},c.textFeatureIndex=h.featureIndex;break}c.textCircles||(c.textCircles=[],c.textFeatureIndex=h.featureIndex),c.textCircles.push(h.anchorPointX,h.anchorPointY,h.radius,h.signedDistanceFromAnchor,1)}for(var f=n;f<i;f++){var p=t.get(f);if(0===p.radius){c.verticalTextBox={x1:p.x1,y1:p.y1,x2:p.x2,y2:p.y2,anchorPointX:p.anchorPointX,anchorPointY:p.anchorPointY},c.verticalTextFeatureIndex=p.featureIndex;break}}for(var d=o;d<a;d++){var A=t.get(d);if(0===A.radius){c.iconBox={x1:A.x1,y1:A.y1,x2:A.x2,y2:A.y2,anchorPointX:A.anchorPointX,anchorPointY:A.anchorPointY},c.iconFeatureIndex=A.featureIndex;break}}for(var g=s;g<u;g++){var m=t.get(g);if(0===m.radius){c.verticalIconBox={x1:m.x1,y1:m.y1,x2:m.x2,y2:m.y2,anchorPointX:m.anchorPointX,anchorPointY:m.anchorPointY},c.verticalIconFeatureIndex=m.featureIndex;break}}return c},qu.prototype.deserializeCollisionBoxes=function(t){this.collisionArrays=[];for(var e=0;e<this.symbolInstances.length;e++){var r=this.symbolInstances.get(e);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex))}},qu.prototype.hasTextData=function(){return this.text.segments.get().length>0},qu.prototype.hasIconData=function(){return this.icon.segments.get().length>0},qu.prototype.hasTextCollisionBoxData=function(){return this.textCollisionBox.segments.get().length>0},qu.prototype.hasIconCollisionBoxData=function(){return this.iconCollisionBox.segments.get().length>0},qu.prototype.hasTextCollisionCircleData=function(){return this.textCollisionCircle.segments.get().length>0},qu.prototype.hasIconCollisionCircleData=function(){return this.iconCollisionCircle.segments.get().length>0},qu.prototype.addIndicesForPlacedSymbol=function(t,e){for(var r=t.placedSymbolArray.get(e),n=r.vertexStartIndex+4*r.numGlyphs,i=r.vertexStartIndex;i<n;i+=4)t.indexArray.emplaceBack(i,i+1,i+2),t.indexArray.emplaceBack(i+1,i+2,i+3)},qu.prototype.getSortedSymbolIndexes=function(t){if(this.sortedAngle===t&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;for(var e=Math.sin(t),r=Math.cos(t),n=[],i=[],o=[],a=0;a<this.symbolInstances.length;++a){o.push(a);var s=this.symbolInstances.get(a);n.push(0|Math.round(e*s.anchorX+r*s.anchorY)),i.push(s.featureIndex)}return o.sort((function(t,e){return n[t]-n[e]||i[e]-i[t]})),o},qu.prototype.sortFeatures=function(t){var e=this;if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var r=0,n=this.symbolInstanceIndexes;r<n.length;r+=1){var i=n[r],o=this.symbolInstances.get(i);this.featureSortOrder.push(o.featureIndex),[o.rightJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.leftJustifiedTextSymbolIndex].forEach((function(t,r,n){t>=0&&n.indexOf(t)===r&&e.addIndicesForPlacedSymbol(e.text,t)})),o.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,o.verticalPlacedTextSymbolIndex),o.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,o.placedIconSymbolIndex),o.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,o.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},dn("SymbolBucket",qu,{omit:["layers","collisionBoxArray","features","compareText"]}),qu.MAX_GLYPHS=65535,qu.addDynamicAttributes=Vu;var Zu=new ti({"symbol-placement":new Qn(Tt.layout_symbol["symbol-placement"]),"symbol-spacing":new Qn(Tt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Qn(Tt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Yn(Tt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Qn(Tt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Qn(Tt.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new Qn(Tt.layout_symbol["icon-ignore-placement"]),"icon-optional":new Qn(Tt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Qn(Tt.layout_symbol["icon-rotation-alignment"]),"icon-size":new Yn(Tt.layout_symbol["icon-size"]),"icon-text-fit":new Qn(Tt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Qn(Tt.layout_symbol["icon-text-fit-padding"]),"icon-image":new Yn(Tt.layout_symbol["icon-image"]),"icon-rotate":new Yn(Tt.layout_symbol["icon-rotate"]),"icon-padding":new Qn(Tt.layout_symbol["icon-padding"]),"icon-keep-upright":new Qn(Tt.layout_symbol["icon-keep-upright"]),"icon-offset":new Yn(Tt.layout_symbol["icon-offset"]),"icon-anchor":new Yn(Tt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Qn(Tt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Qn(Tt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Qn(Tt.layout_symbol["text-rotation-alignment"]),"text-field":new Yn(Tt.layout_symbol["text-field"]),"text-font":new Yn(Tt.layout_symbol["text-font"]),"text-size":new Yn(Tt.layout_symbol["text-size"]),"text-max-width":new Yn(Tt.layout_symbol["text-max-width"]),"text-line-height":new Qn(Tt.layout_symbol["text-line-height"]),"text-letter-spacing":new Yn(Tt.layout_symbol["text-letter-spacing"]),"text-justify":new Yn(Tt.layout_symbol["text-justify"]),"text-radial-offset":new Yn(Tt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Qn(Tt.layout_symbol["text-variable-anchor"]),"text-anchor":new Yn(Tt.layout_symbol["text-anchor"]),"text-max-angle":new Qn(Tt.layout_symbol["text-max-angle"]),"text-writing-mode":new Qn(Tt.layout_symbol["text-writing-mode"]),"text-rotate":new Yn(Tt.layout_symbol["text-rotate"]),"text-padding":new Qn(Tt.layout_symbol["text-padding"]),"text-keep-upright":new Qn(Tt.layout_symbol["text-keep-upright"]),"text-transform":new Yn(Tt.layout_symbol["text-transform"]),"text-offset":new Yn(Tt.layout_symbol["text-offset"]),"text-allow-overlap":new Qn(Tt.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new Qn(Tt.layout_symbol["text-ignore-placement"]),"text-optional":new Qn(Tt.layout_symbol["text-optional"])}),Xu={paint:new ti({"icon-opacity":new Yn(Tt.paint_symbol["icon-opacity"]),"icon-color":new Yn(Tt.paint_symbol["icon-color"]),"icon-halo-color":new Yn(Tt.paint_symbol["icon-halo-color"]),"icon-halo-width":new Yn(Tt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Yn(Tt.paint_symbol["icon-halo-blur"]),"icon-translate":new Qn(Tt.paint_symbol["icon-translate"]),"icon-translate-anchor":new Qn(Tt.paint_symbol["icon-translate-anchor"]),"text-opacity":new Yn(Tt.paint_symbol["text-opacity"]),"text-color":new Yn(Tt.paint_symbol["text-color"],{runtimeType:zt,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new Yn(Tt.paint_symbol["text-halo-color"]),"text-halo-width":new Yn(Tt.paint_symbol["text-halo-width"]),"text-halo-blur":new Yn(Tt.paint_symbol["text-halo-blur"]),"text-translate":new Qn(Tt.paint_symbol["text-translate"]),"text-translate-anchor":new Qn(Tt.paint_symbol["text-translate-anchor"])}),layout:Zu},Qu=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:jt,this.defaultValue=t};Qu.prototype.evaluate=function(t){if(t.formattedSection){var e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default},Qu.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},Qu.prototype.possibleOutputs=function(){return[void 0]},Qu.prototype.serialize=function(){return null},dn("FormatSectionOverride",Qu,{omit:["defaultValue"]});var Yu=function(t){function e(e){t.call(this,e,Xu)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.recalculate=function(e,r){if(t.prototype.recalculate.call(this,e,r),"auto"===this.layout.get("icon-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){var n=this.layout.get("text-writing-mode");if(n){for(var i=[],o=0,a=n;o<a.length;o+=1){var s=a[o];i.indexOf(s)<0&&i.push(s)}this.layout._values["text-writing-mode"]=i}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()},e.prototype.getValueAndResolveTokens=function(t,e,r){var n=this.layout.get(t).evaluate(e,{},r),i=this._unevaluatedLayout._values[t];return i.isDataDriven()||wr(i.value)||!n?n:function(t,e){return e.replace(/{([^{}]+)}/g,(function(e,r){return r in t?String(t[r]):""}))}(e.properties,n)},e.prototype.createBucket=function(t){return new qu(t)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return!1},e.prototype._setPaintOverrides=function(){for(var t=0,r=Xu.paint.overridableProperties;t<r.length;t+=1){var n=r[t];if(e.hasPaintOverride(this.layout,n)){var i,o=this.paint.get(n),a=new Qu(o),s=new xr(a,o.property.specification);i="constant"===o.value.kind||"source"===o.value.kind?new Sr("source",s):new Or("composite",s,o.value.zoomStops,o.value._interpolationType),this.paint._values[n]=new Zn(o.property,i,o.parameters)}}},e.prototype._handleOverridablePaintPropertyUpdate=function(t,r,n){return!(!this.layout||r.isDataDriven()||n.isDataDriven())&&e.hasPaintOverride(this.layout,t)},e.hasPaintOverride=function(t,e){var r=t.get("text-field"),n=Xu.paint.properties[e],i=!1,o=function(t){for(var e=0,r=t;e<r.length;e+=1){var o=r[e];if(n.overrides&&n.overrides.hasOverride(o))return void(i=!0)}};if("constant"===r.value.kind&&r.value.value instanceof Jt)o(r.value.value.sections);else if("source"===r.value.kind){var a=function(t){if(!i)if(t instanceof ie&&re(t.value)===Gt){var e=t.value;o(e.sections)}else t instanceof ue?o(t.sections):t.eachChild(a)},s=r.value;s._styleExpression&&a(s._styleExpression.expression)}return i},e.hasPaintOverrides=function(t){for(var r=0,n=Xu.paint.overridableProperties;r<n.length;r+=1){var i=n[r];if(e.hasPaintOverride(t,i))return!0}return!1},e}(ei),Ku={paint:new ti({"background-color":new Qn(Tt.paint_background["background-color"]),"background-pattern":new $n(Tt.paint_background["background-pattern"]),"background-opacity":new Qn(Tt.paint_background["background-opacity"])})},$u=function(t){function e(e){t.call(this,e,Ku)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(ei),Ju={paint:new ti({"raster-opacity":new Qn(Tt.paint_raster["raster-opacity"]),"raster-hue-rotate":new Qn(Tt.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Qn(Tt.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Qn(Tt.paint_raster["raster-brightness-max"]),"raster-saturation":new Qn(Tt.paint_raster["raster-saturation"]),"raster-contrast":new Qn(Tt.paint_raster["raster-contrast"]),"raster-resampling":new Qn(Tt.paint_raster["raster-resampling"]),"raster-fade-duration":new Qn(Tt.paint_raster["raster-fade-duration"])})},tc=function(t){function e(e){t.call(this,e,Ju)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(ei),ec=function(t){function e(e){t.call(this,e,{}),this.implementation=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.is3D=function(){return"3d"===this.implementation.renderingMode},e.prototype.hasOffscreenPass=function(){return void 0!==this.implementation.prerender},e.prototype.recalculate=function(){},e.prototype.updateTransitions=function(){},e.prototype.hasTransition=function(){},e.prototype.serialize=function(){},e.prototype.onAdd=function(t){this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl)},e.prototype.onRemove=function(t){this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl)},e}(ei),rc={circle:jo,heatmap:Ho,hillshade:Zo,fill:Ra,"fill-extrusion":Ka,line:us,symbol:Yu,background:$u,raster:tc},nc=self.HTMLImageElement,ic=self.HTMLCanvasElement,oc=self.HTMLVideoElement,ac=self.ImageData,sc=function(t,e,r,n){this.context=t,this.format=r,this.texture=t.gl.createTexture(),this.update(e,n)};sc.prototype.update=function(t,e,r){var n=t.width,i=t.height,o=!(this.size&&this.size[0]===n&&this.size[1]===i||r),a=this.context,s=a.gl;if(this.useMipmap=Boolean(e&&e.useMipmap),s.bindTexture(s.TEXTURE_2D,this.texture),a.pixelStoreUnpackFlipY.set(!1),a.pixelStoreUnpack.set(1),a.pixelStoreUnpackPremultiplyAlpha.set(this.format===s.RGBA&&(!e||!1!==e.premultiply)),o)this.size=[n,i],t instanceof nc||t instanceof ic||t instanceof oc||t instanceof ac?s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,s.UNSIGNED_BYTE,t):s.texImage2D(s.TEXTURE_2D,0,this.format,n,i,0,this.format,s.UNSIGNED_BYTE,t.data);else{var u=r||{x:0,y:0},c=u.x,l=u.y;t instanceof nc||t instanceof ic||t instanceof oc||t instanceof ac?s.texSubImage2D(s.TEXTURE_2D,0,c,l,s.RGBA,s.UNSIGNED_BYTE,t):s.texSubImage2D(s.TEXTURE_2D,0,c,l,n,i,s.RGBA,s.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&s.generateMipmap(s.TEXTURE_2D)},sc.prototype.bind=function(t,e,r){var n=this.context.gl;n.bindTexture(n.TEXTURE_2D,this.texture),r!==n.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(r=n.LINEAR),t!==this.filter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,t),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,r||t),this.filter=t),e!==this.wrap&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,e),this.wrap=e)},sc.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},sc.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null};var uc=function(t){var e=this;this._callback=t,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){e._triggered=!1,e._callback()})};uc.prototype.trigger=function(){var t=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((function(){t._triggered=!1,t._callback()}),0))},uc.prototype.remove=function(){delete this._channel,this._callback=function(){}};var cc=function(t,e,r){this.target=t,this.parent=e,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},g(["receive","process"],this),this.invoker=new uc(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=S()?t:self};function lc(t,e,r){var n=2*Math.PI*6378137/256/Math.pow(2,r);return[t*n-2*Math.PI*6378137/2,e*n-2*Math.PI*6378137/2]}cc.prototype.send=function(t,e,r,n,i){var o=this;void 0===i&&(i=!1);var a=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[a]=r);var s=P(this.globalScope)?void 0:[];return this.target.postMessage({id:a,type:t,hasCallback:!!r,targetMapId:n,mustQueue:i,sourceMapId:this.mapId,data:mn(e,s)},s),{cancel:function(){r&&delete o.callbacks[a],o.target.postMessage({id:a,type:"<cancel>",targetMapId:n,sourceMapId:o.mapId})}}},cc.prototype.receive=function(t){var e=t.data,r=e.id;if(r&&(!e.targetMapId||this.mapId===e.targetMapId))if("<cancel>"===e.type){delete this.tasks[r];var n=this.cancelCallbacks[r];delete this.cancelCallbacks[r],n&&n()}else S()||e.mustQueue?(this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,e)},cc.prototype.process=function(){if(this.taskQueue.length){var t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),e&&this.processTask(t,e)}},cc.prototype.processTask=function(t,e){var r=this;if("<response>"===e.type){var n=this.callbacks[t];delete this.callbacks[t],n&&(e.error?n(yn(e.error)):n(null,yn(e.data)))}else{var i=!1,o=P(this.globalScope)?void 0:[],a=e.hasCallback?function(e,n){i=!0,delete r.cancelCallbacks[t],r.target.postMessage({id:t,type:"<response>",sourceMapId:r.mapId,error:e?mn(e):null,data:mn(n,o)},o)}:function(t){i=!0},s=null,u=yn(e.data);if(this.parent[e.type])s=this.parent[e.type](e.sourceMapId,u,a);else if(this.parent.getWorkerSource){var c=e.type.split(".");s=this.parent.getWorkerSource(e.sourceMapId,c[0],u.source)[c[1]](u,a)}else a(new Error("Could not find function "+e.type));!i&&s&&s.cancel&&(this.cancelCallbacks[t]=s.cancel)}},cc.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var hc=function(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))};hc.prototype.setNorthEast=function(t){return this._ne=t instanceof fc?new fc(t.lng,t.lat):fc.convert(t),this},hc.prototype.setSouthWest=function(t){return this._sw=t instanceof fc?new fc(t.lng,t.lat):fc.convert(t),this},hc.prototype.extend=function(t){var e,r,n=this._sw,i=this._ne;if(t instanceof fc)e=t,r=t;else{if(!(t instanceof hc))return Array.isArray(t)?t.every(Array.isArray)?this.extend(hc.convert(t)):this.extend(fc.convert(t)):this;if(e=t._sw,r=t._ne,!e||!r)return this}return n||i?(n.lng=Math.min(e.lng,n.lng),n.lat=Math.min(e.lat,n.lat),i.lng=Math.max(r.lng,i.lng),i.lat=Math.max(r.lat,i.lat)):(this._sw=new fc(e.lng,e.lat),this._ne=new fc(r.lng,r.lat)),this},hc.prototype.getCenter=function(){return new fc((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},hc.prototype.getSouthWest=function(){return this._sw},hc.prototype.getNorthEast=function(){return this._ne},hc.prototype.getNorthWest=function(){return new fc(this.getWest(),this.getNorth())},hc.prototype.getSouthEast=function(){return new fc(this.getEast(),this.getSouth())},hc.prototype.getWest=function(){return this._sw.lng},hc.prototype.getSouth=function(){return this._sw.lat},hc.prototype.getEast=function(){return this._ne.lng},hc.prototype.getNorth=function(){return this._ne.lat},hc.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},hc.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},hc.prototype.isEmpty=function(){return!(this._sw&&this._ne)},hc.prototype.contains=function(t){var e=fc.convert(t),r=e.lng,n=e.lat,i=this._sw.lat<=n&&n<=this._ne.lat,o=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(o=this._sw.lng>=r&&r>=this._ne.lng),i&&o},hc.convert=function(t){return!t||t instanceof hc?t:new hc(t)};var fc=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};fc.prototype.wrap=function(){return new fc(l(this.lng,-180,180),this.lat)},fc.prototype.toArray=function(){return[this.lng,this.lat]},fc.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},fc.prototype.toBounds=function(t){void 0===t&&(t=0);var e=360*t/40075017,r=e/Math.cos(Math.PI/180*this.lat);return new hc(new fc(this.lng-r,this.lat-e),new fc(this.lng+r,this.lat+e))},fc.convert=function(t){if(t instanceof fc)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new fc(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new fc(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")};var pc=2*Math.PI*6378137;function dc(t){return pc*Math.cos(t*Math.PI/180)}function Ac(t){return(180+t)/360}function gc(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function mc(t,e){return t/dc(e)}function yc(t){var e=180-360*t;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}var vc=function(t,e,r){void 0===r&&(r=0),this.x=+t,this.y=+e,this.z=+r};vc.fromLngLat=function(t,e){void 0===e&&(e=0);var r=fc.convert(t);return new vc(Ac(r.lng),gc(r.lat),mc(e,r.lat))},vc.prototype.toLngLat=function(){return new fc(360*this.x-180,yc(this.y))},vc.prototype.toAltitude=function(){return this.z*dc(yc(this.y))},vc.prototype.meterInMercatorCoordinateUnits=function(){return 1/pc*(t=yc(this.y),1/Math.cos(t*Math.PI/180));var t};var _c=function(t,e,r){this.z=t,this.x=e,this.y=r,this.key=wc(0,t,e,r)};_c.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},_c.prototype.url=function(t,e){var r,n,i,o,a,s=(r=this.x,n=this.y,i=this.z,o=lc(256*r,256*(n=Math.pow(2,i)-n-1),i),a=lc(256*(r+1),256*(n+1),i),o[0]+","+o[1]+","+a[0]+","+a[1]),u=function(t,e,r){for(var n,i="",o=t;o>0;o--)i+=(e&(n=1<<o-1)?1:0)+(r&n?2:0);return i}(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String("tms"===e?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",u).replace("{bbox-epsg-3857}",s)},_c.prototype.getTilePoint=function(t){var e=Math.pow(2,this.z);return new i((t.x*e-this.x)*lo,(t.y*e-this.y)*lo)},_c.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var bc=function(t,e){this.wrap=t,this.canonical=e,this.key=wc(t,e.z,e.x,e.y)},xc=function(t,e,r,n,i){this.overscaledZ=t,this.wrap=e,this.canonical=new _c(r,+n,+i),this.key=wc(e,t,n,i)};function wc(t,e,r,n){(t*=2)<0&&(t=-1*t-1);var i=1<<e;return 32*(i*i*t+i*n+r)+e}xc.prototype.equals=function(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)},xc.prototype.scaledTo=function(t){var e=this.canonical.z-t;return t>this.canonical.z?new xc(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new xc(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},xc.prototype.isChildOf=function(t){if(t.wrap!==this.wrap)return!1;var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ<this.overscaledZ&&t.canonical.x===this.canonical.x>>e&&t.canonical.y===this.canonical.y>>e},xc.prototype.children=function(t){if(this.overscaledZ>=t)return[new xc(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new xc(e,this.wrap,e,r,n),new xc(e,this.wrap,e,r+1,n),new xc(e,this.wrap,e,r,n+1),new xc(e,this.wrap,e,r+1,n+1)]},xc.prototype.isLessThan=function(t){return this.wrap<t.wrap||!(this.wrap>t.wrap)&&(this.overscaledZ<t.overscaledZ||!(this.overscaledZ>t.overscaledZ)&&(this.canonical.x<t.canonical.x||!(this.canonical.x>t.canonical.x)&&this.canonical.y<t.canonical.y))},xc.prototype.wrapped=function(){return new xc(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},xc.prototype.unwrapTo=function(t){return new xc(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)},xc.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},xc.prototype.toUnwrapped=function(){return new bc(this.wrap,this.canonical)},xc.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},xc.prototype.getTilePoint=function(t){return this.canonical.getTilePoint(new vc(t.x-this.wrap,t.y))},dn("CanonicalTileID",_c),dn("OverscaledTileID",xc,{omit:["posMatrix"]});var Ec=function(t,e,r){if(this.uid=t,e.height!==e.width)throw new RangeError("DEM tiles must be square");if(r&&"mapbox"!==r&&"terrarium"!==r)return x('"'+r+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');this.stride=e.height;var n=this.dim=e.height-2;this.data=new Uint32Array(e.data.buffer),this.encoding=r||"mapbox";for(var i=0;i<n;i++)this.data[this._idx(-1,i)]=this.data[this._idx(0,i)],this.data[this._idx(n,i)]=this.data[this._idx(n-1,i)],this.data[this._idx(i,-1)]=this.data[this._idx(i,0)],this.data[this._idx(i,n)]=this.data[this._idx(i,n-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(n,-1)]=this.data[this._idx(n-1,0)],this.data[this._idx(-1,n)]=this.data[this._idx(0,n-1)],this.data[this._idx(n,n)]=this.data[this._idx(n-1,n-1)]};Ec.prototype.get=function(t,e){var r=new Uint8Array(this.data.buffer),n=4*this._idx(t,e);return("terrarium"===this.encoding?this._unpackTerrarium:this._unpackMapbox)(r[n],r[n+1],r[n+2])},Ec.prototype.getUnpackVector=function(){return"terrarium"===this.encoding?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},Ec.prototype._idx=function(t,e){if(t<-1||t>=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)},Ec.prototype._unpackMapbox=function(t,e,r){return(256*t*256+256*e+r)/10-1e4},Ec.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},Ec.prototype.getPixels=function(){return new Vo({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Ec.prototype.backfillBorder=function(t,e,r){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var n=e*this.dim,i=e*this.dim+this.dim,o=r*this.dim,a=r*this.dim+this.dim;switch(e){case-1:n=i-1;break;case 1:i=n+1}switch(r){case-1:o=a-1;break;case 1:a=o+1}for(var s=-e*this.dim,u=-r*this.dim,c=o;c<a;c++)for(var l=n;l<i;l++)this.data[this._idx(l,c)]=t.data[this._idx(l+s,c+u)]},dn("DEMData",Ec);var Sc=oi([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),Oc=function(t){this._stringToNumber={},this._numberToString=[];for(var e=0;e<t.length;e++){var r=t[e];this._stringToNumber[r]=e,this._numberToString[e]=r}};Oc.prototype.encode=function(t){return this._stringToNumber[t]},Oc.prototype.decode=function(t){return this._numberToString[t]};var Tc=function(t,e,r,n){this.type="Feature",this._vectorTileFeature=t,t._z=e,t._x=r,t._y=n,this.properties=t.properties,null!=t.id&&(this.id=t.id)},Pc={geometry:{configurable:!0}};Pc.geometry.get=function(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},Pc.geometry.set=function(t){this._geometry=t},Tc.prototype.toJSON=function(){var t={geometry:this.geometry};for(var e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&(t[e]=this[e]);return t},Object.defineProperties(Tc.prototype,Pc);var Mc=function(){this.state={},this.stateChanges={},this.deletedStates={}};Mc.prototype.updateState=function(t,e,r){var n=String(e);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][n]=this.stateChanges[t][n]||{},h(this.stateChanges[t][n],r),null===this.deletedStates[t])for(var i in this.deletedStates[t]={},this.state[t])i!==n&&(this.deletedStates[t][i]=null);else if(this.deletedStates[t]&&null===this.deletedStates[t][n])for(var o in this.deletedStates[t][n]={},this.state[t][n])r[o]||(this.deletedStates[t][n][o]=null);else for(var a in r)this.deletedStates[t]&&this.deletedStates[t][n]&&null===this.deletedStates[t][n][a]&&delete this.deletedStates[t][n][a]},Mc.prototype.removeFeatureState=function(t,e,r){if(null!==this.deletedStates[t]){var n=String(e);if(this.deletedStates[t]=this.deletedStates[t]||{},r&&void 0!==e&&e>=0)null!==this.deletedStates[t][n]&&(this.deletedStates[t][n]=this.deletedStates[t][n]||{},this.deletedStates[t][n][r]=null);else if(void 0!==e&&e>=0)if(this.stateChanges[t]&&this.stateChanges[t][n])for(r in this.deletedStates[t][n]={},this.stateChanges[t][n])this.deletedStates[t][n][r]=null;else this.deletedStates[t][n]=null;else this.deletedStates[t]=null}},Mc.prototype.getState=function(t,e){var r=String(e),n=this.state[t]||{},i=this.stateChanges[t]||{},o=h({},n[r],i[r]);if(null===this.deletedStates[t])return{};if(this.deletedStates[t]){var a=this.deletedStates[t][e];if(null===a)return{};for(var s in a)delete o[s]}return o},Mc.prototype.initializeTileState=function(t,e){t.setFeatureState(this.state,e)},Mc.prototype.coalesceChanges=function(t,e){var r={};for(var n in this.stateChanges){this.state[n]=this.state[n]||{};var i={};for(var o in this.stateChanges[n])this.state[n][o]||(this.state[n][o]={}),h(this.state[n][o],this.stateChanges[n][o]),i[o]=this.state[n][o];r[n]=i}for(var a in this.deletedStates){this.state[a]=this.state[a]||{};var s={};if(null===this.deletedStates[a])for(var u in this.state[a])s[u]={},this.state[a][u]={};else for(var c in this.deletedStates[a]){if(null===this.deletedStates[a][c])this.state[a][c]={};else for(var l=0,f=Object.keys(this.deletedStates[a][c]);l<f.length;l+=1){var p=f[l];delete this.state[a][c][p]}s[c]=this.state[a][c]}r[a]=r[a]||{},h(r[a],s)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(r).length)for(var d in t)t[d].setFeatureState(r,e)};var Cc=function(t,e,r){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=e||new ln(lo,16,0),this.grid3D=new ln(lo,16,0),this.featureIndexArray=r||new zi};function Ic(t){for(var e=1/0,r=1/0,n=-1/0,i=-1/0,o=0,a=t;o<a.length;o+=1){var s=a[o];e=Math.min(e,s.x),r=Math.min(r,s.y),n=Math.max(n,s.x),i=Math.max(i,s.y)}return{minX:e,minY:r,maxX:n,maxY:i}}function kc(t,e){return e-t}Cc.prototype.insert=function(t,e,r,n,i,o){var a=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,n,i);for(var s=o?this.grid3D:this.grid,u=0;u<e.length;u++){for(var c=e[u],l=[1/0,1/0,-1/0,-1/0],h=0;h<c.length;h++){var f=c[h];l[0]=Math.min(l[0],f.x),l[1]=Math.min(l[1],f.y),l[2]=Math.max(l[2],f.x),l[3]=Math.max(l[3],f.y)}l[0]<lo&&l[1]<lo&&l[2]>=0&&l[3]>=0&&s.insert(a,l[0],l[1],l[2],l[3])}},Cc.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Ga.VectorTile(new vs(this.rawTileData)).layers,this.sourceLayerCoder=new Oc(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Cc.prototype.query=function(t,e,r){var n=this;this.loadVTLayers();for(var o=t.params||{},a=lo/t.tileSize/t.scale,s=Br(o.filter),u=t.queryGeometry,c=t.queryPadding*a,l=Ic(u),h=this.grid.query(l.minX-c,l.minY-c,l.maxX+c,l.maxY+c),f=Ic(t.cameraQueryGeometry),p=0,d=this.grid3D.query(f.minX-c,f.minY-c,f.maxX+c,f.maxY+c,(function(e,r,n,o){return function(t,e,r,n,o){for(var a=0,s=t;a<s.length;a+=1){var u=s[a];if(e<=u.x&&r<=u.y&&n>=u.x&&o>=u.y)return!0}var c=[new i(e,r),new i(e,o),new i(n,o),new i(n,r)];if(t.length>2)for(var l=0,h=c;l<h.length;l+=1)if(So(t,h[l]))return!0;for(var f=0;f<t.length-1;f++)if(Oo(t[f],t[f+1],c))return!0;return!1}(t.cameraQueryGeometry,e-c,r-c,n+c,o+c)}));p<d.length;p+=1){var A=d[p];h.push(A)}h.sort(kc);for(var g,m={},y=function(i){var c=h[i];if(c!==g){g=c;var l=n.featureIndexArray.get(c),f=null;n.loadMatchingFeature(m,l.bucketIndex,l.sourceLayerIndex,l.featureIndex,s,o.layers,e,(function(e,i){f||(f=fo(e));var o={};return e.id&&(o=r.getState(i.sourceLayer||"_geojsonTileLayer",e.id)),i.queryIntersectsFeature(u,e,o,f,n.z,t.transform,a,t.pixelPosMatrix)}))}},v=0;v<h.length;v++)y(v);return m},Cc.prototype.loadMatchingFeature=function(t,e,r,n,i,o,a,s){var u=this.bucketLayerIDs[e];if(!o||function(t,e){for(var r=0;r<t.length;r++)if(e.indexOf(t[r])>=0)return!0;return!1}(o,u)){var c=this.sourceLayerCoder.decode(r),l=this.vtLayers[c].feature(n);if(i(new Nn(this.tileID.overscaledZ),l))for(var h=0;h<u.length;h++){var f=u[h];if(!(o&&o.indexOf(f)<0)){var p=a[f];if(p){var d=!s||s(l,p);if(d){var A=new Tc(l,this.z,this.x,this.y);A.layer=p.serialize();var g=t[f];void 0===g&&(g=t[f]=[]),g.push({featureIndex:n,feature:A,intersectionZ:d})}}}}}},Cc.prototype.lookupSymbolFeatures=function(t,e,r,n,i,o){var a={};this.loadVTLayers();for(var s=Br(n),u=0,c=t;u<c.length;u+=1){var l=c[u];this.loadMatchingFeature(a,e,r,l,s,i,o)}return a},Cc.prototype.hasLayer=function(t){for(var e=0,r=this.bucketLayerIDs;e<r.length;e+=1)for(var n=0,i=r[e];n<i.length;n+=1)if(t===i[n])return!0;return!1},dn("FeatureIndex",Cc,{omit:["rawTileData","sourceLayerCoder"]});var Rc=function(t,e){this.tileID=t,this.uid=p(),this.uses=0,this.tileSize=e,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.expiredRequestCount=0,this.state="loading"};Rc.prototype.registerFadeDuration=function(t){var e=t+this.timeAdded;e<B.now()||this.fadeEndTime&&e<this.fadeEndTime||(this.fadeEndTime=e)},Rc.prototype.wasRequested=function(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state},Rc.prototype.loadVectorData=function(t,e,r){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){for(var n in t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestFeatureIndex.rawTileData=t.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=function(t,e){var r={};if(!e)return r;for(var n=function(){var t=o[i],n=t.layerIds.map((function(t){return e.getLayer(t)})).filter(Boolean);if(0!==n.length){t.layers=n,t.stateDependentLayerIds&&(t.stateDependentLayers=t.stateDependentLayerIds.map((function(t){return n.filter((function(e){return e.id===t}))[0]})));for(var a=0,s=n;a<s.length;a+=1){var u=s[a];r[u.id]=t}}},i=0,o=t;i<o.length;i+=1)n();return r}(t.buckets,e.style),this.hasSymbolBuckets=!1,this.buckets){var i=this.buckets[n];if(i instanceof qu){if(this.hasSymbolBuckets=!0,!r)break;i.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(var o in this.buckets){var a=this.buckets[o];if(a instanceof qu&&a.hasRTLText){this.hasRTLText=!0,zn.isLoading()||zn.isLoaded()||"deferred"!==Bn()||Fn();break}}for(var s in this.queryPadding=0,this.buckets){var u=this.buckets[s];this.queryPadding=Math.max(this.queryPadding,e.style.getLayer(s).queryRadius(u))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new Mi},Rc.prototype.unloadVectorData=function(){for(var t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"},Rc.prototype.getBucket=function(t){return this.buckets[t.id]},Rc.prototype.upload=function(t){for(var e in this.buckets){var r=this.buckets[e];r.uploadPending()&&r.upload(t)}var n=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new sc(t,this.imageAtlas.image,n.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new sc(t,this.glyphAtlasImage,n.ALPHA),this.glyphAtlasImage=null)},Rc.prototype.prepare=function(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)},Rc.prototype.queryRenderedFeatures=function(t,e,r,n,i,o,a,s,u){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:r,cameraQueryGeometry:n,scale:i,tileSize:this.tileSize,pixelPosMatrix:u,transform:a,params:o,queryPadding:this.queryPadding*s},t,e):{}},Rc.prototype.querySourceFeatures=function(t,e){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData){var r=this.latestFeatureIndex.loadVTLayers(),n=e?e.sourceLayer:"",i=r._geojsonTileLayer||r[n];if(i)for(var o=Br(e&&e.filter),a=this.tileID.canonical,s=a.z,u=a.x,c=a.y,l={z:s,x:u,y:c},h=0;h<i.length;h++){var f=i.feature(h);if(o(new Nn(this.tileID.overscaledZ),f)){var p=new Tc(f,s,u,c);p.tile=l,t.push(p)}}}},Rc.prototype.clearMask=function(){this.segments&&(this.segments.destroy(),delete this.segments),this.maskedBoundsBuffer&&(this.maskedBoundsBuffer.destroy(),delete this.maskedBoundsBuffer),this.maskedIndexBuffer&&(this.maskedIndexBuffer.destroy(),delete this.maskedIndexBuffer),delete this.mask},Rc.prototype.setMask=function(t,e){if(!a(this.mask,t)&&(this.clearMask(),this.mask=t,!a(t,{0:!0}))){var r=new ui,n=new wi;this.segments=new Ui,this.segments.prepareSegment(0,r,n);for(var o=Object.keys(t),s=0;s<o.length;s++){var u=t[+o[s]],c=lo>>u.z,l=new i(u.x*c,u.y*c),h=new i(l.x+c,l.y+c),f=this.segments.prepareSegment(4,r,n);r.emplaceBack(l.x,l.y,l.x,l.y),r.emplaceBack(h.x,l.y,h.x,l.y),r.emplaceBack(l.x,h.y,l.x,h.y),r.emplaceBack(h.x,h.y,h.x,h.y);var p=f.vertexLength;n.emplaceBack(p,p+1,p+2),n.emplaceBack(p+1,p+2,p+3),f.vertexLength+=4,f.primitiveLength+=2}this.maskedBoundsBuffer=e.createVertexBuffer(r,Sc.members),this.maskedIndexBuffer=e.createIndexBuffer(n)}},Rc.prototype.hasData=function(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state},Rc.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},Rc.prototype.setExpiryData=function(t){var e=this.expirationTime;if(t.cacheControl){var r=O(t.cacheControl);r["max-age"]&&(this.expirationTime=Date.now()+1e3*r["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){var n=Date.now(),i=!1;if(this.expirationTime>n)i=!1;else if(e)if(this.expirationTime<e)i=!0;else{var o=this.expirationTime-e;o?this.expirationTime=n+Math.max(o,3e4):i=!0}else i=!0;i?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}},Rc.prototype.getExpiryTimeout=function(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-(new Date).getTime(),Math.pow(2,31)-1)},Rc.prototype.setFeatureState=function(t,e){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData&&0!==Object.keys(t).length){var r=this.latestFeatureIndex.loadVTLayers();for(var n in this.buckets){var i=this.buckets[n],o=i.layers[0].sourceLayer||"_geojsonTileLayer",a=r[o],s=t[o];a&&s&&0!==Object.keys(s).length&&(i.update(s,a,this.imageAtlas&&this.imageAtlas.patternPositions||{}),e&&e.style&&(this.queryPadding=Math.max(this.queryPadding,e.style.getLayer(n).queryRadius(i))))}}},Rc.prototype.holdingForFade=function(){return void 0!==this.symbolFadeHoldUntil},Rc.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<B.now()},Rc.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},Rc.prototype.setHoldDuration=function(t){this.symbolFadeHoldUntil=B.now()+t},Rc.prototype.setDependencies=function(t,e){for(var r={},n=0,i=e;n<i.length;n+=1)r[i[n]]=!0;this.dependencies[t]=r},Rc.prototype.hasDependency=function(t,e){for(var r=0,n=t;r<n.length;r+=1){var i=n[r],o=this.dependencies[i];if(o)for(var a=0,s=e;a<s.length;a+=1)if(o[s[a]])return!0}return!1},t.Actor=cc,t.AlphaImage=Uo,t.CanonicalTileID=_c,t.CollisionBoxArray=Mi,t.Color=Yt,t.DEMData=Ec,t.DataConstantProperty=Qn,t.DictionaryCoder=Oc,t.EXTENT=lo,t.ErrorEvent=St,t.EvaluationParameters=Nn,t.Event=Et,t.Evented=Ot,t.FeatureIndex=Cc,t.FillBucket=Ca,t.FillExtrusionBucket=Za,t.ImageAtlas=Gs,t.ImagePosition=Us,t.LineBucket=is,t.LngLat=fc,t.LngLatBounds=hc,t.MercatorCoordinate=vc,t.ONE_EM=24,t.OverscaledTileID=xc,t.Point=i,t.Point$1=i,t.ProgramConfiguration=ao,t.Properties=ti,t.Protobuf=vs,t.RGBAImage=Vo,t.RequestManager=W,t.ResourceType=ft,t.SegmentVector=Ui,t.SourceFeatureState=Mc,t.StructArrayLayout1ui2=Si,t.StructArrayLayout2i4=si,t.StructArrayLayout2ui4=Ei,t.StructArrayLayout3ui6=wi,t.StructArrayLayout4i8=ui,t.SymbolBucket=qu,t.Texture=sc,t.Tile=Rc,t.Transitionable=Gn,t.Uniform1f=Zi,t.Uniform1i=qi,t.Uniform2f=Xi,t.Uniform3f=Qi,t.Uniform4f=Yi,t.UniformColor=Ki,t.UniformMatrix4f=Ji,t.UnwrappedTileID=bc,t.ValidationError=Pt,t.WritingMode=Ws,t.ZoomHistory=vn,t.addDynamicAttributes=Vu,t.asyncAll=function(t,e,r){if(!t.length)return r(null,[]);var n=t.length,i=new Array(t.length),o=null;t.forEach((function(t,a){e(t,(function(t,e){t&&(o=t),i[a]=e,0==--n&&r(o,i)}))}))},t.bezier=s,t.bindAll=g,t.browser=B,t.cacheEntryPossiblyAdded=function(t){++ht>ut&&(t.getActor().send("enforceCacheSizeLimit",st),ht=0)},t.clamp=c,t.clearTileCache=function(t){var e=self.caches.delete(at);t&&e.catch(t).then((function(){return t()}))},t.clone=function(t){var e=new Ro(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],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},t.clone$1=_,t.config=F,t.create=function(){var t=new Ro(16);return Ro!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.create$1=function(){var t=new Ro(9);return Ro!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t},t.create$2=function(){var t=new Ro(4);return Ro!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},t.createCommonjsModule=e,t.createExpression=Er,t.createLayout=oi,t.createStyleLayer=function(t){return"custom"===t.type?new ec(t):new rc[t.type](t)},t.deepEqual=a,t.ease=u,t.emitValidationErrors=cn,t.endsWith=m,t.enforceCacheSizeLimit=function(t){ct(),J&&J.then((function(e){e.keys().then((function(r){for(var n=0;n<r.length-t;n++)e.delete(r[n])}))}))},t.evaluateSizeForFeature=su,t.evaluateSizeForZoom=uu,t.evaluateVariableOffset=Ru,t.evented=Dn,t.extend=h,t.featureFilter=Br,t.filterObject=v,t.fromRotation=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},t.getAnchorAlignment=eu,t.getAnchorJustification=Lu,t.getArrayBuffer=vt,t.getImage=bt,t.getJSON=function(t,e){return yt(h(t,{type:"json"}),e)},t.getRTLTextPluginStatus=Bn,t.getReferrer=dt,t.getVideo=function(t,e){var r,n,i=self.document.createElement("video");i.muted=!0,i.onloadstart=function(){e(null,i)};for(var o=0;o<t.length;o++){var a=self.document.createElement("source");r=t[o],n=void 0,(n=self.document.createElement("a")).href=r,(n.protocol!==self.document.location.protocol||n.host!==self.document.location.host)&&(i.crossOrigin="Anonymous"),a.src=t[o],i.appendChild(a)}return{cancel:function(){}}},t.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},t.invert=function(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],h=e[9],f=e[10],p=e[11],d=e[12],A=e[13],g=e[14],m=e[15],y=r*s-n*a,v=r*u-i*a,_=r*c-o*a,b=n*u-i*s,x=n*c-o*s,w=i*c-o*u,E=l*A-h*d,S=l*g-f*d,O=l*m-p*d,T=h*g-f*A,P=h*m-p*A,M=f*m-p*g,C=y*M-v*P+_*T+b*O-x*S+w*E;return C?(C=1/C,t[0]=(s*M-u*P+c*T)*C,t[1]=(i*P-n*M-o*T)*C,t[2]=(A*w-g*x+m*b)*C,t[3]=(f*x-h*w-p*b)*C,t[4]=(u*O-a*M-c*S)*C,t[5]=(r*M-i*O+o*S)*C,t[6]=(g*_-d*w-m*v)*C,t[7]=(l*w-f*_+p*v)*C,t[8]=(a*P-s*O+c*E)*C,t[9]=(n*O-r*P-o*E)*C,t[10]=(d*x-A*_+m*y)*C,t[11]=(h*_-l*x-p*y)*C,t[12]=(s*S-a*T-u*E)*C,t[13]=(r*T-n*S+i*E)*C,t[14]=(A*v-d*b-g*y)*C,t[15]=(l*b-h*v+f*y)*C,t):null},t.isChar=_n,t.isMapboxURL=H,t.keysDifference=function(t,e){var r=[];for(var n in t)n in e||r.push(n);return r},t.makeRequest=yt,t.mapObject=y,t.mercatorXfromLng=Ac,t.mercatorYfromLat=gc,t.mercatorZfromAltitude=mc,t.multiply=function(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],f=e[9],p=e[10],d=e[11],A=e[12],g=e[13],m=e[14],y=e[15],v=r[0],_=r[1],b=r[2],x=r[3];return t[0]=v*n+_*s+b*h+x*A,t[1]=v*i+_*u+b*f+x*g,t[2]=v*o+_*c+b*p+x*m,t[3]=v*a+_*l+b*d+x*y,v=r[4],_=r[5],b=r[6],x=r[7],t[4]=v*n+_*s+b*h+x*A,t[5]=v*i+_*u+b*f+x*g,t[6]=v*o+_*c+b*p+x*m,t[7]=v*a+_*l+b*d+x*y,v=r[8],_=r[9],b=r[10],x=r[11],t[8]=v*n+_*s+b*h+x*A,t[9]=v*i+_*u+b*f+x*g,t[10]=v*o+_*c+b*p+x*m,t[11]=v*a+_*l+b*d+x*y,v=r[12],_=r[13],b=r[14],x=r[15],t[12]=v*n+_*s+b*h+x*A,t[13]=v*i+_*u+b*f+x*g,t[14]=v*o+_*c+b*p+x*m,t[15]=v*a+_*l+b*d+x*y,t},t.mvt=Ga,t.number=we,t.ortho=function(t,e,r,n,i,o,a){var s=1/(e-r),u=1/(n-i),c=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*u,t[14]=(a+o)*c,t[15]=1,t},t.parseGlyphPBF=function(t){return new vs(t).readFields(Bs,[])},t.pbf=vs,t.performSymbolLayout=function(t,e,r,n,o,a){t.createArrays();var s=512*t.overscaling;t.tilePixelRatio=lo/s,t.compareText={},t.iconsNeedLinear=!1;var u=t.layers[0].layout,c=t.layers[0]._unevaluatedLayout._values,l={};if("composite"===t.textSizeData.kind){var h=t.textSizeData,f=h.minZoom,p=h.maxZoom;l.compositeTextSizes=[c["text-size"].possiblyEvaluate(new Nn(f)),c["text-size"].possiblyEvaluate(new Nn(p))]}if("composite"===t.iconSizeData.kind){var d=t.iconSizeData,A=d.minZoom,g=d.maxZoom;l.compositeIconSizes=[c["icon-size"].possiblyEvaluate(new Nn(A)),c["icon-size"].possiblyEvaluate(new Nn(g))]}l.layoutTextSize=c["text-size"].possiblyEvaluate(new Nn(t.zoom+1)),l.layoutIconSize=c["icon-size"].possiblyEvaluate(new Nn(t.zoom+1)),l.textMaxSize=c["text-size"].possiblyEvaluate(new Nn(18));for(var m=24*u.get("text-line-height"),y="map"===u.get("text-rotation-alignment")&&"point"!==u.get("symbol-placement"),v=u.get("text-keep-upright"),_=u.get("text-size"),b=function(){var a=E[w],s=u.get("text-font").evaluate(a,{}).join(","),c=_.evaluate(a,{}),h=l.layoutTextSize.evaluate(a,{}),f=l.layoutIconSize.evaluate(a,{}),p={horizontal:{},vertical:void 0},d=a.text,A=[0,0];if(d){var g=d.toString(),b=24*u.get("text-letter-spacing").evaluate(a,{}),S=function(t){for(var e=0,r=t;e<r.length;e+=1)if(!xn(r[e].charCodeAt(0)))return!1;return!0}(g)?b:0,O=u.get("text-anchor").evaluate(a,{}),T=u.get("text-variable-anchor");if(!T){var P=u.get("text-radial-offset").evaluate(a,{});A=P?Ru(O,[24*P,ku]):u.get("text-offset").evaluate(a,{}).map((function(t){return 24*t}))}var M=y?"center":u.get("text-justify").evaluate(a,{}),C=u.get("symbol-placement"),I="point"===C?24*u.get("text-max-width").evaluate(a,{}):0,k=function(){t.allowVerticalPlacement&&bn(g)&&(p.vertical=Zs(d,e,r,o,s,I,m,O,"left",S,A,Ws.vertical,!0,C,h,c))};if(!y&&T){for(var R="auto"===M?T.map((function(t){return Lu(t)})):[M],L=!1,j=0;j<R.length;j++){var D=R[j];if(!p.horizontal[D])if(L)p.horizontal[D]=p.horizontal[0];else{var B=Zs(d,e,r,o,s,I,m,"center",D,S,A,Ws.horizontal,!1,C,h,c);B&&(p.horizontal[D]=B,L=1===B.positionedLines.length)}}k()}else{"auto"===M&&(M=Lu(O));var F=Zs(d,e,r,o,s,I,m,O,M,S,A,Ws.horizontal,!1,C,h,c);F&&(p.horizontal[M]=F),k(),bn(g)&&y&&v&&(p.vertical=Zs(d,e,r,o,s,I,m,O,M,S,A,Ws.vertical,!1,C,h,c))}}var z=void 0,N=!1;if(a.icon&&a.icon.name){var U=n[a.icon.name];U&&(z=function(t,e,r){var n=eu(r),i=n.horizontalAlign,o=n.verticalAlign,a=e[0],s=e[1],u=a-t.displaySize[0]*i,c=u+t.displaySize[0],l=s-t.displaySize[1]*o;return{image:t,top:l,bottom:l+t.displaySize[1],left:u,right:c}}(o[a.icon.name],u.get("icon-offset").evaluate(a,{}),u.get("icon-anchor").evaluate(a,{})),N=U.sdf,void 0===t.sdfIcons?t.sdfIcons=U.sdf:t.sdfIcons!==U.sdf&&x("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),U.pixelRatio!==t.pixelRatio?t.iconsNeedLinear=!0:0!==u.get("icon-rotate").constantOr(1)&&(t.iconsNeedLinear=!0))}var V=Bu(p.horizontal)||p.vertical;t.iconsInText=!!V&&V.iconsInText,(V||z)&&function(t,e,r,n,o,a,s,u,c,l){var h=a.textMaxSize.evaluate(e,{});void 0===h&&(h=s);var f,p=t.layers[0].layout,d=p.get("icon-offset").evaluate(e,{}),A=Bu(r.horizontal),g=s/24,m=t.tilePixelRatio*g,y=t.tilePixelRatio*h/24,v=t.tilePixelRatio*u,_=t.tilePixelRatio*p.get("symbol-spacing"),b=p.get("text-padding")*t.tilePixelRatio,w=p.get("icon-padding")*t.tilePixelRatio,E=p.get("text-max-angle")/180*Math.PI,S="map"===p.get("text-rotation-alignment")&&"point"!==p.get("symbol-placement"),O="map"===p.get("icon-rotation-alignment")&&"point"!==p.get("symbol-placement"),T=p.get("symbol-placement"),P=_/2,M=p.get("icon-text-fit");n&&"none"!==M&&(t.allowVerticalPlacement&&r.vertical&&(f=nu(n,r.vertical,M,p.get("icon-text-fit-padding"),d,g)),A&&(n=nu(n,A,M,p.get("icon-text-fit-padding"),d,g)));var C=function(i,s){s.x<0||s.x>=lo||s.y<0||s.y>=lo||function(t,e,r,n,i,o,a,s,u,c,l,h,f,p,d,A,g,m,y,v,_,b,w){var E,S,O,T,P,M=t.addToLineVertexArray(e,r),C=0,I=0,k=0,R=0,L=-1,j=-1,D={},B=Mu(""),F=0,z=0;if(void 0===s._unevaluatedLayout.getValue("text-radial-offset")?(F=(E=s.layout.get("text-offset").evaluate(_,{}).map((function(t){return 24*t})))[0],z=E[1]):(F=24*s.layout.get("text-radial-offset").evaluate(_,{}),z=ku),t.allowVerticalPlacement&&n.vertical){var N=s.layout.get("text-rotate").evaluate(_,{})+90,U=n.vertical;T=new bu(u,r,e,c,l,h,U,f,p,d,t.overscaling,N),a&&(P=new bu(u,r,e,c,l,h,a,g,m,d,t.overscaling,N))}if(i){var V=s.layout.get("icon-rotate").evaluate(_,{}),G="none"!==s.layout.get("icon-text-fit"),W=gu(i,V,w,G),H=a?gu(a,V,w,G):void 0;O=new bu(u,r,e,c,l,h,i,g,m,!1,t.overscaling,V),C=4*W.length;var q=t.iconSizeData,Z=null;"source"===q.kind?(Z=[ou*s.layout.get("icon-size").evaluate(_,{})])[0]>ju&&x(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):"composite"===q.kind&&((Z=[ou*b.compositeIconSizes[0].evaluate(_,{}),ou*b.compositeIconSizes[1].evaluate(_,{})])[0]>ju||Z[1]>ju)&&x(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),t.addSymbols(t.icon,W,Z,v,y,_,!1,e,M.lineStartIndex,M.lineLength,-1),L=t.icon.placedSymbolArray.length-1,H&&(I=4*H.length,t.addSymbols(t.icon,H,Z,v,y,_,Ws.vertical,e,M.lineStartIndex,M.lineLength,-1),j=t.icon.placedSymbolArray.length-1)}for(var X in n.horizontal){var Q=n.horizontal[X];if(!S){B=Mu(Q.text);var Y=s.layout.get("text-rotate").evaluate(_,{});S=new bu(u,r,e,c,l,h,Q,f,p,d,t.overscaling,Y)}var K=1===Q.positionedLines.length;if(k+=Du(t,e,Q,o,s,d,_,A,M,n.vertical?Ws.horizontal:Ws.horizontalOnly,K?Object.keys(n.horizontal):[X],D,L,b),K)break}n.vertical&&(R+=Du(t,e,n.vertical,o,s,d,_,A,M,Ws.vertical,["vertical"],D,j,b));var $=S?S.boxStartIndex:t.collisionBoxArray.length,J=S?S.boxEndIndex:t.collisionBoxArray.length,tt=T?T.boxStartIndex:t.collisionBoxArray.length,et=T?T.boxEndIndex:t.collisionBoxArray.length,rt=O?O.boxStartIndex:t.collisionBoxArray.length,nt=O?O.boxEndIndex:t.collisionBoxArray.length,it=P?P.boxStartIndex:t.collisionBoxArray.length,ot=P?P.boxEndIndex:t.collisionBoxArray.length;t.glyphOffsetArray.length>=qu.MAX_GLYPHS&&x("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),t.symbolInstances.emplaceBack(e.x,e.y,D.right>=0?D.right:-1,D.center>=0?D.center:-1,D.left>=0?D.left:-1,D.vertical||-1,L,j,B,$,J,tt,et,rt,nt,it,ot,c,k,R,C,I,0,f,F,z)}(t,s,i,r,n,o,f,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,m,b,S,c,v,w,O,d,e,a,l)};if("line"===T)for(var I=0,k=function(t,e,r,n,o){for(var a=[],s=0;s<t.length;s++)for(var u=t[s],c=void 0,l=0;l<u.length-1;l++){var h=u[l],f=u[l+1];h.x<0&&f.x<0||(h.x<0?h=new i(0,h.y+(f.y-h.y)*((0-h.x)/(f.x-h.x)))._round():f.x<0&&(f=new i(0,h.y+(f.y-h.y)*((0-h.x)/(f.x-h.x)))._round()),h.y<0&&f.y<0||(h.y<0?h=new i(h.x+(f.x-h.x)*((0-h.y)/(f.y-h.y)),0)._round():f.y<0&&(f=new i(h.x+(f.x-h.x)*((0-h.y)/(f.y-h.y)),0)._round()),h.x>=n&&f.x>=n||(h.x>=n?h=new i(n,h.y+(f.y-h.y)*((n-h.x)/(f.x-h.x)))._round():f.x>=n&&(f=new i(n,h.y+(f.y-h.y)*((n-h.x)/(f.x-h.x)))._round()),h.y>=o&&f.y>=o||(h.y>=o?h=new i(h.x+(f.x-h.x)*((o-h.y)/(f.y-h.y)),o)._round():f.y>=o&&(f=new i(h.x+(f.x-h.x)*((o-h.y)/(f.y-h.y)),o)._round()),c&&h.equals(c[c.length-1])||(c=[h],a.push(c)),c.push(f)))))}return a}(e.geometry,0,0,lo,lo);I<k.length;I+=1)for(var R=k[I],L=0,j=Au(R,_,E,r.vertical||A,n,24,y,t.overscaling,lo);L<j.length;L+=1){var D=j[L];A&&Fu(t,A.text,P,D)||C(R,D)}else if("line-center"===T)for(var B=0,F=e.geometry;B<F.length;B+=1){var z=F[B];if(z.length>1){var N=du(z,E,r.vertical||A,n,24,y);N&&C(z,N)}}else if("Polygon"===e.type)for(var U=0,V=Oa(e.geometry,0);U<V.length;U+=1){var G=V[U],W=Eu(G,16);C(G[0],new iu(W.x,W.y,0))}else if("LineString"===e.type)for(var H=0,q=e.geometry;H<q.length;H+=1){var Z=q[H];C(Z,new iu(Z[0].x,Z[0].y,0))}else if("Point"===e.type)for(var X=0,Q=e.geometry;X<Q.length;X+=1)for(var Y=0,K=Q[X];Y<K.length;Y+=1){var $=K[Y];C([$],new iu($.x,$.y,0))}}(t,a,p,z,n,l,h,f,A,N)},w=0,E=t.features;w<E.length;w+=1)b();a&&t.generateCollisionDebugBuffers()},t.perspective=function(t,e,r,n,i){var o,a=1/Math.tan(e/2);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(o=1/(n-i),t[10]=(i+n)*o,t[14]=2*i*n*o):(t[10]=-1,t[14]=-2*n),t},t.pick=function(t,e){for(var r={},n=0;n<e.length;n++){var i=e[n];i in t&&(r[i]=t[i])}return r},t.plugin=zn,t.polygonIntersectsPolygon=go,t.postMapLoadEvent=ot,t.postTurnstileEvent=nt,t.potpack=Ns,t.rasterBoundsAttributes=Sc,t.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],t.register=dn,t.registerForPluginStateChange=function(t){return t({pluginStatus:kn,pluginURL:Rn}),Dn.on("pluginStateChange",t),t},t.rotate=function(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(r),u=Math.cos(r);return t[0]=n*u+o*s,t[1]=i*u+a*s,t[2]=n*-s+o*u,t[3]=i*-s+a*u,t},t.rotateX=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),o=e[4],a=e[5],s=e[6],u=e[7],c=e[8],l=e[9],h=e[10],f=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+c*n,t[5]=a*i+l*n,t[6]=s*i+h*n,t[7]=u*i+f*n,t[8]=c*i-o*n,t[9]=l*i-a*n,t[10]=h*i-s*n,t[11]=f*i-u*n,t},t.rotateZ=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),o=e[0],a=e[1],s=e[2],u=e[3],c=e[4],l=e[5],h=e[6],f=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i+c*n,t[1]=a*i+l*n,t[2]=s*i+h*n,t[3]=u*i+f*n,t[4]=c*i-o*n,t[5]=l*i-a*n,t[6]=h*i-s*n,t[7]=f*i-u*n,t},t.scale=function(t,e,r){var n=r[0],i=r[1],o=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},t.setCacheLimits=function(t,e){st=t,ut=e},t.setRTLTextPlugin=function(t,e,r){if(void 0===r&&(r=!1),kn===Pn||kn===Mn||kn===Cn)throw new Error("setRTLTextPlugin cannot be called multiple times.");Rn=B.resolveURL(t),kn=Pn,In=e,jn(),r||Fn()},t.sphericalToCartesian=function(t){var e=t[0],r=t[1],n=t[2];return r+=90,r*=Math.PI/180,n*=Math.PI/180,{x:e*Math.cos(r)*Math.sin(n),y:e*Math.sin(r)*Math.sin(n),z:e*Math.cos(n)}},t.styleSpec=Tt,t.symbolSize=cu,t.transformMat3=function(t,e,r){var n=e[0],i=e[1],o=e[2];return t[0]=n*r[0]+i*r[3]+o*r[6],t[1]=n*r[1]+i*r[4]+o*r[7],t[2]=n*r[2]+i*r[5]+o*r[8],t},t.transformMat4=Lo,t.translate=function(t,e,r){var n,i,o,a,s,u,c,l,h,f,p,d,A=r[0],g=r[1],m=r[2];return e===t?(t[12]=e[0]*A+e[4]*g+e[8]*m+e[12],t[13]=e[1]*A+e[5]*g+e[9]*m+e[13],t[14]=e[2]*A+e[6]*g+e[10]*m+e[14],t[15]=e[3]*A+e[7]*g+e[11]*m+e[15]):(n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],f=e[9],p=e[10],d=e[11],t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=c,t[7]=l,t[8]=h,t[9]=f,t[10]=p,t[11]=d,t[12]=n*A+s*g+h*m+e[12],t[13]=i*A+u*g+f*m+e[13],t[14]=o*A+c*g+p*m+e[14],t[15]=a*A+l*g+d*m+e[15]),t},t.triggerPluginCompletionEvent=Ln,t.uniqueId=p,t.validateCustomStyleLayer=function(t){var e=[],r=t.id;return void 0===r&&e.push({message:"layers."+r+': missing required property "id"'}),void 0===t.render&&e.push({message:"layers."+r+': missing required method "render"'}),t.renderingMode&&"2d"!==t.renderingMode&&"3d"!==t.renderingMode&&e.push({message:"layers."+r+': property "renderingMode" must be either "2d" or "3d"'}),e},t.validateLight=an,t.validateStyle=on,t.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},t.vectorTile=Ga,t.version="1.6.1",t.warnOnce=x,t.webpSupported=z,t.window=self,t.wrap=l})),n(0,(function(t){function e(t){var r=typeof t;if("number"===r||"boolean"===r||"string"===r||null==t)return JSON.stringify(t);if(Array.isArray(t)){for(var n="[",i=0,o=t;i<o.length;i+=1)n+=e(o[i])+",";return n+"]"}for(var a=Object.keys(t).sort(),s="{",u=0;u<a.length;u++)s+=JSON.stringify(a[u])+":"+e(t[a[u]])+",";return s+"}"}function r(r){for(var n="",i=0,o=t.refProperties;i<o.length;i+=1)n+="/"+e(r[o[i]]);return n}var n=function(t){this.keyCache={},t&&this.replace(t)};n.prototype.replace=function(t){this._layerConfigs={},this._layers={},this.update(t,[])},n.prototype.update=function(e,n){for(var i=this,o=0,a=e;o<a.length;o+=1){var s=a[o];this._layerConfigs[s.id]=s;var u=this._layers[s.id]=t.createStyleLayer(s);u._featureFilter=t.featureFilter(u.filter),this.keyCache[s.id]&&delete this.keyCache[s.id]}for(var c=0,l=n;c<l.length;c+=1){var h=l[c];delete this.keyCache[h],delete this._layerConfigs[h],delete this._layers[h]}this.familiesBySource={};for(var f=0,p=function(t,e){for(var n={},i=0;i<t.length;i++){var o=e&&e[t[i].id]||r(t[i]);e&&(e[t[i].id]=o);var a=n[o];a||(a=n[o]=[]),a.push(t[i])}var s=[];for(var u in n)s.push(n[u]);return s}(t.values(this._layerConfigs),this.keyCache);f<p.length;f+=1){var d=p[f].map((function(t){return i._layers[t.id]})),A=d[0];if("none"!==A.visibility){var g=A.source||"",m=this.familiesBySource[g];m||(m=this.familiesBySource[g]={});var y=A.sourceLayer||"_geojsonTileLayer",v=m[y];v||(v=m[y]=[]),v.push(d)}}};var i=function(e){var r={},n=[];for(var i in e){var o=e[i],a=r[i]={};for(var s in o){var u=o[+s];if(u&&0!==u.bitmap.width&&0!==u.bitmap.height){var c={x:0,y:0,w:u.bitmap.width+2,h:u.bitmap.height+2};n.push(c),a[s]={rect:c,metrics:u.metrics}}}}var l=t.potpack(n),h=l.w,f=l.h,p=new t.AlphaImage({width:h||1,height:f||1});for(var d in e){var A=e[d];for(var g in A){var m=A[+g];if(m&&0!==m.bitmap.width&&0!==m.bitmap.height){var y=r[d][g].rect;t.AlphaImage.copy(m.bitmap,p,{x:0,y:0},{x:y.x+1,y:y.y+1},m.bitmap)}}}this.image=p,this.positions=r};t.register("GlyphAtlas",i);var o=function(e){this.tileID=new t.OverscaledTileID(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.uid=e.uid,this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=e.showCollisionBoxes,this.collectResourceTiming=!!e.collectResourceTiming,this.returnDependencies=!!e.returnDependencies};function a(e,r,n){for(var i=new t.EvaluationParameters(r),o=0,a=e;o<a.length;o+=1)a[o].recalculate(i,n)}o.prototype.parse=function(e,r,n,o,s){var u=this;this.status="parsing",this.data=e,this.collisionBoxArray=new t.CollisionBoxArray;var c=new t.DictionaryCoder(Object.keys(e.layers).sort()),l=new t.FeatureIndex(this.tileID);l.bucketLayerIDs=[];var h,f,p,d,A={},g={featureIndex:l,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:n},m=r.familiesBySource[this.source];for(var y in m){var v=e.layers[y];if(v){1===v.version&&t.warnOnce('Vector tile source "'+this.source+'" layer "'+y+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var _=c.encode(y),b=[],x=0;x<v.length;x++){var w=v.feature(x);b.push({feature:w,index:x,sourceLayerIndex:_})}for(var E=0,S=m[y];E<S.length;E+=1){var O=S[E],T=O[0];T.minzoom&&this.zoom<Math.floor(T.minzoom)||T.maxzoom&&this.zoom>=T.maxzoom||"none"!==T.visibility&&(a(O,this.zoom,n),(A[T.id]=T.createBucket({index:l.bucketLayerIDs.length,layers:O,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:_,sourceID:this.source})).populate(b,g),l.bucketLayerIDs.push(O.map((function(t){return t.id}))))}}}var P=t.mapObject(g.glyphDependencies,(function(t){return Object.keys(t).map(Number)}));Object.keys(P).length?o.send("getGlyphs",{uid:this.uid,stacks:P},(function(t,e){h||(h=t,f=e,I.call(u))})):f={};var M=Object.keys(g.iconDependencies);M.length?o.send("getImages",{icons:M,source:this.source,tileID:this.tileID,type:"icons"},(function(t,e){h||(h=t,p=e,I.call(u))})):p={};var C=Object.keys(g.patternDependencies);function I(){if(h)return s(h);if(f&&p&&d){var e=new i(f),r=new t.ImageAtlas(p,d);for(var o in A){var u=A[o];u instanceof t.SymbolBucket?(a(u.layers,this.zoom,n),t.performSymbolLayout(u,f,e.positions,p,r.iconPositions,this.showCollisionBoxes)):u.hasPattern&&(u instanceof t.LineBucket||u instanceof t.FillBucket||u instanceof t.FillExtrusionBucket)&&(a(u.layers,this.zoom,n),u.addFeatures(g,r.patternPositions))}this.status="done",s(null,{buckets:t.values(A).filter((function(t){return!t.isEmpty()})),featureIndex:l,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:e.image,imageAtlas:r,glyphMap:this.returnDependencies?f:null,iconMap:this.returnDependencies?p:null,glyphPositions:this.returnDependencies?e.positions:null})}}C.length?o.send("getImages",{icons:C,source:this.source,tileID:this.tileID,type:"patterns"},(function(t,e){h||(h=t,d=e,I.call(u))})):d={},I.call(this)};var s="undefined"!=typeof performance,u={getEntriesByName:function(t){return!!(s&&performance&&performance.getEntriesByName)&&performance.getEntriesByName(t)},mark:function(t){return!!(s&&performance&&performance.mark)&&performance.mark(t)},measure:function(t,e,r){return!!(s&&performance&&performance.measure)&&performance.measure(t,e,r)},clearMarks:function(t){return!!(s&&performance&&performance.clearMarks)&&performance.clearMarks(t)},clearMeasures:function(t){return!!(s&&performance&&performance.clearMeasures)&&performance.clearMeasures(t)}},c=function(t){this._marks={start:[t.url,"start"].join("#"),end:[t.url,"end"].join("#"),measure:t.url.toString()},u.mark(this._marks.start)};function l(e,r){var n=t.getArrayBuffer(e.request,(function(e,n,i,o){e?r(e):n&&r(null,{vectorTile:new t.vectorTile.VectorTile(new t.pbf(n)),rawData:n,cacheControl:i,expires:o})}));return function(){n.cancel(),r()}}c.prototype.finish=function(){u.mark(this._marks.end);var t=u.getEntriesByName(this._marks.measure);return 0===t.length&&(u.measure(this._marks.measure,this._marks.start,this._marks.end),t=u.getEntriesByName(this._marks.measure),u.clearMarks(this._marks.start),u.clearMarks(this._marks.end),u.clearMeasures(this._marks.measure)),t},u.Performance=c;var h=function(t,e,r,n){this.actor=t,this.layerIndex=e,this.availableImages=r,this.loadVectorData=n||l,this.loading={},this.loaded={}};h.prototype.loadTile=function(e,r){var n=this,i=e.uid;this.loading||(this.loading={});var a=!!(e&&e.request&&e.request.collectResourceTiming)&&new u.Performance(e.request),s=this.loading[i]=new o(e);s.abort=this.loadVectorData(e,(function(e,o){if(delete n.loading[i],e||!o)return s.status="done",n.loaded[i]=s,r(e);var u=o.rawData,c={};o.expires&&(c.expires=o.expires),o.cacheControl&&(c.cacheControl=o.cacheControl);var l={};if(a){var h=a.finish();h&&(l.resourceTiming=JSON.parse(JSON.stringify(h)))}s.vectorTile=o.vectorTile,s.parse(o.vectorTile,n.layerIndex,n.availableImages,n.actor,(function(e,n){if(e||!n)return r(e);r(null,t.extend({rawTileData:u.slice(0)},n,c,l))})),n.loaded=n.loaded||{},n.loaded[i]=s}))},h.prototype.reloadTile=function(t,e){var r=this,n=this.loaded,i=t.uid,o=this;if(n&&n[i]){var a=n[i];a.showCollisionBoxes=t.showCollisionBoxes;var s=function(t,n){var i=a.reloadCallback;i&&(delete a.reloadCallback,a.parse(a.vectorTile,o.layerIndex,r.availableImages,o.actor,i)),e(t,n)};"parsing"===a.status?a.reloadCallback=s:"done"===a.status&&(a.vectorTile?a.parse(a.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s())}},h.prototype.abortTile=function(t,e){var r=this.loading,n=t.uid;r&&r[n]&&r[n].abort&&(r[n].abort(),delete r[n]),e()},h.prototype.removeTile=function(t,e){var r=this.loaded,n=t.uid;r&&r[n]&&delete r[n],e()};var f=function(){this.loaded={}};f.prototype.loadTile=function(e,r){var n=e.uid,i=e.encoding,o=e.rawImageData,a=new t.DEMData(n,o,i);this.loaded=this.loaded||{},this.loaded[n]=a,r(null,a)},f.prototype.removeTile=function(t){var e=this.loaded,r=t.uid;e&&e[r]&&delete e[r]};var p=6378137;function d(t){var e=0;if(t&&t.length>0){e+=Math.abs(A(t[0]));for(var r=1;r<t.length;r++)e-=Math.abs(A(t[r]))}return e}function A(t){var e,r,n,i,o,a,s=0,u=t.length;if(u>2){for(a=0;a<u;a++)a===u-2?(n=u-2,i=u-1,o=0):a===u-1?(n=u-1,i=0,o=1):(n=a,i=a+1,o=a+2),e=t[n],r=t[i],s+=(g(t[o][0])-g(e[0]))*Math.sin(g(r[1]));s=s*p*p/2}return s}function g(t){return t*Math.PI/180}var m={geometry:function t(e){var r,n=0;switch(e.type){case"Polygon":return d(e.coordinates);case"MultiPolygon":for(r=0;r<e.coordinates.length;r++)n+=d(e.coordinates[r]);return n;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0;case"GeometryCollection":for(r=0;r<e.geometries.length;r++)n+=t(e.geometries[r]);return n}},ring:A};function y(t,e){return function(r){return t(r,e)}}function v(t,e){e=!!e,t[0]=_(t[0],e);for(var r=1;r<t.length;r++)t[r]=_(t[r],!e);return t}function _(t,e){return function(t){return m.ring(t)>=0}(t)===e?t:t.reverse()}var b=t.vectorTile.VectorTileFeature.prototype.toGeoJSON,x=function(e){this._feature=e,this.extent=t.EXTENT,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))};x.prototype.loadGeometry=function(){if(1===this._feature.type){for(var e=[],r=0,n=this._feature.geometry;r<n.length;r+=1){var i=n[r];e.push([new t.Point$1(i[0],i[1])])}return e}for(var o=[],a=0,s=this._feature.geometry;a<s.length;a+=1){for(var u=[],c=0,l=s[a];c<l.length;c+=1){var h=l[c];u.push(new t.Point$1(h[0],h[1]))}o.push(u)}return o},x.prototype.toGeoJSON=function(t,e,r){return b.call(this,t,e,r)};var w=function(e){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=t.EXTENT,this.length=e.length,this._features=e};w.prototype.feature=function(t){return new x(this._features[t])};var E=t.vectorTile.VectorTileFeature,S=O;function O(t,e){this.options=e||{},this.features=t,this.length=t.length}function T(t,e){this.id="number"==typeof t.id?t.id:void 0,this.type=t.type,this.rawGeometry=1===t.type?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=e||4096}O.prototype.feature=function(t){return new T(this.features[t],this.options.extent)},T.prototype.loadGeometry=function(){var e=this.rawGeometry;this.geometry=[];for(var r=0;r<e.length;r++){for(var n=e[r],i=[],o=0;o<n.length;o++)i.push(new t.Point$1(n[o][0],n[o][1]));this.geometry.push(i)}return this.geometry},T.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var t=this.geometry,e=1/0,r=-1/0,n=1/0,i=-1/0,o=0;o<t.length;o++)for(var a=t[o],s=0;s<a.length;s++){var u=a[s];e=Math.min(e,u.x),r=Math.max(r,u.x),n=Math.min(n,u.y),i=Math.max(i,u.y)}return[e,n,r,i]},T.prototype.toGeoJSON=E.prototype.toGeoJSON;var P=I,M=I,C=S;function I(e){var r=new t.pbf;return function(t,e){for(var r in t.layers)e.writeMessage(3,k,t.layers[r])}(e,r),r.finish()}function k(t,e){var r;e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||""),e.writeVarintField(5,t.extent||4096);var n={keys:[],values:[],keycache:{},valuecache:{}};for(r=0;r<t.length;r++)n.feature=t.feature(r),e.writeMessage(2,R,n);var i=n.keys;for(r=0;r<i.length;r++)e.writeStringField(3,i[r]);var o=n.values;for(r=0;r<o.length;r++)e.writeMessage(4,F,o[r])}function R(t,e){var r=t.feature;void 0!==r.id&&e.writeVarintField(1,r.id),e.writeMessage(2,L,t),e.writeVarintField(3,r.type),e.writeMessage(4,B,r)}function L(t,e){var r=t.feature,n=t.keys,i=t.values,o=t.keycache,a=t.valuecache;for(var s in r.properties){var u=o[s];void 0===u&&(n.push(s),u=n.length-1,o[s]=u),e.writeVarint(u);var c=r.properties[s],l=typeof c;"string"!==l&&"boolean"!==l&&"number"!==l&&(c=JSON.stringify(c));var h=l+":"+c,f=a[h];void 0===f&&(i.push(c),f=i.length-1,a[h]=f),e.writeVarint(f)}}function j(t,e){return(e<<3)+(7&t)}function D(t){return t<<1^t>>31}function B(t,e){for(var r=t.loadGeometry(),n=t.type,i=0,o=0,a=r.length,s=0;s<a;s++){var u=r[s],c=1;1===n&&(c=u.length),e.writeVarint(j(1,c));for(var l=3===n?u.length-1:u.length,h=0;h<l;h++){1===h&&1!==n&&e.writeVarint(j(2,l-1));var f=u[h].x-i,p=u[h].y-o;e.writeVarint(D(f)),e.writeVarint(D(p)),i+=f,o+=p}3===n&&e.writeVarint(j(7,1))}}function F(t,e){var r=typeof t;"string"===r?e.writeStringField(1,t):"boolean"===r?e.writeBooleanField(7,t):"number"===r&&(t%1!=0?e.writeDoubleField(3,t):t<0?e.writeSVarintField(6,t):e.writeVarintField(5,t))}function z(t,e,r,n){N(t,r,n),N(e,2*r,2*n),N(e,2*r+1,2*n+1)}function N(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function U(t,e,r,n){var i=t-r,o=e-n;return i*i+o*o}P.fromVectorTileJs=M,P.fromGeojsonVt=function(t,e){e=e||{};var r={};for(var n in t)r[n]=new S(t[n].features,e),r[n].name=n,r[n].version=e.version,r[n].extent=e.extent;return I({layers:r})},P.GeoJSONWrapper=C;var V=function(t){return t[0]},G=function(t){return t[1]},W=function(t,e,r,n,i){void 0===e&&(e=V),void 0===r&&(r=G),void 0===n&&(n=64),void 0===i&&(i=Float64Array),this.nodeSize=n,this.points=t;for(var o=t.length<65536?Uint16Array:Uint32Array,a=this.ids=new o(t.length),s=this.coords=new i(2*t.length),u=0;u<t.length;u++)a[u]=u,s[2*u]=e(t[u]),s[2*u+1]=r(t[u]);!function t(e,r,n,i,o,a){if(!(o-i<=n)){var s=i+o>>1;!function t(e,r,n,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,u=n-i+1,c=Math.log(s),l=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*l*(s-l)/s)*(u-s/2<0?-1:1);t(e,r,n,Math.max(i,Math.floor(n-u*l/s+h)),Math.min(o,Math.floor(n+(s-u)*l/s+h)),a)}var f=r[2*n+a],p=i,d=o;for(z(e,r,i,n),r[2*o+a]>f&&z(e,r,i,o);p<d;){for(z(e,r,p,d),p++,d--;r[2*p+a]<f;)p++;for(;r[2*d+a]>f;)d--}r[2*i+a]===f?z(e,r,i,d):z(e,r,++d,o),d<=n&&(i=d+1),n<=d&&(o=d-1)}}(e,r,s,i,o,a%2),t(e,r,n,i,s-1,a+1),t(e,r,n,s+1,o,a+1)}}(a,s,n,0,a.length-1,0)};W.prototype.range=function(t,e,r,n){return function(t,e,r,n,i,o,a){for(var s,u,c=[0,t.length-1,0],l=[];c.length;){var h=c.pop(),f=c.pop(),p=c.pop();if(f-p<=a)for(var d=p;d<=f;d++)s=e[2*d],u=e[2*d+1],s>=r&&s<=i&&u>=n&&u<=o&&l.push(t[d]);else{var A=Math.floor((p+f)/2);s=e[2*A],u=e[2*A+1],s>=r&&s<=i&&u>=n&&u<=o&&l.push(t[A]);var g=(h+1)%2;(0===h?r<=s:n<=u)&&(c.push(p),c.push(A-1),c.push(g)),(0===h?i>=s:o>=u)&&(c.push(A+1),c.push(f),c.push(g))}}return l}(this.ids,this.coords,t,e,r,n,this.nodeSize)},W.prototype.within=function(t,e,r){return function(t,e,r,n,i,o){for(var a=[0,t.length-1,0],s=[],u=i*i;a.length;){var c=a.pop(),l=a.pop(),h=a.pop();if(l-h<=o)for(var f=h;f<=l;f++)U(e[2*f],e[2*f+1],r,n)<=u&&s.push(t[f]);else{var p=Math.floor((h+l)/2),d=e[2*p],A=e[2*p+1];U(d,A,r,n)<=u&&s.push(t[p]);var g=(c+1)%2;(0===c?r-i<=d:n-i<=A)&&(a.push(h),a.push(p-1),a.push(g)),(0===c?r+i>=d:n+i>=A)&&(a.push(p+1),a.push(l),a.push(g))}}return s}(this.ids,this.coords,t,e,r,this.nodeSize)};var H={minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(t){return t}},q=function(t){this.options=J(Object.create(H),t),this.trees=new Array(this.options.maxZoom+1)};function Z(t,e,r,n,i){return{x:t,y:e,zoom:1/0,id:r,parentId:-1,numPoints:n,properties:i}}function X(t,e){var r=t.geometry.coordinates,n=r[0],i=r[1];return{x:K(n),y:$(i),zoom:1/0,index:e,parentId:-1}}function Q(t){return{type:"Feature",id:t.id,properties:Y(t),geometry:{type:"Point",coordinates:[(n=t.x,360*(n-.5)),(e=t.y,r=(180-360*e)*Math.PI/180,360*Math.atan(Math.exp(r))/Math.PI-90)]}};var e,r,n}function Y(t){var e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return J(J({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function K(t){return t/360+.5}function $(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function J(t,e){for(var r in e)t[r]=e[r];return t}function tt(t){return t.x}function et(t){return t.y}function rt(t,e,r,n,i,o){var a=i-r,s=o-n;if(0!==a||0!==s){var u=((t-r)*a+(e-n)*s)/(a*a+s*s);u>1?(r=i,n=o):u>0&&(r+=a*u,n+=s*u)}return(a=t-r)*a+(s=e-n)*s}function nt(t,e,r,n){var i={id:void 0===t?null:t,type:e,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,r=t.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)it(t,e);else if("Polygon"===r||"MultiLineString"===r)for(var n=0;n<e.length;n++)it(t,e[n]);else if("MultiPolygon"===r)for(n=0;n<e.length;n++)for(var i=0;i<e[n].length;i++)it(t,e[n][i])}(i),i}function it(t,e){for(var r=0;r<e.length;r+=3)t.minX=Math.min(t.minX,e[r]),t.minY=Math.min(t.minY,e[r+1]),t.maxX=Math.max(t.maxX,e[r]),t.maxY=Math.max(t.maxY,e[r+1])}function ot(t,e,r,n){if(e.geometry){var i=e.geometry.coordinates,o=e.geometry.type,a=Math.pow(r.tolerance/((1<<r.maxZoom)*r.extent),2),s=[],u=e.id;if(r.promoteId?u=e.properties[r.promoteId]:r.generateId&&(u=n||0),"Point"===o)at(i,s);else if("MultiPoint"===o)for(var c=0;c<i.length;c++)at(i[c],s);else if("LineString"===o)st(i,s,a,!1);else if("MultiLineString"===o){if(r.lineMetrics){for(c=0;c<i.length;c++)s=[],st(i[c],s,a,!1),t.push(nt(u,"LineString",s,e.properties));return}ut(i,s,a,!1)}else if("Polygon"===o)ut(i,s,a,!0);else{if("MultiPolygon"!==o){if("GeometryCollection"===o){for(c=0;c<e.geometry.geometries.length;c++)ot(t,{id:u,geometry:e.geometry.geometries[c],properties:e.properties},r,n);return}throw new Error("Input data is not a valid GeoJSON object.")}for(c=0;c<i.length;c++){var l=[];ut(i[c],l,a,!0),s.push(l)}}t.push(nt(u,o,s,e.properties))}}function at(t,e){e.push(ct(t[0])),e.push(lt(t[1])),e.push(0)}function st(t,e,r,n){for(var i,o,a=0,s=0;s<t.length;s++){var u=ct(t[s][0]),c=lt(t[s][1]);e.push(u),e.push(c),e.push(0),s>0&&(a+=n?(i*c-u*o)/2:Math.sqrt(Math.pow(u-i,2)+Math.pow(c-o,2))),i=u,o=c}var l=e.length-3;e[2]=1,function t(e,r,n,i){for(var o,a=i,s=n-r>>1,u=n-r,c=e[r],l=e[r+1],h=e[n],f=e[n+1],p=r+3;p<n;p+=3){var d=rt(e[p],e[p+1],c,l,h,f);if(d>a)o=p,a=d;else if(d===a){var A=Math.abs(p-s);A<u&&(o=p,u=A)}}a>i&&(o-r>3&&t(e,r,o,i),e[o+2]=a,n-o>3&&t(e,o,n,i))}(e,0,l,r),e[l+2]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}function ut(t,e,r,n){for(var i=0;i<t.length;i++){var o=[];st(t[i],o,r,n),e.push(o)}}function ct(t){return t/360+.5}function lt(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function ht(t,e,r,n,i,o,a,s){if(n/=e,o>=(r/=e)&&a<n)return t;if(a<r||o>=n)return null;for(var u=[],c=0;c<t.length;c++){var l=t[c],h=l.geometry,f=l.type,p=0===i?l.minX:l.minY,d=0===i?l.maxX:l.maxY;if(p>=r&&d<n)u.push(l);else if(!(d<r||p>=n)){var A=[];if("Point"===f||"MultiPoint"===f)ft(h,A,r,n,i);else if("LineString"===f)pt(h,A,r,n,i,!1,s.lineMetrics);else if("MultiLineString"===f)At(h,A,r,n,i,!1);else if("Polygon"===f)At(h,A,r,n,i,!0);else if("MultiPolygon"===f)for(var g=0;g<h.length;g++){var m=[];At(h[g],m,r,n,i,!0),m.length&&A.push(m)}if(A.length){if(s.lineMetrics&&"LineString"===f){for(g=0;g<A.length;g++)u.push(nt(l.id,f,A[g],l.tags));continue}"LineString"!==f&&"MultiLineString"!==f||(1===A.length?(f="LineString",A=A[0]):f="MultiLineString"),"Point"!==f&&"MultiPoint"!==f||(f=3===A.length?"Point":"MultiPoint"),u.push(nt(l.id,f,A,l.tags))}}}return u.length?u:null}function ft(t,e,r,n,i){for(var o=0;o<t.length;o+=3){var a=t[o+i];a>=r&&a<=n&&(e.push(t[o]),e.push(t[o+1]),e.push(t[o+2]))}}function pt(t,e,r,n,i,o,a){for(var s,u,c=dt(t),l=0===i?mt:yt,h=t.start,f=0;f<t.length-3;f+=3){var p=t[f],d=t[f+1],A=t[f+2],g=t[f+3],m=t[f+4],y=0===i?p:d,v=0===i?g:m,_=!1;a&&(s=Math.sqrt(Math.pow(p-g,2)+Math.pow(d-m,2))),y<r?v>r&&(u=l(c,p,d,g,m,r),a&&(c.start=h+s*u)):y>n?v<n&&(u=l(c,p,d,g,m,n),a&&(c.start=h+s*u)):gt(c,p,d,A),v<r&&y>=r&&(u=l(c,p,d,g,m,r),_=!0),v>n&&y<=n&&(u=l(c,p,d,g,m,n),_=!0),!o&&_&&(a&&(c.end=h+s*u),e.push(c),c=dt(t)),a&&(h+=s)}var b=t.length-3;p=t[b],d=t[b+1],A=t[b+2],(y=0===i?p:d)>=r&&y<=n&&gt(c,p,d,A),b=c.length-3,o&&b>=3&&(c[b]!==c[0]||c[b+1]!==c[1])&&gt(c,c[0],c[1],c[2]),c.length&&e.push(c)}function dt(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function At(t,e,r,n,i,o){for(var a=0;a<t.length;a++)pt(t[a],e,r,n,i,o,!1)}function gt(t,e,r,n){t.push(e),t.push(r),t.push(n)}function mt(t,e,r,n,i,o){var a=(o-e)/(n-e);return t.push(o),t.push(r+(i-r)*a),t.push(1),a}function yt(t,e,r,n,i,o){var a=(o-r)/(i-r);return t.push(e+(n-e)*a),t.push(o),t.push(1),a}function vt(t,e){for(var r=[],n=0;n<t.length;n++){var i,o=t[n],a=o.type;if("Point"===a||"MultiPoint"===a||"LineString"===a)i=_t(o.geometry,e);else if("MultiLineString"===a||"Polygon"===a){i=[];for(var s=0;s<o.geometry.length;s++)i.push(_t(o.geometry[s],e))}else if("MultiPolygon"===a)for(i=[],s=0;s<o.geometry.length;s++){for(var u=[],c=0;c<o.geometry[s].length;c++)u.push(_t(o.geometry[s][c],e));i.push(u)}r.push(nt(o.id,a,i,o.tags))}return r}function _t(t,e){var r=[];r.size=t.size,void 0!==t.start&&(r.start=t.start,r.end=t.end);for(var n=0;n<t.length;n+=3)r.push(t[n]+e,t[n+1],t[n+2]);return r}function bt(t,e){if(t.transformed)return t;var r,n,i,o=1<<t.z,a=t.x,s=t.y;for(r=0;r<t.features.length;r++){var u=t.features[r],c=u.geometry,l=u.type;if(u.geometry=[],1===l)for(n=0;n<c.length;n+=2)u.geometry.push(xt(c[n],c[n+1],e,o,a,s));else for(n=0;n<c.length;n++){var h=[];for(i=0;i<c[n].length;i+=2)h.push(xt(c[n][i],c[n][i+1],e,o,a,s));u.geometry.push(h)}}return t.transformed=!0,t}function xt(t,e,r,n,i,o){return[Math.round(r*(t*n-i)),Math.round(r*(e*n-o))]}function wt(t,e,r,n,i){for(var o=e===i.maxZoom?0:i.tolerance/((1<<e)*i.extent),a={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:n,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},s=0;s<t.length;s++){a.numFeatures++,Et(a,t[s],o,i);var u=t[s].minX,c=t[s].minY,l=t[s].maxX,h=t[s].maxY;u<a.minX&&(a.minX=u),c<a.minY&&(a.minY=c),l>a.maxX&&(a.maxX=l),h>a.maxY&&(a.maxY=h)}return a}function Et(t,e,r,n){var i=e.geometry,o=e.type,a=[];if("Point"===o||"MultiPoint"===o)for(var s=0;s<i.length;s+=3)a.push(i[s]),a.push(i[s+1]),t.numPoints++,t.numSimplified++;else if("LineString"===o)St(a,i,t,r,!1,!1);else if("MultiLineString"===o||"Polygon"===o)for(s=0;s<i.length;s++)St(a,i[s],t,r,"Polygon"===o,0===s);else if("MultiPolygon"===o)for(var u=0;u<i.length;u++){var c=i[u];for(s=0;s<c.length;s++)St(a,c[s],t,r,!0,0===s)}if(a.length){var l=e.tags||null;if("LineString"===o&&n.lineMetrics){for(var h in l={},e.tags)l[h]=e.tags[h];l.mapbox_clip_start=i.start/i.size,l.mapbox_clip_end=i.end/i.size}var f={geometry:a,type:"Polygon"===o||"MultiPolygon"===o?3:"LineString"===o||"MultiLineString"===o?2:1,tags:l};null!==e.id&&(f.id=e.id),t.features.push(f)}}function St(t,e,r,n,i,o){var a=n*n;if(n>0&&e.size<(i?a:n))r.numPoints+=e.length/3;else{for(var s=[],u=0;u<e.length;u+=3)(0===n||e[u+2]>a)&&(r.numSimplified++,s.push(e[u]),s.push(e[u+1])),r.numPoints++;i&&function(t,e){for(var r=0,n=0,i=t.length,o=i-2;n<i;o=n,n+=2)r+=(t[n]-t[o])*(t[n+1]+t[o+1]);if(r>0===e)for(n=0,i=t.length;n<i/2;n+=2){var a=t[n],s=t[n+1];t[n]=t[i-2-n],t[n+1]=t[i-1-n],t[i-2-n]=a,t[i-1-n]=s}}(s,o),t.push(s)}}function Ot(t,e){var r=(e=this.options=function(t,e){for(var r in e)t[r]=e[r];return t}(Object.create(this.options),e)).debug;if(r&&console.time("preprocess data"),e.maxZoom<0||e.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var n=function(t,e){var r=[];if("FeatureCollection"===t.type)for(var n=0;n<t.features.length;n++)ot(r,t.features[n],e,n);else"Feature"===t.type?ot(r,t,e):ot(r,{geometry:t},e);return r}(t,e);this.tiles={},this.tileCoords=[],r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(n=function(t,e){var r=e.buffer/e.extent,n=t,i=ht(t,1,-1-r,r,0,-1,2,e),o=ht(t,1,1-r,2+r,0,-1,2,e);return(i||o)&&(n=ht(t,1,-r,1+r,0,-1,2,e)||[],i&&(n=vt(i,1).concat(n)),o&&(n=n.concat(vt(o,-1)))),n}(n,e)).length&&this.splitTile(n,0,0,0),r&&(n.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function Tt(t,e,r){return 32*((1<<t)*r+e)+t}function Pt(t,e){var r=t.tileID.canonical;if(!this._geoJSONIndex)return e(null,null);var n=this._geoJSONIndex.getTile(r.z,r.x,r.y);if(!n)return e(null,null);var i=new w(n.features),o=P(i);0===o.byteOffset&&o.byteLength===o.buffer.byteLength||(o=new Uint8Array(o)),e(null,{vectorTile:i,rawData:o.buffer})}q.prototype.load=function(t){var e=this.options,r=e.log,n=e.minZoom,i=e.maxZoom,o=e.nodeSize;r&&console.time("total time");var a="prepare "+t.length+" points";r&&console.time(a),this.points=t;for(var s=[],u=0;u<t.length;u++)t[u].geometry&&s.push(X(t[u],u));this.trees[i+1]=new W(s,tt,et,o,Float32Array),r&&console.timeEnd(a);for(var c=i;c>=n;c--){var l=+Date.now();s=this._cluster(s,c),this.trees[c]=new W(s,tt,et,o,Float32Array),r&&console.log("z%d: %d clusters in %dms",c,s.length,+Date.now()-l)}return r&&console.timeEnd("total time"),this},q.prototype.getClusters=function(t,e){var r=((t[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,t[1])),i=180===t[2]?180:((t[2]+180)%360+360)%360-180,o=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,i=180;else if(r>i){var a=this.getClusters([r,n,180,o],e),s=this.getClusters([-180,n,i,o],e);return a.concat(s)}for(var u=this.trees[this._limitZoom(e)],c=[],l=0,h=u.range(K(r),$(o),K(i),$(n));l<h.length;l+=1){var f=h[l],p=u.points[f];c.push(p.numPoints?Q(p):this.points[p.index])}return c},q.prototype.getChildren=function(t){var e=this._getOriginId(t),r=this._getOriginZoom(t),n="No cluster with the specified id.",i=this.trees[r];if(!i)throw new Error(n);var o=i.points[e];if(!o)throw new Error(n);for(var a=this.options.radius/(this.options.extent*Math.pow(2,r-1)),s=[],u=0,c=i.within(o.x,o.y,a);u<c.length;u+=1){var l=c[u],h=i.points[l];h.parentId===t&&s.push(h.numPoints?Q(h):this.points[h.index])}if(0===s.length)throw new Error(n);return s},q.prototype.getLeaves=function(t,e,r){e=e||10,r=r||0;var n=[];return this._appendLeaves(n,t,e,r,0),n},q.prototype.getTile=function(t,e,r){var n=this.trees[this._limitZoom(t)],i=Math.pow(2,t),o=this.options,a=o.extent,s=o.radius/a,u=(r-s)/i,c=(r+1+s)/i,l={features:[]};return this._addTileFeatures(n.range((e-s)/i,u,(e+1+s)/i,c),n.points,e,r,i,l),0===e&&this._addTileFeatures(n.range(1-s/i,u,1,c),n.points,i,r,i,l),e===i-1&&this._addTileFeatures(n.range(0,u,s/i,c),n.points,-1,r,i,l),l.features.length?l:null},q.prototype.getClusterExpansionZoom=function(t){for(var e=this._getOriginZoom(t)-1;e<=this.options.maxZoom;){var r=this.getChildren(t);if(e++,1!==r.length)break;t=r[0].properties.cluster_id}return e},q.prototype._appendLeaves=function(t,e,r,n,i){for(var o=0,a=this.getChildren(e);o<a.length;o+=1){var s=a[o],u=s.properties;if(u&&u.cluster?i+u.point_count<=n?i+=u.point_count:i=this._appendLeaves(t,u.cluster_id,r,n,i):i<n?i++:t.push(s),t.length===r)break}return i},q.prototype._addTileFeatures=function(t,e,r,n,i,o){for(var a=0,s=t;a<s.length;a+=1){var u=e[s[a]],c=u.numPoints,l={type:1,geometry:[[Math.round(this.options.extent*(u.x*i-r)),Math.round(this.options.extent*(u.y*i-n))]],tags:c?Y(u):this.points[u.index].properties},h=void 0;c?h=u.id:this.options.generateId?h=u.index:this.points[u.index].id&&(h=this.points[u.index].id),void 0!==h&&(l.id=h),o.features.push(l)}},q.prototype._limitZoom=function(t){return Math.max(this.options.minZoom,Math.min(t,this.options.maxZoom+1))},q.prototype._cluster=function(t,e){for(var r=[],n=this.options,i=n.radius,o=n.extent,a=n.reduce,s=i/(o*Math.pow(2,e)),u=0;u<t.length;u++){var c=t[u];if(!(c.zoom<=e)){c.zoom=e;for(var l=this.trees[e+1],h=l.within(c.x,c.y,s),f=c.numPoints||1,p=c.x*f,d=c.y*f,A=a&&f>1?this._map(c,!0):null,g=(u<<5)+(e+1)+this.points.length,m=0,y=h;m<y.length;m+=1){var v=y[m],_=l.points[v];if(!(_.zoom<=e)){_.zoom=e;var b=_.numPoints||1;p+=_.x*b,d+=_.y*b,f+=b,_.parentId=g,a&&(A||(A=this._map(c,!0)),a(A,this._map(_)))}}1===f?r.push(c):(c.parentId=g,r.push(Z(p/f,d/f,g,f,A)))}}return r},q.prototype._getOriginId=function(t){return t-this.points.length>>5},q.prototype._getOriginZoom=function(t){return(t-this.points.length)%32},q.prototype._map=function(t,e){if(t.numPoints)return e?J({},t.properties):t.properties;var r=this.points[t.index].properties,n=this.options.map(r);return e&&n===r?J({},n):n},Ot.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Ot.prototype.splitTile=function(t,e,r,n,i,o,a){for(var s=[t,e,r,n],u=this.options,c=u.debug;s.length;){n=s.pop(),r=s.pop(),e=s.pop(),t=s.pop();var l=1<<e,h=Tt(e,r,n),f=this.tiles[h];if(!f&&(c>1&&console.time("creation"),f=this.tiles[h]=wt(t,e,r,n,u),this.tileCoords.push({z:e,x:r,y:n}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,f.numFeatures,f.numPoints,f.numSimplified),console.timeEnd("creation"));var p="z"+e;this.stats[p]=(this.stats[p]||0)+1,this.total++}if(f.source=t,i){if(e===u.maxZoom||e===i)continue;var d=1<<i-e;if(r!==Math.floor(o/d)||n!==Math.floor(a/d))continue}else if(e===u.indexMaxZoom||f.numPoints<=u.indexMaxPoints)continue;if(f.source=null,0!==t.length){c>1&&console.time("clipping");var A,g,m,y,v,_,b=.5*u.buffer/u.extent,x=.5-b,w=.5+b,E=1+b;A=g=m=y=null,v=ht(t,l,r-b,r+w,0,f.minX,f.maxX,u),_=ht(t,l,r+x,r+E,0,f.minX,f.maxX,u),t=null,v&&(A=ht(v,l,n-b,n+w,1,f.minY,f.maxY,u),g=ht(v,l,n+x,n+E,1,f.minY,f.maxY,u),v=null),_&&(m=ht(_,l,n-b,n+w,1,f.minY,f.maxY,u),y=ht(_,l,n+x,n+E,1,f.minY,f.maxY,u),_=null),c>1&&console.timeEnd("clipping"),s.push(A||[],e+1,2*r,2*n),s.push(g||[],e+1,2*r,2*n+1),s.push(m||[],e+1,2*r+1,2*n),s.push(y||[],e+1,2*r+1,2*n+1)}}},Ot.prototype.getTile=function(t,e,r){var n=this.options,i=n.extent,o=n.debug;if(t<0||t>24)return null;var a=1<<t,s=Tt(t,e=(e%a+a)%a,r);if(this.tiles[s])return bt(this.tiles[s],i);o>1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var u,c=t,l=e,h=r;!u&&c>0;)c--,l=Math.floor(l/2),h=Math.floor(h/2),u=this.tiles[Tt(c,l,h)];return u&&u.source?(o>1&&console.log("found parent tile z%d-%d-%d",c,l,h),o>1&&console.time("drilling down"),this.splitTile(u.source,c,l,h,t,e,r),o>1&&console.timeEnd("drilling down"),this.tiles[s]?bt(this.tiles[s],i):null):null};var Mt=function(e){function r(t,r,n,i){e.call(this,t,r,n,Pt),i&&(this.loadGeoJSON=i)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.loadData=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=e,this._pendingLoadDataParams=t,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},r.prototype._loadData=function(){var e=this;if(this._pendingCallback&&this._pendingLoadDataParams){var r=this._pendingCallback,n=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var i=!!(n&&n.request&&n.request.collectResourceTiming)&&new u.Performance(n.request);this.loadGeoJSON(n,(function(o,a){if(o||!a)return r(o);if("object"!=typeof a)return r(new Error("Input data given to '"+n.source+"' is not a valid GeoJSON object."));!function t(e,r){switch(e&&e.type||null){case"FeatureCollection":return e.features=e.features.map(y(t,r)),e;case"GeometryCollection":return e.geometries=e.geometries.map(y(t,r)),e;case"Feature":return e.geometry=t(e.geometry,r),e;case"Polygon":case"MultiPolygon":return function(t,e){return"Polygon"===t.type?t.coordinates=v(t.coordinates,e):"MultiPolygon"===t.type&&(t.coordinates=t.coordinates.map(y(v,e))),t}(e,r);default:return e}}(a,!0);try{e._geoJSONIndex=n.cluster?new q(function(e){var r=e.superclusterOptions,n=e.clusterProperties;if(!n||!r)return r;for(var i={},o={},a={accumulated:null,zoom:0},s={properties:null},u=Object.keys(n),c=0,l=u;c<l.length;c+=1){var h=l[c],f=n[h],p=f[0],d=f[1],A=t.createExpression(d),g=t.createExpression("string"==typeof p?[p,["accumulated"],["get",h]]:p);i[h]=A.value,o[h]=g.value}return r.map=function(t){s.properties=t;for(var e={},r=0,n=u;r<n.length;r+=1){var o=n[r];e[o]=i[o].evaluate(a,s)}return e},r.reduce=function(t,e){s.properties=e;for(var r=0,n=u;r<n.length;r+=1){var i=n[r];a.accumulated=t[i],t[i]=o[i].evaluate(a,s)}},r}(n)).load(a.features):function(t,e){return new Ot(t,e)}(a,n.geojsonVtOptions)}catch(o){return r(o)}e.loaded={};var s={};if(i){var u=i.finish();u&&(s.resourceTiming={},s.resourceTiming[n.source]=JSON.parse(JSON.stringify(u)))}r(null,s)}))}},r.prototype.coalesce=function(){"Coalescing"===this._state?this._state="Idle":"NeedsLoadData"===this._state&&(this._state="Coalescing",this._loadData())},r.prototype.reloadTile=function(t,r){var n=this.loaded,i=t.uid;return n&&n[i]?e.prototype.reloadTile.call(this,t,r):this.loadTile(t,r)},r.prototype.loadGeoJSON=function(e,r){if(e.request)t.getJSON(e.request,r);else{if("string"!=typeof e.data)return r(new Error("Input data given to '"+e.source+"' is not a valid GeoJSON object."));try{return r(null,JSON.parse(e.data))}catch(t){return r(new Error("Input data given to '"+e.source+"' is not a valid GeoJSON object."))}}},r.prototype.removeSource=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),e()},r.prototype.getClusterExpansionZoom=function(t,e){e(null,this._geoJSONIndex.getClusterExpansionZoom(t.clusterId))},r.prototype.getClusterChildren=function(t,e){e(null,this._geoJSONIndex.getChildren(t.clusterId))},r.prototype.getClusterLeaves=function(t,e){e(null,this._geoJSONIndex.getLeaves(t.clusterId,t.limit,t.offset))},r}(h),Ct=function(e){var r=this;this.self=e,this.actor=new t.Actor(e,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:h,geojson:Mt},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(t,e){if(r.workerSourceTypes[t])throw new Error('Worker source with name "'+t+'" already registered.');r.workerSourceTypes[t]=e},this.self.registerRTLTextPlugin=function(e){if(t.plugin.isParsed())throw new Error("RTL text plugin already registered.");t.plugin.applyArabicShaping=e.applyArabicShaping,t.plugin.processBidirectionalText=e.processBidirectionalText,t.plugin.processStyledBidirectionalText=e.processStyledBidirectionalText}};return Ct.prototype.setReferrer=function(t,e){this.referrer=e},Ct.prototype.setImages=function(t,e,r){this.availableImages[t]=e,r()},Ct.prototype.setLayers=function(t,e,r){this.getLayerIndex(t).replace(e),r()},Ct.prototype.updateLayers=function(t,e,r){this.getLayerIndex(t).update(e.layers,e.removedIds),r()},Ct.prototype.loadTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).loadTile(e,r)},Ct.prototype.loadDEMTile=function(t,e,r){this.getDEMWorkerSource(t,e.source).loadTile(e,r)},Ct.prototype.reloadTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).reloadTile(e,r)},Ct.prototype.abortTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).abortTile(e,r)},Ct.prototype.removeTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).removeTile(e,r)},Ct.prototype.removeDEMTile=function(t,e){this.getDEMWorkerSource(t,e.source).removeTile(e)},Ct.prototype.removeSource=function(t,e,r){if(this.workerSources[t]&&this.workerSources[t][e.type]&&this.workerSources[t][e.type][e.source]){var n=this.workerSources[t][e.type][e.source];delete this.workerSources[t][e.type][e.source],void 0!==n.removeSource?n.removeSource(e,r):r()}},Ct.prototype.loadWorkerSource=function(t,e,r){try{this.self.importScripts(e.url),r()}catch(t){r(t.toString())}},Ct.prototype.syncRTLPluginState=function(e,r,n){try{t.plugin.setState(r);var i=t.plugin.getPluginURL();if(t.plugin.isLoaded()&&!t.plugin.isParsed()&&null!=i){this.self.importScripts(i);var o=t.plugin.isParsed();n(o?void 0:new Error("RTL Text Plugin failed to import scripts from "+i),o)}}catch(t){n(t.toString())}},Ct.prototype.getAvailableImages=function(t){var e=this.availableImages[t];return e||(e=[]),e},Ct.prototype.getLayerIndex=function(t){var e=this.layerIndexes[t];return e||(e=this.layerIndexes[t]=new n),e},Ct.prototype.getWorkerSource=function(t,e,r){var n=this;if(this.workerSources[t]||(this.workerSources[t]={}),this.workerSources[t][e]||(this.workerSources[t][e]={}),!this.workerSources[t][e][r]){var i={send:function(e,r,i){n.actor.send(e,r,i,t)}};this.workerSources[t][e][r]=new this.workerSourceTypes[e](i,this.getLayerIndex(t),this.getAvailableImages(t))}return this.workerSources[t][e][r]},Ct.prototype.getDEMWorkerSource=function(t,e){return this.demWorkerSources[t]||(this.demWorkerSources[t]={}),this.demWorkerSources[t][e]||(this.demWorkerSources[t][e]=new f),this.demWorkerSources[t][e]},Ct.prototype.enforceCacheSizeLimit=function(e,r){t.enforceCacheSizeLimit(r)},"undefined"!=typeof WorkerGlobalScope&&void 0!==t.window&&t.window instanceof WorkerGlobalScope&&(t.window.worker=new Ct(t.window)),Ct})),n(0,(function(t){var e=t.createCommonjsModule((function(t){function e(t){return!!("undefined"!=typeof window&&"undefined"!=typeof document&&Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray&&Function.prototype&&Function.prototype.bind&&Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions&&"JSON"in window&&"parse"in JSON&&"stringify"in JSON&&function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var t,e,r=new Blob([""],{type:"text/javascript"}),n=URL.createObjectURL(r);try{e=new Worker(n),t=!0}catch(e){t=!1}return e&&e.terminate(),URL.revokeObjectURL(n),t}()&&"Uint8ClampedArray"in window&&ArrayBuffer.isView&&function(t){return void 0===r[t]&&(r[t]=function(t){var r=document.createElement("canvas"),n=Object.create(e.webGLContextAttributes);return n.failIfMajorPerformanceCaveat=t,r.probablySupportsContext?r.probablySupportsContext("webgl",n)||r.probablySupportsContext("experimental-webgl",n):r.supportsContext?r.supportsContext("webgl",n)||r.supportsContext("experimental-webgl",n):r.getContext("webgl",n)||r.getContext("experimental-webgl",n)}(t)),r[t]}(t&&t.failIfMajorPerformanceCaveat))}t.exports?t.exports=e:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=e);var r={};e.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}})),r={create:function(e,r,n){var i=t.window.document.createElement(e);return void 0!==r&&(i.className=r),n&&n.appendChild(i),i},createNS:function(e,r){return t.window.document.createElementNS(e,r)}},n=t.window.document.documentElement.style;function i(t){if(!n)return t[0];for(var e=0;e<t.length;e++)if(t[e]in n)return t[e];return t[0]}var o,a=i(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);r.disableDrag=function(){n&&a&&(o=n[a],n[a]="none")},r.enableDrag=function(){n&&a&&(n[a]=o)};var s=i(["transform","WebkitTransform"]);r.setTransform=function(t,e){t.style[s]=e};var u=!1;try{var c=Object.defineProperty({},"passive",{get:function(){u=!0}});t.window.addEventListener("test",c,c),t.window.removeEventListener("test",c,c)}catch(t){u=!1}r.addEventListener=function(t,e,r,n){void 0===n&&(n={}),"passive"in n&&u?t.addEventListener(e,r,n):t.addEventListener(e,r,n.capture)},r.removeEventListener=function(t,e,r,n){void 0===n&&(n={}),"passive"in n&&u?t.removeEventListener(e,r,n):t.removeEventListener(e,r,n.capture)};var l=function(e){e.preventDefault(),e.stopPropagation(),t.window.removeEventListener("click",l,!0)};function h(t){var e=t.userImage;return!!(e&&e.render&&e.render())&&(t.data.replace(new Uint8Array(e.data.buffer)),!0)}r.suppressClick=function(){t.window.addEventListener("click",l,!0),t.window.setTimeout((function(){t.window.removeEventListener("click",l,!0)}),0)},r.mousePos=function(e,r){var n=e.getBoundingClientRect(),i=t.window.TouchEvent&&r instanceof t.window.TouchEvent?r.touches[0]:r;return new t.Point(i.clientX-n.left-e.clientLeft,i.clientY-n.top-e.clientTop)},r.touchPos=function(e,r){for(var n=e.getBoundingClientRect(),i=[],o="touchend"===r.type?r.changedTouches:r.touches,a=0;a<o.length;a++)i.push(new t.Point(o[a].clientX-n.left-e.clientLeft,o[a].clientY-n.top-e.clientTop));return i},r.mouseButton=function(e){return void 0!==t.window.InstallTrigger&&2===e.button&&e.ctrlKey&&t.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:e.button},r.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)};var f=function(e){function r(){e.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.RGBAImage({width:1,height:1}),this.dirty=!0}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.isLoaded=function(){return this.loaded},r.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t,t)){for(var e=0,r=this.requestors;e<r.length;e+=1){var n=r[e],i=n.ids,o=n.callback;this._notify(i,o)}this.requestors=[]}},r.prototype.getImage=function(t){return this.images[t]},r.prototype.addImage=function(t,e){this._validate(t,e)&&(this.images[t]=e)},r.prototype._validate=function(e,r){var n=!0;return this._validateStretch(r.stretchX,r.data&&r.data.width)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "stretchX" value'))),n=!1),this._validateStretch(r.stretchY,r.data&&r.data.height)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "stretchY" value'))),n=!1),this._validateContent(r.content,r)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "content" value'))),n=!1),n},r.prototype._validateStretch=function(t,e){if(!t)return!0;for(var r=0,n=0,i=t;n<i.length;n+=1){var o=i[n];if(o[0]<r||o[1]<o[0]||e<o[1])return!1;r=o[1]}return!0},r.prototype._validateContent=function(t,e){return!(t&&(4!==t.length||t[0]<0||e.data.width<t[0]||t[1]<0||e.data.height<t[1]||t[2]<0||e.data.width<t[2]||t[3]<0||e.data.height<t[3]||t[2]<t[0]||t[3]<t[1]))},r.prototype.updateImage=function(t,e){var r=this.images[t];e.version=r.version+1,this.images[t]=e,this.updatedImages[t]=!0},r.prototype.removeImage=function(t){var e=this.images[t];delete this.images[t],delete this.patterns[t],e.userImage&&e.userImage.onRemove&&e.userImage.onRemove()},r.prototype.listImages=function(){return Object.keys(this.images)},r.prototype.getImages=function(t,e){var r=!0;if(!this.isLoaded())for(var n=0,i=t;n<i.length;n+=1){var o=i[n];this.images[o]||(r=!1)}this.isLoaded()||r?this._notify(t,e):this.requestors.push({ids:t,callback:e})},r.prototype._notify=function(e,r){for(var n={},i=0,o=e;i<o.length;i+=1){var a=o[i];this.images[a]||this.fire(new t.Event("styleimagemissing",{id:a}));var s=this.images[a];s?n[a]={data:s.data.clone(),pixelRatio:s.pixelRatio,sdf:s.sdf,version:s.version,stretchX:s.stretchX,stretchY:s.stretchY,content:s.content,hasRenderCallback:Boolean(s.userImage&&s.userImage.render)}:t.warnOnce('Image "'+a+'" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.')}r(null,n)},r.prototype.getPixelSize=function(){var t=this.atlasImage;return{width:t.width,height:t.height}},r.prototype.getPattern=function(e){var r=this.patterns[e],n=this.getImage(e);if(!n)return null;if(r&&r.position.version===n.version)return r.position;if(r)r.position.version=n.version;else{var i={w:n.data.width+2,h:n.data.height+2,x:0,y:0},o=new t.ImagePosition(i,n);this.patterns[e]={bin:i,position:o}}return this._updatePatternAtlas(),this.patterns[e].position},r.prototype.bind=function(e){var r=e.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new t.Texture(e,this.atlasImage,r.RGBA),this.atlasTexture.bind(r.LINEAR,r.CLAMP_TO_EDGE)},r.prototype._updatePatternAtlas=function(){var e=[];for(var r in this.patterns)e.push(this.patterns[r].bin);var n=t.potpack(e),i=n.w,o=n.h,a=this.atlasImage;for(var s in a.resize({width:i||1,height:o||1}),this.patterns){var u=this.patterns[s].bin,c=u.x+1,l=u.y+1,h=this.images[s].data,f=h.width,p=h.height;t.RGBAImage.copy(h,a,{x:0,y:0},{x:c,y:l},{width:f,height:p}),t.RGBAImage.copy(h,a,{x:0,y:p-1},{x:c,y:l-1},{width:f,height:1}),t.RGBAImage.copy(h,a,{x:0,y:0},{x:c,y:l+p},{width:f,height:1}),t.RGBAImage.copy(h,a,{x:f-1,y:0},{x:c-1,y:l},{width:1,height:p}),t.RGBAImage.copy(h,a,{x:0,y:0},{x:c+f,y:l},{width:1,height:p})}this.dirty=!0},r.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={}},r.prototype.dispatchRenderCallbacks=function(t){for(var e=0,r=t;e<r.length;e+=1){var n=r[e];if(!this.callbackDispatchedThisFrame[n]){this.callbackDispatchedThisFrame[n]=!0;var i=this.images[n];h(i)&&this.updateImage(n,i)}}},r}(t.Evented),p=g,d=g,A=1e20;function g(t,e,r,n,i,o){this.fontSize=t||24,this.buffer=void 0===e?3:e,this.cutoff=n||.25,this.fontFamily=i||"sans-serif",this.fontWeight=o||"normal",this.radius=r||8;var a=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=a,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(a*a),this.gridInner=new Float64Array(a*a),this.f=new Float64Array(a),this.d=new Float64Array(a),this.z=new Float64Array(a+1),this.v=new Int16Array(a),this.middle=Math.round(a/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function m(t,e,r,n,i,o,a){for(var s=0;s<e;s++){for(var u=0;u<r;u++)n[u]=t[u*e+s];for(y(n,i,o,a,r),u=0;u<r;u++)t[u*e+s]=i[u]}for(u=0;u<r;u++){for(s=0;s<e;s++)n[s]=t[u*e+s];for(y(n,i,o,a,e),s=0;s<e;s++)t[u*e+s]=Math.sqrt(i[s])}}function y(t,e,r,n,i){r[0]=0,n[0]=-A,n[1]=+A;for(var o=1,a=0;o<i;o++){for(var s=(t[o]+o*o-(t[r[a]]+r[a]*r[a]))/(2*o-2*r[a]);s<=n[a];)a--,s=(t[o]+o*o-(t[r[a]]+r[a]*r[a]))/(2*o-2*r[a]);r[++a]=o,n[a]=s,n[a+1]=+A}for(o=0,a=0;o<i;o++){for(;n[a+1]<o;)a++;e[o]=(o-r[a])*(o-r[a])+t[r[a]]}}g.prototype.draw=function(t){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(t,this.buffer,this.middle);for(var e=this.ctx.getImageData(0,0,this.size,this.size),r=new Uint8ClampedArray(this.size*this.size),n=0;n<this.size*this.size;n++){var i=e.data[4*n+3]/255;this.gridOuter[n]=1===i?0:0===i?A:Math.pow(Math.max(0,.5-i),2),this.gridInner[n]=1===i?A:0===i?0:Math.pow(Math.max(0,i-.5),2)}for(m(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),m(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),n=0;n<this.size*this.size;n++){var o=this.gridOuter[n]-this.gridInner[n];r[n]=Math.max(0,Math.min(255,Math.round(255-255*(o/this.radius+this.cutoff))))}return r},p.default=d;var v=function(t,e){this.requestManager=t,this.localIdeographFontFamily=e,this.entries={}};v.prototype.setURL=function(t){this.url=t},v.prototype.getGlyphs=function(e,r){var n=this,i=[];for(var o in e)for(var a=0,s=e[o];a<s.length;a+=1){var u=s[a];i.push({stack:o,id:u})}t.asyncAll(i,(function(t,e){var r=t.stack,i=t.id,o=n.entries[r];o||(o=n.entries[r]={glyphs:{},requests:{}});var a=o.glyphs[i];if(void 0===a){if(a=n._tinySDF(o,r,i))return o.glyphs[i]=a,void e(null,{stack:r,id:i,glyph:a});var s=Math.floor(i/256);if(256*s>65535)e(new Error("glyphs > 65535 not supported"));else{var u=o.requests[s];u||(u=o.requests[s]=[],v.loadGlyphRange(r,s,n.url,n.requestManager,(function(t,e){if(e)for(var r in e)n._doesCharSupportLocalGlyph(+r)||(o.glyphs[+r]=e[+r]);for(var i=0,a=u;i<a.length;i+=1)(0,a[i])(t,e);delete o.requests[s]}))),u.push((function(t,n){t?e(t):n&&e(null,{stack:r,id:i,glyph:n[i]||null})}))}}else e(null,{stack:r,id:i,glyph:a})}),(function(t,e){if(t)r(t);else if(e){for(var n={},i=0,o=e;i<o.length;i+=1){var a=o[i],s=a.stack,u=a.id,c=a.glyph;(n[s]||(n[s]={}))[u]=c&&{id:c.id,bitmap:c.bitmap.clone(),metrics:c.metrics}}r(null,n)}}))},v.prototype._doesCharSupportLocalGlyph=function(e){return!!this.localIdeographFontFamily&&(t.isChar["CJK Unified Ideographs"](e)||t.isChar["Hangul Syllables"](e)||t.isChar.Hiragana(e)||t.isChar.Katakana(e))},v.prototype._tinySDF=function(e,r,n){var i=this.localIdeographFontFamily;if(i&&this._doesCharSupportLocalGlyph(n)){var o=e.tinySDF;if(!o){var a="400";/bold/i.test(r)?a="900":/medium/i.test(r)?a="500":/light/i.test(r)&&(a="200"),o=e.tinySDF=new v.TinySDF(24,3,8,.25,i,a)}return{id:n,bitmap:new t.AlphaImage({width:30,height:30},o.draw(String.fromCharCode(n))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},v.loadGlyphRange=function(e,r,n,i,o){var a=256*r,s=a+255,u=i.transformRequest(i.normalizeGlyphsURL(n).replace("{fontstack}",e).replace("{range}",a+"-"+s),t.ResourceType.Glyphs);t.getArrayBuffer(u,(function(e,r){if(e)o(e);else if(r){for(var n={},i=0,a=t.parseGlyphPBF(r);i<a.length;i+=1){var s=a[i];n[s.id]=s}o(null,n)}}))},v.TinySDF=p;var _=function(){this.specification=t.styleSpec.light.position};_.prototype.possiblyEvaluate=function(e,r){return t.sphericalToCartesian(e.expression.evaluate(r))},_.prototype.interpolate=function(e,r,n){return{x:t.number(e.x,r.x,n),y:t.number(e.y,r.y,n),z:t.number(e.z,r.z,n)}};var b=new t.Properties({anchor:new t.DataConstantProperty(t.styleSpec.light.anchor),position:new _,color:new t.DataConstantProperty(t.styleSpec.light.color),intensity:new t.DataConstantProperty(t.styleSpec.light.intensity)}),x=function(e){function r(r){e.call(this),this._transitionable=new t.Transitionable(b),this.setLight(r),this._transitioning=this._transitionable.untransitioned()}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.getLight=function(){return this._transitionable.serialize()},r.prototype.setLight=function(e,r){if(void 0===r&&(r={}),!this._validate(t.validateLight,e,r))for(var n in e){var i=e[n];t.endsWith(n,"-transition")?this._transitionable.setTransition(n.slice(0,-"-transition".length),i):this._transitionable.setValue(n,i)}},r.prototype.updateTransitions=function(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)},r.prototype.hasTransition=function(){return this._transitioning.hasTransition()},r.prototype.recalculate=function(t){this.properties=this._transitioning.possiblyEvaluate(t)},r.prototype._validate=function(e,r,n){return(!n||!1!==n.validate)&&t.emitValidationErrors(this,e.call(t.validateStyle,t.extend({value:r,style:{glyphs:!0,sprite:!0},styleSpec:t.styleSpec})))},r}(t.Evented),w=function(t,e){this.width=t,this.height=e,this.nextRow=0,this.bytes=4,this.data=new Uint8Array(this.width*this.height*this.bytes),this.positions={}};w.prototype.getDash=function(t,e){var r=t.join(",")+String(e);return this.positions[r]||(this.positions[r]=this.addDash(t,e)),this.positions[r]},w.prototype.addDash=function(e,r){var n=r?7:0,i=2*n+1;if(this.nextRow+i>this.height)return t.warnOnce("LineAtlas out of space"),null;for(var o=0,a=0;a<e.length;a++)o+=e[a];for(var s=this.width/o,u=s/2,c=e.length%2==1,l=-n;l<=n;l++)for(var h=this.nextRow+n+l,f=this.width*h,p=c?-e[e.length-1]:0,d=e[0],A=1,g=0;g<this.width;g++){for(;d<g/s;)p=d,d+=e[A],c&&A===e.length-1&&(d+=e[0]),A++;var m=Math.abs(g-p*s),y=Math.abs(g-d*s),v=Math.min(m,y),_=A%2==1,b=void 0;if(r){var x=n?l/n*(u+1):0;if(_){var w=u-Math.abs(x);b=Math.sqrt(v*v+w*w)}else b=u-Math.sqrt(v*v+x*x)}else b=(_?1:-1)*v;this.data[3+4*(f+g)]=Math.max(0,Math.min(255,b+128))}var E={y:(this.nextRow+n+.5)/this.height,height:2*n/this.height,width:o};return this.nextRow+=i,this.dirty=!0,E},w.prototype.bind=function(t){var e=t.gl;this.texture?(e.bindTexture(e.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,e.texSubImage2D(e.TEXTURE_2D,0,0,0,this.width,this.height,e.RGBA,e.UNSIGNED_BYTE,this.data))):(this.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,this.width,this.height,0,e.RGBA,e.UNSIGNED_BYTE,this.data))};var E=function e(r,n){this.workerPool=r,this.actors=[],this.currentActor=0,this.id=t.uniqueId();for(var i=this.workerPool.acquire(this.id),o=0;o<i.length;o++){var a=i[o],s=new e.Actor(a,n,this.id);s.name="Worker "+o,this.actors.push(s)}};function S(e,r,n){var i=function(i,o){if(i)return n(i);if(o){var a=t.pick(t.extend(o,e),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);o.vector_layers&&(a.vectorLayers=o.vector_layers,a.vectorLayerIds=a.vectorLayers.map((function(t){return t.id}))),e.url&&(a.tiles=r.canonicalizeTileset(a,e.url)),n(null,a)}};return e.url?t.getJSON(r.transformRequest(r.normalizeSourceURL(e.url),t.ResourceType.Source),i):t.browser.frame((function(){return i(null,e)}))}E.prototype.broadcast=function(e,r,n){n=n||function(){},t.asyncAll(this.actors,(function(t,n){t.send(e,r,n)}),n)},E.prototype.getActor=function(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]},E.prototype.remove=function(){this.actors.forEach((function(t){t.remove()})),this.actors=[],this.workerPool.release(this.id)},E.Actor=t.Actor;var O=function(e,r,n){this.bounds=t.LngLatBounds.convert(this.validateBounds(e)),this.minzoom=r||0,this.maxzoom=n||24};O.prototype.validateBounds=function(t){return Array.isArray(t)&&4===t.length?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]},O.prototype.contains=function(e){var r=Math.pow(2,e.z),n=Math.floor(t.mercatorXfromLng(this.bounds.getWest())*r),i=Math.floor(t.mercatorYfromLat(this.bounds.getNorth())*r),o=Math.ceil(t.mercatorXfromLng(this.bounds.getEast())*r),a=Math.ceil(t.mercatorYfromLat(this.bounds.getSouth())*r);return e.x>=n&&e.x<o&&e.y>=i&&e.y<a};var T=function(e){function r(r,n,i,o){if(e.call(this),this.id=r,this.dispatcher=i,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,t.extend(this,t.pick(n,["url","scheme","tileSize"])),this._options=t.extend({type:"vector"},n),this._collectResourceTiming=n.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(o)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(){var e=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=S(this._options,this.map._requestManager,(function(r,n){e._tileJSONRequest=null,e._loaded=!0,r?e.fire(new t.ErrorEvent(r)):n&&(t.extend(e,n),n.bounds&&(e.tileBounds=new O(n.bounds,e.minzoom,e.maxzoom)),t.postTurnstileEvent(n.tiles,e.map._requestManager._customAccessToken),t.postMapLoadEvent(n.tiles,e.map._getMapId(),e.map._requestManager._skuToken,e.map._requestManager._customAccessToken),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})))}))},r.prototype.loaded=function(){return this._loaded},r.prototype.hasTile=function(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},r.prototype.serialize=function(){return t.extend({},this._options)},r.prototype.loadTile=function(e,r){var n=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme),this.url,null),i={request:this.map._requestManager.transformRequest(n,t.ResourceType.Tile),uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes};function o(n,i){return delete e.request,e.aborted?r(null):n&&404!==n.status?r(n):(i&&i.resourceTiming&&(e.resourceTiming=i.resourceTiming),this.map._refreshExpiredTiles&&i&&e.setExpiryData(i),e.loadVectorData(i,this.map.painter),t.cacheEntryPossiblyAdded(this.dispatcher),r(null),void(e.reloadCallback&&(this.loadTile(e,e.reloadCallback),e.reloadCallback=null)))}i.request.collectResourceTiming=this._collectResourceTiming,e.actor&&"expired"!==e.state?"loading"===e.state?e.reloadCallback=r:e.request=e.actor.send("reloadTile",i,o.bind(this)):(e.actor=this.dispatcher.getActor(),e.request=e.actor.send("loadTile",i,o.bind(this)))},r.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.actor&&t.actor.send("abortTile",{uid:t.uid,type:this.type,source:this.id},void 0)},r.prototype.unloadTile=function(t){t.unloadVectorData(),t.clearMask(),t.actor&&t.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id},void 0)},r.prototype.hasTransition=function(){return!1},r}(t.Evented),P=function(e){function r(r,n,i,o){e.call(this),this.id=r,this.dispatcher=i,this.setEventedParent(o),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=t.extend({type:"raster"},n),t.extend(this,t.pick(n,["url","scheme","tileSize"]))}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(){var e=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=S(this._options,this.map._requestManager,(function(r,n){e._tileJSONRequest=null,e._loaded=!0,r?e.fire(new t.ErrorEvent(r)):n&&(t.extend(e,n),n.bounds&&(e.tileBounds=new O(n.bounds,e.minzoom,e.maxzoom)),t.postTurnstileEvent(n.tiles),t.postMapLoadEvent(n.tiles,e.map._getMapId(),e.map._requestManager._skuToken),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})))}))},r.prototype.loaded=function(){return this._loaded},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},r.prototype.serialize=function(){return t.extend({},this._options)},r.prototype.hasTile=function(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)},r.prototype.loadTile=function(e,r){var n=this,i=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme),this.url,this.tileSize);e.request=t.getImage(this.map._requestManager.transformRequest(i,t.ResourceType.Tile),(function(i,o){if(delete e.request,e.aborted)e.state="unloaded",r(null);else if(i)e.state="errored",r(i);else if(o){n.map._refreshExpiredTiles&&e.setExpiryData(o),delete o.cacheControl,delete o.expires;var a=n.map.painter.context,s=a.gl;e.texture=n.map.painter.getTileTexture(o.width),e.texture?e.texture.update(o,{useMipmap:!0}):(e.texture=new t.Texture(a,o,s.RGBA,{useMipmap:!0}),e.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE,s.LINEAR_MIPMAP_NEAREST),a.extTextureFilterAnisotropic&&s.texParameterf(s.TEXTURE_2D,a.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,a.extTextureFilterAnisotropicMax)),e.state="loaded",t.cacheEntryPossiblyAdded(n.dispatcher),r(null)}}))},r.prototype.abortTile=function(t,e){t.request&&(t.request.cancel(),delete t.request),e()},r.prototype.unloadTile=function(t,e){t.texture&&this.map.painter.saveTileTexture(t.texture),t.clearMask(),e()},r.prototype.hasTransition=function(){return!1},r}(t.Evented),M=function(e){function r(r,n,i,o){e.call(this,r,n,i,o),this.type="raster-dem",this.maxzoom=22,this._options=t.extend({type:"raster-dem"},n),this.encoding=n.encoding||"mapbox"}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.serialize=function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},r.prototype.loadTile=function(e,r){var n=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme),this.url,this.tileSize);function i(t,n){t&&(e.state="errored",r(t)),n&&(e.dem=n,e.needsHillshadePrepare=!0,e.state="loaded",r(null))}e.request=t.getImage(this.map._requestManager.transformRequest(n,t.ResourceType.Tile),function(n,o){if(delete e.request,e.aborted)e.state="unloaded",r(null);else if(n)e.state="errored",r(n);else if(o){this.map._refreshExpiredTiles&&e.setExpiryData(o),delete o.cacheControl,delete o.expires;var a=t.browser.getImageData(o,1),s={uid:e.uid,coord:e.tileID,source:this.id,rawImageData:a,encoding:this.encoding};e.actor&&"expired"!==e.state||(e.actor=this.dispatcher.getActor(),e.actor.send("loadDEMTile",s,i.bind(this)))}}.bind(this)),e.neighboringTiles=this._getNeighboringTiles(e.tileID)},r.prototype._getNeighboringTiles=function(e){var r=e.canonical,n=Math.pow(2,r.z),i=(r.x-1+n)%n,o=0===r.x?e.wrap-1:e.wrap,a=(r.x+1+n)%n,s=r.x+1===n?e.wrap+1:e.wrap,u={};return u[new t.OverscaledTileID(e.overscaledZ,o,r.z,i,r.y).key]={backfilled:!1},u[new t.OverscaledTileID(e.overscaledZ,s,r.z,a,r.y).key]={backfilled:!1},r.y>0&&(u[new t.OverscaledTileID(e.overscaledZ,o,r.z,i,r.y-1).key]={backfilled:!1},u[new t.OverscaledTileID(e.overscaledZ,e.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},u[new t.OverscaledTileID(e.overscaledZ,s,r.z,a,r.y-1).key]={backfilled:!1}),r.y+1<n&&(u[new t.OverscaledTileID(e.overscaledZ,o,r.z,i,r.y+1).key]={backfilled:!1},u[new t.OverscaledTileID(e.overscaledZ,e.wrap,r.z,r.x,r.y+1).key]={backfilled:!1},u[new t.OverscaledTileID(e.overscaledZ,s,r.z,a,r.y+1).key]={backfilled:!1}),u},r.prototype.unloadTile=function(t){t.demTexture&&this.map.painter.saveTileTexture(t.demTexture),t.fbo&&(t.fbo.destroy(),delete t.fbo),t.dem&&delete t.dem,delete t.neighboringTiles,t.clearMask(),t.state="unloaded",t.actor&&t.actor.send("removeDEMTile",{uid:t.uid,source:this.id})},r}(P),C=function(e){function r(r,n,i,o){e.call(this),this.id=r,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._loaded=!1,this.actor=i.getActor(),this.setEventedParent(o),this._data=n.data,this._options=t.extend({},n),this._collectResourceTiming=n.collectResourceTiming,this._resourceTiming=[],void 0!==n.maxzoom&&(this.maxzoom=n.maxzoom),n.type&&(this.type=n.type),n.attribution&&(this.attribution=n.attribution);var a=t.EXTENT/this.tileSize;this.workerOptions=t.extend({source:this.id,cluster:n.cluster||!1,geojsonVtOptions:{buffer:(void 0!==n.buffer?n.buffer:128)*a,tolerance:(void 0!==n.tolerance?n.tolerance:.375)*a,extent:t.EXTENT,maxZoom:this.maxzoom,lineMetrics:n.lineMetrics||!1,generateId:n.generateId||!1},superclusterOptions:{maxZoom:void 0!==n.clusterMaxZoom?Math.min(n.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,extent:t.EXTENT,radius:(n.clusterRadius||50)*a,log:!1,generateId:n.generateId||!1},clusterProperties:n.clusterProperties},n.workerOptions)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(){var e=this;this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(r){if(r)e.fire(new t.ErrorEvent(r));else{var n={dataType:"source",sourceDataType:"metadata"};e._collectResourceTiming&&e._resourceTiming&&e._resourceTiming.length>0&&(n.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new t.Event("data",n))}}))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setData=function(e){var r=this;return this._data=e,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(e){if(e)r.fire(new t.ErrorEvent(e));else{var n={dataType:"source",sourceDataType:"content"};r._collectResourceTiming&&r._resourceTiming&&r._resourceTiming.length>0&&(n.resourceTiming=r._resourceTiming,r._resourceTiming=[]),r.fire(new t.Event("data",n))}})),this},r.prototype.getClusterExpansionZoom=function(t,e){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},e),this},r.prototype.getClusterChildren=function(t,e){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},e),this},r.prototype.getClusterLeaves=function(t,e,r,n){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:r},n),this},r.prototype._updateWorkerData=function(e){var r=this;this._loaded=!1;var n=t.extend({},this.workerOptions),i=this._data;"string"==typeof i?(n.request=this.map._requestManager.transformRequest(t.browser.resolveURL(i),t.ResourceType.Source),n.request.collectResourceTiming=this._collectResourceTiming):n.data=JSON.stringify(i),this.actor.send(this.type+".loadData",n,(function(t,i){r._removed||i&&i.abandoned||(r._loaded=!0,i&&i.resourceTiming&&i.resourceTiming[r.id]&&(r._resourceTiming=i.resourceTiming[r.id].slice(0)),r.actor.send(r.type+".coalesce",{source:n.source},null),e(t))}))},r.prototype.loaded=function(){return this._loaded},r.prototype.loadTile=function(e,r){var n=this,i=e.actor?"reloadTile":"loadTile";e.actor=this.actor;var o={type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes};e.request=this.actor.send(i,o,(function(t,o){return delete e.request,e.unloadVectorData(),e.aborted?r(null):t?r(t):(e.loadVectorData(o,n.map.painter,"reloadTile"===i),r(null))}))},r.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0},r.prototype.unloadTile=function(t){t.unloadVectorData(),t.clearMask(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})},r.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},r.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},r.prototype.hasTransition=function(){return!1},r}(t.Evented),I=function(e){function r(t,r,n,i){e.call(this),this.id=t,this.dispatcher=n,this.coordinates=r.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(i),this.options=r}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(e,r){var n=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this.url=this.options.url,t.getImage(this.map._requestManager.transformRequest(this.url,t.ResourceType.Image),(function(i,o){n._loaded=!0,i?n.fire(new t.ErrorEvent(i)):o&&(n.image=o,e&&(n.coordinates=e),r&&r(),n._finishLoading())}))},r.prototype.loaded=function(){return this._loaded},r.prototype.updateImage=function(t){var e=this;return this.image&&t.url?(this.options.url=t.url,this.load(t.coordinates,(function(){e.texture=null})),this):this},r.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setCoordinates=function(e){var r=this;this.coordinates=e;var n=e.map(t.MercatorCoordinate.fromLngLat);this.tileID=function(e){for(var r=1/0,n=1/0,i=-1/0,o=-1/0,a=0,s=e;a<s.length;a+=1){var u=s[a];r=Math.min(r,u.x),n=Math.min(n,u.y),i=Math.max(i,u.x),o=Math.max(o,u.y)}var c=i-r,l=o-n,h=Math.max(c,l),f=Math.max(0,Math.floor(-Math.log(h)/Math.LN2)),p=Math.pow(2,f);return new t.CanonicalTileID(f,Math.floor((r+i)/2*p),Math.floor((n+o)/2*p))}(n),this.minzoom=this.maxzoom=this.tileID.z;var i=n.map((function(t){return r.tileID.getTilePoint(t)._round()}));return this._boundsArray=new t.StructArrayLayout4i8,this._boundsArray.emplaceBack(i[0].x,i[0].y,0,0),this._boundsArray.emplaceBack(i[1].x,i[1].y,t.EXTENT,0),this._boundsArray.emplaceBack(i[3].x,i[3].y,0,t.EXTENT),this._boundsArray.emplaceBack(i[2].x,i[2].y,t.EXTENT,t.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})),this},r.prototype.prepare=function(){if(0!==Object.keys(this.tiles).length&&this.image){var e=this.map.painter.context,r=e.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,t.rasterBoundsAttributes.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new t.Texture(e,this.image,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[n];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},r.prototype.loadTile=function(t,e){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={},e(null)):(t.state="errored",e(null))},r.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return!1},r}(t.Evented),k=function(e){function r(t,r,n,i){e.call(this,t,r,n,i),this.roundZoom=!0,this.type="video",this.options=r}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(){var e=this;this._loaded=!1;var r=this.options;this.urls=[];for(var n=0,i=r.urls;n<i.length;n+=1){var o=i[n];this.urls.push(this.map._requestManager.transformRequest(o,t.ResourceType.Source).url)}t.getVideo(this.urls,(function(r,n){e._loaded=!0,r?e.fire(new t.ErrorEvent(r)):n&&(e.video=n,e.video.loop=!0,e.video.addEventListener("playing",(function(){e.map.triggerRepaint()})),e.map&&e.video.play(),e._finishLoading())}))},r.prototype.pause=function(){this.video&&this.video.pause()},r.prototype.play=function(){this.video&&this.video.play()},r.prototype.seek=function(e){if(this.video){var r=this.video.seekable;e<r.start(0)||e>r.end(0)?this.fire(new t.ErrorEvent(new t.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+r.start(0)+" and "+r.end(0)+"-second mark."))):this.video.currentTime=e}},r.prototype.getVideo=function(){return this.video},r.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},r.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var e=this.map.painter.context,r=e.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,t.rasterBoundsAttributes.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new t.Texture(e,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[n];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this.video&&!this.video.paused},r}(I),R=function(e){function r(r,n,i,o){e.call(this,r,n,i,o),n.coordinates?Array.isArray(n.coordinates)&&4===n.coordinates.length&&!n.coordinates.some((function(t){return!Array.isArray(t)||2!==t.length||t.some((function(t){return"number"!=typeof t}))}))||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "coordinates"'))),n.animate&&"boolean"!=typeof n.animate&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'optional "animate" property must be a boolean value'))),n.canvas?"string"==typeof n.canvas||n.canvas instanceof t.window.HTMLCanvasElement||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "canvas"'))),this.options=n,this.animate=void 0===n.animate||n.animate}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof t.window.HTMLCanvasElement?this.options.canvas:t.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},r.prototype.getCanvas=function(){return this.canvas},r.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()},r.prototype.onRemove=function(){this.pause()},r.prototype.prepare=function(){var e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){var r=this.map.painter.context,n=r.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,t.rasterBoundsAttributes.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new t.Texture(r,this.canvas,n.RGBA,{premultiply:!0}),this.tiles){var o=this.tiles[i];"loaded"!==o.state&&(o.state="loaded",o.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this._playing},r.prototype._hasInvalidDimensions=function(){for(var t=0,e=[this.canvas.width,this.canvas.height];t<e.length;t+=1){var r=e[t];if(isNaN(r)||r<=0)return!0}return!1},r}(I),L={vector:T,raster:P,"raster-dem":M,geojson:C,video:k,image:I,canvas:R};function j(e,r){var n=t.identity([]);return t.translate(n,n,[1,1,0]),t.scale(n,n,[.5*e.width,.5*e.height,1]),t.multiply(n,n,e.calculatePosMatrix(r.toUnwrapped()))}function D(t,e,r,n,i){var o=function(t,e,r){if(t)for(var n=0,i=t;n<i.length;n+=1){var o=e[i[n]];if(o&&o.source===r&&"fill-extrusion"===o.type)return!0}else for(var a in e){var s=e[a];if(s.source===r&&"fill-extrusion"===s.type)return!0}return!1}(n&&n.layers,e,t.id),a=i.maxPitchScaleFactor(),s=t.tilesIn(r,a,o);s.sort(B);for(var u=[],c=0,l=s;c<l.length;c+=1){var h=l[c];u.push({wrappedTileID:h.tileID.wrapped().key,queryResults:h.tile.queryRenderedFeatures(e,t._state,h.queryGeometry,h.cameraQueryGeometry,h.scale,n,i,a,j(t.transform,h.tileID))})}var f=function(t){for(var e={},r={},n=0,i=t;n<i.length;n+=1){var o=i[n],a=o.queryResults,s=o.wrappedTileID,u=r[s]=r[s]||{};for(var c in a)for(var l=a[c],h=u[c]=u[c]||{},f=e[c]=e[c]||[],p=0,d=l;p<d.length;p+=1){var A=d[p];h[A.featureIndex]||(h[A.featureIndex]=!0,f.push(A))}}return e}(u);for(var p in f)f[p].forEach((function(e){var r=e.feature,n=t.getFeatureState(r.layer["source-layer"],r.id);r.source=r.layer.source,r.layer["source-layer"]&&(r.sourceLayer=r.layer["source-layer"]),r.state=n}));return f}function B(t,e){var r=t.tileID,n=e.tileID;return r.overscaledZ-n.overscaledZ||r.canonical.y-n.canonical.y||r.wrap-n.wrap||r.canonical.x-n.canonical.x}var F=function(t,e){this.max=t,this.onRemove=e,this.reset()};F.prototype.reset=function(){for(var t in this.data)for(var e=0,r=this.data[t];e<r.length;e+=1){var n=r[e];n.timeout&&clearTimeout(n.timeout),this.onRemove(n.value)}return this.data={},this.order=[],this},F.prototype.add=function(t,e,r){var n=this,i=t.wrapped().key;void 0===this.data[i]&&(this.data[i]=[]);var o={value:e,timeout:void 0};if(void 0!==r&&(o.timeout=setTimeout((function(){n.remove(t,o)}),r)),this.data[i].push(o),this.order.push(i),this.order.length>this.max){var a=this._getAndRemoveByKey(this.order[0]);a&&this.onRemove(a)}return this},F.prototype.has=function(t){return t.wrapped().key in this.data},F.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},F.prototype._getAndRemoveByKey=function(t){var e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value},F.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},F.prototype.remove=function(t,e){if(!this.has(t))return this;var r=t.wrapped().key,n=void 0===e?0:this.data[r].indexOf(e),i=this.data[r][n];return this.data[r].splice(n,1),i.timeout&&clearTimeout(i.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(i.value),this.order.splice(this.order.indexOf(r),1),this},F.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this},F.prototype.filter=function(t){var e=[];for(var r in this.data)for(var n=0,i=this.data[r];n<i.length;n+=1){var o=i[n];t(o.value)||e.push(o)}for(var a=0,s=e;a<s.length;a+=1){var u=s[a];this.remove(u.value.tileID,u)}};var z=function(t,e,r){this.context=t;var n=t.gl;this.buffer=n.createBuffer(),this.dynamicDraw=Boolean(r),this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),n.bufferData(n.ELEMENT_ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer};z.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},z.prototype.updateData=function(t){var e=this.context.gl;this.context.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)},z.prototype.destroy=function(){var t=this.context.gl;this.buffer&&(t.deleteBuffer(this.buffer),delete this.buffer)};var N={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},U=function(t,e,r,n){this.length=e.length,this.attributes=r,this.itemSize=e.bytesPerElement,this.dynamicDraw=n,this.context=t;var i=t.gl;this.buffer=i.createBuffer(),t.bindVertexBuffer.set(this.buffer),i.bufferData(i.ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?i.DYNAMIC_DRAW:i.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer};U.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},U.prototype.updateData=function(t){var e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer)},U.prototype.enableAttributes=function(t,e){for(var r=0;r<this.attributes.length;r++){var n=this.attributes[r],i=e.attributes[n.name];void 0!==i&&t.enableVertexAttribArray(i)}},U.prototype.setVertexAttribPointers=function(t,e,r){for(var n=0;n<this.attributes.length;n++){var i=this.attributes[n],o=e.attributes[i.name];void 0!==o&&t.vertexAttribPointer(o,i.components,t[N[i.type]],!1,this.itemSize,i.offset+this.itemSize*(r||0))}},U.prototype.destroy=function(){var t=this.context.gl;this.buffer&&(t.deleteBuffer(this.buffer),delete this.buffer)};var V=function(t){this.gl=t.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1};V.prototype.get=function(){return this.current},V.prototype.set=function(t){},V.prototype.getDefault=function(){return this.default},V.prototype.setDefault=function(){this.set(this.default)};var G=function(e){function r(){e.apply(this,arguments)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.getDefault=function(){return t.Color.transparent},r.prototype.set=function(t){var e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)},r}(V),W=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return 1},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.clearDepth(t),this.current=t,this.dirty=!1)},e}(V),H=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return 0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.clearStencil(t),this.current=t,this.dirty=!1)},e}(V),q=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return[!0,!0,!0,!0]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)},e}(V),Z=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return!0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.depthMask(t),this.current=t,this.dirty=!1)},e}(V),X=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return 255},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.stencilMask(t),this.current=t,this.dirty=!1)},e}(V),Q=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return{func:this.gl.ALWAYS,ref:0,mask:255}},e.prototype.set=function(t){var e=this.current;(t.func!==e.func||t.ref!==e.ref||t.mask!==e.mask||this.dirty)&&(this.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t,this.dirty=!1)},e}(V),Y=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){var t=this.gl;return[t.KEEP,t.KEEP,t.KEEP]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||this.dirty)&&(this.gl.stencilOp(t[0],t[1],t[2]),this.current=t,this.dirty=!1)},e}(V),K=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.STENCIL_TEST):e.disable(e.STENCIL_TEST),this.current=t,this.dirty=!1}},e}(V),$=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return[0,1]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.depthRange(t[0],t[1]),this.current=t,this.dirty=!1)},e}(V),J=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),this.current=t,this.dirty=!1}},e}(V),tt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return this.gl.LESS},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.depthFunc(t),this.current=t,this.dirty=!1)},e}(V),et=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.BLEND):e.disable(e.BLEND),this.current=t,this.dirty=!1}},e}(V),rt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){var t=this.gl;return[t.ONE,t.ZERO]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.blendFunc(t[0],t[1]),this.current=t,this.dirty=!1)},e}(V),nt=function(e){function r(){e.apply(this,arguments)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.getDefault=function(){return t.Color.transparent},r.prototype.set=function(t){var e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)},r}(V),it=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return this.gl.FUNC_ADD},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.blendEquation(t),this.current=t,this.dirty=!1)},e}(V),ot=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.CULL_FACE):e.disable(e.CULL_FACE),this.current=t,this.dirty=!1}},e}(V),at=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return this.gl.BACK},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.cullFace(t),this.current=t,this.dirty=!1)},e}(V),st=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return this.gl.CCW},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(t),this.current=t,this.dirty=!1)},e}(V),ut=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.useProgram(t),this.current=t,this.dirty=!1)},e}(V),ct=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return this.gl.TEXTURE0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.activeTexture(t),this.current=t,this.dirty=!1)},e}(V),lt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){var t=this.gl;return[0,0,t.drawingBufferWidth,t.drawingBufferHeight]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)},e}(V),ht=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,t),this.current=t,this.dirty=!1}},e}(V),ft=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindRenderbuffer(e.RENDERBUFFER,t),this.current=t,this.dirty=!1}},e}(V),pt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindTexture(e.TEXTURE_2D,t),this.current=t,this.dirty=!1}},e}(V),dt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindBuffer(e.ARRAY_BUFFER,t),this.current=t,this.dirty=!1}},e}(V),At=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){var e=this.gl;e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1},e}(V),gt=function(t){function e(e){t.call(this,e),this.vao=e.extVertexArrayObject}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){this.vao&&(t!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(t),this.current=t,this.dirty=!1)},e}(V),mt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return 4},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1}},e}(V),yt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1}},e}(V),vt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1}},e}(V),_t=function(t){function e(e,r){t.call(this,e),this.context=e,this.parent=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return null},e}(V),bt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setDirty=function(){this.dirty=!0},e.prototype.set=function(t){if(t!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var e=this.gl;e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}},e}(_t),xt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){if(t!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var e=this.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t),this.current=t,this.dirty=!1}},e}(_t),wt=function(t,e,r){this.context=t,this.width=e,this.height=r;var n=t.gl,i=this.framebuffer=n.createFramebuffer();this.colorAttachment=new bt(t,i),this.depthAttachment=new xt(t,i)};wt.prototype.destroy=function(){var t=this.context.gl,e=this.colorAttachment.get();e&&t.deleteTexture(e);var r=this.depthAttachment.get();r&&t.deleteRenderbuffer(r),t.deleteFramebuffer(this.framebuffer)};var Et=function(t,e,r){this.func=t,this.mask=e,this.range=r};Et.ReadOnly=!1,Et.ReadWrite=!0,Et.disabled=new Et(519,Et.ReadOnly,[0,1]);var St=function(t,e,r,n,i,o){this.test=t,this.ref=e,this.mask=r,this.fail=n,this.depthFail=i,this.pass=o};St.disabled=new St({func:519,mask:0},0,0,7680,7680,7680);var Ot=function(t,e,r){this.blendFunction=t,this.blendColor=e,this.mask=r};Ot.disabled=new Ot(Ot.Replace=[1,0],t.Color.transparent,[!1,!1,!1,!1]),Ot.unblended=new Ot(Ot.Replace,t.Color.transparent,[!0,!0,!0,!0]),Ot.alphaBlended=new Ot([1,771],t.Color.transparent,[!0,!0,!0,!0]);var Tt=function(t,e,r){this.enable=t,this.mode=e,this.frontFace=r};Tt.disabled=new Tt(!1,1029,2305),Tt.backCCW=new Tt(!0,1029,2305);var Pt=function(t){this.gl=t,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new G(this),this.clearDepth=new W(this),this.clearStencil=new H(this),this.colorMask=new q(this),this.depthMask=new Z(this),this.stencilMask=new X(this),this.stencilFunc=new Q(this),this.stencilOp=new Y(this),this.stencilTest=new K(this),this.depthRange=new $(this),this.depthTest=new J(this),this.depthFunc=new tt(this),this.blend=new et(this),this.blendFunc=new rt(this),this.blendColor=new nt(this),this.blendEquation=new it(this),this.cullFace=new ot(this),this.cullFaceSide=new at(this),this.frontFace=new st(this),this.program=new ut(this),this.activeTexture=new ct(this),this.viewport=new lt(this),this.bindFramebuffer=new ht(this),this.bindRenderbuffer=new ft(this),this.bindTexture=new pt(this),this.bindVertexBuffer=new dt(this),this.bindElementBuffer=new At(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new gt(this),this.pixelStoreUnpack=new mt(this),this.pixelStoreUnpackPremultiplyAlpha=new yt(this),this.pixelStoreUnpackFlipY=new vt(this),this.extTextureFilterAnisotropic=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=t.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=t.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&t.getExtension("OES_texture_half_float_linear"),this.extTimerQuery=t.getExtension("EXT_disjoint_timer_query")};Pt.prototype.setDefault=function(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()},Pt.prototype.setDirty=function(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.extVertexArrayObject&&(this.bindVertexArrayOES.dirty=!0),this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0},Pt.prototype.createIndexBuffer=function(t,e){return new z(this,t,e)},Pt.prototype.createVertexBuffer=function(t,e,r){return new U(this,t,e,r)},Pt.prototype.createRenderbuffer=function(t,e,r){var n=this.gl,i=n.createRenderbuffer();return this.bindRenderbuffer.set(i),n.renderbufferStorage(n.RENDERBUFFER,t,e,r),this.bindRenderbuffer.set(null),i},Pt.prototype.createFramebuffer=function(t,e){return new wt(this,t,e)},Pt.prototype.clear=function(t){var e=t.color,r=t.depth,n=this.gl,i=0;e&&(i|=n.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),void 0!==r&&(i|=n.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(r),this.depthMask.set(!0)),n.clear(i)},Pt.prototype.setCullFace=function(t){!1===t.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(t.mode),this.frontFace.set(t.frontFace))},Pt.prototype.setDepthMode=function(t){t.func!==this.gl.ALWAYS||t.mask?(this.depthTest.set(!0),this.depthFunc.set(t.func),this.depthMask.set(t.mask),this.depthRange.set(t.range)):this.depthTest.set(!1)},Pt.prototype.setStencilMode=function(t){t.test.func!==this.gl.ALWAYS||t.mask?(this.stencilTest.set(!0),this.stencilMask.set(t.mask),this.stencilOp.set([t.fail,t.depthFail,t.pass]),this.stencilFunc.set({func:t.test.func,ref:t.ref,mask:t.test.mask})):this.stencilTest.set(!1)},Pt.prototype.setColorMode=function(e){t.deepEqual(e.blendFunction,Ot.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask)},Pt.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)};var Mt=function(e){function r(r,n,i){var o=this;e.call(this),this.id=r,this.dispatcher=i,this.on("data",(function(t){"source"===t.dataType&&"metadata"===t.sourceDataType&&(o._sourceLoaded=!0),o._sourceLoaded&&!o._paused&&"source"===t.dataType&&"content"===t.sourceDataType&&(o.reload(),o.transform&&o.update(o.transform))})),this.on("error",(function(){o._sourceErrored=!0})),this._source=function(e,r,n,i){var o=new L[r.type](e,r,n,i);if(o.id!==e)throw new Error("Expected Source id to be "+e+" instead of "+o.id);return t.bindAll(["load","abort","unload","serialize","prepare"],o),o}(r,n,i,this),this._tiles={},this._cache=new F(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._coveredTiles={},this._state=new t.SourceFeatureState}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.onAdd=function(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(t)},r.prototype.onRemove=function(t){this._source&&this._source.onRemove&&this._source.onRemove(t)},r.prototype.loaded=function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;if(!this._source.loaded())return!1;for(var t in this._tiles){var e=this._tiles[t];if("loaded"!==e.state&&"errored"!==e.state)return!1}return!0},r.prototype.getSource=function(){return this._source},r.prototype.pause=function(){this._paused=!0},r.prototype.resume=function(){if(this._paused){var t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform)}},r.prototype._loadTile=function(t,e){return this._source.loadTile(t,e)},r.prototype._unloadTile=function(t){if(this._source.unloadTile)return this._source.unloadTile(t,(function(){}))},r.prototype._abortTile=function(t){if(this._source.abortTile)return this._source.abortTile(t,(function(){}))},r.prototype.serialize=function(){return this._source.serialize()},r.prototype.prepare=function(t){for(var e in this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null),this._tiles){var r=this._tiles[e];r.upload(t),r.prepare(this.map.style.imageManager)}},r.prototype.getIds=function(){return Object.keys(this._tiles).map(Number).sort(Ct)},r.prototype.getRenderableIds=function(e){var r=this,n=[];for(var i in this._tiles)this._isIdRenderable(+i,e)&&n.push(+i);return e?n.sort((function(e,n){var i=r._tiles[e].tileID,o=r._tiles[n].tileID,a=new t.Point(i.canonical.x,i.canonical.y)._rotate(r.transform.angle),s=new t.Point(o.canonical.x,o.canonical.y)._rotate(r.transform.angle);return i.overscaledZ-o.overscaledZ||s.y-a.y||s.x-a.x})):n.sort(Ct)},r.prototype.hasRenderableParent=function(t){var e=this.findLoadedParent(t,0);return!!e&&this._isIdRenderable(e.tileID.key)},r.prototype._isIdRenderable=function(t,e){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(e||!this._tiles[t].holdingForFade())},r.prototype.reload=function(){if(this._paused)this._shouldReloadOnResume=!0;else for(var t in this._cache.reset(),this._tiles)"errored"!==this._tiles[t].state&&this._reloadTile(t,"reloading")},r.prototype._reloadTile=function(t,e){var r=this._tiles[t];r&&("loading"!==r.state&&(r.state=e),this._loadTile(r,this._tileLoaded.bind(this,r,t,e)))},r.prototype._tileLoaded=function(e,r,n,i){if(i)return e.state="errored",void(404!==i.status?this._source.fire(new t.ErrorEvent(i,{tile:e})):this.update(this.transform));e.timeAdded=t.browser.now(),"expired"===n&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(r,e),"raster-dem"===this.getSource().type&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),this._source.fire(new t.Event("data",{dataType:"source",tile:e,coord:e.tileID}))},r.prototype._backfillDEM=function(t){for(var e=this.getRenderableIds(),r=0;r<e.length;r++){var n=e[r];if(t.neighboringTiles&&t.neighboringTiles[n]){var i=this.getTileByID(n);o(t,i),o(i,t)}}function o(t,e){t.needsHillshadePrepare=!0;var r=e.tileID.canonical.x-t.tileID.canonical.x,n=e.tileID.canonical.y-t.tileID.canonical.y,i=Math.pow(2,t.tileID.canonical.z),o=e.tileID.key;0===r&&0===n||Math.abs(n)>1||(Math.abs(r)>1&&(1===Math.abs(r+i)?r+=i:1===Math.abs(r-i)&&(r-=i)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,r,n),t.neighboringTiles&&t.neighboringTiles[o]&&(t.neighboringTiles[o].backfilled=!0)))}},r.prototype.getTile=function(t){return this.getTileByID(t.key)},r.prototype.getTileByID=function(t){return this._tiles[t]},r.prototype._retainLoadedChildren=function(t,e,r,n){for(var i in this._tiles){var o=this._tiles[i];if(!(n[i]||!o.hasData()||o.tileID.overscaledZ<=e||o.tileID.overscaledZ>r)){for(var a=o.tileID;o&&o.tileID.overscaledZ>e+1;){var s=o.tileID.scaledTo(o.tileID.overscaledZ-1);(o=this._tiles[s.key])&&o.hasData()&&(a=s)}for(var u=a;u.overscaledZ>e;)if(t[(u=u.scaledTo(u.overscaledZ-1)).key]){n[a.key]=a;break}}}},r.prototype.findLoadedParent=function(t,e){for(var r=t.overscaledZ-1;r>=e;r--){var n=t.scaledTo(r);if(!n)return;var i=String(n.key),o=this._tiles[i];if(o&&o.hasData())return o;if(this._cache.has(n))return this._cache.get(n)}},r.prototype.updateCacheSize=function(t){var e=(Math.ceil(t.width/this._source.tileSize)+1)*(Math.ceil(t.height/this._source.tileSize)+1),r=Math.floor(5*e),n="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,r):r;this._cache.setMaxSize(n)},r.prototype.handleWrapJump=function(t){var e=(t-(void 0===this._prevLng?t:this._prevLng))/360,r=Math.round(e);if(this._prevLng=t,r){var n={};for(var i in this._tiles){var o=this._tiles[i];o.tileID=o.tileID.unwrapTo(o.tileID.wrap+r),n[o.tileID.key]=o}for(var a in this._tiles=n,this._timers)clearTimeout(this._timers[a]),delete this._timers[a];for(var s in this._tiles){var u=this._tiles[s];this._setTileReloadTimer(s,u)}}},r.prototype.update=function(e){var n=this;if(this.transform=e,this._sourceLoaded&&!this._paused){var i;this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?i=e.getVisibleUnwrappedCoordinates(this._source.tileID).map((function(e){return new t.OverscaledTileID(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y)})):(i=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(i=i.filter((function(t){return n._source.hasTile(t)})))):i=[];var o=e.coveringZoomLevel(this._source),a=Math.max(o-r.maxOverzooming,this._source.minzoom),s=Math.max(o+r.maxUnderzooming,this._source.minzoom),u=this._updateRetainedTiles(i,o);if(It(this._source.type)){for(var c={},l={},h=0,f=Object.keys(u);h<f.length;h+=1){var p=f[h],d=u[p],A=this._tiles[p];if(A&&!(A.fadeEndTime&&A.fadeEndTime<=t.browser.now())){var g=this.findLoadedParent(d,a);g&&(this._addTile(g.tileID),c[g.tileID.key]=g.tileID),l[p]=d}}for(var m in this._retainLoadedChildren(l,o,s,u),c)u[m]||(this._coveredTiles[m]=!0,u[m]=c[m])}for(var y in u)this._tiles[y].clearFadeHold();for(var v=0,_=t.keysDifference(this._tiles,u);v<_.length;v+=1){var b=_[v],x=this._tiles[b];x.hasSymbolBuckets&&!x.holdingForFade()?x.setHoldDuration(this.map._fadeDuration):x.hasSymbolBuckets&&!x.symbolFadeFinished()||this._removeTile(b)}}},r.prototype.releaseSymbolFadeTiles=function(){for(var t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t)},r.prototype._updateRetainedTiles=function(t,e){for(var n={},i={},o=Math.max(e-r.maxOverzooming,this._source.minzoom),a=Math.max(e+r.maxUnderzooming,this._source.minzoom),s={},u=0,c=t;u<c.length;u+=1){var l=c[u],h=this._addTile(l);n[l.key]=l,h.hasData()||e<this._source.maxzoom&&(s[l.key]=l)}this._retainLoadedChildren(s,e,a,n);for(var f=0,p=t;f<p.length;f+=1){var d=p[f],A=this._tiles[d.key];if(!A.hasData()){if(e+1>this._source.maxzoom){var g=d.children(this._source.maxzoom)[0],m=this.getTile(g);if(m&&m.hasData()){n[g.key]=g;continue}}else{var y=d.children(this._source.maxzoom);if(n[y[0].key]&&n[y[1].key]&&n[y[2].key]&&n[y[3].key])continue}for(var v=A.wasRequested(),_=d.overscaledZ-1;_>=o;--_){var b=d.scaledTo(_);if(i[b.key])break;if(i[b.key]=!0,!(A=this.getTile(b))&&v&&(A=this._addTile(b)),A&&(n[b.key]=b,v=A.wasRequested(),A.hasData()))break}}}return n},r.prototype._addTile=function(e){var r=this._tiles[e.key];if(r)return r;(r=this._cache.getAndRemove(e))&&(this._setTileReloadTimer(e.key,r),r.tileID=e,this._state.initializeTileState(r,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,r)));var n=Boolean(r);return n||(r=new t.Tile(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(r,this._tileLoaded.bind(this,r,e.key,r.state))),r?(r.uses++,this._tiles[e.key]=r,n||this._source.fire(new t.Event("dataloading",{tile:r,coord:r.tileID,dataType:"source"})),r):null},r.prototype._setTileReloadTimer=function(t,e){var r=this;t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);var n=e.getExpiryTimeout();n&&(this._timers[t]=setTimeout((function(){r._reloadTile(t,"expired"),delete r._timers[t]}),n))},r.prototype._removeTile=function(t){var e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),e.uses>0||(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))},r.prototype.clearTiles=function(){for(var t in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(t);this._cache.reset()},r.prototype.tilesIn=function(e,r,n){var i=this,o=[],a=this.transform;if(!a)return o;for(var s=n?a.getCameraQueryGeometry(e):e,u=e.map((function(t){return a.pointCoordinate(t)})),c=s.map((function(t){return a.pointCoordinate(t)})),l=this.getIds(),h=1/0,f=1/0,p=-1/0,d=-1/0,A=0,g=c;A<g.length;A+=1){var m=g[A];h=Math.min(h,m.x),f=Math.min(f,m.y),p=Math.max(p,m.x),d=Math.max(d,m.y)}for(var y=function(e){var n=i._tiles[l[e]];if(!n.holdingForFade()){var s=n.tileID,A=Math.pow(2,a.zoom-n.tileID.overscaledZ),g=r*n.queryPadding*t.EXTENT/n.tileSize/A,m=[s.getTilePoint(new t.MercatorCoordinate(h,f)),s.getTilePoint(new t.MercatorCoordinate(p,d))];if(m[0].x-g<t.EXTENT&&m[0].y-g<t.EXTENT&&m[1].x+g>=0&&m[1].y+g>=0){var y=u.map((function(t){return s.getTilePoint(t)})),v=c.map((function(t){return s.getTilePoint(t)}));o.push({tile:n,tileID:s,queryGeometry:y,cameraQueryGeometry:v,scale:A})}}},v=0;v<l.length;v++)y(v);return o},r.prototype.getVisibleCoordinates=function(t){for(var e=this,r=this.getRenderableIds(t).map((function(t){return e._tiles[t].tileID})),n=0,i=r;n<i.length;n+=1){var o=i[n];o.posMatrix=this.transform.calculatePosMatrix(o.toUnwrapped())}return r},r.prototype.hasTransition=function(){if(this._source.hasTransition())return!0;if(It(this._source.type))for(var e in this._tiles){var r=this._tiles[e];if(void 0!==r.fadeEndTime&&r.fadeEndTime>=t.browser.now())return!0}return!1},r.prototype.setFeatureState=function(t,e,r){t=t||"_geojsonTileLayer",this._state.updateState(t,e,r)},r.prototype.removeFeatureState=function(t,e,r){t=t||"_geojsonTileLayer",this._state.removeFeatureState(t,e,r)},r.prototype.getFeatureState=function(t,e){return t=t||"_geojsonTileLayer",this._state.getState(t,e)},r.prototype.setDependencies=function(t,e,r){var n=this._tiles[t];n&&n.setDependencies(e,r)},r.prototype.reloadTilesForDependencies=function(t,e){for(var r in this._tiles)this._tiles[r].hasDependency(t,e)&&this._reloadTile(r,"reloading");this._cache.filter((function(r){return!r.hasDependency(t,e)}))},r}(t.Evented);function Ct(t,e){return t%32-e%32||e-t}function It(t){return"raster"===t||"image"===t||"video"===t}function kt(){return new t.window.Worker(ri.workerUrl)}Mt.maxOverzooming=10,Mt.maxUnderzooming=3;var Rt=function(){this.active={}};Rt.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length<Rt.workerCount;)this.workers.push(new kt);return this.active[t]=!0,this.workers.slice()},Rt.prototype.release=function(t){delete this.active[t],0===Object.keys(this.active).length&&(this.workers.forEach((function(t){t.terminate()})),this.workers=null)};var Lt,jt=Math.floor(t.browser.hardwareConcurrency/2);function Dt(e,r){var n={};for(var i in e)"ref"!==i&&(n[i]=e[i]);return t.refProperties.forEach((function(t){t in r&&(n[t]=r[t])})),n}function Bt(t){t=t.slice();for(var e=Object.create(null),r=0;r<t.length;r++)e[t[r].id]=t[r];for(var n=0;n<t.length;n++)"ref"in t[n]&&(t[n]=Dt(t[n],e[t[n].ref]));return t}Rt.workerCount=Math.max(Math.min(jt,6),1);var Ft={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};function zt(t,e,r){r.push({command:Ft.addSource,args:[t,e[t]]})}function Nt(t,e,r){e.push({command:Ft.removeSource,args:[t]}),r[t]=!0}function Ut(t,e,r,n){Nt(t,r,n),zt(t,e,r)}function Vt(e,r,n){var i;for(i in e[n])if(e[n].hasOwnProperty(i)&&"data"!==i&&!t.deepEqual(e[n][i],r[n][i]))return!1;for(i in r[n])if(r[n].hasOwnProperty(i)&&"data"!==i&&!t.deepEqual(e[n][i],r[n][i]))return!1;return!0}function Gt(e,r,n,i,o,a){var s;for(s in r=r||{},e=e||{})e.hasOwnProperty(s)&&(t.deepEqual(e[s],r[s])||n.push({command:a,args:[i,s,r[s],o]}));for(s in r)r.hasOwnProperty(s)&&!e.hasOwnProperty(s)&&(t.deepEqual(e[s],r[s])||n.push({command:a,args:[i,s,r[s],o]}))}function Wt(t){return t.id}function Ht(t,e){return t[e.id]=e,t}var qt=function(t,e,r){var n=this.boxCells=[],i=this.circleCells=[];this.xCellCount=Math.ceil(t/r),this.yCellCount=Math.ceil(e/r);for(var o=0;o<this.xCellCount*this.yCellCount;o++)n.push([]),i.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=t,this.height=e,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/e,this.boxUid=0,this.circleUid=0};function Zt(e,r,n,i,o){var a=t.create();return r?(t.scale(a,a,[1/o,1/o,1]),n||t.rotateZ(a,a,i.angle)):t.multiply(a,i.labelPlaneMatrix,e),a}function Xt(e,r,n,i,o){if(r){var a=t.clone(e);return t.scale(a,a,[o,o,1]),n||t.rotateZ(a,a,-i.angle),a}return i.glCoordMatrix}function Qt(e,r){var n=[e.x,e.y,0,1];oe(n,n,r);var i=n[3];return{point:new t.Point(n[0]/i,n[1]/i),signedDistanceFromCamera:i}}function Yt(t,e){var r=t[0]/t[3],n=t[1]/t[3];return r>=-e[0]&&r<=e[0]&&n>=-e[1]&&n<=e[1]}function Kt(e,r,n,i,o,a,s,u){var c=i?e.textSizeData:e.iconSizeData,l=t.evaluateSizeForZoom(c,n.transform.zoom),h=[256/n.width*2+1,256/n.height*2+1],f=i?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;f.clear();for(var p=e.lineVertexArray,d=i?e.text.placedSymbolArray:e.icon.placedSymbolArray,A=n.transform.width/n.transform.height,g=!1,m=0;m<d.length;m++){var y=d.get(m);if(y.hidden||y.writingMode===t.WritingMode.vertical&&!g)ie(y.numGlyphs,f);else{g=!1;var v=[y.anchorX,y.anchorY,0,1];if(t.transformMat4(v,v,r),Yt(v,h)){var _=.5+v[3]/n.transform.cameraToCenterDistance*.5,b=t.evaluateSizeForFeature(c,l,y),x=s?b*_:b/_,w=new t.Point(y.anchorX,y.anchorY),E=Qt(w,o).point,S={},O=te(y,x,!1,u,r,o,a,e.glyphOffsetArray,p,f,E,w,S,A);g=O.useVertical,(O.notEnoughRoom||g||O.needsFlipping&&te(y,x,!0,u,r,o,a,e.glyphOffsetArray,p,f,E,w,S,A).notEnoughRoom)&&ie(y.numGlyphs,f)}else ie(y.numGlyphs,f)}}i?e.text.dynamicLayoutVertexBuffer.updateData(f):e.icon.dynamicLayoutVertexBuffer.updateData(f)}function $t(t,e,r,n,i,o,a,s,u,c,l,h){var f=s.glyphStartIndex+s.numGlyphs,p=s.lineStartIndex,d=s.lineStartIndex+s.lineLength,A=e.getoffsetX(s.glyphStartIndex),g=e.getoffsetX(f-1),m=re(t*A,r,n,i,o,a,s.segment,p,d,u,c,l,h);if(!m)return null;var y=re(t*g,r,n,i,o,a,s.segment,p,d,u,c,l,h);return y?{first:m,last:y}:null}function Jt(e,r,n,i){return e===t.WritingMode.horizontal&&Math.abs(n.y-r.y)>Math.abs(n.x-r.x)*i?{useVertical:!0}:(e===t.WritingMode.vertical?r.y<n.y:r.x>n.x)?{needsFlipping:!0}:null}function te(e,r,n,i,o,a,s,u,c,l,h,f,p,d){var A,g=r/24,m=e.lineOffsetX*g,y=e.lineOffsetY*g;if(e.numGlyphs>1){var v=e.glyphStartIndex+e.numGlyphs,_=e.lineStartIndex,b=e.lineStartIndex+e.lineLength,x=$t(g,u,m,y,n,h,f,e,c,a,p,!1);if(!x)return{notEnoughRoom:!0};var w=Qt(x.first.point,s).point,E=Qt(x.last.point,s).point;if(i&&!n){var S=Jt(e.writingMode,w,E,d);if(S)return S}A=[x.first];for(var O=e.glyphStartIndex+1;O<v-1;O++)A.push(re(g*u.getoffsetX(O),m,y,n,h,f,e.segment,_,b,c,a,p,!1));A.push(x.last)}else{if(i&&!n){var T=Qt(f,o).point,P=e.lineStartIndex+e.segment+1,M=new t.Point(c.getx(P),c.gety(P)),C=Qt(M,o),I=C.signedDistanceFromCamera>0?C.point:ee(f,M,T,1,o),k=Jt(e.writingMode,T,I,d);if(k)return k}var R=re(g*u.getoffsetX(e.glyphStartIndex),m,y,n,h,f,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,c,a,p,!1);if(!R)return{notEnoughRoom:!0};A=[R]}for(var L=0,j=A;L<j.length;L+=1){var D=j[L];t.addDynamicAttributes(l,D.point,D.angle)}return{}}function ee(t,e,r,n,i){var o=Qt(t.add(t.sub(e)._unit()),i).point,a=r.sub(o);return r.add(a._mult(n/a.mag()))}function re(e,r,n,i,o,a,s,u,c,l,h,f,p){var d=i?e-r:e+r,A=d>0?1:-1,g=0;i&&(A*=-1,g=Math.PI),A<0&&(g+=Math.PI);for(var m=A>0?u+s:u+s+1,y=m,v=o,_=o,b=0,x=0,w=Math.abs(d);b+x<=w;){if((m+=A)<u||m>=c)return null;if(_=v,void 0===(v=f[m])){var E=new t.Point(l.getx(m),l.gety(m)),S=Qt(E,h);if(S.signedDistanceFromCamera>0)v=f[m]=S.point;else{var O=m-A;v=ee(0===b?a:new t.Point(l.getx(O),l.gety(O)),E,_,w-b+1,h)}}b+=x,x=_.dist(v)}var T=(w-b)/x,P=v.sub(_),M=P.mult(T)._add(_);return M._add(P._unit()._perp()._mult(n*A)),{point:M,angle:g+Math.atan2(v.y-_.y,v.x-_.x),tileDistance:p?{prevTileDistance:m-A===y?0:l.gettileUnitDistanceFromAnchor(m-A),lastSegmentViewportDistance:w-b}:null}}qt.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},qt.prototype.insert=function(t,e,r,n,i){this._forEachCell(e,r,n,i,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)},qt.prototype.insertCircle=function(t,e,r,n){this._forEachCell(e-n,r-n,e+n,r+n,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(r),this.circles.push(n)},qt.prototype._insertBoxCell=function(t,e,r,n,i,o){this.boxCells[i].push(o)},qt.prototype._insertCircleCell=function(t,e,r,n,i,o){this.circleCells[i].push(o)},qt.prototype._query=function(t,e,r,n,i,o){if(r<0||t>this.width||n<0||e>this.height)return!i&&[];var a=[];if(t<=0&&e<=0&&this.width<=r&&this.height<=n){if(i)return!0;for(var s=0;s<this.boxKeys.length;s++)a.push({key:this.boxKeys[s],x1:this.bboxes[4*s],y1:this.bboxes[4*s+1],x2:this.bboxes[4*s+2],y2:this.bboxes[4*s+3]});for(var u=0;u<this.circleKeys.length;u++){var c=this.circles[3*u],l=this.circles[3*u+1],h=this.circles[3*u+2];a.push({key:this.circleKeys[u],x1:c-h,y1:l-h,x2:c+h,y2:l+h})}return o?a.filter(o):a}var f={hitTest:i,seenUids:{box:{},circle:{}}};return this._forEachCell(t,e,r,n,this._queryCell,a,f,o),i?a.length>0:a},qt.prototype._queryCircle=function(t,e,r,n,i){var o=t-r,a=t+r,s=e-r,u=e+r;if(a<0||o>this.width||u<0||s>this.height)return!n&&[];var c=[],l={hitTest:n,circle:{x:t,y:e,radius:r},seenUids:{box:{},circle:{}}};return this._forEachCell(o,s,a,u,this._queryCellCircle,c,l,i),n?c.length>0:c},qt.prototype.query=function(t,e,r,n,i){return this._query(t,e,r,n,!1,i)},qt.prototype.hitTest=function(t,e,r,n,i){return this._query(t,e,r,n,!0,i)},qt.prototype.hitTestCircle=function(t,e,r,n){return this._queryCircle(t,e,r,!0,n)},qt.prototype._queryCell=function(t,e,r,n,i,o,a,s){var u=a.seenUids,c=this.boxCells[i];if(null!==c)for(var l=this.bboxes,h=0,f=c;h<f.length;h+=1){var p=f[h];if(!u.box[p]){u.box[p]=!0;var d=4*p;if(t<=l[d+2]&&e<=l[d+3]&&r>=l[d+0]&&n>=l[d+1]&&(!s||s(this.boxKeys[p]))){if(a.hitTest)return o.push(!0),!0;o.push({key:this.boxKeys[p],x1:l[d],y1:l[d+1],x2:l[d+2],y2:l[d+3]})}}}var A=this.circleCells[i];if(null!==A)for(var g=this.circles,m=0,y=A;m<y.length;m+=1){var v=y[m];if(!u.circle[v]){u.circle[v]=!0;var _=3*v;if(this._circleAndRectCollide(g[_],g[_+1],g[_+2],t,e,r,n)&&(!s||s(this.circleKeys[v]))){if(a.hitTest)return o.push(!0),!0;var b=g[_],x=g[_+1],w=g[_+2];o.push({key:this.circleKeys[v],x1:b-w,y1:x-w,x2:b+w,y2:x+w})}}}},qt.prototype._queryCellCircle=function(t,e,r,n,i,o,a,s){var u=a.circle,c=a.seenUids,l=this.boxCells[i];if(null!==l)for(var h=this.bboxes,f=0,p=l;f<p.length;f+=1){var d=p[f];if(!c.box[d]){c.box[d]=!0;var A=4*d;if(this._circleAndRectCollide(u.x,u.y,u.radius,h[A+0],h[A+1],h[A+2],h[A+3])&&(!s||s(this.boxKeys[d])))return o.push(!0),!0}}var g=this.circleCells[i];if(null!==g)for(var m=this.circles,y=0,v=g;y<v.length;y+=1){var _=v[y];if(!c.circle[_]){c.circle[_]=!0;var b=3*_;if(this._circlesCollide(m[b],m[b+1],m[b+2],u.x,u.y,u.radius)&&(!s||s(this.circleKeys[_])))return o.push(!0),!0}}},qt.prototype._forEachCell=function(t,e,r,n,i,o,a,s){for(var u=this._convertToXCellCoord(t),c=this._convertToYCellCoord(e),l=this._convertToXCellCoord(r),h=this._convertToYCellCoord(n),f=u;f<=l;f++)for(var p=c;p<=h;p++){var d=this.xCellCount*p+f;if(i.call(this,t,e,r,n,d,o,a,s))return}},qt.prototype._convertToXCellCoord=function(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))},qt.prototype._convertToYCellCoord=function(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))},qt.prototype._circlesCollide=function(t,e,r,n,i,o){var a=n-t,s=i-e,u=r+o;return u*u>a*a+s*s},qt.prototype._circleAndRectCollide=function(t,e,r,n,i,o,a){var s=(o-n)/2,u=Math.abs(t-(n+s));if(u>s+r)return!1;var c=(a-i)/2,l=Math.abs(e-(i+c));if(l>c+r)return!1;if(u<=s||l<=c)return!0;var h=u-s,f=l-c;return h*h+f*f<=r*r};var ne=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ie(t,e){for(var r=0;r<t;r++){var n=e.length;e.resize(n+4),e.float32.set(ne,3*n)}}function oe(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t[3]=r[3]*n+r[7]*i+r[15],t}var ae=function(t,e,r){void 0===e&&(e=new qt(t.width+200,t.height+200,25)),void 0===r&&(r=new qt(t.width+200,t.height+200,25)),this.transform=t,this.grid=e,this.ignoredGrid=r,this.pitchfactor=Math.cos(t._pitch)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+100,this.screenBottomBoundary=t.height+100,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200};function se(t,e,r){t[e+4]=r?1:0}function ue(e,r,n){return r*(t.EXTENT/(e.tileSize*Math.pow(2,n-e.tileID.overscaledZ)))}ae.prototype.placeCollisionBox=function(t,e,r,n,i){var o=this.projectAndGetPerspectiveRatio(n,t.anchorPointX,t.anchorPointY),a=r*o.perspectiveRatio,s=t.x1*a+o.point.x,u=t.y1*a+o.point.y,c=t.x2*a+o.point.x,l=t.y2*a+o.point.y;return!this.isInsideGrid(s,u,c,l)||!e&&this.grid.hitTest(s,u,c,l,i)?{box:[],offscreen:!1}:{box:[s,u,c,l],offscreen:this.isOffscreen(s,u,c,l)}},ae.prototype.approximateTileDistance=function(t,e,r,n,i){var o=i?1:n/this.pitchfactor,a=t.lastSegmentViewportDistance*r;return t.prevTileDistance+a+(o-1)*a*Math.abs(Math.sin(e))},ae.prototype.placeCollisionCircles=function(e,r,n,i,o,a,s,u,c,l,h,f,p){var d=[],A=this.projectAnchor(c,o.anchorX,o.anchorY),g=u/24,m=o.lineOffsetX*u,y=o.lineOffsetY*u,v=new t.Point(o.anchorX,o.anchorY),_=$t(g,s,m,y,!1,Qt(v,l).point,v,o,a,l,{},!0),b=!1,x=!1,w=!0,E=A.perspectiveRatio*i,S=1/(i*n),O=0,T=0;_&&(O=this.approximateTileDistance(_.first.tileDistance,_.first.angle,S,A.cameraDistance,f),T=this.approximateTileDistance(_.last.tileDistance,_.last.angle,S,A.cameraDistance,f));for(var P=0;P<e.length;P+=5){var M=e[P],C=e[P+1],I=e[P+2],k=e[P+3];if(!_||k<-O||k>T)se(e,P,!1);else{var R=this.projectPoint(c,M,C),L=I*E;if(d.length>0){var j=R.x-d[d.length-4],D=R.y-d[d.length-3];if(L*L*2>j*j+D*D&&P+8<e.length){var B=e[P+8];if(B>-O&&B<T){se(e,P,!1);continue}}}var F=P/5;d.push(R.x,R.y,L,F),se(e,P,!0);var z=R.x-L,N=R.y-L,U=R.x+L,V=R.y+L;if(w=w&&this.isOffscreen(z,N,U,V),x=x||this.isInsideGrid(z,N,U,V),!r&&this.grid.hitTestCircle(R.x,R.y,L,p)){if(!h)return{circles:[],offscreen:!1};b=!0}}}return{circles:b||!x?[]:d,offscreen:w}},ae.prototype.queryRenderedSymbols=function(e){if(0===e.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};for(var r=[],n=1/0,i=1/0,o=-1/0,a=-1/0,s=0,u=e;s<u.length;s+=1){var c=u[s],l=new t.Point(c.x+100,c.y+100);n=Math.min(n,l.x),i=Math.min(i,l.y),o=Math.max(o,l.x),a=Math.max(a,l.y),r.push(l)}for(var h={},f={},p=0,d=this.grid.query(n,i,o,a).concat(this.ignoredGrid.query(n,i,o,a));p<d.length;p+=1){var A=d[p],g=A.key;if(void 0===h[g.bucketInstanceId]&&(h[g.bucketInstanceId]={}),!h[g.bucketInstanceId][g.featureIndex]){var m=[new t.Point(A.x1,A.y1),new t.Point(A.x2,A.y1),new t.Point(A.x2,A.y2),new t.Point(A.x1,A.y2)];t.polygonIntersectsPolygon(r,m)&&(h[g.bucketInstanceId][g.featureIndex]=!0,void 0===f[g.bucketInstanceId]&&(f[g.bucketInstanceId]=[]),f[g.bucketInstanceId].push(g.featureIndex))}}return f},ae.prototype.insertCollisionBox=function(t,e,r,n,i){var o={bucketInstanceId:r,featureIndex:n,collisionGroupID:i};(e?this.ignoredGrid:this.grid).insert(o,t[0],t[1],t[2],t[3])},ae.prototype.insertCollisionCircles=function(t,e,r,n,i){for(var o=e?this.ignoredGrid:this.grid,a={bucketInstanceId:r,featureIndex:n,collisionGroupID:i},s=0;s<t.length;s+=4)o.insertCircle(a,t[s],t[s+1],t[s+2])},ae.prototype.projectAnchor=function(t,e,r){var n=[e,r,0,1];return oe(n,n,t),{perspectiveRatio:.5+this.transform.cameraToCenterDistance/n[3]*.5,cameraDistance:n[3]}},ae.prototype.projectPoint=function(e,r,n){var i=[r,n,0,1];return oe(i,i,e),new t.Point((i[0]/i[3]+1)/2*this.transform.width+100,(-i[1]/i[3]+1)/2*this.transform.height+100)},ae.prototype.projectAndGetPerspectiveRatio=function(e,r,n){var i=[r,n,0,1];return oe(i,i,e),{point:new t.Point((i[0]/i[3]+1)/2*this.transform.width+100,(-i[1]/i[3]+1)/2*this.transform.height+100),perspectiveRatio:.5+this.transform.cameraToCenterDistance/i[3]*.5}},ae.prototype.isOffscreen=function(t,e,r,n){return r<100||t>=this.screenRightBoundary||n<100||e>this.screenBottomBoundary},ae.prototype.isInsideGrid=function(t,e,r,n){return r>=0&&t<this.gridRightBoundary&&n>=0&&e<this.gridBottomBoundary};var ce=function(t,e,r,n){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?e:-e))):n&&r?1:0,this.placed=r};ce.prototype.isHidden=function(){return 0===this.opacity&&!this.placed};var le=function(t,e,r,n,i){this.text=new ce(t?t.text:null,e,r,i),this.icon=new ce(t?t.icon:null,e,n,i)};le.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var he=function(t,e,r){this.text=t,this.icon=e,this.skipFade=r},fe=function(t,e,r,n,i){this.bucketInstanceId=t,this.featureIndex=e,this.sourceLayerIndex=r,this.bucketIndex=n,this.tileID=i},pe=function(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}};function de(e,r,n,i,o){var a=t.getAnchorAlignment(e),s=-(a.horizontalAlign-.5)*r,u=-(a.verticalAlign-.5)*n,c=t.evaluateVariableOffset(e,i);return new t.Point(s+c[0]*o,u+c[1]*o)}function Ae(e,r,n,i,o,a){var s=e.x1,u=e.x2,c=e.y1,l=e.y2,h=e.anchorPointX,f=e.anchorPointY,p=new t.Point(r,n);return i&&p._rotate(o?a:-a),{x1:s+p.x,y1:c+p.y,x2:u+p.x,y2:l+p.y,anchorPointX:h,anchorPointY:f}}pe.prototype.get=function(t){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[t]){var e=++this.maxGroupID;this.collisionGroups[t]={ID:e,predicate:function(t){return t.collisionGroupID===e}}}return this.collisionGroups[t]};var ge=function(t,e,r,n){this.transform=t.clone(),this.collisionIndex=new ae(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=e,this.retainedQueryData={},this.collisionGroups=new pe(r),this.prevPlacement=n,n&&(n.prevPlacement=void 0),this.placedOrientations={}};function me(t,e,r,n,i){t.emplaceBack(e?1:0,r?1:0,n||0,i||0),t.emplaceBack(e?1:0,r?1:0,n||0,i||0),t.emplaceBack(e?1:0,r?1:0,n||0,i||0),t.emplaceBack(e?1:0,r?1:0,n||0,i||0)}ge.prototype.placeLayerTile=function(e,r,n,i){var o=r.getBucket(e),a=r.latestFeatureIndex;if(o&&a&&e.id===o.layerIds[0]){var s=r.collisionBoxArray,u=o.layers[0].layout,c=Math.pow(2,this.transform.zoom-r.tileID.overscaledZ),l=r.tileSize/t.EXTENT,h=this.transform.calculatePosMatrix(r.tileID.toUnwrapped()),f=Zt(h,"map"===u.get("text-pitch-alignment"),"map"===u.get("text-rotation-alignment"),this.transform,ue(r,1,this.transform.zoom)),p=Zt(h,"map"===u.get("icon-pitch-alignment"),"map"===u.get("icon-rotation-alignment"),this.transform,ue(r,1,this.transform.zoom));this.retainedQueryData[o.bucketInstanceId]=new fe(o.bucketInstanceId,a,o.sourceLayerIndex,o.index,r.tileID),this.placeLayerBucket(o,h,f,p,c,l,n,r.holdingForFade(),i,s)}},ge.prototype.attemptAnchorPlacement=function(t,e,r,n,i,o,a,s,u,c,l,h,f,p,d){var A,g=[h.textOffset0,h.textOffset1],m=de(t,r,n,g,i),y=this.collisionIndex.placeCollisionBox(Ae(e,m.x,m.y,o,a,this.transform.angle),l,s,u,c.predicate);if(!d||0!==this.collisionIndex.placeCollisionBox(Ae(d,m.x,m.y,o,a,this.transform.angle),l,s,u,c.predicate).box.length)return y.box.length>0?(this.prevPlacement&&this.prevPlacement.variableOffsets[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID].text&&(A=this.prevPlacement.variableOffsets[h.crossTileID].anchor),this.variableOffsets[h.crossTileID]={textOffset:g,width:r,height:n,anchor:t,textBoxScale:i,prevAnchor:A},this.markUsedJustification(f,t,h,p),f.allowVerticalPlacement&&(this.markUsedOrientation(f,p,h),this.placedOrientations[h.crossTileID]=p),{shift:m,placedGlyphBoxes:y}):void 0},ge.prototype.placeLayerBucket=function(e,r,n,i,o,a,s,u,c,l){var h=this,f=e.layers[0].layout,p=t.evaluateSizeForZoom(e.textSizeData,this.transform.zoom),d=f.get("text-optional"),A=f.get("icon-optional"),g=f.get("text-allow-overlap"),m=f.get("icon-allow-overlap"),y=g&&(m||!e.hasIconData()||A),v=m&&(g||!e.hasTextData()||d),_=this.collisionGroups.get(e.sourceID),b="map"===f.get("text-rotation-alignment"),x="map"===f.get("text-pitch-alignment"),w="none"!==f.get("icon-text-fit"),E="viewport-y"===f.get("symbol-z-order");!e.collisionArrays&&l&&e.deserializeCollisionBoxes(l);var S=function(i,l){if(!c[i.crossTileID])if(u)h.placements[i.crossTileID]=new he(!1,!1,!1);else{var E,S=!1,O=!1,T=!0,P=null,M={box:null,offscreen:null},C={box:null,offscreen:null},I=null,k=null,R=0,L=0,j=0;l.textFeatureIndex&&(R=l.textFeatureIndex),l.verticalTextFeatureIndex&&(L=l.verticalTextFeatureIndex);var D=l.textBox;if(D){var B=function(r){var n=t.WritingMode.horizontal;if(e.allowVerticalPlacement&&!r&&h.prevPlacement){var o=h.prevPlacement.placedOrientations[i.crossTileID];o&&(h.placedOrientations[i.crossTileID]=o,n=o,h.markUsedOrientation(e,n,i))}return n},F=function(r,n){if(e.allowVerticalPlacement&&i.numVerticalGlyphVertices>0&&l.verticalTextBox)for(var o=0,a=e.writingModes;o<a.length&&(a[o]===t.WritingMode.vertical?(M=n(),C=M):M=r(),!(M&&M.box&&M.box.length));o+=1);else M=r()};if(f.get("text-variable-anchor")){var z=f.get("text-variable-anchor");if(h.prevPlacement&&h.prevPlacement.variableOffsets[i.crossTileID]){var N=h.prevPlacement.variableOffsets[i.crossTileID];z.indexOf(N.anchor)>0&&(z=z.filter((function(t){return t!==N.anchor}))).unshift(N.anchor)}var U=function(t,n,o){for(var s=t.x2-t.x1,u=t.y2-t.y1,c=i.textBoxScale,l=w&&!m?n:null,f={box:[],offscreen:!1},p=g?2*z.length:z.length,d=0;d<p;++d){var A=z[d%z.length],y=d>=z.length,v=h.attemptAnchorPlacement(A,t,s,u,c,b,x,a,r,_,y,i,e,o,l);if(v&&(f=v.placedGlyphBoxes)&&f.box&&f.box.length){S=!0,P=v.shift;break}}return f};F((function(){return U(D,l.iconBox,t.WritingMode.horizontal)}),(function(){var r=l.verticalTextBox,n=M&&M.box&&M.box.length;return e.allowVerticalPlacement&&!n&&i.numVerticalGlyphVertices>0&&r?U(r,l.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null}})),M&&(S=M.box,T=M.offscreen);var V=B(M&&M.box);if(!S&&h.prevPlacement){var G=h.prevPlacement.variableOffsets[i.crossTileID];G&&(h.variableOffsets[i.crossTileID]=G,h.markUsedJustification(e,G.anchor,i,V))}}else{var W=function(t,n){var o=h.collisionIndex.placeCollisionBox(t,f.get("text-allow-overlap"),a,r,_.predicate);return o&&o.box&&o.box.length&&(h.markUsedOrientation(e,n,i),h.placedOrientations[i.crossTileID]=n),o};F((function(){return W(D,t.WritingMode.horizontal)}),(function(){var r=l.verticalTextBox;return e.allowVerticalPlacement&&i.numVerticalGlyphVertices>0&&r?W(r,t.WritingMode.vertical):{box:null,offscreen:null}})),B(M&&M.box&&M.box.length)}}S=(E=M)&&E.box&&E.box.length>0,T=E&&E.offscreen;var H=l.textCircles;if(H){var q=e.text.placedSymbolArray.get(i.centerJustifiedTextSymbolIndex),Z=t.evaluateSizeForFeature(e.textSizeData,p,q);I=h.collisionIndex.placeCollisionCircles(H,f.get("text-allow-overlap"),o,a,q,e.lineVertexArray,e.glyphOffsetArray,Z,r,n,s,x,_.predicate),S=f.get("text-allow-overlap")||I.circles.length>0,T=T&&I.offscreen}if(l.iconFeatureIndex&&(j=l.iconFeatureIndex),l.iconBox){var X=function(t){var e=w&&P?Ae(t,P.x,P.y,b,x,h.transform.angle):t;return h.collisionIndex.placeCollisionBox(e,f.get("icon-allow-overlap"),a,r,_.predicate)};O=C&&C.box&&C.box.length&&l.verticalIconBox?(k=X(l.verticalIconBox)).box.length>0:(k=X(l.iconBox)).box.length>0,T=T&&k.offscreen}var Q=d||0===i.numHorizontalGlyphVertices&&0===i.numVerticalGlyphVertices,Y=A||0===i.numIconVertices;Q||Y?Y?Q||(O=O&&S):S=O&&S:O=S=O&&S,S&&E&&E.box&&(C&&C.box&&L?h.collisionIndex.insertCollisionBox(E.box,f.get("text-ignore-placement"),e.bucketInstanceId,L,_.ID):h.collisionIndex.insertCollisionBox(E.box,f.get("text-ignore-placement"),e.bucketInstanceId,R,_.ID)),O&&k&&h.collisionIndex.insertCollisionBox(k.box,f.get("icon-ignore-placement"),e.bucketInstanceId,j,_.ID),S&&I&&h.collisionIndex.insertCollisionCircles(I.circles,f.get("text-ignore-placement"),e.bucketInstanceId,R,_.ID),h.placements[i.crossTileID]=new he(S||y,O||v,T||e.justReloaded),c[i.crossTileID]=!0}};if(E)for(var O=e.getSortedSymbolIndexes(this.transform.angle),T=O.length-1;T>=0;--T){var P=O[T];S(e.symbolInstances.get(P),e.collisionArrays[P])}else for(var M=0;M<e.symbolInstances.length;++M)S(e.symbolInstances.get(M),e.collisionArrays[M]);e.justReloaded=!1},ge.prototype.markUsedJustification=function(e,r,n,i){var o,a={left:n.leftJustifiedTextSymbolIndex,center:n.centerJustifiedTextSymbolIndex,right:n.rightJustifiedTextSymbolIndex};o=i===t.WritingMode.vertical?n.verticalPlacedTextSymbolIndex:a[t.getAnchorJustification(r)];for(var s=0,u=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex,n.verticalPlacedTextSymbolIndex];s<u.length;s+=1){var c=u[s];c>=0&&(e.text.placedSymbolArray.get(c).crossTileID=o>=0&&c!==o?0:n.crossTileID)}},ge.prototype.markUsedOrientation=function(e,r,n){for(var i=r===t.WritingMode.horizontal||r===t.WritingMode.horizontalOnly?r:0,o=r===t.WritingMode.vertical?r:0,a=0,s=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];a<s.length;a+=1){var u=s[a];e.text.placedSymbolArray.get(u).placedOrientation=i}n.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(n.verticalPlacedTextSymbolIndex).placedOrientation=o)},ge.prototype.commit=function(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;var e=this.prevPlacement,r=!1;this.prevZoomAdjustment=e?e.zoomAdjustment(this.transform.zoom):0;var n=e?e.symbolFadeChange(t):1,i=e?e.opacities:{},o=e?e.variableOffsets:{},a=e?e.placedOrientations:{};for(var s in this.placements){var u=this.placements[s],c=i[s];c?(this.opacities[s]=new le(c,n,u.text,u.icon),r=r||u.text!==c.text.placed||u.icon!==c.icon.placed):(this.opacities[s]=new le(null,n,u.text,u.icon,u.skipFade),r=r||u.text||u.icon)}for(var l in i){var h=i[l];if(!this.opacities[l]){var f=new le(h,n,!1,!1);f.isHidden()||(this.opacities[l]=f,r=r||h.text.placed||h.icon.placed)}}for(var p in o)this.variableOffsets[p]||!this.opacities[p]||this.opacities[p].isHidden()||(this.variableOffsets[p]=o[p]);for(var d in a)this.placedOrientations[d]||!this.opacities[d]||this.opacities[d].isHidden()||(this.placedOrientations[d]=a[d]);r?this.lastPlacementChangeTime=t:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=e?e.lastPlacementChangeTime:t)},ge.prototype.updateLayerOpacities=function(t,e){for(var r={},n=0,i=e;n<i.length;n+=1){var o=i[n],a=o.getBucket(t);a&&o.latestFeatureIndex&&t.id===a.layerIds[0]&&this.updateBucketOpacities(a,r,o.collisionBoxArray)}},ge.prototype.updateBucketOpacities=function(e,r,n){var i=this;e.hasTextData()&&e.text.opacityVertexArray.clear(),e.hasIconData()&&e.icon.opacityVertexArray.clear(),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexArray.clear(),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexArray.clear(),e.hasIconCollisionCircleData()&&e.iconCollisionCircle.collisionVertexArray.clear(),e.hasTextCollisionCircleData()&&e.textCollisionCircle.collisionVertexArray.clear();var o=e.layers[0].layout,a=new le(null,0,!1,!1,!0),s=o.get("text-allow-overlap"),u=o.get("icon-allow-overlap"),c=o.get("text-variable-anchor"),l="map"===o.get("text-rotation-alignment"),h="map"===o.get("text-pitch-alignment"),f="none"!==o.get("icon-text-fit"),p=new le(null,0,s&&(u||!e.hasIconData()||o.get("icon-optional")),u&&(s||!e.hasTextData()||o.get("text-optional")),!0);!e.collisionArrays&&n&&(e.hasIconCollisionBoxData()||e.hasIconCollisionCircleData()||e.hasTextCollisionBoxData()||e.hasTextCollisionCircleData())&&e.deserializeCollisionBoxes(n);for(var d=function(t,e,r){for(var n=0;n<e/4;n++)t.opacityVertexArray.emplaceBack(r)},A=function(n){var o=e.symbolInstances.get(n),s=o.numHorizontalGlyphVertices,u=o.numVerticalGlyphVertices,A=o.crossTileID,g=r[A],m=i.opacities[A];g?m=a:m||(m=p,i.opacities[A]=m),r[A]=!0;var y=s>0||u>0,v=o.numIconVertices>0,_=i.placedOrientations[o.crossTileID],b=_===t.WritingMode.vertical,x=_===t.WritingMode.horizontal||_===t.WritingMode.horizontalOnly;if(y){var w=Se(m.text),E=b?Oe:w;d(e.text,s,E);var S=x?Oe:w;d(e.text,u,S);var O=m.text.isHidden();[o.rightJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.leftJustifiedTextSymbolIndex].forEach((function(t){t>=0&&(e.text.placedSymbolArray.get(t).hidden=O||b?1:0)})),o.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(o.verticalPlacedTextSymbolIndex).hidden=O||x?1:0);var T=i.variableOffsets[o.crossTileID];T&&i.markUsedJustification(e,T.anchor,o,_);var P=i.placedOrientations[o.crossTileID];P&&(i.markUsedJustification(e,"left",o,P),i.markUsedOrientation(e,P,o))}if(v){var M=Se(m.icon),C=!(f&&o.verticalPlacedIconSymbolIndex&&b);if(o.placedIconSymbolIndex>=0){var I=C?M:Oe;d(e.icon,o.numIconVertices,I),e.icon.placedSymbolArray.get(o.placedIconSymbolIndex).hidden=m.icon.isHidden()}if(o.verticalPlacedIconSymbolIndex>=0){var k=C?Oe:M;d(e.icon,o.numVerticalIconVertices,k),e.icon.placedSymbolArray.get(o.verticalPlacedIconSymbolIndex).hidden=m.icon.isHidden()}}if(e.hasIconCollisionBoxData()||e.hasIconCollisionCircleData()||e.hasTextCollisionBoxData()||e.hasTextCollisionCircleData()){var R=e.collisionArrays[n];if(R){var L=new t.Point(0,0);if(R.textBox||R.verticalTextBox){var j=!0;if(c){var D=i.variableOffsets[A];D?(L=de(D.anchor,D.width,D.height,D.textOffset,D.textBoxScale),l&&L._rotate(h?i.transform.angle:-i.transform.angle)):j=!1}R.textBox&&me(e.textCollisionBox.collisionVertexArray,m.text.placed,!j||b,L.x,L.y),R.verticalTextBox&&me(e.textCollisionBox.collisionVertexArray,m.text.placed,!j||x,L.x,L.y)}var B=Boolean(!x&&R.verticalIconBox);R.iconBox&&me(e.iconCollisionBox.collisionVertexArray,m.icon.placed,B,f?L.x:0,f?L.y:0),R.verticalIconBox&&me(e.iconCollisionBox.collisionVertexArray,m.icon.placed,!B,f?L.x:0,f?L.y:0);var F=R.textCircles;if(F&&e.hasTextCollisionCircleData())for(var z=0;z<F.length;z+=5){var N=g||0===F[z+4];me(e.textCollisionCircle.collisionVertexArray,m.text.placed,N)}}}},g=0;g<e.symbolInstances.length;g++)A(g);e.sortFeatures(this.transform.angle),this.retainedQueryData[e.bucketInstanceId]&&(this.retainedQueryData[e.bucketInstanceId].featureSortOrder=e.featureSortOrder),e.hasTextData()&&e.text.opacityVertexBuffer&&e.text.opacityVertexBuffer.updateData(e.text.opacityVertexArray),e.hasIconData()&&e.icon.opacityVertexBuffer&&e.icon.opacityVertexBuffer.updateData(e.icon.opacityVertexArray),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexBuffer&&e.iconCollisionBox.collisionVertexBuffer.updateData(e.iconCollisionBox.collisionVertexArray),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexBuffer&&e.textCollisionBox.collisionVertexBuffer.updateData(e.textCollisionBox.collisionVertexArray),e.hasIconCollisionCircleData()&&e.iconCollisionCircle.collisionVertexBuffer&&e.iconCollisionCircle.collisionVertexBuffer.updateData(e.iconCollisionCircle.collisionVertexArray),e.hasTextCollisionCircleData()&&e.textCollisionCircle.collisionVertexBuffer&&e.textCollisionCircle.collisionVertexBuffer.updateData(e.textCollisionCircle.collisionVertexArray)},ge.prototype.symbolFadeChange=function(t){return 0===this.fadeDuration?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment},ge.prototype.zoomAdjustment=function(t){return Math.max(0,(this.transform.zoom-t)/1.5)},ge.prototype.hasTransitions=function(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration},ge.prototype.stillRecent=function(t,e){var r=this.zoomAtLastRecencyCheck===e?1-this.zoomAdjustment(e):1;return this.zoomAtLastRecencyCheck=e,this.commitTime+this.fadeDuration*r>t},ge.prototype.setStale=function(){this.stale=!0};var ye=Math.pow(2,25),ve=Math.pow(2,24),_e=Math.pow(2,17),be=Math.pow(2,16),xe=Math.pow(2,9),we=Math.pow(2,8),Ee=Math.pow(2,1);function Se(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;var e=t.placed?1:0,r=Math.floor(127*t.opacity);return r*ye+e*ve+r*_e+e*be+r*xe+e*we+r*Ee+e}var Oe=0,Te=function(){this._currentTileIndex=0,this._seenCrossTileIDs={}};Te.prototype.continuePlacement=function(t,e,r,n,i){for(;this._currentTileIndex<t.length;){var o=t[this._currentTileIndex];if(e.placeLayerTile(n,o,r,this._seenCrossTileIDs),this._currentTileIndex++,i())return!0}};var Pe=function(t,e,r,n,i,o,a){this.placement=new ge(t,i,o,a),this._currentPlacementIndex=e.length-1,this._forceFullPlacement=r,this._showCollisionBoxes=n,this._done=!1};Pe.prototype.isDone=function(){return this._done},Pe.prototype.continuePlacement=function(e,r,n){for(var i=this,o=t.browser.now(),a=function(){var e=t.browser.now()-o;return!i._forceFullPlacement&&e>2};this._currentPlacementIndex>=0;){var s=r[e[this._currentPlacementIndex]],u=this.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=u)&&(!s.maxzoom||s.maxzoom>u)){if(this._inProgressLayer||(this._inProgressLayer=new Te),this._inProgressLayer.continuePlacement(n[s.source],this.placement,this._showCollisionBoxes,s,a))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},Pe.prototype.commit=function(t){return this.placement.commit(t),this.placement};var Me=512/t.EXTENT/2,Ce=function(t,e,r){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=r;for(var n=0;n<e.length;n++){var i=e.get(n),o=i.key;this.indexedSymbolInstances[o]||(this.indexedSymbolInstances[o]=[]),this.indexedSymbolInstances[o].push({crossTileID:i.crossTileID,coord:this.getScaledCoordinates(i,t)})}};Ce.prototype.getScaledCoordinates=function(e,r){var n=r.canonical.z-this.tileID.canonical.z,i=Me/Math.pow(2,n);return{x:Math.floor((r.canonical.x*t.EXTENT+e.anchorX)*i),y:Math.floor((r.canonical.y*t.EXTENT+e.anchorY)*i)}},Ce.prototype.findMatches=function(t,e,r){for(var n=this.tileID.canonical.z<e.canonical.z?1:Math.pow(2,this.tileID.canonical.z-e.canonical.z),i=0;i<t.length;i++){var o=t.get(i);if(!o.crossTileID){var a=this.indexedSymbolInstances[o.key];if(a)for(var s=this.getScaledCoordinates(o,e),u=0,c=a;u<c.length;u+=1){var l=c[u];if(Math.abs(l.coord.x-s.x)<=n&&Math.abs(l.coord.y-s.y)<=n&&!r[l.crossTileID]){r[l.crossTileID]=!0,o.crossTileID=l.crossTileID;break}}}}};var Ie=function(){this.maxCrossTileID=0};Ie.prototype.generate=function(){return++this.maxCrossTileID};var ke=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0};ke.prototype.handleWrapJump=function(t){var e=Math.round((t-this.lng)/360);if(0!==e)for(var r in this.indexes){var n=this.indexes[r],i={};for(var o in n){var a=n[o];a.tileID=a.tileID.unwrapTo(a.tileID.wrap+e),i[a.tileID.key]=a}this.indexes[r]=i}this.lng=t},ke.prototype.addBucket=function(t,e,r){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===e.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(var n=0;n<e.symbolInstances.length;n++)e.symbolInstances.get(n).crossTileID=0;this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]={});var i=this.usedCrossTileIDs[t.overscaledZ];for(var o in this.indexes){var a=this.indexes[o];if(Number(o)>t.overscaledZ)for(var s in a){var u=a[s];u.tileID.isChildOf(t)&&u.findMatches(e.symbolInstances,t,i)}else{var c=a[t.scaledTo(Number(o)).key];c&&c.findMatches(e.symbolInstances,t,i)}}for(var l=0;l<e.symbolInstances.length;l++){var h=e.symbolInstances.get(l);h.crossTileID||(h.crossTileID=r.generate(),i[h.crossTileID]=!0)}return void 0===this.indexes[t.overscaledZ]&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new Ce(t,e.symbolInstances,e.bucketInstanceId),!0},ke.prototype.removeBucketCrossTileIDs=function(t,e){for(var r in e.indexedSymbolInstances)for(var n=0,i=e.indexedSymbolInstances[r];n<i.length;n+=1){var o=i[n];delete this.usedCrossTileIDs[t][o.crossTileID]}},ke.prototype.removeStaleBuckets=function(t){var e=!1;for(var r in this.indexes){var n=this.indexes[r];for(var i in n)t[n[i].bucketInstanceId]||(this.removeBucketCrossTileIDs(r,n[i]),delete n[i],e=!0)}return e};var Re=function(){this.layerIndexes={},this.crossTileIDs=new Ie,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};Re.prototype.addLayer=function(t,e,r){var n=this.layerIndexes[t.id];void 0===n&&(n=this.layerIndexes[t.id]=new ke);var i=!1,o={};n.handleWrapJump(r);for(var a=0,s=e;a<s.length;a+=1){var u=s[a],c=u.getBucket(t);c&&t.id===c.layerIds[0]&&(c.bucketInstanceId||(c.bucketInstanceId=++this.maxBucketInstanceId),n.addBucket(u.tileID,c,this.crossTileIDs)&&(i=!0),o[c.bucketInstanceId]=!0)}return n.removeStaleBuckets(o)&&(i=!0),i},Re.prototype.pruneUnusedLayers=function(t){var e={};for(var r in t.forEach((function(t){e[t]=!0})),this.layerIndexes)e[r]||delete this.layerIndexes[r]};var Le=function(e,r){return t.emitValidationErrors(e,r&&r.filter((function(t){return"source.canvas"!==t.identifier})))},je=t.pick(Ft,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),De=t.pick(Ft,["setCenter","setZoom","setBearing","setPitch"]),Be=function(e){function r(n,i){var o=this;void 0===i&&(i={}),e.call(this),this.map=n,this.dispatcher=new E((Lt||(Lt=new Rt),Lt),this),this.imageManager=new f,this.imageManager.setEventedParent(this),this.glyphManager=new v(n._requestManager,i.localIdeographFontFamily),this.lineAtlas=new w(256,512),this.crossTileSymbolIndex=new Re,this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new t.ZoomHistory,this._loaded=!1,this._resetUpdates(),this.dispatcher.broadcast("setReferrer",t.getReferrer());var a=this;this._rtlTextPluginCallback=r.registerForPluginStateChange((function(e){var r={pluginStatus:e.pluginStatus,pluginURL:e.pluginURL};a.dispatcher.broadcast("syncRTLPluginState",r,(function(e,r){if(t.triggerPluginCompletionEvent(e),r&&r.every((function(t){return t})))for(var n in a.sourceCaches)a.sourceCaches[n].reload()}))})),this.on("data",(function(t){if("source"===t.dataType&&"metadata"===t.sourceDataType){var e=o.sourceCaches[t.sourceId];if(e){var r=e.getSource();if(r&&r.vectorLayerIds)for(var n in o._layers){var i=o._layers[n];i.source===r.id&&o._validateLayer(i)}}}}))}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.loadURL=function(e,r){var n=this;void 0===r&&(r={}),this.fire(new t.Event("dataloading",{dataType:"style"}));var i="boolean"==typeof r.validate?r.validate:!t.isMapboxURL(e);e=this.map._requestManager.normalizeStyleURL(e,r.accessToken);var o=this.map._requestManager.transformRequest(e,t.ResourceType.Style);this._request=t.getJSON(o,(function(e,r){n._request=null,e?n.fire(new t.ErrorEvent(e)):r&&n._load(r,i)}))},r.prototype.loadJSON=function(e,r){var n=this;void 0===r&&(r={}),this.fire(new t.Event("dataloading",{dataType:"style"})),this._request=t.browser.frame((function(){n._request=null,n._load(e,!1!==r.validate)}))},r.prototype._load=function(e,r){var n=this;if(!r||!Le(this,t.validateStyle(e))){for(var i in this._loaded=!0,this.stylesheet=e,e.sources)this.addSource(i,e.sources[i],{validate:!1});e.sprite?this._spriteRequest=function(e,r,n){var i,o,a,s=t.browser.devicePixelRatio>1?"@2x":"",u=t.getJSON(r.transformRequest(r.normalizeSpriteURL(e,s,".json"),t.ResourceType.SpriteJSON),(function(t,e){u=null,a||(a=t,i=e,l())})),c=t.getImage(r.transformRequest(r.normalizeSpriteURL(e,s,".png"),t.ResourceType.SpriteImage),(function(t,e){c=null,a||(a=t,o=e,l())}));function l(){if(a)n(a);else if(i&&o){var e=t.browser.getImageData(o),r={};for(var s in i){var u=i[s],c=u.width,l=u.height,h=u.x,f=u.y,p=u.sdf,d=u.pixelRatio,A=u.stretchX,g=u.stretchY,m=u.content,y=new t.RGBAImage({width:c,height:l});t.RGBAImage.copy(e,y,{x:h,y:f},{x:0,y:0},{width:c,height:l}),r[s]={data:y,pixelRatio:d,sdf:p,stretchX:A,stretchY:g,content:m}}n(null,r)}}return{cancel:function(){u&&(u.cancel(),u=null),c&&(c.cancel(),c=null)}}}(e.sprite,this.map._requestManager,(function(e,r){if(n._spriteRequest=null,e)n.fire(new t.ErrorEvent(e));else if(r)for(var i in r)n.imageManager.addImage(i,r[i]);n.imageManager.setLoaded(!0),n.dispatcher.broadcast("setImages",n.imageManager.listImages()),n.fire(new t.Event("data",{dataType:"style"}))})):this.imageManager.setLoaded(!0),this.glyphManager.setURL(e.glyphs);var o=Bt(this.stylesheet.layers);this._order=o.map((function(t){return t.id})),this._layers={};for(var a=0,s=o;a<s.length;a+=1){var u=s[a];(u=t.createStyleLayer(u)).setEventedParent(this,{layer:{id:u.id}}),this._layers[u.id]=u}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new x(this.stylesheet.light),this.fire(new t.Event("data",{dataType:"style"})),this.fire(new t.Event("style.load"))}},r.prototype._validateLayer=function(e){var r=this.sourceCaches[e.source];if(r){var n=e.sourceLayer;if(n){var i=r.getSource();("geojson"===i.type||i.vectorLayerIds&&-1===i.vectorLayerIds.indexOf(n))&&this.fire(new t.ErrorEvent(new Error('Source layer "'+n+'" does not exist on source "'+i.id+'" as specified by style layer "'+e.id+'"')))}}},r.prototype.loaded=function(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(var t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()},r.prototype._serializeLayers=function(t){for(var e=[],r=0,n=t;r<n.length;r+=1){var i=n[r],o=this._layers[i];"custom"!==o.type&&e.push(o.serialize())}return e},r.prototype.hasTransitions=function(){if(this.light&&this.light.hasTransition())return!0;for(var t in this.sourceCaches)if(this.sourceCaches[t].hasTransition())return!0;for(var e in this._layers)if(this._layers[e].hasTransition())return!0;return!1},r.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},r.prototype.update=function(e){if(this._loaded){var r=this._changed;if(this._changed){var n=Object.keys(this._updatedLayers),i=Object.keys(this._removedLayers);for(var o in(n.length||i.length)&&this._updateWorkerLayers(n,i),this._updatedSources){var a=this._updatedSources[o];"reload"===a?this._reloadSource(o):"clear"===a&&this._clearSource(o)}for(var s in this._updateTilesForChangedImages(),this._updatedPaintProps)this._layers[s].updateTransitions(e);this.light.updateTransitions(e),this._resetUpdates()}for(var u in this.sourceCaches)this.sourceCaches[u].used=!1;for(var c=0,l=this._order;c<l.length;c+=1){var h=l[c],f=this._layers[h];f.recalculate(e,this.imageManager.listImages()),!f.isHidden(e.zoom)&&f.source&&(this.sourceCaches[f.source].used=!0)}this.light.recalculate(e),this.z=e.zoom,r&&this.fire(new t.Event("data",{dataType:"style"}))}},r.prototype._updateTilesForChangedImages=function(){var t=Object.keys(this._changedImages);if(t.length){for(var e in this.sourceCaches)this.sourceCaches[e].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}},r.prototype._updateWorkerLayers=function(t,e){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(t),removedIds:e})},r.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}},r.prototype.setState=function(e){var r=this;if(this._checkLoaded(),Le(this,t.validateStyle(e)))return!1;(e=t.clone$1(e)).layers=Bt(e.layers);var n=function(e,r){if(!e)return[{command:Ft.setStyle,args:[r]}];var n=[];try{if(!t.deepEqual(e.version,r.version))return[{command:Ft.setStyle,args:[r]}];t.deepEqual(e.center,r.center)||n.push({command:Ft.setCenter,args:[r.center]}),t.deepEqual(e.zoom,r.zoom)||n.push({command:Ft.setZoom,args:[r.zoom]}),t.deepEqual(e.bearing,r.bearing)||n.push({command:Ft.setBearing,args:[r.bearing]}),t.deepEqual(e.pitch,r.pitch)||n.push({command:Ft.setPitch,args:[r.pitch]}),t.deepEqual(e.sprite,r.sprite)||n.push({command:Ft.setSprite,args:[r.sprite]}),t.deepEqual(e.glyphs,r.glyphs)||n.push({command:Ft.setGlyphs,args:[r.glyphs]}),t.deepEqual(e.transition,r.transition)||n.push({command:Ft.setTransition,args:[r.transition]}),t.deepEqual(e.light,r.light)||n.push({command:Ft.setLight,args:[r.light]});var i={},o=[];!function(e,r,n,i){var o;for(o in r=r||{},e=e||{})e.hasOwnProperty(o)&&(r.hasOwnProperty(o)||Nt(o,n,i));for(o in r)r.hasOwnProperty(o)&&(e.hasOwnProperty(o)?t.deepEqual(e[o],r[o])||("geojson"===e[o].type&&"geojson"===r[o].type&&Vt(e,r,o)?n.push({command:Ft.setGeoJSONSourceData,args:[o,r[o].data]}):Ut(o,r,n,i)):zt(o,r,n))}(e.sources,r.sources,o,i);var a=[];e.layers&&e.layers.forEach((function(t){i[t.source]?n.push({command:Ft.removeLayer,args:[t.id]}):a.push(t)})),n=n.concat(o),function(e,r,n){r=r||[];var i,o,a,s,u,c,l,h=(e=e||[]).map(Wt),f=r.map(Wt),p=e.reduce(Ht,{}),d=r.reduce(Ht,{}),A=h.slice(),g=Object.create(null);for(i=0,o=0;i<h.length;i++)a=h[i],d.hasOwnProperty(a)?o++:(n.push({command:Ft.removeLayer,args:[a]}),A.splice(A.indexOf(a,o),1));for(i=0,o=0;i<f.length;i++)a=f[f.length-1-i],A[A.length-1-i]!==a&&(p.hasOwnProperty(a)?(n.push({command:Ft.removeLayer,args:[a]}),A.splice(A.lastIndexOf(a,A.length-o),1)):o++,c=A[A.length-i],n.push({command:Ft.addLayer,args:[d[a],c]}),A.splice(A.length-i,0,a),g[a]=!0);for(i=0;i<f.length;i++)if(s=p[a=f[i]],u=d[a],!g[a]&&!t.deepEqual(s,u))if(t.deepEqual(s.source,u.source)&&t.deepEqual(s["source-layer"],u["source-layer"])&&t.deepEqual(s.type,u.type)){for(l in Gt(s.layout,u.layout,n,a,null,Ft.setLayoutProperty),Gt(s.paint,u.paint,n,a,null,Ft.setPaintProperty),t.deepEqual(s.filter,u.filter)||n.push({command:Ft.setFilter,args:[a,u.filter]}),t.deepEqual(s.minzoom,u.minzoom)&&t.deepEqual(s.maxzoom,u.maxzoom)||n.push({command:Ft.setLayerZoomRange,args:[a,u.minzoom,u.maxzoom]}),s)s.hasOwnProperty(l)&&"layout"!==l&&"paint"!==l&&"filter"!==l&&"metadata"!==l&&"minzoom"!==l&&"maxzoom"!==l&&(0===l.indexOf("paint.")?Gt(s[l],u[l],n,a,l.slice(6),Ft.setPaintProperty):t.deepEqual(s[l],u[l])||n.push({command:Ft.setLayerProperty,args:[a,l,u[l]]}));for(l in u)u.hasOwnProperty(l)&&!s.hasOwnProperty(l)&&"layout"!==l&&"paint"!==l&&"filter"!==l&&"metadata"!==l&&"minzoom"!==l&&"maxzoom"!==l&&(0===l.indexOf("paint.")?Gt(s[l],u[l],n,a,l.slice(6),Ft.setPaintProperty):t.deepEqual(s[l],u[l])||n.push({command:Ft.setLayerProperty,args:[a,l,u[l]]}))}else n.push({command:Ft.removeLayer,args:[a]}),c=A[A.lastIndexOf(a)+1],n.push({command:Ft.addLayer,args:[u,c]})}(a,r.layers,n)}catch(t){console.warn("Unable to compute style diff:",t),n=[{command:Ft.setStyle,args:[r]}]}return n}(this.serialize(),e).filter((function(t){return!(t.command in De)}));if(0===n.length)return!1;var i=n.filter((function(t){return!(t.command in je)}));if(i.length>0)throw new Error("Unimplemented: "+i.map((function(t){return t.command})).join(", ")+".");return n.forEach((function(t){"setTransition"!==t.command&&r[t.command].apply(r,t.args)})),this.stylesheet=e,!0},r.prototype.addImage=function(e,r){if(this.getImage(e))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(e,r),this._changedImages[e]=!0,this._changed=!0,this.fire(new t.Event("data",{dataType:"style"}))},r.prototype.updateImage=function(t,e){this.imageManager.updateImage(t,e)},r.prototype.getImage=function(t){return this.imageManager.getImage(t)},r.prototype.removeImage=function(e){if(!this.getImage(e))return this.fire(new t.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(e),this._changedImages[e]=!0,this._changed=!0,this.fire(new t.Event("data",{dataType:"style"}))},r.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},r.prototype.addSource=function(e,r,n){var i=this;if(void 0===n&&(n={}),this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error("There is already a source with this ID");if(!r.type)throw new Error("The type property must be defined, but the only the following properties were given: "+Object.keys(r).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(r.type)>=0&&this._validate(t.validateStyle.source,"sources."+e,r,null,n))){this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);var o=this.sourceCaches[e]=new Mt(e,r,this.dispatcher);o.style=this,o.setEventedParent(this,(function(){return{isSourceLoaded:i.loaded(),source:o.serialize(),sourceId:e}})),o.onAdd(this.map),this._changed=!0}},r.prototype.removeSource=function(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(var r in this._layers)if(this._layers[r].source===e)return this.fire(new t.ErrorEvent(new Error('Source "'+e+'" cannot be removed while layer "'+r+'" is using it.')));var n=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],n.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),n.setEventedParent(null),n.clearTiles(),n.onRemove&&n.onRemove(this.map),this._changed=!0},r.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0},r.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},r.prototype.addLayer=function(e,r,n){void 0===n&&(n={}),this._checkLoaded();var i=e.id;if(this.getLayer(i))this.fire(new t.ErrorEvent(new Error('Layer with id "'+i+'" already exists on this map')));else{var o;if("custom"===e.type){if(Le(this,t.validateCustomStyleLayer(e)))return;o=t.createStyleLayer(e)}else{if("object"==typeof e.source&&(this.addSource(i,e.source),e=t.clone$1(e),e=t.extend(e,{source:i})),this._validate(t.validateStyle.layer,"layers."+i,e,{arrayIndex:-1},n))return;o=t.createStyleLayer(e),this._validateLayer(o),o.setEventedParent(this,{layer:{id:i}})}var a=r?this._order.indexOf(r):this._order.length;if(r&&-1===a)this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.')));else{if(this._order.splice(a,0,i),this._layerOrderChanged=!0,this._layers[i]=o,this._removedLayers[i]&&o.source&&"custom"!==o.type){var s=this._removedLayers[i];delete this._removedLayers[i],s.type!==o.type?this._updatedSources[o.source]="clear":(this._updatedSources[o.source]="reload",this.sourceCaches[o.source].pause())}this._updateLayer(o),o.onAdd&&o.onAdd(this.map)}}},r.prototype.moveLayer=function(e,r){if(this._checkLoaded(),this._changed=!0,this._layers[e]){if(e!==r){var n=this._order.indexOf(e);this._order.splice(n,1);var i=r?this._order.indexOf(r):this._order.length;r&&-1===i?this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.'))):(this._order.splice(i,0,e),this._layerOrderChanged=!0)}}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be moved.")))},r.prototype.removeLayer=function(e){this._checkLoaded();var r=this._layers[e];if(r){r.setEventedParent(null);var n=this._order.indexOf(e);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=r,delete this._layers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],r.onRemove&&r.onRemove(this.map)}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be removed.")))},r.prototype.getLayer=function(t){return this._layers[t]},r.prototype.setLayerZoomRange=function(e,r,n){this._checkLoaded();var i=this.getLayer(e);i?i.minzoom===r&&i.maxzoom===n||(null!=r&&(i.minzoom=r),null!=n&&(i.maxzoom=n),this._updateLayer(i)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot have zoom extent.")))},r.prototype.setFilter=function(e,r,n){void 0===n&&(n={}),this._checkLoaded();var i=this.getLayer(e);if(i){if(!t.deepEqual(i.filter,r))return null==r?(i.filter=void 0,void this._updateLayer(i)):void(this._validate(t.validateStyle.filter,"layers."+i.id+".filter",r,null,n)||(i.filter=t.clone$1(r),this._updateLayer(i)))}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be filtered.")))},r.prototype.getFilter=function(e){return t.clone$1(this.getLayer(e).filter)},r.prototype.setLayoutProperty=function(e,r,n,i){void 0===i&&(i={}),this._checkLoaded();var o=this.getLayer(e);o?t.deepEqual(o.getLayoutProperty(r),n)||(o.setLayoutProperty(r,n,i),this._updateLayer(o)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getLayoutProperty=function(e,r){var n=this.getLayer(e);if(n)return n.getLayoutProperty(r);this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style.")))},r.prototype.setPaintProperty=function(e,r,n,i){void 0===i&&(i={}),this._checkLoaded();var o=this.getLayer(e);o?t.deepEqual(o.getPaintProperty(r),n)||(o.setPaintProperty(r,n,i)&&this._updateLayer(o),this._changed=!0,this._updatedPaintProps[e]=!0):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},r.prototype.setFeatureState=function(e,r){this._checkLoaded();var n=e.source,i=e.sourceLayer,o=this.sourceCaches[n],a=parseInt(e.id,10);if(void 0!==o){var s=o.getSource().type;"geojson"===s&&i?this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==s||i?isNaN(a)||a<0?this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided and non-negative."))):o.setFeatureState(i,a,r):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.removeFeatureState=function(e,r){this._checkLoaded();var n=e.source,i=this.sourceCaches[n];if(void 0!==i){var o=i.getSource().type,a="vector"===o?e.sourceLayer:void 0,s=parseInt(e.id,10);"vector"!==o||a?void 0!==e.id&&isNaN(s)||s<0?this.fire(new t.ErrorEvent(new Error("The feature id parameter must be non-negative."))):r&&"string"!=typeof e.id&&"number"!=typeof e.id?this.fire(new t.ErrorEvent(new Error("A feature id is requred to remove its specific state property."))):i.removeFeatureState(a,s,r):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.getFeatureState=function(e){this._checkLoaded();var r=e.source,n=e.sourceLayer,i=this.sourceCaches[r],o=parseInt(e.id,10);if(void 0!==i)if("vector"!==i.getSource().type||n){if(!(isNaN(o)||o<0))return i.getFeatureState(n,o);this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided and non-negative.")))}else this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));else this.fire(new t.ErrorEvent(new Error("The source '"+r+"' does not exist in the map's style.")))},r.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},r.prototype.serialize=function(){return t.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:t.mapObject(this.sourceCaches,(function(t){return t.serialize()})),layers:this._serializeLayers(this._order)},(function(t){return void 0!==t}))},r.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&"raster"!==this.sourceCaches[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0},r.prototype._flattenAndSortRenderedFeatures=function(t){for(var e=this,r=function(t){return"fill-extrusion"===e._layers[t].type},n={},i=[],o=this._order.length-1;o>=0;o--){var a=this._order[o];if(r(a)){n[a]=o;for(var s=0,u=t;s<u.length;s+=1){var c=u[s][a];if(c)for(var l=0,h=c;l<h.length;l+=1){var f=h[l];i.push(f)}}}}i.sort((function(t,e){return e.intersectionZ-t.intersectionZ}));for(var p=[],d=this._order.length-1;d>=0;d--){var A=this._order[d];if(r(A))for(var g=i.length-1;g>=0;g--){var m=i[g].feature;if(n[m.layer.id]<d)break;p.push(m),i.pop()}else for(var y=0,v=t;y<v.length;y+=1){var _=v[y][A];if(_)for(var b=0,x=_;b<x.length;b+=1){var w=x[b];p.push(w.feature)}}}return p},r.prototype.queryRenderedFeatures=function(e,r,n){r&&r.filter&&this._validate(t.validateStyle.filter,"queryRenderedFeatures.filter",r.filter,null,r);var i={};if(r&&r.layers){if(!Array.isArray(r.layers))return this.fire(new t.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(var o=0,a=r.layers;o<a.length;o+=1){var s=a[o],u=this._layers[s];if(!u)return this.fire(new t.ErrorEvent(new Error("The layer '"+s+"' does not exist in the map's style and cannot be queried for features."))),[];i[u.source]=!0}}var c=[];for(var l in this.sourceCaches)r.layers&&!i[l]||c.push(D(this.sourceCaches[l],this._layers,e,r,n));return this.placement&&c.push(function(t,e,r,n,i,o){for(var a={},s=i.queryRenderedSymbols(r),u=[],c=0,l=Object.keys(s).map(Number);c<l.length;c+=1){var h=l[c];u.push(o[h])}u.sort(B);for(var f=function(){var e=d[p],r=e.featureIndex.lookupSymbolFeatures(s[e.bucketInstanceId],e.bucketIndex,e.sourceLayerIndex,n.filter,n.layers,t);for(var i in r){var o=a[i]=a[i]||[],u=r[i];u.sort((function(t,r){var n=e.featureSortOrder;if(n){var i=n.indexOf(t.featureIndex);return n.indexOf(r.featureIndex)-i}return r.featureIndex-t.featureIndex}));for(var c=0,l=u;c<l.length;c+=1){var h=l[c];o.push(h)}}},p=0,d=u;p<d.length;p+=1)f();var A=function(r){a[r].forEach((function(n){var i=n.feature,o=t[r],a=e[o.source].getFeatureState(i.layer["source-layer"],i.id);i.source=i.layer.source,i.layer["source-layer"]&&(i.sourceLayer=i.layer["source-layer"]),i.state=a}))};for(var g in a)A(g);return a}(this._layers,this.sourceCaches,e,r,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(c)},r.prototype.querySourceFeatures=function(e,r){r&&r.filter&&this._validate(t.validateStyle.filter,"querySourceFeatures.filter",r.filter,null,r);var n=this.sourceCaches[e];return n?function(t,e){for(var r=t.getRenderableIds().map((function(e){return t.getTileByID(e)})),n=[],i={},o=0;o<r.length;o++){var a=r[o],s=a.tileID.canonical.key;i[s]||(i[s]=!0,a.querySourceFeatures(n,e))}return n}(n,r):[]},r.prototype.addSourceType=function(t,e,n){return r.getSourceType(t)?n(new Error('A source type called "'+t+'" already exists.')):(r.setSourceType(t,e),e.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:t,url:e.workerSourceURL},n):n(null,null))},r.prototype.getLight=function(){return this.light.getLight()},r.prototype.setLight=function(e,r){void 0===r&&(r={}),this._checkLoaded();var n=this.light.getLight(),i=!1;for(var o in e)if(!t.deepEqual(e[o],n[o])){i=!0;break}if(i){var a={now:t.browser.now(),transition:t.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(e,r),this.light.updateTransitions(a)}},r.prototype._validate=function(e,r,n,i,o){return void 0===o&&(o={}),(!o||!1!==o.validate)&&Le(this,e.call(t.validateStyle,t.extend({key:r,style:this.serialize(),value:n,styleSpec:t.styleSpec},i)))},r.prototype._remove=function(){for(var e in this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),t.evented.off("pluginStateChange",this._rtlTextPluginCallback),this._layers)this._layers[e].setEventedParent(null);for(var r in this.sourceCaches)this.sourceCaches[r].clearTiles(),this.sourceCaches[r].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()},r.prototype._clearSource=function(t){this.sourceCaches[t].clearTiles()},r.prototype._reloadSource=function(t){this.sourceCaches[t].resume(),this.sourceCaches[t].reload()},r.prototype._updateSources=function(t){for(var e in this.sourceCaches)this.sourceCaches[e].update(t)},r.prototype._generateCollisionBoxes=function(){for(var t in this.sourceCaches)this._reloadSource(t)},r.prototype._updatePlacement=function(e,r,n,i){for(var o=!1,a=!1,s={},u=0,c=this._order;u<c.length;u+=1){var l=c[u],h=this._layers[l];if("symbol"===h.type){if(!s[h.source]){var f=this.sourceCaches[h.source];s[h.source]=f.getRenderableIds(!0).map((function(t){return f.getTileByID(t)})).sort((function(t,e){return e.tileID.overscaledZ-t.tileID.overscaledZ||(t.tileID.isLessThan(e.tileID)?-1:1)}))}var p=this.crossTileSymbolIndex.addLayer(h,s[h.source],e.center.lng);o=o||p}}this.crossTileSymbolIndex.pruneUnusedLayers(this._order);var d=this._layerOrderChanged||0===n;if((d||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(t.browser.now(),e.zoom))&&(this.pauseablePlacement=new Pe(e,this._order,d,r,n,i,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,s),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(t.browser.now()),a=!0),o&&this.pauseablePlacement.placement.setStale()),a||o)for(var A=0,g=this._order;A<g.length;A+=1){var m=g[A],y=this._layers[m];"symbol"===y.type&&this.placement.updateLayerOpacities(y,s[y.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(t.browser.now())},r.prototype._releaseSymbolFadeTiles=function(){for(var t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles()},r.prototype.getImages=function(t,e,r){this.imageManager.getImages(e.icons,r),this._updateTilesForChangedImages();var n=this.sourceCaches[e.source];n&&n.setDependencies(e.tileID.key,e.type,e.icons)},r.prototype.getGlyphs=function(t,e,r){this.glyphManager.getGlyphs(e.stacks,r)},r.prototype.getResource=function(e,r,n){return t.makeRequest(r,n)},r}(t.Evented);Be.getSourceType=function(t){return L[t]},Be.setSourceType=function(t,e){L[t]=e},Be.registerForPluginStateChange=t.registerForPluginStateChange;var Fe=t.createLayout([{name:"a_pos",type:"Int16",components:2}]),ze=hr("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif","#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}"),Ne=hr("uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),Ue=hr("uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),Ve=hr("varying vec3 v_data;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,0,1);} else {gl_Position=u_matrix*vec4(circle_center,0,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}"),Ge=hr("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),We=hr("uniform highp float u_intensity;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}"),He=hr("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(0.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),qe=hr("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),Ze=hr("uniform float u_overscale_factor;varying float v_placed;varying float v_notUsed;varying float v_radius;varying vec2 v_extrude;varying vec2 v_extrude_scale;void main() {float alpha=0.5;vec4 color=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {color=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {color*=.2;}float extrude_scale_length=length(v_extrude_scale);float extrude_length=length(v_extrude)*extrude_scale_length;float stroke_width=15.0*extrude_scale_length/u_overscale_factor;float radius=v_radius*extrude_scale_length;float distance_to_edge=abs(extrude_length-radius);float opacity_t=smoothstep(-stroke_width,0.0,-distance_to_edge);gl_FragColor=opacity_t*color;}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;varying float v_radius;varying vec2 v_extrude;varying vec2 v_extrude_scale;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);highp float padding_factor=1.2;gl_Position.xy+=a_extrude*u_extrude_scale*padding_factor*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;v_radius=abs(a_extrude.y);v_extrude=a_extrude*padding_factor;v_extrude_scale=u_extrude_scale*u_camera_to_center_distance*collision_perspective_ratio;}"),Xe=hr("uniform highp vec4 u_color;void main() {gl_FragColor=u_color;}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),Qe=hr("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),Ye=hr("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),Ke=hr("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec4 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float pixelRatio=u_scale.x;float tileRatio=u_scale.y;float fromScale=u_scale.z;float toScale=u_scale.w;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=vec2((pattern_br_a.x-pattern_tl_a.x)/pixelRatio,(pattern_br_a.y-pattern_tl_a.y)/pixelRatio);vec2 display_size_b=vec2((pattern_br_b.x-pattern_tl_b.x)/pixelRatio,(pattern_br_b.y-pattern_tl_b.y)/pixelRatio);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),$e=hr("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec4 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float pixelRatio=u_scale.x;float tileZoomRatio=u_scale.y;float fromScale=u_scale.z;float toScale=u_scale.w;vec2 display_size_a=vec2((pattern_br_a.x-pattern_tl_a.x)/pixelRatio,(pattern_br_a.y-pattern_tl_a.y)/pixelRatio);vec2 display_size_b=vec2((pattern_br_b.x-pattern_tl_b.x)/pixelRatio,(pattern_br_b.y-pattern_tl_b.y)/pixelRatio);gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}"),Je=hr("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}"),tr=hr("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec4 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float pixelRatio=u_scale.x;float tileRatio=u_scale.y;float fromScale=u_scale.z;float toScale=u_scale.w;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=vec2((pattern_br_a.x-pattern_tl_a.x)/pixelRatio,(pattern_br_a.y-pattern_tl_a.y)/pixelRatio);vec2 display_size_b=vec2((pattern_br_b.x-pattern_tl_b.x)/pixelRatio,(pattern_br_b.y-pattern_tl_b.y)/pixelRatio);base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"),er=hr("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform float u_maxzoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggeration=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/ pow(2.0,(u_zoom-u_maxzoom)*exaggeration+19.2562-u_zoom);gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),rr=hr("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),nr=hr("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),ir=hr("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp float v_lineprogress;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,vec2(v_lineprogress,0.5));gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define MAX_LINE_DISTANCE 32767.0\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_lineprogress;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_lineprogress=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0/MAX_LINE_DISTANCE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),or=hr("uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec4 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float pixelRatio=u_scale.x;float tileZoomRatio=u_scale.y;float fromScale=u_scale.z;float toScale=u_scale.w;vec2 display_size_a=vec2((pattern_br_a.x-pattern_tl_a.x)/pixelRatio,(pattern_br_a.y-pattern_tl_a.y)/pixelRatio);vec2 display_size_b=vec2((pattern_br_b.x-pattern_tl_b.x)/pixelRatio,(pattern_br_b.y-pattern_tl_b.y)/pixelRatio);vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x,1.0);float x_b=mod(v_linesofar/pattern_size_b.x,1.0);float y_a=0.5+(v_normal.y*clamp(v_width2.s,0.0,(pattern_size_a.y+2.0)/2.0)/pattern_size_a.y);float y_b=0.5+(v_normal.y*clamp(v_width2.s,0.0,(pattern_size_b.y+2.0)/2.0)/pattern_size_b.y);vec2 pos_a=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,vec2(x_a,y_a));vec2 pos_b=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,vec2(x_b,y_b));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);}"),ar=hr("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}"),sr=hr("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),ur=hr("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}"),cr=hr("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),lr=hr("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}");function hr(t,e){var r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,n={};return{fragmentSource:t=t.replace(r,(function(t,e,r,i,o){return n[o]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+o+"\nvarying "+r+" "+i+" "+o+";\n#else\nuniform "+r+" "+i+" u_"+o+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+o+"\n "+r+" "+i+" "+o+" = u_"+o+";\n#endif\n"})),vertexSource:e=e.replace(r,(function(t,e,r,i,o){var a="float"===i?"vec2":"vec4",s=o.match(/color/)?"color":a;return n[o]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+o+"\nuniform lowp float u_"+o+"_t;\nattribute "+r+" "+a+" a_"+o+";\nvarying "+r+" "+i+" "+o+";\n#else\nuniform "+r+" "+i+" u_"+o+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+o+"\n "+o+" = a_"+o+";\n#else\n "+r+" "+i+" "+o+" = u_"+o+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+o+"\n "+o+" = unpack_mix_"+s+"(a_"+o+", u_"+o+"_t);\n#else\n "+r+" "+i+" "+o+" = u_"+o+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+o+"\nuniform lowp float u_"+o+"_t;\nattribute "+r+" "+a+" a_"+o+";\n#else\nuniform "+r+" "+i+" u_"+o+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+o+"\n "+r+" "+i+" "+o+" = a_"+o+";\n#else\n "+r+" "+i+" "+o+" = u_"+o+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+o+"\n "+r+" "+i+" "+o+" = unpack_mix_"+s+"(a_"+o+", u_"+o+"_t);\n#else\n "+r+" "+i+" "+o+" = u_"+o+";\n#endif\n"}))}}var fr=Object.freeze({__proto__:null,prelude:ze,background:Ne,backgroundPattern:Ue,circle:Ve,clippingMask:Ge,heatmap:We,heatmapTexture:He,collisionBox:qe,collisionCircle:Ze,debug:Xe,fill:Qe,fillOutline:Ye,fillOutlinePattern:Ke,fillPattern:$e,fillExtrusion:Je,fillExtrusionPattern:tr,hillshadePrepare:er,hillshade:rr,line:nr,lineGradient:ir,linePattern:or,lineSDF:ar,raster:sr,symbolIcon:ur,symbolSDF:cr,symbolTextAndIcon:lr}),pr=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};pr.prototype.bind=function(t,e,r,n,i,o,a,s){this.context=t;for(var u=this.boundPaintVertexBuffers.length!==n.length,c=0;!u&&c<n.length;c++)this.boundPaintVertexBuffers[c]!==n[c]&&(u=!0);var l=!this.vao||this.boundProgram!==e||this.boundLayoutVertexBuffer!==r||u||this.boundIndexBuffer!==i||this.boundVertexOffset!==o||this.boundDynamicVertexBuffer!==a||this.boundDynamicVertexBuffer2!==s;!t.extVertexArrayObject||l?this.freshBind(e,r,n,i,o,a,s):(t.bindVertexArrayOES.set(this.vao),a&&a.bind(),i&&i.dynamicDraw&&i.bind(),s&&s.bind())},pr.prototype.freshBind=function(t,e,r,n,i,o,a){var s,u=t.numAttributes,c=this.context,l=c.gl;if(c.extVertexArrayObject)this.vao&&this.destroy(),this.vao=c.extVertexArrayObject.createVertexArrayOES(),c.bindVertexArrayOES.set(this.vao),s=0,this.boundProgram=t,this.boundLayoutVertexBuffer=e,this.boundPaintVertexBuffers=r,this.boundIndexBuffer=n,this.boundVertexOffset=i,this.boundDynamicVertexBuffer=o,this.boundDynamicVertexBuffer2=a;else{s=c.currentNumAttributes||0;for(var h=u;h<s;h++)l.disableVertexAttribArray(h)}e.enableAttributes(l,t);for(var f=0,p=r;f<p.length;f+=1)p[f].enableAttributes(l,t);o&&o.enableAttributes(l,t),a&&a.enableAttributes(l,t),e.bind(),e.setVertexAttribPointers(l,t,i);for(var d=0,A=r;d<A.length;d+=1){var g=A[d];g.bind(),g.setVertexAttribPointers(l,t,i)}o&&(o.bind(),o.setVertexAttribPointers(l,t,i)),n&&n.bind(),a&&(a.bind(),a.setVertexAttribPointers(l,t,i)),c.currentNumAttributes=u},pr.prototype.destroy=function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)};var dr=function(t,e,r,n,i){var o=t.gl;this.program=o.createProgram();var a=r.defines();i&&a.push("#define OVERDRAW_INSPECTOR;");var s=a.concat(ze.fragmentSource,e.fragmentSource).join("\n"),u=a.concat(ze.vertexSource,e.vertexSource).join("\n"),c=o.createShader(o.FRAGMENT_SHADER);if(o.isContextLost())this.failedToCreate=!0;else{o.shaderSource(c,s),o.compileShader(c),o.attachShader(this.program,c);var l=o.createShader(o.VERTEX_SHADER);if(o.isContextLost())this.failedToCreate=!0;else{o.shaderSource(l,u),o.compileShader(l),o.attachShader(this.program,l);for(var h=r.layoutAttributes||[],f=0;f<h.length;f++)o.bindAttribLocation(this.program,f,h[f].name);o.linkProgram(this.program),this.numAttributes=o.getProgramParameter(this.program,o.ACTIVE_ATTRIBUTES),this.attributes={};for(var p={},d=0;d<this.numAttributes;d++){var A=o.getActiveAttrib(this.program,d);A&&(this.attributes[A.name]=o.getAttribLocation(this.program,A.name))}for(var g=o.getProgramParameter(this.program,o.ACTIVE_UNIFORMS),m=0;m<g;m++){var y=o.getActiveUniform(this.program,m);y&&(p[y.name]=o.getUniformLocation(this.program,y.name))}this.fixedUniforms=n(t,p),this.binderUniforms=r.getUniforms(t,p)}}};function Ar(e,r,n){var i=1/ue(n,1,r.transform.tileZoom),o=Math.pow(2,n.tileID.overscaledZ),a=n.tileSize*Math.pow(2,r.transform.tileZoom)/o,s=a*(n.tileID.canonical.x+n.tileID.wrap*o),u=a*n.tileID.canonical.y;return{u_image:0,u_texsize:n.imageAtlasTexture.size,u_scale:[t.browser.devicePixelRatio,i,e.fromScale,e.toScale],u_fade:e.t,u_pixel_coord_upper:[s>>16,u>>16],u_pixel_coord_lower:[65535&s,65535&u]}}dr.prototype.draw=function(t,e,r,n,i,o,a,s,u,c,l,h,f,p,d,A){var g,m=t.gl;if(!this.failedToCreate){for(var y in t.program.set(this.program),t.setDepthMode(r),t.setStencilMode(n),t.setColorMode(i),t.setCullFace(o),this.fixedUniforms)this.fixedUniforms[y].set(a[y]);p&&p.setUniforms(t,this.binderUniforms,h,{zoom:f});for(var v=(g={},g[m.LINES]=2,g[m.TRIANGLES]=3,g[m.LINE_STRIP]=1,g)[e],_=0,b=l.get();_<b.length;_+=1){var x=b[_],w=x.vaos||(x.vaos={});(w[s]||(w[s]=new pr)).bind(t,this,u,p?p.getPaintVertexBuffers():[],c,x.vertexOffset,d,A),m.drawElements(e,x.primitiveLength*v,m.UNSIGNED_SHORT,x.primitiveOffset*v*2)}}};var gr=function(e,r,n,i){var o=r.style.light,a=o.properties.get("position"),s=[a.x,a.y,a.z],u=t.create$1();"viewport"===o.properties.get("anchor")&&t.fromRotation(u,-r.transform.angle),t.transformMat3(s,s,u);var c=o.properties.get("color");return{u_matrix:e,u_lightpos:s,u_lightintensity:o.properties.get("intensity"),u_lightcolor:[c.r,c.g,c.b],u_vertical_gradient:+n,u_opacity:i}},mr=function(e,r,n,i,o,a,s){return t.extend(gr(e,r,n,i),Ar(a,r,s),{u_height_factor:-Math.pow(2,o.overscaledZ)/s.tileSize/8})},yr=function(t){return{u_matrix:t}},vr=function(e,r,n,i){return t.extend(yr(e),Ar(n,r,i))},_r=function(t,e){return{u_matrix:t,u_world:e}},br=function(e,r,n,i,o){return t.extend(vr(e,r,n,i),{u_world:o})},xr=function(e,r,n,i){var o,a,s=e.transform;if("map"===i.paint.get("circle-pitch-alignment")){var u=ue(n,1,s.zoom);o=!0,a=[u,u]}else o=!1,a=s.pixelsToGLUnits;return{u_camera_to_center_distance:s.cameraToCenterDistance,u_scale_with_map:+("map"===i.paint.get("circle-pitch-scale")),u_matrix:e.translatePosMatrix(r.posMatrix,n,i.paint.get("circle-translate"),i.paint.get("circle-translate-anchor")),u_pitch_with_map:+o,u_device_pixel_ratio:t.browser.devicePixelRatio,u_extrude_scale:a}},wr=function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pixels_to_tile_units:new t.Uniform1f(e,r.u_pixels_to_tile_units),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_overscale_factor:new t.Uniform1f(e,r.u_overscale_factor)}},Er=function(t,e,r){var n=ue(r,1,e.zoom),i=Math.pow(2,e.zoom-r.tileID.overscaledZ),o=r.tileID.overscaleFactor();return{u_matrix:t,u_camera_to_center_distance:e.cameraToCenterDistance,u_pixels_to_tile_units:n,u_extrude_scale:[e.pixelsToGLUnits[0]/(n*i),e.pixelsToGLUnits[1]/(n*i)],u_overscale_factor:o}},Sr=function(t,e){return{u_matrix:t,u_color:e}},Or=function(t){return{u_matrix:t}},Tr=function(t,e,r,n){return{u_matrix:t,u_extrude_scale:ue(e,1,r),u_intensity:n}};function Pr(e,r){var n=Math.pow(2,r.canonical.z),i=r.canonical.y;return[new t.MercatorCoordinate(0,i/n).toLngLat().lat,new t.MercatorCoordinate(0,(i+1)/n).toLngLat().lat]}var Mr=function(e,r,n){var i=e.transform;return{u_matrix:Lr(e,r,n),u_ratio:1/ue(r,1,i.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_units_to_pixels:[1/i.pixelsToGLUnits[0],1/i.pixelsToGLUnits[1]]}},Cr=function(e,r,n){return t.extend(Mr(e,r,n),{u_image:0})},Ir=function(e,r,n,i){var o=e.transform,a=Rr(r,o);return{u_matrix:Lr(e,r,n),u_texsize:r.imageAtlasTexture.size,u_ratio:1/ue(r,1,o.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_image:0,u_scale:[t.browser.devicePixelRatio,a,i.fromScale,i.toScale],u_fade:i.t,u_units_to_pixels:[1/o.pixelsToGLUnits[0],1/o.pixelsToGLUnits[1]]}},kr=function(e,r,n,i,o){var a=e.transform,s=e.lineAtlas,u=Rr(r,a),c="round"===n.layout.get("line-cap"),l=s.getDash(i.from,c),h=s.getDash(i.to,c),f=l.width*o.fromScale,p=h.width*o.toScale;return t.extend(Mr(e,r,n),{u_patternscale_a:[u/f,-l.height/2],u_patternscale_b:[u/p,-h.height/2],u_sdfgamma:s.width/(256*Math.min(f,p)*t.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:l.y,u_tex_y_b:h.y,u_mix:o.t})};function Rr(t,e){return 1/ue(t,1,e.tileZoom)}function Lr(t,e,r){return t.translatePosMatrix(e.tileID.posMatrix,e,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}var jr=function(t,e,r,n,i){return{u_matrix:t,u_tl_parent:e,u_scale_parent:r,u_buffer_scale:1,u_fade_t:n.mix,u_opacity:n.opacity*i.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:i.paint.get("raster-brightness-min"),u_brightness_high:i.paint.get("raster-brightness-max"),u_saturation_factor:(a=i.paint.get("raster-saturation"),a>0?1-1/(1.001-a):-a),u_contrast_factor:(o=i.paint.get("raster-contrast"),o>0?1/(1-o):1+o),u_spin_weights:Dr(i.paint.get("raster-hue-rotate"))};var o,a};function Dr(t){t*=Math.PI/180;var e=Math.sin(t),r=Math.cos(t);return[(2*r+1)/3,(-Math.sqrt(3)*e-r+1)/3,(Math.sqrt(3)*e-r+1)/3]}var Br=function(t,e,r,n,i,o,a,s,u,c){var l=i.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:l.cameraToCenterDistance,u_pitch:l.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:l.width/l.height,u_fade_change:i.options.fadeDuration?i.symbolFadeChange:1,u_matrix:o,u_label_plane_matrix:a,u_coord_matrix:s,u_is_text:+u,u_pitch_with_map:+n,u_texsize:c,u_texture:0}},Fr=function(e,r,n,i,o,a,s,u,c,l,h){var f=o.transform;return t.extend(Br(e,r,n,i,o,a,s,u,c,l),{u_gamma_scale:i?Math.cos(f._pitch)*f.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:+h})},zr=function(e,r,n,i,o,a,s,u,c,l){return t.extend(Fr(e,r,n,i,o,a,s,u,!0,c,!0),{u_texsize_icon:l,u_texture_icon:1})},Nr=function(t,e,r){return{u_matrix:t,u_opacity:e,u_color:r}},Ur=function(e,r,n,i,o,a){return t.extend(function(t,e,r,n){var i=r.imageManager.getPattern(t.from.toString()),o=r.imageManager.getPattern(t.to.toString()),a=r.imageManager.getPixelSize(),s=a.width,u=a.height,c=Math.pow(2,n.tileID.overscaledZ),l=n.tileSize*Math.pow(2,r.transform.tileZoom)/c,h=l*(n.tileID.canonical.x+n.tileID.wrap*c),f=l*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:i.tl,u_pattern_br_a:i.br,u_pattern_tl_b:o.tl,u_pattern_br_b:o.br,u_texsize:[s,u],u_mix:e.t,u_pattern_size_a:i.displaySize,u_pattern_size_b:o.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/ue(n,1,r.transform.tileZoom),u_pixel_coord_upper:[h>>16,f>>16],u_pixel_coord_lower:[65535&h,65535&f]}}(i,a,n,o),{u_matrix:e,u_opacity:r})},Vr={fillExtrusion:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fillExtrusionPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_height_factor:new t.Uniform1f(e,r.u_height_factor),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform4f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fill:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},fillPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform4f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},fillOutline:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world)}},fillOutlinePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform4f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},circle:function(e,r){return{u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(e,r.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},collisionBox:wr,collisionCircle:wr,debug:function(e,r){return{u_color:new t.UniformColor(e,r.u_color),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},clippingMask:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmap:function(e,r){return{u_extrude_scale:new t.Uniform1f(e,r.u_extrude_scale),u_intensity:new t.Uniform1f(e,r.u_intensity),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmapTexture:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_color_ramp:new t.Uniform1i(e,r.u_color_ramp),u_opacity:new t.Uniform1f(e,r.u_opacity)}},hillshade:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_latrange:new t.Uniform2f(e,r.u_latrange),u_light:new t.Uniform2f(e,r.u_light),u_shadow:new t.UniformColor(e,r.u_shadow),u_highlight:new t.UniformColor(e,r.u_highlight),u_accent:new t.UniformColor(e,r.u_accent)}},hillshadePrepare:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_dimension:new t.Uniform2f(e,r.u_dimension),u_zoom:new t.Uniform1f(e,r.u_zoom),u_maxzoom:new t.Uniform1f(e,r.u_maxzoom),u_unpack:new t.Uniform4f(e,r.u_unpack)}},line:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels)}},lineGradient:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_image:new t.Uniform1i(e,r.u_image)}},linePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_texsize:new t.Uniform2f(e,r.u_texsize),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_image:new t.Uniform1i(e,r.u_image),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_scale:new t.Uniform4f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},lineSDF:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_patternscale_a:new t.Uniform2f(e,r.u_patternscale_a),u_patternscale_b:new t.Uniform2f(e,r.u_patternscale_b),u_sdfgamma:new t.Uniform1f(e,r.u_sdfgamma),u_image:new t.Uniform1i(e,r.u_image),u_tex_y_a:new t.Uniform1f(e,r.u_tex_y_a),u_tex_y_b:new t.Uniform1f(e,r.u_tex_y_b),u_mix:new t.Uniform1f(e,r.u_mix)}},raster:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_tl_parent:new t.Uniform2f(e,r.u_tl_parent),u_scale_parent:new t.Uniform1f(e,r.u_scale_parent),u_buffer_scale:new t.Uniform1f(e,r.u_buffer_scale),u_fade_t:new t.Uniform1f(e,r.u_fade_t),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image0:new t.Uniform1i(e,r.u_image0),u_image1:new t.Uniform1i(e,r.u_image1),u_brightness_low:new t.Uniform1f(e,r.u_brightness_low),u_brightness_high:new t.Uniform1f(e,r.u_brightness_high),u_saturation_factor:new t.Uniform1f(e,r.u_saturation_factor),u_contrast_factor:new t.Uniform1f(e,r.u_contrast_factor),u_spin_weights:new t.Uniform3f(e,r.u_spin_weights)}},symbolIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1f(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture)}},symbolSDF:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1f(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1f(e,r.u_is_halo)}},symbolTextAndIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1f(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texsize_icon:new t.Uniform2f(e,r.u_texsize_icon),u_texture:new t.Uniform1i(e,r.u_texture),u_texture_icon:new t.Uniform1i(e,r.u_texture_icon),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1f(e,r.u_is_halo)}},background:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_color:new t.UniformColor(e,r.u_color)}},backgroundPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image:new t.Uniform1i(e,r.u_image),u_pattern_tl_a:new t.Uniform2f(e,r.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(e,r.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(e,r.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(e,r.u_pattern_br_b),u_texsize:new t.Uniform2f(e,r.u_texsize),u_mix:new t.Uniform1f(e,r.u_mix),u_pattern_size_a:new t.Uniform2f(e,r.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(e,r.u_pattern_size_b),u_scale_a:new t.Uniform1f(e,r.u_scale_a),u_scale_b:new t.Uniform1f(e,r.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(e,r.u_tile_units_to_pixels)}}};function Gr(e,r){for(var n=e.sort((function(t,e){return t.tileID.isLessThan(e.tileID)?-1:e.tileID.isLessThan(t.tileID)?1:0})),i=0;i<n.length;i++){var o={},a=n[i],s=n.slice(i+1);Wr(a.tileID.wrapped(),a.tileID,s,new t.OverscaledTileID(0,a.tileID.wrap+1,0,0,0),o),a.setMask(o,r)}}function Wr(e,r,n,i,o){for(var a=0;a<n.length;a++){var s=n[a];if(i.isLessThan(s.tileID))break;if(r.key===s.tileID.key)return;if(s.tileID.isChildOf(r)){for(var u=r.children(1/0),c=0;c<u.length;c++)Wr(e,u[c],n.slice(a),i,o);return}}var l=r.overscaledZ-e.overscaledZ,h=new t.CanonicalTileID(l,r.canonical.x-(e.canonical.x<<l),r.canonical.y-(e.canonical.y<<l));o[h.key]=o[h.key]||h}function Hr(t,e,r,n,i,o,a,s){for(var u=t.context,c=u.gl,l=i?t.useProgram("collisionCircle"):t.useProgram("collisionBox"),h=0;h<n.length;h++){var f=n[h],p=e.getTile(f),d=p.getBucket(r);if(d){var A=i?s?d.textCollisionCircle:d.iconCollisionCircle:s?d.textCollisionBox:d.iconCollisionBox;if(A){var g=f.posMatrix;0===o[0]&&0===o[1]||(g=t.translatePosMatrix(f.posMatrix,p,o,a)),l.draw(u,i?c.TRIANGLES:c.LINES,Et.disabled,St.disabled,t.colorModeForRenderPass(),Tt.disabled,Er(g,t.transform,p),r.id,A.layoutVertexBuffer,A.indexBuffer,A.segments,null,t.transform.zoom,null,null,A.collisionVertexBuffer)}}}}function qr(t,e,r,n,i,o,a){Hr(t,e,r,n,!1,i,o,a),Hr(t,e,r,n,!0,i,o,a)}var Zr=t.identity(new Float32Array(16));function Xr(e,r,n,i,o,a){var s=t.getAnchorAlignment(e),u=-(s.horizontalAlign-.5)*r,c=-(s.verticalAlign-.5)*n,l=t.evaluateVariableOffset(e,i);return new t.Point((u/o+l[0])*a,(c/o+l[1])*a)}function Qr(e,r,n,i,o,a,s,u,c,l,h){var f=e.text.placedSymbolArray,p=e.text.dynamicLayoutVertexArray,d=e.icon.dynamicLayoutVertexArray,A={};p.clear();for(var g=0;g<f.length;g++){var m=f.get(g),y=e.allowVerticalPlacement&&!m.placedOrientation,v=m.hidden||!m.crossTileID||y?null:i[m.crossTileID];if(v){var _=new t.Point(m.anchorX,m.anchorY),b=Qt(_,n?u:s),x=.5+a.cameraToCenterDistance/b.signedDistanceFromCamera*.5,w=o.evaluateSizeForFeature(e.textSizeData,l,m)*x/t.ONE_EM;n&&(w*=e.tilePixelRatio/c);for(var E=v.width,S=v.height,O=Xr(v.anchor,E,S,v.textOffset,v.textBoxScale,w),T=n?Qt(_.add(O),s).point:b.point.add(r?O.rotate(-a.angle):O),P=e.allowVerticalPlacement&&m.placedOrientation===t.WritingMode.vertical?Math.PI/2:0,M=0;M<m.numGlyphs;M++)t.addDynamicAttributes(p,T,P);h&&m.associatedIconIndex>=0&&(A[m.associatedIconIndex]={shiftedAnchor:T,angle:P})}else ie(m.numGlyphs,p)}if(h){d.clear();for(var C=e.icon.placedSymbolArray,I=0;I<C.length;I++){var k=C.get(I);if(k.hidden)ie(k.numGlyphs,d);else{var R=A[I];if(R)for(var L=0;L<k.numGlyphs;L++)t.addDynamicAttributes(d,R.shiftedAnchor,R.angle);else ie(k.numGlyphs,d)}}e.icon.dynamicLayoutVertexBuffer.updateData(d)}e.text.dynamicLayoutVertexBuffer.updateData(p)}function Yr(t,e,r){return r.iconsInText&&e?"symbolTextAndIcon":t?"symbolSDF":"symbolIcon"}function Kr(e,r,n,i,o,a,s,u,c,l,h,f){for(var p,d,A=e.context,g=A.gl,m=e.transform,y="map"===u,v="map"===c,_=y&&"point"!==n.layout.get("symbol-placement"),b=y&&!v&&!_,x=void 0!==n.layout.get("symbol-sort-key").constantOr(1),w=e.depthModeForSublayer(0,Et.ReadOnly),E=n.layout.get("text-variable-anchor"),S=[],O=0,T=i;O<T.length;O+=1){var P=T[O],M=r.getTile(P),C=M.getBucket(n);if(C){var I=o?C.text:C.icon;if(I&&I.segments.get().length){var k=I.programConfigurations.get(n.id),R=o||C.sdfIcons,L=o?C.textSizeData:C.iconSizeData,j=v||0!==m.pitch;p||(p=e.useProgram(Yr(R,o,C),k),d=t.evaluateSizeForZoom(L,m.zoom));var D=void 0,B=[0,0],F=void 0,z=void 0,N=null,U=void 0;if(o){if(F=M.glyphAtlasTexture,z=g.LINEAR,D=M.glyphAtlasTexture.size,C.iconsInText){B=M.imageAtlasTexture.size,N=M.imageAtlasTexture;var V="composite"===L.kind||"camera"===L.kind;U=j||e.options.rotating||e.options.zooming||V?g.LINEAR:g.NEAREST}}else{var G=1!==n.layout.get("icon-size").constantOr(0)||C.iconsNeedLinear;F=M.imageAtlasTexture,z=R||e.options.rotating||e.options.zooming||G||j?g.LINEAR:g.NEAREST,D=M.imageAtlasTexture.size}var W=ue(M,1,e.transform.zoom),H=Zt(P.posMatrix,v,y,e.transform,W),q=Xt(P.posMatrix,v,y,e.transform,W),Z=E&&C.hasTextData(),X="none"!==n.layout.get("icon-text-fit")&&Z&&C.hasIconData();_&&Kt(C,P.posMatrix,e,o,H,q,v,l);var Q=e.translatePosMatrix(P.posMatrix,M,a,s),Y=_||o&&E||X?Zr:H,K=e.translatePosMatrix(q,M,a,s,!0),$=R&&0!==n.paint.get(o?"text-halo-width":"icon-halo-width").constantOr(1),J={program:p,buffers:I,uniformValues:R?C.iconsInText?zr(L.kind,d,b,v,e,Q,Y,K,D,B):Fr(L.kind,d,b,v,e,Q,Y,K,o,D,!0):Br(L.kind,d,b,v,e,Q,Y,K,o,D),atlasTexture:F,atlasTextureIcon:N,atlasInterpolation:z,atlasInterpolationIcon:U,isSDF:R,hasHalo:$};if(x)for(var tt=0,et=I.segments.get();tt<et.length;tt+=1){var rt=et[tt];S.push({segments:new t.SegmentVector([rt]),sortKey:rt.sortKey,state:J})}else S.push({segments:I.segments,sortKey:0,state:J})}}}x&&S.sort((function(t,e){return t.sortKey-e.sortKey}));for(var nt=0,it=S;nt<it.length;nt+=1){var ot=it[nt],at=ot.state;if(A.activeTexture.set(g.TEXTURE0),at.atlasTexture.bind(at.atlasInterpolation,g.CLAMP_TO_EDGE),at.atlasTextureIcon&&(A.activeTexture.set(g.TEXTURE1),at.atlasTextureIcon&&at.atlasTextureIcon.bind(at.atlasInterpolationIcon,g.CLAMP_TO_EDGE)),at.isSDF){var st=at.uniformValues;at.hasHalo&&(st.u_is_halo=1,$r(at.buffers,ot.segments,n,e,at.program,w,h,f,st)),st.u_is_halo=0}$r(at.buffers,ot.segments,n,e,at.program,w,h,f,at.uniformValues)}}function $r(t,e,r,n,i,o,a,s,u){var c=n.context,l=c.gl;i.draw(c,l.TRIANGLES,o,a,s,Tt.disabled,u,r.id,t.layoutVertexBuffer,t.indexBuffer,e,r.paint,n.transform.zoom,t.programConfigurations.get(r.id),t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer)}function Jr(t,e,r,n,i,o,a){var s,u,c,l,h,f=t.context.gl,p=r.paint.get("fill-pattern"),d=p&&p.constantOr(1),A=r.getCrossfadeParameters();a?(u=d&&!r.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",s=f.LINES):(u=d?"fillPattern":"fill",s=f.TRIANGLES);for(var g=0,m=n;g<m.length;g+=1){var y=m[g],v=e.getTile(y);if(!d||v.patternsLoaded()){var _=v.getBucket(r);if(_){var b=_.programConfigurations.get(r.id),x=t.useProgram(u,b);d&&(t.context.activeTexture.set(f.TEXTURE0),v.imageAtlasTexture.bind(f.LINEAR,f.CLAMP_TO_EDGE),b.updatePatternPaintBuffers(A));var w=p.constantOr(null);if(w&&v.imageAtlas){var E=v.imageAtlas,S=E.patternPositions[w.to.toString()],O=E.patternPositions[w.from.toString()];S&&O&&b.setConstantPatternPositions(S,O)}var T=t.translatePosMatrix(y.posMatrix,v,r.paint.get("fill-translate"),r.paint.get("fill-translate-anchor"));if(a){l=_.indexBuffer2,h=_.segments2;var P=[f.drawingBufferWidth,f.drawingBufferHeight];c="fillOutlinePattern"===u&&d?br(T,t,A,v,P):_r(T,P)}else l=_.indexBuffer,h=_.segments,c=d?vr(T,t,A,v):yr(T);x.draw(t.context,s,i,t.stencilModeForClipping(y),o,Tt.disabled,c,r.id,_.layoutVertexBuffer,l,h,r.paint,t.transform.zoom,b)}}}}function tn(t,e,r,n,i,o,a){for(var s=t.context,u=s.gl,c=r.paint.get("fill-extrusion-pattern"),l=c.constantOr(1),h=r.getCrossfadeParameters(),f=r.paint.get("fill-extrusion-opacity"),p=0,d=n;p<d.length;p+=1){var A=d[p],g=e.getTile(A),m=g.getBucket(r);if(m){var y=m.programConfigurations.get(r.id),v=t.useProgram(l?"fillExtrusionPattern":"fillExtrusion",y);l&&(t.context.activeTexture.set(u.TEXTURE0),g.imageAtlasTexture.bind(u.LINEAR,u.CLAMP_TO_EDGE),y.updatePatternPaintBuffers(h));var _=c.constantOr(null);if(_&&g.imageAtlas){var b=g.imageAtlas,x=b.patternPositions[_.to.toString()],w=b.patternPositions[_.from.toString()];x&&w&&y.setConstantPatternPositions(x,w)}var E=t.translatePosMatrix(A.posMatrix,g,r.paint.get("fill-extrusion-translate"),r.paint.get("fill-extrusion-translate-anchor")),S=r.paint.get("fill-extrusion-vertical-gradient"),O=l?mr(E,t,S,f,A,h,g):gr(E,t,S,f);v.draw(s,s.gl.TRIANGLES,i,o,a,Tt.backCCW,O,r.id,m.layoutVertexBuffer,m.indexBuffer,m.segments,r.paint,t.transform.zoom,y)}}}function en(t,e,r,n,i,o){var a=t.context,s=a.gl,u=e.fbo;if(u){var c=t.useProgram("hillshade");a.activeTexture.set(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,u.colorAttachment.get());var l=function(t,e,r){var n=r.paint.get("hillshade-shadow-color"),i=r.paint.get("hillshade-highlight-color"),o=r.paint.get("hillshade-accent-color"),a=r.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===r.paint.get("hillshade-illumination-anchor")&&(a-=t.transform.angle);var s=!t.options.moving;return{u_matrix:t.transform.calculatePosMatrix(e.tileID.toUnwrapped(),s),u_image:0,u_latrange:Pr(0,e.tileID),u_light:[r.paint.get("hillshade-exaggeration"),a],u_shadow:n,u_highlight:i,u_accent:o}}(t,e,r);e.maskedBoundsBuffer&&e.maskedIndexBuffer&&e.segments?c.draw(a,s.TRIANGLES,n,i,o,Tt.disabled,l,r.id,e.maskedBoundsBuffer,e.maskedIndexBuffer,e.segments):c.draw(a,s.TRIANGLES,n,i,o,Tt.disabled,l,r.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}}function rn(e,r,n,i,o,a,s){var u=e.context,c=u.gl,l=r.dem;if(l&&l.data){var h=l.dim,f=l.stride,p=l.getPixels();if(u.activeTexture.set(c.TEXTURE1),u.pixelStoreUnpackPremultiplyAlpha.set(!1),r.demTexture=r.demTexture||e.getTileTexture(f),r.demTexture){var d=r.demTexture;d.update(p,{premultiply:!1}),d.bind(c.NEAREST,c.CLAMP_TO_EDGE)}else r.demTexture=new t.Texture(u,p,c.RGBA,{premultiply:!1}),r.demTexture.bind(c.NEAREST,c.CLAMP_TO_EDGE);u.activeTexture.set(c.TEXTURE0);var A=r.fbo;if(!A){var g=new t.Texture(u,{width:h,height:h,data:null},c.RGBA);g.bind(c.LINEAR,c.CLAMP_TO_EDGE),(A=r.fbo=u.createFramebuffer(h,h)).colorAttachment.set(g.texture)}u.bindFramebuffer.set(A.framebuffer),u.viewport.set([0,0,h,h]),e.useProgram("hillshadePrepare").draw(u,c.TRIANGLES,o,a,s,Tt.disabled,function(e,r,n){var i=r.stride,o=t.create();return t.ortho(o,0,t.EXTENT,-t.EXTENT,0,0,1),t.translate(o,o,[0,-t.EXTENT,0]),{u_matrix:o,u_image:1,u_dimension:[i,i],u_zoom:e.overscaledZ,u_maxzoom:n,u_unpack:r.getUnpackVector()}}(r.tileID,l,i),n.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments),r.needsHillshadePrepare=!1}}function nn(e,r,n,i,o){var a=i.paint.get("raster-fade-duration");if(a>0){var s=t.browser.now(),u=(s-e.timeAdded)/a,c=r?(s-r.timeAdded)/a:-1,l=n.getSource(),h=o.coveringZoomLevel({tileSize:l.tileSize,roundZoom:l.roundZoom}),f=!r||Math.abs(r.tileID.overscaledZ-h)>Math.abs(e.tileID.overscaledZ-h),p=f&&e.refreshedUponExpiration?1:t.clamp(f?u:1-c,0,1);return e.refreshedUponExpiration&&u>=1&&(e.refreshedUponExpiration=!1),r?{opacity:1,mix:1-p}:{opacity:p,mix:0}}return{opacity:1,mix:0}}function on(e,r,n){var i=e.context,o=i.gl,a=n.posMatrix,s=e.useProgram("debug"),u=Et.disabled,c=St.disabled,l=e.colorModeForRenderPass(),h="$debug";s.draw(i,o.LINE_STRIP,u,c,l,Tt.disabled,Sr(a,t.Color.red),h,e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments);var f=r.getTileByID(n.key).latestRawTileData,p=f&&f.byteLength||0,d=Math.floor(p/1024),A=r.getTile(n).tileSize,g=512/Math.min(A,512),m=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(m+=" => "+n.overscaledZ);for(var y=function(t,e,r,n){n=n||1;var i,o,a,s,u,c,l,h,f=[];for(i=0,o=t.length;i<o;i++)if(u=an[t[i]]){for(h=null,a=0,s=u[1].length;a<s;a+=2)-1===u[1][a]&&-1===u[1][a+1]?h=null:(c=e+u[1][a]*n,l=r-u[1][a+1]*n,h&&f.push(h.x,h.y,c,l),h={x:c,y:l});e+=u[0]*n}return f}(m+" "+d+"kb",50,200*g,5*g),v=new t.StructArrayLayout2i4,_=new t.StructArrayLayout2ui4,b=0;b<y.length;b+=2)v.emplaceBack(y[b],y[b+1]),_.emplaceBack(b,b+1);for(var x=i.createVertexBuffer(v,Fe.members),w=i.createIndexBuffer(_),E=t.SegmentVector.simpleSegment(0,0,v.length/2,v.length/2),S=t.EXTENT/(Math.pow(2,e.transform.zoom-n.overscaledZ)*A*g),O=[],T=-1;T<=1;T++)for(var P=-1;P<=1&&(0!==T||0!==P);P++)O.push([T,P]);for(var M=0;M<O.length;M++){var C=O[M];s.draw(i,o.LINES,u,c,l,Tt.disabled,Sr(t.translate([],a,[S*C[0],S*C[1],0]),t.Color.white),h,x,w,E)}s.draw(i,o.LINES,u,c,l,Tt.disabled,Sr(a,t.Color.black),h,x,w,E),x.destroy(),w.destroy(),E.destroy()}var an={" ":[16,[]],"!":[10,[5,21,5,7,-1,-1,5,2,4,1,5,0,6,1,5,2]],'"':[16,[4,21,4,14,-1,-1,12,21,12,14]],"#":[21,[11,25,4,-7,-1,-1,17,25,10,-7,-1,-1,4,12,18,12,-1,-1,3,6,17,6]],$:[20,[8,25,8,-4,-1,-1,12,25,12,-4,-1,-1,17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],"%":[24,[21,21,3,0,-1,-1,8,21,10,19,10,17,9,15,7,14,5,14,3,16,3,18,4,20,6,21,8,21,10,20,13,19,16,19,19,20,21,21,-1,-1,17,7,15,6,14,4,14,2,16,0,18,0,20,1,21,3,21,5,19,7,17,7]],"&":[26,[23,12,23,13,22,14,21,14,20,13,19,11,17,6,15,3,13,1,11,0,7,0,5,1,4,2,3,4,3,6,4,8,5,9,12,13,13,14,14,16,14,18,13,20,11,21,9,20,8,18,8,16,9,13,11,10,16,3,18,1,20,0,22,0,23,1,23,2]],"'":[10,[5,19,4,20,5,21,6,20,6,18,5,16,4,15]],"(":[14,[11,25,9,23,7,20,5,16,4,11,4,7,5,2,7,-2,9,-5,11,-7]],")":[14,[3,25,5,23,7,20,9,16,10,11,10,7,9,2,7,-2,5,-5,3,-7]],"*":[16,[8,21,8,9,-1,-1,3,18,13,12,-1,-1,13,18,3,12]],"+":[26,[13,18,13,0,-1,-1,4,9,22,9]],",":[10,[6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],"-":[26,[4,9,22,9]],".":[10,[5,2,4,1,5,0,6,1,5,2]],"/":[22,[20,25,2,-7]],0:[20,[9,21,6,20,4,17,3,12,3,9,4,4,6,1,9,0,11,0,14,1,16,4,17,9,17,12,16,17,14,20,11,21,9,21]],1:[20,[6,17,8,18,11,21,11,0]],2:[20,[4,16,4,17,5,19,6,20,8,21,12,21,14,20,15,19,16,17,16,15,15,13,13,10,3,0,17,0]],3:[20,[5,21,16,21,10,13,13,13,15,12,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],4:[20,[13,21,3,7,18,7,-1,-1,13,21,13,0]],5:[20,[15,21,5,21,4,12,5,13,8,14,11,14,14,13,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],6:[20,[16,18,15,20,12,21,10,21,7,20,5,17,4,12,4,7,5,3,7,1,10,0,11,0,14,1,16,3,17,6,17,7,16,10,14,12,11,13,10,13,7,12,5,10,4,7]],7:[20,[17,21,7,0,-1,-1,3,21,17,21]],8:[20,[8,21,5,20,4,18,4,16,5,14,7,13,11,12,14,11,16,9,17,7,17,4,16,2,15,1,12,0,8,0,5,1,4,2,3,4,3,7,4,9,6,11,9,12,13,13,15,14,16,16,16,18,15,20,12,21,8,21]],9:[20,[16,14,15,11,13,9,10,8,9,8,6,9,4,11,3,14,3,15,4,18,6,20,9,21,10,21,13,20,15,18,16,14,16,9,15,4,13,1,10,0,8,0,5,1,4,3]],":":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,5,2,4,1,5,0,6,1,5,2]],";":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],"<":[24,[20,18,4,9,20,0]],"=":[26,[4,12,22,12,-1,-1,4,6,22,6]],">":[24,[4,18,20,9,4,0]],"?":[18,[3,16,3,17,4,19,5,20,7,21,11,21,13,20,14,19,15,17,15,15,14,13,13,12,9,10,9,7,-1,-1,9,2,8,1,9,0,10,1,9,2]],"@":[27,[18,13,17,15,15,16,12,16,10,15,9,14,8,11,8,8,9,6,11,5,14,5,16,6,17,8,-1,-1,12,16,10,14,9,11,9,8,10,6,11,5,-1,-1,18,16,17,8,17,6,19,5,21,5,23,7,24,10,24,12,23,15,22,17,20,19,18,20,15,21,12,21,9,20,7,19,5,17,4,15,3,12,3,9,4,6,5,4,7,2,9,1,12,0,15,0,18,1,20,2,21,3,-1,-1,19,16,18,8,18,6,19,5]],A:[18,[9,21,1,0,-1,-1,9,21,17,0,-1,-1,4,7,14,7]],B:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,-1,-1,4,11,13,11,16,10,17,9,18,7,18,4,17,2,16,1,13,0,4,0]],C:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5]],D:[21,[4,21,4,0,-1,-1,4,21,11,21,14,20,16,18,17,16,18,13,18,8,17,5,16,3,14,1,11,0,4,0]],E:[19,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11,-1,-1,4,0,17,0]],F:[18,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11]],G:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,18,8,-1,-1,13,8,18,8]],H:[22,[4,21,4,0,-1,-1,18,21,18,0,-1,-1,4,11,18,11]],I:[8,[4,21,4,0]],J:[16,[12,21,12,5,11,2,10,1,8,0,6,0,4,1,3,2,2,5,2,7]],K:[21,[4,21,4,0,-1,-1,18,21,4,7,-1,-1,9,12,18,0]],L:[17,[4,21,4,0,-1,-1,4,0,16,0]],M:[24,[4,21,4,0,-1,-1,4,21,12,0,-1,-1,20,21,12,0,-1,-1,20,21,20,0]],N:[22,[4,21,4,0,-1,-1,4,21,18,0,-1,-1,18,21,18,0]],O:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21]],P:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,14,17,12,16,11,13,10,4,10]],Q:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21,-1,-1,12,4,18,-2]],R:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,4,11,-1,-1,11,11,18,0]],S:[20,[17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],T:[16,[8,21,8,0,-1,-1,1,21,15,21]],U:[22,[4,21,4,6,5,3,7,1,10,0,12,0,15,1,17,3,18,6,18,21]],V:[18,[1,21,9,0,-1,-1,17,21,9,0]],W:[24,[2,21,7,0,-1,-1,12,21,7,0,-1,-1,12,21,17,0,-1,-1,22,21,17,0]],X:[20,[3,21,17,0,-1,-1,17,21,3,0]],Y:[18,[1,21,9,11,9,0,-1,-1,17,21,9,11]],Z:[20,[17,21,3,0,-1,-1,3,21,17,21,-1,-1,3,0,17,0]],"[":[14,[4,25,4,-7,-1,-1,5,25,5,-7,-1,-1,4,25,11,25,-1,-1,4,-7,11,-7]],"\\":[14,[0,21,14,-3]],"]":[14,[9,25,9,-7,-1,-1,10,25,10,-7,-1,-1,3,25,10,25,-1,-1,3,-7,10,-7]],"^":[16,[6,15,8,18,10,15,-1,-1,3,12,8,17,13,12,-1,-1,8,17,8,0]],_:[16,[0,-2,16,-2]],"`":[10,[6,21,5,20,4,18,4,16,5,15,6,16,5,17]],a:[19,[15,14,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],b:[19,[4,21,4,0,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],c:[18,[15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],d:[19,[15,21,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],e:[18,[3,8,15,8,15,10,14,12,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],f:[12,[10,21,8,21,6,20,5,17,5,0,-1,-1,2,14,9,14]],g:[19,[15,14,15,-2,14,-5,13,-6,11,-7,8,-7,6,-6,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],h:[19,[4,21,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],i:[8,[3,21,4,20,5,21,4,22,3,21,-1,-1,4,14,4,0]],j:[10,[5,21,6,20,7,21,6,22,5,21,-1,-1,6,14,6,-3,5,-6,3,-7,1,-7]],k:[17,[4,21,4,0,-1,-1,14,14,4,4,-1,-1,8,8,15,0]],l:[8,[4,21,4,0]],m:[30,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0,-1,-1,15,10,18,13,20,14,23,14,25,13,26,10,26,0]],n:[19,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],o:[19,[8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3,16,6,16,8,15,11,13,13,11,14,8,14]],p:[19,[4,14,4,-7,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],q:[19,[15,14,15,-7,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],r:[13,[4,14,4,0,-1,-1,4,8,5,11,7,13,9,14,12,14]],s:[17,[14,11,13,13,10,14,7,14,4,13,3,11,4,9,6,8,11,7,13,6,14,4,14,3,13,1,10,0,7,0,4,1,3,3]],t:[12,[5,21,5,4,6,1,8,0,10,0,-1,-1,2,14,9,14]],u:[19,[4,14,4,4,5,1,7,0,10,0,12,1,15,4,-1,-1,15,14,15,0]],v:[16,[2,14,8,0,-1,-1,14,14,8,0]],w:[22,[3,14,7,0,-1,-1,11,14,7,0,-1,-1,11,14,15,0,-1,-1,19,14,15,0]],x:[17,[3,14,14,0,-1,-1,14,14,3,0]],y:[16,[2,14,8,0,-1,-1,14,14,8,0,6,-4,4,-6,2,-7,1,-7]],z:[17,[14,14,3,0,-1,-1,3,14,14,14,-1,-1,3,0,14,0]],"{":[14,[9,25,7,24,6,23,5,21,5,19,6,17,7,16,8,14,8,12,6,10,-1,-1,7,24,6,22,6,20,7,18,8,17,9,15,9,13,8,11,4,9,8,7,9,5,9,3,8,1,7,0,6,-2,6,-4,7,-6,-1,-1,6,8,8,6,8,4,7,2,6,1,5,-1,5,-3,6,-5,7,-6,9,-7]],"|":[8,[4,25,4,-7]],"}":[14,[5,25,7,24,8,23,9,21,9,19,8,17,7,16,6,14,6,12,8,10,-1,-1,7,24,8,22,8,20,7,18,6,17,5,15,5,13,6,11,10,9,6,7,5,5,5,3,6,1,7,0,8,-2,8,-4,7,-6,-1,-1,8,8,6,6,6,4,7,2,8,1,9,-1,9,-3,8,-5,7,-6,5,-7]],"~":[24,[3,6,3,8,4,11,6,12,8,12,10,11,14,8,16,7,18,7,20,8,21,10,-1,-1,3,8,4,10,6,11,8,11,10,10,14,7,16,6,18,6,20,7,21,10,21,12]]},sn={symbol:function(e,r,n,i,o){if("translucent"===e.renderPass){var a=St.disabled,s=e.colorModeForRenderPass();n.layout.get("text-variable-anchor")&&function(e,r,n,i,o,a,s){for(var u=r.transform,c="map"===o,l="map"===a,h=0,f=e;h<f.length;h+=1){var p=f[h],d=i.getTile(p),A=d.getBucket(n);if(A&&A.text&&A.text.segments.get().length){var g=A.textSizeData,m=t.evaluateSizeForZoom(g,u.zoom),y=ue(d,1,r.transform.zoom),v=Zt(p.posMatrix,l,c,r.transform,y),_="none"!==n.layout.get("icon-text-fit")&&A.hasIconData();if(m){var b=Math.pow(2,u.zoom-d.tileID.overscaledZ);Qr(A,c,l,s,t.symbolSize,u,v,p.posMatrix,b,m,_)}}}}(i,e,n,r,n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),o),0!==n.paint.get("icon-opacity").constantOr(1)&&Kr(e,r,n,i,!1,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),n.layout.get("icon-rotation-alignment"),n.layout.get("icon-pitch-alignment"),n.layout.get("icon-keep-upright"),a,s),0!==n.paint.get("text-opacity").constantOr(1)&&Kr(e,r,n,i,!0,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),n.layout.get("text-keep-upright"),a,s),r.map.showCollisionBoxes&&(qr(e,r,n,i,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),!0),qr(e,r,n,i,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),!1))}},circle:function(e,r,n,i){if("translucent"===e.renderPass){var o=n.paint.get("circle-opacity"),a=n.paint.get("circle-stroke-width"),s=n.paint.get("circle-stroke-opacity"),u=void 0!==n.layout.get("circle-sort-key").constantOr(1);if(0!==o.constantOr(1)||0!==a.constantOr(1)&&0!==s.constantOr(1)){for(var c=e.context,l=c.gl,h=e.depthModeForSublayer(0,Et.ReadOnly),f=St.disabled,p=e.colorModeForRenderPass(),d=[],A=0;A<i.length;A++){var g=i[A],m=r.getTile(g),y=m.getBucket(n);if(y){var v=y.programConfigurations.get(n.id),_={programConfiguration:v,program:e.useProgram("circle",v),layoutVertexBuffer:y.layoutVertexBuffer,indexBuffer:y.indexBuffer,uniformValues:xr(e,g,m,n)};if(u)for(var b=0,x=y.segments.get();b<x.length;b+=1){var w=x[b];d.push({segments:new t.SegmentVector([w]),sortKey:w.sortKey,state:_})}else d.push({segments:y.segments,sortKey:0,state:_})}}u&&d.sort((function(t,e){return t.sortKey-e.sortKey}));for(var E=0,S=d;E<S.length;E+=1){var O=S[E],T=O.state,P=T.programConfiguration,M=T.program,C=T.layoutVertexBuffer,I=T.indexBuffer,k=T.uniformValues,R=O.segments;M.draw(c,l.TRIANGLES,h,f,p,Tt.disabled,k,n.id,C,I,R,n.paint,e.transform.zoom,P)}}}},heatmap:function(e,r,n,i){if(0!==n.paint.get("heatmap-opacity"))if("offscreen"===e.renderPass){var o=e.context,a=o.gl,s=e.depthModeForSublayer(0,Et.ReadOnly),u=St.disabled,c=new Ot([a.ONE,a.ONE],t.Color.transparent,[!0,!0,!0,!0]);!function(t,e,r){var n=t.gl;t.activeTexture.set(n.TEXTURE1),t.viewport.set([0,0,e.width/4,e.height/4]);var i=r.heatmapFbo;if(i)n.bindTexture(n.TEXTURE_2D,i.colorAttachment.get()),t.bindFramebuffer.set(i.framebuffer);else{var o=n.createTexture();n.bindTexture(n.TEXTURE_2D,o),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),i=r.heatmapFbo=t.createFramebuffer(e.width/4,e.height/4),function t(e,r,n,i){var o=e.gl;o.texImage2D(o.TEXTURE_2D,0,o.RGBA,r.width/4,r.height/4,0,o.RGBA,e.extTextureHalfFloat?e.extTextureHalfFloat.HALF_FLOAT_OES:o.UNSIGNED_BYTE,null),i.colorAttachment.set(n),e.extTextureHalfFloat&&o.checkFramebufferStatus(o.FRAMEBUFFER)!==o.FRAMEBUFFER_COMPLETE&&(e.extTextureHalfFloat=null,i.colorAttachment.setDirty(),t(e,r,n,i))}(t,e,o,i)}}(o,e,n),o.clear({color:t.Color.transparent});for(var l=0;l<i.length;l++){var h=i[l];if(!r.hasRenderableParent(h)){var f=r.getTile(h),p=f.getBucket(n);if(p){var d=p.programConfigurations.get(n.id),A=e.useProgram("heatmap",d),g=e.transform.zoom;A.draw(o,a.TRIANGLES,s,u,c,Tt.disabled,Tr(h.posMatrix,f,g,n.paint.get("heatmap-intensity")),n.id,p.layoutVertexBuffer,p.indexBuffer,p.segments,n.paint,e.transform.zoom,d)}}}o.viewport.set([0,0,e.width,e.height])}else"translucent"===e.renderPass&&(e.context.setColorMode(e.colorModeForRenderPass()),function(e,r){var n=e.context,i=n.gl,o=r.heatmapFbo;if(o){n.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,o.colorAttachment.get()),n.activeTexture.set(i.TEXTURE1);var a=r.colorRampTexture;a||(a=r.colorRampTexture=new t.Texture(n,r.colorRamp,i.RGBA)),a.bind(i.LINEAR,i.CLAMP_TO_EDGE),e.useProgram("heatmapTexture").draw(n,i.TRIANGLES,Et.disabled,St.disabled,e.colorModeForRenderPass(),Tt.disabled,function(e,r,n,i){var o=t.create();t.ortho(o,0,e.width,e.height,0,0,1);var a=e.context.gl;return{u_matrix:o,u_world:[a.drawingBufferWidth,a.drawingBufferHeight],u_image:n,u_color_ramp:i,u_opacity:r.paint.get("heatmap-opacity")}}(e,r,0,1),r.id,e.viewportBuffer,e.quadTriangleIndexBuffer,e.viewportSegments,r.paint,e.transform.zoom)}}(e,n))},line:function(e,r,n,i){if("translucent"===e.renderPass){var o=n.paint.get("line-opacity"),a=n.paint.get("line-width");if(0!==o.constantOr(1)&&0!==a.constantOr(1)){var s=e.depthModeForSublayer(0,Et.ReadOnly),u=e.colorModeForRenderPass(),c=n.paint.get("line-dasharray"),l=n.paint.get("line-pattern"),h=l.constantOr(1),f=n.paint.get("line-gradient"),p=n.getCrossfadeParameters(),d=c?"lineSDF":h?"linePattern":f?"lineGradient":"line",A=e.context,g=A.gl,m=!0;if(f){A.activeTexture.set(g.TEXTURE0);var y=n.gradientTexture;if(!n.gradient)return;y||(y=n.gradientTexture=new t.Texture(A,n.gradient,g.RGBA)),y.bind(g.LINEAR,g.CLAMP_TO_EDGE)}for(var v=0,_=i;v<_.length;v+=1){var b=_[v],x=r.getTile(b);if(!h||x.patternsLoaded()){var w=x.getBucket(n);if(w){var E=w.programConfigurations.get(n.id),S=e.context.program.get(),O=e.useProgram(d,E),T=m||O.program!==S,P=l.constantOr(null);if(P&&x.imageAtlas){var M=x.imageAtlas,C=M.patternPositions[P.to.toString()],I=M.patternPositions[P.from.toString()];C&&I&&E.setConstantPatternPositions(C,I)}var k=c?kr(e,x,n,c,p):h?Ir(e,x,n,p):f?Cr(e,x,n):Mr(e,x,n);c&&(T||e.lineAtlas.dirty)?(A.activeTexture.set(g.TEXTURE0),e.lineAtlas.bind(A)):h&&(A.activeTexture.set(g.TEXTURE0),x.imageAtlasTexture.bind(g.LINEAR,g.CLAMP_TO_EDGE),E.updatePatternPaintBuffers(p)),O.draw(A,g.TRIANGLES,s,e.stencilModeForClipping(b),u,Tt.disabled,k,n.id,w.layoutVertexBuffer,w.indexBuffer,w.segments,n.paint,e.transform.zoom,E),m=!1}}}}}},fill:function(e,r,n,i){var o=n.paint.get("fill-color"),a=n.paint.get("fill-opacity");if(0!==a.constantOr(1)){var s=e.colorModeForRenderPass(),u=n.paint.get("fill-pattern"),c=e.opaquePassEnabledForLayer()&&!u.constantOr(1)&&1===o.constantOr(t.Color.transparent).a&&1===a.constantOr(0)?"opaque":"translucent";if(e.renderPass===c){var l=e.depthModeForSublayer(1,"opaque"===e.renderPass?Et.ReadWrite:Et.ReadOnly);Jr(e,r,n,i,l,s,!1)}if("translucent"===e.renderPass&&n.paint.get("fill-antialias")){var h=e.depthModeForSublayer(n.getPaintProperty("fill-outline-color")?2:0,Et.ReadOnly);Jr(e,r,n,i,h,s,!0)}}},"fill-extrusion":function(t,e,r,n){var i=r.paint.get("fill-extrusion-opacity");if(0!==i&&"translucent"===t.renderPass){var o=new Et(t.context.gl.LEQUAL,Et.ReadWrite,t.depthRangeFor3D);if(1!==i||r.paint.get("fill-extrusion-pattern").constantOr(1))tn(t,e,r,n,o,St.disabled,Ot.disabled),tn(t,e,r,n,o,t.stencilModeFor3D(),t.colorModeForRenderPass());else{var a=t.colorModeForRenderPass();tn(t,e,r,n,o,St.disabled,a)}}},hillshade:function(t,e,r,n){if("offscreen"===t.renderPass||"translucent"===t.renderPass){for(var i=t.context,o=e.getSource().maxzoom,a=t.depthModeForSublayer(0,Et.ReadOnly),s=St.disabled,u=t.colorModeForRenderPass(),c=0,l=n;c<l.length;c+=1){var h=l[c],f=e.getTile(h);f.needsHillshadePrepare&&"offscreen"===t.renderPass?rn(t,f,r,o,a,s,u):"translucent"===t.renderPass&&en(t,f,r,a,s,u)}i.viewport.set([0,0,t.width,t.height])}},raster:function(t,e,r,n){if("translucent"===t.renderPass&&0!==r.paint.get("raster-opacity"))for(var i=t.context,o=i.gl,a=e.getSource(),s=t.useProgram("raster"),u=St.disabled,c=t.colorModeForRenderPass(),l=n.length&&n[0].overscaledZ,h=!t.options.moving,f=0,p=n;f<p.length;f+=1){var d=p[f],A=t.depthModeForSublayer(d.overscaledZ-l,1===r.paint.get("raster-opacity")?Et.ReadWrite:Et.ReadOnly,o.LESS),g=e.getTile(d),m=t.transform.calculatePosMatrix(d.toUnwrapped(),h);g.registerFadeDuration(r.paint.get("raster-fade-duration"));var y=e.findLoadedParent(d,0),v=nn(g,y,e,r,t.transform),_=void 0,b=void 0,x="nearest"===r.paint.get("raster-resampling")?o.NEAREST:o.LINEAR;i.activeTexture.set(o.TEXTURE0),g.texture.bind(x,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST),i.activeTexture.set(o.TEXTURE1),y?(y.texture.bind(x,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST),_=Math.pow(2,y.tileID.overscaledZ-g.tileID.overscaledZ),b=[g.tileID.canonical.x*_%1,g.tileID.canonical.y*_%1]):g.texture.bind(x,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST);var w=jr(m,b||[0,0],_||1,v,r);a instanceof I?s.draw(i,o.TRIANGLES,A,u,c,Tt.disabled,w,r.id,a.boundsBuffer,t.quadTriangleIndexBuffer,a.boundsSegments):g.maskedBoundsBuffer&&g.maskedIndexBuffer&&g.segments?s.draw(i,o.TRIANGLES,A,u,c,Tt.disabled,w,r.id,g.maskedBoundsBuffer,g.maskedIndexBuffer,g.segments,r.paint,t.transform.zoom):s.draw(i,o.TRIANGLES,A,u,c,Tt.disabled,w,r.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}},background:function(t,e,r){var n=r.paint.get("background-color"),i=r.paint.get("background-opacity");if(0!==i){var o=t.context,a=o.gl,s=t.transform,u=s.tileSize,c=r.paint.get("background-pattern");if(!t.isPatternMissing(c)){var l=!c&&1===n.a&&1===i&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(t.renderPass===l){var h=St.disabled,f=t.depthModeForSublayer(0,"opaque"===l?Et.ReadWrite:Et.ReadOnly),p=t.colorModeForRenderPass(),d=t.useProgram(c?"backgroundPattern":"background"),A=s.coveringTiles({tileSize:u});c&&(o.activeTexture.set(a.TEXTURE0),t.imageManager.bind(t.context));for(var g=r.getCrossfadeParameters(),m=0,y=A;m<y.length;m+=1){var v=y[m],_=t.transform.calculatePosMatrix(v.toUnwrapped()),b=c?Ur(_,i,t,c,{tileID:v,tileSize:u},g):Nr(_,i,n);d.draw(o,a.TRIANGLES,f,h,p,Tt.disabled,b,r.id,t.tileExtentBuffer,t.quadTriangleIndexBuffer,t.tileExtentSegments)}}}}},debug:function(t,e,r){for(var n=0;n<r.length;n++)on(t,e,r[n])},custom:function(t,e,r){var n=t.context,i=r.implementation;if("offscreen"===t.renderPass){var o=i.prerender;o&&(t.setCustomLayerDefaults(),n.setColorMode(t.colorModeForRenderPass()),o.call(i,n.gl,t.transform.customLayerMatrix()),n.setDirty(),t.setBaseState())}else if("translucent"===t.renderPass){t.setCustomLayerDefaults(),n.setColorMode(t.colorModeForRenderPass()),n.setStencilMode(St.disabled);var a="3d"===i.renderingMode?new Et(t.context.gl.LEQUAL,Et.ReadWrite,t.depthRangeFor3D):t.depthModeForSublayer(0,Et.ReadOnly);n.setDepthMode(a),i.render(n.gl,t.transform.customLayerMatrix()),n.setDirty(),t.setBaseState(),n.bindFramebuffer.set(null)}}},un=function(e,r){this.context=new Pt(e),this.transform=r,this._tileTextures={},this.setup(),this.numSublayers=Mt.maxUnderzooming+Mt.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.depthRboNeedsClear=!0,this.emptyProgramConfiguration=new t.ProgramConfiguration,this.crossTileSymbolIndex=new Re,this.gpuTimers={}};function cn(t,e){if(t.y>e.y){var r=t;t=e,e=r}return{x0:t.x,y0:t.y,x1:e.x,y1:e.y,dx:e.x-t.x,dy:e.y-t.y}}function ln(t,e,r,n,i){var o=Math.max(r,Math.floor(e.y0)),a=Math.min(n,Math.ceil(e.y1));if(t.x0===e.x0&&t.y0===e.y0?t.x0+e.dy/t.dy*t.dx<e.x1:t.x1-e.dy/t.dy*t.dx<e.x0){var s=t;t=e,e=s}for(var u=t.dx/t.dy,c=e.dx/e.dy,l=t.dx>0,h=e.dx<0,f=o;f<a;f++){var p=u*Math.max(0,Math.min(t.dy,f+l-t.y0))+t.x0,d=c*Math.max(0,Math.min(e.dy,f+h-e.y0))+e.x0;i(Math.floor(d),Math.ceil(p),f)}}function hn(t,e,r,n,i,o){var a,s=cn(t,e),u=cn(e,r),c=cn(r,t);s.dy>u.dy&&(a=s,s=u,u=a),s.dy>c.dy&&(a=s,s=c,c=a),u.dy>c.dy&&(a=u,u=c,c=a),s.dy&&ln(c,s,n,i,o),u.dy&&ln(c,u,n,i,o)}un.prototype.resize=function(e,r){var n=this.context.gl;if(this.width=e*t.browser.devicePixelRatio,this.height=r*t.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var i=0,o=this.style._order;i<o.length;i+=1){var a=o[i];this.style._layers[a].resize()}this.depthRbo&&(n.deleteRenderbuffer(this.depthRbo),this.depthRbo=null)},un.prototype.setup=function(){var e=this.context,r=new t.StructArrayLayout2i4;r.emplaceBack(0,0),r.emplaceBack(t.EXTENT,0),r.emplaceBack(0,t.EXTENT),r.emplaceBack(t.EXTENT,t.EXTENT),this.tileExtentBuffer=e.createVertexBuffer(r,Fe.members),this.tileExtentSegments=t.SegmentVector.simpleSegment(0,0,4,2);var n=new t.StructArrayLayout2i4;n.emplaceBack(0,0),n.emplaceBack(t.EXTENT,0),n.emplaceBack(0,t.EXTENT),n.emplaceBack(t.EXTENT,t.EXTENT),this.debugBuffer=e.createVertexBuffer(n,Fe.members),this.debugSegments=t.SegmentVector.simpleSegment(0,0,4,5);var i=new t.StructArrayLayout4i8;i.emplaceBack(0,0,0,0),i.emplaceBack(t.EXTENT,0,t.EXTENT,0),i.emplaceBack(0,t.EXTENT,0,t.EXTENT),i.emplaceBack(t.EXTENT,t.EXTENT,t.EXTENT,t.EXTENT),this.rasterBoundsBuffer=e.createVertexBuffer(i,t.rasterBoundsAttributes.members),this.rasterBoundsSegments=t.SegmentVector.simpleSegment(0,0,4,2);var o=new t.StructArrayLayout2i4;o.emplaceBack(0,0),o.emplaceBack(1,0),o.emplaceBack(0,1),o.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(o,Fe.members),this.viewportSegments=t.SegmentVector.simpleSegment(0,0,4,2);var a=new t.StructArrayLayout1ui2;a.emplaceBack(0),a.emplaceBack(1),a.emplaceBack(3),a.emplaceBack(2),a.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(a);var s=new t.StructArrayLayout3ui6;s.emplaceBack(0,1,2),s.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(s);var u=this.context.gl;this.stencilClearMode=new St({func:u.ALWAYS,mask:0},0,255,u.ZERO,u.ZERO,u.ZERO)},un.prototype.clearStencil=function(){var e=this.context,r=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var n=t.create();t.ortho(n,0,this.width,this.height,0,0,1),t.scale(n,n,[r.drawingBufferWidth,r.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(e,r.TRIANGLES,Et.disabled,this.stencilClearMode,Ot.disabled,Tt.disabled,Or(n),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},un.prototype._renderTileClippingMasks=function(t,e){if(this.currentStencilSource!==t.source&&t.isTileClipped()&&e&&e.length){this.currentStencilSource=t.source;var r=this.context,n=r.gl;this.nextStencilID+e.length>256&&this.clearStencil(),r.setColorMode(Ot.disabled),r.setDepthMode(Et.disabled);var i=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var o=0,a=e;o<a.length;o+=1){var s=a[o],u=this._tileClippingMaskIDs[s.key]=this.nextStencilID++;i.draw(r,n.TRIANGLES,Et.disabled,new St({func:n.ALWAYS,mask:0},u,255,n.KEEP,n.KEEP,n.REPLACE),Ot.disabled,Tt.disabled,Or(s.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}},un.prototype.stencilModeFor3D=function(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();var t=this.nextStencilID++,e=this.context.gl;return new St({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)},un.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new St({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},un.prototype.colorModeForRenderPass=function(){var e=this.context.gl;return this._showOverdrawInspector?new Ot([e.CONSTANT_COLOR,e.ONE],new t.Color(1/8,1/8,1/8,0),[!0,!0,!0,!0]):"opaque"===this.renderPass?Ot.unblended:Ot.alphaBlended},un.prototype.depthModeForSublayer=function(t,e,r){if(!this.opaquePassEnabledForLayer())return Et.disabled;var n=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new Et(r||this.context.gl.LEQUAL,e,[n,n])},un.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},un.prototype.render=function(e,r){var n=this;this.style=e,this.options=r,this.lineAtlas=e.lineAtlas,this.imageManager=e.imageManager,this.glyphManager=e.glyphManager,this.symbolFadeChange=e.placement.symbolFadeChange(t.browser.now()),this.imageManager.beginFrame();var i=this.style._order,o=this.style.sourceCaches;for(var a in o){var s=o[a];s.used&&s.prepare(this.context)}var u,c,l={},h={},f={};for(var p in o){var d=o[p];l[p]=d.getVisibleCoordinates(),h[p]=l[p].slice().reverse(),f[p]=d.getVisibleCoordinates(!0).reverse()}for(var A in o){var g=o[A],m=g.getSource();if("raster"===m.type||"raster-dem"===m.type){for(var y=[],v=0,_=l[A];v<_.length;v+=1){var b=_[v];y.push(g.getTile(b))}Gr(y,this.context)}}this.opaquePassCutoff=1/0;for(var x=0;x<i.length;x++){var w=i[x];if(this.style._layers[w].is3D()){this.opaquePassCutoff=x;break}}this.renderPass="offscreen",this.depthRboNeedsClear=!0;for(var E=0,S=i;E<S.length;E+=1){var O=S[E],T=this.style._layers[O];if(T.hasOffscreenPass()&&!T.isHidden(this.transform.zoom)){var P=h[T.source];("custom"===T.type||P.length)&&this.renderLayer(this,o[T.source],T,P)}}for(this.context.bindFramebuffer.set(null),this.context.clear({color:r.showOverdrawInspector?t.Color.black:t.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=r.showOverdrawInspector,this.depthRangeFor3D=[0,1-(e._order.length+2)*this.numSublayers*this.depthEpsilon],this.renderPass="opaque",this.currentLayer=i.length-1;this.currentLayer>=0;this.currentLayer--){var M=this.style._layers[i[this.currentLayer]],C=o[M.source],I=l[M.source];this._renderTileClippingMasks(M,I),this.renderLayer(this,C,M,I)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<i.length;this.currentLayer++){var k=this.style._layers[i[this.currentLayer]],R=o[k.source],L=("symbol"===k.type?f:h)[k.source];this._renderTileClippingMasks(k,l[k.source]),this.renderLayer(this,R,k,L)}this.options.showTileBoundaries&&(t.values(this.style._layers).forEach((function(t){t.source&&!t.isHidden(n.transform.zoom)&&(t.source!==(c&&c.id)&&(c=n.style.sourceCaches[t.source]),(!u||u.getSource().maxzoom<c.getSource().maxzoom)&&(u=c))})),u&&sn.debug(this,u,u.getVisibleCoordinates())),this.context.setDefault()},un.prototype.setupOffscreenDepthRenderbuffer=function(){var t=this.context;this.depthRbo||(this.depthRbo=t.createRenderbuffer(t.gl.DEPTH_COMPONENT16,this.width,this.height))},un.prototype.renderLayer=function(t,e,r,n){r.isHidden(this.transform.zoom)||("background"===r.type||"custom"===r.type||n.length)&&(this.id=r.id,this.gpuTimingStart(r),sn[r.type](t,e,r,n,this.style.placement.variableOffsets),this.gpuTimingEnd())},un.prototype.gpuTimingStart=function(t){if(this.options.gpuTiming){var e=this.context.extTimerQuery,r=this.gpuTimers[t.id];r||(r=this.gpuTimers[t.id]={calls:0,cpuTime:0,query:e.createQueryEXT()}),r.calls++,e.beginQueryEXT(e.TIME_ELAPSED_EXT,r.query)}},un.prototype.gpuTimingEnd=function(){if(this.options.gpuTiming){var t=this.context.extTimerQuery;t.endQueryEXT(t.TIME_ELAPSED_EXT)}},un.prototype.collectGpuTimers=function(){var t=this.gpuTimers;return this.gpuTimers={},t},un.prototype.queryGpuTimers=function(t){var e={};for(var r in t){var n=t[r],i=this.context.extTimerQuery,o=i.getQueryObjectEXT(n.query,i.QUERY_RESULT_EXT)/1e6;i.deleteQueryEXT(n.query),e[r]=o}return e},un.prototype.translatePosMatrix=function(e,r,n,i,o){if(!n[0]&&!n[1])return e;var a=o?"map"===i?this.transform.angle:0:"viewport"===i?-this.transform.angle:0;if(a){var s=Math.sin(a),u=Math.cos(a);n=[n[0]*u-n[1]*s,n[0]*s+n[1]*u]}var c=[o?n[0]:ue(r,n[0],this.transform.zoom),o?n[1]:ue(r,n[1],this.transform.zoom),0],l=new Float32Array(16);return t.translate(l,e,c),l},un.prototype.saveTileTexture=function(t){var e=this._tileTextures[t.size[0]];e?e.push(t):this._tileTextures[t.size[0]]=[t]},un.prototype.getTileTexture=function(t){var e=this._tileTextures[t];return e&&e.length>0?e.pop():null},un.prototype.isPatternMissing=function(t){if(!t)return!1;var e=this.imageManager.getPattern(t.from.toString()),r=this.imageManager.getPattern(t.to.toString());return!e||!r},un.prototype.useProgram=function(t,e){void 0===e&&(e=this.emptyProgramConfiguration),this.cache=this.cache||{};var r=""+t+(e.cacheKey||"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=new dr(this.context,fr[t],e,Vr[t],this._showOverdrawInspector)),this.cache[r]},un.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},un.prototype.setBaseState=function(){var t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)};var fn=function(e,r,n,i,o){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===o||o,this._minZoom=e||0,this._maxZoom=r||22,this._minPitch=null==n?0:n,this._maxPitch=null==i?60:i,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._posMatrixCache={},this._alignedPosMatrixCache={}},pn={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerPoint:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};fn.prototype.clone=function(){var t=new fn(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.tileSize=this.tileSize,t.latRange=this.latRange,t.width=this.width,t.height=this.height,t._center=this._center,t.zoom=this.zoom,t.angle=this.angle,t._fov=this._fov,t._pitch=this._pitch,t._unmodified=this._unmodified,t._calcMatrices(),t},pn.minZoom.get=function(){return this._minZoom},pn.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},pn.maxZoom.get=function(){return this._maxZoom},pn.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},pn.minPitch.get=function(){return this._minPitch},pn.minPitch.set=function(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))},pn.maxPitch.get=function(){return this._maxPitch},pn.maxPitch.set=function(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))},pn.renderWorldCopies.get=function(){return this._renderWorldCopies},pn.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},pn.worldSize.get=function(){return this.tileSize*this.scale},pn.centerPoint.get=function(){return this.size._div(2)},pn.size.get=function(){return new t.Point(this.width,this.height)},pn.bearing.get=function(){return-this.angle/Math.PI*180},pn.bearing.set=function(e){var r=-t.wrap(e,-180,180)*Math.PI/180;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=t.create$2(),t.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},pn.pitch.get=function(){return this._pitch/Math.PI*180},pn.pitch.set=function(e){var r=t.clamp(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices())},pn.fov.get=function(){return this._fov/Math.PI*180},pn.fov.set=function(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())},pn.zoom.get=function(){return this._zoom},pn.zoom.set=function(t){var e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom,this._constrain(),this._calcMatrices())},pn.center.get=function(){return this._center},pn.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},fn.prototype.coveringZoomLevel=function(t){var e=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,e)},fn.prototype.getVisibleUnwrappedCoordinates=function(e){var r=[new t.UnwrappedTileID(0,e)];if(this._renderWorldCopies)for(var n=this.pointCoordinate(new t.Point(0,0)),i=this.pointCoordinate(new t.Point(this.width,0)),o=this.pointCoordinate(new t.Point(this.width,this.height)),a=this.pointCoordinate(new t.Point(0,this.height)),s=Math.floor(Math.min(n.x,i.x,o.x,a.x)),u=Math.floor(Math.max(n.x,i.x,o.x,a.x)),c=s-1;c<=u+1;c++)0!==c&&r.push(new t.UnwrappedTileID(c,e));return r},fn.prototype.coveringTiles=function(e){var r=this.coveringZoomLevel(e),n=r;if(void 0!==e.minzoom&&r<e.minzoom)return[];void 0!==e.maxzoom&&r>e.maxzoom&&(r=e.maxzoom);var i=t.MercatorCoordinate.fromLngLat(this.center),o=Math.pow(2,r),a=new t.Point(o*i.x-.5,o*i.y-.5);return function(e,r,n,i){void 0===i&&(i=!0);var o=1<<e,a={};function s(r,s,u){var c,l,h,f;if(u>=0&&u<=o)for(c=r;c<s;c++)l=Math.floor(c/o),h=(c%o+o)%o,0!==l&&!0!==i||(f=new t.OverscaledTileID(n,l,e,h,u),a[f.key]=f)}var u=r.map((function(e){return new t.Point(e.x,e.y)._mult(o)}));return hn(u[0],u[1],u[2],0,o,s),hn(u[2],u[3],u[0],0,o,s),Object.keys(a).map((function(t){return a[t]}))}(r,[this.pointCoordinate(new t.Point(0,0)),this.pointCoordinate(new t.Point(this.width,0)),this.pointCoordinate(new t.Point(this.width,this.height)),this.pointCoordinate(new t.Point(0,this.height))],e.reparseOverscaled?n:r,this._renderWorldCopies).sort((function(t,e){return a.dist(t.canonical)-a.dist(e.canonical)}))},fn.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},pn.unmodified.get=function(){return this._unmodified},fn.prototype.zoomScale=function(t){return Math.pow(2,t)},fn.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},fn.prototype.project=function(e){var r=t.clamp(e.lat,-this.maxValidLatitude,this.maxValidLatitude);return new t.Point(t.mercatorXfromLng(e.lng)*this.worldSize,t.mercatorYfromLat(r)*this.worldSize)},fn.prototype.unproject=function(e){return new t.MercatorCoordinate(e.x/this.worldSize,e.y/this.worldSize).toLngLat()},pn.point.get=function(){return this.project(this.center)},fn.prototype.setLocationAtPoint=function(e,r){var n=this.pointCoordinate(r),i=this.pointCoordinate(this.centerPoint),o=this.locationCoordinate(e),a=new t.MercatorCoordinate(o.x-(n.x-i.x),o.y-(n.y-i.y));this.center=this.coordinateLocation(a),this._renderWorldCopies&&(this.center=this.center.wrap())},fn.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},fn.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},fn.prototype.locationCoordinate=function(e){return t.MercatorCoordinate.fromLngLat(e)},fn.prototype.coordinateLocation=function(t){return t.toLngLat()},fn.prototype.pointCoordinate=function(e){var r=[e.x,e.y,0,1],n=[e.x,e.y,1,1];t.transformMat4(r,r,this.pixelMatrixInverse),t.transformMat4(n,n,this.pixelMatrixInverse);var i=r[3],o=n[3],a=r[0]/i,s=n[0]/o,u=r[1]/i,c=n[1]/o,l=r[2]/i,h=n[2]/o,f=l===h?0:(0-l)/(h-l);return new t.MercatorCoordinate(t.number(a,s,f)/this.worldSize,t.number(u,c,f)/this.worldSize)},fn.prototype.coordinatePoint=function(e){var r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix),new t.Point(r[0]/r[3],r[1]/r[3])},fn.prototype.getBounds=function(){return(new t.LngLatBounds).extend(this.pointLocation(new t.Point(0,0))).extend(this.pointLocation(new t.Point(this.width,0))).extend(this.pointLocation(new t.Point(this.width,this.height))).extend(this.pointLocation(new t.Point(0,this.height)))},fn.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new t.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},fn.prototype.setMaxBounds=function(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},fn.prototype.calculatePosMatrix=function(e,r){void 0===r&&(r=!1);var n=e.key,i=r?this._alignedPosMatrixCache:this._posMatrixCache;if(i[n])return i[n];var o=e.canonical,a=this.worldSize/this.zoomScale(o.z),s=o.x+Math.pow(2,o.z)*e.wrap,u=t.identity(new Float64Array(16));return t.translate(u,u,[s*a,o.y*a,0]),t.scale(u,u,[a/t.EXTENT,a/t.EXTENT,1]),t.multiply(u,r?this.alignedProjMatrix:this.projMatrix,u),i[n]=new Float32Array(u),i[n]},fn.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},fn.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var e,r,n,i,o=-90,a=90,s=-180,u=180,c=this.size,l=this._unmodified;if(this.latRange){var h=this.latRange;o=t.mercatorYfromLat(h[1])*this.worldSize,e=(a=t.mercatorYfromLat(h[0])*this.worldSize)-o<c.y?c.y/(a-o):0}if(this.lngRange){var f=this.lngRange;s=t.mercatorXfromLng(f[0])*this.worldSize,r=(u=t.mercatorXfromLng(f[1])*this.worldSize)-s<c.x?c.x/(u-s):0}var p=this.point,d=Math.max(r||0,e||0);if(d)return this.center=this.unproject(new t.Point(r?(u+s)/2:p.x,e?(a+o)/2:p.y)),this.zoom+=this.scaleZoom(d),this._unmodified=l,void(this._constraining=!1);if(this.latRange){var A=p.y,g=c.y/2;A-g<o&&(i=o+g),A+g>a&&(i=a-g)}if(this.lngRange){var m=p.x,y=c.x/2;m-y<s&&(n=s+y),m+y>u&&(n=u-y)}void 0===n&&void 0===i||(this.center=this.unproject(new t.Point(void 0!==n?n:p.x,void 0!==i?i:p.y))),this._unmodified=l,this._constraining=!1}},fn.prototype._calcMatrices=function(){if(this.height){this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var e=this._fov/2,r=Math.PI/2+this._pitch,n=Math.sin(e)*this.cameraToCenterDistance/Math.sin(Math.PI-r-e),i=this.point,o=i.x,a=i.y,s=1.01*(Math.cos(Math.PI/2-this._pitch)*n+this.cameraToCenterDistance),u=this.height/50,c=new Float64Array(16);t.perspective(c,this._fov,this.width/this.height,u,s),t.scale(c,c,[1,-1,1]),t.translate(c,c,[0,0,-this.cameraToCenterDistance]),t.rotateX(c,c,this._pitch),t.rotateZ(c,c,this.angle),t.translate(c,c,[-o,-a,0]),this.mercatorMatrix=t.scale([],c,[this.worldSize,this.worldSize,this.worldSize]),t.scale(c,c,[1,1,t.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=c;var l=this.width%2/2,h=this.height%2/2,f=Math.cos(this.angle),p=Math.sin(this.angle),d=o-Math.round(o)+f*l+p*h,A=a-Math.round(a)+f*h+p*l,g=new Float64Array(c);if(t.translate(g,g,[d>.5?d-1:d,A>.5?A-1:A,0]),this.alignedProjMatrix=g,c=t.create(),t.scale(c,c,[this.width/2,-this.height/2,1]),t.translate(c,c,[1,-1,0]),this.labelPlaneMatrix=c,c=t.create(),t.scale(c,c,[1,-1,1]),t.translate(c,c,[-1,-1,0]),t.scale(c,c,[2/this.width,2/this.height,1]),this.glCoordMatrix=c,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(c=t.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=c,this._posMatrixCache={},this._alignedPosMatrixCache={}}},fn.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var e=this.pointCoordinate(new t.Point(0,0)),r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance},fn.prototype.getCameraPoint=function(){var e=this._pitch,r=Math.tan(e)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,r))},fn.prototype.getCameraQueryGeometry=function(e){var r=this.getCameraPoint();if(1===e.length)return[e[0],r];for(var n=r.x,i=r.y,o=r.x,a=r.y,s=0,u=e;s<u.length;s+=1){var c=u[s];n=Math.min(n,c.x),i=Math.min(i,c.y),o=Math.max(o,c.x),a=Math.max(a,c.y)}return[new t.Point(n,i),new t.Point(o,i),new t.Point(o,a),new t.Point(n,a),new t.Point(n,i)]},Object.defineProperties(fn.prototype,pn);var dn=function(e){var r,n,i,o;this._hashName=e&&encodeURIComponent(e),t.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=(r=this._updateHashUnthrottled.bind(this),n=!1,i=null,o=function(){i=null,n&&(r(),i=setTimeout(o,300),n=!1)},function(){return n=!0,i||o(),i})};dn.prototype.addTo=function(e){return this._map=e,t.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},dn.prototype.remove=function(){return t.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},dn.prototype.getHashString=function(e){var r=this._map.getCenter(),n=Math.round(100*this._map.getZoom())/100,i=Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10),o=Math.pow(10,i),a=Math.round(r.lng*o)/o,s=Math.round(r.lat*o)/o,u=this._map.getBearing(),c=this._map.getPitch(),l="";if(l+=e?"/"+a+"/"+s+"/"+n:n+"/"+s+"/"+a,(u||c)&&(l+="/"+Math.round(10*u)/10),c&&(l+="/"+Math.round(c)),this._hashName){var h=this._hashName,f=!1,p=t.window.location.hash.slice(1).split("&").map((function(t){var e=t.split("=")[0];return e===h?(f=!0,e+"="+l):t})).filter((function(t){return t}));return f||p.push(h+"="+l),"#"+p.join("&")}return"#"+l},dn.prototype._getCurrentHash=function(){var e,r=this,n=t.window.location.hash.replace("#","");return this._hashName?(n.split("&").map((function(t){return t.split("=")})).forEach((function(t){t[0]===r._hashName&&(e=t)})),(e&&e[1]||"").split("/")):n.split("/")},dn.prototype._onHashChange=function(){var t=this._getCurrentHash();return t.length>=3&&!t.some((function(t){return isNaN(t)}))&&(this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:+(t[3]||0),pitch:+(t[4]||0)}),!0)},dn.prototype._updateHashUnthrottled=function(){var e=this.getHashString();try{t.window.history.replaceState(t.window.history.state,"",e)}catch(t){}};var An=function(e){function n(n,i,o,a){void 0===a&&(a={});var s=r.mousePos(i.getCanvasContainer(),o),u=i.unproject(s);e.call(this,n,t.extend({point:s,lngLat:u,originalEvent:o},a)),this._defaultPrevented=!1,this.target=i}e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n;var i={defaultPrevented:{configurable:!0}};return n.prototype.preventDefault=function(){this._defaultPrevented=!0},i.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(n.prototype,i),n}(t.Event),gn=function(e){function n(n,i,o){var a=r.touchPos(i.getCanvasContainer(),o),s=a.map((function(t){return i.unproject(t)})),u=a.reduce((function(t,e,r,n){return t.add(e.div(n.length))}),new t.Point(0,0)),c=i.unproject(u);e.call(this,n,{points:a,point:u,lngLats:s,lngLat:c,originalEvent:o}),this._defaultPrevented=!1}e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n;var i={defaultPrevented:{configurable:!0}};return n.prototype.preventDefault=function(){this._defaultPrevented=!0},i.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(n.prototype,i),n}(t.Event),mn=function(t){function e(e,r,n){t.call(this,e,{originalEvent:n}),this._defaultPrevented=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={defaultPrevented:{configurable:!0}};return e.prototype.preventDefault=function(){this._defaultPrevented=!0},r.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(e.prototype,r),e}(t.Event),yn=function(e){this._map=e,this._el=e.getCanvasContainer(),this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,t.bindAll(["_onWheel","_onTimeout","_onScrollFrame","_onScrollFinished"],this)};yn.prototype.setZoomRate=function(t){this._defaultZoomRate=t},yn.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t},yn.prototype.isEnabled=function(){return!!this._enabled},yn.prototype.isActive=function(){return!!this._active},yn.prototype.isZooming=function(){return!!this._zooming},yn.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},yn.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},yn.prototype.onWheel=function(e){if(this.isEnabled()){var r=e.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,n=t.browser.now(),i=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,0!==r&&r%4.000244140625==0?this._type="wheel":0!==r&&Math.abs(r)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(i*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),e.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=e,this._delta-=r,this.isActive()||this._start(e)),e.preventDefault()}},yn.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this.isActive()||this._start(t)},yn.prototype._start=function(e){if(this._delta){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0,this._map.fire(new t.Event("movestart",{originalEvent:e})),this._map.fire(new t.Event("zoomstart",{originalEvent:e}))),this._finishTimeout&&clearTimeout(this._finishTimeout);var n=r.mousePos(this._el,e);this._around=t.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(n)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onScrollFrame))}},yn.prototype._onScrollFrame=function(){var e=this;if(this._frameId=null,this.isActive()){var r=this._map.transform;if(0!==this._delta){var n="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,i=2/(1+Math.exp(-Math.abs(this._delta*n)));this._delta<0&&0!==i&&(i=1/i);var o="number"==typeof this._targetZoom?r.zoomScale(this._targetZoom):r.scale;this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(o*i))),"wheel"===this._type&&(this._startZoom=r.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var a="number"==typeof this._targetZoom?this._targetZoom:r.zoom,s=this._startZoom,u=this._easing,c=!1;if("wheel"===this._type&&s&&u){var l=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),h=u(l);r.zoom=t.number(s,a,h),l<1?this._frameId||(this._frameId=this._map._requestRenderFrame(this._onScrollFrame)):c=!0}else r.zoom=a,c=!0;r.setLocationAtPoint(this._around,this._aroundPoint),this._map.fire(new t.Event("move",{originalEvent:this._lastWheelEvent})),this._map.fire(new t.Event("zoom",{originalEvent:this._lastWheelEvent})),c&&(this._active=!1,this._finishTimeout=setTimeout((function(){e._zooming=!1,e._map.fire(new t.Event("zoomend",{originalEvent:e._lastWheelEvent})),e._map.fire(new t.Event("moveend",{originalEvent:e._lastWheelEvent})),delete e._targetZoom}),200))}},yn.prototype._smoothOutEasing=function(e){var r=t.ease;if(this._prevEase){var n=this._prevEase,i=(t.browser.now()-n.start)/n.duration,o=n.easing(i+.01)-n.easing(i),a=.27/Math.sqrt(o*o+1e-4)*.01,s=Math.sqrt(.0729-a*a);r=t.bezier(a,s,.25,1)}return this._prevEase={start:t.browser.now(),duration:e,easing:r},r};var vn=function(e,r){this._map=e,this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=r.clickTolerance||1,t.bindAll(["_onMouseMove","_onMouseUp","_onKeyDown"],this)};vn.prototype.isEnabled=function(){return!!this._enabled},vn.prototype.isActive=function(){return!!this._active},vn.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},vn.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},vn.prototype.onMouseDown=function(e){this.isEnabled()&&e.shiftKey&&0===e.button&&(t.window.document.addEventListener("mousemove",this._onMouseMove,!1),t.window.document.addEventListener("keydown",this._onKeyDown,!1),t.window.document.addEventListener("mouseup",this._onMouseUp,!1),r.disableDrag(),this._startPos=this._lastPos=r.mousePos(this._el,e),this._active=!0)},vn.prototype._onMouseMove=function(t){var e=r.mousePos(this._el,t);if(!(this._lastPos.equals(e)||!this._box&&e.dist(this._startPos)<this._clickTolerance)){var n=this._startPos;this._lastPos=e,this._box||(this._box=r.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var i=Math.min(n.x,e.x),o=Math.max(n.x,e.x),a=Math.min(n.y,e.y),s=Math.max(n.y,e.y);r.setTransform(this._box,"translate("+i+"px,"+a+"px)"),this._box.style.width=o-i+"px",this._box.style.height=s-a+"px"}},vn.prototype._onMouseUp=function(e){if(0===e.button){var n=this._startPos,i=r.mousePos(this._el,e);this._finish(),r.suppressClick(),n.x===i.x&&n.y===i.y?this._fireEvent("boxzoomcancel",e):this._map.fitScreenCoordinates(n,i,this._map.getBearing(),{linear:!0}).fire(new t.Event("boxzoomend",{originalEvent:e}))}},vn.prototype._onKeyDown=function(t){27===t.keyCode&&(this._finish(),this._fireEvent("boxzoomcancel",t))},vn.prototype._finish=function(){this._active=!1,t.window.document.removeEventListener("mousemove",this._onMouseMove,!1),t.window.document.removeEventListener("keydown",this._onKeyDown,!1),t.window.document.removeEventListener("mouseup",this._onMouseUp,!1),this._container.classList.remove("mapboxgl-crosshair"),this._box&&(r.remove(this._box),this._box=null),r.enableDrag(),delete this._startPos,delete this._lastPos},vn.prototype._fireEvent=function(e,r){return this._map.fire(new t.Event(e,{originalEvent:r}))};var _n=t.bezier(0,0,.25,1),bn=function(e,r){this._map=e,this._el=r.element||e.getCanvasContainer(),this._state="disabled",this._button=r.button||"right",this._bearingSnap=r.bearingSnap||0,this._pitchWithRotate=!1!==r.pitchWithRotate,t.bindAll(["onMouseDown","_onMouseMove","_onMouseUp","_onBlur","_onDragFrame"],this)};bn.prototype.isEnabled=function(){return"disabled"!==this._state},bn.prototype.isActive=function(){return"active"===this._state},bn.prototype.enable=function(){this.isEnabled()||(this._state="enabled")},bn.prototype.disable=function(){if(this.isEnabled())switch(this._state){case"active":this._state="disabled",this._unbind(),this._deactivate(),this._fireEvent("rotateend"),this._pitchWithRotate&&this._fireEvent("pitchend"),this._fireEvent("moveend");break;case"pending":this._state="disabled",this._unbind();break;default:this._state="disabled"}},bn.prototype.onMouseDown=function(e){if("enabled"===this._state){var n="touchstart"===e.type;if(n)this._startTime=Date.now();else if("right"===this._button){if(this._eventButton=r.mouseButton(e),this._eventButton!==(e.ctrlKey?0:2))return}else{if(e.ctrlKey||0!==r.mouseButton(e))return;this._eventButton=0}r.disableDrag(),n?(t.window.document.addEventListener("touchmove",this._onMouseMove,{capture:!0}),t.window.document.addEventListener("touchend",this._onMouseUp)):(t.window.document.addEventListener("mousemove",this._onMouseMove,{capture:!0}),t.window.document.addEventListener("mouseup",this._onMouseUp)),t.window.addEventListener("blur",this._onBlur),this._state="pending",this._inertia=[[t.browser.now(),this._map.getBearing()]],this._startPos=this._prevPos=this._lastPos=r.mousePos(this._el,e),this._center=this._map.transform.centerPoint,e.preventDefault()}},bn.prototype._onMouseMove=function(t){var e=r.mousePos(this._el,t);this._lastPos.equals(e)||(this._lastMoveEvent=t,this._lastPos=e,"pending"===this._state&&(this._state="active",this._fireEvent("rotatestart",t),this._fireEvent("movestart",t),this._pitchWithRotate&&this._fireEvent("pitchstart",t)),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onDragFrame)))},bn.prototype._onDragFrame=function(){this._frameId=null;var e=this._lastMoveEvent;if(e){var r=this._map.transform,n=this._prevPos,i=this._lastPos,o=.8*(n.x-i.x),a=-.5*(n.y-i.y),s=r.bearing-o,u=r.pitch-a,c=this._inertia,l=c[c.length-1];this._drainInertiaBuffer(),c.push([t.browser.now(),this._map._normalizeBearing(s,l[1])]);var h=r.bearing;if(r.bearing=s,this._pitchWithRotate){var f=r.pitch;r.pitch=u,r.pitch!==f&&this._fireEvent("pitch",e)}r.bearing!==h&&this._fireEvent("rotate",e),this._fireEvent("move",e),delete this._lastMoveEvent,this._prevPos=this._lastPos}},bn.prototype._onMouseUp=function(t){if("touchend"===t.type&&this._startPos===this._lastPos&&Date.now()-this._startTime<300&&this._el.click(),r.mouseButton(t)===this._eventButton)switch(this._state){case"active":this._state="enabled",r.suppressClick(),this._unbind(),this._deactivate(),this._inertialRotate(t);break;case"pending":this._state="enabled",this._unbind()}},bn.prototype._onBlur=function(t){switch(this._state){case"active":this._state="enabled",this._unbind(),this._deactivate(),this._fireEvent("rotateend",t),this._pitchWithRotate&&this._fireEvent("pitchend",t),this._fireEvent("moveend",t);break;case"pending":this._state="enabled",this._unbind()}},bn.prototype._unbind=function(){t.window.document.removeEventListener("mousemove",this._onMouseMove,{capture:!0}),t.window.document.removeEventListener("mouseup",this._onMouseUp),t.window.document.removeEventListener("touchmove",this._onMouseMove,{capture:!0}),t.window.document.removeEventListener("touchend",this._onMouseUp),t.window.removeEventListener("blur",this._onBlur),r.enableDrag()},bn.prototype._deactivate=function(){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),delete this._lastMoveEvent,delete this._startPos,delete this._prevPos,delete this._lastPos},bn.prototype._inertialRotate=function(t){var e=this;this._fireEvent("rotateend",t),this._drainInertiaBuffer();var r=this._map,n=r.getBearing(),i=this._inertia,o=function(){Math.abs(n)<e._bearingSnap?r.resetNorth({noMoveStart:!0},{originalEvent:t}):e._fireEvent("moveend",t),e._pitchWithRotate&&e._fireEvent("pitchend",t)};if(i.length<2)o();else{var a=i[0],s=i[i.length-1],u=i[i.length-2],c=r._normalizeBearing(n,u[1]),l=s[1]-a[1],h=l<0?-1:1,f=(s[0]-a[0])/1e3;if(0!==l&&0!==f){var p=Math.abs(l*(.25/f));p>180&&(p=180);var d=p/180;c+=h*p*(d/2),Math.abs(r._normalizeBearing(c,0))<this._bearingSnap&&(c=r._normalizeBearing(0,c)),r.rotateTo(c,{duration:1e3*d,easing:_n,noMoveStart:!0},{originalEvent:t})}else o()}},bn.prototype._fireEvent=function(e,r){return this._map.fire(new t.Event(e,r?{originalEvent:r}:{}))},bn.prototype._drainInertiaBuffer=function(){for(var e=this._inertia,r=t.browser.now();e.length>0&&r-e[0][0]>160;)e.shift()};var xn={linearity:.3,easing:t.bezier(0,0,.3,1),maxSpeed:1400,deceleration:2500},wn=function(e,r){this._map=e,this._el=e.getCanvasContainer(),this._state="disabled",this._clickTolerance=r.clickTolerance||1,this._inertiaOptions=xn,t.bindAll(["_onMove","_onMouseUp","_onTouchEnd","_onBlur","_onDragFrame"],this)};wn.prototype.isEnabled=function(){return"disabled"!==this._state},wn.prototype.isActive=function(){return"active"===this._state},wn.prototype.enable=function(e){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-drag-pan"),this._state="enabled",this._inertiaOptions=t.extend(xn,e))},wn.prototype.disable=function(){if(this.isEnabled())switch(this._el.classList.remove("mapboxgl-touch-drag-pan"),this._state){case"active":this._state="disabled",this._unbind(),this._deactivate(),this._fireEvent("dragend"),this._fireEvent("moveend");break;case"pending":this._state="disabled",this._unbind();break;default:this._state="disabled"}},wn.prototype.onMouseDown=function(e){"enabled"===this._state&&(e.ctrlKey||0!==r.mouseButton(e)||(r.addEventListener(t.window.document,"mousemove",this._onMove,{capture:!0}),r.addEventListener(t.window.document,"mouseup",this._onMouseUp),this._start(e)))},wn.prototype.onTouchStart=function(e){this.isEnabled()&&(e.touches&&e.touches.length>1&&("pending"===this._state||"active"===this._state)||(r.addEventListener(t.window.document,"touchmove",this._onMove,{capture:!0,passive:!1}),r.addEventListener(t.window.document,"touchend",this._onTouchEnd),this._start(e)))},wn.prototype._start=function(e){t.window.addEventListener("blur",this._onBlur),this._state="pending",this._startPos=this._mouseDownPos=this._prevPos=this._lastPos=r.mousePos(this._el,e),this._startTouch=this._lastTouch=t.window.TouchEvent&&e instanceof t.window.TouchEvent?r.touchPos(this._el,e):null,this._inertia=[[t.browser.now(),this._startPos]]},wn.prototype._touchesMatch=function(t,e){return!(!t||!e||t.length!==e.length)&&t.every((function(t,r){return e[r]===t}))},wn.prototype._onMove=function(e){e.preventDefault();var n=t.window.TouchEvent&&e instanceof t.window.TouchEvent?r.touchPos(this._el,e):null,i=r.mousePos(this._el,e);(n?this._touchesMatch(this._lastTouch,n):this._lastPos.equals(i))||"pending"===this._state&&i.dist(this._mouseDownPos)<this._clickTolerance||(this._lastMoveEvent=e,this._lastPos=i,this._lastTouch=n,this._drainInertiaBuffer(),this._inertia.push([t.browser.now(),this._lastPos]),"pending"===this._state&&(this._state="active",this._shouldStart=!0),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onDragFrame)))},wn.prototype._onDragFrame=function(){this._frameId=null;var t=this._lastMoveEvent;if(t)if(this._map.touchZoomRotate.isActive())this._abort(t);else if(this._shouldStart&&(this._fireEvent("dragstart",t),this._fireEvent("movestart",t),this._shouldStart=!1),this.isActive()){var e=this._map.transform;e.setLocationAtPoint(e.pointLocation(this._prevPos),this._lastPos),this._fireEvent("drag",t),this._fireEvent("move",t),this._prevPos=this._lastPos,delete this._lastMoveEvent}},wn.prototype._onMouseUp=function(t){if(0===r.mouseButton(t))switch(this._state){case"active":this._state="enabled",r.suppressClick(),this._unbind(),this._deactivate(),this._inertialPan(t);break;case"pending":this._state="enabled",this._unbind()}},wn.prototype._onTouchEnd=function(t){if(t.touches&&0!==t.touches.length)switch(this._state){case"pending":case"active":break;case"enabled":this.onTouchStart(t)}else switch(this._state){case"active":this._state="enabled",this._unbind(),this._deactivate(),this._inertialPan(t);break;case"pending":this._state="enabled",this._unbind();break;case"enabled":this._unbind()}},wn.prototype._abort=function(e){switch(this._state){case"active":this._state="enabled",this._shouldStart||(this._fireEvent("dragend",e),this._fireEvent("moveend",e)),this._unbind(),this._deactivate(),t.window.TouchEvent&&e instanceof t.window.TouchEvent&&e.touches.length>1&&r.addEventListener(t.window.document,"touchend",this._onTouchEnd);break;case"pending":this._state="enabled",this._unbind();break;case"enabled":this._unbind()}},wn.prototype._onBlur=function(t){this._abort(t)},wn.prototype._unbind=function(){r.removeEventListener(t.window.document,"touchmove",this._onMove,{capture:!0,passive:!1}),r.removeEventListener(t.window.document,"touchend",this._onTouchEnd),r.removeEventListener(t.window.document,"mousemove",this._onMove,{capture:!0}),r.removeEventListener(t.window.document,"mouseup",this._onMouseUp),r.removeEventListener(t.window,"blur",this._onBlur)},wn.prototype._deactivate=function(){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),delete this._lastMoveEvent,delete this._startPos,delete this._prevPos,delete this._mouseDownPos,delete this._lastPos,delete this._startTouch,delete this._lastTouch,delete this._shouldStart},wn.prototype._inertialPan=function(t){this._fireEvent("dragend",t),this._drainInertiaBuffer();var e=this._inertia;if(e.length<2)this._fireEvent("moveend",t);else{var r=e[e.length-1],n=e[0],i=r[1].sub(n[1]),o=(r[0]-n[0])/1e3;if(0===o||r[1].equals(n[1]))this._fireEvent("moveend",t);else{var a=this._inertiaOptions,s=a.linearity,u=a.easing,c=a.maxSpeed,l=a.deceleration,h=i.mult(s/o),f=h.mag();f>c&&(f=c,h._unit()._mult(f));var p=f/(l*s),d=h.mult(-p/2);this._map.panBy(d,{duration:1e3*p,easing:u,noMoveStart:!0},{originalEvent:t})}}},wn.prototype._fireEvent=function(e,r){return this._map.fire(new t.Event(e,r?{originalEvent:r}:{}))},wn.prototype._drainInertiaBuffer=function(){for(var e=this._inertia,r=t.browser.now();e.length>0&&r-e[0][0]>160;)e.shift()};var En=function(e){this._map=e,this._el=e.getCanvasContainer(),t.bindAll(["_onKeyDown"],this)};function Sn(t){return t*(2-t)}En.prototype.isEnabled=function(){return!!this._enabled},En.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("keydown",this._onKeyDown,!1),this._enabled=!0)},En.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("keydown",this._onKeyDown),this._enabled=!1)},En.prototype._onKeyDown=function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e=0,r=0,n=0,i=0,o=0;switch(t.keyCode){case 61:case 107:case 171:case 187:e=1;break;case 189:case 109:case 173:e=-1;break;case 37:t.shiftKey?r=-1:(t.preventDefault(),i=-1);break;case 39:t.shiftKey?r=1:(t.preventDefault(),i=1);break;case 38:t.shiftKey?n=1:(t.preventDefault(),o=-1);break;case 40:t.shiftKey?n=-1:(o=1,t.preventDefault());break;default:return}var a=this._map,s=a.getZoom(),u={duration:300,delayEndEvents:500,easing:Sn,zoom:e?Math.round(s)+e*(t.shiftKey?2:1):s,bearing:a.getBearing()+15*r,pitch:a.getPitch()+10*n,offset:[100*-i,100*-o],center:a.getCenter()};a.easeTo(u,{originalEvent:t})}};var On=function(e){this._map=e,t.bindAll(["_onDblClick","_onZoomEnd"],this)};On.prototype.isEnabled=function(){return!!this._enabled},On.prototype.isActive=function(){return!!this._active},On.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},On.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},On.prototype.onTouchStart=function(t){var e=this;if(this.isEnabled()&&!(t.points.length>1))if(this._tapped){var r=t.points[0],n=this._tappedPoint;if(n&&n.dist(r)<=30){t.originalEvent.preventDefault();var i=function(){e._tapped&&e._zoom(t),e._map.off("touchcancel",o),e._resetTapped()},o=function(){e._map.off("touchend",i),e._resetTapped()};this._map.once("touchend",i),this._map.once("touchcancel",o)}else this._resetTapped()}else this._tappedPoint=t.points[0],this._tapped=setTimeout((function(){e._tapped=null,e._tappedPoint=null}),300)},On.prototype._resetTapped=function(){clearTimeout(this._tapped),this._tapped=null,this._tappedPoint=null},On.prototype.onDblClick=function(t){this.isEnabled()&&(t.originalEvent.preventDefault(),this._zoom(t))},On.prototype._zoom=function(t){this._active=!0,this._map.on("zoomend",this._onZoomEnd),this._map.zoomTo(this._map.getZoom()+(t.originalEvent.shiftKey?-1:1),{around:t.lngLat},t)},On.prototype._onZoomEnd=function(){this._active=!1,this._map.off("zoomend",this._onZoomEnd)};var Tn=t.bezier(0,0,.15,1),Pn=function(e){this._map=e,this._el=e.getCanvasContainer(),t.bindAll(["_onMove","_onEnd","_onTouchFrame"],this)};Pn.prototype.isEnabled=function(){return!!this._enabled},Pn.prototype.enable=function(t){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-zoom-rotate"),this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around)},Pn.prototype.disable=function(){this.isEnabled()&&(this._el.classList.remove("mapboxgl-touch-zoom-rotate"),this._enabled=!1)},Pn.prototype.disableRotation=function(){this._rotationDisabled=!0},Pn.prototype.enableRotation=function(){this._rotationDisabled=!1},Pn.prototype.isActive=function(){return this.isEnabled()&&!!this._gestureIntent},Pn.prototype.onStart=function(e){if(this.isEnabled()&&2===e.touches.length){var n=r.mousePos(this._el,e.touches[0]),i=r.mousePos(this._el,e.touches[1]),o=n.add(i).div(2);this._startVec=n.sub(i),this._startAround=this._map.transform.pointLocation(o),this._gestureIntent=void 0,this._inertia=[],r.addEventListener(t.window.document,"touchmove",this._onMove,{passive:!1}),r.addEventListener(t.window.document,"touchend",this._onEnd)}},Pn.prototype._getTouchEventData=function(t){var e=r.mousePos(this._el,t.touches[0]),n=r.mousePos(this._el,t.touches[1]),i=e.sub(n);return{vec:i,center:e.add(n).div(2),scale:i.mag()/this._startVec.mag(),bearing:this._rotationDisabled?0:180*i.angleWith(this._startVec)/Math.PI}},Pn.prototype._onMove=function(e){if(2===e.touches.length){var r=this._getTouchEventData(e),n=r.vec,i=r.scale,o=r.bearing;if(!this._gestureIntent){var a=this._rotationDisabled&&1!==i||Math.abs(1-i)>.15;Math.abs(o)>10?this._gestureIntent="rotate":a&&(this._gestureIntent="zoom"),this._gestureIntent&&(this._map.fire(new t.Event(this._gestureIntent+"start",{originalEvent:e})),this._map.fire(new t.Event("movestart",{originalEvent:e})),this._startVec=n)}this._lastTouchEvent=e,this._frameId||(this._frameId=this._map._requestRenderFrame(this._onTouchFrame)),e.preventDefault()}},Pn.prototype._onTouchFrame=function(){this._frameId=null;var e=this._gestureIntent;if(e){var r=this._map.transform;this._startScale||(this._startScale=r.scale,this._startBearing=r.bearing);var n=this._getTouchEventData(this._lastTouchEvent),i=n.center,o=n.bearing,a=n.scale,s=r.pointLocation(i),u=r.locationPoint(s);"rotate"===e&&(r.bearing=this._startBearing+o),r.zoom=r.scaleZoom(this._startScale*a),r.setLocationAtPoint(this._startAround,u),this._map.fire(new t.Event(e,{originalEvent:this._lastTouchEvent})),this._map.fire(new t.Event("move",{originalEvent:this._lastTouchEvent})),this._drainInertiaBuffer(),this._inertia.push([t.browser.now(),a,i])}},Pn.prototype._onEnd=function(e){r.removeEventListener(t.window.document,"touchmove",this._onMove,{passive:!1}),r.removeEventListener(t.window.document,"touchend",this._onEnd);var n=this._gestureIntent,i=this._startScale;if(this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),delete this._gestureIntent,delete this._startScale,delete this._startBearing,delete this._lastTouchEvent,n){this._map.fire(new t.Event(n+"end",{originalEvent:e})),this._drainInertiaBuffer();var o=this._inertia,a=this._map;if(o.length<2)a.snapToNorth({},{originalEvent:e});else{var s=o[o.length-1],u=o[0],c=a.transform.scaleZoom(i*s[1]),l=a.transform.scaleZoom(i*u[1]),h=c-l,f=(s[0]-u[0])/1e3,p=s[2];if(0!==f&&c!==l){var d=.15*h/f;Math.abs(d)>2.5&&(d=d>0?2.5:-2.5);var A=1e3*Math.abs(d/(12*.15)),g=c+d*A/2e3;a.easeTo({zoom:g,duration:A,easing:Tn,around:this._aroundCenter?a.getCenter():a.unproject(p),noMoveStart:!0},{originalEvent:e})}else a.snapToNorth({},{originalEvent:e})}}},Pn.prototype._drainInertiaBuffer=function(){for(var e=this._inertia,r=t.browser.now();e.length>2&&r-e[0][0]>160;)e.shift()};var Mn={scrollZoom:yn,boxZoom:vn,dragRotate:bn,dragPan:wn,keyboard:En,doubleClickZoom:On,touchZoomRotate:Pn},Cn=function(e){function r(r,n){e.call(this),this._moving=!1,this._zooming=!1,this.transform=r,this._bearingSnap=n.bearingSnap,t.bindAll(["_renderFrameCallback"],this)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.getCenter=function(){return new t.LngLat(this.transform.center.lng,this.transform.center.lat)},r.prototype.setCenter=function(t,e){return this.jumpTo({center:t},e)},r.prototype.panBy=function(e,r,n){return e=t.Point.convert(e).mult(-1),this.panTo(this.transform.center,t.extend({offset:e},r),n)},r.prototype.panTo=function(e,r,n){return this.easeTo(t.extend({center:e},r),n)},r.prototype.getZoom=function(){return this.transform.zoom},r.prototype.setZoom=function(t,e){return this.jumpTo({zoom:t},e),this},r.prototype.zoomTo=function(e,r,n){return this.easeTo(t.extend({zoom:e},r),n)},r.prototype.zoomIn=function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},r.prototype.zoomOut=function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},r.prototype.getBearing=function(){return this.transform.bearing},r.prototype.setBearing=function(t,e){return this.jumpTo({bearing:t},e),this},r.prototype.rotateTo=function(e,r,n){return this.easeTo(t.extend({bearing:e},r),n)},r.prototype.resetNorth=function(e,r){return this.rotateTo(0,t.extend({duration:1e3},e),r),this},r.prototype.resetNorthPitch=function(e,r){return this.easeTo(t.extend({bearing:0,pitch:0,duration:1e3},e),r),this},r.prototype.snapToNorth=function(t,e){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,e):this},r.prototype.getPitch=function(){return this.transform.pitch},r.prototype.setPitch=function(t,e){return this.jumpTo({pitch:t},e),this},r.prototype.cameraForBounds=function(e,r){return e=t.LngLatBounds.convert(e),this._cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),0,r)},r.prototype._cameraForBoxAndBearing=function(e,r,n,i){if("number"==typeof(i=t.extend({padding:{top:0,bottom:0,right:0,left:0},offset:[0,0],maxZoom:this.transform.maxZoom},i)).padding){var o=i.padding;i.padding={top:o,bottom:o,right:o,left:o}}if(t.deepEqual(Object.keys(i.padding).sort((function(t,e){return t<e?-1:t>e?1:0})),["bottom","left","right","top"])){var a=this.transform,s=a.project(t.LngLat.convert(e)),u=a.project(t.LngLat.convert(r)),c=s.rotate(-n*Math.PI/180),l=u.rotate(-n*Math.PI/180),h=new t.Point(Math.max(c.x,l.x),Math.max(c.y,l.y)),f=new t.Point(Math.min(c.x,l.x),Math.min(c.y,l.y)),p=h.sub(f),d=(a.width-i.padding.left-i.padding.right)/p.x,A=(a.height-i.padding.top-i.padding.bottom)/p.y;if(!(A<0||d<0)){var g=Math.min(a.scaleZoom(a.scale*Math.min(d,A)),i.maxZoom),m=t.Point.convert(i.offset),y=(i.padding.left-i.padding.right)/2,v=(i.padding.top-i.padding.bottom)/2,_=new t.Point(m.x+y,m.y+v).mult(a.scale/a.zoomScale(g));return{center:a.unproject(s.add(u).div(2).sub(_)),zoom:g,bearing:n}}t.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.")}else t.warnOnce("options.padding must be a positive number, or an Object with keys 'bottom', 'left', 'right', 'top'")},r.prototype.fitBounds=function(t,e,r){return this._fitInternal(this.cameraForBounds(t,e),e,r)},r.prototype.fitScreenCoordinates=function(e,r,n,i,o){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(t.Point.convert(e)),this.transform.pointLocation(t.Point.convert(r)),n,i),i,o)},r.prototype._fitInternal=function(e,r,n){return e?(r=t.extend(e,r)).linear?this.easeTo(r,n):this.flyTo(r,n):this},r.prototype.jumpTo=function(e,r){this.stop();var n=this.transform,i=!1,o=!1,a=!1;return"zoom"in e&&n.zoom!==+e.zoom&&(i=!0,n.zoom=+e.zoom),void 0!==e.center&&(n.center=t.LngLat.convert(e.center)),"bearing"in e&&n.bearing!==+e.bearing&&(o=!0,n.bearing=+e.bearing),"pitch"in e&&n.pitch!==+e.pitch&&(a=!0,n.pitch=+e.pitch),this.fire(new t.Event("movestart",r)).fire(new t.Event("move",r)),i&&this.fire(new t.Event("zoomstart",r)).fire(new t.Event("zoom",r)).fire(new t.Event("zoomend",r)),o&&this.fire(new t.Event("rotatestart",r)).fire(new t.Event("rotate",r)).fire(new t.Event("rotateend",r)),a&&this.fire(new t.Event("pitchstart",r)).fire(new t.Event("pitch",r)).fire(new t.Event("pitchend",r)),this.fire(new t.Event("moveend",r))},r.prototype.easeTo=function(e,r){var n=this;this.stop(),(!1===(e=t.extend({offset:[0,0],duration:500,easing:t.ease},e)).animate||!e.essential&&t.browser.prefersReducedMotion)&&(e.duration=0);var i=this.transform,o=this.getZoom(),a=this.getBearing(),s=this.getPitch(),u="zoom"in e?+e.zoom:o,c="bearing"in e?this._normalizeBearing(e.bearing,a):a,l="pitch"in e?+e.pitch:s,h=i.centerPoint.add(t.Point.convert(e.offset)),f=i.pointLocation(h),p=t.LngLat.convert(e.center||f);this._normalizeCenter(p);var d,A,g=i.project(f),m=i.project(p).sub(g),y=i.zoomScale(u-o);return e.around&&(d=t.LngLat.convert(e.around),A=i.locationPoint(d)),this._zooming=u!==o,this._rotating=a!==c,this._pitching=l!==s,this._prepareEase(r,e.noMoveStart),clearTimeout(this._easeEndTimeoutID),this._ease((function(e){if(n._zooming&&(i.zoom=t.number(o,u,e)),n._rotating&&(i.bearing=t.number(a,c,e)),n._pitching&&(i.pitch=t.number(s,l,e)),d)i.setLocationAtPoint(d,A);else{var f=i.zoomScale(i.zoom-o),p=u>o?Math.min(2,y):Math.max(.5,y),v=Math.pow(p,1-e),_=i.unproject(g.add(m.mult(e*v)).mult(f));i.setLocationAtPoint(i.renderWorldCopies?_.wrap():_,h)}n._fireMoveEvents(r)}),(function(){e.delayEndEvents?n._easeEndTimeoutID=setTimeout((function(){return n._afterEase(r)}),e.delayEndEvents):n._afterEase(r)}),e),this},r.prototype._prepareEase=function(e,r){this._moving=!0,r||this.fire(new t.Event("movestart",e)),this._zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&this.fire(new t.Event("rotatestart",e)),this._pitching&&this.fire(new t.Event("pitchstart",e))},r.prototype._fireMoveEvents=function(e){this.fire(new t.Event("move",e)),this._zooming&&this.fire(new t.Event("zoom",e)),this._rotating&&this.fire(new t.Event("rotate",e)),this._pitching&&this.fire(new t.Event("pitch",e))},r.prototype._afterEase=function(e){var r=this._zooming,n=this._rotating,i=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,r&&this.fire(new t.Event("zoomend",e)),n&&this.fire(new t.Event("rotateend",e)),i&&this.fire(new t.Event("pitchend",e)),this.fire(new t.Event("moveend",e))},r.prototype.flyTo=function(e,r){var n=this;if(!e.essential&&t.browser.prefersReducedMotion){var i=t.pick(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(i,r)}this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);var o=this.transform,a=this.getZoom(),s=this.getBearing(),u=this.getPitch(),c="zoom"in e?t.clamp(+e.zoom,o.minZoom,o.maxZoom):a,l="bearing"in e?this._normalizeBearing(e.bearing,s):s,h="pitch"in e?+e.pitch:u,f=o.zoomScale(c-a),p=o.centerPoint.add(t.Point.convert(e.offset)),d=o.pointLocation(p),A=t.LngLat.convert(e.center||d);this._normalizeCenter(A);var g=o.project(d),m=o.project(A).sub(g),y=e.curve,v=Math.max(o.width,o.height),_=v/f,b=m.mag();if("minZoom"in e){var x=t.clamp(Math.min(e.minZoom,a,c),o.minZoom,o.maxZoom),w=v/o.zoomScale(x-a);y=Math.sqrt(w/b*2)}var E=y*y;function S(t){var e=(_*_-v*v+(t?-1:1)*E*E*b*b)/(2*(t?_:v)*E*b);return Math.log(Math.sqrt(e*e+1)-e)}function O(t){return(Math.exp(t)-Math.exp(-t))/2}function T(t){return(Math.exp(t)+Math.exp(-t))/2}var P=S(0),M=function(t){return T(P)/T(P+y*t)},C=function(t){return v*((T(P)*(O(e=P+y*t)/T(e))-O(P))/E)/b;var e},I=(S(1)-P)/y;if(Math.abs(b)<1e-6||!isFinite(I)){if(Math.abs(v-_)<1e-6)return this.easeTo(e,r);var k=_<v?-1:1;I=Math.abs(Math.log(_/v))/y,C=function(){return 0},M=function(t){return Math.exp(k*y*t)}}if("duration"in e)e.duration=+e.duration;else{var R="screenSpeed"in e?+e.screenSpeed/y:+e.speed;e.duration=1e3*I/R}return e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=s!==l,this._pitching=h!==u,this._prepareEase(r,!1),this._ease((function(e){var i=e*I,f=1/M(i);o.zoom=1===e?c:a+o.scaleZoom(f),n._rotating&&(o.bearing=t.number(s,l,e)),n._pitching&&(o.pitch=t.number(u,h,e));var d=1===e?A:o.unproject(g.add(m.mult(C(i))).mult(f));o.setLocationAtPoint(o.renderWorldCopies?d.wrap():d,p),n._fireMoveEvents(r)}),(function(){return n._afterEase(r)}),e),this},r.prototype.isEasing=function(){return!!this._easeFrameId},r.prototype.stop=function(){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var t=this._onEaseEnd;delete this._onEaseEnd,t.call(this)}return this},r.prototype._ease=function(e,r,n){!1===n.animate||0===n.duration?(e(1),r()):(this._easeStart=t.browser.now(),this._easeOptions=n,this._onEaseFrame=e,this._onEaseEnd=r,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},r.prototype._renderFrameCallback=function(){var e=Math.min((t.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},r.prototype._normalizeBearing=function(e,r){e=t.wrap(e,-180,180);var n=Math.abs(e-r);return Math.abs(e-360-r)<n&&(e-=360),Math.abs(e+360-r)<n&&(e+=360),e},r.prototype._normalizeCenter=function(t){var e=this.transform;if(e.renderWorldCopies&&!e.lngRange){var r=t.lng-e.center.lng;t.lng+=r>180?-360:r<-180?360:0}},r}(t.Evented),In=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_updateEditLink","_updateData","_updateCompact"],this)};In.prototype.getDefaultPosition=function(){return"bottom-right"},In.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._innerContainer=r.create("div","mapboxgl-ctrl-attrib-inner",this._container),e&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===e&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},In.prototype.onRemove=function(){r.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},In.prototype._updateEditLink=function(){var e=this._editLink;e||(e=this._editLink=this._container.querySelector(".mapbox-improve-map"));var r=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||t.config.ACCESS_TOKEN}];if(e){var n=r.reduce((function(t,e,n){return e.value&&(t+=e.key+"="+e.value+(n<r.length-1?"&":"")),t}),"?");e.href=t.config.FEEDBACK_URL+"/"+n+(this._map._hash?this._map._hash.getHashString(!0):""),e.rel="noopener nofollow"}},In.prototype._updateData=function(t){!t||"metadata"!==t.sourceDataType&&"style"!==t.dataType||(this._updateAttributions(),this._updateEditLink())},In.prototype._updateAttributions=function(){if(this._map.style){var t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map((function(t){return"string"!=typeof t?"":t}))):"string"==typeof this.options.customAttribution&&t.push(this.options.customAttribution)),this._map.style.stylesheet){var e=this._map.style.stylesheet;this.styleOwner=e.owner,this.styleId=e.id}var r=this._map.style.sourceCaches;for(var n in r){var i=r[n];if(i.used){var o=i.getSource();o.attribution&&t.indexOf(o.attribution)<0&&t.push(o.attribution)}}t.sort((function(t,e){return t.length-e.length}));var a=(t=t.filter((function(e,r){for(var n=r+1;n<t.length;n++)if(t[n].indexOf(e)>=0)return!1;return!0}))).join(" | ");a!==this._attribHTML&&(this._attribHTML=a,t.length?(this._innerContainer.innerHTML=a,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},In.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact")};var kn=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this)};kn.prototype.onAdd=function(t){this._map=t,this._container=r.create("div","mapboxgl-ctrl");var e=r.create("a","mapboxgl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://www.mapbox.com/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},kn.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},kn.prototype.getDefaultPosition=function(){return"bottom-left"},kn.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},kn.prototype._logoRequired=function(){if(this._map.style){var t=this._map.style.sourceCaches;for(var e in t)if(t[e].getSource().mapbox_logo)return!0;return!1}},kn.prototype._updateCompact=function(){var t=this._container.children;if(t.length){var e=t[0];this._map.getCanvasContainer().offsetWidth<250?e.classList.add("mapboxgl-compact"):e.classList.remove("mapboxgl-compact")}};var Rn=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};Rn.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},Rn.prototype.remove=function(t){for(var e=this._currentlyRunning,r=0,n=e?this._queue.concat(e):this._queue;r<n.length;r+=1){var i=n[r];if(i.id===t)return void(i.cancelled=!0)}},Rn.prototype.run=function(){var t=this._currentlyRunning=this._queue;this._queue=[];for(var e=0,r=t;e<r.length;e+=1){var n=r[e];if(!n.cancelled&&(n.callback(),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1},Rn.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]};var Ln={"FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm"},jn=t.window.HTMLImageElement,Dn=t.window.HTMLElement,Bn={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,bearingSnap:7,clickTolerance:3,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",transformRequest:null,accessToken:null,fadeDuration:300,crossSourceCollisions:!0},Fn=function(n){function i(e){var i=this;if(null!=(e=t.extend({},Bn,e)).minZoom&&null!=e.maxZoom&&e.minZoom>e.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=e.minPitch&&null!=e.maxPitch&&e.minPitch>e.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=e.minPitch&&e.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=e.maxPitch&&e.maxPitch>60)throw new Error("maxPitch must be less than or equal to 60");var o=new fn(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies);if(n.call(this,o,e),this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._antialias=e.antialias,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles,this._fadeDuration=e.fadeDuration,this._crossSourceCollisions=e.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=e.collectResourceTiming,this._renderTaskQueue=new Rn,this._controls=[],this._mapId=t.uniqueId(),this._locale=t.extend({},Ln,e.locale),this._requestManager=new t.RequestManager(e.transformRequest,e.accessToken),"string"==typeof e.container){if(this._container=t.window.document.getElementById(e.container),!this._container)throw new Error("Container '"+e.container+"' not found.")}else{if(!(e.container instanceof Dn))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return i._update(!1)})),this.on("moveend",(function(){return i._update(!1)})),this.on("zoom",(function(){return i._update(!0)})),void 0!==t.window&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1)),function(t,e){var n=t.getCanvasContainer(),i=null,o=!1,a=null;for(var s in Mn)t[s]=new Mn[s](t,e),e.interactive&&e[s]&&t[s].enable(e[s]);r.addEventListener(n,"mouseout",(function(e){t.fire(new An("mouseout",t,e))})),r.addEventListener(n,"mousedown",(function(i){o=!0,a=r.mousePos(n,i);var s=new An("mousedown",t,i);t.fire(s),s.defaultPrevented||(e.interactive&&!t.doubleClickZoom.isActive()&&t.stop(),t.boxZoom.onMouseDown(i),t.boxZoom.isActive()||t.dragPan.isActive()||t.dragRotate.onMouseDown(i),t.boxZoom.isActive()||t.dragRotate.isActive()||t.dragPan.onMouseDown(i))})),r.addEventListener(n,"mouseup",(function(e){var r=t.dragRotate.isActive();i&&!r&&t.fire(new An("contextmenu",t,i)),i=null,o=!1,t.fire(new An("mouseup",t,e))})),r.addEventListener(n,"mousemove",(function(e){if(!t.dragPan.isActive()&&!t.dragRotate.isActive()){for(var r=e.target;r&&r!==n;)r=r.parentNode;r===n&&t.fire(new An("mousemove",t,e))}})),r.addEventListener(n,"mouseover",(function(e){for(var r=e.target;r&&r!==n;)r=r.parentNode;r===n&&t.fire(new An("mouseover",t,e))})),r.addEventListener(n,"touchstart",(function(r){var n=new gn("touchstart",t,r);t.fire(n),n.defaultPrevented||(e.interactive&&t.stop(),t.boxZoom.isActive()||t.dragRotate.isActive()||t.dragPan.onTouchStart(r),t.touchZoomRotate.onStart(r),t.doubleClickZoom.onTouchStart(n))}),{passive:!1}),r.addEventListener(n,"touchmove",(function(e){t.fire(new gn("touchmove",t,e))}),{passive:!1}),r.addEventListener(n,"touchend",(function(e){t.fire(new gn("touchend",t,e))})),r.addEventListener(n,"touchcancel",(function(e){t.fire(new gn("touchcancel",t,e))})),r.addEventListener(n,"click",(function(i){var o=r.mousePos(n,i);(!a||o.equals(a)||o.dist(a)<e.clickTolerance)&&t.fire(new An("click",t,i))})),r.addEventListener(n,"dblclick",(function(e){var r=new An("dblclick",t,e);t.fire(r),r.defaultPrevented||t.doubleClickZoom.onDblClick(r)})),r.addEventListener(n,"contextmenu",(function(e){var r=t.dragRotate.isActive();o||r?o&&(i=e):t.fire(new An("contextmenu",t,e)),(t.dragRotate.isEnabled()||t.listens("contextmenu"))&&e.preventDefault()})),r.addEventListener(n,"wheel",(function(r){e.interactive&&t.stop();var n=new mn("wheel",t,r);t.fire(n),n.defaultPrevented||t.scrollZoom.onWheel(r)}),{passive:!1})}(this,e);var a="string"==typeof e.hash&&e.hash||void 0;this._hash=e.hash&&new dn(a).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),e.bounds&&(this.resize(),this.fitBounds(e.bounds,t.extend({},e.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=e.localIdeographFontFamily,e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new In({customAttribution:e.customAttribution})),this.addControl(new kn,e.logoPosition),this.on("style.load",(function(){i.transform.unmodified&&i.jumpTo(i.style.stylesheet)})),this.on("data",(function(e){i._update("style"===e.dataType),i.fire(new t.Event(e.dataType+"data",e))})),this.on("dataloading",(function(e){i.fire(new t.Event(e.dataType+"dataloading",e))}))}n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i;var o={showTileBoundaries:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return i.prototype._getMapId=function(){return this._mapId},i.prototype.addControl=function(e,r){if(void 0===r&&e.getDefaultPosition&&(r=e.getDefaultPosition()),void 0===r&&(r="top-right"),!e||!e.onAdd)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var n=e.onAdd(this);this._controls.push(e);var i=this._controlPositions[r];return-1!==r.indexOf("bottom")?i.insertBefore(n,i.firstChild):i.appendChild(n),this},i.prototype.removeControl=function(e){if(!e||!e.onRemove)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var r=this._controls.indexOf(e);return r>-1&&this._controls.splice(r,1),e.onRemove(this),this},i.prototype.resize=function(e){var r=this._containerDimensions(),n=r[0],i=r[1];return this._resizeCanvas(n,i),this.transform.resize(n,i),this.painter.resize(n,i),this.fire(new t.Event("movestart",e)).fire(new t.Event("move",e)).fire(new t.Event("resize",e)).fire(new t.Event("moveend",e)),this},i.prototype.getBounds=function(){return this.transform.getBounds()},i.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},i.prototype.setMaxBounds=function(e){return this.transform.setMaxBounds(t.LngLatBounds.convert(e)),this._update()},i.prototype.setMinZoom=function(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()<t&&this.setZoom(t),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")},i.prototype.getMinZoom=function(){return this.transform.minZoom},i.prototype.setMaxZoom=function(t){if((t=null==t?22:t)>=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")},i.prototype.getMaxZoom=function(){return this.transform.maxZoom},i.prototype.setMinPitch=function(t){if((t=null==t?0:t)<0)throw new Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()<t&&this.setPitch(t),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")},i.prototype.getMinPitch=function(){return this.transform.minPitch},i.prototype.setMaxPitch=function(t){if((t=null==t?60:t)>60)throw new Error("maxPitch must be less than or equal to 60");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t&&this.setPitch(t),this;throw new Error("maxPitch must be greater than the current minPitch")},i.prototype.getMaxPitch=function(){return this.transform.maxPitch},i.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},i.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update()},i.prototype.project=function(e){return this.transform.locationPoint(t.LngLat.convert(e))},i.prototype.unproject=function(e){return this.transform.pointLocation(t.Point.convert(e))},i.prototype.isMoving=function(){return this._moving||this.dragPan.isActive()||this.dragRotate.isActive()||this.scrollZoom.isActive()},i.prototype.isZooming=function(){return this._zooming||this.scrollZoom.isZooming()},i.prototype.isRotating=function(){return this._rotating||this.dragRotate.isActive()},i.prototype.on=function(t,e,r){var i=this;if(void 0===r)return n.prototype.on.call(this,t,e);var o=function(){var n;if("mouseenter"===t||"mouseover"===t){var o=!1;return{layer:e,listener:r,delegates:{mousemove:function(n){var a=i.getLayer(e)?i.queryRenderedFeatures(n.point,{layers:[e]}):[];a.length?o||(o=!0,r.call(i,new An(t,i,n.originalEvent,{features:a}))):o=!1},mouseout:function(){o=!1}}}}if("mouseleave"===t||"mouseout"===t){var a=!1;return{layer:e,listener:r,delegates:{mousemove:function(n){(i.getLayer(e)?i.queryRenderedFeatures(n.point,{layers:[e]}):[]).length?a=!0:a&&(a=!1,r.call(i,new An(t,i,n.originalEvent)))},mouseout:function(e){a&&(a=!1,r.call(i,new An(t,i,e.originalEvent)))}}}}return{layer:e,listener:r,delegates:(n={},n[t]=function(t){var n=i.getLayer(e)?i.queryRenderedFeatures(t.point,{layers:[e]}):[];n.length&&(t.features=n,r.call(i,t),delete t.features)},n)}}();for(var a in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(o),o.delegates)this.on(a,o.delegates[a]);return this},i.prototype.off=function(t,e,r){if(void 0===r)return n.prototype.off.call(this,t,e);if(this._delegatedListeners&&this._delegatedListeners[t])for(var i=this._delegatedListeners[t],o=0;o<i.length;o++){var a=i[o];if(a.layer===e&&a.listener===r){for(var s in a.delegates)this.off(s,a.delegates[s]);return i.splice(o,1),this}}return this},i.prototype.queryRenderedFeatures=function(e,r){if(!this.style)return[];var n;if(void 0!==r||void 0===e||e instanceof t.Point||Array.isArray(e)||(r=e,e=void 0),r=r||{},(e=e||[[0,0],[this.transform.width,this.transform.height]])instanceof t.Point||"number"==typeof e[0])n=[t.Point.convert(e)];else{var i=t.Point.convert(e[0]),o=t.Point.convert(e[1]);n=[i,new t.Point(o.x,i.y),o,new t.Point(i.x,o.y),i]}return this.style.queryRenderedFeatures(n,r,this.transform)},i.prototype.querySourceFeatures=function(t,e){return this.style.querySourceFeatures(t,e)},i.prototype.setStyle=function(e,r){return!1!==(r=t.extend({},{localIdeographFontFamily:this._localIdeographFontFamily},r)).diff&&r.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&e?(this._diffStyle(e,r),this):(this._localIdeographFontFamily=r.localIdeographFontFamily,this._updateStyle(e,r))},i.prototype._getUIString=function(t){var e=this._locale[t];if(null==e)throw new Error("Missing UI string '"+t+"'");return e},i.prototype._updateStyle=function(t,e){return this.style&&(this.style.setEventedParent(null),this.style._remove()),t?(this.style=new Be(this,e||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof t?this.style.loadURL(t):this.style.loadJSON(t),this):(delete this.style,this)},i.prototype._diffStyle=function(e,r){var n=this;if("string"==typeof e){var i=this._requestManager.normalizeStyleURL(e),o=this._requestManager.transformRequest(i,t.ResourceType.Style);t.getJSON(o,(function(e,i){e?n.fire(new t.ErrorEvent(e)):i&&n._updateDiff(i,r)}))}else"object"==typeof e&&this._updateDiff(e,r)},i.prototype._updateDiff=function(e,r){try{this.style.setState(e)&&this._update(!0)}catch(n){t.warnOnce("Unable to perform style diff: "+(n.message||n.error||n)+". Rebuilding the style from scratch."),this._updateStyle(e,r)}},i.prototype.getStyle=function(){if(this.style)return this.style.serialize()},i.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():t.warnOnce("There is no style added to the map.")},i.prototype.addSource=function(t,e){return this.style.addSource(t,e),this._update(!0)},i.prototype.isSourceLoaded=function(e){var r=this.style&&this.style.sourceCaches[e];if(void 0!==r)return r.loaded();this.fire(new t.ErrorEvent(new Error("There is no source with ID '"+e+"'")))},i.prototype.areTilesLoaded=function(){var t=this.style&&this.style.sourceCaches;for(var e in t){var r=t[e]._tiles;for(var n in r){var i=r[n];if("loaded"!==i.state&&"errored"!==i.state)return!1}}return!0},i.prototype.addSourceType=function(t,e,r){return this.style.addSourceType(t,e,r)},i.prototype.removeSource=function(t){return this.style.removeSource(t),this._update(!0)},i.prototype.getSource=function(t){return this.style.getSource(t)},i.prototype.addImage=function(e,r,n){void 0===n&&(n={});var i=n.pixelRatio;void 0===i&&(i=1);var o=n.sdf;void 0===o&&(o=!1);var a=n.stretchX,s=n.stretchY,u=n.content;if(r instanceof jn){var c=t.browser.getImageData(r),l=c.width,h=c.height,f=c.data;this.style.addImage(e,{data:new t.RGBAImage({width:l,height:h},f),pixelRatio:i,stretchX:a,stretchY:s,content:u,sdf:o,version:0})}else{if(void 0===r.width||void 0===r.height)return this.fire(new t.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));var p=r.width,d=r.height,A=r.data,g=r;this.style.addImage(e,{data:new t.RGBAImage({width:p,height:d},new Uint8Array(A)),pixelRatio:i,stretchX:a,stretchY:s,content:u,sdf:o,version:0,userImage:g}),g.onAdd&&g.onAdd(this,e)}},i.prototype.updateImage=function(e,r){var n=this.style.getImage(e);if(!n)return this.fire(new t.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));var i=r instanceof jn?t.browser.getImageData(r):r,o=i.width,a=i.height,s=i.data;if(void 0===o||void 0===a)return this.fire(new t.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(o!==n.data.width||a!==n.data.height)return this.fire(new t.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image")));var u=!(r instanceof jn);n.data.replace(s,u),this.style.updateImage(e,n)},i.prototype.hasImage=function(e){return e?!!this.style.getImage(e):(this.fire(new t.ErrorEvent(new Error("Missing required image id"))),!1)},i.prototype.removeImage=function(t){this.style.removeImage(t)},i.prototype.loadImage=function(e,r){t.getImage(this._requestManager.transformRequest(e,t.ResourceType.Image),r)},i.prototype.listImages=function(){return this.style.listImages()},i.prototype.addLayer=function(t,e){return this.style.addLayer(t,e),this._update(!0)},i.prototype.moveLayer=function(t,e){return this.style.moveLayer(t,e),this._update(!0)},i.prototype.removeLayer=function(t){return this.style.removeLayer(t),this._update(!0)},i.prototype.getLayer=function(t){return this.style.getLayer(t)},i.prototype.setLayerZoomRange=function(t,e,r){return this.style.setLayerZoomRange(t,e,r),this._update(!0)},i.prototype.setFilter=function(t,e,r){return void 0===r&&(r={}),this.style.setFilter(t,e,r),this._update(!0)},i.prototype.getFilter=function(t){return this.style.getFilter(t)},i.prototype.setPaintProperty=function(t,e,r,n){return void 0===n&&(n={}),this.style.setPaintProperty(t,e,r,n),this._update(!0)},i.prototype.getPaintProperty=function(t,e){return this.style.getPaintProperty(t,e)},i.prototype.setLayoutProperty=function(t,e,r,n){return void 0===n&&(n={}),this.style.setLayoutProperty(t,e,r,n),this._update(!0)},i.prototype.getLayoutProperty=function(t,e){return this.style.getLayoutProperty(t,e)},i.prototype.setLight=function(t,e){return void 0===e&&(e={}),this.style.setLight(t,e),this._update(!0)},i.prototype.getLight=function(){return this.style.getLight()},i.prototype.setFeatureState=function(t,e){return this.style.setFeatureState(t,e),this._update()},i.prototype.removeFeatureState=function(t,e){return this.style.removeFeatureState(t,e),this._update()},i.prototype.getFeatureState=function(t){return this.style.getFeatureState(t)},i.prototype.getContainer=function(){return this._container},i.prototype.getCanvasContainer=function(){return this._canvasContainer},i.prototype.getCanvas=function(){return this._canvas},i.prototype._containerDimensions=function(){var t=0,e=0;return this._container&&(t=this._container.clientWidth||400,e=this._container.clientHeight||300),[t,e]},i.prototype._detectMissingCSS=function(){"rgb(250, 128, 114)"!==t.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")&&t.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")},i.prototype._setupContainer=function(){var t=this._container;t.classList.add("mapboxgl-map"),(this._missingCSSCanary=r.create("div","mapboxgl-canary",t)).style.visibility="hidden",this._detectMissingCSS();var e=this._canvasContainer=r.create("div","mapboxgl-canvas-container",t);this._interactive&&e.classList.add("mapboxgl-interactive"),this._canvas=r.create("canvas","mapboxgl-canvas",e),this._canvas.style.position="absolute",this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map");var n=this._containerDimensions();this._resizeCanvas(n[0],n[1]);var i=this._controlContainer=r.create("div","mapboxgl-control-container",t),o=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((function(t){o[t]=r.create("div","mapboxgl-ctrl-"+t,i)}))},i.prototype._resizeCanvas=function(e,r){var n=t.window.devicePixelRatio||1;this._canvas.width=n*e,this._canvas.height=n*r,this._canvas.style.width=e+"px",this._canvas.style.height=r+"px"},i.prototype._setupPainter=function(){var r=t.extend({},e.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),n=this._canvas.getContext("webgl",r)||this._canvas.getContext("experimental-webgl",r);n?(this.painter=new un(n,this.transform),t.webpSupported.testSupport(n)):this.fire(new t.ErrorEvent(new Error("Failed to initialize WebGL")))},i.prototype._contextLost=function(e){e.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new t.Event("webglcontextlost",{originalEvent:e}))},i.prototype._contextRestored=function(e){this._setupPainter(),this.resize(),this._update(),this.fire(new t.Event("webglcontextrestored",{originalEvent:e}))},i.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()},i.prototype._update=function(t){return this.style?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this.triggerRepaint(),this):this},i.prototype._requestRenderFrame=function(t){return this._update(),this._renderTaskQueue.add(t)},i.prototype._cancelRenderFrame=function(t){this._renderTaskQueue.remove(t)},i.prototype._render=function(){var e,r=this,n=0,i=this.painter.context.extTimerQuery;this.listens("gpu-timing-frame")&&(e=i.createQueryEXT(),i.beginQueryEXT(i.TIME_ELAPSED_EXT,e),n=t.browser.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run();var o=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var a=this.transform.zoom,s=t.browser.now();this.style.zoomHistory.update(a,s);var u=new t.EvaluationParameters(a,{now:s,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),c=u.crossFadingFactor();1===c&&c===this._crossFadingFactor||(o=!0,this._crossFadingFactor=c),this.style.update(u)}if(this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),gpuTiming:!!this.listens("gpu-timing-layer"),fadeDuration:this._fadeDuration}),this.fire(new t.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new t.Event("load"))),this.style&&(this.style.hasTransitions()||o)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){var l=t.browser.now()-n;i.endQueryEXT(i.TIME_ELAPSED_EXT,e),setTimeout((function(){var n=i.getQueryObjectEXT(e,i.QUERY_RESULT_EXT)/1e6;i.deleteQueryEXT(e),r.fire(new t.Event("gpu-timing-frame",{cpuTime:l,gpuTime:n}))}),50)}if(this.listens("gpu-timing-layer")){var h=this.painter.collectGpuTimers();setTimeout((function(){var e=r.painter.queryGpuTimers(h);r.fire(new t.Event("gpu-timing-layer",{layerTimes:e}))}),50)}return this._sourcesDirty||this._repaint||this._styleDirty||this._placementDirty?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new t.Event("idle")),this},i.prototype.remove=function(){this._hash&&this._hash.remove();for(var e=0,r=this._controls;e<r.length;e+=1)r[e].onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.setStyle(null),void 0!==t.window&&(t.window.removeEventListener("resize",this._onWindowResize,!1),t.window.removeEventListener("online",this._onWindowOnline,!1));var n=this.painter.context.gl.getExtension("WEBGL_lose_context");n&&n.loseContext(),zn(this._canvasContainer),zn(this._controlContainer),zn(this._missingCSSCanary),this._container.classList.remove("mapboxgl-map"),this.fire(new t.Event("remove"))},i.prototype.triggerRepaint=function(){var e=this;this.style&&!this._frame&&(this._frame=t.browser.frame((function(){e._frame=null,e._render()})))},i.prototype._onWindowOnline=function(){this._update()},i.prototype._onWindowResize=function(t){this._trackResize&&this.resize({originalEvent:t})._update()},o.showTileBoundaries.get=function(){return!!this._showTileBoundaries},o.showTileBoundaries.set=function(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())},o.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},o.showCollisionBoxes.set=function(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,t?this.style._generateCollisionBoxes():this._update())},o.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},o.showOverdrawInspector.set=function(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())},o.repaint.get=function(){return!!this._repaint},o.repaint.set=function(t){this._repaint!==t&&(this._repaint=t,this.triggerRepaint())},o.vertices.get=function(){return!!this._vertices},o.vertices.set=function(t){this._vertices=t,this._update()},i.prototype._setCacheLimits=function(e,r){t.setCacheLimits(e,r)},o.version.get=function(){return t.version},Object.defineProperties(i.prototype,o),i}(Cn);function zn(t){t.parentNode&&t.parentNode.removeChild(t)}var Nn={showCompass:!0,showZoom:!0,visualizePitch:!1},Un=function(e){var n=this;this.options=t.extend({},Nn,e),this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this.options.showZoom&&(t.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",(function(t){return n._map.zoomIn({},{originalEvent:t})})),r.create("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden",!0),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",(function(t){return n._map.zoomOut({},{originalEvent:t})})),r.create("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden",!0)),this.options.showCompass&&(t.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",(function(t){n.options.visualizePitch?n._map.resetNorthPitch({},{originalEvent:t}):n._map.resetNorth({},{originalEvent:t})})),this._compassIcon=r.create("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden",!0))};function Vn(e,r,n){if(e=new t.LngLat(e.lng,e.lat),r){var i=new t.LngLat(e.lng-360,e.lat),o=new t.LngLat(e.lng+360,e.lat),a=n.locationPoint(e).distSqr(r);n.locationPoint(i).distSqr(r)<a?e=i:n.locationPoint(o).distSqr(r)<a&&(e=o)}for(;Math.abs(e.lng-n.center.lng)>180;){var s=n.locationPoint(e);if(s.x>=0&&s.y>=0&&s.x<=n.width&&s.y<=n.height)break;e.lng>n.center.lng?e.lng-=360:e.lng+=360}return e}Un.prototype._updateZoomButtons=function(){var t=this._map.getZoom();this._zoomInButton.disabled=t===this._map.getMaxZoom(),this._zoomOutButton.disabled=t===this._map.getMinZoom()},Un.prototype._rotateCompassArrow=function(){var t=this.options.visualizePitch?"scale("+1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)+") rotateX("+this._map.transform.pitch+"deg) rotateZ("+this._map.transform.angle*(180/Math.PI)+"deg)":"rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassIcon.style.transform=t},Un.prototype.onAdd=function(t){return this._map=t,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new bn(t,{button:"left",element:this._compass}),r.addEventListener(this._compass,"mousedown",this._handler.onMouseDown),r.addEventListener(this._compass,"touchstart",this._handler.onMouseDown,{passive:!1}),this._handler.enable()),this._container},Un.prototype.onRemove=function(){r.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),r.removeEventListener(this._compass,"mousedown",this._handler.onMouseDown),r.removeEventListener(this._compass,"touchstart",this._handler.onMouseDown,{passive:!1}),this._handler.disable(),delete this._handler),delete this._map},Un.prototype._createButton=function(t,e){var n=r.create("button",t,this._container);return n.type="button",n.addEventListener("click",e),n},Un.prototype._setButtonTitle=function(t,e){var r=this._map._getUIString("NavigationControl."+e);t.title=r,t.setAttribute("aria-label",r)};var Gn={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function Wn(t,e,r){var n=t.classList;for(var i in Gn)n.remove("mapboxgl-"+r+"-anchor-"+i);n.add("mapboxgl-"+r+"-anchor-"+e)}var Hn,qn=function(e){function n(n,i){var o=this;if(e.call(this),(n instanceof t.window.HTMLElement||i)&&(n=t.extend({element:n},i)),t.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=n&&n.anchor||"center",this._color=n&&n.color||"#3FB1CE",this._draggable=n&&n.draggable||!1,this._state="inactive",this._rotation=n&&n.rotation||0,this._rotationAlignment=n&&n.rotationAlignment||"auto",this._pitchAlignment=n&&n.pitchAlignment&&"auto"!==n.pitchAlignment?n.pitchAlignment:this._rotationAlignment,n&&n.element)this._element=n.element,this._offset=t.Point.convert(n&&n.offset||[0,0]);else{this._defaultMarker=!0,this._element=r.create("div"),this._element.setAttribute("aria-label","Map marker");var a=r.createNS("http://www.w3.org/2000/svg","svg");a.setAttributeNS(null,"display","block"),a.setAttributeNS(null,"height","41px"),a.setAttributeNS(null,"width","27px"),a.setAttributeNS(null,"viewBox","0 0 27 41");var s=r.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"stroke","none"),s.setAttributeNS(null,"stroke-width","1"),s.setAttributeNS(null,"fill","none"),s.setAttributeNS(null,"fill-rule","evenodd");var u=r.createNS("http://www.w3.org/2000/svg","g");u.setAttributeNS(null,"fill-rule","nonzero");var c=r.createNS("http://www.w3.org/2000/svg","g");c.setAttributeNS(null,"transform","translate(3.0, 29.0)"),c.setAttributeNS(null,"fill","#000000");for(var l=0,h=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];l<h.length;l+=1){var f=h[l],p=r.createNS("http://www.w3.org/2000/svg","ellipse");p.setAttributeNS(null,"opacity","0.04"),p.setAttributeNS(null,"cx","10.5"),p.setAttributeNS(null,"cy","5.80029008"),p.setAttributeNS(null,"rx",f.rx),p.setAttributeNS(null,"ry",f.ry),c.appendChild(p)}var d=r.createNS("http://www.w3.org/2000/svg","g");d.setAttributeNS(null,"fill",this._color);var A=r.createNS("http://www.w3.org/2000/svg","path");A.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),d.appendChild(A);var g=r.createNS("http://www.w3.org/2000/svg","g");g.setAttributeNS(null,"opacity","0.25"),g.setAttributeNS(null,"fill","#000000");var m=r.createNS("http://www.w3.org/2000/svg","path");m.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),g.appendChild(m);var y=r.createNS("http://www.w3.org/2000/svg","g");y.setAttributeNS(null,"transform","translate(6.0, 7.0)"),y.setAttributeNS(null,"fill","#FFFFFF");var v=r.createNS("http://www.w3.org/2000/svg","g");v.setAttributeNS(null,"transform","translate(8.0, 8.0)");var _=r.createNS("http://www.w3.org/2000/svg","circle");_.setAttributeNS(null,"fill","#000000"),_.setAttributeNS(null,"opacity","0.25"),_.setAttributeNS(null,"cx","5.5"),_.setAttributeNS(null,"cy","5.5"),_.setAttributeNS(null,"r","5.4999962");var b=r.createNS("http://www.w3.org/2000/svg","circle");b.setAttributeNS(null,"fill","#FFFFFF"),b.setAttributeNS(null,"cx","5.5"),b.setAttributeNS(null,"cy","5.5"),b.setAttributeNS(null,"r","5.4999962"),v.appendChild(_),v.appendChild(b),u.appendChild(c),u.appendChild(d),u.appendChild(g),u.appendChild(y),u.appendChild(v),a.appendChild(u),this._element.appendChild(a),this._offset=t.Point.convert(n&&n.offset||[0,-14])}this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",(function(t){t.preventDefault()})),this._element.addEventListener("mousedown",(function(t){t.preventDefault()})),this._element.addEventListener("focus",(function(){var t=o._map.getContainer();t.scrollTop=0,t.scrollLeft=0})),Wn(this._element,this._anchor,"marker"),this._popup=null}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.addTo=function(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this},n.prototype.remove=function(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),r.remove(this._element),this._popup&&this._popup.remove(),this},n.prototype.getLngLat=function(){return this._lngLat},n.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},n.prototype.getElement=function(){return this._element},n.prototype.setPopup=function(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){var e=Math.sqrt(Math.pow(13.5,2)/2);t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[e,-1*(24.6+e)],"bottom-right":[-e,-1*(24.6+e)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=t,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this},n.prototype._onKeyPress=function(t){var e=t.code,r=t.charCode||t.keyCode;"Space"!==e&&"Enter"!==e&&32!==r&&13!==r||this.togglePopup()},n.prototype._onMapClick=function(t){var e=t.originalEvent.target,r=this._element;this._popup&&(e===r||r.contains(e))&&this.togglePopup()},n.prototype.getPopup=function(){return this._popup},n.prototype.togglePopup=function(){var t=this._popup;return t?(t.isOpen()?t.remove():t.addTo(this._map),this):this},n.prototype._update=function(t){if(this._map){this._map.transform.renderWorldCopies&&(this._lngLat=Vn(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);var e="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?e="rotateZ("+this._rotation+"deg)":"map"===this._rotationAlignment&&(e="rotateZ("+(this._rotation-this._map.getBearing())+"deg)");var n="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?n="rotateX(0deg)":"map"===this._pitchAlignment&&(n="rotateX("+this._map.getPitch()+"deg)"),t&&"moveend"!==t.type||(this._pos=this._pos.round()),r.setTransform(this._element,Gn[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px) "+n+" "+e)}},n.prototype.getOffset=function(){return this._offset},n.prototype.setOffset=function(e){return this._offset=t.Point.convert(e),this._update(),this},n.prototype._onMove=function(e){this._pos=e.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new t.Event("dragstart"))),this.fire(new t.Event("drag"))},n.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new t.Event("dragend")),this._state="inactive"},n.prototype._addDragHandler=function(t){this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},n.prototype.setDraggable=function(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},n.prototype.isDraggable=function(){return this._draggable},n.prototype.setRotation=function(t){return this._rotation=t||0,this._update(),this},n.prototype.getRotation=function(){return this._rotation},n.prototype.setRotationAlignment=function(t){return this._rotationAlignment=t||"auto",this._update(),this},n.prototype.getRotationAlignment=function(){return this._rotationAlignment},n.prototype.setPitchAlignment=function(t){return this._pitchAlignment=t&&"auto"!==t?t:this._rotationAlignment,this._update(),this},n.prototype.getPitchAlignment=function(){return this._pitchAlignment},n}(t.Evented),Zn={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showUserLocation:!0},Xn=function(e){function n(r){e.call(this),this.options=t.extend({},Zn,r),t.bindAll(["_onSuccess","_onError","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.onAdd=function(e){var n;return this._map=e,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),n=this._setupUI,void 0!==Hn?n(Hn):void 0!==t.window.navigator.permissions?t.window.navigator.permissions.query({name:"geolocation"}).then((function(t){Hn="denied"!==t.state,n(Hn)})):(Hn=!!t.window.navigator.geolocation,n(Hn)),this._container},n.prototype.onRemove=function(){void 0!==this._geolocationWatchID&&(t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),r.remove(this._container),this._map=void 0},n.prototype._isOutOfMapMaxBounds=function(t){var e=this._map.getMaxBounds(),r=t.coords;return e&&(r.longitude<e.getWest()||r.longitude>e.getEast()||r.latitude<e.getSouth()||r.latitude>e.getNorth())},n.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}},n.prototype._onSuccess=function(e){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new t.Event("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(e),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("geolocate",e)),this._finish()},n.prototype._updateCamera=function(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude),n=e.coords.accuracy,i=this._map.getBearing(),o=t.extend({bearing:i},this.options.fitBoundsOptions);this._map.fitBounds(r.toBounds(n),o,{geolocateSource:!0})},n.prototype._updateMarker=function(t){t?this._userLocationDotMarker.setLngLat([t.coords.longitude,t.coords.latitude]).addTo(this._map):this._userLocationDotMarker.remove()},n.prototype._onError=function(e){if(this.options.trackUserLocation)if(1===e.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r),void 0!==this._geolocationWatchID&&this._clearWatch()}else this._setErrorState();"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("error",e)),this._finish()},n.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},n.prototype._setupUI=function(e){var n=this;if(this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this._geolocateButton=r.create("button","mapboxgl-ctrl-geolocate",this._container),r.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",!1===e){t.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i)}else{var o=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=o,this._geolocateButton.setAttribute("aria-label",o)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=r.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new qn(this._dotElement),this.options.trackUserLocation&&(this._watchState="OFF")),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(function(e){var r=e.originalEvent&&"resize"===e.originalEvent.type;e.geolocateSource||"ACTIVE_LOCK"!==n._watchState||r||(n._watchState="BACKGROUND",n._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),n._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),n.fire(new t.Event("trackuserlocationend")))}))},n.prototype.trigger=function(){if(!this._setup)return t.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new t.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new t.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}"OFF"===this._watchState&&void 0!==this._geolocationWatchID?this._clearWatch():void 0===this._geolocationWatchID&&(this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._geolocationWatchID=t.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,this.options.positionOptions))}else t.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},n.prototype._clearWatch=function(){t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},n}(t.Evented),Qn={maxWidth:100,unit:"metric"},Yn=function(e){this.options=t.extend({},Qn,e),t.bindAll(["_onMove","setUnit"],this)};function Kn(t,e,r){var n,i,o,a,s,u,c=r&&r.maxWidth||100,l=t._container.clientHeight/2,h=(n=t.unproject([0,l]),i=t.unproject([c,l]),o=Math.PI/180,a=n.lat*o,s=i.lat*o,u=Math.sin(a)*Math.sin(s)+Math.cos(a)*Math.cos(s)*Math.cos((i.lng-n.lng)*o),6371e3*Math.acos(Math.min(u,1)));if(r&&"imperial"===r.unit){var f=3.2808*h;f>5280?$n(e,c,f/5280,t._getUIString("ScaleControl.Miles")):$n(e,c,f,t._getUIString("ScaleControl.Feet"))}else r&&"nautical"===r.unit?$n(e,c,h/1852,t._getUIString("ScaleControl.NauticalMiles")):h>=1e3?$n(e,c,h/1e3,t._getUIString("ScaleControl.Kilometers")):$n(e,c,h,t._getUIString("ScaleControl.Meters"))}function $n(t,e,r,n){var i,o,a,s=(i=r,(o=Math.pow(10,(""+Math.floor(i)).length-1))*(a=(a=i/o)>=10?10:a>=5?5:a>=3?3:a>=2?2:a>=1?1:function(t){var e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(a))),u=s/r;t.style.width=e*u+"px",t.innerHTML=s+n}Yn.prototype.getDefaultPosition=function(){return"bottom-left"},Yn.prototype._onMove=function(){Kn(this._map,this._container,this.options)},Yn.prototype.onAdd=function(t){return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},Yn.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},Yn.prototype.setUnit=function(t){this.options.unit=t,Kn(this._map,this._container,this.options)};var Jn=function(e){this._fullscreen=!1,e&&e.container&&(e.container instanceof t.window.HTMLElement?this._container=e.container:t.warnOnce("Full screen control 'container' must be a DOM element.")),t.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in t.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in t.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in t.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in t.window.document&&(this._fullscreenchange="MSFullscreenChange")};Jn.prototype.onAdd=function(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},Jn.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Jn.prototype._checkFullscreenSupport=function(){return!!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},Jn.prototype._setupUI=function(){var e=this._fullscreenButton=r.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);r.create("span","mapboxgl-ctrl-icon",e).setAttribute("aria-hidden",!0),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},Jn.prototype._updateTitle=function(){var t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t},Jn.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Jn.prototype._isFullscreen=function(){return this._fullscreen},Jn.prototype._changeIcon=function(){(t.window.document.fullscreenElement||t.window.document.mozFullScreenElement||t.window.document.webkitFullscreenElement||t.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},Jn.prototype._onClickFullscreen=function(){this._isFullscreen()?t.window.document.exitFullscreen?t.window.document.exitFullscreen():t.window.document.mozCancelFullScreen?t.window.document.mozCancelFullScreen():t.window.document.msExitFullscreen?t.window.document.msExitFullscreen():t.window.document.webkitCancelFullScreen&&t.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var ti={closeButton:!0,closeOnClick:!0,className:"",maxWidth:"240px"},ei=function(e){function n(r){e.call(this),this.options=t.extend(Object.create(ti),r),t.bindAll(["_update","_onClickClose","remove"],this)}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.addTo=function(e){var r=this;return this._map=e,this.options.closeOnClick&&this._map.on("click",this._onClickClose),this._map.on("remove",this.remove),this._update(),this._trackPointer?(this._map.on("mousemove",(function(t){r._update(t.point)})),this._map.on("mouseup",(function(t){r._update(t.point)})),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new t.Event("open")),this},n.prototype.isOpen=function(){return!!this._map},n.prototype.remove=function(){return this._content&&r.remove(this._content),this._container&&(r.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("click",this._onClickClose),this._map.off("remove",this.remove),this._map.off("mousemove"),delete this._map),this.fire(new t.Event("close")),this},n.prototype.getLngLat=function(){return this._lngLat},n.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove"),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},n.prototype.trackPointer=function(){var t=this;return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",(function(e){t._update(e.point)})),this._map.on("drag",(function(e){t._update(e.point)})),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},n.prototype.getElement=function(){return this._container},n.prototype.setText=function(e){return this.setDOMContent(t.window.document.createTextNode(e))},n.prototype.setHTML=function(e){var r,n=t.window.document.createDocumentFragment(),i=t.window.document.createElement("body");for(i.innerHTML=e;r=i.firstChild;)n.appendChild(r);return this.setDOMContent(n)},n.prototype.getMaxWidth=function(){return this._container.style.maxWidth},n.prototype.setMaxWidth=function(t){return this.options.maxWidth=t,this._update(),this},n.prototype.setDOMContent=function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},n.prototype.addClassName=function(t){this._container.classList.add(t)},n.prototype.removeClassName=function(t){this._container.classList.remove(t)},n.prototype.toggleClassName=function(t){return this._container.classList.toggle(t)},n.prototype._createContent=function(){this._content&&r.remove(this._content),this._content=r.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=r.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClickClose))},n.prototype._update=function(e){var n=this,i=this._lngLat||this._trackPointer;if(this._map&&i&&this._content&&(this._container||(this._container=r.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=r.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(t){return n._container.classList.add(t)})),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Vn(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||e)){var o=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat),a=this.options.anchor,s=function e(r){if(r){if("number"==typeof r){var n=Math.round(Math.sqrt(.5*Math.pow(r,2)));return{center:new t.Point(0,0),top:new t.Point(0,r),"top-left":new t.Point(n,n),"top-right":new t.Point(-n,n),bottom:new t.Point(0,-r),"bottom-left":new t.Point(n,-n),"bottom-right":new t.Point(-n,-n),left:new t.Point(r,0),right:new t.Point(-r,0)}}if(r instanceof t.Point||Array.isArray(r)){var i=t.Point.convert(r);return{center:i,top:i,"top-left":i,"top-right":i,bottom:i,"bottom-left":i,"bottom-right":i,left:i,right:i}}return{center:t.Point.convert(r.center||[0,0]),top:t.Point.convert(r.top||[0,0]),"top-left":t.Point.convert(r["top-left"]||[0,0]),"top-right":t.Point.convert(r["top-right"]||[0,0]),bottom:t.Point.convert(r.bottom||[0,0]),"bottom-left":t.Point.convert(r["bottom-left"]||[0,0]),"bottom-right":t.Point.convert(r["bottom-right"]||[0,0]),left:t.Point.convert(r.left||[0,0]),right:t.Point.convert(r.right||[0,0])}}return e(new t.Point(0,0))}(this.options.offset);if(!a){var u,c=this._container.offsetWidth,l=this._container.offsetHeight;u=o.y+s.bottom.y<l?["top"]:o.y>this._map.transform.height-l?["bottom"]:[],o.x<c/2?u.push("left"):o.x>this._map.transform.width-c/2&&u.push("right"),a=0===u.length?"bottom":u.join("-")}var h=o.add(s[a]).round();r.setTransform(this._container,Gn[a]+" translate("+h.x+"px,"+h.y+"px)"),Wn(this._container,a,"popup")}},n.prototype._onClickClose=function(){this.remove()},n}(t.Evented),ri={version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:Fn,NavigationControl:Un,GeolocateControl:Xn,AttributionControl:In,ScaleControl:Yn,FullscreenControl:Jn,Popup:ei,Marker:qn,Style:Be,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,Evented:t.Evented,config:t.config,get accessToken(){return t.config.ACCESS_TOKEN},set accessToken(e){t.config.ACCESS_TOKEN=e},get baseApiUrl(){return t.config.API_URL},set baseApiUrl(e){t.config.API_URL=e},get workerCount(){return Rt.workerCount},set workerCount(t){Rt.workerCount=t},get maxParallelImageRequests(){return t.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(e){t.config.MAX_PARALLEL_IMAGE_REQUESTS=e},clearStorage:function(e){t.clearTileCache(e)},workerUrl:""};return ri})),r}()},function(t,e,r){"use strict";r.r(e);var n=r(2),i=r.n(n),o=r(5),a=r.n(o),s=r(6),u=r.n(s),c=r(1),l=r.n(c);function h(t){var e=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(t){return!1}}();return function(){var r,n=l()(t);if(e){var i=l()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return u()(this,r)}}var f=function(t){a()(r,t);var e=h(r);function r(){return i()(this,r),e.apply(this,arguments)}return r}(r(222).a);f.layerName="GreatCircleLayer",f.defaultProps={getHeight:{type:"accessor",value:0},greatCircle:!0};var p=r(3),d=r.n(p),A=r(0),g=r.n(A),m=r(190),y=r(215),v=r(10),_=r.n(v),b=r(118),x=r.n(b),w=180/Math.PI;function E(t,e,r){var n=1<<e;return[(t[0]+r[0])/n,(t[1]+r[1])/n]}function S(t){return t>=.5?1/3*(4*t*t-1):1/3*(1-4*(1-t)*(1-t))}function O(t){return[S(t[0]),S(t[1])]}function T(t,e){var r=_()(e,2),n=r[0],i=r[1];switch(t){case 0:return[1,n,i];case 1:return[-n,1,i];case 2:return[-n,-i,1];case 3:return[-1,-i,-n];case 4:return[i,-1,-n];case 5:return[i,n,-1];default:throw new Error("Invalid face")}}function P(t,e,r,n){if(0===n){1===r&&(e[0]=t-1-e[0],e[1]=t-1-e[1]);var i=e[0];e[0]=e[1],e[1]=i}}function M(t){if("string"==typeof t){if(t.indexOf("/")>0)return t;t=function(t){var e=t.padEnd(16,"0");return x.a.fromString(e,16)}(t)}return function(t){for(var e=x.a.fromString(t,!0,10).toString(2);e.length<64;)e="0"+e;for(var r=e.lastIndexOf("1"),n=e.substring(0,3),i=e.substring(3,r),o=i.length/2,a=x.a.fromString(n,!0,2).toString(10),s=x.a.fromString(i,!0,2).toString(4);s.length<o;)s="0"+s;return"".concat(a,"/").concat(s)}(t.toString())}function C(t){return function(t){for(var e,r,n,i,o,a,s=t.face,u=t.ij,c=t.level,l=[[0,0],[0,1],[1,1],[1,0],[0,0]],h=Math.max(1,Math.ceil(100*Math.pow(2,-c))),f=new Float64Array(4*h*2+2),p=0,d=0,A=0;A<4;A++)for(var g=l[A].slice(0),m=l[A+1],y=(m[0]-g[0])/h,v=(m[1]-g[1])/h,b=0;b<h;b++){g[0]+=y,g[1]+=v;var x=T(s,O(E(u,c,g))),S=(e=x,r=void 0,n=void 0,i=void 0,o=void 0,a=void 0,r=_()(e,3),n=r[0],i=r[1],o=r[2],a=Math.atan2(o,Math.sqrt(n*n+i*i)),[Math.atan2(i,n)*w,a*w]);Math.abs(S[1])>89.999&&(S[0]=d);var P=S[0]-d;S[0]+=P>180?-360:P<-180?360:0,f[p++]=S[0],f[p++]=S[1],d=S[0]}return f[p++]=f[0],f[p++]=f[1],f}(function(t){for(var e,r=t.split("/"),n=parseInt(r[0],10),i=r[1],o=i.length,a=[0,0],s=o-1;s>=0;s--){e=o-s;var u=i[s],c=0,l=0;"1"===u?l=1:"2"===u?(c=1,l=1):"3"===u&&(c=1);var h=Math.pow(2,e-1);P(h,a,c,l),a[0]+=h*c,a[1]+=h*l}if(n%2==1){var f=a[0];a[0]=a[1],a[1]=f}return{face:n,ij:a,level:e}}(M(t)))}function I(t){var e=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(t){return!1}}();return function(){var r,n=l()(t);if(e){var i=l()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return u()(this,r)}}function k(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function R(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?k(Object(r),!0).forEach((function(e){g()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):k(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var L=R(R({},y.a.defaultProps),{},{getS2Token:{type:"accessor",value:function(t){return t.token}}}),j=function(t){a()(r,t);var e=I(r);function r(){return i()(this,r),e.apply(this,arguments)}return d()(r,[{key:"renderLayers",value:function(){var t=this.props,e=t.data,r=t.getS2Token,n=this.props,i=n.elevationScale,o=n.extruded,a=n.wireframe,s=n.filled,u=n.stroked,c=n.lineWidthUnits,l=n.lineWidthScale,h=n.lineWidthMinPixels,f=n.lineWidthMaxPixels,p=n.lineJointRounded,d=n.lineMiterLimit,A=n.lineDashJustified,g=n.getElevation,m=n.getFillColor,v=n.getLineColor,_=n.getLineWidth,b=n.getLineDashArray,x=this.props,w=x.updateTriggers,E=x.material;return new(this.getSubLayerClass("cell",y.a))({filled:s,wireframe:a,extruded:o,elevationScale:i,stroked:u,lineWidthUnits:c,lineWidthScale:l,lineWidthMinPixels:h,lineWidthMaxPixels:f,lineJointRounded:p,lineMiterLimit:d,lineDashJustified:A,material:E,getElevation:g,getFillColor:m,getLineColor:v,getLineWidth:_,getLineDashArray:b},this.getSubLayerProps({id:"cell",updateTriggers:{getElevation:w.getElevation,getFillColor:w.getFillColor,getLineColor:w.getLineColor,getLineWidth:w.getLineWidth,getLineDashArray:w.getLineDashArray}}),{data:e,_normalize:!1,positionFormat:"XY",getPolygon:function(t,e){return C(r(t,e))}})}}]),r}(m.a);j.layerName="S2Layer",j.defaultProps=L;var D=r(66),B=r(221),F=r(43),z=r.n(F),N=r(68),U=r.n(N),V=r(18),G=function(){function t(e){var r=e.x,n=e.y,o=e.z;i()(this,t),this.x=r,this.y=n,this.z=o,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}var e;return d()(t,[{key:"_loadData",value:(e=U()(z.a.mark((function t(e){var r,n,i,o,a,s,u,c,l,h,f,p,d;return z.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.getData,n=e.requestScheduler,i=e.onLoad,o=e.onError,a=this.x,s=this.y,u=this.z,c=this.bbox,l=this._loaderId,this._abortController=new AbortController,h=this._abortController.signal,t.next=7,n.scheduleRequest(this,(function(t){return t.isSelected?1:-1}));case 7:if(f=t.sent){t.next=11;break}return this._isCancelled=!0,t.abrupt("return");case 11:if(!this._isCancelled){t.next=14;break}return f.done(),t.abrupt("return");case 14:return p=null,t.prev=15,t.next=18,r({x:a,y:s,z:u,bbox:c,signal:h});case 18:p=t.sent,t.next=24;break;case 21:t.prev=21,t.t0=t.catch(15),d=t.t0||!0;case 24:return t.prev=24,f.done(),t.finish(24);case 27:if(l===this._loaderId){t.next=29;break}return t.abrupt("return");case 29:if(this._loader=void 0,this.content=p,!this._isCancelled||p){t.next=34;break}return this._isLoaded=!1,t.abrupt("return");case 34:this._isLoaded=!0,this._isCancelled=!1,d?o(d,this):i(this);case 37:case"end":return t.stop()}}),t,this,[[15,21,24,27]])}))),function(t){return e.apply(this,arguments)})},{key:"loadData",value:function(t){return this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1,this._loaderId++,this._loader=this._loadData(t),this._loader}},{key:"setNeedsReload",value:function(){this.isLoading&&(this.abort(),this._loader=void 0),this._needsReload=!0}},{key:"abort",value:function(){this.isLoaded||(this._isCancelled=!0,this._abortController.abort())}},{key:"data",get:function(){var t=this;return this.isLoading?this._loader.then((function(){return t.data})):this.content}},{key:"isLoaded",get:function(){return this._isLoaded&&!this._needsReload}},{key:"isLoading",get:function(){return Boolean(this._loader)&&!this._isCancelled}},{key:"needsReload",get:function(){return this._needsReload||this._isCancelled}},{key:"byteLength",get:function(){var t=this.content?this.content.byteLength:0;return Number.isFinite(t)||V.a.error("byteLength not defined in tile data")(),t}}]),t}(),W=r(44),H=r.n(W);const q=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1});var Z=r(147);const X=new Z.a,Q=new Z.a;class Y{constructor(t=[0,0,0],e=[0,0,0],r=null){r=r||X.copy(t).add(e).scale(.5),this.center=new Z.a(r),this.halfDiagonal=new Z.a(e).subtract(this.center),this.minimum=new Z.a(t),this.maximum=new Z.a(e)}clone(){return new Y(this.minimum,this.maximum,this.center)}equals(t){return this===t||Boolean(t)&&this.minimum.equals(t.minimum)&&this.maximum.equals(t.maximum)}transform(t){return this.center.transformAsPoint(t),this.halfDiagonal.transform(t),this.minimum.transform(t),this.maximum.transform(t),this}intersectPlane(t){const{halfDiagonal:e}=this,r=Q.from(t.normal),n=e.x*Math.abs(r.x)+e.y*Math.abs(r.y)+e.z*Math.abs(r.z),i=this.center.dot(r)+t.distance;return i-n>0?q.INSIDE:i+n<0?q.OUTSIDE:q.INTERSECTING}distanceTo(t){return Math.sqrt(this.distanceSquaredTo(t))}distanceSquaredTo(t){const e=X.from(t).subtract(this.center),{halfDiagonal:r}=this;let n,i=0;return n=Math.abs(e.x)-r.x,n>0&&(i+=n*n),n=Math.abs(e.y)-r.y,n>0&&(i+=n*n),n=Math.abs(e.z)-r.z,n>0&&(i+=n*n),i}}var K=r(17);const $=new Z.a,J=new Z.a;class tt{constructor(t=[0,0,0],e=0){this.radius=-0,this.center=new Z.a,this.fromCenterRadius(t,e)}fromCenterRadius(t,e){return this.center.from(t),this.radius=e,this}fromCornerPoints(t,e){return e=$.from(e),this.center=(new Z.a).from(t).add(e).scale(.5),this.radius=this.center.distance(e),this}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.radius===t.radius}clone(){return new tt(this.center,this.radius)}union(t){const e=this.center,r=this.radius,n=t.center,i=t.radius,o=$.copy(n).subtract(e),a=o.magnitude();if(r>=a+i)return this.clone();if(i>=a+r)return t.clone();const s=.5*(r+a+i);return J.copy(o).scale((-r+s)/a).add(e),this.center.copy(J),this.radius=s,this}expand(t){const e=(t=$.from(t)).subtract(this.center).magnitude();return e>this.radius&&(this.radius=e),this}transform(t){this.center.transform(t);const e=K.e($,t);return this.radius=Math.max(e[0],Math.max(e[1],e[2]))*this.radius,this}distanceSquaredTo(t){const e=this.distanceTo(t);return e*e}distanceTo(t){const e=(t=$.from(t)).subtract(this.center);return Math.max(0,e.len()-this.radius)}intersectPlane(t){const e=this.center,r=this.radius,n=t.normal.dot(e)+t.distance;return n<-r?q.OUTSIDE:n<r?q.INTERSECTING:q.INSIDE}}var et=r(216),rt=r(228);const nt=new Z.a,it=new Z.a,ot=new Z.a,at=new Z.a,st=new Z.a,ut=new Z.a,ct=new Z.a,lt=0,ht=1,ft=2,pt=3,dt=4,At=5,gt=6,mt=7,yt=8;class vt{constructor(t=[0,0,0],e=[0,0,0,0,0,0,0,0,0]){this.center=(new Z.a).from(t),this.halfAxes=new et.a(e)}get halfSize(){const t=this.halfAxes.getColumn(0),e=this.halfAxes.getColumn(1),r=this.halfAxes.getColumn(2);return[new Z.a(t).len(),new Z.a(e).len(),new Z.a(r).len()]}get quaternion(){const t=this.halfAxes.getColumn(0),e=this.halfAxes.getColumn(1),r=this.halfAxes.getColumn(2),n=new Z.a(t).normalize(),i=new Z.a(e).normalize(),o=new Z.a(r).normalize();return(new rt.a).fromMatrix3(new et.a([...n,...i,...o]))}fromCenterHalfSizeQuaternion(t,e,r){const n=new rt.a(r),i=(new et.a).fromQuaternion(n);return i[0]=i[0]*e[0],i[1]=i[1]*e[0],i[2]=i[2]*e[0],i[3]=i[3]*e[1],i[4]=i[4]*e[1],i[5]=i[5]*e[1],i[6]=i[6]*e[2],i[7]=i[7]*e[2],i[8]=i[8]*e[2],this.center=(new Z.a).from(t),this.halfAxes=i,this}clone(){return new vt(this.center,this.halfAxes)}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.halfAxes.equals(t.halfAxes)}getBoundingSphere(t=new tt){const e=this.halfAxes,r=e.getColumn(0,ot),n=e.getColumn(1,at),i=e.getColumn(2,st),o=nt.copy(r).add(n).add(i);return t.center.copy(this.center),t.radius=o.magnitude(),t}intersectPlane(t){const e=this.center,r=t.normal,n=this.halfAxes,i=r.x,o=r.y,a=r.z,s=Math.abs(i*n[lt]+o*n[ht]+a*n[ft])+Math.abs(i*n[pt]+o*n[dt]+a*n[At])+Math.abs(i*n[gt]+o*n[mt]+a*n[yt]),u=r.dot(e)+t.distance;return u<=-s?q.OUTSIDE:u>=s?q.INSIDE:q.INTERSECTING}distanceTo(t){return Math.sqrt(this.distanceSquaredTo(t))}distanceSquaredTo(t){const e=it.from(t).subtract(this.center),r=this.halfAxes,n=r.getColumn(0,ot),i=r.getColumn(1,at),o=r.getColumn(2,st),a=n.magnitude(),s=i.magnitude(),u=o.magnitude();n.normalize(),i.normalize(),o.normalize();let c,l=0;return c=Math.abs(e.dot(n))-a,c>0&&(l+=c*c),c=Math.abs(e.dot(i))-s,c>0&&(l+=c*c),c=Math.abs(e.dot(o))-u,c>0&&(l+=c*c),l}computePlaneDistances(t,e,r=[-0,-0]){let n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;const o=this.center,a=this.halfAxes,s=a.getColumn(0,ot),u=a.getColumn(1,at),c=a.getColumn(2,st),l=ut.copy(s).add(u).add(c).add(o),h=ct.copy(l).subtract(t);let f=e.dot(h);return n=Math.min(f,n),i=Math.max(f,i),l.copy(o).add(s).add(u).subtract(c),h.copy(l).subtract(t),f=e.dot(h),n=Math.min(f,n),i=Math.max(f,i),l.copy(o).add(s).subtract(u).add(c),h.copy(l).subtract(t),f=e.dot(h),n=Math.min(f,n),i=Math.max(f,i),l.copy(o).add(s).subtract(u).subtract(c),h.copy(l).subtract(t),f=e.dot(h),n=Math.min(f,n),i=Math.max(f,i),o.copy(l).subtract(s).add(u).add(c),h.copy(l).subtract(t),f=e.dot(h),n=Math.min(f,n),i=Math.max(f,i),o.copy(l).subtract(s).add(u).subtract(c),h.copy(l).subtract(t),f=e.dot(h),n=Math.min(f,n),i=Math.max(f,i),o.copy(l).subtract(s).subtract(u).add(c),h.copy(l).subtract(t),f=e.dot(h),n=Math.min(f,n),i=Math.max(f,i),o.copy(l).subtract(s).subtract(u).subtract(c),h.copy(l).subtract(t),f=e.dot(h),n=Math.min(f,n),i=Math.max(f,i),r[0]=n,r[1]=i,r}transform(t){this.center.transformAsPoint(t);const e=this.halfAxes.getColumn(0,ot);e.transformAsPoint(t);const r=this.halfAxes.getColumn(1,at);r.transformAsPoint(t);const n=this.halfAxes.getColumn(2,st);return n.transformAsPoint(t),this.halfAxes=new et.a([...e,...r,...n]),this}getTransform(){throw new Error("not implemented")}}var _t=r(42),bt=r(13);const xt=new Z.a,wt=new Z.a;class Et{constructor(t=[0,0,1],e=0){this.normal=new Z.a,this.distance=-0,this.fromNormalDistance(t,e)}fromNormalDistance(t,e){return Object(_t.a)(Number.isFinite(e)),this.normal.from(t).normalize(),this.distance=e,this}fromPointNormal(t,e){t=xt.from(t),this.normal.from(e).normalize();const r=-this.normal.dot(t);return this.distance=r,this}fromCoefficients(t,e,r,n){return this.normal.set(t,e,r),Object(_t.a)(Object(bt.d)(this.normal.len(),1)),this.distance=n,this}clone(t){return new Et(this.normal,this.distance)}equals(t){return Object(bt.d)(this.distance,t.distance)&&Object(bt.d)(this.normal,t.normal)}getPointDistance(t){return this.normal.dot(t)+this.distance}transform(t){const e=wt.copy(this.normal).transformAsVector(t).normalize(),r=this.normal.scale(-this.distance).transform(t);return this.fromPointNormal(r,e)}projectPointOntoPlane(t,e=[0,0,0]){t=xt.from(t);const r=this.getPointDistance(t),n=wt.copy(this.normal).scale(r);return t.subtract(n).to(e)}}const St=[new Z.a([1,0,0]),new Z.a([0,1,0]),new Z.a([0,0,1])],Ot=new Z.a,Tt=new Z.a;new Et(new Z.a(1,0,0),0);class Pt{static get MASK_OUTSIDE(){return 4294967295}static get MASK_INSIDE(){return 0}static get MASK_INDETERMINATE(){return 2147483647}constructor(t=[]){this.planes=t,Object(_t.a)(this.planes.every(t=>t instanceof Et))}fromBoundingSphere(t){this.planes.length=2*St.length;const e=t.center,r=t.radius;let n=0;for(const t of St){let i=this.planes[n],o=this.planes[n+1];i||(i=this.planes[n]=new Et),o||(o=this.planes[n+1]=new Et);const a=Ot.copy(t).scale(-r).add(e);t.dot(a);i.fromPointNormal(a,t);const s=Ot.copy(t).scale(r).add(e),u=Tt.copy(t).negate();u.dot(s);o.fromPointNormal(s,u),n+=2}return this}computeVisibility(t){Object(_t.a)(t);let e=q.INSIDE;for(const r of this.planes){switch(t.intersectPlane(r)){case q.OUTSIDE:return q.OUTSIDE;case q.INTERSECTING:e=q.INTERSECTING}}return e}computeVisibilityWithPlaneMask(t,e){if(Object(_t.a)(t,"boundingVolume is required."),Object(_t.a)(Number.isFinite(e),"parentPlaneMask is required."),e===Pt.MASK_OUTSIDE||e===Pt.MASK_INSIDE)return e;let r=Pt.MASK_INSIDE;const n=this.planes;for(let i=0;i<this.planes.length;++i){const o=i<31?1<<i:0;if(i<31&&0==(e&o))continue;const a=n[i],s=t.intersectPlane(a);if(s===q.OUTSIDE)return Pt.MASK_OUTSIDE;s===q.INTERSECTING&&(r|=o)}return r}}var Mt=r(205);new Z.a,new Z.a,new Z.a,new Z.a,new Z.a;new Z.a,new Z.a,new Z.a,new Z.a,new Z.a,new Z.a,new Z.a,new Z.a,new Z.a,new Z.a,new Z.a,new Z.a,Math.PI;var Ct=r(217);const It=new et.a,kt=new et.a,Rt=new et.a,Lt=new et.a,jt=new et.a;function Dt(t,e={}){const r=Ct.a.EPSILON20;let n=0,i=0;const o=kt,a=Rt;o.identity(),a.copy(t);const s=r*function(t){let e=0;for(let r=0;r<9;++r){const n=t[r];e+=n*n}return Math.sqrt(e)}(a);for(;i<10&&zt(a)>s;)Nt(a,Lt),jt.copy(Lt).transpose(),a.multiplyRight(Lt),a.multiplyLeft(jt),o.multiplyRight(Lt),++n>2&&(++i,n=0);return e.unitary=o.toTarget(e.unitary),e.diagonal=a.toTarget(e.diagonal),e}const Bt=[1,0,0],Ft=[2,2,1];function zt(t){let e=0;for(let r=0;r<3;++r){const n=t[It.getElementIndex(Ft[r],Bt[r])];e+=2*n*n}return Math.sqrt(e)}function Nt(t,e){const r=Ct.a.EPSILON15;let n=0,i=1;for(let e=0;e<3;++e){const r=Math.abs(t[It.getElementIndex(Ft[e],Bt[e])]);r>n&&(i=e,n=r)}const o=Bt[i],a=Ft[i];let s=1,u=0;if(Math.abs(t[It.getElementIndex(a,o)])>r){const e=(t[It.getElementIndex(a,a)]-t[It.getElementIndex(o,o)])/2/t[It.getElementIndex(a,o)];let r;r=e<0?-1/(-e+Math.sqrt(1+e*e)):1/(e+Math.sqrt(1+e*e)),s=1/Math.sqrt(1+r*r),u=r*s}return et.a.IDENTITY.to(e),e[It.getElementIndex(o,o)]=e[It.getElementIndex(a,a)]=s,e[It.getElementIndex(a,o)]=u,e[It.getElementIndex(o,a)]=-u,e}const Ut=new Z.a,Vt=new Z.a,Gt=new Z.a,Wt=new Z.a,Ht=new Z.a,qt=new et.a,Zt={diagonal:new et.a,unitary:new et.a};var Xt=r(22);function Qt(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Yt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Yt(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Yt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var Kt=[[.5,.5],[0,0],[0,1],[1,0],[1,1]],$t=Kt.concat([[0,.5],[.5,0],[1,.5],[.5,1]]),Jt=$t.concat([[.25,.5],[.75,.5]]),te=function(){function t(e,r,n){i()(this,t),this.x=e,this.y=r,this.z=n}return d()(t,[{key:"update",value:function(t){var e=t.viewport,r=t.cullingVolume,n=t.elevationBounds,i=t.minZ,o=t.maxZ,a=t.bounds,s=t.offset,u=t.project,c=this.getBoundingVolume(n,s,u);if(a&&!this.insideBounds(a))return!1;if(r.computeVisibility(c)<0)return!1;if(!this.childVisible){var l=this.z;if(l<o&&l>=i){var h=c.distanceTo(e.cameraPosition)*e.scale/e.height;l+=Math.floor(Math.log2(h))}if(l>=o)return this.selected=!0,!0}this.selected=!1,this.childVisible=!0;var f,p=Qt(this.children);try{for(p.s();!(f=p.n()).done;){f.value.update(t)}}catch(t){p.e(t)}finally{p.f()}return!0}},{key:"getSelected",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(this.selected&&t.push(this),this._children){var e,r=Qt(this._children);try{for(r.s();!(e=r.n()).done;){var n=e.value;n.getSelected(t)}}catch(t){r.e(t)}finally{r.f()}}return t}},{key:"insideBounds",value:function(t){var e=_()(t,4),r=e[0],n=e[1],i=e[2],o=e[3],a=512/Math.pow(2,this.z);return this.x*a<i&&this.y*a<o&&(this.x+1)*a>r&&(this.y+1)*a>n}},{key:"getBoundingVolume",value:function(t,e,r){if(r){var n,i=[],o=Qt(this.z<1?Jt:this.z<2?$t:Kt);try{for(o.s();!(n=o.n()).done;){var a=n.value,s=ae(this.x+a[0],this.y+a[1],this.z);s[2]=t[0],i.push(r(s)),t[0]!==t[1]&&(s[2]=t[1],i.push(r(s)))}}catch(t){o.e(t)}finally{o.f()}return function(t,e=new vt){if(!t||0===t.length)return e.halfAxes=new et.a([0,0,0,0,0,0,0,0,0]),e.center=new Z.a,e;const r=t.length,n=new Z.a(0,0,0);for(const e of t)n.add(e);const i=1/r;n.multiplyByScalar(i);let o=0,a=0,s=0,u=0,c=0,l=0;for(const e of t){const t=Ut.copy(e).subtract(n);o+=t.x*t.x,a+=t.x*t.y,s+=t.x*t.z,u+=t.y*t.y,c+=t.y*t.z,l+=t.z*t.z}o*=i,a*=i,s*=i,u*=i,c*=i,l*=i;const h=qt;h[0]=o,h[1]=a,h[2]=s,h[3]=a,h[4]=u,h[5]=c,h[6]=s,h[7]=c,h[8]=l;const{unitary:f}=Dt(h,Zt),p=e.halfAxes.copy(f);let d=p.getColumn(0,Gt),A=p.getColumn(1,Wt),g=p.getColumn(2,Ht),m=-Number.MAX_VALUE,y=-Number.MAX_VALUE,v=-Number.MAX_VALUE,_=Number.MAX_VALUE,b=Number.MAX_VALUE,x=Number.MAX_VALUE;for(const e of t)Ut.copy(e),m=Math.max(Ut.dot(d),m),y=Math.max(Ut.dot(A),y),v=Math.max(Ut.dot(g),v),_=Math.min(Ut.dot(d),_),b=Math.min(Ut.dot(A),b),x=Math.min(Ut.dot(g),x);d=d.multiplyByScalar(.5*(_+m)),A=A.multiplyByScalar(.5*(b+y)),g=g.multiplyByScalar(.5*(x+v)),e.center.copy(d).add(A).add(g);const w=Vt.set(m-_,y-b,v-x).multiplyByScalar(.5),E=new et.a([w[0],0,0,0,w[1],0,0,0,w[2]]);return e.halfAxes.multiplyRight(E),e}(i)}var u=512/Math.pow(2,this.z),c=this.x*u+512*e,l=512-(this.y+1)*u;return new Y([c,l,t[0]],[c+u,l+u,t[1]])}},{key:"children",get:function(){if(!this._children){var e=2*this.x,r=2*this.y,n=this.z+1;this._children=[new t(e,r,n),new t(e,r+1,n),new t(e+1,r,n),new t(e+1,r+1,n)]}return this._children}}]),t}();var ee=[-1/0,-1/0,1/0,1/0],re={type:"url",value:null,validate:function(t,e){return e.optional&&null===t||"string"==typeof t||Array.isArray(t)&&t.every((function(t){return"string"==typeof t}))},equals:function(t,e){if(t===e)return!0;if(!Array.isArray(t)||!Array.isArray(e))return!1;var r=t.length;if(r!==e.length)return!1;for(var n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}};function ne(t,e){var r=[e.transformPoint([t[0],t[1]]),e.transformPoint([t[2],t[1]]),e.transformPoint([t[0],t[3]]),e.transformPoint([t[2],t[3]])];return[Math.min.apply(Math,H()(r.map((function(t){return t[0]})))),Math.min.apply(Math,H()(r.map((function(t){return t[1]})))),Math.max.apply(Math,H()(r.map((function(t){return t[0]})))),Math.max.apply(Math,H()(r.map((function(t){return t[1]}))))]}function ie(t,e){if(!t||!t.length)return null;Array.isArray(t)&&(t=t[Math.abs(e.x+e.y)%t.length]);var r=e.x,n=e.y,i=e.z;return t.replace("{x}",r).replace("{y}",n).replace("{z}",i).replace("{-y}",Math.pow(2,i)-n-1)}function oe(t,e){return 512*Math.pow(2,t)/e}function ae(t,e,r){var n=oe(r,512),i=t/n*360-180,o=Math.PI-2*Math.PI*e/n;return[i,180/Math.PI*Math.atan(.5*(Math.exp(o)-Math.exp(-o)))]}function se(t,e,r,n){var i=oe(r,n);return[t/i*512,e/i*512]}function ue(t,e,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:512;if(t.isGeospatial){var o=ae(e,r,n),a=_()(o,2),s=a[0],u=a[1],c=ae(e+1,r+1,n),l=_()(c,2),h=l[0],f=l[1];return{west:s,north:u,east:h,south:f}}var p=se(e,r,n,i),d=_()(p,2),A=d[0],g=d[1],m=se(e+1,r+1,n,i),y=_()(m,2),v=y[0],b=y[1];return{left:A,top:g,right:v,bottom:b}}function ce(t,e,r,n,i){for(var o=function(t,e,r){return r?ne(t,r).map((function(t){return t*e/512})):t.map((function(t){return t*e/512}))}(function(t,e,r){var n;if(e&&2===e.length){var i=_()(e,2),o=i[0],a=i[1],s=t.getBounds({z:o}),u=t.getBounds({z:a});n=[Math.min(s[0],u[0]),Math.min(s[1],u[1]),Math.max(s[2],u[2]),Math.max(s[3],u[3])]}else n=t.getBounds();return t.isGeospatial?[Math.max(n[0],r[0]),Math.max(n[1],r[1]),Math.min(n[2],r[2]),Math.min(n[3],r[3])]:[Math.max(Math.min(n[0],r[2]),r[0]),Math.max(Math.min(n[1],r[3]),r[1]),Math.min(Math.max(n[2],r[0]),r[2]),Math.min(Math.max(n[3],r[1]),r[3])]}(t,null,n),oe(e,r),i),a=_()(o,4),s=a[0],u=a[1],c=a[2],l=a[3],h=[],f=Math.floor(s);f<c;f++)for(var p=Math.floor(u);p<l;p++)h.push({x:f,y:p,z:e});return h}function le(t){var e=t.viewport,r=t.maxZoom,n=t.minZoom,i=t.zRange,o=t.extent,a=t.tileSize,s=void 0===a?512:a,u=t.modelMatrix,c=t.modelMatrixInverse,l=t.zoomOffset,h=void 0===l?0:l,f=e.isGeospatial?Math.round(e.zoom+Math.log2(512/s))+h:Math.ceil(e.zoom)+h;if(Number.isFinite(n)&&f<n){if(!o)return[];f=n}Number.isFinite(r)&&f>r&&(f=r);var p=o;return u&&c&&o&&!e.isGeospatial&&(p=ne(o,u)),e.isGeospatial?function(t,e,r,n){var i=t.resolution?t.projectPosition:null,o=Object.values(t.getFrustumPlanes()).map((function(t){var e=t.normal,r=t.distance;return new Et(e.clone().negate(),r)})),a=new Pt(o),s=t.distanceScales.unitsPerMeter[2],u=r&&r[0]*s||0,c=r&&r[1]*s||0,l=t.pitch<=60?e:0;if(n){var h=n,f=_()(h,4),p=f[0],d=f[1],A=f[2],g=f[3],m=Object(Xt.l)([p,g]),y=Object(Xt.l)([A,d]);n=[m[0],512-m[1],y[0],512-y[1]]}var v=new te(0,0,0),b={viewport:t,project:i,cullingVolume:a,elevationBounds:[u,c],minZ:l,maxZ:e,bounds:n,offset:0};if(v.update(b),t.subViewports&&t.subViewports.length>1){for(b.offset=-1;v.update(b)&&!(--b.offset<-3););for(b.offset=1;v.update(b)&&!(++b.offset>3););}return v.getSelected()}(e,f,i,o):ce(e,f,s,p||ee,c)}var he=r(211),fe=r(11);function pe(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return de(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return de(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function de(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var Ae=function(){function t(e){var r=this;i()(this,t),this.opts=e,this.onTileLoad=function(t){r.opts.onTileLoad(t),r.opts.maxCacheByteSize&&(r._cacheByteSize+=t.byteLength,r._resizeCache())},this._requestScheduler=new he.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.setOptions(e)}return d()(t,[{key:"setOptions",value:function(t){Object.assign(this.opts,t),Number.isFinite(t.maxZoom)&&(this._maxZoom=Math.floor(t.maxZoom)),Number.isFinite(t.minZoom)&&(this._minZoom=Math.ceil(t.minZoom))}},{key:"finalize",value:function(){var t,e=pe(this._cache.values());try{for(e.s();!(t=e.n()).done;){var r=t.value;r.isLoading&&r.abort()}}catch(t){e.e(t)}finally{e.f()}this._cache.clear(),this._tiles=[],this._selectedTiles=null}},{key:"reloadAll",value:function(){var t,e=pe(this._cache.keys());try{for(e.s();!(t=e.n()).done;){var r=t.value,n=this._cache.get(r);this._selectedTiles.includes(n)?n.setNeedsReload():this._cache.delete(r)}}catch(t){e.e(t)}finally{e.f()}}},{key:"update",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.zRange,i=r.modelMatrix,o=new fe.a(i),a=!o.equals(this._modelMatrix);if(!t.equals(this._viewport)||a){a&&(this._modelMatrixInverse=i&&o.clone().invert(),this._modelMatrix=i&&o),this._viewport=t;var s=this.getTileIndices({viewport:t,maxZoom:this._maxZoom,minZoom:this._minZoom,zRange:n,modelMatrix:this._modelMatrix,modelMatrixInverse:this._modelMatrixInverse});this._selectedTiles=s.map((function(t){return e._getTile(t,!0)})),this._dirty&&this._rebuildTree()}var u=this.updateTileStates();return this._dirty&&this._resizeCache(),u&&this._frameNumber++,this._frameNumber}},{key:"getTileIndices",value:function(t){var e=t.viewport,r=t.maxZoom,n=t.minZoom,i=t.zRange,o=t.modelMatrix,a=t.modelMatrixInverse,s=this.opts;return le({viewport:e,maxZoom:r,minZoom:n,zRange:i,tileSize:s.tileSize,extent:s.extent,modelMatrix:o,modelMatrixInverse:a,zoomOffset:s.zoomOffset})}},{key:"getTileMetadata",value:function(t){var e=t.x,r=t.y,n=t.z,i=this.opts.tileSize;return{bbox:ue(this._viewport,e,r,n,i)}}},{key:"getParentIndex",value:function(t){return t.x=Math.floor(t.x/2),t.y=Math.floor(t.y/2),t.z-=1,t}},{key:"updateTileStates",value:function(){this._updateTileStates(this.selectedTiles);var t,e=this.opts.maxRequests,r=[],n=0,i=!1,o=pe(this._cache.values());try{for(o.s();!(t=o.n()).done;){var a=t.value,s=Boolean(1&a.state);a.isVisible!==s&&(i=!0,a.isVisible=s),a.isSelected=5===a.state,a.isLoading&&(n++,a.isSelected||r.push(a))}}catch(t){o.e(t)}finally{o.f()}if(e>0)for(;n>e&&r.length>0;){r.shift().abort(),n--}return i}},{key:"_rebuildTree",value:function(){var t,e=this._cache,r=pe(e.values());try{for(r.s();!(t=r.n()).done;){var n=t.value;n.parent=null,n.children.length=0}}catch(t){r.e(t)}finally{r.f()}var i,o=pe(e.values());try{for(o.s();!(i=o.n()).done;){var a=i.value,s=this._getNearestAncestor(a.x,a.y,a.z);a.parent=s,s&&s.children.push(a)}}catch(t){o.e(t)}finally{o.f()}}},{key:"_updateTileStates",value:function(t){var e,r=this._cache,n=this.opts.refinementStrategy||"best-available",i=pe(r.values());try{for(i.s();!(e=i.n()).done;){e.value.state=0}}catch(t){i.e(t)}finally{i.f()}var o,a=pe(t);try{for(a.s();!(o=a.n()).done;){o.value.state=5}}catch(t){a.e(t)}finally{a.f()}if("never"!==n){var s,u=pe(t);try{for(u.s();!(s=u.n()).done;){me(s.value,n)}}catch(t){u.e(t)}finally{u.f()}var c,l=pe(t);try{for(l.s();!(c=l.n()).done;){var h=c.value;ge(h)&&ye(h)}}catch(t){l.e(t)}finally{l.f()}}}},{key:"_resizeCache",value:function(){var t=this._cache,e=this.opts,r=e.maxCacheSize||(e.maxCacheByteSize?1/0:5*this.selectedTiles.length),n=e.maxCacheByteSize||1/0;if(t.size>r||this._cacheByteSize>n){var i,o=pe(t);try{for(o.s();!(i=o.n()).done;){var a=_()(i.value,2),s=a[0],u=a[1];if(u.isVisible||(this._cacheByteSize-=e.maxCacheByteSize?u.byteLength:0,t.delete(s),this.opts.onTileUnload(u)),t.size<=r&&this._cacheByteSize<=n)break}}catch(t){o.e(t)}finally{o.f()}this._rebuildTree(),this._dirty=!0}this._dirty&&(this._tiles=Array.from(this._cache.values()).sort((function(t,e){return t.z-e.z})),this._dirty=!1)}},{key:"_getTile",value:function(t,e){var r=t.x,n=t.y,i=t.z,o="".concat(r,",").concat(n,",").concat(i),a=this._cache.get(o),s=!1;return!a&&e?(a=new G({x:r,y:n,z:i}),Object.assign(a,this.getTileMetadata(a)),s=!0,this._cache.set(o,a),this._dirty=!0):a&&a.needsReload&&(s=!0),s&&a.loadData({getData:this.opts.getTileData,requestScheduler:this._requestScheduler,onLoad:this.onTileLoad,onError:this.opts.onTileError}),a}},{key:"_getNearestAncestor",value:function(t,e,r){for(var n=this._minZoom,i=void 0===n?0:n,o={x:t,y:e,z:r};o.z>i;){o=this.getParentIndex(o);var a=this._getTile(o);if(a)return a}return null}},{key:"tiles",get:function(){return this._tiles}},{key:"selectedTiles",get:function(){return this._selectedTiles}},{key:"isLoaded",get:function(){return this._selectedTiles.every((function(t){return t.isLoaded}))}}]),t}();function ge(t){for(var e=t;e;){if(!1&e.state)return!0;if(e.isLoaded)return!1;e=e.parent}return!0}function me(t,e){for(var r,n=3;r=t.parent;){if(t.isLoaded&&(n=4,"best-available"===e))return;r.state=Math.max(r.state,n),t=r}}function ye(t){var e,r=pe(t.children);try{for(r.s();!(e=r.n()).done;){var n=e.value;n.state=Math.max(n.state,3),n.isLoaded||ye(n)}}catch(t){r.e(t)}finally{r.f()}}function ve(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function _e(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ve(Object(r),!0).forEach((function(e){g()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ve(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function be(t){var e=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(t){return!1}}();return function(){var r,n=l()(t);if(e){var i=l()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return u()(this,r)}}var xe={data:[],dataComparator:re.equals,renderSubLayers:{type:"function",value:function(t){return new B.a(t)},compare:!1},getTileData:{type:"function",optional:!0,value:null,compare:!1},onViewportLoad:{type:"function",optional:!0,value:null,compare:!1},onTileLoad:{type:"function",value:function(t){},compare:!1},onTileUnload:{type:"function",value:function(t){},compare:!1},onTileError:{type:"function",value:function(t){return console.error(t)},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},we=function(t){a()(r,t);var e=be(r);function r(){return i()(this,r),e.apply(this,arguments)}return d()(r,[{key:"initializeState",value:function(){this.state={tileset:null,isLoaded:!1}}},{key:"finalizeState",value:function(){var t;null===(t=this.state.tileset)||void 0===t||t.finalize()}},{key:"shouldUpdateState",value:function(t){return t.changeFlags.somethingChanged}},{key:"updateState",value:function(t){var e=t.props,r=t.changeFlags,n=this.state.tileset,i=r.propsOrDataChanged||r.updateTriggersChanged,o=r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getTileData);n?i&&(n.setOptions(this._getTilesetOptions(e)),o?n.reloadAll():this.state.tileset.tiles.forEach((function(t){t.layers=null}))):(n=new Ae(this._getTilesetOptions(e)),this.setState({tileset:n})),this._updateTileset()}},{key:"_getTilesetOptions",value:function(t){var e=t.tileSize,r=t.maxCacheSize,n=t.maxCacheByteSize,i=t.refinementStrategy,o=t.extent;return{maxCacheSize:r,maxCacheByteSize:n,maxZoom:t.maxZoom,minZoom:t.minZoom,tileSize:e,refinementStrategy:i,extent:o,maxRequests:t.maxRequests,zoomOffset:t.zoomOffset,getTileData:this.getTileData.bind(this),onTileLoad:this._onTileLoad.bind(this),onTileError:this._onTileError.bind(this),onTileUnload:this._onTileUnload.bind(this)}}},{key:"_updateTileset",value:function(){var t=this.state.tileset,e=this.props,r=e.zRange,n=e.modelMatrix,i=t.update(this.context.viewport,{zRange:r,modelMatrix:n}),o=t.isLoaded,a=this.state.isLoaded!==o,s=this.state.frameNumber!==i;o&&(a||s)&&this._onViewportLoad(),s&&this.setState({frameNumber:i}),this.state.isLoaded=o}},{key:"_onViewportLoad",value:function(){var t=this.state.tileset,e=this.props.onViewportLoad;e&&e(t.selectedTiles)}},{key:"_onTileLoad",value:function(t){this.props.onTileLoad(t),t.layers=null,t.isVisible&&this.setNeedsUpdate()}},{key:"_onTileError",value:function(t,e){this.props.onTileError(t),e.layers=null,e.isVisible&&this.setNeedsUpdate()}},{key:"_onTileUnload",value:function(t){this.props.onTileUnload(t)}},{key:"getTileData",value:function(t){var e=this.props,r=e.data,n=e.getTileData,i=e.fetch,o=t.signal;return t.url=ie(r,t),n?n(t):t.url?i(t.url,{propName:"data",layer:this,signal:o}):null}},{key:"renderSubLayers",value:function(t){return this.props.renderSubLayers(t)}},{key:"getHighlightedObjectIndex",value:function(){return-1}},{key:"getPickingInfo",value:function(t){var e=t.info,r=t.sourceLayer;return e.tile=r.props.tile,e}},{key:"_updateAutoHighlight",value:function(t){t.sourceLayer&&t.sourceLayer.updateAutoHighlight(t)}},{key:"renderLayers",value:function(){var t=this;return this.state.tileset.tiles.map((function(e){var r=t.getHighlightedObjectIndex(e);if(e.isLoaded||e.content)if(e.layers)e.layers[0]&&e.layers[0].props.highlightedObjectIndex!==r&&(e.layers=e.layers.map((function(t){return t.clone({highlightedObjectIndex:r})})));else{var n=t.renderSubLayers(_e(_e({},t.props),{},{id:"".concat(t.id,"-").concat(e.x,"-").concat(e.y,"-").concat(e.z),data:e.content,_offset:0,tile:e}));e.layers=Object(D.b)(n,Boolean).map((function(t){return t.clone({tile:e,highlightedObjectIndex:r})}))}else;return e.layers}))}},{key:"filterSubLayer",value:function(t){return t.layer.props.tile.isVisible}},{key:"isLoaded",get:function(){return this.state.tileset.selectedTiles.every((function(t){return t.isLoaded&&t.layers&&t.layers.every((function(t){return t.isLoaded}))}))}}]),r}(m.a);we.layerName="TileLayer",we.defaultProps=xe;var Ee=r(8),Se=r.n(Ee);function Oe(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Te(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Oe(Object(r),!0).forEach((function(e){g()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Oe(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Pe(t){var e=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(t){return!1}}();return function(){var r,n=l()(t);if(e){var i=l()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return u()(this,r)}}var Me=function(t){a()(r,t);var e=Pe(r);function r(){return i()(this,r),e.apply(this,arguments)}return d()(r,[{key:"getShaders",value:function(){var t=Se()(l()(r.prototype),"getShaders",this).call(this);return t.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"},t}},{key:"initializeState",value:function(t){Se()(l()(r.prototype),"initializeState",this).call(this,t),this.getAttributeManager().addInstanced({timestamps:{size:1,accessor:"getTimestamps",shaderAttributes:{instanceTimestamps:{vertexOffset:0},instanceNextTimestamps:{vertexOffset:1}}}})}},{key:"draw",value:function(t){var e=this.props,n=e.fadeTrail,i=e.trailLength,o=e.currentTime;t.uniforms=Te(Te({},t.uniforms),{},{fadeTrail:n,trailLength:i,currentTime:o}),Se()(l()(r.prototype),"draw",this).call(this,t)}}]),r}(r(109).a);Me.layerName="TripsLayer",Me.defaultProps={fadeTrail:!0,trailLength:{type:"number",value:120,min:0},currentTime:{type:"number",value:0,min:0},getTimestamps:{type:"accessor",value:null}};var Ce=function(t){var e,r=void 0!==(t=t||{})?t:{},n={};for(e in r)r.hasOwnProperty(e)&&(n[e]=r[e]);var i,o=[],a="";document.currentScript&&(a=document.currentScript.src),a=0!==a.indexOf("blob:")?a.substr(0,a.lastIndexOf("/")+1):"",i=function(t,e,r){var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="arraybuffer",n.onload=function(){if(200==n.status||0==n.status&&n.response)e(n.response);else{var i=Q(t);i?e(i.buffer):r()}},n.onerror=r,n.send(null)};var s=r.print||console.log.bind(console),u=r.printErr||console.warn.bind(console);for(e in n)n.hasOwnProperty(e)&&(r[e]=n[e]);n=null,r.arguments&&(o=r.arguments);var c=0,l=function(){return c};var h=!1;function f(t){var e,n=r["_"+t];return e="Cannot call unknown function "+t+", make sure it is exported",n||ut("Assertion failed: "+e),n}function p(t,e,r,n,i){var o={string:function(t){var e=0;if(null!=t&&0!==t){var r=1+(t.length<<2);(function(t,e,r){(function(t,e,r,n){if(!(n>0))return 0;for(var i=r,o=r+n-1,a=0;a<t.length;++a){var s=t.charCodeAt(a);if(s>=55296&&s<=57343){var u=t.charCodeAt(++a);s=65536+((1023&s)<<10)|1023&u}if(s<=127){if(r>=o)break;e[r++]=s}else if(s<=2047){if(r+1>=o)break;e[r++]=192|s>>6,e[r++]=128|63&s}else if(s<=65535){if(r+2>=o)break;e[r++]=224|s>>12,e[r++]=128|s>>6&63,e[r++]=128|63&s}else{if(r+3>=o)break;e[r++]=240|s>>18,e[r++]=128|s>>12&63,e[r++]=128|s>>6&63,e[r++]=128|63&s}}e[r]=0})(t,y,e,r)})(t,e=tt(r),r)}return e},array:function(t){var e=tt(t.length);return function(t,e){m.set(t,e)}(t,e),e}};var a=f(t),s=[],u=0;if(n)for(var c=0;c<n.length;c++){var l=o[r[c]];l?(0===u&&(u=rt()),s[c]=l(n[c])):s[c]=n[c]}var h=a.apply(null,s);return h=function(t){return"string"===e?A(t):"boolean"===e?Boolean(t):t}(h),0!==u&&et(u),h}var d="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function A(t,e){return t?function(t,e,r){for(var n=e+r,i=e;t[i]&&!(i>=n);)++i;if(i-e>16&&t.subarray&&d)return d.decode(t.subarray(e,i));for(var o="";e<i;){var a=t[e++];if(128&a){var s=63&t[e++];if(192!=(224&a)){var u=63&t[e++];if((a=224==(240&a)?(15&a)<<12|s<<6|u:(7&a)<<18|s<<12|u<<6|63&t[e++])<65536)o+=String.fromCharCode(a);else{var c=a-65536;o+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else o+=String.fromCharCode((31&a)<<6|s)}else o+=String.fromCharCode(a)}return o}(y,t,e):""}var g,m,y,v,_,b,x;"undefined"!=typeof TextDecoder&&new TextDecoder("utf-16le");function w(t,e){return t%e>0&&(t+=e-t%e),t}function E(t){g=t,r.HEAP8=m=new Int8Array(t),r.HEAP16=v=new Int16Array(t),r.HEAP32=_=new Int32Array(t),r.HEAPU8=y=new Uint8Array(t),r.HEAPU16=new Uint16Array(t),r.HEAPU32=new Uint32Array(t),r.HEAPF32=b=new Float32Array(t),r.HEAPF64=x=new Float64Array(t)}var S=r.TOTAL_MEMORY||33554432;function O(t){for(;t.length>0;){var e=t.shift();if("function"!=typeof e){var n=e.func;"number"==typeof n?void 0===e.arg?r.dynCall_v(n):r.dynCall_vi(n,e.arg):n(void 0===e.arg?null:e.arg)}else e()}}S=(g=r.buffer?r.buffer:new ArrayBuffer(S)).byteLength,E(g),_[5916]=5266576;var T=[],P=[],M=[],C=[];var I=Math.abs,k=Math.ceil,R=Math.floor,L=Math.min,j=0,D=null,B=null;r.preloadedImages={},r.preloadedAudios={};var F,z,N=null,U="data:application/octet-stream;base64,";function V(t){return String.prototype.startsWith?t.startsWith(U):0===t.indexOf(U)}N="data:application/octet-stream;base64,AAAAAAAAAAACAAAAAwAAAAEAAAAFAAAABAAAAAYAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAABAAAABAAAAAMAAAAGAAAABQAAAAIAAAAAAAAAAgAAAAMAAAABAAAABAAAAAYAAAAAAAAABQAAAAMAAAAGAAAABAAAAAUAAAAAAAAAAQAAAAIAAAAEAAAABQAAAAYAAAAAAAAAAgAAAAMAAAABAAAABQAAAAIAAAAAAAAAAQAAAAMAAAAGAAAABAAAAAYAAAAAAAAABQAAAAIAAAABAAAABAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAgAAAAMAAAAAAAAAAAAAAAIAAAAAAAAAAQAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAEAAAABgAAAAAAAAAFAAAAAAAAAAAAAAAEAAAABQAAAAAAAAAAAAAAAAAAAAIAAAAAAAAABgAAAAAAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAACAAAAAwAAAAQAAAAFAAAABgAAAAEAAAACAAAAAwAAAAQAAAAFAAAABgAAAAAAAAACAAAAAwAAAAQAAAAFAAAABgAAAAAAAAABAAAAAwAAAAQAAAAFAAAABgAAAAAAAAABAAAAAgAAAAQAAAAFAAAABgAAAAAAAAABAAAAAgAAAAMAAAAFAAAABgAAAAAAAAABAAAAAgAAAAMAAAAEAAAABgAAAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAADAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAACAAAAAgAAAAAAAAAAAAAABgAAAAAAAAADAAAAAgAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAUAAAAEAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAAFAAAAAAAAAAAAAAAAAAAABgAAAAAAAAAEAAAAAAAAAAYAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAUAAAACAAAABAAAAAMAAAAIAAAAAQAAAAcAAAAGAAAACQAAAAAAAAADAAAAAgAAAAIAAAAGAAAACgAAAAsAAAAAAAAAAQAAAAUAAAADAAAADQAAAAEAAAAHAAAABAAAAAwAAAAAAAAABAAAAH8AAAAPAAAACAAAAAMAAAAAAAAADAAAAAUAAAACAAAAEgAAAAoAAAAIAAAAAAAAABAAAAAGAAAADgAAAAsAAAARAAAAAQAAAAkAAAACAAAABwAAABUAAAAJAAAAEwAAAAMAAAANAAAAAQAAAAgAAAAFAAAAFgAAABAAAAAEAAAAAAAAAA8AAAAJAAAAEwAAAA4AAAAUAAAAAQAAAAcAAAAGAAAACgAAAAsAAAAYAAAAFwAAAAUAAAACAAAAEgAAAAsAAAARAAAAFwAAABkAAAACAAAABgAAAAoAAAAMAAAAHAAAAA0AAAAaAAAABAAAAA8AAAADAAAADQAAABoAAAAVAAAAHQAAAAMAAAAMAAAABwAAAA4AAAB/AAAAEQAAABsAAAAJAAAAFAAAAAYAAAAPAAAAFgAAABwAAAAfAAAABAAAAAgAAAAMAAAAEAAAABIAAAAhAAAAHgAAAAgAAAAFAAAAFgAAABEAAAALAAAADgAAAAYAAAAjAAAAGQAAABsAAAASAAAAGAAAAB4AAAAgAAAABQAAAAoAAAAQAAAAEwAAACIAAAAUAAAAJAAAAAcAAAAVAAAACQAAABQAAAAOAAAAEwAAAAkAAAAoAAAAGwAAACQAAAAVAAAAJgAAABMAAAAiAAAADQAAAB0AAAAHAAAAFgAAABAAAAApAAAAIQAAAA8AAAAIAAAAHwAAABcAAAAYAAAACwAAAAoAAAAnAAAAJQAAABkAAAAYAAAAfwAAACAAAAAlAAAACgAAABcAAAASAAAAGQAAABcAAAARAAAACwAAAC0AAAAnAAAAIwAAABoAAAAqAAAAHQAAACsAAAAMAAAAHAAAAA0AAAAbAAAAKAAAACMAAAAuAAAADgAAABQAAAARAAAAHAAAAB8AAAAqAAAALAAAAAwAAAAPAAAAGgAAAB0AAAArAAAAJgAAAC8AAAANAAAAGgAAABUAAAAeAAAAIAAAADAAAAAyAAAAEAAAABIAAAAhAAAAHwAAACkAAAAsAAAANQAAAA8AAAAWAAAAHAAAACAAAAAeAAAAGAAAABIAAAA0AAAAMgAAACUAAAAhAAAAHgAAADEAAAAwAAAAFgAAABAAAAApAAAAIgAAABMAAAAmAAAAFQAAADYAAAAkAAAAMwAAACMAAAAuAAAALQAAADgAAAARAAAAGwAAABkAAAAkAAAAFAAAACIAAAATAAAANwAAACgAAAA2AAAAJQAAACcAAAA0AAAAOQAAABgAAAAXAAAAIAAAACYAAAB/AAAAIgAAADMAAAAdAAAALwAAABUAAAAnAAAAJQAAABkAAAAXAAAAOwAAADkAAAAtAAAAKAAAABsAAAAkAAAAFAAAADwAAAAuAAAANwAAACkAAAAxAAAANQAAAD0AAAAWAAAAIQAAAB8AAAAqAAAAOgAAACsAAAA+AAAAHAAAACwAAAAaAAAAKwAAAD4AAAAvAAAAQAAAABoAAAAqAAAAHQAAACwAAAA1AAAAOgAAAEEAAAAcAAAAHwAAACoAAAAtAAAAJwAAACMAAAAZAAAAPwAAADsAAAA4AAAALgAAADwAAAA4AAAARAAAABsAAAAoAAAAIwAAAC8AAAAmAAAAKwAAAB0AAABFAAAAMwAAAEAAAAAwAAAAMQAAAB4AAAAhAAAAQwAAAEIAAAAyAAAAMQAAAH8AAAA9AAAAQgAAACEAAAAwAAAAKQAAADIAAAAwAAAAIAAAAB4AAABGAAAAQwAAADQAAAAzAAAARQAAADYAAABHAAAAJgAAAC8AAAAiAAAANAAAADkAAABGAAAASgAAACAAAAAlAAAAMgAAADUAAAA9AAAAQQAAAEsAAAAfAAAAKQAAACwAAAA2AAAARwAAADcAAABJAAAAIgAAADMAAAAkAAAANwAAACgAAAA2AAAAJAAAAEgAAAA8AAAASQAAADgAAABEAAAAPwAAAE0AAAAjAAAALgAAAC0AAAA5AAAAOwAAAEoAAABOAAAAJQAAACcAAAA0AAAAOgAAAH8AAAA+AAAATAAAACwAAABBAAAAKgAAADsAAAA/AAAATgAAAE8AAAAnAAAALQAAADkAAAA8AAAASAAAAEQAAABQAAAAKAAAADcAAAAuAAAAPQAAADUAAAAxAAAAKQAAAFEAAABLAAAAQgAAAD4AAAArAAAAOgAAACoAAABSAAAAQAAAAEwAAAA/AAAAfwAAADgAAAAtAAAATwAAADsAAABNAAAAQAAAAC8AAAA+AAAAKwAAAFQAAABFAAAAUgAAAEEAAAA6AAAANQAAACwAAABWAAAATAAAAEsAAABCAAAAQwAAAFEAAABVAAAAMQAAADAAAAA9AAAAQwAAAEIAAAAyAAAAMAAAAFcAAABVAAAARgAAAEQAAAA4AAAAPAAAAC4AAABaAAAATQAAAFAAAABFAAAAMwAAAEAAAAAvAAAAWQAAAEcAAABUAAAARgAAAEMAAAA0AAAAMgAAAFMAAABXAAAASgAAAEcAAABZAAAASQAAAFsAAAAzAAAARQAAADYAAABIAAAAfwAAAEkAAAA3AAAAUAAAADwAAABYAAAASQAAAFsAAABIAAAAWAAAADYAAABHAAAANwAAAEoAAABOAAAAUwAAAFwAAAA0AAAAOQAAAEYAAABLAAAAQQAAAD0AAAA1AAAAXgAAAFYAAABRAAAATAAAAFYAAABSAAAAYAAAADoAAABBAAAAPgAAAE0AAAA/AAAARAAAADgAAABdAAAATwAAAFoAAABOAAAASgAAADsAAAA5AAAAXwAAAFwAAABPAAAATwAAAE4AAAA/AAAAOwAAAF0AAABfAAAATQAAAFAAAABEAAAASAAAADwAAABjAAAAWgAAAFgAAABRAAAAVQAAAF4AAABlAAAAPQAAAEIAAABLAAAAUgAAAGAAAABUAAAAYgAAAD4AAABMAAAAQAAAAFMAAAB/AAAASgAAAEYAAABkAAAAVwAAAFwAAABUAAAARQAAAFIAAABAAAAAYQAAAFkAAABiAAAAVQAAAFcAAABlAAAAZgAAAEIAAABDAAAAUQAAAFYAAABMAAAASwAAAEEAAABoAAAAYAAAAF4AAABXAAAAUwAAAGYAAABkAAAAQwAAAEYAAABVAAAAWAAAAEgAAABbAAAASQAAAGMAAABQAAAAaQAAAFkAAABhAAAAWwAAAGcAAABFAAAAVAAAAEcAAABaAAAATQAAAFAAAABEAAAAagAAAF0AAABjAAAAWwAAAEkAAABZAAAARwAAAGkAAABYAAAAZwAAAFwAAABTAAAATgAAAEoAAABsAAAAZAAAAF8AAABdAAAATwAAAFoAAABNAAAAbQAAAF8AAABqAAAAXgAAAFYAAABRAAAASwAAAGsAAABoAAAAZQAAAF8AAABcAAAATwAAAE4AAABtAAAAbAAAAF0AAABgAAAAaAAAAGIAAABuAAAATAAAAFYAAABSAAAAYQAAAH8AAABiAAAAVAAAAGcAAABZAAAAbwAAAGIAAABuAAAAYQAAAG8AAABSAAAAYAAAAFQAAABjAAAAUAAAAGkAAABYAAAAagAAAFoAAABxAAAAZAAAAGYAAABTAAAAVwAAAGwAAAByAAAAXAAAAGUAAABmAAAAawAAAHAAAABRAAAAVQAAAF4AAABmAAAAZQAAAFcAAABVAAAAcgAAAHAAAABkAAAAZwAAAFsAAABhAAAAWQAAAHQAAABpAAAAbwAAAGgAAABrAAAAbgAAAHMAAABWAAAAXgAAAGAAAABpAAAAWAAAAGcAAABbAAAAcQAAAGMAAAB0AAAAagAAAF0AAABjAAAAWgAAAHUAAABtAAAAcQAAAGsAAAB/AAAAZQAAAF4AAABzAAAAaAAAAHAAAABsAAAAZAAAAF8AAABcAAAAdgAAAHIAAABtAAAAbQAAAGwAAABdAAAAXwAAAHUAAAB2AAAAagAAAG4AAABiAAAAaAAAAGAAAAB3AAAAbwAAAHMAAABvAAAAYQAAAG4AAABiAAAAdAAAAGcAAAB3AAAAcAAAAGsAAABmAAAAZQAAAHgAAABzAAAAcgAAAHEAAABjAAAAdAAAAGkAAAB1AAAAagAAAHkAAAByAAAAcAAAAGQAAABmAAAAdgAAAHgAAABsAAAAcwAAAG4AAABrAAAAaAAAAHgAAAB3AAAAcAAAAHQAAABnAAAAdwAAAG8AAABxAAAAaQAAAHkAAAB1AAAAfwAAAG0AAAB2AAAAcQAAAHkAAABqAAAAdgAAAHgAAABsAAAAcgAAAHUAAAB5AAAAbQAAAHcAAABvAAAAcwAAAG4AAAB5AAAAdAAAAHgAAAB4AAAAcwAAAHIAAABwAAAAeQAAAHcAAAB2AAAAeQAAAHQAAAB4AAAAdwAAAHUAAABxAAAAdgAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAEAAAAFAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAIAAAAFAAAAAQAAAAAAAAD/////AQAAAAAAAAADAAAABAAAAAIAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAwAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAUAAAABAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAAFAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAQAAAAFAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAUAAAAFAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAMAAAAAAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAAAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAADAAAAAwAAAAMAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAADAAAABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAUAAAAFAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAAAAAAAAAAABAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAADAAAAAAAAAAMAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAMAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAQAAAAMAAAABAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAMAAAABAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAADAAAABQAAAAEAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAEAAAABQAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAgAAAAUAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAMAAAABAAAAAAAAAAEAAAAAAAAABQAAAAAAAAAAAAAABQAAAAUAAAAAAAAAAAAAAP////8BAAAAAAAAAAMAAAAEAAAAAgAAAAAAAAAAAAAAAQAAAAAAAAAAAAAABQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAABQAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAQAAAP//////////AQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAIAAAAAAAAAAAAAAAEAAAACAAAABgAAAAQAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAABwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABgAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAoAAAACAAAAAAAAAAAAAAABAAAAAQAAAAUAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAIAAAAAAAAAAAAAAAEAAAADAAAABwAAAAYAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAHAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAABAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAOAAAAAgAAAAAAAAAAAAAAAQAAAAAAAAAJAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAwAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAgAAAAAAAAAAAAAAAQAAAAQAAAAIAAAACgAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAsAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAJAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAACAAAAAAAAAAAAAAABAAAACwAAAA8AAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA4AAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAgAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAFAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAACAAAAAAAAAAAAAAABAAAADAAAABAAAAAMAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAPAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAEAAAAKAAAAEwAAAAgAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACQAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAADwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABAAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAJAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAgAAAAAAAAAAAAAAAQAAAA0AAAARAAAADQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABEAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABMAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACQAAAAIAAAAAAAAAAAAAAAEAAAAOAAAAEgAAAA8AAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAPAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEgAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAEgAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABMAAAACAAAAAAAAAAAAAAABAAAA//////////8TAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABMAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAASAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABIAAAAAAAAAGAAAAAAAAAAhAAAAAAAAAB4AAAAAAAAAIAAAAAMAAAAxAAAAAQAAADAAAAADAAAAMgAAAAMAAAAIAAAAAAAAAAUAAAAFAAAACgAAAAUAAAAWAAAAAAAAABAAAAAAAAAAEgAAAAAAAAApAAAAAQAAACEAAAAAAAAAHgAAAAAAAAAEAAAAAAAAAAAAAAAFAAAAAgAAAAUAAAAPAAAAAQAAAAgAAAAAAAAABQAAAAUAAAAfAAAAAQAAABYAAAAAAAAAEAAAAAAAAAACAAAAAAAAAAYAAAAAAAAADgAAAAAAAAAKAAAAAAAAAAsAAAAAAAAAEQAAAAMAAAAYAAAAAQAAABcAAAADAAAAGQAAAAMAAAAAAAAAAAAAAAEAAAAFAAAACQAAAAUAAAAFAAAAAAAAAAIAAAAAAAAABgAAAAAAAAASAAAAAQAAAAoAAAAAAAAACwAAAAAAAAAEAAAAAQAAAAMAAAAFAAAABwAAAAUAAAAIAAAAAQAAAAAAAAAAAAAAAQAAAAUAAAAQAAAAAQAAAAUAAAAAAAAAAgAAAAAAAAAHAAAAAAAAABUAAAAAAAAAJgAAAAAAAAAJAAAAAAAAABMAAAAAAAAAIgAAAAMAAAAOAAAAAQAAABQAAAADAAAAJAAAAAMAAAADAAAAAAAAAA0AAAAFAAAAHQAAAAUAAAABAAAAAAAAAAcAAAAAAAAAFQAAAAAAAAAGAAAAAQAAAAkAAAAAAAAAEwAAAAAAAAAEAAAAAgAAAAwAAAAFAAAAGgAAAAUAAAAAAAAAAQAAAAMAAAAAAAAADQAAAAUAAAACAAAAAQAAAAEAAAAAAAAABwAAAAAAAAAaAAAAAAAAACoAAAAAAAAAOgAAAAAAAAAdAAAAAAAAACsAAAAAAAAAPgAAAAMAAAAmAAAAAQAAAC8AAAADAAAAQAAAAAMAAAAMAAAAAAAAABwAAAAFAAAALAAAAAUAAAANAAAAAAAAABoAAAAAAAAAKgAAAAAAAAAVAAAAAQAAAB0AAAAAAAAAKwAAAAAAAAAEAAAAAwAAAA8AAAAFAAAAHwAAAAUAAAADAAAAAQAAAAwAAAAAAAAAHAAAAAUAAAAHAAAAAQAAAA0AAAAAAAAAGgAAAAAAAAAfAAAAAAAAACkAAAAAAAAAMQAAAAAAAAAsAAAAAAAAADUAAAAAAAAAPQAAAAMAAAA6AAAAAQAAAEEAAAADAAAASwAAAAMAAAAPAAAAAAAAABYAAAAFAAAAIQAAAAUAAAAcAAAAAAAAAB8AAAAAAAAAKQAAAAAAAAAqAAAAAQAAACwAAAAAAAAANQAAAAAAAAAEAAAABAAAAAgAAAAFAAAAEAAAAAUAAAAMAAAAAQAAAA8AAAAAAAAAFgAAAAUAAAAaAAAAAQAAABwAAAAAAAAAHwAAAAAAAAAyAAAAAAAAADAAAAAAAAAAMQAAAAMAAAAgAAAAAAAAAB4AAAADAAAAIQAAAAMAAAAYAAAAAwAAABIAAAADAAAAEAAAAAMAAABGAAAAAAAAAEMAAAAAAAAAQgAAAAMAAAA0AAAAAwAAADIAAAAAAAAAMAAAAAAAAAAlAAAAAwAAACAAAAAAAAAAHgAAAAMAAABTAAAAAAAAAFcAAAADAAAAVQAAAAMAAABKAAAAAwAAAEYAAAAAAAAAQwAAAAAAAAA5AAAAAQAAADQAAAADAAAAMgAAAAAAAAAZAAAAAAAAABcAAAAAAAAAGAAAAAMAAAARAAAAAAAAAAsAAAADAAAACgAAAAMAAAAOAAAAAwAAAAYAAAADAAAAAgAAAAMAAAAtAAAAAAAAACcAAAAAAAAAJQAAAAMAAAAjAAAAAwAAABkAAAAAAAAAFwAAAAAAAAAbAAAAAwAAABEAAAAAAAAACwAAAAMAAAA/AAAAAAAAADsAAAADAAAAOQAAAAMAAAA4AAAAAwAAAC0AAAAAAAAAJwAAAAAAAAAuAAAAAwAAACMAAAADAAAAGQAAAAAAAAAkAAAAAAAAABQAAAAAAAAADgAAAAMAAAAiAAAAAAAAABMAAAADAAAACQAAAAMAAAAmAAAAAwAAABUAAAADAAAABwAAAAMAAAA3AAAAAAAAACgAAAAAAAAAGwAAAAMAAAA2AAAAAwAAACQAAAAAAAAAFAAAAAAAAAAzAAAAAwAAACIAAAAAAAAAEwAAAAMAAABIAAAAAAAAADwAAAADAAAALgAAAAMAAABJAAAAAwAAADcAAAAAAAAAKAAAAAAAAABHAAAAAwAAADYAAAADAAAAJAAAAAAAAABAAAAAAAAAAC8AAAAAAAAAJgAAAAMAAAA+AAAAAAAAACsAAAADAAAAHQAAAAMAAAA6AAAAAwAAACoAAAADAAAAGgAAAAMAAABUAAAAAAAAAEUAAAAAAAAAMwAAAAMAAABSAAAAAwAAAEAAAAAAAAAALwAAAAAAAABMAAAAAwAAAD4AAAAAAAAAKwAAAAMAAABhAAAAAAAAAFkAAAADAAAARwAAAAMAAABiAAAAAwAAAFQAAAAAAAAARQAAAAAAAABgAAAAAwAAAFIAAAADAAAAQAAAAAAAAABLAAAAAAAAAEEAAAAAAAAAOgAAAAMAAAA9AAAAAAAAADUAAAADAAAALAAAAAMAAAAxAAAAAwAAACkAAAADAAAAHwAAAAMAAABeAAAAAAAAAFYAAAAAAAAATAAAAAMAAABRAAAAAwAAAEsAAAAAAAAAQQAAAAAAAABCAAAAAwAAAD0AAAAAAAAANQAAAAMAAABrAAAAAAAAAGgAAAADAAAAYAAAAAMAAABlAAAAAwAAAF4AAAAAAAAAVgAAAAAAAABVAAAAAwAAAFEAAAADAAAASwAAAAAAAAA5AAAAAAAAADsAAAAAAAAAPwAAAAMAAABKAAAAAAAAAE4AAAADAAAATwAAAAMAAABTAAAAAwAAAFwAAAADAAAAXwAAAAMAAAAlAAAAAAAAACcAAAADAAAALQAAAAMAAAA0AAAAAAAAADkAAAAAAAAAOwAAAAAAAABGAAAAAwAAAEoAAAAAAAAATgAAAAMAAAAYAAAAAAAAABcAAAADAAAAGQAAAAMAAAAgAAAAAwAAACUAAAAAAAAAJwAAAAMAAAAyAAAAAwAAADQAAAAAAAAAOQAAAAAAAAAuAAAAAAAAADwAAAAAAAAASAAAAAMAAAA4AAAAAAAAAEQAAAADAAAAUAAAAAMAAAA/AAAAAwAAAE0AAAADAAAAWgAAAAMAAAAbAAAAAAAAACgAAAADAAAANwAAAAMAAAAjAAAAAAAAAC4AAAAAAAAAPAAAAAAAAAAtAAAAAwAAADgAAAAAAAAARAAAAAMAAAAOAAAAAAAAABQAAAADAAAAJAAAAAMAAAARAAAAAwAAABsAAAAAAAAAKAAAAAMAAAAZAAAAAwAAACMAAAAAAAAALgAAAAAAAABHAAAAAAAAAFkAAAAAAAAAYQAAAAMAAABJAAAAAAAAAFsAAAADAAAAZwAAAAMAAABIAAAAAwAAAFgAAAADAAAAaQAAAAMAAAAzAAAAAAAAAEUAAAADAAAAVAAAAAMAAAA2AAAAAAAAAEcAAAAAAAAAWQAAAAAAAAA3AAAAAwAAAEkAAAAAAAAAWwAAAAMAAAAmAAAAAAAAAC8AAAADAAAAQAAAAAMAAAAiAAAAAwAAADMAAAAAAAAARQAAAAMAAAAkAAAAAwAAADYAAAAAAAAARwAAAAAAAABgAAAAAAAAAGgAAAAAAAAAawAAAAMAAABiAAAAAAAAAG4AAAADAAAAcwAAAAMAAABhAAAAAwAAAG8AAAADAAAAdwAAAAMAAABMAAAAAAAAAFYAAAADAAAAXgAAAAMAAABSAAAAAAAAAGAAAAAAAAAAaAAAAAAAAABUAAAAAwAAAGIAAAAAAAAAbgAAAAMAAAA6AAAAAAAAAEEAAAADAAAASwAAAAMAAAA+AAAAAwAAAEwAAAAAAAAAVgAAAAMAAABAAAAAAwAAAFIAAAAAAAAAYAAAAAAAAABVAAAAAAAAAFcAAAAAAAAAUwAAAAMAAABlAAAAAAAAAGYAAAADAAAAZAAAAAMAAABrAAAAAwAAAHAAAAADAAAAcgAAAAMAAABCAAAAAAAAAEMAAAADAAAARgAAAAMAAABRAAAAAAAAAFUAAAAAAAAAVwAAAAAAAABeAAAAAwAAAGUAAAAAAAAAZgAAAAMAAAAxAAAAAAAAADAAAAADAAAAMgAAAAMAAAA9AAAAAwAAAEIAAAAAAAAAQwAAAAMAAABLAAAAAwAAAFEAAAAAAAAAVQAAAAAAAABfAAAAAAAAAFwAAAAAAAAAUwAAAAAAAABPAAAAAAAAAE4AAAAAAAAASgAAAAMAAAA/AAAAAQAAADsAAAADAAAAOQAAAAMAAABtAAAAAAAAAGwAAAAAAAAAZAAAAAUAAABdAAAAAQAAAF8AAAAAAAAAXAAAAAAAAABNAAAAAQAAAE8AAAAAAAAATgAAAAAAAAB1AAAABAAAAHYAAAAFAAAAcgAAAAUAAABqAAAAAQAAAG0AAAAAAAAAbAAAAAAAAABaAAAAAQAAAF0AAAABAAAAXwAAAAAAAABaAAAAAAAAAE0AAAAAAAAAPwAAAAAAAABQAAAAAAAAAEQAAAAAAAAAOAAAAAMAAABIAAAAAQAAADwAAAADAAAALgAAAAMAAABqAAAAAAAAAF0AAAAAAAAATwAAAAUAAABjAAAAAQAAAFoAAAAAAAAATQAAAAAAAABYAAAAAQAAAFAAAAAAAAAARAAAAAAAAAB1AAAAAwAAAG0AAAAFAAAAXwAAAAUAAABxAAAAAQAAAGoAAAAAAAAAXQAAAAAAAABpAAAAAQAAAGMAAAABAAAAWgAAAAAAAABpAAAAAAAAAFgAAAAAAAAASAAAAAAAAABnAAAAAAAAAFsAAAAAAAAASQAAAAMAAABhAAAAAQAAAFkAAAADAAAARwAAAAMAAABxAAAAAAAAAGMAAAAAAAAAUAAAAAUAAAB0AAAAAQAAAGkAAAAAAAAAWAAAAAAAAABvAAAAAQAAAGcAAAAAAAAAWwAAAAAAAAB1AAAAAgAAAGoAAAAFAAAAWgAAAAUAAAB5AAAAAQAAAHEAAAAAAAAAYwAAAAAAAAB3AAAAAQAAAHQAAAABAAAAaQAAAAAAAAB3AAAAAAAAAG8AAAAAAAAAYQAAAAAAAABzAAAAAAAAAG4AAAAAAAAAYgAAAAMAAABrAAAAAQAAAGgAAAADAAAAYAAAAAMAAAB5AAAAAAAAAHQAAAAAAAAAZwAAAAUAAAB4AAAAAQAAAHcAAAAAAAAAbwAAAAAAAABwAAAAAQAAAHMAAAAAAAAAbgAAAAAAAAB1AAAAAQAAAHEAAAAFAAAAaQAAAAUAAAB2AAAAAQAAAHkAAAAAAAAAdAAAAAAAAAByAAAAAQAAAHgAAAABAAAAdwAAAAAAAAByAAAAAAAAAHAAAAAAAAAAawAAAAAAAABkAAAAAAAAAGYAAAAAAAAAZQAAAAMAAABTAAAAAQAAAFcAAAADAAAAVQAAAAMAAAB2AAAAAAAAAHgAAAAAAAAAcwAAAAUAAABsAAAAAQAAAHIAAAAAAAAAcAAAAAAAAABcAAAAAQAAAGQAAAAAAAAAZgAAAAAAAAB1AAAAAAAAAHkAAAAFAAAAdwAAAAUAAABtAAAAAQAAAHYAAAAAAAAAeAAAAAAAAABfAAAAAQAAAGwAAAABAAAAcgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAEAAAABAAAAAAAAAAAAAAABAAAAAAAAAAEAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAB+ogX28rbpPxqumpJv+fM/165tC4ns9D+XaEnTqUsEQFrOtNlC4PA/3U+0XG6P9b9TdUUBxTTjP4PUp8ex1ty/B1rD/EN43z+lcDi6LLrZP/a45NWEHMY/oJ5ijLDZ+j/xw3rjxWPjP2B8A46ioQdAotff3wla2z+FMSpA1jj+v6b5Y1mtPbS/cIu8K0F457/2esiyJpDNv98k5Ts2NeA/pvljWa09tD88ClUJ60MDQPZ6yLImkM0/4ONKxa0UBcD2uOTVhBzGv5G7JRxGave/8cN648Vj47+HCwtkjAXIv6LX398JWtu/qyheaCAL9D9TdUUBxTTjv4gyTxslhwVAB1rD/EN4378EH/28teoFwH6iBfbytum/F6ztFYdK/r/Xrm0Liez0vwcS6wNGWeO/Ws602ULg8L9TCtRLiLT8P8pi5RexJsw/BlIKPVwR5T95Wyu0/QjnP5PjoT7YYcu/mBhKZ6zrwj8wRYS7NebuP3qW6geh+Ls/SLrixebL3r+pcyymN9XrPwmkNHp7xec/GWNMZVAA17+82s+x2BLiPwn2ytbJ9ek/LgEH1sMS1j8yp/2LhTfeP+SnWwtQBbu/d38gkp5X7z8ytsuHaADGPzUYObdf1+m/7IauECWhwz+cjSACjzniP76Z+wUhN9K/1+GEKzup67+/GYr/04baPw6idWOvsuc/ZedTWsRa5b/EJQOuRzi0v/OncYhHPes/h49PixY53j+i8wWfC03Nvw2idWOvsue/ZedTWsRa5T/EJQOuRzi0P/KncYhHPeu/iY9PixY53r+i8wWfC03NP9anWwtQBbs/d38gkp5X778ytsuHaADGvzUYObdf1+k/74auECWhw7+cjSACjzniv8CZ+wUhN9I/1uGEKzup6z+/GYr/04bavwmkNHp7xee/F2NMZVAA1z+82s+x2BLivwr2ytbJ9em/KwEH1sMS1r8yp/2LhTfev81i5RexJsy/BlIKPVwR5b95Wyu0/Qjnv5DjoT7YYcs/nBhKZ6zrwr8wRYS7Nebuv3OW6geh+Lu/SLrixebL3j+pcyymN9Xrv8rHIFfWehZAMBwUdlo0DECTUc17EOb2PxpVB1SWChdAzjbhb9pTDUDQhmdvECX5P9FlMKCC9+g/IIAzjELgE0DajDngMv8GQFhWDmDPjNs/y1guLh96EkAxPi8k7DIEQJCc4URlhRhA3eLKKLwkEECqpNAyTBD/P6xpjXcDiwVAFtl//cQm4z+Ibt3XKiYTQM7mCLUb3QdAoM1t8yVv7D8aLZv2Nk8UQEAJPV5nQwxAtSsfTCoE9z9TPjXLXIIWQBVanC5W9AtAYM3d7Adm9j++5mQz1FoWQBUThyaVBghAwH5muQsV7T89Q1qv82MUQJoWGOfNuBdAzrkClkmwDkDQjKq77t37Py+g0dtitsE/ZwAMTwVPEUBojepluNwBQGYbtuW+t9w/HNWIJs6MEkDTNuQUSlgEQKxktPP5TcQ/ixbLB8JjEUCwuWjXMQYCQAS/R09FkRdAowpiZjhhDkB7LmlczD/7P01iQmhhsAVAnrtTwDy84z/Z6jfQ2TgTQChOCXMnWwpAhrW3daoz8z/HYJvVPI4VQLT3ik5FcA5Angi7LOZd+z+NNVzDy5gXQBXdvVTFUA1AYNMgOeYe+T8+qHXGCwkXQKQTOKwa5AJA8gFVoEMW0T+FwzJyttIRQAEAAAD/////BwAAAP////8xAAAA/////1cBAAD/////YQkAAP////+nQQAA/////5HLAQD/////95AMAP/////B9lcAAAAAAAAAAAAAAAAAAgAAAP////8OAAAA/////2IAAAD/////rgIAAP/////CEgAA/////06DAAD/////IpcDAP/////uIRkA/////4LtrwAAAAAAAAAAAAAAAAAAAAAAAgAAAP//////////AQAAAAMAAAD//////////////////////////////////////////////////////////////////////////wEAAAAAAAAAAgAAAP///////////////wMAAAD//////////////////////////////////////////////////////////////////////////wEAAAAAAAAAAgAAAP///////////////wMAAAD//////////////////////////////////////////////////////////////////////////wEAAAAAAAAAAgAAAP///////////////wMAAAD//////////////////////////////////////////////////////////wIAAAD//////////wEAAAAAAAAA/////////////////////wMAAAD/////////////////////////////////////////////////////AwAAAP////////////////////8AAAAA/////////////////////wEAAAD///////////////8CAAAA////////////////////////////////AwAAAP////////////////////8AAAAA////////////////AgAAAAEAAAD/////////////////////////////////////////////////////AwAAAP////////////////////8AAAAA////////////////AgAAAAEAAAD/////////////////////////////////////////////////////AwAAAP////////////////////8AAAAA////////////////AgAAAAEAAAD/////////////////////////////////////////////////////AwAAAP////////////////////8AAAAA////////////////AgAAAAEAAAD/////////////////////////////////////////////////////AQAAAAIAAAD///////////////8AAAAA/////////////////////wMAAAD/////////////////////////////////////////////////////AQAAAAIAAAD///////////////8AAAAA/////////////////////wMAAAD/////////////////////////////////////////////////////AQAAAAIAAAD///////////////8AAAAA/////////////////////wMAAAD/////////////////////////////////////////////////////AQAAAAIAAAD///////////////8AAAAA/////////////////////wMAAAD///////////////////////////////8CAAAA////////////////AQAAAP////////////////////8AAAAA/////////////////////wMAAAD/////////////////////////////////////////////////////AwAAAP////////////////////8AAAAAAQAAAP//////////AgAAAP//////////////////////////////////////////////////////////AwAAAP///////////////wIAAAAAAAAAAQAAAP//////////////////////////////////////////////////////////////////////////AwAAAP///////////////wIAAAAAAAAAAQAAAP//////////////////////////////////////////////////////////////////////////AwAAAP///////////////wIAAAAAAAAAAQAAAP//////////////////////////////////////////////////////////////////////////AwAAAAEAAAD//////////wIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAgAAAAAAAAACAAAAAQAAAAEAAAACAAAAAgAAAAAAAAAFAAAABQAAAAAAAAACAAAAAgAAAAMAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAIAAAABAAAAAgAAAAIAAAACAAAAAAAAAAUAAAAGAAAAAAAAAAIAAAACAAAAAwAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAIAAAAAAAAAAgAAAAEAAAADAAAAAgAAAAIAAAAAAAAABQAAAAcAAAAAAAAAAgAAAAIAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAgAAAAAAAAACAAAAAQAAAAQAAAACAAAAAgAAAAAAAAAFAAAACAAAAAAAAAACAAAAAgAAAAMAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAACAAAAAAAAAAIAAAABAAAAAAAAAAIAAAACAAAAAAAAAAUAAAAJAAAAAAAAAAIAAAACAAAAAwAAAAUAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAIAAAACAAAAAAAAAAMAAAAOAAAAAgAAAAAAAAACAAAAAwAAAAAAAAAAAAAAAgAAAAIAAAADAAAABgAAAAAAAAAAAAAAAAAAAAAAAAALAAAAAgAAAAIAAAAAAAAAAwAAAAoAAAACAAAAAAAAAAIAAAADAAAAAQAAAAAAAAACAAAAAgAAAAMAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAACAAAAAgAAAAAAAAADAAAACwAAAAIAAAAAAAAAAgAAAAMAAAACAAAAAAAAAAIAAAACAAAAAwAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAIAAAACAAAAAAAAAAMAAAAMAAAAAgAAAAAAAAACAAAAAwAAAAMAAAAAAAAAAgAAAAIAAAADAAAACQAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAgAAAAIAAAAAAAAAAwAAAA0AAAACAAAAAAAAAAIAAAADAAAABAAAAAAAAAACAAAAAgAAAAMAAAAKAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAACAAAAAgAAAAAAAAADAAAABgAAAAIAAAAAAAAAAgAAAAMAAAAPAAAAAAAAAAIAAAACAAAAAwAAAAsAAAAAAAAAAAAAAAAAAAAAAAAABgAAAAIAAAACAAAAAAAAAAMAAAAHAAAAAgAAAAAAAAACAAAAAwAAABAAAAAAAAAAAgAAAAIAAAADAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAgAAAAIAAAAAAAAAAwAAAAgAAAACAAAAAAAAAAIAAAADAAAAEQAAAAAAAAACAAAAAgAAAAMAAAANAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAACAAAAAgAAAAAAAAADAAAACQAAAAIAAAAAAAAAAgAAAAMAAAASAAAAAAAAAAIAAAACAAAAAwAAAA4AAAAAAAAAAAAAAAAAAAAAAAAACQAAAAIAAAACAAAAAAAAAAMAAAAFAAAAAgAAAAAAAAACAAAAAwAAABMAAAAAAAAAAgAAAAIAAAADAAAADwAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAgAAAAAAAAACAAAAAQAAABMAAAACAAAAAgAAAAAAAAAFAAAACgAAAAAAAAACAAAAAgAAAAMAAAAQAAAAAAAAAAAAAAAAAAAAAAAAABEAAAACAAAAAAAAAAIAAAABAAAADwAAAAIAAAACAAAAAAAAAAUAAAALAAAAAAAAAAIAAAACAAAAAwAAABEAAAAAAAAAAAAAAAAAAAAAAAAAEgAAAAIAAAAAAAAAAgAAAAEAAAAQAAAAAgAAAAIAAAAAAAAABQAAAAwAAAAAAAAAAgAAAAIAAAADAAAAEgAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAgAAAAAAAAACAAAAAQAAABEAAAACAAAAAgAAAAAAAAAFAAAADQAAAAAAAAACAAAAAgAAAAMAAAATAAAAAAAAAAAAAAAAAAAAAAAAAA8AAAACAAAAAAAAAAIAAAABAAAAEgAAAAIAAAACAAAAAAAAAAUAAAAOAAAAAAAAAAIAAAACAAAAAwAAAAIAAAABAAAAAAAAAAEAAAACAAAAAAAAAAAAAAACAAAAAQAAAAAAAAABAAAAAgAAAAEAAAAAAAAAAgAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAAAAAAAAAAABQAAAAQAAAAAAAAAAQAAAAUAAAAEAAAAAAAAAAUAAAAAAAAAAgAAAAEAAAAAAAAAAQAAAAIAAAAAAAAAAAAAAAIAAAABAAAAAAAAAAEAAAACAAAAAQAAAAAAAAACAAAAAgAAAAAAAAABAAAAAAAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAAAAAAAAAAABQAAAAQAAAAAAAAAAQAAAAUAAAAEAAAAAAAAAAUAAAAFAAAAAAAAAAEAAAAAAAAAAAAAAMuhRbbsNlBBYqHW9OmHIkF9XBuqnS31QAK37uYhNMhAOSo3UUupm0DC+6pc6JxvQHV9eseEEEJAzURsCyqlFEB8BQ4NMJjnPyy3tBoS97o/xawXQznRjj89J2K2CZxhP6vX43RIIDQ/S8isgygEBz+LvFHQkmzaPjFFFO7wMq4+AADMLkTtjkIAAOgkJqxhQgAAU7B0MjRCAADwpBcVB0IAAACYP2HaQQAAAIn/Ja5BzczM4Eg6gUHNzMxMU7BTQTMzMzNfgCZBAAAAAEi3+UAAAAAAwGPNQDMzMzMzy6BAmpmZmZkxc0AzMzMzM/NFQDMzMzMzMxlAzczMzMzM7D+ygXSx2U6RQKimJOvQKnpA23hmONTHY0A/AGcxyudNQNb3K647mzZA+S56rrwWIUAm4kUQ+9UJQKre9hGzh/M/BLvoy9WG3T+LmqMf8VHGP2m3nYNV37A/gbFHcyeCmT+cBPWBckiDP61tZACjKW0/q2RbYVUYVj8uDypVyLNAP6jGS5cA5zBBwcqhBdCNGUEGEhQ/JVEDQT6WPnRbNO1AB/AWSJgT1kDfUWNCNLDAQNk+5C33OqlAchWL34QSk0DKvtDIrNV8QNF0G3kFzGVASSeWhBl6UED+/0mNGuk4QGjA/dm/1CJALPLPMql6DEDSHoDrwpP1P2jouzWST+A/egAAAAAAAABKAwAAAAAAAPoWAAAAAAAAyqAAAAAAAAB6ZQQAAAAAAErGHgAAAAAA+mvXAAAAAADK8+MFAAAAAHqqOykAAAAASqmhIAEAAAD6oGvkBwAAAMpm8T43AAAAes+ZuIIBAABKrDQMkwoAAPq1cFUFSgAAyvkUViUGAgAAAAAAAwAAAAYAAAACAAAABQAAAAEAAAAEAAAAAAAAAAAAAAAFAAAAAwAAAAEAAAAGAAAABAAAAAIAAAAAAAAAAAAAAP////8AAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////////8AAAAA/////wAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAP////8AAAAAAAAAAAEAAAABAAAAAAAAAAAAAAD/////AAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAA/////wUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAP////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////AAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////wAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAUAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////////8AAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAABAAAAAAAAAAAAAAABAAAAAQAAAAEAAAAAAAAAAQAAAAAAAAAFAAAAAQAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAEAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAAAAAAABAAEAAAEBAAAAAAABAAAAAQAAAAEAAQAAAAAAAAAAAAAAAAAAAABhbGdvcy5jAHBvbHlmaWxsAGFkamFjZW50RmFjZURpclt0bXBGaWprLmZhY2VdW2ZpamsuZmFjZV0gPT0gS0kAZmFjZWlqay5jAF9mYWNlSWprUGVudFRvR2VvQm91bmRhcnkAYWRqYWNlbnRGYWNlRGlyW2NlbnRlcklKSy5mYWNlXVtmYWNlMl0gPT0gS0kAX2ZhY2VJamtUb0dlb0JvdW5kYXJ5AHBvbHlnb24tPm5leHQgPT0gTlVMTABsaW5rZWRHZW8uYwBhZGROZXdMaW5rZWRQb2x5Z29uAG5leHQgIT0gTlVMTABsb29wICE9IE5VTEwAYWRkTmV3TGlua2VkTG9vcABwb2x5Z29uLT5maXJzdCA9PSBOVUxMAGFkZExpbmtlZExvb3AAY29vcmQgIT0gTlVMTABhZGRMaW5rZWRDb29yZABsb29wLT5maXJzdCA9PSBOVUxMAGlubmVyTG9vcHMgIT0gTlVMTABub3JtYWxpemVNdWx0aVBvbHlnb24AYmJveGVzICE9IE5VTEwAY2FuZGlkYXRlcyAhPSBOVUxMAGZpbmRQb2x5Z29uRm9ySG9sZQBjYW5kaWRhdGVCQm94ZXMgIT0gTlVMTAByZXZEaXIgIT0gSU5WQUxJRF9ESUdJVABsb2NhbGlqLmMAaDNUb0xvY2FsSWprAGJhc2VDZWxsICE9IG9yaWdpbkJhc2VDZWxsACEob3JpZ2luT25QZW50ICYmIGluZGV4T25QZW50KQBwZW50YWdvblJvdGF0aW9ucyA+PSAwAGRpcmVjdGlvblJvdGF0aW9ucyA+PSAwAGJhc2VDZWxsID09IG9yaWdpbkJhc2VDZWxsAGJhc2VDZWxsICE9IElOVkFMSURfQkFTRV9DRUxMAGxvY2FsSWprVG9IMwAhX2lzQmFzZUNlbGxQZW50YWdvbihiYXNlQ2VsbCkAYmFzZUNlbGxSb3RhdGlvbnMgPj0gMAB3aXRoaW5QZW50YWdvblJvdGF0aW9ucyA+PSAwAGdyYXBoLT5idWNrZXRzICE9IE5VTEwAdmVydGV4R3JhcGguYwBpbml0VmVydGV4R3JhcGgAbm9kZSAhPSBOVUxMAGFkZFZlcnRleE5vZGU=";function G(t){return t}function W(t){return t.replace(/\b__Z[\w\d_]+/g,(function(t){return t===t?t:t+" ["+t+"]"}))}function H(){var t=new Error;if(!t.stack){try{throw new Error(0)}catch(e){t=e}if(!t.stack)return"(no stack trace available)"}return t.stack.toString()}function q(){return m.length}function Z(t){try{var e=new ArrayBuffer(t);if(e.byteLength!=t)return;return new Int8Array(e).set(m),J(e),E(e),1}catch(t){}}var X="function"==typeof atob?atob:function(t){var e,r,n,i,o,a,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",u="",c=0;t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{e=s.indexOf(t.charAt(c++))<<2|(i=s.indexOf(t.charAt(c++)))>>4,r=(15&i)<<4|(o=s.indexOf(t.charAt(c++)))>>2,n=(3&o)<<6|(a=s.indexOf(t.charAt(c++))),u+=String.fromCharCode(e),64!==o&&(u+=String.fromCharCode(r)),64!==a&&(u+=String.fromCharCode(n))}while(c<t.length);return u};function Q(t){if(V(t))return function(t){try{for(var e=X(t),r=new Uint8Array(e.length),n=0;n<e.length;++n)r[n]=e.charCodeAt(n);return r}catch(t){throw new Error("Converting base64 string to bytes failed.")}}(t.slice(U.length))}var Y,K,$=function(t,e,r){var n=new t.Int8Array(r),i=new t.Int32Array(r),o=(new t.Uint8Array(r),new t.Float32Array(r),new t.Float64Array(r)),a=0|e.p,s=t.Math.floor,u=t.Math.abs,c=t.Math.sqrt,l=t.Math.pow,h=t.Math.cos,f=t.Math.sin,p=t.Math.tan,d=t.Math.acos,A=t.Math.asin,g=t.Math.atan,m=t.Math.atan2,y=t.Math.ceil,v=t.Math.imul,_=t.Math.clz32,b=e.b,x=e.c,w=e.d,E=e.e,S=e.f,O=e.g,T=e.h,P=e.i,M=23696;function C(t,e,r,n){var i,o,a;0|I(t|=0,e|=0,r|=0,n|=0,a=0|he(o=(i=1+(0|v(3*r|0,r+1|0))|0)<<2))?(xe(0|n,0,i<<3|0),xe(0|a,0,0|o),k(t,e,r,n,a,i,0),fe(a)):fe(a)}function I(t,e,r,n,o){t|=0,e|=0,r|=0,o|=0;var a,s=0,u=0,c=0,l=0,h=0,f=0,p=0,d=0;if(a=M,M=M+16|0,d=a,i[(s=n|=0)>>2]=t,i[s+4>>2]=e,(s=0!=(0|o))&&(i[o>>2]=0),0|It(t,e))return M=a,0|(d=1);i[d>>2]=0;t:do{if((0|r)>=1)if(s)for(h=0,f=1,p=1,u=0,s=t;;){if(!(u|h)){if(0==(0|(s=0|R(s,e,4,d)))&0==(0|(e=0|x()))){s=2;break t}if(0|It(s,e)){s=1;break t}}if(0==(0|(s=0|R(s,e,0|i[16+(h<<2)>>2],d)))&0==(0|(e=0|x()))){s=2;break t}if(i[(t=n+(p<<3)|0)>>2]=s,i[t+4>>2]=e,i[o+(p<<2)>>2]=f,t=(0|(u=u+1|0))==(0|f),l=6==(0|(c=h+1|0)),0|It(s,e)){s=1;break t}if((0|(f=f+(l&t&1)|0))>(0|r)){s=0;break}h=t?l?0:c:h,p=p+1|0,u=t?0:u}else for(h=0,f=1,p=1,u=0,s=t;;){if(!(u|h)){if(0==(0|(s=0|R(s,e,4,d)))&0==(0|(e=0|x()))){s=2;break t}if(0|It(s,e)){s=1;break t}}if(0==(0|(s=0|R(s,e,0|i[16+(h<<2)>>2],d)))&0==(0|(e=0|x()))){s=2;break t}if(i[(t=n+(p<<3)|0)>>2]=s,i[t+4>>2]=e,t=(0|(u=u+1|0))==(0|f),l=6==(0|(c=h+1|0)),0|It(s,e)){s=1;break t}if((0|(f=f+(l&t&1)|0))>(0|r)){s=0;break}h=t?l?0:c:h,p=p+1|0,u=t?0:u}else s=0}while(0);return M=a,0|(d=s)}function k(t,e,r,n,o,a,s){r|=0,n|=0,o|=0,a|=0,s|=0;var u,c,l=0,h=0,f=0,p=0,d=0;if(c=M,M=M+16|0,u=c,0==(0|(t|=0))&0==(0|(e|=0)))M=c;else{if(l=0|me(0|t,0|e,0|a,((0|a)<0)<<31>>31|0),x(),!(0==(0|(d=0|i[(p=h=n+(l<<3)|0)>>2]))&0==(0|(p=0|i[p+4>>2]))|(f=(0|d)==(0|t)&(0|p)==(0|e))))do{f=(0|(p=0|i[(d=h=n+((l=(l+1|0)%(0|a)|0)<<3)|0)>>2]))==(0|t)&(0|(d=0|i[d+4>>2]))==(0|e)}while(!(0==(0|p)&0==(0|d)|f));l=o+(l<<2)|0,f&&(0|i[l>>2])<=(0|s)?M=c:(i[(d=h)>>2]=t,i[d+4>>2]=e,i[l>>2]=s,(0|s)>=(0|r)?M=c:(d=s+1|0,i[u>>2]=0,k(p=0|R(t,e,2,u),0|x(),r,n,o,a,d),i[u>>2]=0,k(p=0|R(t,e,3,u),0|x(),r,n,o,a,d),i[u>>2]=0,k(p=0|R(t,e,1,u),0|x(),r,n,o,a,d),i[u>>2]=0,k(p=0|R(t,e,5,u),0|x(),r,n,o,a,d),i[u>>2]=0,k(p=0|R(t,e,4,u),0|x(),r,n,o,a,d),i[u>>2]=0,k(p=0|R(t,e,6,u),0|x(),r,n,o,a,d),M=c))}}function R(t,e,r,n){t|=0,e|=0,r|=0;var o,a,s=0,u=0,c=0,l=0,h=0,f=0,p=0;if((0|i[(n|=0)>>2])>0){s=0;do{r=0|ot(r),s=s+1|0}while((0|s)<(0|i[n>>2]))}o=0|ye(0|t,0|e,45),x(),a=127&o,u=0|kt(t,e),s=0|ye(0|t,0|e,52),x(),s&=15;t:do{if(s)for(;;){if(f=0|ye(0|t,0|e,0|(h=3*(15-s|0)|0)),x(),f&=7,p=0==(0|Bt(s)),s=s+-1|0,l=0|ve(7,0,0|h),e&=~(0|x()),t=(h=0|ve(0|i[(p?464:48)+(28*f|0)+(r<<2)>>2],0,0|h))|t&~l,e|=0|x(),!(r=0|i[(p?672:256)+(28*f|0)+(r<<2)>>2])){r=0;break t}if(!s){c=6;break}}else c=6}while(0);6==(0|c)&&(t|=f=0|ve(0|(p=0|i[880+(28*a|0)+(r<<2)>>2]),0,45),e=0|x()|-1040385&e,r=0|i[4304+(28*a|0)+(r<<2)>>2],127==(127&p|0)&&(p=0|ve(0|i[880+(28*a|0)+20>>2],0,45),e=0|x()|-1040385&e,r=0|i[4304+(28*a|0)+20>>2],t=0|Lt(p|t,e),e=0|x(),i[n>>2]=1+(0|i[n>>2]))),c=0|ye(0|t,0|e,45),x(),c&=127;t:do{if(0|L(c)){e:do{if(1==(0|kt(t,e))){if((0|a)!=(0|c)){if(0|F(c,0|i[7728+(28*a|0)>>2])){t=0|Dt(t,e),u=1,e=0|x();break}t=0|Lt(t,e),u=1,e=0|x();break}switch(0|u){case 5:t=0|Dt(t,e),e=0|x(),i[n>>2]=5+(0|i[n>>2]),u=0;break e;case 3:t=0|Lt(t,e),e=0|x(),i[n>>2]=1+(0|i[n>>2]),u=0;break e;default:return p=0,b(0|(f=0)),0|p}}else u=0}while(0);if((0|r)>0){s=0;do{t=0|Rt(t,e),e=0|x(),s=s+1|0}while((0|s)!=(0|r))}if((0|a)!=(0|c)){if(!(0|j(c))){if(0!=(0|u)|5!=(0|kt(t,e)))break;i[n>>2]=1+(0|i[n>>2]);break}switch(127&o){case 8:case 118:break t}3!=(0|kt(t,e))&&(i[n>>2]=1+(0|i[n>>2]))}}else if((0|r)>0){s=0;do{t=0|Lt(t,e),e=0|x(),s=s+1|0}while((0|s)!=(0|r))}}while(0);return i[n>>2]=((0|i[n>>2])+r|0)%6|0,p=t,b(0|(f=e)),0|p}function L(t){return 0|i[7728+(28*(t|=0)|0)+16>>2]}function j(t){return 4==(0|(t|=0))|117==(0|t)|0}function D(t){return 0|i[11152+(216*(0|i[(t|=0)>>2])|0)+(72*(0|i[t+4>>2])|0)+(24*(0|i[t+8>>2])|0)+(i[t+12>>2]<<3)>>2]}function B(t){return 0|i[11152+(216*(0|i[(t|=0)>>2])|0)+(72*(0|i[t+4>>2])|0)+(24*(0|i[t+8>>2])|0)+(i[t+12>>2]<<3)+4>>2]}function F(t,e){return e|=0,(0|i[7728+(28*(t|=0)|0)+20>>2])==(0|e)?0|(e=1):0|(e=(0|i[7728+(28*t|0)+24>>2])==(0|e))}function z(t,e){return 0|i[880+(28*(t|=0)|0)+((e|=0)<<2)>>2]}function N(t,e){return e|=0,(0|i[880+(28*(t|=0)|0)>>2])==(0|e)?0|(e=0):(0|i[880+(28*t|0)+4>>2])==(0|e)?0|(e=1):(0|i[880+(28*t|0)+8>>2])==(0|e)?0|(e=2):(0|i[880+(28*t|0)+12>>2])==(0|e)?0|(e=3):(0|i[880+(28*t|0)+16>>2])==(0|e)?0|(e=4):(0|i[880+(28*t|0)+20>>2])==(0|e)?0|(e=5):0|((0|i[880+(28*t|0)+24>>2])==(0|e)?6:7)}function U(t){return+o[(t|=0)+16>>3]<+o[t+24>>3]|0}function V(t,e){t|=0;var r,n,i=0;return(i=+o[(e|=0)>>3])>=+o[t+8>>3]&&i<=+o[t>>3]?(r=+o[t+16>>3],i=+o[t+24>>3],e=(n=+o[e+8>>3])>=i,t=n<=r&1,r<i?e&&(t=1):e||(t=0),0|(e=0!=(0|t))):0|(e=0)}function G(t,e){e|=0;var r,n,i,a,s,c,l,h,f=0,p=0;return r=M,M=M+224|0,i=r+200|0,n=r+32|0,s=r,h=(t|=0)+8|0,o[(a=r+16|0)>>3]=.5*(+o[t>>3]+ +o[h>>3]),f=+o[(c=t+16|0)>>3],f=+Ot(.5*((p=+o[t+24>>3])+(f<p?f+6.283185307179586:f))),o[a+8>>3]=f,f=+o[t>>3],p=+u(+f),l=+o[h>>3],t=p>+u(+l),o[s>>3]=t?l:f,o[s+8>>3]=+o[c>>3],f=+Tt(a,s),Ut(t=0|Ft(a,e),e=0|x(),i),Vt(t,e,n),e=~~+y(+f/+Tt(i,n+8|0)),M=r,0|e}function W(t,e,r,n){e|=0,r|=0,n|=0,i[(t|=0)>>2]=e,i[t+4>>2]=r,i[t+8>>2]=n}function H(t,e){t|=0;var r,n,a,s,c=0,l=0,h=0,f=0,p=0,d=0,A=0;i[(s=(e|=0)+8|0)>>2]=0,n=+o[t>>3],f=+u(+n),a=+o[t+8>>3],f+=.5*(p=+u(+a)/.8660254037844386),f-=+(0|(c=~~f)),p-=+(0|(t=~~p));do{if(f<.5){if(f<.3333333333333333){if(i[e>>2]=c,p<.5*(f+1)){i[e+4>>2]=t;break}t=t+1|0,i[e+4>>2]=t;break}if(t=(1&!(p<(A=1-f)))+t|0,i[e+4>>2]=t,A<=p&p<2*f){c=c+1|0,i[e>>2]=c;break}i[e>>2]=c;break}if(!(f<.6666666666666666)){if(c=c+1|0,i[e>>2]=c,p<.5*f){i[e+4>>2]=t;break}t=t+1|0,i[e+4>>2]=t;break}if(p<1-f){if(i[e+4>>2]=t,2*f-1<p){i[e>>2]=c;break}}else t=t+1|0,i[e+4>>2]=t;c=c+1|0,i[e>>2]=c}while(0);do{if(n<0){if(1&t){c=~~(+(0|c)-(2*(+((d=0|de(0|c,((0|c)<0)<<31>>31|0,0|(d=(t+1|0)/2|0),((0|d)<0)<<31>>31|0))>>>0)+4294967296*+(0|x()))+1)),i[e>>2]=c;break}c=~~(+(0|c)-2*(+((d=0|de(0|c,((0|c)<0)<<31>>31|0,0|(d=(0|t)/2|0),((0|d)<0)<<31>>31|0))>>>0)+4294967296*+(0|x()))),i[e>>2]=c;break}}while(0);d=e+4|0,a<0&&(c=c-((1|t<<1)/2|0)|0,i[e>>2]=c,t=0-t|0,i[d>>2]=t),l=t-c|0,(0|c)<0?(h=0-c|0,i[d>>2]=l,i[s>>2]=h,i[e>>2]=0,t=l,c=0):h=0,(0|t)<0&&(c=c-t|0,i[e>>2]=c,h=h-t|0,i[s>>2]=h,i[d>>2]=0,t=0),r=c-h|0,l=t-h|0,(0|h)<0&&(i[e>>2]=r,i[d>>2]=l,i[s>>2]=0,t=l,c=r,h=0),(0|(l=(0|h)<(0|(l=(0|t)<(0|c)?t:c))?h:l))<=0||(i[e>>2]=c-l,i[d>>2]=t-l,i[s>>2]=h-l)}function q(t){var e,r=0,n=0,o=0,a=0,s=0;r=0|i[(t|=0)>>2],n=0|i[(e=t+4|0)>>2],(0|r)<0&&(n=n-r|0,i[e>>2]=n,i[(s=t+8|0)>>2]=(0|i[s>>2])-r,i[t>>2]=0,r=0),(0|n)<0?(r=r-n|0,i[t>>2]=r,a=(0|i[(s=t+8|0)>>2])-n|0,i[s>>2]=a,i[e>>2]=0,n=0):(s=a=t+8|0,a=0|i[a>>2]),(0|a)<0&&(r=r-a|0,i[t>>2]=r,n=n-a|0,i[e>>2]=n,i[s>>2]=0,a=0),(0|(o=(0|a)<(0|(o=(0|n)<(0|r)?n:r))?a:o))<=0||(i[t>>2]=r-o,i[e>>2]=n-o,i[s>>2]=a-o)}function Z(t,e){e|=0;var r,n;n=0|i[(t|=0)+8>>2],r=+((0|i[t+4>>2])-n|0),o[e>>3]=+((0|i[t>>2])-n|0)-.5*r,o[e+8>>3]=.8660254037844386*r}function X(t,e,r){t|=0,e|=0,i[(r|=0)>>2]=(0|i[e>>2])+(0|i[t>>2]),i[r+4>>2]=(0|i[e+4>>2])+(0|i[t+4>>2]),i[r+8>>2]=(0|i[e+8>>2])+(0|i[t+8>>2])}function Q(t,e,r){t|=0,e|=0,i[(r|=0)>>2]=(0|i[t>>2])-(0|i[e>>2]),i[r+4>>2]=(0|i[t+4>>2])-(0|i[e+4>>2]),i[r+8>>2]=(0|i[t+8>>2])-(0|i[e+8>>2])}function Y(t,e){e|=0;var r,n=0;n=0|v(0|i[(t|=0)>>2],e),i[t>>2]=n,r=0|v(0|i[(n=t+4|0)>>2],e),i[n>>2]=r,e=0|v(0|i[(t=t+8|0)>>2],e),i[t>>2]=e}function K(t){var e,r,n=0,o=0,a=0,s=0,u=0;u=(0|(r=0|i[(t|=0)>>2]))<0,t=(t=(o=(0|(s=((e=(0|(a=(0|i[t+4>>2])-(u?r:0)|0))<0)?0-a|0:0)+((0|i[t+8>>2])-(u?r:0))|0))<0)?0:s)-((a=(0|(o=(0|t)<(0|(o=(0|(n=(e?0:a)-(o?s:0)|0))<(0|(s=(u?0:r)-(e?a:0)-(o?s:0)|0))?n:s))?t:o))>0)?o:0)|0,n=n-(a?o:0)|0;t:do{switch(s-(a?o:0)|0){case 0:switch(0|n){case 0:return 0|(u=0==(0|t)?0:1==(0|t)?1:7);case 1:return 0|(u=0==(0|t)?2:1==(0|t)?3:7);default:break t}case 1:switch(0|n){case 0:return 0|(u=0==(0|t)?4:1==(0|t)?5:7);case 1:if(t)break t;return 0|(t=6);default:break t}}}while(0);return 0|(u=7)}function $(t){var e,r,n=0,o=0,a=0,s=0,u=0;o=0|i[(e=(t|=0)+8|0)>>2],a=0|le(+((3*(n=(0|i[t>>2])-o|0)|0)-(o=(0|i[(r=t+4|0)>>2])-o|0)|0)/7),i[t>>2]=a,n=0|le(+((o<<1)+n|0)/7),i[r>>2]=n,i[e>>2]=0,o=n-a|0,(0|a)<0?(u=0-a|0,i[r>>2]=o,i[e>>2]=u,i[t>>2]=0,n=o,a=0,o=u):o=0,(0|n)<0&&(a=a-n|0,i[t>>2]=a,o=o-n|0,i[e>>2]=o,i[r>>2]=0,n=0),u=a-o|0,s=n-o|0,(0|o)<0?(i[t>>2]=u,i[r>>2]=s,i[e>>2]=0,n=s,s=u,o=0):s=a,(0|(a=(0|o)<(0|(a=(0|n)<(0|s)?n:s))?o:a))<=0||(i[t>>2]=s-a,i[r>>2]=n-a,i[e>>2]=o-a)}function J(t){var e,r,n=0,o=0,a=0,s=0,u=0;o=0|i[(e=(t|=0)+8|0)>>2],a=0|le(+(((n=(0|i[t>>2])-o|0)<<1)+(o=(0|i[(r=t+4|0)>>2])-o|0)|0)/7),i[t>>2]=a,n=0|le(+((3*o|0)-n|0)/7),i[r>>2]=n,i[e>>2]=0,o=n-a|0,(0|a)<0?(u=0-a|0,i[r>>2]=o,i[e>>2]=u,i[t>>2]=0,n=o,a=0,o=u):o=0,(0|n)<0&&(a=a-n|0,i[t>>2]=a,o=o-n|0,i[e>>2]=o,i[r>>2]=0,n=0),u=a-o|0,s=n-o|0,(0|o)<0?(i[t>>2]=u,i[r>>2]=s,i[e>>2]=0,n=s,s=u,o=0):s=a,(0|(a=(0|o)<(0|(a=(0|n)<(0|s)?n:s))?o:a))<=0||(i[t>>2]=s-a,i[r>>2]=n-a,i[e>>2]=o-a)}function tt(t){var e,r,n,o=0,a=0,s=0,u=0;o=0|i[(t|=0)>>2],a=0|i[(r=t+4|0)>>2],s=0|i[(n=t+8|0)>>2],u=a+(3*o|0)|0,i[t>>2]=u,a=s+(3*a|0)|0,i[r>>2]=a,o=(3*s|0)+o|0,i[n>>2]=o,s=a-u|0,(0|u)<0?(o=o-u|0,i[r>>2]=s,i[n>>2]=o,i[t>>2]=0,a=s,s=0):s=u,(0|a)<0&&(s=s-a|0,i[t>>2]=s,o=o-a|0,i[n>>2]=o,i[r>>2]=0,a=0),e=s-o|0,u=a-o|0,(0|o)<0?(i[t>>2]=e,i[r>>2]=u,i[n>>2]=0,s=e,o=0):u=a,(0|(a=(0|o)<(0|(a=(0|u)<(0|s)?u:s))?o:a))<=0||(i[t>>2]=s-a,i[r>>2]=u-a,i[n>>2]=o-a)}function et(t){var e,r,n,o=0,a=0,s=0,u=0;u=0|i[(t|=0)>>2],s=(3*(o=0|i[(r=t+4|0)>>2])|0)+u|0,u=(a=0|i[(n=t+8|0)>>2])+(3*u|0)|0,i[t>>2]=u,i[r>>2]=s,o=(3*a|0)+o|0,i[n>>2]=o,a=s-u|0,(0|u)<0?(o=o-u|0,i[r>>2]=a,i[n>>2]=o,i[t>>2]=0,u=0):a=s,(0|a)<0&&(u=u-a|0,i[t>>2]=u,o=o-a|0,i[n>>2]=o,i[r>>2]=0,a=0),e=u-o|0,s=a-o|0,(0|o)<0?(i[t>>2]=e,i[r>>2]=s,i[n>>2]=0,u=e,o=0):s=a,(0|(a=(0|o)<(0|(a=(0|s)<(0|u)?s:u))?o:a))<=0||(i[t>>2]=u-a,i[r>>2]=s-a,i[n>>2]=o-a)}function rt(t,e){t|=0;var r,n,o,a=0,s=0,u=0;((e|=0)+-1|0)>>>0>=6||(u=(0|i[15472+(12*e|0)>>2])+(0|i[t>>2])|0,i[t>>2]=u,o=t+4|0,s=(0|i[15472+(12*e|0)+4>>2])+(0|i[o>>2])|0,i[o>>2]=s,n=t+8|0,e=(0|i[15472+(12*e|0)+8>>2])+(0|i[n>>2])|0,i[n>>2]=e,a=s-u|0,(0|u)<0?(e=e-u|0,i[o>>2]=a,i[n>>2]=e,i[t>>2]=0,s=0):(a=s,s=u),(0|a)<0&&(s=s-a|0,i[t>>2]=s,e=e-a|0,i[n>>2]=e,i[o>>2]=0,a=0),r=s-e|0,u=a-e|0,(0|e)<0?(i[t>>2]=r,i[o>>2]=u,i[n>>2]=0,s=r,e=0):u=a,(0|(a=(0|e)<(0|(a=(0|u)<(0|s)?u:s))?e:a))<=0||(i[t>>2]=s-a,i[o>>2]=u-a,i[n>>2]=e-a))}function nt(t){var e,r,n,o=0,a=0,s=0,u=0;u=0|i[(t|=0)>>2],s=(o=0|i[(r=t+4|0)>>2])+u|0,u=(a=0|i[(n=t+8|0)>>2])+u|0,i[t>>2]=u,i[r>>2]=s,o=a+o|0,i[n>>2]=o,a=s-u|0,(0|u)<0?(o=o-u|0,i[r>>2]=a,i[n>>2]=o,i[t>>2]=0,s=0):(a=s,s=u),(0|a)<0&&(s=s-a|0,i[t>>2]=s,o=o-a|0,i[n>>2]=o,i[r>>2]=0,a=0),e=s-o|0,u=a-o|0,(0|o)<0?(i[t>>2]=e,i[r>>2]=u,i[n>>2]=0,s=e,o=0):u=a,(0|(a=(0|o)<(0|(a=(0|u)<(0|s)?u:s))?o:a))<=0||(i[t>>2]=s-a,i[r>>2]=u-a,i[n>>2]=o-a)}function it(t){var e,r,n,o=0,a=0,s=0,u=0;o=0|i[(t|=0)>>2],s=0|i[(r=t+4|0)>>2],a=0|i[(n=t+8|0)>>2],u=s+o|0,i[t>>2]=u,s=a+s|0,i[r>>2]=s,o=a+o|0,i[n>>2]=o,a=s-u|0,(0|u)<0?(o=o-u|0,i[r>>2]=a,i[n>>2]=o,i[t>>2]=0,s=0):(a=s,s=u),(0|a)<0&&(s=s-a|0,i[t>>2]=s,o=o-a|0,i[n>>2]=o,i[r>>2]=0,a=0),e=s-o|0,u=a-o|0,(0|o)<0?(i[t>>2]=e,i[r>>2]=u,i[n>>2]=0,s=e,o=0):u=a,(0|(a=(0|o)<(0|(a=(0|u)<(0|s)?u:s))?o:a))<=0||(i[t>>2]=s-a,i[r>>2]=u-a,i[n>>2]=o-a)}function ot(t){switch(0|(t|=0)){case 1:t=5;break;case 5:t=4;break;case 4:t=6;break;case 6:t=2;break;case 2:t=3;break;case 3:t=1}return 0|t}function at(t){switch(0|(t|=0)){case 1:t=3;break;case 3:t=2;break;case 2:t=6;break;case 6:t=4;break;case 4:t=5;break;case 5:t=1}return 0|t}function st(t){var e,r,n,o=0,a=0,s=0,u=0;o=0|i[(t|=0)>>2],a=0|i[(r=t+4|0)>>2],s=0|i[(n=t+8|0)>>2],u=a+(o<<1)|0,i[t>>2]=u,a=s+(a<<1)|0,i[r>>2]=a,o=(s<<1)+o|0,i[n>>2]=o,s=a-u|0,(0|u)<0?(o=o-u|0,i[r>>2]=s,i[n>>2]=o,i[t>>2]=0,a=s,s=0):s=u,(0|a)<0&&(s=s-a|0,i[t>>2]=s,o=o-a|0,i[n>>2]=o,i[r>>2]=0,a=0),e=s-o|0,u=a-o|0,(0|o)<0?(i[t>>2]=e,i[r>>2]=u,i[n>>2]=0,s=e,o=0):u=a,(0|(a=(0|o)<(0|(a=(0|u)<(0|s)?u:s))?o:a))<=0||(i[t>>2]=s-a,i[r>>2]=u-a,i[n>>2]=o-a)}function ut(t){var e,r,n,o=0,a=0,s=0,u=0;u=0|i[(t|=0)>>2],s=((o=0|i[(r=t+4|0)>>2])<<1)+u|0,u=(a=0|i[(n=t+8|0)>>2])+(u<<1)|0,i[t>>2]=u,i[r>>2]=s,o=(a<<1)+o|0,i[n>>2]=o,a=s-u|0,(0|u)<0?(o=o-u|0,i[r>>2]=a,i[n>>2]=o,i[t>>2]=0,u=0):a=s,(0|a)<0&&(u=u-a|0,i[t>>2]=u,o=o-a|0,i[n>>2]=o,i[r>>2]=0,a=0),e=u-o|0,s=a-o|0,(0|o)<0?(i[t>>2]=e,i[r>>2]=s,i[n>>2]=0,u=e,o=0):s=a,(0|(a=(0|o)<(0|(a=(0|s)<(0|u)?s:u))?o:a))<=0||(i[t>>2]=u-a,i[r>>2]=s-a,i[n>>2]=o-a)}function ct(t,e){e|=0;var r,n,o,a=0,s=0,u=0;return o=(0|(n=(0|i[(t|=0)>>2])-(0|i[e>>2])|0))<0,r=(0|(s=(0|i[t+4>>2])-(0|i[e+4>>2])-(o?n:0)|0))<0,e=(e=(t=(0|(u=(o?0-n|0:0)+(0|i[t+8>>2])-(0|i[e+8>>2])+(r?0-s|0:0)|0))<0)?0:u)-((s=(0|(t=(0|e)<(0|(t=(0|(a=(r?0:s)-(t?u:0)|0))<(0|(u=(o?0:n)-(r?s:0)-(t?u:0)|0))?a:u))?e:t))>0)?t:0)|0,a=a-(s?t:0)|0,0|((0|(t=(0|(t=u-(s?t:0)|0))>-1?t:0-t|0))>(0|(e=(0|(a=(0|a)>-1?a:0-a|0))>(0|(e=(0|e)>-1?e:0-e|0))?a:e))?t:e)}function lt(t,e){e|=0;var r;r=0|i[(t|=0)+8>>2],i[e>>2]=(0|i[t>>2])-r,i[e+4>>2]=(0|i[t+4>>2])-r}function ht(t,e){e|=0;var r,n,o,a=0,s=0,u=0;s=0|i[(t|=0)>>2],i[e>>2]=s,t=0|i[t+4>>2],i[(n=e+4|0)>>2]=t,i[(o=e+8|0)>>2]=0,a=t-s|0,(0|s)<0?(t=0-s|0,i[n>>2]=a,i[o>>2]=t,i[e>>2]=0,s=0):(a=t,t=0),(0|a)<0&&(s=s-a|0,i[e>>2]=s,t=t-a|0,i[o>>2]=t,i[n>>2]=0,a=0),r=s-t|0,u=a-t|0,(0|t)<0?(i[e>>2]=r,i[n>>2]=u,i[o>>2]=0,a=u,u=r,t=0):u=s,(0|(s=(0|t)<(0|(s=(0|a)<(0|u)?a:u))?t:s))<=0||(i[e>>2]=u-s,i[n>>2]=a-s,i[o>>2]=t-s)}function ft(t){var e,r,n,o;r=(o=0|i[(e=(t|=0)+8|0)>>2])-(0|i[t>>2])|0,i[t>>2]=r,t=(0|i[(n=t+4|0)>>2])-o|0,i[n>>2]=t,i[e>>2]=0-(t+r)}function pt(t){var e,r,n=0,o=0,a=0,s=0,u=0;n=0-(o=0|i[(t|=0)>>2])|0,i[t>>2]=n,i[(e=t+8|0)>>2]=0,s=(a=0|i[(r=t+4|0)>>2])+o|0,(0|o)>0?(i[r>>2]=s,i[e>>2]=o,i[t>>2]=0,n=0,a=s):o=0,(0|a)<0?(u=n-a|0,i[t>>2]=u,o=o-a|0,i[e>>2]=o,i[r>>2]=0,s=u-o|0,n=0-o|0,(0|o)<0?(i[t>>2]=s,i[r>>2]=n,i[e>>2]=0,a=n,o=0):(a=0,s=u)):s=n,(0|(n=(0|o)<(0|(n=(0|a)<(0|s)?a:s))?o:n))<=0||(i[t>>2]=s-n,i[r>>2]=a-n,i[e>>2]=o-n)}function dt(t,e,r,n){e|=0,r|=0,n|=0;var a,s=0,u=0,c=0,l=0;if(a=M,M=M+32|0,function(t,e){e|=0;var r,n,i=0;i=+o[(t=t|0)>>3],r=+h(+i),i=+f(+i),o[e+16>>3]=i,i=+o[t+8>>3],n=r*+h(+i),o[e>>3]=n,i=r*+f(+i),o[e+8>>3]=i}(t|=0,u=a),i[r>>2]=0,s=+re(15888,u),(c=+re(15912,u))<s&&(i[r>>2]=1,s=c),(c=+re(15936,u))<s&&(i[r>>2]=2,s=c),(c=+re(15960,u))<s&&(i[r>>2]=3,s=c),(c=+re(15984,u))<s&&(i[r>>2]=4,s=c),(c=+re(16008,u))<s&&(i[r>>2]=5,s=c),(c=+re(16032,u))<s&&(i[r>>2]=6,s=c),(c=+re(16056,u))<s&&(i[r>>2]=7,s=c),(c=+re(16080,u))<s&&(i[r>>2]=8,s=c),(c=+re(16104,u))<s&&(i[r>>2]=9,s=c),(c=+re(16128,u))<s&&(i[r>>2]=10,s=c),(c=+re(16152,u))<s&&(i[r>>2]=11,s=c),(c=+re(16176,u))<s&&(i[r>>2]=12,s=c),(c=+re(16200,u))<s&&(i[r>>2]=13,s=c),(c=+re(16224,u))<s&&(i[r>>2]=14,s=c),(c=+re(16248,u))<s&&(i[r>>2]=15,s=c),(c=+re(16272,u))<s&&(i[r>>2]=16,s=c),(c=+re(16296,u))<s&&(i[r>>2]=17,s=c),(c=+re(16320,u))<s&&(i[r>>2]=18,s=c),(c=+re(16344,u))<s&&(i[r>>2]=19,s=c),(c=+d(+(1-.5*s)))<1e-16)return i[n>>2]=0,i[n+4>>2]=0,i[n+8>>2]=0,i[n+12>>2]=0,void(M=a);if(r=0|i[r>>2],s=+xt((s=+o[16368+(24*r|0)>>3])-+xt(+function(t,e){t|=0;var r,n,i,a,s;return a=+o[(e=e|0)>>3],n=+h(+a),i=+o[e+8>>3]-+o[t+8>>3],s=n*+f(+i),r=+o[t>>3],+ +m(+s,+(+f(+a)*+h(+r)-+h(+i)*(n*+f(+r))))}(15568+(r<<4)|0,t))),l=0|Bt(e)?+xt(s+-.3334731722518321):s,s=+p(+c)/.381966011250105,(0|e)>0){u=0;do{s*=2.6457513110645907,u=u+1|0}while((0|u)!=(0|e))}c=+h(+l)*s,o[n>>3]=c,l=+f(+l)*s,o[n+8>>3]=l,M=a}function At(t,e,r,n,a){e|=0,r|=0,n|=0,a|=0;var s=0,l=0;if((s=+function(t){var e,r;return r=+o[(t=t|0)>>3],e=+o[t+8>>3],+ +c(+(r*r+e*e))}(t|=0))<1e-16)return e=15568+(e<<4)|0,i[a>>2]=i[e>>2],i[a+4>>2]=i[e+4>>2],i[a+8>>2]=i[e+8>>2],void(i[a+12>>2]=i[e+12>>2]);if(l=+m(+ +o[t+8>>3],+ +o[t>>3]),(0|r)>0){t=0;do{s/=2.6457513110645907,t=t+1|0}while((0|t)!=(0|r))}n?(s/=3,r=0==(0|Bt(r)),s=+g(.381966011250105*(r?s:s/2.6457513110645907))):(s=+g(.381966011250105*s),0|Bt(r)&&(l=+xt(l+.3334731722518321))),function(t,e,r,n){t|=0,e=+e,n|=0;var a=0,s=0,c=0,l=0;if((r=+r)<1e-16)return i[n>>2]=i[t>>2],i[n+4>>2]=i[t+4>>2],i[n+8>>2]=i[t+8>>2],void(i[n+12>>2]=i[t+12>>2]);s=e<0?e+6.283185307179586:e,s=e>=6.283185307179586?s+-6.283185307179586:s;do{if(!(s<1e-16)){if(a=+u(+(s+-3.141592653589793))<1e-16,e=+o[t>>3],a){e-=r,o[n>>3]=e,a=n;break}if(c=+h(+r),r=+f(+r),e=c*+f(+e)+ +h(+s)*(r*+h(+e)),e=+A(+((e=e>1?1:e)<-1?-1:e)),o[n>>3]=e,+u(+(e+-1.5707963267948966))<1e-16)return o[n>>3]=1.5707963267948966,void(o[n+8>>3]=0);if(+u(+(e+1.5707963267948966))<1e-16)return o[n>>3]=-1.5707963267948966,void(o[n+8>>3]=0);if(l=+h(+e),s=r*+f(+s)/l,r=+o[t>>3],e=(c-+f(+e)*+f(+r))/+h(+r)/l,c=s>1?1:s,e=e>1?1:e,(e=+o[t+8>>3]+ +m(+(c<-1?-1:c),+(e<-1?-1:e)))>3.141592653589793)do{e+=-6.283185307179586}while(e>3.141592653589793);if(e<-3.141592653589793)do{e+=6.283185307179586}while(e<-3.141592653589793);return void(o[n+8>>3]=e)}e=+o[t>>3]+r,o[n>>3]=e,a=n}while(0);if(+u(+(e+-1.5707963267948966))<1e-16)return o[a>>3]=1.5707963267948966,void(o[n+8>>3]=0);if(+u(+(e+1.5707963267948966))<1e-16)return o[a>>3]=-1.5707963267948966,void(o[n+8>>3]=0);if((e=+o[t+8>>3])>3.141592653589793)do{e+=-6.283185307179586}while(e>3.141592653589793);if(e<-3.141592653589793)do{e+=6.283185307179586}while(e<-3.141592653589793);o[n+8>>3]=e}(15568+(e<<4)|0,+xt(+o[16368+(24*e|0)>>3]-l),s,a)}function gt(t,e,r){e|=0,r|=0;var n,o;n=M,M=M+16|0,Z((t|=0)+4|0,o=n),At(o,0|i[t>>2],e,0,r),M=n}function mt(t,e,r){t|=0,e|=0,r|=0;var n,o=0,a=0,s=0,u=0,c=0;n=M,M=M+128|0,a=n,u=20208,c=(s=o=n+64|0)+60|0;do{i[s>>2]=i[u>>2],s=s+4|0,u=u+4|0}while((0|s)<(0|c));u=20272,c=(s=a)+60|0;do{i[s>>2]=i[u>>2],s=s+4|0,u=u+4|0}while((0|s)<(0|c));o=(c=0==(0|Bt(0|i[e>>2])))?o:a,st(a=t+4|0),ut(a),0|Bt(0|i[e>>2])&&(et(a),i[e>>2]=1+(0|i[e>>2])),i[r>>2]=i[t>>2],X(a,o,e=r+4|0),q(e),i[r+16>>2]=i[t>>2],X(a,o+12|0,e=r+20|0),q(e),i[r+32>>2]=i[t>>2],X(a,o+24|0,e=r+36|0),q(e),i[r+48>>2]=i[t>>2],X(a,o+36|0,e=r+52|0),q(e),i[r+64>>2]=i[t>>2],X(a,o+48|0,r=r+68|0),q(r),M=n}function yt(t,e,r,n){r|=0,n|=0;var o,a,s,u,c,l,h=0,f=0,p=0,d=0,A=0;if(l=M,M=M+32|0,c=l+12|0,a=l,A=(t|=0)+4|0,d=0|i[16928+((e|=0)<<2)>>2],d=(u=0!=(0|n))?3*d|0:d,h=0|i[A>>2],o=0|i[(s=t+8|0)>>2],u){if((0|(h=o+h+(n=0|i[(f=t+12|0)>>2])|0))==(0|d))return M=l,0|(A=1);p=f}else h=o+h+(n=0|i[(p=t+12|0)>>2])|0;if((0|h)<=(0|d))return M=l,0|(A=0);do{if((0|n)>0){if(n=0|i[t>>2],(0|o)>0){f=18608+(80*n|0)+60|0,n=t;break}n=18608+(80*n|0)+40|0,r?(W(c,d,0,0),Q(A,c,a),it(a),X(a,c,A),f=n,n=t):(f=n,n=t)}else f=18608+(80*(0|i[t>>2])|0)+20|0,n=t}while(0);if(i[n>>2]=i[f>>2],(0|i[(h=f+16|0)>>2])>0){n=0;do{nt(A),n=n+1|0}while((0|n)<(0|i[h>>2]))}return t=f+4|0,i[c>>2]=i[t>>2],i[c+4>>2]=i[t+4>>2],i[c+8>>2]=i[t+8>>2],e=0|i[16848+(e<<2)>>2],Y(c,u?3*e|0:e),X(A,c,A),q(A),n=u&&((0|i[s>>2])+(0|i[A>>2])+(0|i[p>>2])|0)==(0|d)?1:2,M=l,0|(A=n)}function vt(t,e){t|=0,e|=0;var r=0;do{r=0|yt(t,e,0,1)}while(2==(0|r));return 0|r}function _t(t,e,r,n){t|=0,e|=0,n|=0;var a,s,u,c,l,h,f,p,d,A,g,m,y,v,_,b,x=0,E=0,S=0,O=0,T=0,P=0;if(b=M,M=M+240|0,x=b+224|0,g=b+208|0,m=b,y=b+192|0,v=b+176|0,_=b+160|0,f=b+144|0,p=b+128|0,d=b+112|0,A=b+96|0,0|(r|=0))return function(t,e,r){t|=0,e|=0,r|=0;var n,a,s,u,c,l,h,f,p,d,A,g,m,y,v,_,b,x,E,S=0,O=0,T=0,P=0,C=0,I=0,k=0,R=0;E=M,M=M+272|0,I=E+240|0,y=E,v=E+224|0,_=E+208|0,b=E+176|0,x=E+160|0,f=E+192|0,p=E+144|0,d=E+128|0,A=E+112|0,g=E+96|0,m=E+80|0,i[(C=E+256|0)>>2]=e,i[I>>2]=i[t>>2],i[I+4>>2]=i[t+4>>2],i[I+8>>2]=i[t+8>>2],i[I+12>>2]=i[t+12>>2],mt(I,C,y),i[r>>2]=0,I=v+4|0,n=b+4|0,a=16848+((C=0|i[C>>2])<<2)|0,s=16928+(C<<2)|0,u=d+8|0,c=A+8|0,l=g+8|0,h=_+4|0,P=0;t:for(;;){T=y+(((P>>>0)%5|0)<<4)|0,i[_>>2]=i[T>>2],i[_+4>>2]=i[T+4>>2],i[_+8>>2]=i[T+8>>2],i[_+12>>2]=i[T+12>>2];do{}while(2==(0|yt(_,C,0,1)));if(0!=(0|P)&0!=(0|Bt(e))){if(i[b>>2]=i[_>>2],i[b+4>>2]=i[_+4>>2],i[b+8>>2]=i[_+8>>2],i[b+12>>2]=i[_+12>>2],Z(I,x),S=0|i[b>>2],O=0|i[17008+(80*S|0)+(i[v>>2]<<2)>>2],i[b>>2]=i[18608+(80*S|0)+(20*O|0)>>2],(0|(T=0|i[18608+(80*S|0)+(20*O|0)+16>>2]))>0){t=0;do{nt(n),t=t+1|0}while((0|t)<(0|T))}switch(T=18608+(80*S|0)+(20*O|0)+4|0,i[f>>2]=i[T>>2],i[f+4>>2]=i[T+4>>2],i[f+8>>2]=i[T+8>>2],Y(f,3*(0|i[a>>2])|0),X(n,f,n),q(n),Z(n,p),k=+(0|i[s>>2]),o[d>>3]=3*k,o[u>>3]=0,R=-1.5*k,o[A>>3]=R,o[c>>3]=2.598076211353316*k,o[g>>3]=R,o[l>>3]=-2.598076211353316*k,0|i[17008+(80*(0|i[b>>2])|0)+(i[_>>2]<<2)>>2]){case 1:t=A,S=d;break;case 3:t=g,S=A;break;case 2:t=d,S=g;break;default:t=11;break t}te(x,p,S,t,m),At(m,0|i[b>>2],C,1,r+8+(i[r>>2]<<4)|0),i[r>>2]=1+(0|i[r>>2])}if(P>>>0<5&&(Z(h,b),At(b,0|i[_>>2],C,1,r+8+(i[r>>2]<<4)|0),i[r>>2]=1+(0|i[r>>2])),i[v>>2]=i[_>>2],i[v+4>>2]=i[_+4>>2],i[v+8>>2]=i[_+8>>2],i[v+12>>2]=i[_+12>>2],(P=P+1|0)>>>0>=6){t=2;break}}2!=(0|t)?11==(0|t)&&w(22113,22160,571,22170):M=E}(t,e,n),void(M=b);i[x>>2]=e,i[g>>2]=i[t>>2],i[g+4>>2]=i[t+4>>2],i[g+8>>2]=i[t+8>>2],i[g+12>>2]=i[t+12>>2],bt(g,x,m),i[n>>2]=0,s=16928+((a=0|i[x>>2])<<2)|0,u=f+8|0,c=p+8|0,l=d+8|0,h=y+4|0,E=0,S=0,r=-1;t:for(;;){if(t=m+((x=(S>>>0)%6|0)<<4)|0,i[y>>2]=i[t>>2],i[y+4>>2]=i[t+4>>2],i[y+8>>2]=i[t+8>>2],i[y+12>>2]=i[t+12>>2],t=E,E=0|yt(y,a,0,1),0!=(0|S)&0!=(0|Bt(e))&&(1!=(0|t)&&(0|i[y>>2])!=(0|r))){switch(Z(m+((((x+5|0)>>>0)%6|0)<<4)+4|0,v),Z(m+(x<<4)+4|0,_),T=+(0|i[s>>2]),o[f>>3]=3*T,o[u>>3]=0,P=-1.5*T,o[p>>3]=P,o[c>>3]=2.598076211353316*T,o[d>>3]=P,o[l>>3]=-2.598076211353316*T,x=0|i[g>>2],0|i[17008+(80*x|0)+(((0|r)==(0|x)?0|i[y>>2]:r)<<2)>>2]){case 1:t=p,r=f;break;case 3:t=d,r=p;break;case 2:t=f,r=d;break;default:O=9;break t}te(v,_,r,t,A),0|ee(v,A)||0|ee(_,A)||(At(A,0|i[g>>2],a,1,n+8+(i[n>>2]<<4)|0),i[n>>2]=1+(0|i[n>>2]))}if(S>>>0<6&&(Z(h,v),At(v,0|i[y>>2],a,1,n+8+(i[n>>2]<<4)|0),i[n>>2]=1+(0|i[n>>2])),(S=S+1|0)>>>0>=7)break;r=0|i[y>>2]}9==(0|O)&&w(22196,22160,735,22241),M=b}function bt(t,e,r){t|=0,e|=0,r|=0;var n,o=0,a=0,s=0,u=0,c=0;n=M,M=M+160|0,a=n,u=20336,c=(s=o=n+80|0)+72|0;do{i[s>>2]=i[u>>2],s=s+4|0,u=u+4|0}while((0|s)<(0|c));u=20416,c=(s=a)+72|0;do{i[s>>2]=i[u>>2],s=s+4|0,u=u+4|0}while((0|s)<(0|c));o=(c=0==(0|Bt(0|i[e>>2])))?o:a,st(a=t+4|0),ut(a),0|Bt(0|i[e>>2])&&(et(a),i[e>>2]=1+(0|i[e>>2])),i[r>>2]=i[t>>2],X(a,o,e=r+4|0),q(e),i[r+16>>2]=i[t>>2],X(a,o+12|0,e=r+20|0),q(e),i[r+32>>2]=i[t>>2],X(a,o+24|0,e=r+36|0),q(e),i[r+48>>2]=i[t>>2],X(a,o+36|0,e=r+52|0),q(e),i[r+64>>2]=i[t>>2],X(a,o+48|0,e=r+68|0),q(e),i[r+80>>2]=i[t>>2],X(a,o+60|0,r=r+84|0),q(r),M=n}function xt(t){var e;return e=(t=+t)<0?t+6.283185307179586:t,+(t>=6.283185307179586?e+-6.283185307179586:e)}function wt(t,e,r){return e|=0,r=+r,+u(+(+o[(t|=0)>>3]-+o[e>>3]))<r?0|(e=+u(+(+o[t+8>>3]-+o[e+8>>3]))<r):0|(e=0)}function Et(t,e){return e|=0,+u(+(+o[(t|=0)>>3]-+o[e>>3]))<17453292519943298e-27?0|(e=+u(+(+o[t+8>>3]-+o[e+8>>3]))<17453292519943298e-27):0|(e=0)}function St(t){if(!((t=+t)>1.5707963267948966))return+t;do{t+=-3.141592653589793}while(t>1.5707963267948966);return+t}function Ot(t){if((t=+t)>3.141592653589793)do{t+=-6.283185307179586}while(t>3.141592653589793);if(!(t<-3.141592653589793))return+t;do{t+=6.283185307179586}while(t<-3.141592653589793);return+t}function Tt(t,e){t|=0;var r=0,n=0,i=0;return n=+o[(e|=0)+8>>3],i=+o[t+8>>3],(r=+u(+(n-i)))>3.141592653589793&&(r=+u(+((n<0?n+6.283185307179586:n)-(i<0?i+6.283185307179586:i)))),n=1.5707963267948966-+o[t>>3],i=1.5707963267948966-+o[e>>3],i=+h(+n)*+h(+i)+ +h(+r)*(+f(+n)*+f(+i)),6371.007180918475*+d(+((i=i>1?1:i)<-1?-1:i))}function Pt(t,e){var r=0,n=0,i=0,o=0,a=0,s=0;if(!(!0&134217728==(2013265920&(e|=0)|0)))return 0|(e=0);if(a=0|ye(0|(t|=0),0|e,45),x(),(a&=127)>>>0>121)return 0|(e=0);r=0|ye(0|t,0|e,52),x(),r&=15;do{if(0|r){for(i=1,n=0;;){if(o=0|ye(0|t,0|e,3*(15-i|0)|0),x(),0!=(0|(o&=7))&(1^n)){if(1==(0|o)&0!=(0|L(a))){s=0,n=13;break}n=1}if(7==(0|o)){s=0,n=13;break}if(!(i>>>0<r>>>0)){n=9;break}i=i+1|0}if(9==(0|n)){if(15!=(0|r))break;return 0|(s=1)}if(13==(0|n))return 0|s}}while(0);for(;;){if(s=0|ye(0|t,0|e,3*(14-r|0)|0),x(),!(7==(7&s|0)&!0)){s=0,n=13;break}if(!(r>>>0<14)){s=1,n=13;break}r=r+1|0}return 13==(0|n)?0|s:0}function Mt(t,e,r){r|=0;var n=0,i=0;if(n=0|ye(0|(t|=0),0|(e|=0),52),x(),(0|(n&=15))>=(0|r)){if((0|n)!=(0|r))if(r>>>0<=15){if(t|=i=0|ve(0|r,0,52),e=0|x()|-15728641&e,(0|n)>(0|r))do{i=0|ve(7,0,3*(14-r|0)|0),r=r+1|0,t|=i,e=0|x()|e}while((0|r)<(0|n))}else e=0,t=0}else e=0,t=0;return b(0|e),0|t}function Ct(t,e,r,n){r|=0,n|=0;var o,a=0,s=0,u=0,c=0,l=0,h=0;if(u=0|ye(0|(t|=0),0|(e|=0),52),x(),(0|r)<16&(0|(u&=15))<=(0|r)){if((0|u)==(0|r))return i[(r=n)>>2]=t,void(i[r+4>>2]=e);if(o=(0|(l=0|Yt(7,r-u|0)))/7|0,c=0|ye(0|t,0|e,45),x(),0|L(127&c)){t:do{if(u)for(s=1;;){if(a=0|ye(0|t,0|e,3*(15-s|0)|0),x(),0|(a&=7))break t;if(!(s>>>0<u>>>0)){a=0;break}s=s+1|0}else a=0}while(0);s=0==(0|a)}else s=0;if(h=0|ve(u+1|0,0,52),a=0|x()|-15728641&e,Ct(e=(h|t)&~(e=0|ve(7,0,0|(c=3*(14-u|0)|0))),u=a&~(0|x()),r,n),a=n+(o<<3)|0,!s)return Ct((h=0|ve(1,0,0|c))|e,0|x()|u,r,a),h=a+(o<<3)|0,Ct((l=0|ve(2,0,0|c))|e,0|x()|u,r,h),h=h+(o<<3)|0,Ct((l=0|ve(3,0,0|c))|e,0|x()|u,r,h),h=h+(o<<3)|0,Ct((l=0|ve(4,0,0|c))|e,0|x()|u,r,h),h=h+(o<<3)|0,Ct((l=0|ve(5,0,0|c))|e,0|x()|u,r,h),void Ct((l=0|ve(6,0,0|c))|e,0|x()|u,r,h+(o<<3)|0);s=a+(o<<3)|0,(0|l)>6&&(xe(0|a,0,(h=(s>>>0>(l=a+8|0)>>>0?s:l)+-1+(0-a)|0)+8&-8|0),a=l+(h>>>3<<3)|0),Ct((h=0|ve(2,0,0|c))|e,0|x()|u,r,a),h=a+(o<<3)|0,Ct((l=0|ve(3,0,0|c))|e,0|x()|u,r,h),h=h+(o<<3)|0,Ct((l=0|ve(4,0,0|c))|e,0|x()|u,r,h),h=h+(o<<3)|0,Ct((l=0|ve(5,0,0|c))|e,0|x()|u,r,h),Ct((l=0|ve(6,0,0|c))|e,0|x()|u,r,h+(o<<3)|0)}}function It(t,e){var r=0,n=0,i=0;if(i=0|ye(0|(t|=0),0|(e|=0),45),x(),!(0|L(127&i)))return 0|(i=0);i=0|ye(0|t,0|e,52),x(),i&=15;t:do{if(i)for(n=1;;){if(r=0|ye(0|t,0|e,3*(15-n|0)|0),x(),0|(r&=7))break t;if(!(n>>>0<i>>>0)){r=0;break}n=n+1|0}else r=0}while(0);return 0|(i=0==(0|r)&1)}function kt(t,e){var r=0,n=0,i=0;if(i=0|ye(0|(t|=0),0|(e|=0),52),x(),!(i&=15))return 0|(i=0);for(n=1;;){if(r=0|ye(0|t,0|e,3*(15-n|0)|0),x(),0|(r&=7)){n=5;break}if(!(n>>>0<i>>>0)){r=0,n=5;break}n=n+1|0}return 5==(0|n)?0|r:0}function Rt(t,e){var r=0,n=0,i=0,o=0,a=0,s=0,u=0;if(u=0|ye(0|(t|=0),0|(e|=0),52),x(),!(u&=15))return u=t,b(0|(s=e)),0|u;for(s=1,r=0;;){n=0|ve(7,0,0|(o=3*(15-s|0)|0)),i=0|x(),a=0|ye(0|t,0|e,0|o),x(),t=(o=0|ve(0|ot(7&a),0,0|o))|t&~n,e=(a=0|x())|e&~i;t:do{if(!r)if(0==(o&n|0)&0==(a&i|0))r=0;else if(n=0|ye(0|t,0|e,52),x(),n&=15){r=1;e:for(;;){switch(a=0|ye(0|t,0|e,3*(15-r|0)|0),x(),7&a){case 1:break e;case 0:break;default:r=1;break t}if(!(r>>>0<n>>>0)){r=1;break t}r=r+1|0}for(r=1;;){if(i=0|ye(0|t,0|e,0|(a=3*(15-r|0)|0)),x(),o=0|ve(7,0,0|a),e&=~(0|x()),t=t&~o|(a=0|ve(0|ot(7&i),0,0|a)),e=0|e|x(),!(r>>>0<n>>>0)){r=1;break}r=r+1|0}}else r=1}while(0);if(!(s>>>0<u>>>0))break;s=s+1|0}return b(0|e),0|t}function Lt(t,e){var r=0,n=0,i=0,o=0,a=0;if(n=0|ye(0|(t|=0),0|(e|=0),52),x(),!(n&=15))return n=t,b(0|(r=e)),0|n;for(r=1;a=0|ye(0|t,0|e,0|(o=3*(15-r|0)|0)),x(),i=0|ve(7,0,0|o),e&=~(0|x()),t=(o=0|ve(0|ot(7&a),0,0|o))|t&~i,e=0|x()|e,r>>>0<n>>>0;)r=r+1|0;return b(0|e),0|t}function jt(t,e){var r=0,n=0,i=0,o=0,a=0,s=0,u=0;if(u=0|ye(0|(t|=0),0|(e|=0),52),x(),!(u&=15))return u=t,b(0|(s=e)),0|u;for(s=1,r=0;;){n=0|ve(7,0,0|(o=3*(15-s|0)|0)),i=0|x(),a=0|ye(0|t,0|e,0|o),x(),t=(o=0|ve(0|at(7&a),0,0|o))|t&~n,e=(a=0|x())|e&~i;t:do{if(!r)if(0==(o&n|0)&0==(a&i|0))r=0;else if(n=0|ye(0|t,0|e,52),x(),n&=15){r=1;e:for(;;){switch(a=0|ye(0|t,0|e,3*(15-r|0)|0),x(),7&a){case 1:break e;case 0:break;default:r=1;break t}if(!(r>>>0<n>>>0)){r=1;break t}r=r+1|0}for(r=1;;){if(o=0|ve(7,0,0|(i=3*(15-r|0)|0)),a=e&~(0|x()),e=0|ye(0|t,0|e,0|i),x(),t=t&~o|(e=0|ve(0|at(7&e),0,0|i)),e=0|a|x(),!(r>>>0<n>>>0)){r=1;break}r=r+1|0}}else r=1}while(0);if(!(s>>>0<u>>>0))break;s=s+1|0}return b(0|e),0|t}function Dt(t,e){var r=0,n=0,i=0,o=0,a=0;if(n=0|ye(0|(t|=0),0|(e|=0),52),x(),!(n&=15))return n=t,b(0|(r=e)),0|n;for(r=1;o=0|ve(7,0,0|(a=3*(15-r|0)|0)),i=e&~(0|x()),e=0|ye(0|t,0|e,0|a),x(),t=(e=0|ve(0|at(7&e),0,0|a))|t&~o,e=0|x()|i,r>>>0<n>>>0;)r=r+1|0;return b(0|e),0|t}function Bt(t){return 0|(0|(t|=0))%2}function Ft(t,e){t|=0;var r,n;return n=M,M=M+16|0,r=n,(e|=0)>>>0<=15&&2146435072!=(2146435072&i[t+4>>2]|0)&&2146435072!=(2146435072&i[t+8+4>>2]|0)?(!function(t,e,r){var n,i;n=M,M=M+16|0,dt(t|=0,e|=0,r|=0,i=n),H(i,r+4|0),M=n}(t,e,r),e=0|function(t,e){t|=0;var r,n=0,o=0,a=0,s=0,u=0,c=0,l=0,h=0;if(r=M,M=M+64|0,c=r+40|0,o=r+24|0,a=r+12|0,s=r,ve(0|(e|=0),0,52),n=134225919|x(),!e)return(0|i[t+4>>2])>2?(c=0,b(0|(u=0)),M=r,0|c):(0|i[t+8>>2])>2?(c=0,b(0|(u=0)),M=r,0|c):(0|i[t+12>>2])>2?(c=0,b(0|(u=0)),M=r,0|c):(ve(0|D(t),0,45),u=0|x()|n,c=-1,b(0|u),M=r,0|c);if(i[c>>2]=i[t>>2],i[c+4>>2]=i[t+4>>2],i[c+8>>2]=i[t+8>>2],i[c+12>>2]=i[t+12>>2],u=c+4|0,(0|e)>0)for(t=-1;i[o>>2]=i[u>>2],i[o+4>>2]=i[u+4>>2],i[o+8>>2]=i[u+8>>2],1&e?($(u),i[a>>2]=i[u>>2],i[a+4>>2]=i[u+4>>2],i[a+8>>2]=i[u+8>>2],tt(a)):(J(u),i[a>>2]=i[u>>2],i[a+4>>2]=i[u+4>>2],i[a+8>>2]=i[u+8>>2],et(a)),Q(o,a,s),q(s),l=0|ve(7,0,0|(h=3*(15-e|0)|0)),n&=~(0|x()),t=(h=0|ve(0|K(s),0,0|h))|t&~l,n=0|x()|n,(0|e)>1;)e=e+-1|0;else t=-1;t:do{if((0|i[u>>2])<=2&&(0|i[c+8>>2])<=2&&(0|i[c+12>>2])<=2){if(e=0|ve(0|(o=0|D(c)),0,45),e|=t,t=0|x()|-1040385&n,s=0|B(c),!(0|L(o))){if((0|s)<=0)break;for(a=0;;){if(o=0|ye(0|e,0|t,52),x(),o&=15)for(n=1;c=0|ye(0|e,0|t,0|(h=3*(15-n|0)|0)),x(),l=0|ve(7,0,0|h),t&=~(0|x()),e=e&~l|(h=0|ve(0|ot(7&c),0,0|h)),t=0|t|x(),n>>>0<o>>>0;)n=n+1|0;if((0|(a=a+1|0))==(0|s))break t}}a=0|ye(0|e,0|t,52),x(),a&=15;e:do{if(a){n=1;r:for(;;){switch(h=0|ye(0|e,0|t,3*(15-n|0)|0),x(),7&h){case 1:break r;case 0:break;default:break e}if(!(n>>>0<a>>>0))break e;n=n+1|0}if(0|F(o,0|i[c>>2]))for(n=1;l=0|ve(7,0,0|(c=3*(15-n|0)|0)),h=t&~(0|x()),t=0|ye(0|e,0|t,0|c),x(),e=e&~l|(t=0|ve(0|at(7&t),0,0|c)),t=0|h|x(),n>>>0<a>>>0;)n=n+1|0;else for(n=1;c=0|ye(0|e,0|t,0|(h=3*(15-n|0)|0)),x(),l=0|ve(7,0,0|h),t&=~(0|x()),e=e&~l|(h=0|ve(0|ot(7&c),0,0|h)),t=0|t|x(),n>>>0<a>>>0;)n=n+1|0}}while(0);if((0|s)>0){n=0;do{e=0|Rt(e,t),t=0|x(),n=n+1|0}while((0|n)!=(0|s))}}else e=0,t=0}while(0);return h=e,b(0|(l=t)),M=r,0|h}(r,e),t=0|x()):(t=0,e=0),b(0|t),M=n,0|e}function zt(t,e,r){var n,o=0,a=0,s=0;if(n=(r|=0)+4|0,a=0|ye(0|(t|=0),0|(e|=0),52),x(),a&=15,s=0|ye(0|t,0|e,45),x(),o=0==(0|a),0|L(127&s)){if(o)return 0|(s=1);o=1}else{if(o)return 0|(s=0);o=0==(0|i[n>>2])&&0==(0|i[r+8>>2])?0!=(0|i[r+12>>2])&1:1}for(r=1;1&r?tt(n):et(n),s=0|ye(0|t,0|e,3*(15-r|0)|0),x(),rt(n,7&s),r>>>0<a>>>0;)r=r+1|0;return 0|o}function Nt(t,e,r){r|=0;var n,o,a=0,s=0,u=0,c=0,l=0,h=0;o=M,M=M+16|0,n=o,h=0|ye(0|(t|=0),0|(e|=0),45),x(),h&=127;t:do{if(0!=(0|L(h))&&(u=0|ye(0|t,0|e,52),x(),0!=(0|(u&=15)))){a=1;e:for(;;){switch(l=0|ye(0|t,0|e,3*(15-a|0)|0),x(),7&l){case 5:break e;case 0:break;default:a=e;break t}if(!(a>>>0<u>>>0)){a=e;break t}a=a+1|0}for(s=1,a=e;c=0|ve(7,0,0|(e=3*(15-s|0)|0)),l=a&~(0|x()),a=0|ye(0|t,0|a,0|e),x(),t=t&~c|(a=0|ve(0|at(7&a),0,0|e)),a=0|l|x(),s>>>0<u>>>0;)s=s+1|0}else a=e}while(0);if(l=7728+(28*h|0)|0,i[r>>2]=i[l>>2],i[r+4>>2]=i[l+4>>2],i[r+8>>2]=i[l+8>>2],i[r+12>>2]=i[l+12>>2],0|zt(t,a,r)){if(c=r+4|0,i[n>>2]=i[c>>2],i[n+4>>2]=i[c+4>>2],i[n+8>>2]=i[c+8>>2],u=0|ye(0|t,0|a,52),x(),l=15&u,1&u?(et(c),u=l+1|0):u=l,0|L(h)){t:do{if(l)for(e=1;;){if(s=0|ye(0|t,0|a,3*(15-e|0)|0),x(),0|(s&=7)){a=s;break t}if(!(e>>>0<l>>>0)){a=0;break}e=e+1|0}else a=0}while(0);a=4==(0|a)&1}else a=0;if(0|yt(r,u,a,0)){if(0|L(h))do{}while(0!=(0|yt(r,u,0,0)));(0|u)!=(0|l)&&J(c)}else(0|u)!=(0|l)&&(i[c>>2]=i[n>>2],i[c+4>>2]=i[n+4>>2],i[c+8>>2]=i[n+8>>2]);M=o}else M=o}function Ut(t,e,r){r|=0;var n,i;n=M,M=M+16|0,Nt(t|=0,e|=0,i=n),e=0|ye(0|t,0|e,52),x(),gt(i,15&e,r),M=n}function Vt(t,e,r){r|=0;var n,i,o=0,a=0,s=0;if(i=M,M=M+16|0,Nt(t|=0,e|=0,n=i),s=0|ye(0|t,0|e,52),x(),s&=15,a=0|ye(0|t,0|e,45),x(),!(0|L(127&a)))return _t(n,s,e=0,r),void(M=i);t:do{if(s)for(a=1;;){if(o=0|ye(0|t,0|e,3*(15-a|0)|0),x(),0|(o&=7))break t;if(!(a>>>0<s>>>0)){o=0;break}a=a+1|0}else o=0}while(0);_t(n,s,e=0==(0|o)&1,r),M=i}function Gt(t,e,r,n){var o,a=0,s=0,u=0,c=0,l=0;if(o=M,M=M+64|0,u=o,(0|(t|=0))==(0|(r|=0))&(0|(e|=0))==(0|(n|=0))|!1|134217728!=(2013265920&e|0)|!1|134217728!=(2013265920&n|0))return M=o,0|(u=0);if(a=0|ye(0|t,0|e,52),x(),a&=15,s=0|ye(0|r,0|n,52),x(),(0|a)!=(15&s|0))return M=o,0|(u=0);if(s=a+-1|0,a>>>0>1&&(l=0|Mt(t,e,s),c=0|x(),(0|l)==(0|(s=0|Mt(r,n,s)))&(0|c)==(0|x()))){if(a=0|ye(0|t,0|e,0|(s=3*(15^a)|0)),x(),a&=7,s=0|ye(0|r,0|n,0|s),x(),0==(0|a)|0==(0|(s&=7)))return M=o,0|(l=1);if((0|i[21136+(a<<2)>>2])==(0|s))return M=o,0|(l=1);if((0|i[21168+(a<<2)>>2])==(0|s))return M=o,0|(l=1)}s=(a=u)+56|0;do{i[a>>2]=0,a=a+4|0}while((0|a)<(0|s));return C(t,e,1,u),a=(0|i[(l=u)>>2])==(0|r)&&(0|i[l+4>>2])==(0|n)||(0|i[(l=u+8|0)>>2])==(0|r)&&(0|i[l+4>>2])==(0|n)||(0|i[(l=u+16|0)>>2])==(0|r)&&(0|i[l+4>>2])==(0|n)||(0|i[(l=u+24|0)>>2])==(0|r)&&(0|i[l+4>>2])==(0|n)||(0|i[(l=u+32|0)>>2])==(0|r)&&(0|i[l+4>>2])==(0|n)||(0|i[(l=u+40|0)>>2])==(0|r)&&(0|i[l+4>>2])==(0|n)?1:1&((0|i[(a=u+48|0)>>2])==(0|r)?(0|i[a+4>>2])==(0|n):0),M=o,0|(l=a)}function Wt(t){t|=0;var e,r,n=0;return(e=0|pe(1,12))||w(22330,22285,46,22343),0|(n=0|i[(r=t+4|0)>>2])?(i[(n=n+8|0)>>2]=e,i[r>>2]=e,0|e):(0|i[t>>2]&&w(22360,22285,58,22383),i[(n=t)>>2]=e,i[r>>2]=e,0|e)}function Ht(t,e){t|=0,e|=0;var r,n;return(n=0|he(24))||w(22397,22285,75,22411),i[n>>2]=i[e>>2],i[n+4>>2]=i[e+4>>2],i[n+8>>2]=i[e+8>>2],i[n+12>>2]=i[e+12>>2],i[n+16>>2]=0,0|(r=0|i[(e=t+4|0)>>2])?(i[r+16>>2]=n,i[e>>2]=n,0|n):(0|i[t>>2]&&w(22426,22285,79,22411),i[t>>2]=n,i[e>>2]=n,0|n)}function qt(t){var e,r,n=0,a=0,s=0,c=0,l=0,h=0,f=0,p=0,d=0,A=0,g=0,m=0,y=0,v=0,_=0,b=0,x=0,E=0,S=0,O=0,T=0,P=0,M=0,C=0,I=0,k=0,R=0,L=0,j=0,D=0;if(0|i[(c=(t|=0)+8|0)>>2])return 0|(D=1);if(!(s=0|i[t>>2]))return 0|(D=0);n=s,a=0;do{a=a+1|0,n=0|i[n+8>>2]}while(0!=(0|n));if(a>>>0<2)return 0|(D=0);(r=0|he(a<<2))||w(22446,22285,312,22465),(e=0|he(a<<5))||w(22487,22285,316,22465),i[t>>2]=0,i[(P=t+4|0)>>2]=0,i[c>>2]=0,a=0,L=0,T=0,g=0;t:for(;;){if(A=0|i[s>>2]){l=0,h=A;do{if(p=+o[h+8>>3],n=h,h=0|i[h+16>>2],f=+o[(c=(d=0==(0|h))?A:h)+8>>3],+u(+(p-f))>3.141592653589793){D=14;break}l+=(f-p)*(+o[n>>3]+ +o[c>>3])}while(!d);if(14==(0|D)){D=0,l=0,n=A;do{O=+o[n+8>>3],k=0|i[(R=n+16|0)>>2],S=+o[(k=0==(0|k)?A:k)+8>>3],l+=(+o[n>>3]+ +o[k>>3])*((S<0?S+6.283185307179586:S)-(O<0?O+6.283185307179586:O)),n=0|i[(0==(0|n)?s:R)>>2]}while(0!=(0|n))}l>0?(i[r+(L<<2)>>2]=s,L=L+1|0,c=T,n=g):D=19}else D=19;if(19==(0|D)){D=0;do{if(!a){if(g){c=P,h=g+8|0,n=s,a=t;break}if(0|i[t>>2]){D=27;break t}c=P,h=t,n=s,a=t;break}if(0|i[(n=a+8|0)>>2]){D=21;break t}if(!(a=0|pe(1,12))){D=23;break t}i[n>>2]=a,c=a+4|0,h=a,n=g}while(0);if(i[h>>2]=s,i[c>>2]=s,h=e+(T<<5)|0,d=0|i[s>>2]){for(o[(A=e+(T<<5)+8|0)>>3]=17976931348623157e292,o[(g=e+(T<<5)+24|0)>>3]=17976931348623157e292,o[h>>3]=-17976931348623157e292,o[(m=e+(T<<5)+16|0)>>3]=-17976931348623157e292,x=17976931348623157e292,E=-17976931348623157e292,c=0,y=d,p=17976931348623157e292,_=17976931348623157e292,b=-17976931348623157e292,f=-17976931348623157e292;l=+o[y>>3],O=+o[y+8>>3],y=0|i[y+16>>2],S=+o[((v=0==(0|y))?d:y)+8>>3],l<p&&(o[A>>3]=l,p=l),O<_&&(o[g>>3]=O,_=O),l>b?o[h>>3]=l:l=b,O>f&&(o[m>>3]=O,f=O),x=O>0&O<x?O:x,E=O<0&O>E?O:E,c|=+u(+(O-S))>3.141592653589793,!v;)b=l;c&&(o[m>>3]=E,o[g>>3]=x)}else i[h>>2]=0,i[h+4>>2]=0,i[h+8>>2]=0,i[h+12>>2]=0,i[h+16>>2]=0,i[h+20>>2]=0,i[h+24>>2]=0,i[h+28>>2]=0;c=T+1|0}if(s=0|i[(R=s+8|0)>>2],i[R>>2]=0,!s){D=45;break}T=c,g=n}if(21==(0|D))w(22263,22285,32,22297);else if(23==(0|D))w(22317,22285,34,22297);else if(27==(0|D))w(22360,22285,58,22383);else if(45==(0|D)){t:do{if((0|L)>0){for(R=0==(0|c),I=c<<2,k=0==(0|t),C=0,n=0;;){if(M=0|i[r+(C<<2)>>2],R)D=73;else{if(!(T=0|he(I))){D=50;break}if(!(P=0|he(I))){D=52;break}e:do{if(k)a=0;else{for(c=0,a=0,h=t;s=e+(c<<5)|0,0|Zt(0|i[h>>2],s,0|i[M>>2])?(i[T+(a<<2)>>2]=h,i[P+(a<<2)>>2]=s,v=a+1|0):v=a,h=0|i[h+8>>2];)c=c+1|0,a=v;if((0|v)>0)if(s=0|i[T>>2],1==(0|v))a=s;else for(m=0,y=-1,a=s,g=s;;){for(d=0|i[g>>2],s=0,h=0;A=(0|(c=0|i[i[T+(h<<2)>>2]>>2]))==(0|d)?s:s+(1&(0|Zt(c,0|i[P+(h<<2)>>2],0|i[d>>2])))|0,(0|(h=h+1|0))!=(0|v);)s=A;if(a=(c=(0|A)>(0|y))?g:a,(0|(s=m+1|0))==(0|v))break e;m=s,y=c?A:y,g=0|i[T+(s<<2)>>2]}else a=0}}while(0);if(fe(T),fe(P),a){if(s=0|i[(c=a+4|0)>>2])a=s+8|0;else if(0|i[a>>2]){D=70;break}i[a>>2]=M,i[c>>2]=M}else D=73}if(73==(0|D)){if(D=0,0|(n=0|i[M>>2]))do{P=n,n=0|i[n+16>>2],fe(P)}while(0!=(0|n));fe(M),n=2}if((0|(C=C+1|0))>=(0|L)){j=n;break t}}50==(0|D)?w(22502,22285,246,22521):52==(0|D)?w(22540,22285,248,22521):70==(0|D)&&w(22360,22285,58,22383)}else j=0}while(0);return fe(r),fe(e),0|(D=j)}return 0}function Zt(t,e,r){t|=0;var n,a=0,s=0,u=0,c=0,l=0,h=0,f=0;if(!(0|V(e|=0,r|=0)))return 0|(t=0);if(e=0|U(e),n=+o[r>>3],a=e&(a=+o[r+8>>3])<0?a+6.283185307179586:a,!(t=0|i[t>>2]))return 0|(t=0);if(e){e=0,r=t;t:for(;;){for(;c=+o[r>>3],h=+o[r+8>>3],f=0|i[(r=r+16|0)>>2],u=+o[(f=0==(0|f)?t:f)>>3],s=+o[f+8>>3],c>u?(l=c,c=h):(l=u,u=c,c=s,s=h),n<u|n>l;)if(!(r=0|i[r>>2])){r=22;break t}if(a=(c=c<0?c+6.283185307179586:c)==a|(h=s<0?s+6.283185307179586:s)==a?a+-2220446049250313e-31:a,((h+=(n-u)/(l-u)*(c-h))<0?h+6.283185307179586:h)>a&&(e^=1),!(r=0|i[r>>2])){r=22;break}}if(22==(0|r))return 0|e}else{e=0,r=t;t:for(;;){for(;c=+o[r>>3],h=+o[r+8>>3],f=0|i[(r=r+16|0)>>2],u=+o[(f=0==(0|f)?t:f)>>3],s=+o[f+8>>3],c>u?(l=c,c=h):(l=u,u=c,c=s,s=h),n<u|n>l;)if(!(r=0|i[r>>2])){r=22;break t}if(s+(n-u)/(l-u)*(c-s)>(a=c==a|s==a?a+-2220446049250313e-31:a)&&(e^=1),!(r=0|i[r>>2])){r=22;break}}if(22==(0|r))return 0|e}return 0}function Xt(t,e,r,o,a){r|=0,o|=0,a|=0;var s,u,c,l,h=0,f=0,p=0,d=0,A=0,g=0,m=0,y=0,v=0,_=0;if(l=M,M=M+32|0,_=l+16|0,c=l,h=0|ye(0|(t|=0),0|(e|=0),52),x(),h&=15,m=0|ye(0|r,0|o,52),x(),(0|h)!=(15&m|0))return M=l,0|(_=1);if(A=0|ye(0|t,0|e,45),x(),A&=127,g=0|ye(0|r,0|o,45),x(),m=(0|A)!=(0|(g&=127))){if(7==(0|(p=0|N(A,g))))return M=l,0|(_=2);7==(0|(d=0|N(g,A)))?w(22564,22588,151,22598):(y=p,f=d)}else y=0,f=0;s=0|L(A),u=0|L(g),i[_>>2]=0,i[_+4>>2]=0,i[_+8>>2]=0,i[_+12>>2]=0;do{if(y){if(p=(0|(g=0|i[4304+(28*A|0)+(y<<2)>>2]))>0,u)if(p){A=0,d=r,p=o;do{d=0|jt(d,p),p=0|x(),1==(0|(f=0|at(f)))&&(f=0|at(1)),A=A+1|0}while((0|A)!=(0|g));g=f,A=d,d=p}else g=f,A=r,d=o;else if(p){A=0,d=r,p=o;do{d=0|Dt(d,p),p=0|x(),f=0|at(f),A=A+1|0}while((0|A)!=(0|g));g=f,A=d,d=p}else g=f,A=r,d=o;if(zt(A,d,_),m||w(22611,22588,181,22598),(p=0!=(0|s))&(f=0!=(0|u))&&w(22638,22588,182,22598),p){if(f=0|kt(t,e),0|n[22032+(7*f|0)+y>>0]){h=3;break}A=d=0|i[21200+(28*f|0)+(y<<2)>>2],v=26}else if(f){if(f=0|kt(A,d),0|n[22032+(7*f|0)+g>>0]){h=4;break}A=0,d=0|i[21200+(28*g|0)+(f<<2)>>2],v=26}else f=0;if(26==(0|v))if((0|d)<=-1&&w(22669,22588,212,22598),(0|A)<=-1&&w(22692,22588,213,22598),(0|d)>0){p=_+4|0,f=0;do{it(p),f=f+1|0}while((0|f)!=(0|d));f=A}else f=A;if(i[c>>2]=0,i[c+4>>2]=0,i[c+8>>2]=0,rt(c,y),0|h)for(;0|Bt(h)?tt(c):et(c),(0|h)>1;)h=h+-1|0;if((0|f)>0){h=0;do{it(c),h=h+1|0}while((0|h)!=(0|f))}X(v=_+4|0,c,v),q(v),v=50}else if(zt(r,o,_),0!=(0|s)&0!=(0|u))if((0|g)!=(0|A)&&w(22716,22588,243,22598),f=0|kt(t,e),h=0|kt(r,o),0|n[22032+(7*f|0)+h>>0])h=5;else if((0|(f=0|i[21200+(28*f|0)+(h<<2)>>2]))>0){p=_+4|0,h=0;do{it(p),h=h+1|0}while((0|h)!=(0|f));v=50}else v=50;else v=50}while(0);return 50==(0|v)&&(h=_+4|0,i[a>>2]=i[h>>2],i[a+4>>2]=i[h+4>>2],i[a+8>>2]=i[h+8>>2],h=0),M=l,0|(_=h)}function Qt(t,e,r,n){r|=0,n|=0;var o,a,s=0,u=0,c=0,l=0,h=0,f=0,p=0,d=0,A=0,g=0,m=0,y=0,v=0;if(a=M,M=M+48|0,c=a+36|0,l=a+24|0,h=a+12|0,f=a,u=0|ye(0|(t|=0),0|(e|=0),52),x(),u&=15,d=0|ye(0|t,0|e,45),x(),o=0|L(d&=127),ve(0|u,0,52),m=134225919|x(),i[(g=n)>>2]=-1,i[g+4>>2]=m,!u)return(0|i[r>>2])>1?(M=a,0|(m=1)):(0|i[r+4>>2])>1?(M=a,0|(m=1)):(0|i[r+8>>2])>1?(M=a,0|(m=1)):127==(0|(s=0|z(d,0|K(r))))?(M=a,0|(m=1)):(A=0|ve(0|s,0,45),g=0|x(),g=-1040385&i[(d=n)+4>>2]|g,i[(m=n)>>2]=i[d>>2]|A,i[m+4>>2]=g,M=a,0|(m=0));for(i[c>>2]=i[r>>2],i[c+4>>2]=i[r+4>>2],i[c+8>>2]=i[r+8>>2];i[l>>2]=i[c>>2],i[l+4>>2]=i[c+4>>2],i[l+8>>2]=i[c+8>>2],0|Bt(u)?($(c),i[h>>2]=i[c>>2],i[h+4>>2]=i[c+4>>2],i[h+8>>2]=i[c+8>>2],tt(h)):(J(c),i[h>>2]=i[c>>2],i[h+4>>2]=i[c+4>>2],i[h+8>>2]=i[c+8>>2],et(h)),Q(l,h,f),q(f),y=0|i[(g=n)>>2],g=0|i[g+4>>2],r=0|ve(7,0,0|(v=3*(15-u|0)|0)),g&=~(0|x()),v=0|ve(0|K(f),0,0|v),g=0|x()|g,i[(m=n)>>2]=v|y&~r,i[m+4>>2]=g,(0|u)>1;)u=u+-1|0;t:do{if((0|i[c>>2])<=1&&(0|i[c+4>>2])<=1&&(0|i[c+8>>2])<=1){f=127==(0|(l=0|z(d,u=0|K(c))))?0:0|L(l);e:do{if(u){if(o){if(c=21408+(28*(0|kt(t,e))|0)+(u<<2)|0,(0|(c=0|i[c>>2]))>0){r=0;do{u=0|ot(u),r=r+1|0}while((0|r)!=(0|c))}if(1==(0|u)){s=3;break t}127==(0|(r=0|z(d,u)))&&w(22743,22588,376,22773),0|L(r)?w(22786,22588,377,22773):(A=c,p=u,s=r)}else A=0,p=u,s=l;if((0|(h=0|i[4304+(28*d|0)+(p<<2)>>2]))<=-1&&w(22817,22588,384,22773),!f){if((0|A)<=-1&&w(22669,22588,417,22773),0|A){u=0,r=0|i[(c=n)>>2],c=0|i[c+4>>2];do{r=0|Lt(r,c),c=0|x(),i[(v=n)>>2]=r,i[v+4>>2]=c,u=u+1|0}while((0|u)<(0|A))}if((0|h)<=0){u=54;break}for(u=0,r=0|i[(c=n)>>2],c=0|i[c+4>>2];;)if(r=0|Lt(r,c),c=0|x(),i[(v=n)>>2]=r,i[v+4>>2]=c,(0|(u=u+1|0))==(0|h)){u=54;break e}}if(7==(0|(l=0|N(s,d)))&&w(22564,22588,393,22773),r=0|i[(u=n)>>2],u=0|i[u+4>>2],(0|h)>0){c=0;do{r=0|Lt(r,u),u=0|x(),i[(v=n)>>2]=r,i[v+4>>2]=u,c=c+1|0}while((0|c)!=(0|h))}if(r=0|kt(r,u),v=0|j(s),(0|(r=0|i[(v?21824:21616)+(28*l|0)+(r<<2)>>2]))<=-1&&w(22669,22588,412,22773),r){u=0,c=0|i[(l=n)>>2],l=0|i[l+4>>2];do{c=0|Rt(c,l),l=0|x(),i[(v=n)>>2]=c,i[v+4>>2]=l,u=u+1|0}while((0|u)<(0|r));u=54}else u=54}else if(0!=(0|o)&0!=(0|f))if(u=21408+(28*(v=0|kt(t,e))|0)+((0|kt(0|i[(u=n)>>2],0|i[u+4>>2]))<<2)|0,(0|(u=0|i[u>>2]))<=-1&&w(22840,22588,433,22773),u){s=0,r=0|i[(c=n)>>2],c=0|i[c+4>>2];do{r=0|Lt(r,c),c=0|x(),i[(v=n)>>2]=r,i[v+4>>2]=c,s=s+1|0}while((0|s)<(0|u));s=l,u=54}else s=l,u=55;else s=l,u=54}while(0);if(54==(0|u)&&f&&(u=55),55==(0|u)&&1==(0|kt(0|i[(v=n)>>2],0|i[v+4>>2]))){s=4;break}m=0|i[(v=n)>>2],v=-1040385&i[v+4>>2],y=0|ve(0|s,0,45),v=0|v|x(),i[(s=n)>>2]=m|y,i[s+4>>2]=v,s=0}else s=2}while(0);return M=a,0|(v=s)}function Yt(t,e){var r=0;if(!(e|=0))return 0|(r=1);r=t|=0,t=1;do{t=0|v(0==(1&e|0)?1:r,t),e>>=1,r=0|v(r,r)}while(0!=(0|e));return 0|t}function Kt(t,e,r){t|=0;var n,a,s=0,u=0,c=0,l=0,h=0,f=0,p=0,d=0;if(!(0|V(e|=0,r|=0)))return 0|(d=0);if(e=0|U(e),a=+o[r>>3],s=e&(s=+o[r+8>>3])<0?s+6.283185307179586:s,(0|(d=0|i[t>>2]))<=0)return 0|(d=0);if(n=0|i[t+4>>2],e){e=0,r=-1,t=0;t:for(;;){for(p=t;l=+o[n+(p<<4)>>3],f=+o[n+(p<<4)+8>>3],c=+o[n+((t=(r+2|0)%(0|d)|0)<<4)>>3],u=+o[n+(t<<4)+8>>3],l>c?(h=l,l=f):(h=c,c=l,l=u,u=f),a<c|a>h;){if(!((0|(r=p+1|0))<(0|d))){r=22;break t}t=p,p=r,r=t}if(s=(l=l<0?l+6.283185307179586:l)==s|(f=u<0?u+6.283185307179586:u)==s?s+-2220446049250313e-31:s,((f+=(a-c)/(h-c)*(l-f))<0?f+6.283185307179586:f)>s&&(e^=1),(0|(t=p+1|0))>=(0|d)){r=22;break}r=p}if(22==(0|r))return 0|e}else{e=0,r=-1,t=0;t:for(;;){for(p=t;l=+o[n+(p<<4)>>3],f=+o[n+(p<<4)+8>>3],c=+o[n+((t=(r+2|0)%(0|d)|0)<<4)>>3],u=+o[n+(t<<4)+8>>3],l>c?(h=l,l=f):(h=c,c=l,l=u,u=f),a<c|a>h;){if(!((0|(r=p+1|0))<(0|d))){r=22;break t}t=p,p=r,r=t}if(u+(a-c)/(h-c)*(l-u)>(s=l==s|u==s?s+-2220446049250313e-31:s)&&(e^=1),(0|(t=p+1|0))>=(0|d)){r=22;break}r=p}if(22==(0|r))return 0|e}return 0}function $t(t,e){e|=0;var r,n,a,s,c,l=0,h=0,f=0,p=0,d=0,A=0,g=0,m=0,y=0,v=0,_=0,b=0;if(!(n=0|i[(t|=0)>>2]))return i[e>>2]=0,i[e+4>>2]=0,i[e+8>>2]=0,i[e+12>>2]=0,i[e+16>>2]=0,i[e+20>>2]=0,i[e+24>>2]=0,void(i[e+28>>2]=0);if(o[(a=e+8|0)>>3]=17976931348623157e292,o[(s=e+24|0)>>3]=17976931348623157e292,o[e>>3]=-17976931348623157e292,o[(c=e+16|0)>>3]=-17976931348623157e292,!((0|n)<=0)){for(r=0|i[t+4>>2],m=17976931348623157e292,y=-17976931348623157e292,v=0,t=-1,p=17976931348623157e292,d=17976931348623157e292,g=-17976931348623157e292,h=-17976931348623157e292,_=0;l=+o[r+(_<<4)>>3],A=+o[r+(_<<4)+8>>3],f=+o[r+(((0|(t=t+2|0))==(0|n)?0:t)<<4)+8>>3],l<p&&(o[a>>3]=l,p=l),A<d&&(o[s>>3]=A,d=A),l>g?o[e>>3]=l:l=g,A>h&&(o[c>>3]=A,h=A),m=A>0&A<m?A:m,y=A<0&A>y?A:y,v|=+u(+(A-f))>3.141592653589793,(0|(t=_+1|0))!=(0|n);)b=_,g=l,_=t,t=b;v&&(o[c>>3]=y,o[s>>3]=m)}}function Jt(t,e,r){var n=0,o=0,a=0;if(!(0|Kt(t|=0,e|=0,r|=0)))return 0|(o=0);if((0|i[(o=t+8|0)>>2])<=0)return 0|(o=1);for(n=t+12|0,t=0;;){if(a=t,t=t+1|0,0|Kt((0|i[n>>2])+(a<<3)|0,e+(t<<5)|0,r)){t=0,n=6;break}if((0|t)>=(0|i[o>>2])){t=1,n=6;break}}return 6==(0|n)?0|t:0}function te(t,e,r,n,i){e|=0,r|=0,n|=0,i|=0;var a,s,u,c,l,h,f,p=0;c=+o[(t|=0)>>3],u=+o[e>>3]-c,s=+o[t+8>>3],a=+o[e+8>>3]-s,h=+o[r>>3],p=((p=+o[n>>3]-h)*(s-(f=+o[r+8>>3]))-(c-h)*(l=+o[n+8>>3]-f))/(u*l-a*p),o[i>>3]=c+u*p,o[i+8>>3]=s+a*p}function ee(t,e){return e|=0,+o[(t|=0)>>3]!=+o[e>>3]?0|(e=0):0|(e=+o[t+8>>3]==+o[e+8>>3])}function re(t,e){e|=0;var r,n,i;return+((i=+o[(t|=0)>>3]-+o[e>>3])*i+(n=+o[t+8>>3]-+o[e+8>>3])*n+(r=+o[t+16>>3]-+o[e+16>>3])*r)}function ne(t,e,r){t|=0,r|=0;var n=0;(0|(e|=0))>0?(n=0|pe(e,4),i[t>>2]=n,n||w(22869,22892,37,22906)):i[t>>2]=0,i[t+4>>2]=e,i[t+8>>2]=0,i[t+12>>2]=r}function ie(t){var e,r,n,a=0,s=0,c=0,h=0;e=(t|=0)+4|0,r=t+12|0,n=t+8|0;t:for(;;){for(s=0|i[e>>2],a=0;;){if((0|a)>=(0|s))break t;if(c=0|i[t>>2],h=0|i[c+(a<<2)>>2])break;a=a+1|0}a=c+(~~(+u(+ +l(10,+ +(15-(0|i[r>>2])|0))*(+o[h>>3]+ +o[h+8>>3]))%+(0|s))>>>0<<2)|0,s=0|i[a>>2];e:do{if(0|s){if(c=h+32|0,(0|s)==(0|h))i[a>>2]=i[c>>2];else{if(!(a=0|i[(s=s+32|0)>>2]))break;for(;(0|a)!=(0|h);)if(!(a=0|i[(s=a+32|0)>>2]))break e;i[s>>2]=i[c>>2]}fe(h),i[n>>2]=(0|i[n>>2])-1}}while(0)}fe(0|i[t>>2])}function oe(t){var e,r=0,n=0;for(e=0|i[(t|=0)+4>>2],n=0;;){if((0|n)>=(0|e)){r=0,n=4;break}if(r=0|i[(0|i[t>>2])+(n<<2)>>2]){n=4;break}n=n+1|0}return 4==(0|n)?0|r:0}function ae(t,e){e|=0;var r=0,n=0,a=0,s=0;if(r=~~(+u(+ +l(10,+ +(15-(0|i[(t|=0)+12>>2])|0))*(+o[e>>3]+ +o[e+8>>3]))%+(0|i[t+4>>2]))>>>0,r=(0|i[t>>2])+(r<<2)|0,!(n=0|i[r>>2]))return 0|(s=1);s=e+32|0;do{if((0|n)!=(0|e)){if(!(r=0|i[n+32>>2]))return 0|(s=1);for(a=r;;){if((0|a)==(0|e)){a=8;break}if(!(r=0|i[a+32>>2])){r=1,a=10;break}n=a,a=r}if(8==(0|a)){i[n+32>>2]=i[s>>2];break}if(10==(0|a))return 0|r}else i[r>>2]=i[s>>2]}while(0);return fe(e),i[(s=t+8|0)>>2]=(0|i[s>>2])-1,0|(s=0)}function se(t,e,r){t|=0,e|=0,r|=0;var n,a=0,s=0,c=0;(n=0|he(40))||w(22922,22892,95,22935),i[n>>2]=i[e>>2],i[n+4>>2]=i[e+4>>2],i[n+8>>2]=i[e+8>>2],i[n+12>>2]=i[e+12>>2],i[(s=n+16|0)>>2]=i[r>>2],i[s+4>>2]=i[r+4>>2],i[s+8>>2]=i[r+8>>2],i[s+12>>2]=i[r+12>>2],i[n+32>>2]=0,s=~~(+u(+ +l(10,+ +(15-(0|i[t+12>>2])|0))*(+o[e>>3]+ +o[e+8>>3]))%+(0|i[t+4>>2]))>>>0,s=(0|i[t>>2])+(s<<2)|0,a=0|i[s>>2];do{if(a){for(;!(0|Et(a,e)&&0|Et(a+16|0,r));)if(s=0|i[a+32>>2],!(0|i[(a=0==(0|s)?a:s)+32>>2])){c=10;break}if(10==(0|c)){i[a+32>>2]=n;break}return fe(n),0|(c=a)}i[s>>2]=n}while(0);return i[(c=t+8|0)>>2]=1+(0|i[c>>2]),0|(c=n)}function ue(t,e,r){e|=0,r|=0;var n=0,a=0;if(a=~~(+u(+ +l(10,+ +(15-(0|i[(t|=0)+12>>2])|0))*(+o[e>>3]+ +o[e+8>>3]))%+(0|i[t+4>>2]))>>>0,!(a=0|i[(0|i[t>>2])+(a<<2)>>2]))return 0|(r=0);if(!r){for(t=a;;){if(0|Et(t,e)){n=10;break}if(!(t=0|i[t+32>>2])){t=0,n=10;break}}if(10==(0|n))return 0|t}for(t=a;;){if(0|Et(t,e)&&0|Et(t+16|0,r)){n=10;break}if(!(t=0|i[t+32>>2])){t=0,n=10;break}}return 10==(0|n)?0|t:0}function ce(t,e){e|=0;var r=0;if(r=~~(+u(+ +l(10,+ +(15-(0|i[(t|=0)+12>>2])|0))*(+o[e>>3]+ +o[e+8>>3]))%+(0|i[t+4>>2]))>>>0,!(t=0|i[(0|i[t>>2])+(r<<2)>>2]))return 0|(r=0);for(;;){if(0|Et(t,e)){e=5;break}if(!(t=0|i[t+32>>2])){t=0,e=5;break}}return 5==(0|e)?0|t:0}function le(t){return 0|~~+function(t){return+ +we(+(t=+t))}(t=+t)}function he(t){t|=0;var e,r=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,h=0,f=0,p=0,d=0,A=0,g=0,m=0,y=0,v=0,_=0,b=0,x=0;e=M,M=M+16|0,d=e;do{if(t>>>0<245){if(t=(h=t>>>0<11?16:t+11&-8)>>>3,3&(n=(p=0|i[5741])>>>t)|0)return o=0|i[(n=(t=23004+((r=(1&n^1)+t|0)<<1<<2)|0)+8|0)>>2],(0|(s=0|i[(a=o+8|0)>>2]))==(0|t)?i[5741]=p&~(1<<r):(i[s+12>>2]=t,i[n>>2]=s),x=r<<3,i[o+4>>2]=3|x,i[(x=o+x+4|0)>>2]=1|i[x>>2],M=e,0|(x=a);if(h>>>0>(f=0|i[5743])>>>0){if(0|n)return r=((r=n<<t&((r=2<<t)|0-r))&0-r)-1|0,s=0|i[(t=(r=23004+((o=((n=(r>>>=c=r>>>12&16)>>>5&8)|c|(s=(r>>>=n)>>>2&4)|(t=(r>>>=s)>>>1&2)|(o=(r>>>=t)>>>1&1))+(r>>>o)|0)<<1<<2)|0)+8|0)>>2],(0|(n=0|i[(c=s+8|0)>>2]))==(0|r)?(t=p&~(1<<o),i[5741]=t):(i[n+12>>2]=r,i[t>>2]=n,t=p),u=(x=o<<3)-h|0,i[s+4>>2]=3|h,i[(a=s+h|0)+4>>2]=1|u,i[s+x>>2]=u,0|f&&(o=0|i[5746],n=23004+((r=f>>>3)<<1<<2)|0,t&(r=1<<r)?r=0|i[(t=n+8|0)>>2]:(i[5741]=t|r,r=n,t=n+8|0),i[t>>2]=o,i[r+12>>2]=o,i[o+8>>2]=r,i[o+12>>2]=n),i[5743]=u,i[5746]=a,M=e,0|(x=c);if(s=0|i[5742]){for(n=(s&0-s)-1|0,n=l=0|i[23268+(((o=(n>>>=a=n>>>12&16)>>>5&8)|a|(u=(n>>>=o)>>>2&4)|(c=(n>>>=u)>>>1&2)|(l=(n>>>=c)>>>1&1))+(n>>>l)<<2)>>2],c=l,l=(-8&i[l+4>>2])-h|0;(t=0|i[n+16>>2])||(t=0|i[n+20>>2]);)n=t,c=(a=(u=(-8&i[t+4>>2])-h|0)>>>0<l>>>0)?t:c,l=a?u:l;if((u=c+h|0)>>>0>c>>>0){a=0|i[c+24>>2],r=0|i[c+12>>2];do{if((0|r)==(0|c)){if(!(r=0|i[(t=c+20|0)>>2])&&!(r=0|i[(t=c+16|0)>>2])){n=0;break}for(;;)if(n=0|i[(o=r+20|0)>>2])r=n,t=o;else{if(!(n=0|i[(o=r+16|0)>>2]))break;r=n,t=o}i[t>>2]=0,n=r}else n=0|i[c+8>>2],i[n+12>>2]=r,i[r+8>>2]=n,n=r}while(0);do{if(0|a){if(r=0|i[c+28>>2],(0|c)==(0|i[(t=23268+(r<<2)|0)>>2])){if(i[t>>2]=n,!n){i[5742]=s&~(1<<r);break}}else if(i[((0|i[(x=a+16|0)>>2])==(0|c)?x:a+20|0)>>2]=n,!n)break;i[n+24>>2]=a,0|(r=0|i[c+16>>2])&&(i[n+16>>2]=r,i[r+24>>2]=n),0|(r=0|i[c+20>>2])&&(i[n+20>>2]=r,i[r+24>>2]=n)}}while(0);return l>>>0<16?(x=l+h|0,i[c+4>>2]=3|x,i[(x=c+x+4|0)>>2]=1|i[x>>2]):(i[c+4>>2]=3|h,i[u+4>>2]=1|l,i[u+l>>2]=l,0|f&&(o=0|i[5746],n=23004+((r=f>>>3)<<1<<2)|0,(r=1<<r)&p?r=0|i[(t=n+8|0)>>2]:(i[5741]=r|p,r=n,t=n+8|0),i[t>>2]=o,i[r+12>>2]=o,i[o+8>>2]=r,i[o+12>>2]=n),i[5743]=l,i[5746]=u),M=e,0|(x=c+8|0)}p=h}else p=h}else p=h}else if(t>>>0<=4294967231)if(h=-8&(t=t+11|0),o=0|i[5742]){a=0-h|0,l=(t>>>=8)?h>>>0>16777215?31:h>>>((l=14-((c=((m=t<<(p=(t+1048320|0)>>>16&8))+520192|0)>>>16&4)|p|(l=((m<<=c)+245760|0)>>>16&2))+(m<<l>>>15)|0)+7|0)&1|l<<1:0,n=0|i[23268+(l<<2)>>2];t:do{if(n)for(t=0,c=h<<(31==(0|l)?0:25-(l>>>1)|0),s=0;;){if((u=(-8&i[n+4>>2])-h|0)>>>0<a>>>0){if(!u){t=n,a=0,m=65;break t}t=n,a=u}if(s=0==(0|(m=0|i[n+20>>2]))|(0|m)==(0|(n=0|i[n+16+(c>>>31<<2)>>2]))?s:m,!n){n=s,m=61;break}c<<=1}else n=0,t=0,m=61}while(0);if(61==(0|m)){if(0==(0|n)&0==(0|t)){if(!(t=((t=2<<l)|0-t)&o)){p=h;break}p=(t&0-t)-1|0,t=0,n=0|i[23268+(((s=(p>>>=u=p>>>12&16)>>>5&8)|u|(c=(p>>>=s)>>>2&4)|(l=(p>>>=c)>>>1&2)|(n=(p>>>=l)>>>1&1))+(p>>>n)<<2)>>2]}n?m=65:(c=t,u=a)}if(65==(0|m))for(s=n;;){if(a=(n=(p=(-8&i[s+4>>2])-h|0)>>>0<a>>>0)?p:a,t=n?s:t,(n=0|i[s+16>>2])||(n=0|i[s+20>>2]),!n){c=t,u=a;break}s=n}if(0!=(0|c)&&u>>>0<((0|i[5743])-h|0)>>>0&&(f=c+h|0)>>>0>c>>>0){s=0|i[c+24>>2],r=0|i[c+12>>2];do{if((0|r)==(0|c)){if(!(r=0|i[(t=c+20|0)>>2])&&!(r=0|i[(t=c+16|0)>>2])){r=0;break}for(;;)if(n=0|i[(a=r+20|0)>>2])r=n,t=a;else{if(!(n=0|i[(a=r+16|0)>>2]))break;r=n,t=a}i[t>>2]=0}else x=0|i[c+8>>2],i[x+12>>2]=r,i[r+8>>2]=x}while(0);do{if(s){if(t=0|i[c+28>>2],(0|c)==(0|i[(n=23268+(t<<2)|0)>>2])){if(i[n>>2]=r,!r){o&=~(1<<t),i[5742]=o;break}}else if(i[((0|i[(x=s+16|0)>>2])==(0|c)?x:s+20|0)>>2]=r,!r)break;i[r+24>>2]=s,0|(t=0|i[c+16>>2])&&(i[r+16>>2]=t,i[t+24>>2]=r),(t=0|i[c+20>>2])&&(i[r+20>>2]=t,i[t+24>>2]=r)}}while(0);t:do{if(u>>>0<16)x=u+h|0,i[c+4>>2]=3|x,i[(x=c+x+4|0)>>2]=1|i[x>>2];else{if(i[c+4>>2]=3|h,i[f+4>>2]=1|u,i[f+u>>2]=u,r=u>>>3,u>>>0<256){n=23004+(r<<1<<2)|0,(t=0|i[5741])&(r=1<<r)?r=0|i[(t=n+8|0)>>2]:(i[5741]=t|r,r=n,t=n+8|0),i[t>>2]=f,i[r+12>>2]=f,i[f+8>>2]=r,i[f+12>>2]=n;break}if(r=23268+((n=(r=u>>>8)?u>>>0>16777215?31:u>>>((n=14-((_=((x=r<<(b=(r+1048320|0)>>>16&8))+520192|0)>>>16&4)|b|(n=((x<<=_)+245760|0)>>>16&2))+(x<<n>>>15)|0)+7|0)&1|n<<1:0)<<2)|0,i[f+28>>2]=n,i[(t=f+16|0)+4>>2]=0,i[t>>2]=0,!(o&(t=1<<n))){i[5742]=o|t,i[r>>2]=f,i[f+24>>2]=r,i[f+12>>2]=f,i[f+8>>2]=f;break}r=0|i[r>>2];e:do{if((-8&i[r+4>>2]|0)!=(0|u)){for(o=u<<(31==(0|n)?0:25-(n>>>1)|0);t=0|i[(n=r+16+(o>>>31<<2)|0)>>2];){if((-8&i[t+4>>2]|0)==(0|u)){r=t;break e}o<<=1,r=t}i[n>>2]=f,i[f+24>>2]=r,i[f+12>>2]=f,i[f+8>>2]=f;break t}}while(0);x=0|i[(b=r+8|0)>>2],i[x+12>>2]=f,i[b>>2]=f,i[f+8>>2]=x,i[f+12>>2]=r,i[f+24>>2]=0}}while(0);return M=e,0|(x=c+8|0)}p=h}else p=h;else p=-1}while(0);if((n=0|i[5743])>>>0>=p>>>0)return r=n-p|0,t=0|i[5746],r>>>0>15?(x=t+p|0,i[5746]=x,i[5743]=r,i[x+4>>2]=1|r,i[t+n>>2]=r,i[t+4>>2]=3|p):(i[5743]=0,i[5746]=0,i[t+4>>2]=3|n,i[(x=t+n+4|0)>>2]=1|i[x>>2]),M=e,0|(x=t+8|0);if((u=0|i[5744])>>>0>p>>>0)return _=u-p|0,i[5744]=_,b=(x=0|i[5747])+p|0,i[5747]=b,i[b+4>>2]=1|_,i[x+4>>2]=3|p,M=e,0|(x=x+8|0);if(0|i[5859]?t=0|i[5861]:(i[5861]=4096,i[5860]=4096,i[5862]=-1,i[5863]=-1,i[5864]=0,i[5852]=0,i[5859]=-16&d^1431655768,t=4096),c=p+48|0,(h=(s=t+(l=p+47|0)|0)&(a=0-t|0))>>>0<=p>>>0)return M=e,0|(x=0);if(0|(t=0|i[5851])&&(d=(f=0|i[5849])+h|0)>>>0<=f>>>0|d>>>0>t>>>0)return M=e,0|(x=0);t:do{if(4&i[5852])r=0,m=143;else{n=0|i[5747];e:do{if(n){for(o=23412;!((d=0|i[o>>2])>>>0<=n>>>0&&(d+(0|i[o+4>>2])|0)>>>0>n>>>0);){if(!(t=0|i[o+8>>2])){m=128;break e}o=t}if((r=s-u&a)>>>0<2147483647)if((0|(t=0|Ee(0|r)))==((0|i[o>>2])+(0|i[o+4>>2])|0)){if(-1!=(0|t)){u=r,s=t,m=145;break t}}else o=t,m=136;else r=0}else m=128}while(0);do{if(128==(0|m))if(-1!=(0|(n=0|Ee(0)))&&(r=n,g=(r=(0==((g=(A=0|i[5860])+-1|0)&r|0)?0:(g+r&0-A)-r|0)+h|0)+(A=0|i[5849])|0,r>>>0>p>>>0&r>>>0<2147483647)){if(0|(d=0|i[5851])&&g>>>0<=A>>>0|g>>>0>d>>>0){r=0;break}if((0|(t=0|Ee(0|r)))==(0|n)){u=r,s=n,m=145;break t}o=t,m=136}else r=0}while(0);do{if(136==(0|m)){if(n=0-r|0,!(c>>>0>r>>>0&r>>>0<2147483647&-1!=(0|o))){if(-1==(0|o)){r=0;break}u=r,s=o,m=145;break t}if((t=l-r+(t=0|i[5861])&0-t)>>>0>=2147483647){u=r,s=o,m=145;break t}if(-1==(0|Ee(0|t))){Ee(0|n),r=0;break}u=t+r|0,s=o,m=145;break t}}while(0);i[5852]=4|i[5852],m=143}}while(0);if(143==(0|m)&&h>>>0<2147483647&&!(-1==(0|(_=0|Ee(0|h)))|1^(v=(y=(g=0|Ee(0))-_|0)>>>0>(p+40|0)>>>0)|_>>>0<g>>>0&-1!=(0|_)&-1!=(0|g)^1)&&(u=v?y:r,s=_,m=145),145==(0|m)){r=(0|i[5849])+u|0,i[5849]=r,r>>>0>(0|i[5850])>>>0&&(i[5850]=r),l=0|i[5747];t:do{if(l){for(r=23412;;){if((0|s)==((t=0|i[r>>2])+(n=0|i[r+4>>2])|0)){m=154;break}if(!(o=0|i[r+8>>2]))break;r=o}if(154==(0|m)&&(b=r+4|0,0==(8&i[r+12>>2]|0))&&s>>>0>l>>>0&t>>>0<=l>>>0){i[b>>2]=n+u,b=l+(_=0==(7&(_=l+8|0)|0)?0:0-_&7)|0,_=(x=(0|i[5744])+u|0)-_|0,i[5747]=b,i[5744]=_,i[b+4>>2]=1|_,i[l+x+4>>2]=40,i[5748]=i[5863];break}for(s>>>0<(0|i[5745])>>>0&&(i[5745]=s),n=s+u|0,r=23412;;){if((0|i[r>>2])==(0|n)){m=162;break}if(!(t=0|i[r+8>>2]))break;r=t}if(162==(0|m)&&0==(8&i[r+12>>2]|0)){i[r>>2]=s,i[(f=r+4|0)>>2]=(0|i[f>>2])+u,h=(f=s+(0==(7&(f=s+8|0)|0)?0:0-f&7)|0)+p|0,c=(r=n+(0==(7&(r=n+8|0)|0)?0:0-r&7)|0)-f-p|0,i[f+4>>2]=3|p;e:do{if((0|l)==(0|r))x=(0|i[5744])+c|0,i[5744]=x,i[5747]=h,i[h+4>>2]=1|x;else{if((0|i[5746])==(0|r)){x=(0|i[5743])+c|0,i[5743]=x,i[5746]=h,i[h+4>>2]=1|x,i[h+x>>2]=x;break}if(1==(3&(t=0|i[r+4>>2])|0)){u=-8&t,o=t>>>3;r:do{if(t>>>0<256){if(t=0|i[r+8>>2],(0|(n=0|i[r+12>>2]))==(0|t)){i[5741]=i[5741]&~(1<<o);break}i[t+12>>2]=n,i[n+8>>2]=t;break}s=0|i[r+24>>2],t=0|i[r+12>>2];do{if((0|t)==(0|r)){if(t=0|i[(o=(n=r+16|0)+4|0)>>2])n=o;else if(!(t=0|i[n>>2])){t=0;break}for(;;)if(o=0|i[(a=t+20|0)>>2])t=o,n=a;else{if(!(o=0|i[(a=t+16|0)>>2]))break;t=o,n=a}i[n>>2]=0}else x=0|i[r+8>>2],i[x+12>>2]=t,i[t+8>>2]=x}while(0);if(!s)break;o=23268+((n=0|i[r+28>>2])<<2)|0;do{if((0|i[o>>2])==(0|r)){if(i[o>>2]=t,0|t)break;i[5742]=i[5742]&~(1<<n);break r}if(i[((0|i[(x=s+16|0)>>2])==(0|r)?x:s+20|0)>>2]=t,!t)break r}while(0);if(i[t+24>>2]=s,0|(o=0|i[(n=r+16|0)>>2])&&(i[t+16>>2]=o,i[o+24>>2]=t),!(n=0|i[n+4>>2]))break;i[t+20>>2]=n,i[n+24>>2]=t}while(0);r=r+u|0,a=u+c|0}else a=c;if(i[(r=r+4|0)>>2]=-2&i[r>>2],i[h+4>>2]=1|a,i[h+a>>2]=a,r=a>>>3,a>>>0<256){n=23004+(r<<1<<2)|0,(t=0|i[5741])&(r=1<<r)?r=0|i[(t=n+8|0)>>2]:(i[5741]=t|r,r=n,t=n+8|0),i[t>>2]=h,i[r+12>>2]=h,i[h+8>>2]=r,i[h+12>>2]=n;break}r=a>>>8;do{if(r){if(a>>>0>16777215){o=31;break}o=a>>>((o=14-((_=((x=r<<(b=(r+1048320|0)>>>16&8))+520192|0)>>>16&4)|b|(o=((x<<=_)+245760|0)>>>16&2))+(x<<o>>>15)|0)+7|0)&1|o<<1}else o=0}while(0);if(r=23268+(o<<2)|0,i[h+28>>2]=o,i[(t=h+16|0)+4>>2]=0,i[t>>2]=0,!((t=0|i[5742])&(n=1<<o))){i[5742]=t|n,i[r>>2]=h,i[h+24>>2]=r,i[h+12>>2]=h,i[h+8>>2]=h;break}r=0|i[r>>2];r:do{if((-8&i[r+4>>2]|0)!=(0|a)){for(o=a<<(31==(0|o)?0:25-(o>>>1)|0);t=0|i[(n=r+16+(o>>>31<<2)|0)>>2];){if((-8&i[t+4>>2]|0)==(0|a)){r=t;break r}o<<=1,r=t}i[n>>2]=h,i[h+24>>2]=r,i[h+12>>2]=h,i[h+8>>2]=h;break e}}while(0);x=0|i[(b=r+8|0)>>2],i[x+12>>2]=h,i[b>>2]=h,i[h+8>>2]=x,i[h+12>>2]=r,i[h+24>>2]=0}}while(0);return M=e,0|(x=f+8|0)}for(r=23412;!((t=0|i[r>>2])>>>0<=l>>>0&&(x=t+(0|i[r+4>>2])|0)>>>0>l>>>0);)r=0|i[r+8>>2];r=(t=(t=(a=x+-47|0)+(0==(7&(t=a+8|0)|0)?0:0-t&7)|0)>>>0<(a=l+16|0)>>>0?l:t)+8|0,b=s+(_=0==(7&(_=s+8|0)|0)?0:0-_&7)|0,_=(n=u+-40|0)-_|0,i[5747]=b,i[5744]=_,i[b+4>>2]=1|_,i[s+n+4>>2]=40,i[5748]=i[5863],i[(n=t+4|0)>>2]=27,i[r>>2]=i[5853],i[r+4>>2]=i[5854],i[r+8>>2]=i[5855],i[r+12>>2]=i[5856],i[5853]=s,i[5854]=u,i[5856]=0,i[5855]=r,r=t+24|0;do{b=r,i[(r=r+4|0)>>2]=7}while((b+8|0)>>>0<x>>>0);if((0|t)!=(0|l)){if(s=t-l|0,i[n>>2]=-2&i[n>>2],i[l+4>>2]=1|s,i[t>>2]=s,r=s>>>3,s>>>0<256){n=23004+(r<<1<<2)|0,(t=0|i[5741])&(r=1<<r)?r=0|i[(t=n+8|0)>>2]:(i[5741]=t|r,r=n,t=n+8|0),i[t>>2]=l,i[r+12>>2]=l,i[l+8>>2]=r,i[l+12>>2]=n;break}if(n=23268+((o=(r=s>>>8)?s>>>0>16777215?31:s>>>((o=14-((_=((x=r<<(b=(r+1048320|0)>>>16&8))+520192|0)>>>16&4)|b|(o=((x<<=_)+245760|0)>>>16&2))+(x<<o>>>15)|0)+7|0)&1|o<<1:0)<<2)|0,i[l+28>>2]=o,i[l+20>>2]=0,i[a>>2]=0,!((r=0|i[5742])&(t=1<<o))){i[5742]=r|t,i[n>>2]=l,i[l+24>>2]=n,i[l+12>>2]=l,i[l+8>>2]=l;break}r=0|i[n>>2];e:do{if((-8&i[r+4>>2]|0)!=(0|s)){for(o=s<<(31==(0|o)?0:25-(o>>>1)|0);t=0|i[(n=r+16+(o>>>31<<2)|0)>>2];){if((-8&i[t+4>>2]|0)==(0|s)){r=t;break e}o<<=1,r=t}i[n>>2]=l,i[l+24>>2]=r,i[l+12>>2]=l,i[l+8>>2]=l;break t}}while(0);x=0|i[(b=r+8|0)>>2],i[x+12>>2]=l,i[b>>2]=l,i[l+8>>2]=x,i[l+12>>2]=r,i[l+24>>2]=0}}else 0==(0|(x=0|i[5745]))|s>>>0<x>>>0&&(i[5745]=s),i[5853]=s,i[5854]=u,i[5856]=0,i[5750]=i[5859],i[5749]=-1,i[5754]=23004,i[5753]=23004,i[5756]=23012,i[5755]=23012,i[5758]=23020,i[5757]=23020,i[5760]=23028,i[5759]=23028,i[5762]=23036,i[5761]=23036,i[5764]=23044,i[5763]=23044,i[5766]=23052,i[5765]=23052,i[5768]=23060,i[5767]=23060,i[5770]=23068,i[5769]=23068,i[5772]=23076,i[5771]=23076,i[5774]=23084,i[5773]=23084,i[5776]=23092,i[5775]=23092,i[5778]=23100,i[5777]=23100,i[5780]=23108,i[5779]=23108,i[5782]=23116,i[5781]=23116,i[5784]=23124,i[5783]=23124,i[5786]=23132,i[5785]=23132,i[5788]=23140,i[5787]=23140,i[5790]=23148,i[5789]=23148,i[5792]=23156,i[5791]=23156,i[5794]=23164,i[5793]=23164,i[5796]=23172,i[5795]=23172,i[5798]=23180,i[5797]=23180,i[5800]=23188,i[5799]=23188,i[5802]=23196,i[5801]=23196,i[5804]=23204,i[5803]=23204,i[5806]=23212,i[5805]=23212,i[5808]=23220,i[5807]=23220,i[5810]=23228,i[5809]=23228,i[5812]=23236,i[5811]=23236,i[5814]=23244,i[5813]=23244,i[5816]=23252,i[5815]=23252,b=s+(_=0==(7&(_=s+8|0)|0)?0:0-_&7)|0,_=(x=u+-40|0)-_|0,i[5747]=b,i[5744]=_,i[b+4>>2]=1|_,i[s+x+4>>2]=40,i[5748]=i[5863]}while(0);if((r=0|i[5744])>>>0>p>>>0)return _=r-p|0,i[5744]=_,b=(x=0|i[5747])+p|0,i[5747]=b,i[b+4>>2]=1|_,i[x+4>>2]=3|p,M=e,0|(x=x+8|0)}return i[(x=22960)>>2]=12,M=e,0|(x=0)}function fe(t){var e=0,r=0,n=0,o=0,a=0,s=0,u=0,c=0;if(t|=0){r=t+-8|0,o=0|i[5745],c=r+(e=-8&(t=0|i[t+-4>>2]))|0;do{if(1&t)u=r,s=r;else{if(n=0|i[r>>2],!(3&t))return;if(a=n+e|0,(s=r+(0-n)|0)>>>0<o>>>0)return;if((0|i[5746])==(0|s)){if(3!=(3&(e=0|i[(t=c+4|0)>>2])|0)){u=s,e=a;break}return i[5743]=a,i[t>>2]=-2&e,i[s+4>>2]=1|a,void(i[s+a>>2]=a)}if(r=n>>>3,n>>>0<256){if(t=0|i[s+8>>2],(0|(e=0|i[s+12>>2]))==(0|t)){i[5741]=i[5741]&~(1<<r),u=s,e=a;break}i[t+12>>2]=e,i[e+8>>2]=t,u=s,e=a;break}o=0|i[s+24>>2],t=0|i[s+12>>2];do{if((0|t)==(0|s)){if(t=0|i[(r=(e=s+16|0)+4|0)>>2])e=r;else if(!(t=0|i[e>>2])){t=0;break}for(;;)if(r=0|i[(n=t+20|0)>>2])t=r,e=n;else{if(!(r=0|i[(n=t+16|0)>>2]))break;t=r,e=n}i[e>>2]=0}else u=0|i[s+8>>2],i[u+12>>2]=t,i[t+8>>2]=u}while(0);if(o){if(e=0|i[s+28>>2],(0|i[(r=23268+(e<<2)|0)>>2])==(0|s)){if(i[r>>2]=t,!t){i[5742]=i[5742]&~(1<<e),u=s,e=a;break}}else if(i[((0|i[(u=o+16|0)>>2])==(0|s)?u:o+20|0)>>2]=t,!t){u=s,e=a;break}i[t+24>>2]=o,0|(r=0|i[(e=s+16|0)>>2])&&(i[t+16>>2]=r,i[r+24>>2]=t),(e=0|i[e+4>>2])?(i[t+20>>2]=e,i[e+24>>2]=t,u=s,e=a):(u=s,e=a)}else u=s,e=a}}while(0);if(!(s>>>0>=c>>>0)&&1&(n=0|i[(t=c+4|0)>>2])){if(2&n)i[t>>2]=-2&n,i[u+4>>2]=1|e,i[s+e>>2]=e,o=e;else{if((0|i[5747])==(0|c)){if(c=(0|i[5744])+e|0,i[5744]=c,i[5747]=u,i[u+4>>2]=1|c,(0|u)!=(0|i[5746]))return;return i[5746]=0,void(i[5743]=0)}if((0|i[5746])==(0|c))return c=(0|i[5743])+e|0,i[5743]=c,i[5746]=s,i[u+4>>2]=1|c,void(i[s+c>>2]=c);o=(-8&n)+e|0,r=n>>>3;do{if(n>>>0<256){if(e=0|i[c+8>>2],(0|(t=0|i[c+12>>2]))==(0|e)){i[5741]=i[5741]&~(1<<r);break}i[e+12>>2]=t,i[t+8>>2]=e;break}a=0|i[c+24>>2],t=0|i[c+12>>2];do{if((0|t)==(0|c)){if(t=0|i[(r=(e=c+16|0)+4|0)>>2])e=r;else if(!(t=0|i[e>>2])){r=0;break}for(;;)if(r=0|i[(n=t+20|0)>>2])t=r,e=n;else{if(!(r=0|i[(n=t+16|0)>>2]))break;t=r,e=n}i[e>>2]=0,r=t}else r=0|i[c+8>>2],i[r+12>>2]=t,i[t+8>>2]=r,r=t}while(0);if(0|a){if(t=0|i[c+28>>2],(0|i[(e=23268+(t<<2)|0)>>2])==(0|c)){if(i[e>>2]=r,!r){i[5742]=i[5742]&~(1<<t);break}}else if(i[((0|i[(n=a+16|0)>>2])==(0|c)?n:a+20|0)>>2]=r,!r)break;i[r+24>>2]=a,0|(e=0|i[(t=c+16|0)>>2])&&(i[r+16>>2]=e,i[e+24>>2]=r),0|(t=0|i[t+4>>2])&&(i[r+20>>2]=t,i[t+24>>2]=r)}}while(0);if(i[u+4>>2]=1|o,i[s+o>>2]=o,(0|u)==(0|i[5746]))return void(i[5743]=o)}if(t=o>>>3,o>>>0<256)return r=23004+(t<<1<<2)|0,(e=0|i[5741])&(t=1<<t)?t=0|i[(e=r+8|0)>>2]:(i[5741]=e|t,t=r,e=r+8|0),i[e>>2]=u,i[t+12>>2]=u,i[u+8>>2]=t,void(i[u+12>>2]=r);t=23268+((n=(t=o>>>8)?o>>>0>16777215?31:o>>>((n=14-((a=((c=t<<(s=(t+1048320|0)>>>16&8))+520192|0)>>>16&4)|s|(n=((c<<=a)+245760|0)>>>16&2))+(c<<n>>>15)|0)+7|0)&1|n<<1:0)<<2)|0,i[u+28>>2]=n,i[u+20>>2]=0,i[u+16>>2]=0,e=0|i[5742],r=1<<n;t:do{if(e&r){t=0|i[t>>2];e:do{if((-8&i[t+4>>2]|0)!=(0|o)){for(n=o<<(31==(0|n)?0:25-(n>>>1)|0);e=0|i[(r=t+16+(n>>>31<<2)|0)>>2];){if((-8&i[e+4>>2]|0)==(0|o)){t=e;break e}n<<=1,t=e}i[r>>2]=u,i[u+24>>2]=t,i[u+12>>2]=u,i[u+8>>2]=u;break t}}while(0);c=0|i[(s=t+8|0)>>2],i[c+12>>2]=u,i[s>>2]=u,i[u+8>>2]=c,i[u+12>>2]=t,i[u+24>>2]=0}else i[5742]=e|r,i[t>>2]=u,i[u+24>>2]=t,i[u+12>>2]=u,i[u+8>>2]=u}while(0);if(c=(0|i[5749])-1|0,i[5749]=c,!(0|c)){for(t=23420;t=0|i[t>>2];)t=t+8|0;i[5749]=-1}}}}function pe(t,e){e|=0;var r=0;return(t|=0)?(r=0|v(e,t),(e|t)>>>0>65535&&(r=(0|(r>>>0)/(t>>>0))==(0|e)?r:-1)):r=0,(t=0|he(r))&&3&i[t+-4>>2]?(xe(0|t,0,0|r),0|t):0|t}function de(t,e,r,n){return 0|(b(0|(n=(e|=0)-(n|=0)-((r|=0)>>>0>(t|=0)>>>0|0)>>>0)),t-r>>>0|0)}function Ae(t){return 0|((t|=0)?31-(0|_(t^t-1))|0:32)}function ge(t,e,r,n,o){o|=0;var a=0,s=0,u=0,c=0,l=0,h=0,f=0,p=0,d=0,A=0;if(h=t|=0,s=r|=0,u=p=n|=0,!(l=c=e|=0))return a=0!=(0|o),u?a?(i[o>>2]=0|t,i[o+4>>2]=0&e,o=0,0|(b(0|(p=0)),o)):(o=0,0|(b(0|(p=0)),o)):(a&&(i[o>>2]=(h>>>0)%(s>>>0),i[o+4>>2]=0),o=(h>>>0)/(s>>>0)>>>0,0|(b(0|(p=0)),o));a=0==(0|u);do{if(s){if(!a){if((a=(0|_(0|u))-(0|_(0|l))|0)>>>0<=31){s=f=a+1|0,t=h>>>(f>>>0)&(e=a-31>>31)|l<<(u=31-a|0),e&=l>>>(f>>>0),a=0,u=h<<u;break}return o?(i[o>>2]=0|t,i[o+4>>2]=c|0&e,o=0,0|(b(0|(p=0)),o)):(o=0,0|(b(0|(p=0)),o))}if((a=s-1|0)&s|0){s=u=33+(0|_(0|s))-(0|_(0|l))|0,t=(f=32-u|0)-1>>31&l>>>((d=u-32|0)>>>0)|(l<<f|h>>>(u>>>0))&(e=d>>31),e&=l>>>(u>>>0),a=h<<(A=64-u|0)&(c=f>>31),u=(l<<A|h>>>(d>>>0))&c|h<<f&u-33>>31;break}return 0|o&&(i[o>>2]=a&h,i[o+4>>2]=0),1==(0|s)?(A=0|t,0|(b(0|(d=c|0&e)),A)):(d=l>>>((A=0|Ae(0|s))>>>0)|0,A=l<<32-A|h>>>(A>>>0)|0,0|(b(0|d),A))}if(a)return 0|o&&(i[o>>2]=(l>>>0)%(s>>>0),i[o+4>>2]=0),A=(l>>>0)/(s>>>0)>>>0,0|(b(0|(d=0)),A);if(!h)return 0|o&&(i[o>>2]=0,i[o+4>>2]=(l>>>0)%(u>>>0)),A=(l>>>0)/(u>>>0)>>>0,0|(b(0|(d=0)),A);if(!((a=u-1|0)&u))return 0|o&&(i[o>>2]=0|t,i[o+4>>2]=a&l|0&e),d=0,A=l>>>((0|Ae(0|u))>>>0),0|(b(0|d),A);if((a=(0|_(0|u))-(0|_(0|l))|0)>>>0<=30){s=e=a+1|0,t=l<<(u=31-a|0)|h>>>(e>>>0),e=l>>>(e>>>0),a=0,u=h<<u;break}return o?(i[o>>2]=0|t,i[o+4>>2]=c|0&e,A=0,0|(b(0|(d=0)),A)):(A=0,0|(b(0|(d=0)),A))}while(0);if(s){l=0|function(t,e,r,n){return 0|(b((e|=0)+(n|=0)+((r=(t|=0)+(r|=0)>>>0)>>>0<t>>>0|0)>>>0|0),0|r)}(0|(f=0|r),0|(h=p|0&n),-1,-1),r=0|x(),c=u,u=0;do{n=c,c=a>>>31|c<<1,a=u|a<<1,de(0|l,0|r,0|(n=t<<1|n>>>31|0),0|(p=t>>>31|e<<1|0)),u=1&(d=(A=0|x())>>31|((0|A)<0?-1:0)<<1),t=0|de(0|n,0|p,d&f|0,(((0|A)<0?-1:0)>>31|((0|A)<0?-1:0)<<1)&h|0),e=0|x(),s=s-1|0}while(0!=(0|s));l=c,c=0}else l=u,c=0,u=0;return s=0,0|o&&(i[o>>2]=t,i[o+4>>2]=e),A=-2&(a<<1|0)|u,0|(b(0|(d=(0|a)>>>31|(l|s)<<1|0&(s<<1|a>>>31)|c)),A)}function me(t,e,r,n){var o,a;return a=M,M=M+16|0,ge(t|=0,e|=0,r|=0,n|=0,o=0|a),M=a,0|(b(0|i[o+4>>2]),0|i[o>>2])}function ye(t,e,r){return t|=0,e|=0,(0|(r|=0))<32?(b(e>>>r|0),t>>>r|(e&(1<<r)-1)<<32-r):(b(0),e>>>r-32|0)}function ve(t,e,r){return t|=0,e|=0,(0|(r|=0))<32?(b(e<<r|(t&(1<<r)-1<<32-r)>>>32-r|0),t<<r):(b(t<<r-32|0),0)}function _e(t){return(t=+t)>=0?+s(t+.5):+y(t-.5)}function be(t,e,r){t|=0,e|=0;var o,a,s=0;if((0|(r|=0))>=8192)return O(0|t,0|e,0|r),0|t;if(a=0|t,o=t+r|0,(3&t)==(3&e)){for(;3&t;){if(!r)return 0|a;n[t>>0]=0|n[e>>0],t=t+1|0,e=e+1|0,r=r-1|0}for(s=(r=-4&o|0)-64|0;(0|t)<=(0|s);)i[t>>2]=i[e>>2],i[t+4>>2]=i[e+4>>2],i[t+8>>2]=i[e+8>>2],i[t+12>>2]=i[e+12>>2],i[t+16>>2]=i[e+16>>2],i[t+20>>2]=i[e+20>>2],i[t+24>>2]=i[e+24>>2],i[t+28>>2]=i[e+28>>2],i[t+32>>2]=i[e+32>>2],i[t+36>>2]=i[e+36>>2],i[t+40>>2]=i[e+40>>2],i[t+44>>2]=i[e+44>>2],i[t+48>>2]=i[e+48>>2],i[t+52>>2]=i[e+52>>2],i[t+56>>2]=i[e+56>>2],i[t+60>>2]=i[e+60>>2],t=t+64|0,e=e+64|0;for(;(0|t)<(0|r);)i[t>>2]=i[e>>2],t=t+4|0,e=e+4|0}else for(r=o-4|0;(0|t)<(0|r);)n[t>>0]=0|n[e>>0],n[t+1>>0]=0|n[e+1>>0],n[t+2>>0]=0|n[e+2>>0],n[t+3>>0]=0|n[e+3>>0],t=t+4|0,e=e+4|0;for(;(0|t)<(0|o);)n[t>>0]=0|n[e>>0],t=t+1|0,e=e+1|0;return 0|a}function xe(t,e,r){e|=0;var o,a=0,s=0,u=0;if(o=(t|=0)+(r|=0)|0,e&=255,(0|r)>=67){for(;3&t;)n[t>>0]=e,t=t+1|0;for(u=e|e<<8|e<<16|e<<24,s=(a=-4&o|0)-64|0;(0|t)<=(0|s);)i[t>>2]=u,i[t+4>>2]=u,i[t+8>>2]=u,i[t+12>>2]=u,i[t+16>>2]=u,i[t+20>>2]=u,i[t+24>>2]=u,i[t+28>>2]=u,i[t+32>>2]=u,i[t+36>>2]=u,i[t+40>>2]=u,i[t+44>>2]=u,i[t+48>>2]=u,i[t+52>>2]=u,i[t+56>>2]=u,i[t+60>>2]=u,t=t+64|0;for(;(0|t)<(0|a);)i[t>>2]=u,t=t+4|0}for(;(0|t)<(0|o);)n[t>>0]=e,t=t+1|0;return o-r|0}function we(t){return(t=+t)>=0?+s(t+.5):+y(t-.5)}function Ee(t){t|=0;var e,r,n;return n=0|S(),(0|t)>0&(0|(e=(r=0|i[a>>2])+t|0))<(0|r)|(0|e)<0?(P(0|e),E(12),-1):(0|e)>(0|n)&&!(0|T(0|e))?(E(12),-1):(i[a>>2]=e,0|r)}return{___uremdi3:me,_bitshift64Lshr:ye,_bitshift64Shl:ve,_calloc:pe,_compact:function(t,e,r){e|=0;var n,o=0,a=0,s=0,u=0,c=0,l=0,h=0,f=0,p=0,d=0,A=0,g=0,m=0,y=0,v=0,_=0,b=0,w=0,E=0;if(!(r|=0))return 0|(E=0);if(o=0|i[(a=t|=0)>>2],!0&0==(15728640&(a=0|i[a+4>>2])|0)){if((0|r)<=0)return 0|(E=0);if(i[(E=e)>>2]=o,i[E+4>>2]=a,1==(0|r))return 0|(E=0);o=1;do{w=0|i[(b=t+(o<<3)|0)+4>>2],i[(E=e+(o<<3)|0)>>2]=i[b>>2],i[E+4>>2]=w,o=o+1|0}while((0|o)!=(0|r));return 0|(o=0)}be(0|(w=0|he(b=r<<3)),0|t,0|b),n=0|pe(r,8),o=r;t:for(;;){v=0|ye(0|(f=0|i[(u=w)>>2]),0|(u=0|i[u+4>>2]),52),x(),_=(v&=15)+-1|0,y=(0|o)>0;e:do{if(y){if(m=((0|o)<0)<<31>>31,A=0|ve(0|_,0,52),g=0|x(),_>>>0>15)for(a=0,t=f,r=u;;){if(!(0==(0|t)&0==(0|r))){if(s=0|ye(0|t,0|r,52),x(),c=(0|(s&=15))<(0|_),s=(0|s)==(0|_),r=0|me(0|(h=c?0:s?t:0),0|(t=c?0:s?r:0),0|o,0|m),x(),0==(0|(l=0|i[(c=s=n+(r<<3)|0)>>2]))&0==(0|(c=0|i[c+4>>2])))r=h;else for(A=0,d=r,p=l,r=h,l=s;;){if((0|A)>(0|o)){E=33;break t}if((0|p)==(0|r)&(-117440513&c|0)==(0|t)){if(s=0|ye(0|p,0|c,56),x(),7==(0|(s&=7))){E=38;break t}g=0|ve(s+1|0,0,56),t=0|x()|-117440513&t,i[l>>2]=0,i[l+4>>2]=0,l=d,r|=g}else l=(d+1|0)%(0|o)|0;if(0==(0|(p=0|i[(c=s=n+(l<<3)|0)>>2]))&0==(0|(c=0|i[c+4>>2])))break;A=A+1|0,d=l,l=s}i[(g=s)>>2]=r,i[g+4>>2]=t}if((0|(a=a+1|0))>=(0|o))break e;t=0|i[(r=w+(a<<3)|0)>>2],r=0|i[r+4>>2]}for(a=0,t=f,r=u;;){if(!(0==(0|t)&0==(0|r))){if(c=0|ye(0|t,0|r,52),x(),(0|(c&=15))>=(0|_)){if((0|c)!=(0|_)&&(t|=A,r=-15728641&r|g,c>>>0>=v>>>0)){s=_;do{d=0|ve(7,0,3*(14-s|0)|0),s=s+1|0,t|=d,r=0|x()|r}while(s>>>0<c>>>0)}}else t=0,r=0;if(c=0|me(0|t,0|r,0|o,0|m),x(),!(0==(0|(h=0|i[(l=s=n+(c<<3)|0)>>2]))&0==(0|(l=0|i[l+4>>2]))))for(d=0,p=h,h=s;;){if((0|d)>(0|o)){E=33;break t}if((0|p)==(0|t)&(-117440513&l|0)==(0|r)){if(s=0|ye(0|p,0|l,56),x(),7==(0|(s&=7))){E=38;break t}p=0|ve(s+1|0,0,56),r=0|x()|-117440513&r,i[h>>2]=0,i[h+4>>2]=0,t|=p}else c=(c+1|0)%(0|o)|0;if(0==(0|(p=0|i[(l=s=n+(c<<3)|0)>>2]))&0==(0|(l=0|i[l+4>>2])))break;d=d+1|0,h=s}i[(d=s)>>2]=t,i[d+4>>2]=r}if((0|(a=a+1|0))>=(0|o))break e;t=0|i[(r=w+(a<<3)|0)>>2],r=0|i[r+4>>2]}}}while(0);if((o+5|0)>>>0<11){E=84;break}m=0|he(((0|o)/6|0)<<3);e:do{if(y){A=0,d=0;do{if(!(0==(0|(a=0|i[(t=c=n+(A<<3)|0)>>2]))&0==(0|(t=0|i[t+4>>2])))){l=0|ye(0|a,0|t,56),x(),r=(l&=7)+1|0,h=-117440513&t,g=0|ye(0|a,0|t,45),x();r:do{if(0|L(127&g)){if(p=0|ye(0|a,0|t,52),x(),0|(p&=15))for(s=1;;){if(!(0==(a&(g=0|ve(7,0,3*(15-s|0)|0))|0)&0==(h&(0|x())|0)))break r;if(!(s>>>0<p>>>0))break;s=s+1|0}a|=t=0|ve(0|r,0,56),t=0|x()|h,i[(r=c)>>2]=a,i[r+4>>2]=t,r=l+2|0}}while(0);7==(0|r)&&(i[(g=m+(d<<3)|0)>>2]=a,i[g+4>>2]=-117440513&t,d=d+1|0)}A=A+1|0}while((0|A)!=(0|o));if(y){if(g=((0|o)<0)<<31>>31,p=0|ve(0|_,0,52),A=0|x(),_>>>0>15)for(t=0,a=0;;){do{if(!(0==(0|f)&0==(0|u))){for(l=0|ye(0|f,0|u,52),x(),s=(0|(l&=15))<(0|_),l=(0|l)==(0|_),s=0|me(0|(c=s?0:l?f:0),0|(l=s?0:l?u:0),0|o,0|g),x(),r=0;;){if((0|r)>(0|o)){E=83;break t}if((-117440513&(h=0|i[(v=n+(s<<3)|0)+4>>2])|0)==(0|l)&&(0|i[v>>2])==(0|c)){E=55;break}if((0|i[(v=n+((s=(s+1|0)%(0|o)|0)<<3)|0)>>2])==(0|c)&&(0|i[v+4>>2])==(0|l))break;r=r+1|0}if(55==(0|E)&&(E=0,!0&100663296==(117440512&h|0)))break;i[(v=e+(a<<3)|0)>>2]=f,i[v+4>>2]=u,a=a+1|0}}while(0);if((0|(t=t+1|0))>=(0|o)){o=d;break e}f=0|i[(u=w+(t<<3)|0)>>2],u=0|i[u+4>>2]}for(t=0,a=0;;){do{if(!(0==(0|f)&0==(0|u))){if(l=0|ye(0|f,0|u,52),x(),(0|(l&=15))>=(0|_))if((0|l)!=(0|_))if(r=f|p,s=-15728641&u|A,l>>>0<v>>>0)l=s;else{c=_;do{y=0|ve(7,0,3*(14-c|0)|0),c=c+1|0,r|=y,s=0|x()|s}while(c>>>0<l>>>0);l=s}else r=f,l=u;else r=0,l=0;for(c=0|me(0|r,0|l,0|o,0|g),x(),s=0;;){if((0|s)>(0|o)){E=83;break t}if((-117440513&(h=0|i[(y=n+(c<<3)|0)+4>>2])|0)==(0|l)&&(0|i[y>>2])==(0|r)){E=78;break}if((0|i[(y=n+((c=(c+1|0)%(0|o)|0)<<3)|0)>>2])==(0|r)&&(0|i[y+4>>2])==(0|l))break;s=s+1|0}if(78==(0|E)&&(E=0,!0&100663296==(117440512&h|0)))break;i[(y=e+(a<<3)|0)>>2]=f,i[y+4>>2]=u,a=a+1|0}}while(0);if((0|(t=t+1|0))>=(0|o)){o=d;break e}f=0|i[(u=w+(t<<3)|0)>>2],u=0|i[u+4>>2]}}else a=0,o=d}else a=0,o=0}while(0);if(xe(0|n,0,0|b),be(0|w,0|m,o<<3|0),fe(m),!o)break;e=e+(a<<3)|0}return 33==(0|E)?(fe(w),fe(n),0|(E=-1)):38==(0|E)?(fe(w),fe(n),0|(E=-2)):83==(0|E)?(fe(m),fe(w),fe(n),0|(E=-1)):(84==(0|E)&&be(0|e,0|w,o<<3|0),fe(w),fe(n),0|(E=0))},_destroyLinkedPolygon:function(t){var e=0,r=0,n=0,o=0;if(t|=0)for(n=1;;){if(0|(e=0|i[t>>2]))do{if(0|(r=0|i[e>>2]))do{o=r,r=0|i[r+16>>2],fe(o)}while(0!=(0|r));o=e,e=0|i[e+8>>2],fe(o)}while(0!=(0|e));if(e=t,t=0|i[t+8>>2],n||fe(e),!t)break;n=0}},_edgeLengthKm:function(t){return+ +o[20752+((t|=0)<<3)>>3]},_edgeLengthM:function(t){return+ +o[20880+((t|=0)<<3)>>3]},_emscripten_replace_memory:function(t){return n=new Int8Array(t),new Uint8Array(t),i=new Int32Array(t),new Float32Array(t),o=new Float64Array(t),r=t,!0},_experimentalH3ToLocalIj:function(t,e,r,n,i){var o,a;return i|=0,a=M,M=M+16|0,(t=0|Xt(t|=0,e|=0,r|=0,n|=0,o=a))||(lt(o,i),t=0),M=a,0|t},_experimentalLocalIjToH3:function(t,e,r,n){var i,o;return t|=0,e|=0,n|=0,i=M,M=M+16|0,ht(r|=0,o=i),n=0|Qt(t,e,o,n),M=i,0|n},_free:fe,_geoToH3:Ft,_getDestinationH3IndexFromUnidirectionalEdge:function(t,e){t|=0;var r,n,o=0;return r=M,M=M+16|0,o=r,!0&268435456==(2013265920&(e|=0)|0)?(n=0|ye(0|t,0|e,56),x(),i[o>>2]=0,o=0|R(t,-2130706433&e|134217728,7&n,o),e=0|x(),b(0|e),M=r,0|o):(o=0,b(0|(e=0)),M=r,0|o)},_getH3IndexesFromUnidirectionalEdge:function(t,e,r){t|=0;var n,o,a,s,u=0;a=M,M=M+16|0,n=a,s=!0&268435456==(2013265920&(e|=0)|0),o=-2130706433&e|134217728,i[(u=r|=0)>>2]=s?t:0,i[u+4>>2]=s?o:0,s?(e=0|ye(0|t,0|e,56),x(),i[n>>2]=0,t=0|R(t,o,7&e,n),e=0|x()):(t=0,e=0),i[(u=r+8|0)>>2]=t,i[u+4>>2]=e,M=a},_getH3UnidirectionalEdge:function(t,e,r,n){var o,a,s=0,u=0;if(a=M,M=M+16|0,o=a,!(0|Gt(t|=0,e|=0,r|=0,n|=0)))return s=0,b(0|(t=0)),M=a,0|s;if(s=-2130706433&e,i[o>>2]=0,(0|(u=0|R(t,e,1,o)))==(0|r)&(0|x())==(0|n))e=0,r=16777216;else if(i[o>>2]=0,(0|(u=0|R(t,e,2,o)))==(0|r)&(0|x())==(0|n))e=0,r=33554432;else if(i[o>>2]=0,(0|(u=0|R(t,e,3,o)))==(0|r)&(0|x())==(0|n))e=0,r=50331648;else if(i[o>>2]=0,(0|(u=0|R(t,e,4,o)))==(0|r)&(0|x())==(0|n))e=0,r=67108864;else if(i[o>>2]=0,(0|(u=0|R(t,e,5,o)))==(0|r)&(0|x())==(0|n))e=0,r=83886080;else{if(i[o>>2]=0,!((0|(u=0|R(t,e,6,o)))==(0|r)&(0|x())==(0|n)))return u=0,b(0|(s=0)),M=a,0|u;e=0,r=100663296}return u=t|e,b(0|(s=s|r|268435456)),M=a,0|u},_getH3UnidirectionalEdgeBoundary:function(t,e,r){t|=0,e|=0,r|=0;var n,o,a=0,s=0,u=0,c=0,l=0,h=0;if(o=M,M=M+368|0,s=o+352|0,l=o+16|0,h=o,xe(0|(n=o+184|0),0,168),xe(0|l,0,168),i[h>>2]=0,i[h+4>>2]=0,i[h+8>>2]=0,i[h+12>>2]=0,a=-2130706433&e|134217728,Vt((c=!0&268435456==(2013265920&e|0))?t:0,c?a:0,n),c?(e=0|ye(0|t,0|e,56),x(),i[s>>2]=0,t=0|R(t,a,7&e,s),e=0|x()):(t=0,e=0),Vt(t,e,l),(0|i[n>>2])<=0)return h=0,i[r>>2]=h,void(M=o);c=n+24|0,t=0,e=0,u=0;do{s=n+8+(u<<4)|0;t:do{if((0|i[l>>2])>0){for(a=0;!(0|wt(s,l+8+(a<<4)|0,1e-6));)if((0|(a=a+1|0))>=(0|i[l>>2]))break t;e:do{if(!u){if((0|i[l>>2])>0){a=0;do{if(0|wt(c,l+8+(a<<4)|0,1e-6))break e;a=a+1|0}while((0|a)<(0|i[l>>2]))}i[h>>2]=i[s>>2],i[h+4>>2]=i[s+4>>2],i[h+8>>2]=i[s+8>>2],i[h+12>>2]=i[s+12>>2],e=1;break t}}while(0);i[(a=r+8+(t<<4)|0)>>2]=i[s>>2],i[a+4>>2]=i[s+4>>2],i[a+8>>2]=i[s+8>>2],i[a+12>>2]=i[s+12>>2],t=t+1|0}}while(0);u=u+1|0}while((0|u)<(0|i[n>>2]));if(!e)return h=t,i[r>>2]=h,void(M=o);i[(l=r+8+(t<<4)|0)>>2]=i[h>>2],i[l+4>>2]=i[h+4>>2],i[l+8>>2]=i[h+8>>2],i[l+12>>2]=i[h+12>>2],h=t+1|0,i[r>>2]=h,M=o},_getH3UnidirectionalEdgesFromHexagon:function(t,e,r){r|=0;var n,o=0;n=0==(0|It(t|=0,e|=0)),e&=-2130706433,i[(o=r)>>2]=n?t:0,i[o+4>>2]=n?285212672|e:0,i[(o=r+8|0)>>2]=t,i[o+4>>2]=301989888|e,i[(o=r+16|0)>>2]=t,i[o+4>>2]=318767104|e,i[(o=r+24|0)>>2]=t,i[o+4>>2]=335544320|e,i[(o=r+32|0)>>2]=t,i[o+4>>2]=352321536|e,i[(r=r+40|0)>>2]=t,i[r+4>>2]=369098752|e},_getOriginH3IndexFromUnidirectionalEdge:function(t,e){var r;return t|=0,b(0|((r=!0&268435456==(2013265920&(e|=0)|0))?-2130706433&e|134217728:0)),0|(r?t:0)},_getPentagonIndexes:function(t,e){e|=0;var r,n=0,o=0,a=0,s=0,u=0,c=0;if(ve(0|(t|=0),0,52),r=134225919|x(),(0|t)<1){o=0,n=0;do{0|L(o)&&(ve(0|o,0,45),u=0|r|x(),i[(t=e+(n<<3)|0)>>2]=-1,i[t+4>>2]=u,n=n+1|0),o=o+1|0}while(122!=(0|o))}else{u=0,n=0;do{if(0|L(u)){for(ve(0|u,0,45),o=1,a=-1,s=0|r|x();a&=~(c=0|ve(7,0,3*(15-o|0)|0)),s&=~(0|x()),(0|o)!=(0|t);)o=o+1|0;i[(c=e+(n<<3)|0)>>2]=a,i[c+4>>2]=s,n=n+1|0}u=u+1|0}while(122!=(0|u))}},_getRes0Indexes:function(t){t|=0;var e=0,r=0,n=0;e=0;do{ve(0|e,0,45),n=134225919|x(),i[(r=t+(e<<3)|0)>>2]=-1,i[r+4>>2]=n,e=e+1|0}while(122!=(0|e))},_h3Distance:function(t,e,r,n){var i,o,a;return r|=0,n|=0,a=M,M=M+32|0,o=a,t=0==(0|Xt(t|=0,e|=0,t,e,i=a+12|0))&&0==(0|Xt(t,e,r,n,o))?0|ct(i,o):-1,M=a,0|t},_h3GetBaseCell:function(t,e){return e=0|ye(0|(t|=0),0|(e|=0),45),x(),127&e|0},_h3GetFaces:function t(e,r,n){n|=0;var o,a=0,s=0,u=0,c=0,l=0,h=0,f=0,p=0;o=M,M=M+128|0,f=o+112|0,u=o+96|0,p=o,s=0|ye(0|(e|=0),0|(r|=0),52),x(),l=15&s,i[f>>2]=l,c=0|ye(0|e,0|r,45),x(),c&=127;t:do{if(0|L(c)){if(0|l)for(a=1;;){if(!(0==((h=0|ve(7,0,3*(15-a|0)|0))&e|0)&0==((0|x())&r|0))){s=0;break t}if(!(a>>>0<l>>>0))break;a=a+1|0}if(!(1&s))return h=0|ve(l+1|0,0,52),p=0|x()|-15728641&r,t((h|e)&~(f=0|ve(7,0,3*(14-l|0)|0)),p&~(0|x()),n),void(M=o);s=1}else s=0}while(0);Nt(e,r,u),s?(mt(u,f,p),h=5):(bt(u,f,p),h=6);t:do{if(0|L(c))if(l)for(a=1;;){if(!(0==((c=0|ve(7,0,3*(15-a|0)|0))&e|0)&0==((0|x())&r|0))){a=8;break t}if(!(a>>>0<l>>>0)){a=20;break}a=a+1|0}else a=20;else a=8}while(0);if(xe(0|n,-1,0|a),s){s=0;do{for(vt(u=p+(s<<4)|0,0|i[f>>2]),u=0|i[u>>2],a=0;!(-1==(0|(l=0|i[(c=n+(a<<2)|0)>>2]))|(0|l)==(0|u));)a=a+1|0;i[c>>2]=u,s=s+1|0}while((0|s)!=(0|h))}else{s=0;do{for(yt(u=p+(s<<4)|0,0|i[f>>2],0,1),u=0|i[u>>2],a=0;!(-1==(0|(l=0|i[(c=n+(a<<2)|0)>>2]))|(0|l)==(0|u));)a=a+1|0;i[c>>2]=u,s=s+1|0}while((0|s)!=(0|h))}M=o},_h3IndexesAreNeighbors:Gt,_h3IsPentagon:It,_h3IsResClassIII:function(t,e){return e=0|ye(0|(t|=0),0|(e|=0),52),x(),1&e|0},_h3IsValid:Pt,_h3Line:function(t,e,r,n,o){r|=0,n|=0,o|=0;var a,s=0,c=0,l=0,h=0,f=0,p=0,d=0,A=0,g=0,m=0,y=0,v=0,_=0,b=0,x=0,w=0,E=0;if(a=M,M=M+48|0,c=a+12|0,w=a,0==(0|Xt(t|=0,e|=0,t,e,s=a+24|0))&&0==(0|Xt(t,e,r,n,c))){if((0|(x=0|ct(s,c)))<0)return M=a,0|(w=x);for(i[s>>2]=0,i[s+4>>2]=0,i[s+8>>2]=0,i[c>>2]=0,i[c+4>>2]=0,i[c+8>>2]=0,Xt(t,e,t,e,s),Xt(t,e,r,n,c),ft(s),ft(c),x?(g=+(0|x),b=s,r=p=0|i[s>>2],n=d=0|i[(v=s+4|0)>>2],s=A=0|i[(_=s+8|0)>>2],m=+((0|i[c>>2])-p|0)/g,y=+((0|i[c+4>>2])-d|0)/g,g=+((0|i[c+8>>2])-A|0)/g):(v=n=s+4|0,_=A=s+8|0,b=s,r=0|i[s>>2],n=0|i[n>>2],s=0|i[A>>2],m=0,y=0,g=0),i[w>>2]=r,i[(A=w+4|0)>>2]=n,i[(d=w+8|0)>>2]=s,p=0;;){E=m*(h=+(0|p))+ +(0|r),l=y*h+ +(0|i[v>>2]),h=g*h+ +(0|i[_>>2]),n=~~+_e(+E),c=~~+_e(+l),r=~~+_e(+h),E=+u(+(+(0|n)-E)),l=+u(+(+(0|c)-l)),h=+u(+(+(0|r)-h));do{if(!(E>l&E>h)){if(f=0-n|0,l>h){s=f-r|0;break}s=c,r=f-c|0;break}n=0-(c+r)|0,s=c}while(0);if(i[w>>2]=n,i[A>>2]=s,i[d>>2]=r,pt(w),Qt(t,e,w,o+(p<<3)|0),(0|p)==(0|x))break;p=p+1|0,r=0|i[b>>2]}return M=a,0|(w=0)}return M=a,0|(w=-1)},_h3LineSize:function(t,e,r,n){var i,o,a;return r|=0,n|=0,a=M,M=M+32|0,o=a,t=0==(0|Xt(t|=0,e|=0,t,e,i=a+12|0))&&0==(0|Xt(t,e,r,n,o))?0|ct(i,o):-1,M=a,(t>>>31^1)+t|0},_h3SetToLinkedGeo:function(t,e,r){r|=0;var n,o,a,s=0;if(a=M,M=M+32|0,n=a,function(t,e,r){t|=0,r|=0;var n,o,a=0,s=0,u=0,c=0,l=0;if(o=M,M=M+176|0,n=o,(0|(e|=0))<1)return ne(r,0,0),void(M=o);c=0|ye(0|i[(c=t)>>2],0|i[c+4>>2],52),x(),ne(r,(0|e)>6?e:6,15&c),c=0;do{if(Vt(0|i[(a=t+(c<<3)|0)>>2],0|i[a+4>>2],n),(0|(a=0|i[n>>2]))>0){l=0;do{u=n+8+(l<<4)|0,(s=0|ue(r,a=n+8+(((0|(l=l+1|0))%(0|a)|0)<<4)|0,u))?ae(r,s):se(r,u,a),a=0|i[n>>2]}while((0|l)<(0|a))}c=c+1|0}while((0|c)!=(0|e));M=o}(t|=0,e|=0,o=a+16|0),i[r>>2]=0,i[r+4>>2]=0,i[r+8>>2]=0,!(t=0|oe(o)))return qt(r),ie(o),void(M=a);do{e=0|Wt(r);do{Ht(e,t),s=t+16|0,i[n>>2]=i[s>>2],i[n+4>>2]=i[s+4>>2],i[n+8>>2]=i[s+8>>2],i[n+12>>2]=i[s+12>>2],ae(o,t),t=0|ce(o,n)}while(0!=(0|t));t=0|oe(o)}while(0!=(0|t));qt(r),ie(o),M=a},_h3ToCenterChild:function(t,e,r){r|=0;var n=0,i=0;if(n=0|ye(0|(t|=0),0|(e|=0),52),x(),(0|r)<16&(0|(n&=15))<=(0|r)){if((0|n)!=(0|r)&&(t|=i=0|ve(0|r,0,52),e=0|x()|-15728641&e,(0|n)<(0|r)))do{i=0|ve(7,0,3*(14-n|0)|0),n=n+1|0,t&=~i,e&=~(0|x())}while((0|n)<(0|r))}else e=0,t=0;return b(0|e),0|t},_h3ToChildren:Ct,_h3ToGeo:Ut,_h3ToGeoBoundary:Vt,_h3ToParent:Mt,_h3UnidirectionalEdgeIsValid:function(t,e){var r=0;if(!(!0&268435456==(2013265920&(e|=0)|0)))return 0|(r=0);switch(r=0|ye(0|(t|=0),0|e,56),x(),7&r){case 0:case 7:return 0|(r=0)}return!0&16777216==(117440512&e|0)&0!=(0|It(t,r=-2130706433&e|134217728))?0|(r=0):0|(r=0|Pt(t,r))},_hexAreaKm2:function(t){return+ +o[20496+((t|=0)<<3)>>3]},_hexAreaM2:function(t){return+ +o[20624+((t|=0)<<3)>>3]},_hexRing:function(t,e,r,n){t|=0,e|=0,n|=0;var o,a=0,s=0,u=0,c=0,l=0,h=0,f=0;if(o=M,M=M+16|0,f=o,!(r|=0))return i[(f=n)>>2]=t,i[f+4>>2]=e,M=o,0|(f=0);i[f>>2]=0;t:do{if(0|It(t,e))t=1;else{if(s=(0|r)>0){a=0,h=t;do{if(0==(0|(h=0|R(h,e,4,f)))&0==(0|(e=0|x()))){t=2;break t}if(a=a+1|0,0|It(h,e)){t=1;break t}}while((0|a)<(0|r));if(i[(l=n)>>2]=h,i[l+4>>2]=e,l=r+-1|0,s){s=0,u=1,a=h,t=e;do{if(0==(0|(a=0|R(a,t,2,f)))&0==(0|(t=0|x()))){t=2;break t}if(i[(c=n+(u<<3)|0)>>2]=a,i[c+4>>2]=t,u=u+1|0,0|It(a,t)){t=1;break t}s=s+1|0}while((0|s)<(0|r));c=0,s=u;do{if(0==(0|(a=0|R(a,t,3,f)))&0==(0|(t=0|x()))){t=2;break t}if(i[(u=n+(s<<3)|0)>>2]=a,i[u+4>>2]=t,s=s+1|0,0|It(a,t)){t=1;break t}c=c+1|0}while((0|c)<(0|r));u=0;do{if(0==(0|(a=0|R(a,t,1,f)))&0==(0|(t=0|x()))){t=2;break t}if(i[(c=n+(s<<3)|0)>>2]=a,i[c+4>>2]=t,s=s+1|0,0|It(a,t)){t=1;break t}u=u+1|0}while((0|u)<(0|r));u=0;do{if(0==(0|(a=0|R(a,t,5,f)))&0==(0|(t=0|x()))){t=2;break t}if(i[(c=n+(s<<3)|0)>>2]=a,i[c+4>>2]=t,s=s+1|0,0|It(a,t)){t=1;break t}u=u+1|0}while((0|u)<(0|r));u=0;do{if(0==(0|(a=0|R(a,t,4,f)))&0==(0|(t=0|x()))){t=2;break t}if(i[(c=n+(s<<3)|0)>>2]=a,i[c+4>>2]=t,s=s+1|0,0|It(a,t)){t=1;break t}u=u+1|0}while((0|u)<(0|r));for(u=0;;){if(0==(0|(a=0|R(a,t,6,f)))&0==(0|(t=0|x()))){t=2;break t}if((0|u)!=(0|l)){if(i[(c=n+(s<<3)|0)>>2]=a,i[c+4>>2]=t,0|It(a,t)){t=1;break t}s=s+1|0}if((0|(u=u+1|0))>=(0|r)){u=h,s=e;break}}}else u=h,a=h,s=e,t=e}else i[(u=n)>>2]=t,i[u+4>>2]=e,u=t,a=t,s=e,t=e;t=1&((0|u)!=(0|a)|(0|s)!=(0|t))}}while(0);return M=o,0|(f=t)},_i64Subtract:de,_kRing:C,_kRingDistances:function(t,e,r,n,i){var o;t|=0,e|=0,n|=0,i|=0,o=1+(0|v(3*(r|=0)|0,r+1|0))|0,0|I(t,e,r,n,i)&&(xe(0|n,0,o<<3|0),xe(0|i,0,o<<2|0),k(t,e,r,n,i,o,0))},_llvm_round_f64:_e,_malloc:he,_maxFaceCount:function(t,e){var r=0,n=0;if(n=0|ye(0|(t|=0),0|(e|=0),45),x(),!(0|L(127&n)))return 0|(n=2);if(n=0|ye(0|t,0|e,52),x(),!(n&=15))return 0|(n=5);for(r=1;;){if(!(0==((0|ve(7,0,3*(15-r|0)|0))&t|0)&0==((0|x())&e|0))){r=2,t=6;break}if(!(r>>>0<n>>>0)){r=5,t=6;break}r=r+1|0}return 6==(0|t)?0|r:0},_maxH3ToChildrenSize:function(t,e,r){return r|=0,t=0|ye(0|(t|=0),0|(e|=0),52),x(),(0|r)<16&(0|(t&=15))<=(0|r)?0|(r=0|Yt(7,r-t|0)):0|(r=0)},_maxKringSize:function(t){return 1+(0|v(3*(t|=0)|0,t+1|0))|0},_maxPolyfillSize:function(t,e){var r,n;return e|=0,r=M,M=M+32|0,$t(t|=0,n=r),e=0|G(n,e),e=1+(0|v(3*e|0,e+1|0))|0,M=r,0|e},_maxUncompactSize:function(t,e,r){t|=0,r|=0;var n=0,o=0,a=0,s=0;if((0|(e|=0))<=0)return 0|(r=0);if((0|r)>=16){for(n=0;;){if(!(0==(0|i[(s=t+(n<<3)|0)>>2])&0==(0|i[s+4>>2]))){n=-1,o=13;break}if((0|(n=n+1|0))>=(0|e)){n=0,o=13;break}}if(13==(0|o))return 0|n}n=0,s=0;t:for(;;){a=0|i[(o=t+(s<<3)|0)>>2],o=0|i[o+4>>2];do{if(!(0==(0|a)&0==(0|o))){if(o=0|ye(0|a,0|o,52),x(),(0|(o&=15))>(0|r)){n=-1,o=13;break t}if((0|o)==(0|r)){n=n+1|0;break}n=(0|Yt(7,r-o|0))+n|0;break}}while(0);if((0|(s=s+1|0))>=(0|e)){o=13;break}}return 13==(0|o)?0|n:0},_memcpy:be,_memset:xe,_numHexagons:function(t){var e;return t=0|i[(e=21008+((t|=0)<<3)|0)>>2],b(0|i[e+4>>2]),0|t},_pentagonIndexCount:function(){return 12},_polyfill:function(t,e,r){e|=0,r|=0;var n,a,s,c,l=0,h=0,f=0,p=0,d=0,A=0;if(c=M,M=M+32|0,l=c+16|0,a=c,(s=0|he(32+(i[(t|=0)+8>>2]<<5)|0))||w(22487,22096,678,22104),function(t,e){e|=0;var r,n=0,a=0,s=0,c=0,l=0,h=0,f=0,p=0,d=0,A=0,g=0,m=0,y=0,v=0,_=0,b=0,x=0,w=0,E=0,S=0,O=0;if(y=0|i[(t=t|0)>>2]){if(o[(v=e+8|0)>>3]=17976931348623157e292,o[(_=e+24|0)>>3]=17976931348623157e292,o[e>>3]=-17976931348623157e292,o[(b=e+16|0)>>3]=-17976931348623157e292,(0|y)>0){for(s=0|i[t+4>>2],g=17976931348623157e292,m=-17976931348623157e292,a=0,n=-1,f=17976931348623157e292,p=17976931348623157e292,A=-17976931348623157e292,l=-17976931348623157e292,x=0;c=+o[s+(x<<4)>>3],d=+o[s+(x<<4)+8>>3],h=+o[s+(((0|(S=n+2|0))==(0|y)?0:S)<<4)+8>>3],c<f&&(o[v>>3]=c,f=c),d<p&&(o[_>>3]=d,p=d),c>A?o[e>>3]=c:c=A,d>l&&(o[b>>3]=d,l=d),g=d>0&d<g?d:g,m=d<0&d>m?d:m,a|=+u(+(d-h))>3.141592653589793,(0|(n=x+1|0))!=(0|y);)S=x,A=c,x=n,n=S;a&&(o[b>>3]=m,o[_>>3]=g)}}else i[e>>2]=0,i[e+4>>2]=0,i[e+8>>2]=0,i[e+12>>2]=0,i[e+16>>2]=0,i[e+20>>2]=0,i[e+24>>2]=0,i[e+28>>2]=0;if((0|(n=0|i[(S=t+8|0)>>2]))<=0)return;r=t+12|0,E=0;do{if(s=0|i[r>>2],a=E,_=e+((E=E+1|0)<<5)|0,b=0|i[s+(a<<3)>>2]){if(o[(x=e+(E<<5)+8|0)>>3]=17976931348623157e292,o[(t=e+(E<<5)+24|0)>>3]=17976931348623157e292,o[_>>3]=-17976931348623157e292,o[(w=e+(E<<5)+16|0)>>3]=-17976931348623157e292,(0|b)>0){for(y=0|i[s+(a<<3)+4>>2],g=17976931348623157e292,m=-17976931348623157e292,s=0,a=-1,v=0,f=17976931348623157e292,p=17976931348623157e292,d=-17976931348623157e292,l=-17976931348623157e292;c=+o[y+(v<<4)>>3],A=+o[y+(v<<4)+8>>3],h=+o[y+(((0|(a=a+2|0))==(0|b)?0:a)<<4)+8>>3],c<f&&(o[x>>3]=c,f=c),A<p&&(o[t>>3]=A,p=A),c>d?o[_>>3]=c:c=d,A>l&&(o[w>>3]=A,l=A),g=A>0&A<g?A:g,m=A<0&A>m?A:m,s|=+u(+(A-h))>3.141592653589793,(0|(a=v+1|0))!=(0|b);)O=v,v=a,d=c,a=O;s&&(o[w>>3]=m,o[t>>3]=g)}}else i[_>>2]=0,i[_+4>>2]=0,i[_+8>>2]=0,i[_+12>>2]=0,i[_+16>>2]=0,i[_+20>>2]=0,i[_+24>>2]=0,i[_+28>>2]=0,n=0|i[S>>2]}while((0|E)<(0|n))}(t,s),p=0|G(s,e),n=(d=0|v(3*p|0,p+1|0))+1|0,function(t,e){t|=0;var r,n=0;o[(e=e|0)>>3]=.5*(+o[t>>3]+ +o[t+8>>3]),n=+o[t+16>>3],r=+o[t+24>>3],n=+Ot(.5*(r+(n<r?n+6.283185307179586:n))),o[e+8>>3]=n}(s,l),0|I(e=0|Ft(l,e),l=0|x(),p,r,f=0|he(h=n<<2))&&(xe(0|r,0,n<<3|0),xe(0|f,0,0|h),k(e,l,p,r,f,n,0)),fe(f),(0|d)<0)return fe(s),void(M=c);l=a+8|0,e=0;do{0==(0|(f=0|i[(p=h=r+(e<<3)|0)>>2]))&0==(0|(p=0|i[p+4>>2]))||(Ut(f,p,a),A=+St(+o[a>>3]),o[a>>3]=A,A=+Ot(+o[l>>3]),o[l>>3]=A,0|Jt(t,s,a))||(i[(d=h)>>2]=0,i[d+4>>2]=0),e=e+1|0}while((0|e)!=(0|n));fe(s),M=c},_res0IndexCount:function(){return 122},_round:we,_sbrk:Ee,_sizeOfCoordIJ:function(){return 8},_sizeOfGeoBoundary:function(){return 168},_sizeOfGeoCoord:function(){return 16},_sizeOfGeoPolygon:function(){return 16},_sizeOfGeofence:function(){return 8},_sizeOfH3Index:function(){return 8},_sizeOfLinkedGeoPolygon:function(){return 12},_uncompact:function(t,e,r,n,o){t|=0,r|=0,n|=0,o|=0;var a=0,s=0,u=0,c=0,l=0,h=0;if((0|(e|=0))<=0)return 0|(o=0);if((0|o)>=16){for(a=0;;){if(!(0==(0|i[(h=t+(a<<3)|0)>>2])&0==(0|i[h+4>>2]))){a=14;break}if((0|(a=a+1|0))>=(0|e)){s=0,a=16;break}}if(14==(0|a))return 0|((0|n)>0?-2:-1);if(16==(0|a))return 0|s}a=0,h=0;t:for(;;){s=0|i[(u=l=t+(h<<3)|0)>>2],u=0|i[u+4>>2];do{if(!(0==(0|s)&0==(0|u))){if((0|a)>=(0|n)){s=-1,a=16;break t}if(c=0|ye(0|s,0|u,52),x(),(0|(c&=15))>(0|o)){s=-2,a=16;break t}if((0|c)==(0|o)){i[(l=r+(a<<3)|0)>>2]=s,i[l+4>>2]=u,a=a+1|0;break}if((0|(s=(0|Yt(7,o-c|0))+a|0))>(0|n)){s=-1,a=16;break t}Ct(0|i[l>>2],0|i[l+4>>2],o,r+(a<<3)|0),a=s}}while(0);if((0|(h=h+1|0))>=(0|e)){s=0,a=16;break}}return 16==(0|a)?0|s:0},establishStackSpace:function(t,e){M=t|=0},stackAlloc:function(t){var e;return e=M,M=(M=M+(t|=0)|0)+15&-16,0|e},stackRestore:function(t){M=t|=0},stackSave:function(){return 0|M}}}({Math:Math,Int8Array:Int8Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Float32Array:Float32Array,Float64Array:Float64Array},{a:ut,b:function(t){c=t},c:l,d:function(t,e,r,n){ut("Assertion failed: "+A(t)+", at: "+[e?A(e):"unknown filename",r,n?A(n):"unknown function"])},e:function(t){return r.___errno_location&&(_[r.___errno_location()>>2]=t),t},f:q,g:function(t,e,r){y.set(y.subarray(e,e+r),t)},h:function(t){var e=q();if(t>2130706432)return!1;for(var r=Math.max(e,16777216);r<t;)r=r<=536870912?w(2*r,16777216):Math.min(w((3*r+2147483648)/4,16777216),2130706432);return!!Z(r)},i:function(t){ut("OOM")},j:G,k:W,l:Z,m:H,n:function(){var t=H();return r.extraStackTrace&&(t+="\n"+r.extraStackTrace()),W(t)},o:23680,p:23664},g),J=(r.___uremdi3=$.___uremdi3,r._bitshift64Lshr=$._bitshift64Lshr,r._bitshift64Shl=$._bitshift64Shl,r._calloc=$._calloc,r._compact=$._compact,r._destroyLinkedPolygon=$._destroyLinkedPolygon,r._edgeLengthKm=$._edgeLengthKm,r._edgeLengthM=$._edgeLengthM,r._emscripten_replace_memory=$._emscripten_replace_memory),tt=(r._experimentalH3ToLocalIj=$._experimentalH3ToLocalIj,r._experimentalLocalIjToH3=$._experimentalLocalIjToH3,r._free=$._free,r._geoToH3=$._geoToH3,r._getDestinationH3IndexFromUnidirectionalEdge=$._getDestinationH3IndexFromUnidirectionalEdge,r._getH3IndexesFromUnidirectionalEdge=$._getH3IndexesFromUnidirectionalEdge,r._getH3UnidirectionalEdge=$._getH3UnidirectionalEdge,r._getH3UnidirectionalEdgeBoundary=$._getH3UnidirectionalEdgeBoundary,r._getH3UnidirectionalEdgesFromHexagon=$._getH3UnidirectionalEdgesFromHexagon,r._getOriginH3IndexFromUnidirectionalEdge=$._getOriginH3IndexFromUnidirectionalEdge,r._getPentagonIndexes=$._getPentagonIndexes,r._getRes0Indexes=$._getRes0Indexes,r._h3Distance=$._h3Distance,r._h3GetBaseCell=$._h3GetBaseCell,r._h3GetFaces=$._h3GetFaces,r._h3IndexesAreNeighbors=$._h3IndexesAreNeighbors,r._h3IsPentagon=$._h3IsPentagon,r._h3IsResClassIII=$._h3IsResClassIII,r._h3IsValid=$._h3IsValid,r._h3Line=$._h3Line,r._h3LineSize=$._h3LineSize,r._h3SetToLinkedGeo=$._h3SetToLinkedGeo,r._h3ToCenterChild=$._h3ToCenterChild,r._h3ToChildren=$._h3ToChildren,r._h3ToGeo=$._h3ToGeo,r._h3ToGeoBoundary=$._h3ToGeoBoundary,r._h3ToParent=$._h3ToParent,r._h3UnidirectionalEdgeIsValid=$._h3UnidirectionalEdgeIsValid,r._hexAreaKm2=$._hexAreaKm2,r._hexAreaM2=$._hexAreaM2,r._hexRing=$._hexRing,r._i64Subtract=$._i64Subtract,r._kRing=$._kRing,r._kRingDistances=$._kRingDistances,r._llvm_round_f64=$._llvm_round_f64,r._malloc=$._malloc,r._maxFaceCount=$._maxFaceCount,r._maxH3ToChildrenSize=$._maxH3ToChildrenSize,r._maxKringSize=$._maxKringSize,r._maxPolyfillSize=$._maxPolyfillSize,r._maxUncompactSize=$._maxUncompactSize,r._memcpy=$._memcpy,r._memset=$._memset,r._numHexagons=$._numHexagons,r._pentagonIndexCount=$._pentagonIndexCount,r._polyfill=$._polyfill,r._res0IndexCount=$._res0IndexCount,r._round=$._round,r._sbrk=$._sbrk,r._sizeOfCoordIJ=$._sizeOfCoordIJ,r._sizeOfGeoBoundary=$._sizeOfGeoBoundary,r._sizeOfGeoCoord=$._sizeOfGeoCoord,r._sizeOfGeoPolygon=$._sizeOfGeoPolygon,r._sizeOfGeofence=$._sizeOfGeofence,r._sizeOfH3Index=$._sizeOfH3Index,r._sizeOfLinkedGeoPolygon=$._sizeOfLinkedGeoPolygon,r._uncompact=$._uncompact,r.establishStackSpace=$.establishStackSpace,r.stackAlloc=$.stackAlloc),et=r.stackRestore=$.stackRestore,rt=r.stackSave=$.stackSave;if(r.asm=$,r.cwrap=function(t,e,r,n){var i=(r=r||[]).every((function(t){return"number"===t}));return"string"!==e&&i&&!n?f(t):function(){return p(t,e,r,arguments)}},r.setValue=function(t,e,r,n){switch("*"===(r=r||"i8").charAt(r.length-1)&&(r="i32"),r){case"i1":case"i8":m[t>>0]=e;break;case"i16":v[t>>1]=e;break;case"i32":_[t>>2]=e;break;case"i64":z=[e>>>0,(F=e,+I(F)>=1?F>0?(0|L(+R(F/4294967296),4294967295))>>>0:~~+k((F-+(~~F>>>0))/4294967296)>>>0:0)],_[t>>2]=z[0],_[t+4>>2]=z[1];break;case"float":b[t>>2]=e;break;case"double":x[t>>3]=e;break;default:ut("invalid type for setValue: "+r)}},r.getValue=function(t,e,r){switch("*"===(e=e||"i8").charAt(e.length-1)&&(e="i32"),e){case"i1":case"i8":return m[t>>0];case"i16":return v[t>>1];case"i32":case"i64":return _[t>>2];case"float":return b[t>>2];case"double":return x[t>>3];default:ut("invalid type for getValue: "+e)}return null},r.getTempRet0=l,N){V(N)||(Y=N,N=r.locateFile?r.locateFile(Y,a):a+Y),j++,r.monitorRunDependencies&&r.monitorRunDependencies(j);var nt=function(t){t.byteLength&&(t=new Uint8Array(t)),y.set(t,8),r.memoryInitializerRequest&&delete r.memoryInitializerRequest.response,function(t){if(j--,r.monitorRunDependencies&&r.monitorRunDependencies(j),0==j&&(null!==D&&(clearInterval(D),D=null),B)){var e=B;B=null,e()}}()},it=function(){i(N,nt,(function(){throw"could not load memory initializer "+N}))},ot=Q(N);if(ot)nt(ot.buffer);else if(r.memoryInitializerRequest){var at=function(){var t=r.memoryInitializerRequest,e=t.response;if(200!==t.status&&0!==t.status){var n=Q(r.memoryInitializerRequestURL);if(!n)return console.warn("a problem seems to have happened with Module.memoryInitializerRequest, status: "+t.status+", retrying "+N),void it();e=n.buffer}nt(e)};r.memoryInitializerRequest.response?setTimeout(at,0):r.memoryInitializerRequest.addEventListener("load",at)}else it()}function st(t){function e(){K||(K=!0,h||(O(P),O(M),r.onRuntimeInitialized&&r.onRuntimeInitialized(),function(){if(r.postRun)for("function"==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;)t=r.postRun.shift(),C.unshift(t);var t;O(C)}()))}t=t||o,j>0||(!function(){if(r.preRun)for("function"==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)t=r.preRun.shift(),T.unshift(t);var t;O(T)}(),j>0||(r.setStatus?(r.setStatus("Running..."),setTimeout((function(){setTimeout((function(){r.setStatus("")}),1),e()}),1)):e()))}function ut(t){throw r.onAbort&&r.onAbort(t),s(t+=""),u(t),h=!0,"abort("+t+"). Build with -s ASSERTIONS=1 for more info."}if(B=function t(){K||st(),K||(B=t)},r.run=st,r.abort=ut,r.preInit)for("function"==typeof r.preInit&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return st(),t}("object"==typeof Ce?Ce:{}),Ie="number",ke={};[["sizeOfH3Index",Ie],["sizeOfGeoCoord",Ie],["sizeOfGeoBoundary",Ie],["sizeOfGeoPolygon",Ie],["sizeOfGeofence",Ie],["sizeOfLinkedGeoPolygon",Ie],["sizeOfCoordIJ",Ie],["h3IsValid","number",["number","number"]],["geoToH3","number",[Ie,Ie,"number"]],["h3ToGeo",null,["number","number",Ie]],["h3ToGeoBoundary",null,["number","number",Ie]],["maxKringSize",Ie,[Ie]],["kRing",null,["number","number",Ie,Ie]],["kRingDistances",null,["number","number",Ie,Ie,Ie]],["hexRing",null,["number","number",Ie,Ie]],["maxPolyfillSize",Ie,[Ie,"number"]],["polyfill",null,[Ie,"number",Ie]],["h3SetToLinkedGeo",null,[Ie,Ie,Ie]],["destroyLinkedPolygon",null,[Ie]],["compact",Ie,[Ie,Ie,Ie]],["uncompact",Ie,[Ie,Ie,Ie,Ie,"number"]],["maxUncompactSize",Ie,[Ie,Ie,"number"]],["h3IsPentagon","number",["number","number"]],["h3IsResClassIII","number",["number","number"]],["h3GetBaseCell",Ie,["number","number"]],["maxFaceCount",Ie,["number","number"]],["h3GetFaces",null,["number","number",Ie]],["h3ToParent","number",["number","number","number"]],["h3ToChildren",null,["number","number","number",Ie]],["h3ToCenterChild","number",["number","number","number"]],["maxH3ToChildrenSize",Ie,["number","number","number"]],["h3IndexesAreNeighbors","number",["number","number","number","number"]],["getH3UnidirectionalEdge","number",["number","number","number","number"]],["getOriginH3IndexFromUnidirectionalEdge","number",["number","number"]],["getDestinationH3IndexFromUnidirectionalEdge","number",["number","number"]],["h3UnidirectionalEdgeIsValid","number",["number","number"]],["getH3IndexesFromUnidirectionalEdge",null,["number","number",Ie]],["getH3UnidirectionalEdgesFromHexagon",null,["number","number",Ie]],["getH3UnidirectionalEdgeBoundary",null,["number","number",Ie]],["h3Distance",Ie,["number","number","number","number"]],["h3Line",Ie,["number","number","number","number",Ie]],["h3LineSize",Ie,["number","number","number","number"]],["experimentalH3ToLocalIj",Ie,["number","number","number","number",Ie]],["experimentalLocalIjToH3",Ie,["number","number",Ie,Ie]],["hexAreaM2",Ie,["number"]],["hexAreaKm2",Ie,["number"]],["edgeLengthM",Ie,["number"]],["edgeLengthKm",Ie,["number"]],["numHexagons",Ie,["number"]],["getRes0Indexes",null,[Ie]],["res0IndexCount",Ie],["getPentagonIndexes",null,[Ie,Ie]],["pentagonIndexCount",Ie]].forEach((function(t){ke[t[0]]=Ce.cwrap.apply(Ce,t)}));var Re=ke.sizeOfH3Index(),Le=ke.sizeOfGeoCoord(),je=ke.sizeOfGeoBoundary(),De=(ke.sizeOfGeoPolygon(),ke.sizeOfGeofence(),ke.sizeOfLinkedGeoPolygon()),Be=(ke.sizeOfCoordIJ(),"m"),Fe="km";function ze(t){if("number"!=typeof t||t<0||t>15||Math.floor(t)!==t)throw new Error("Invalid resolution: "+t)}function Ne(t){if("string"!=typeof t)return[0,0];var e=parseInt(t.substring(0,t.length-8),16);return[parseInt(t.substring(t.length-8),16),e]}function Ue(t){if(t>=0)return t.toString(16);var e=Ge(8,(t&=2147483647).toString(16));return e=(parseInt(e[0],16)+8).toString(16)+e.substring(1)}function Ve(t,e){return Ue(e)+Ge(8,Ue(t))}function Ge(t,e){for(var r=t-e.length,n="",i=0;i<r;i++)n+="0";return n+=e}function We(t){return[t,Ce.getTempRet0()]}function He(t){var e=We(t),r=e[0],n=e[1];return n?Ve(r,n):null}function qe(t,e,r){Ce.HEAPU32.set(Ne(t),e/4+2*r)}function Ze(t,e){for(var r=e.length,n=0;n<r;n++)qe(e[n],t,n)}function Xe(t){return 180*Ce.getValue(t,"double")/Math.PI}function Qe(t){return[Xe(t),Xe(t+8)]}function Ye(t){return[Xe(t+8),Xe(t)]}function Ke(t,e,r){for(var n=Ce.getValue(t,"i32"),i=t+8,o=[],a=e?Ye:Qe,s=0;s<2*n;s+=2)o.push(a(i+8*s));return r&&o.push(o[0]),o}function $e(t){var e=Ne(t),r=e[0],n=e[1];return Boolean(ke.h3IsPentagon(r,n))}function Je(t){var e=Ce._malloc(Le),r=Ne(t),n=r[0],i=r[1];ke.h3ToGeo(n,i,e);var o=Qe(e);return Ce._free(e),o}function tr(t,e){var r=Ce._malloc(je),n=Ne(t),i=n[0],o=n[1];ke.h3ToGeoBoundary(i,o,r);var a=Ke(r,e,e);return Ce._free(r),a}function er(t,e){if(!t||!t.length)return[];var r=t.length,n=Ce._calloc(r,Re);Ze(n,t);var i=Ce._calloc(De),o=i;ke.h3SetToLinkedGeo(n,r,i);var a=function(t,e){for(var r,n,i,o,a=[],s=e?Ye:Qe;t;){for(a.push(r=[]),n=Ce.getValue(t,"i8*");n;){for(r.push(i=[]),o=Ce.getValue(n,"i8*");o;)i.push(s(o)),o=Ce.getValue(o+16,"i8*");e&&i.push(i[0]),n=Ce.getValue(n+8,"i8*")}t=Ce.getValue(t+8,"i8*")}return a}(i,e);return ke.destroyLinkedPolygon(o),Ce._free(o),Ce._free(n),a}function rr(t,e){switch(ze(t),e){case Be:return ke.edgeLengthM(t);case Fe:return ke.edgeLengthKm(t);default:throw new Error("Unknown unit: "+e)}}function nr(t){return t*Math.PI/180}var ir=r(53);function or(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return ar(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ar(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function ar(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function sr(t){var e=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(t){return!1}}();return function(){var r,n=l()(t);if(e){var i=l()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return u()(this,r)}}function ur(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function cr(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ur(Object(r),!0).forEach((function(e){g()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ur(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var lr=cr(cr({},y.a.defaultProps),{},{getHexagons:{type:"accessor",value:function(t){return t.hexagons}}}),hr=function(t){a()(r,t);var e=sr(r);function r(){return i()(this,r),e.apply(this,arguments)}return d()(r,[{key:"updateState",value:function(t){var e=t.props,r=(t.oldProps,t.changeFlags);if(r.dataChanged||r.updateTriggers&&r.updateTriggers.getHexagons){var n,i=e.data,o=e.getHexagons,a=[],s=Object(ir.a)(i),u=s.iterable,c=s.objectInfo,l=or(u);try{for(l.s();!(n=l.n()).done;){var h=n.value;c.index++;var f,p=or(er(o(h,c),!0));try{for(p.s();!(f=p.n()).done;){var d=f.value;a.push(this.getSubLayerRow({polygon:d},h,c.index))}}catch(t){p.e(t)}finally{p.f()}}}catch(t){l.e(t)}finally{l.f()}this.setState({polygons:a})}}},{key:"renderLayers",value:function(){var t=this.props,e=t.elevationScale,r=t.extruded,n=t.wireframe,i=t.filled,o=t.stroked,a=t.lineWidthScale,s=t.lineWidthMinPixels,u=t.lineWidthMaxPixels,c=t.lineJointRounded,l=t.lineMiterLimit,h=t.lineDashJustified,f=t.material,p=t.getFillColor,d=t.getLineColor,A=t.getLineWidth,g=t.getLineDashArray,m=t.getElevation,v=t.transitions,_=t.updateTriggers;return new(this.getSubLayerClass("cluster-region",y.a))({filled:i,wireframe:n,extruded:r,elevationScale:e,stroked:o,lineWidthScale:a,lineWidthMinPixels:s,lineWidthMaxPixels:u,lineJointRounded:c,lineMiterLimit:l,lineDashJustified:h,material:f,transitions:v,getFillColor:this.getSubLayerAccessor(p),getLineColor:this.getSubLayerAccessor(d),getLineWidth:this.getSubLayerAccessor(A),getLineDashArray:this.getSubLayerAccessor(g),getElevation:this.getSubLayerAccessor(m)},this.getSubLayerProps({id:"cluster-region",updateTriggers:_}),{data:this.state.polygons,getPolygon:function(t){return t.polygon}})}}]),r}(m.a);hr.defaultProps=lr,hr.layerName="H3ClusterLayer";var fr=r(24),pr=r.n(fr),dr=r(157);function Ar(t){var e=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(t){return!1}}();return function(){var r,n=l()(t);if(e){var i=l()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return u()(this,r)}}function gr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function mr(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?gr(Object(r),!0).forEach((function(e){g()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):gr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function yr(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return vr(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return vr(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function vr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function _r(t,e){e=void 0===e?t[0][0]:e;var r,n=yr(t);try{for(n.s();!(r=n.n()).done;){var i=r.value,o=i[0]-e;o>180?i[0]-=360:o<-180&&(i[0]+=360)}}catch(t){n.e(t)}finally{n.f()}}function br(t,e,r){var n=Je(t),i=_()(n,2),o=i[0],a=i[1],s=e.length;_r(e,a);for(var u=e[0]===e[s-1]?s-1:s,c=0;c<u;c++)e[c][0]=Object(fe.f)(a,e[c][0],r),e[c][1]=Object(fe.f)(o,e[c][1],r)}function xr(t,e,r){var n=Je(t(e,r)),i=_()(n,2),o=i[0];return[i[1],o]}function wr(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2?arguments[2]:void 0,n=tr(t,!0);if(1!==e?br(t,n,e):_r(n),r){var i,o=new Float64Array(2*n.length),a=0,s=yr(n);try{for(s.s();!(i=s.n()).done;){var u=i.value;o[a++]=u[0],o[a++]=u[1]}}catch(t){s.e(t)}finally{s.f()}return o}return n}var Er=mr(mr({},y.a.defaultProps),{},{highPrecision:"auto",coverage:{type:"number",min:0,max:1,value:1},centerHexagon:null,getHexagon:{type:"accessor",value:function(t){return t.hexagon}},extruded:!0});delete Er.getLineDashArray;var Sr=function(t){a()(r,t);var e=Ar(r);function r(){return i()(this,r),e.apply(this,arguments)}return d()(r,[{key:"shouldUpdateState",value:function(t){var e=t.changeFlags;return this._shouldUseHighPrecision()?e.propsOrDataChanged:e.somethingChanged}},{key:"updateState",value:function(t){var e=t.props,r=(t.oldProps,t.changeFlags);if(!0!==e.highPrecision&&(r.dataChanged||r.updateTriggers&&r.updateTriggers.getHexagon)){var n=this._calculateH3DataProps(e);this.setState(n)}this._updateVertices(this.context.viewport)}},{key:"_calculateH3DataProps",value:function(t){var e,r,n=-1,i=!1,o=!1,a=Object(ir.a)(t.data),s=a.iterable,u=a.objectInfo,c=yr(s);try{for(c.s();!(e=c.n()).done;){var l=e.value;u.index++;var h=t.getHexagon(l,u),f="string"!=typeof(r=h)?-1:parseInt(r.charAt(1),16);if(n<0){if(n=f,!t.highPrecision)break}else if(n!==f){o=!0;break}if($e(h)){i=!0;break}}}catch(t){c.e(t)}finally{c.f()}return{resolution:n,edgeLengthKM:n>=0?rr(n,Fe):0,hasMultipleRes:o,hasPentagon:i}}},{key:"_shouldUseHighPrecision",value:function(){if("auto"===this.props.highPrecision){var t=this.state,e=t.resolution,r=t.hasPentagon,n=t.hasMultipleRes;return this.context.viewport.resolution||n||r||e>=0&&e<=5}return this.props.highPrecision}},{key:"_updateVertices",value:function(t){if(!this._shouldUseHighPrecision()){var e=this.state,r=e.resolution,n=e.edgeLengthKM,i=e.centerHex;if(!(r<0)){var o=this.props.centerHexagon||function(t,e,r){var n=Ce._malloc(Le);Ce.HEAPF64.set([t,e].map(nr),n/8);var i=He(ke.geoToH3(n,r));return Ce._free(n),i}(t.latitude,t.longitude,r);if(i!==o){if(i){var a=(s=o,u=Ne(i),c=u[0],l=u[1],h=Ne(s),f=h[0],p=h[1],ke.h3Distance(c,l,f,p));if(a>=0&&a*n<10)return}var s,u,c,l,h,f,p,d=t.distanceScales.unitsPerMeter,A=wr(o),g=Je(o),m=_()(g,2),y=m[0],v=m[1],b=t.projectFlat([v,y]),x=_()(b,2),w=x[0],E=x[1];A=A.map((function(e){var r=t.projectFlat(e);return[(r[0]-w)/d[0],(r[1]-E)/d[1]]})),this.setState({centerHex:o,vertices:A})}}}}},{key:"renderLayers",value:function(){return this._shouldUseHighPrecision()?this._renderPolygonLayer():this._renderColumnLayer()}},{key:"_getForwardProps",value:function(){var t=this.props,e=t.elevationScale,r=t.material,n=t.coverage,i=t.extruded,o=t.wireframe,a=t.stroked,s=t.filled,u=t.lineWidthUnits,c=t.lineWidthScale,l=t.lineWidthMinPixels,h=t.lineWidthMaxPixels,f=t.getFillColor,p=t.getElevation,d=t.getLineColor,A=t.getLineWidth,g=t.transitions,m=t.updateTriggers;return{elevationScale:e,extruded:i,coverage:n,wireframe:o,stroked:a,filled:s,lineWidthUnits:u,lineWidthScale:c,lineWidthMinPixels:l,lineWidthMaxPixels:h,material:r,getElevation:p,getFillColor:f,getLineColor:d,getLineWidth:A,transitions:g,updateTriggers:{getFillColor:m.getFillColor,getElevation:m.getElevation,getLineColor:m.getLineColor,getLineWidth:m.getLineWidth}}}},{key:"_renderPolygonLayer",value:function(){var t=this.props,e=t.data,r=t.getHexagon,n=t.updateTriggers,i=t.coverage,o=this.getSubLayerClass("hexagon-cell-hifi",y.a),a=this._getForwardProps();return a.updateTriggers.getPolygon=function(t,e){return null==t?e:"object"===pr()(t)?mr(mr({},t),{},{coverage:e}):{getHexagon:t,coverage:e}}(n.getHexagon,i),new o(a,this.getSubLayerProps({id:"hexagon-cell-hifi",updateTriggers:a.updateTriggers}),{data:e,_normalize:!1,_windingOrder:"CCW",positionFormat:"XY",getPolygon:function(t,e){return wr(r(t,e),i,!0)}})}},{key:"_renderColumnLayer",value:function(){var t=this.props,e=t.data,r=t.getHexagon,n=t.updateTriggers,i=this.getSubLayerClass("hexagon-cell",dr.a),o=this._getForwardProps();return o.updateTriggers.getPosition=n.getHexagon,new i(o,this.getSubLayerProps({id:"hexagon-cell",updateTriggers:o.updateTriggers}),{data:e,diskResolution:6,radius:1,vertices:this.state.vertices,getPosition:xr.bind(null,r)})}}]),r}(m.a);Sr.defaultProps=Er,Sr.layerName="H3HexagonLayer";var Or=r(62),Tr=r(14),Pr=r(224),Mr=r(220),Cr=r(239),Ir=r(295),kr=r(176),Rr=r(225);function Lr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function jr(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Lr(Object(r),!0).forEach((function(e){g()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Lr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Dr(t){var e=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(t){return!1}}();return function(){var r,n=l()(t);if(e){var i=l()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return u()(this,r)}}var Br=function(t){a()(r,t);var e=Dr(r);function r(){return i()(this,r),e.apply(this,arguments)}return d()(r,[{key:"getShaders",value:function(){var t=Se()(l()(r.prototype),"getShaders",this).call(this);return t.modules.push(Ir.a),jr(jr({},t),{},{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\nvoid main(void) {\n vec2 uv = fract(texCoords) * (uvRegions.zw - uvRegions.xy) + uvRegions.xy;\n\n geometry.uv = uv;\n geometry.uv = texCoords;\n\n if (u_pickFeatureIds) {\n geometry.pickingColor = featureIdsPickingColors;\n } else {\n geometry.pickingColor = instancePickingColors;\n }\n\n #ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n pbr_vNormal = project_normal(instanceModelMatrix * normals);\n geometry.normal = pbr_vNormal;\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 vTexCoord = uv;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = vec4(colors * instanceColors.rgb, instanceColors.a);\n geometry.normal = normals_commonspace;\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\n #ifdef MODULE_PBR\n pbr_vPosition = geometry.position.xyz;\n #endif\n\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\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"})}},{key:"initializeState",value:function(){var t=this.props.featureIds;Se()(l()(r.prototype),"initializeState",this).call(this),t&&this.state.attributeManager.add({featureIdsPickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateFeatureIdsPickingColors}})}},{key:"updateState",value:function(t){var e=t.props,n=t.oldProps,i=t.changeFlags;Se()(l()(r.prototype),"updateState",this).call(this,{props:e,oldProps:n,changeFlags:i}),e.pbrMaterial!==n.pbrMaterial&&this.updatePbrMaterialUniforms(e.pbrMaterial)}},{key:"draw",value:function(t){var e=this.props.featureIds;this.state.model&&(this.state.model.setUniforms({u_Camera:this.state.model.getUniforms().project_uCameraPosition,u_pickFeatureIds:Boolean(e)}),Se()(l()(r.prototype),"draw",this).call(this,t))}},{key:"getModel",value:function(t){var e,r=this.props,n=r.id,i=r.pbrMaterial,o=this.parseMaterial(i,t),a=this.getShaders();return(e=t.attributes).COLOR_0||e.colors||(e.colors={constant:!0,value:new Float32Array([1,1,1])}),e.uvRegions||(e.uvRegions={constant:!0,value:new Float32Array([0,0,1,1])}),new kr.a(this.context.gl,jr(jr({},this.getShaders()),{},{id:n,geometry:t,defines:jr(jr({},a.defines),null==o?void 0:o.defines),parameters:null==o?void 0:o.parameters,isInstanced:!0}))}},{key:"updatePbrMaterialUniforms",value:function(t){var e=this.state.model;if(e){var r=this.props.mesh,n=this.parseMaterial(t,r);e.setUniforms(n.uniforms)}}},{key:"parseMaterial",value:function(t,e){var r=Boolean(t.pbrMetallicRoughness&&t.pbrMetallicRoughness.baseColorTexture);return new Cr.a(this.context.gl,{attributes:{NORMAL:e.attributes.normals,TEXCOORD_0:e.attributes.texCoords},material:jr({unlit:r},t),pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1})}},{key:"calculateFeatureIdsPickingColors",value:function(t){for(var e=this.props.featureIds,r=new Uint8ClampedArray(e.length*t.size),n=[],i=0;i<e.length;i++)this.encodePickingColor(e[i],n),r[3*i]=n[0],r[3*i+1]=n[1],r[3*i+2]=n[2];t.value=r}}]),r}(Rr.a);Br.layerName="_MeshLayer",Br.defaultProps={pbrMaterial:{type:"object",value:null},featureIds:{type:"array",value:null,optional:!0}};var Fr=r(206),zr=r(4),Nr=r(21);Math.max(6378137,6378137,6356752.314245179);const Ur=t=>t,Vr=new Z.a;function Gr(t,e,r=Ur){return Object(bt.f)(t)?(e[0]=r(t[0]),e[1]=r(t[1]),e[2]=t[2]):"longitude"in t?(e[0]=r(t.longitude),e[1]=r(t.latitude),e[2]=t.height):(e[0]=r(t.x),e[1]=r(t.y),e[2]=t.z),e}function Wr(t,e,r=Ur){return Object(bt.f)(e)?(e[0]=r(t[0]),e[1]=r(t[1]),e[2]=t[2]):"longitude"in e?(e.longitude=r(t[0]),e.latitude=r(t[1]),e.height=t[2]):(e.x=r(t[0]),e.y=r(t[1]),e.z=t[2]),e}const Hr=new Z.a,qr=new Z.a,Zr=new Z.a;const Xr=new Z.a,Qr={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"}},Yr={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},Kr={east:new Z.a,north:new Z.a,up:new Z.a,west:new Z.a,south:new Z.a,down:new Z.a},$r=new Z.a,Jr=new Z.a,tn=new Z.a;function en(t,e,r,n,i,o){const a=Qr[e]&&Qr[e][r];let s,u,c;Object(_t.a)(a&&(!n||n===a));const l=Xr.copy(i);if(Object(bt.d)(l.x,0,1e-14)&&Object(bt.d)(l.y,0,1e-14)){const t=Math.sign(l.z);s=$r.fromArray(Yr[e]),"east"!==e&&"west"!==e&&s.scale(t),u=Jr.fromArray(Yr[r]),"east"!==r&&"west"!==r&&u.scale(t),c=tn.fromArray(Yr[n]),"east"!==n&&"west"!==n&&c.scale(t)}else{const{up:i,east:o,north:a}=Kr;o.set(-l.y,l.x,0).normalize(),t.geodeticSurfaceNormal(l,i),a.copy(i).cross(o);const{down:h,west:f,south:p}=Kr;h.copy(i).scale(-1),f.copy(o).scale(-1),p.copy(a).scale(-1),s=Kr[e],u=Kr[r],c=Kr[n]}return o[0]=s.x,o[1]=s.y,o[2]=s.z,o[3]=0,o[4]=u.x,o[5]=u.y,o[6]=u.z,o[7]=0,o[8]=c.x,o[9]=c.y,o[10]=c.z,o[11]=0,o[12]=l.x,o[13]=l.y,o[14]=l.z,o[15]=1,o}const rn=new Z.a,nn=new Z.a,on=new Z.a,an=new Z.a,sn=new Z.a,un=new Z.a;let cn;class ln{static get WGS84(){return cn=cn||new ln(6378137,6378137,6356752.314245179),cn}constructor(t=0,e=0,r=0){Object(_t.a)(t>=0),Object(_t.a)(e>=0),Object(_t.a)(r>=0),this.radii=new Z.a(t,e,r),this.radiiSquared=new Z.a(t*t,e*e,r*r),this.radiiToTheFourth=new Z.a(t*t*t*t,e*e*e*e,r*r*r*r),this.oneOverRadii=new Z.a(0===t?0:1/t,0===e?0:1/e,0===r?0:1/r),this.oneOverRadiiSquared=new Z.a(0===t?0:1/(t*t),0===e?0:1/(e*e),0===r?0:1/(r*r)),this.minimumRadius=Math.min(t,e,r),this.maximumRadius=Math.max(t,e,r),this.centerToleranceSquared=Ct.a.EPSILON1,0!==this.radiiSquared.z&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}equals(t){return this===t||Boolean(t&&this.radii.equals(t.radii))}toString(){return this.radii.toString()}cartographicToCartesian(t,e=[0,0,0]){const r=nn,n=on,[,,i]=t;this.geodeticSurfaceNormalCartographic(t,r),n.copy(this.radiiSquared).scale(r);const o=Math.sqrt(r.dot(n));return n.scale(1/o),r.scale(i),n.add(r),n.to(e)}cartesianToCartographic(t,e=[0,0,0]){un.from(t);const r=this.scaleToGeodeticSurface(un,an);if(!r)return;const n=this.geodeticSurfaceNormal(r,nn),i=sn;i.copy(un).subtract(r);const o=Math.atan2(n.y,n.x),a=Math.asin(n.z),s=Math.sign(Nr.e(i,un))*Nr.h(i);return Wr([o,a,s],e,bt.b._cartographicRadians?Ur:bt.i)}eastNorthUpToFixedFrame(t,e=new Mt.a){return en(this,"east","north","up",t,e)}localFrameToFixedFrame(t,e,r,n,i=new Mt.a){return en(this,t,e,r,n,i)}geocentricSurfaceNormal(t,e=[0,0,0]){return rn.from(t).normalize().to(e)}geodeticSurfaceNormalCartographic(t,e=[0,0,0]){const r=function(t,e=Vr){return Gr(t,e,bt.b._cartographicRadians?Ur:bt.j)}(t),n=r[0],i=r[1],o=Math.cos(i);return rn.set(o*Math.cos(n),o*Math.sin(n),Math.sin(i)).normalize(),rn.to(e)}geodeticSurfaceNormal(t,e=[0,0,0]){return rn.from(t).scale(this.oneOverRadiiSquared).normalize().to(e)}scaleToGeodeticSurface(t,e){return function(t,e,r=new Z.a){const{oneOverRadii:n,oneOverRadiiSquared:i,centerToleranceSquared:o}=e;Hr.from(t);const a=t.x,s=t.y,u=t.z,c=n.x,l=n.y,h=n.z,f=a*a*c*c,p=s*s*l*l,d=u*u*h*h,A=f+p+d,g=Math.sqrt(1/A);if(!Number.isFinite(g))return;const m=qr;if(m.copy(t).scale(g),A<o)return m.to(r);const y=i.x,v=i.y,_=i.z,b=Zr;b.set(m.x*y*2,m.y*v*2,m.z*_*2);let x,w,E,S,O=(1-g)*t.len()/(.5*b.len()),T=0;do{O-=T,x=1/(1+O*y),w=1/(1+O*v),E=1/(1+O*_);const t=x*x,e=w*w,r=E*E;S=f*t+p*e+d*r-1,T=S/(-2*(f*(t*x)*y+p*(e*w)*v+d*(r*E)*_))}while(Math.abs(S)>Ct.a.EPSILON12);return Hr.scale([x,w,E]).to(r)}(t,this,e)}scaleToGeocentricSurface(t,e=[0,0,0]){an.from(t);const r=an.x,n=an.y,i=an.z,o=this.oneOverRadiiSquared,a=1/Math.sqrt(r*r*o.x+n*n*o.y+i*i*o.z);return an.multiplyScalar(a).to(e)}transformPositionToScaledSpace(t,e=[0,0,0]){return an.from(t).scale(this.oneOverRadii).to(e)}transformPositionFromScaledSpace(t,e=[0,0,0]){return an.from(t).scale(this.radii).to(e)}getSurfaceNormalIntersectionWithZAxis(t,e=0,r=[0,0,0]){Object(_t.a)(Object(bt.d)(this.radii.x,this.radii.y,Ct.a.EPSILON15)),Object(_t.a)(this.radii.z>0),an.from(t);const n=an.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(n)>=this.radii.z-e))return an.set(0,0,n).to(r)}}var hn=r(137),fn=r(97),pn=r(20);class dn{constructor(t,e,r){this.item=t,this.previous=e,this.next=r}}class An{constructor(){this.head=null,this.tail=null,this._length=0}get length(){return this._length}add(t){const e=new dn(t,this.tail,null);return this.tail?(this.tail.next=e,this.tail=e):(this.head=e,this.tail=e),++this._length,e}remove(t){t&&(t.previous&&t.next?(t.previous.next=t.next,t.next.previous=t.previous):t.previous?(t.previous.next=null,this.tail=t.previous):t.next?(t.next.previous=null,this.head=t.next):(this.head=null,this.tail=null),t.next=null,t.previous=null,--this._length)}splice(t,e){t!==e&&(this.remove(e),this._insert(t,e))}_insert(t,e){const r=t.next;t.next=e,this.tail===t?this.tail=e:r.previous=e,e.next=r,e.previous=t,++this._length}}function gn(t){return null!=t}class mn{constructor(){Object(zr.a)(this,"_list",void 0),Object(zr.a)(this,"_sentinel",void 0),Object(zr.a)(this,"_trimTiles",void 0),this._list=new An,this._sentinel=this._list.add("sentinel"),this._trimTiles=!1}reset(){this._list.splice(this._list.tail,this._sentinel)}touch(t){const e=t._cacheNode;gn(e)&&this._list.splice(this._sentinel,e)}add(t,e,r){gn(e._cacheNode)||(e._cacheNode=this._list.add(e),r&&r(t,e))}unloadTile(t,e,r){const n=e._cacheNode;gn(n)&&(this._list.remove(n),e._cacheNode=void 0,r&&r(t,e))}unloadTiles(t,e){const r=this._trimTiles;this._trimTiles=!1;const n=this._list,i=1024*t.maximumMemoryUsage*1024,o=this._sentinel;let a=n.head;for(;a!==o&&(t.gpuMemoryUsageInBytes>i||r);){const r=a.item;a=a.next,this.unloadTile(t,r,e)}}trim(){this._trimTiles=!0}}const yn=new Z.a,vn=new Z.a,_n=new Pt([new Et,new Et,new Et,new Et,new Et,new Et]);function bn(t,e){const{cameraDirection:r,cameraUp:n,height:i}=t,{metersPerUnit:o}=t.distanceScales,a=[t.longitude,t.latitude,0],s=ln.WGS84.cartographicToCartesian(a,new Z.a),u=ln.WGS84.eastNorthUpToFixedFrame(s),c=t.unprojectPosition(t.cameraPosition),l=ln.WGS84.cartographicToCartesian(c,new Z.a),h=new Z.a(u.transformAsVector(new Z.a(r).scale(o))).normalize(),f=new Z.a(u.transformAsVector(new Z.a(n).scale(o))).normalize();return function(t,e){const r=t.getFrustumPlanes();let n=0;for(const i in r){const o=r[i],a=o.normal.dot(t.center);vn.copy(o.normal).scale(o.distance-a).add(t.center);const s=t.unprojectPosition(vn),u=ln.WGS84.cartographicToCartesian(s,new Z.a);_n.planes[n++].fromPointNormal(u,yn.copy(e).subtract(u))}}(t,s),{camera:{position:l,direction:h,up:f},viewport:t,height:i,cullingVolume:_n,frameNumber:e,sseDenominator:1.15}}const xn=new Z.a;function wn(t){const{halfAxes:e,radius:r,width:n,height:i}=t;if(e){const t=function(t){t.getColumn(0,xn);const e=t.getColumn(1),r=t.getColumn(2);return xn.add(e).add(r).len()}(e);return Math.log2(6356752.314245179/t)}if(r)return Math.log2(6356752.314245179/r);if(i&&n){return(Math.log2(6378137/n)+Math.log2(6378137/i))/2}return 1}const En=0,Sn=1,On=3,Tn=4,Pn=5,Mn=1,Cn=2,In="empty",kn="scenegraph",Rn="pointcloud",Ln="mesh",jn="I3S",Dn="TILES3D",Bn="geometricError",Fn=1;function zn(t){return null!=t}const Nn=new Z.a,Un=new Z.a,Vn=new Z.a;function Gn(t,e,r){if(Object(fn.a)(t,"3D Tile: boundingVolume must be defined"),t.box)return function(t,e,r){const n=new Z.a(t[0],t[1],t[2]);e.transform(n,n);let i=[];if(10===t.length){const e=t.slice(3,6),r=new rt.a;r.fromArray(t,6);const n=new Z.a([1,0,0]),o=new Z.a([0,1,0]),a=new Z.a([0,0,1]);n.transformByQuaternion(r),n.scale(e[0]),o.transformByQuaternion(r),o.scale(e[1]),a.transformByQuaternion(r),a.scale(e[2]),i=[...n.toArray(),...o.toArray(),...a.toArray()]}else i=[...t.slice(3,6),...t.slice(6,9),...t.slice(9,12)];const o=e.transformAsVector(i.slice(0,3)),a=e.transformAsVector(i.slice(3,6)),s=e.transformAsVector(i.slice(6,9)),u=new et.a([o[0],o[1],o[2],a[0],a[1],a[2],s[0],s[1],s[2]]);if(zn(r))return r.center=n,r.halfAxes=u,r;return new vt(n,u)}(t.box,e,r);if(t.region){const[e,r,n,i,o,a]=t.region,s=ln.WGS84.cartographicToCartesian([Object(bt.c)(e),Object(bt.c)(i),o],Un),u=ln.WGS84.cartographicToCartesian([Object(bt.c)(n),Object(bt.c)(r),a],Vn),c=(new Z.a).addVectors(s,u).multiplyScalar(.5),l=(new Z.a).subVectors(s,u).len()/2;return Wn([c[0],c[1],c[2],l],new Mt.a)}if(t.sphere)return Wn(t.sphere,e,r);throw new Error("3D Tile: boundingVolume must contain a sphere, region, or box")}function Wn(t,e,r){const n=new Z.a(t[0],t[1],t[2]);e.transform(n,n);const i=e.getScale(Nn),o=Math.max(Math.max(i[0],i[1]),i[2]),a=t[3]*o;return zn(r)?(r.center=n,r.radius=a,r):new tt(n,a)}new Z.a,new Z.a,new Mt.a,new Z.a,new Z.a,new Z.a;function Hn(t,e){if(t.dynamicScreenSpaceError&&t.dynamicScreenSpaceErrorComputedDensity){const r=t.dynamicScreenSpaceErrorComputedDensity,n=t.dynamicScreenSpaceErrorFactor;return function(t,e){const r=t*e;return 1-Math.exp(-r*r)}(e,r)*n}return 0}const qn=Math.PI/2;function Zn([t,e,r]){const n=Object(bt.j)(t),i=Object(bt.j)(e),o=1+r/6378137,a=o*Math.cos(i);return[t=a*Math.cos(n),e=a*Math.sin(n),r=o*Math.sin(i)]}function Xn(t,e){const[r,n,i=0]=t,[o,a,s=0]=e,u=Zn([o,a,s]),c=Zn([r,n,i]),l=c[0]-u[0],h=c[1]-u[1],f=c[2]-u[2];return l*l+h*h+f*f}function Qn(t,e){const r=e.viewport,n=t.header.mbs[1],i=[t.header.mbs[0],n,t.header.mbs[2]],o=t.header.mbs[3]/6378137,a=Xn(r.unprojectPosition(r.cameraPosition),i)-o*o;return a<=0?170141175e30:function(t){const{projectionMatrix:e}=t.viewport;return e[5]}(e)*o/Math.sqrt(a)*300}class Yn{constructor(t=0){this._array=new Array(t),this._map=new Map,this._length=t}get length(){return this._length}set length(t){this._length=t,t>this._array.length&&(this._array.length=t)}get values(){return this._array}get(t){return Object(fn.a)(t<this._array.length),this._array[t]}set(t,e){Object(fn.a)(t>=0),t>=this.length&&(this.length=t+1),this._map.has(this._array[t])&&this._map.delete(this._array[t]),this._array[t]=e,this._map.set(e,t)}delete(t){const e=this._map.get(t);e>=0&&(this._array.splice(e,1),this._map.delete(t),this.length--)}peek(){return this._array[this._length-1]}push(t){if(!this._map.has(t)){const e=this.length++;this._array[e]=t,this._map.set(t,e)}}pop(){const t=this._array[--this.length];return this._map.delete(t),t}reserve(t){Object(fn.a)(t>=0),t>this._array.length&&(this._array.length=t)}resize(t){Object(fn.a)(t>=0),this.length=t}trim(t){null==t&&(t=this.length),this._array.length=t}reset(){this._array=[],this._map=new Map,this._length=0}find(t){return this._map.has(t)}}const Kn={loadSiblings:!1,skipLevelOfDetail:!1,maximumScreenSpaceError:2,updateTransforms:!0,onTraversalEnd:()=>{},viewportTraversersMap:{},basePath:""};class $n{constructor(t){Object(zr.a)(this,"options",void 0),Object(zr.a)(this,"root",void 0),Object(zr.a)(this,"requestedTiles",void 0),Object(zr.a)(this,"selectedTiles",void 0),Object(zr.a)(this,"emptyTiles",void 0),Object(zr.a)(this,"_traversalStack",void 0),Object(zr.a)(this,"_emptyTraversalStack",void 0),Object(zr.a)(this,"_frameNumber",void 0),this.options={...Kn,...t},this._traversalStack=new Yn,this._emptyTraversalStack=new Yn,this._frameNumber=null,this.root=null,this.selectedTiles={},this.requestedTiles={},this.emptyTiles={}}traverse(t,e,r){this.root=t,this.options={...this.options,...r},this.reset(),this.updateTile(t,e),this._frameNumber=e.frameNumber,this.executeTraversal(t,e)}reset(){this.requestedTiles={},this.selectedTiles={},this.emptyTiles={},this._traversalStack.reset(),this._emptyTraversalStack.reset()}executeTraversal(t,e){const r=this._traversalStack;for(t._selectionDepth=1,r.push(t);r.length>0;){const t=r.pop();let n=!1;this.canTraverse(t,e)&&(this.updateChildTiles(t,e),n=this.updateAndPushChildren(t,e,r,t.hasRenderContent?t._selectionDepth+1:t._selectionDepth));const i=t.parent,o=Boolean(!i||i._shouldRefine),a=!n;t.hasRenderContent?t.refine===Mn?(this.loadTile(t,e),this.selectTile(t,e)):t.refine===Cn&&(this.loadTile(t,e),a&&this.selectTile(t,e)):(this.emptyTiles[t.id]=t,this.loadTile(t,e),a&&this.selectTile(t,e)),this.touchTile(t,e),t._shouldRefine=n&&o}this.options.onTraversalEnd(e)}updateChildTiles(t,e){const r=t.children;for(const t of r)this.updateTile(t,e);return!0}updateAndPushChildren(t,e,r,n){const{loadSiblings:i,skipLevelOfDetail:o}=this.options,a=t.children;a.sort(this.compareDistanceToCamera.bind(this));const s=t.refine===Cn&&t.hasRenderContent&&!o;let u=!1,c=!0;for(const t of a)if(t._selectionDepth=n,t.isVisibleAndInRequestVolume?(r.find(t)&&r.delete(t),r.push(t),u=!0):(s||i)&&(this.loadTile(t,e),this.touchTile(t,e)),s){let r;if(r=!!t._inRequestVolume&&(t.hasRenderContent?t.contentAvailable:this.executeEmptyTraversal(t,e)),c=c&&r,!c)return!1}return u||(c=!1),c}updateTile(t,e){this.updateTileVisibility(t,e)}selectTile(t,e){this.shouldSelectTile(t)&&(t._selectedFrame=e.frameNumber,this.selectedTiles[t.id]=t)}loadTile(t,e){this.shouldLoadTile(t)&&(t._requestedFrame=e.frameNumber,t._priority=t._getPriority(),this.requestedTiles[t.id]=t)}touchTile(t,e){t.tileset._cache.touch(t),t._touchedFrame=e.frameNumber}canTraverse(t,e,r=!1,n=!1){return!!t.hasChildren&&(t.hasTilesetContent?!t.contentExpired:!(!n&&!t.isVisibleAndInRequestVolume)&&this.shouldRefine(t,e,r))}shouldLoadTile(t){return t.hasUnloadedContent||t.contentExpired}shouldSelectTile(t){return t.contentAvailable&&!this.options.skipLevelOfDetail}shouldRefine(t,e,r){let n=t._screenSpaceError;return r&&(n=t.getScreenSpaceError(e,!0)),n>this.options.maximumScreenSpaceError}updateTileVisibility(t,e){const r=[];if(this.options.viewportTraversersMap)for(const t in this.options.viewportTraversersMap){this.options.viewportTraversersMap[t]===e.viewport.id&&r.push(t)}else r.push(e.viewport.id);t.updateVisibility(e,r)}compareDistanceToCamera(t,e){return t._distanceToCamera-e._distanceToCamera}anyChildrenVisible(t,e){let r=!1;for(const n of t.children)n.updateVisibility(e),r=r||n.isVisibleAndInRequestVolume;return r}executeEmptyTraversal(t,e){let r=!0;const n=this._emptyTraversalStack;for(n.push(t);n.length>0&&r;){const t=n.pop();if(this.updateTile(t,e),t.isVisibleAndInRequestVolume||this.loadTile(t,e),this.touchTile(t,e),!t.hasRenderContent&&this.canTraverse(t,e,!1,!0)){const e=t.children;for(const t of e)n.find(t)&&n.delete(t),n.push(t)}else t.contentAvailable||(r=!1)}return r}}const Jn=new Z.a;class ti{constructor(t,e,r,n=""){Object(zr.a)(this,"tileset",void 0),Object(zr.a)(this,"header",void 0),Object(zr.a)(this,"id",void 0),Object(zr.a)(this,"url",void 0),Object(zr.a)(this,"parent",void 0),Object(zr.a)(this,"refine",void 0),Object(zr.a)(this,"type",void 0),Object(zr.a)(this,"contentUrl",void 0),Object(zr.a)(this,"lodMetricType",void 0),Object(zr.a)(this,"lodMetricValue",void 0),Object(zr.a)(this,"boundingVolume",void 0),Object(zr.a)(this,"content",void 0),Object(zr.a)(this,"contentState",void 0),Object(zr.a)(this,"gpuMemoryUsageInBytes",void 0),Object(zr.a)(this,"children",void 0),Object(zr.a)(this,"depth",void 0),Object(zr.a)(this,"viewportIds",void 0),Object(zr.a)(this,"transform",void 0),Object(zr.a)(this,"userData",void 0),Object(zr.a)(this,"computedTransform",void 0),Object(zr.a)(this,"hasEmptyContent",void 0),Object(zr.a)(this,"hasTilesetContent",void 0),Object(zr.a)(this,"traverser",void 0),Object(zr.a)(this,"_cacheNode",void 0),Object(zr.a)(this,"_frameNumber",void 0),Object(zr.a)(this,"_lodJudge",void 0),Object(zr.a)(this,"_expireDate",void 0),Object(zr.a)(this,"_expiredContent",void 0),Object(zr.a)(this,"_shouldRefine",void 0),Object(zr.a)(this,"_distanceToCamera",void 0),Object(zr.a)(this,"_centerZDepth",void 0),Object(zr.a)(this,"_screenSpaceError",void 0),Object(zr.a)(this,"_visibilityPlaneMask",void 0),Object(zr.a)(this,"_visible",void 0),Object(zr.a)(this,"_inRequestVolume",void 0),Object(zr.a)(this,"_stackLength",void 0),Object(zr.a)(this,"_selectionDepth",void 0),Object(zr.a)(this,"_touchedFrame",void 0),Object(zr.a)(this,"_visitedFrame",void 0),Object(zr.a)(this,"_selectedFrame",void 0),Object(zr.a)(this,"_requestedFrame",void 0),Object(zr.a)(this,"_priority",void 0),Object(zr.a)(this,"_contentBoundingVolume",void 0),Object(zr.a)(this,"_viewerRequestVolume",void 0),Object(zr.a)(this,"_initialTransform",void 0),this.header=e,this.tileset=t,this.id=n||e.id,this.url=e.url,this.parent=r,this.refine=this._getRefine(e.refine),this.type=e.type,this.contentUrl=e.contentUrl,this.lodMetricType="geometricError",this.lodMetricValue=0,this.boundingVolume=null,this.content=null,this.contentState=En,this.gpuMemoryUsageInBytes=0,this.children=[],this.hasEmptyContent=!1,this.hasTilesetContent=!1,this.depth=0,this.viewportIds=[],this.userData={},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 $n({}),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 Mt.a,this.transform=new Mt.a,this._initializeLodMetric(e),this._initializeTransforms(e),this._initializeBoundingVolumes(e),this._initializeContent(e),this._initializeRenderingState(e),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===On||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===En}get contentExpired(){return this.contentState===Tn}get contentFailed(){return this.contentState===Pn}getScreenSpaceError(t,e){switch(this.tileset.type){case jn:return Qn(this,t);case Dn:return function(t,e,r){const n=t.tileset,i=t.parent&&t.parent.lodMetricValue||t.lodMetricValue,o=r?i:t.lodMetricValue;if(0===o)return 0;const a=Math.max(t._distanceToCamera,1e-7),{height:s,sseDenominator:u}=e,{viewDistanceScale:c}=n.options;let l=o*s*(c||1)/(a*u);return l-=Hn(n,a),l}(this,t,e);default:throw new Error("Unsupported tileset type")}}_getPriority(){const t=this.tileset._traverser,{skipLevelOfDetail:e}=t.options,r=this.refine===Mn||e;if(r&&!this.isVisible&&void 0!==this._visible)return-1;if(this.tileset._frameNumber-this._touchedFrame>=1)return-1;if(this.contentState===En)return-1;const n=this.parent,i=n&&(!r||0===this._screenSpaceError||n.hasTilesetContent)?n._screenSpaceError:this._screenSpaceError,o=t.root?t.root._screenSpaceError:0;return Math.max(o-i,0)}async loadContent(){if(this.hasEmptyContent)return!1;if(this.content)return!0;this.contentExpired&&(this._expireDate=null),this.contentState=Sn;const t=await this.tileset._requestScheduler.scheduleRequest(this.id,this._getPriority.bind(this));if(!t)return this.contentState=En,!1;try{const e=this.tileset.getTileUrl(this.contentUrl),r=this.tileset.loader,n={...this.tileset.loadOptions,[r.id]:{...this.tileset.loadOptions[r.id],isTileset:"json"===this.type,...this._getLoaderSpecificOptions(r.id)}};return this.content=await Object(Fr.a)(e,r,n),this.tileset.options.contentLoader&&await this.tileset.options.contentLoader(this),this._isTileset()&&this.tileset._initializeTileHeaders(this.content,this),this.contentState=On,this._onContentLoaded(),!0}catch(t){throw this.contentState=Pn,t}finally{t.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=En,!0}updateVisibility(t,e){if(this._frameNumber===t.frameNumber)return;const r=this.parent,n=r?r._visibilityPlaneMask:Pt.MASK_INDETERMINATE;if(this.tileset._traverser.options.updateTransforms){const t=r?r.computedTransform:this.tileset.modelMatrix;this._updateTransform(t)}this._distanceToCamera=this.distanceToTile(t),this._screenSpaceError=this.getScreenSpaceError(t,!1),this._visibilityPlaneMask=this.visibility(t,n),this._visible=this._visibilityPlaneMask!==Pt.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(t),this._frameNumber=t.frameNumber,this.viewportIds=e}visibility(t,e){const{cullingVolume:r}=t,{boundingVolume:n}=this;return r.computeVisibilityWithPlaneMask(n,e)}contentVisibility(){return!0}distanceToTile(t){const e=this.boundingVolume;return Math.sqrt(Math.max(e.distanceSquaredTo(t.camera.position),0))}cameraSpaceZDepth({camera:t}){const e=this.boundingVolume;return Jn.subVectors(e.center,t.position),t.direction.dot(Jn)}insideViewerRequestVolume(t){const e=this._viewerRequestVolume;return!e||e.distanceSquaredTo(t.camera.position)<=0}updateExpiration(){if(null!=this._expireDate&&this.contentReady&&!this.hasEmptyContent){const t=Date.now();Date.lessThan(this._expireDate,t)&&(this.contentState=Tn,this._expiredContent=this.content)}}get extras(){return this.header.extras}_initializeLodMetric(t){"lodMetricType"in t?this.lodMetricType=t.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 t?this.lodMetricValue=t.lodMetricValue:(this.lodMetricValue=this.parent&&this.parent.lodMetricValue||this.tileset.lodMetricValue,console.warn("3D Tile: Required prop lodMetricValue is undefined. Using parent lodMetricValue"))}_initializeTransforms(t){this.transform=t.transform?new Mt.a(t.transform):new Mt.a;const e=this.parent,r=this.tileset,n=e&&e.computedTransform?e.computedTransform.clone():r.modelMatrix.clone();this.computedTransform=new Mt.a(n).multiplyRight(this.transform);const i=e&&e._initialTransform?e._initialTransform.clone():new Mt.a;this._initialTransform=new Mt.a(i).multiplyRight(this.transform)}_initializeBoundingVolumes(t){this._contentBoundingVolume=null,this._viewerRequestVolume=null,this._updateBoundingVolume(t)}_initializeContent(t){this.content={_tileset:this.tileset,_tile:this},this.hasEmptyContent=!0,this.contentState=En,this.hasTilesetContent=!1,t.contentUrl&&(this.content=null,this.hasEmptyContent=!1)}_initializeRenderingState(t){this.depth=t.level||(this.parent?this.parent.depth+1:0),this._shouldRefine=!1,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._visibilityPlaneMask=Pt.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(t){return t||this.parent&&this.parent.refine||Cn}_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(t){this.boundingVolume=Gn(t.boundingVolume,this.computedTransform,this.boundingVolume);const e=t.content;e&&(e.boundingVolume&&(this._contentBoundingVolume=Gn(e.boundingVolume,this.computedTransform,this._contentBoundingVolume)),t.viewerRequestVolume&&(this._viewerRequestVolume=Gn(t.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)))}_updateTransform(t=new Mt.a){const e=t.clone().multiplyRight(this.transform);!e.equals(this.computedTransform)&&(this.computedTransform=e,this._updateBoundingVolume(this.header))}_getLoaderSpecificOptions(t){switch(t){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:(e=this.tileset.tileset).asset&&e.asset.gltfUpAxis||"Y"}}var e}}class ei extends $n{compareDistanceToCamera(t,e){return 0===e._distanceToCamera&&0===t._distanceToCamera?e._centerZDepth-t._centerZDepth:e._distanceToCamera-t._distanceToCamera}updateTileVisibility(t,e){if(super.updateTileVisibility(t,e),!t.isVisibleAndInRequestVolume)return;const r=t.children.length>0;if(t.hasTilesetContent&&r){const r=t.children[0];return this.updateTileVisibility(r,e),void(t._visible=r._visible)}if(this.meetsScreenSpaceErrorEarly(t,e))return void(t._visible=!1);const n=t.refine===Cn,i=t._optimChildrenWithinParent===Fn;n&&i&&r&&!this.anyChildrenVisible(t,e)&&(t._visible=!1)}meetsScreenSpaceErrorEarly(t,e){const{parent:r}=t;return!(!r||r.hasTilesetContent||r.refine!==Mn)&&!this.shouldRefine(t,e,!0)}}const ri="REQUESTED",ni="COMPLETED",ii="ERROR";class oi{constructor(){Object(zr.a)(this,"_statusMap",void 0),this._statusMap={}}add(t,e,r,n){this._statusMap[e]||(this._statusMap[e]={request:t,callback:r,key:e,frameState:n,status:ri},t().then(t=>{this._statusMap[e].status=ni,this._statusMap[e].callback(t,n)}).catch(t=>{this._statusMap[e].status=ii,r(t)}))}update(t,e){this._statusMap[t]&&(this._statusMap[t].frameState=e)}find(t){return this._statusMap[t]}}class ai extends $n{constructor(t){super(t),Object(zr.a)(this,"_tileManager",void 0),this._tileManager=new oi}shouldRefine(t,e){return t._lodJudge=function(t,e){const r=e.viewport,n=r.metersPerPixel,i=t.header.mbs[1],o=t.header.mbs[0],a=t.header.mbs[2],s=t.header.mbs[3],{height:u,width:c,latitude:l,longitude:h}=r,f=[h,l],p=[o,i,a],d=[h,i],A=[o,l],g=Math.sqrt(u*u+c*c)*n[0],m=.5*u+s/6378137,y=.5*c+s/6378137;if(Xn(f,p)>g+s/6378137)return"OUT";if(Xn(f,d)>m)return"OUT";if(Xn(f,A)>y)return"OUT";if(0===t.lodMetricValue)return"DIG";let v=Qn(t,e);return v*=qn,v<.5?"OUT":!t.header.children||v<=t.lodMetricValue?"DRAW":t.header.children?"DIG":"OUT"}(t,e),"DIG"===t._lodJudge}updateChildTiles(t,e){const r=t.header.children||[],n=t.children,i=t.tileset;for(const o of r){const r=`${o.id}-${e.viewport.id}`,a=n&&n.find(t=>t.id===r);if(a)a&&this.updateTile(a,e);else{let n=()=>this._loadTile(o.id,i);this._tileManager.find(r)?this._tileManager.update(r,e):(i.tileset.nodePages&&(n=()=>i.tileset.nodePagesTile.formTileFromNodePages(o.id)),this._tileManager.add(n,r,e=>this._onTileLoad(e,t,r),e))}}return!1}async _loadTile(t,e){const{loader:r}=e,n=e.getTileUrl(`${e.url}/nodes/${t}`),i={...e.loadOptions,i3s:{...e.loadOptions.i3s,isTileHeader:!0,loadContent:!1}};return await Object(Fr.a)(n,r,i)}_onTileLoad(t,e,r){const n=new ti(e.tileset,t,e,r);e.children.push(n);const i=this._tileManager.find(n.id).frameState;this.updateTile(n,i),this._frameNumber===i.frameNumber&&this.executeTraversal(n,i)}}const si={description:"",ellipsoid:ln.WGS84,modelMatrix:new Mt.a,throttleRequests:!0,maxRequests:64,maximumMemoryUsage:32,onTileLoad:()=>{},onTileUnload:()=>{},onTileError:()=>{},onTraversalComplete:t=>t,contentLoader:void 0,viewDistanceScale:1,maximumScreenSpaceError:8,loadTiles:!0,updateTransforms:!0,viewportTraversersMap:null,loadOptions:{fetch:{}},attributions:[],basePath:"",i3s:{}};class ui{constructor(t,e){Object(zr.a)(this,"options",void 0),Object(zr.a)(this,"loadOptions",void 0),Object(zr.a)(this,"type",void 0),Object(zr.a)(this,"tileset",void 0),Object(zr.a)(this,"loader",void 0),Object(zr.a)(this,"url",void 0),Object(zr.a)(this,"basePath",void 0),Object(zr.a)(this,"modelMatrix",void 0),Object(zr.a)(this,"ellipsoid",void 0),Object(zr.a)(this,"lodMetricType",void 0),Object(zr.a)(this,"lodMetricValue",void 0),Object(zr.a)(this,"refine",void 0),Object(zr.a)(this,"root",void 0),Object(zr.a)(this,"roots",void 0),Object(zr.a)(this,"asset",void 0),Object(zr.a)(this,"description",void 0),Object(zr.a)(this,"properties",void 0),Object(zr.a)(this,"extras",void 0),Object(zr.a)(this,"attributions",void 0),Object(zr.a)(this,"credits",void 0),Object(zr.a)(this,"stats",void 0),Object(zr.a)(this,"traverseCounter",void 0),Object(zr.a)(this,"geometricError",void 0),Object(zr.a)(this,"selectedTiles",void 0),Object(zr.a)(this,"cartographicCenter",void 0),Object(zr.a)(this,"cartesianCenter",void 0),Object(zr.a)(this,"zoom",void 0),Object(zr.a)(this,"boundingVolume",void 0),Object(zr.a)(this,"gpuMemoryUsageInBytes",void 0),Object(zr.a)(this,"dynamicScreenSpaceErrorComputedDensity",void 0),Object(zr.a)(this,"_traverser",void 0),Object(zr.a)(this,"_cache",void 0),Object(zr.a)(this,"_requestScheduler",void 0),Object(zr.a)(this,"_frameNumber",void 0),Object(zr.a)(this,"_queryParamsString",void 0),Object(zr.a)(this,"_queryParams",void 0),Object(zr.a)(this,"_extensionsUsed",void 0),Object(zr.a)(this,"_tiles",void 0),Object(zr.a)(this,"_pendingCount",void 0),Object(zr.a)(this,"lastUpdatedVieports",void 0),Object(zr.a)(this,"_requestedTiles",void 0),Object(zr.a)(this,"_emptyTiles",void 0),Object(zr.a)(this,"frameStateData",void 0),Object(zr.a)(this,"maximumMemoryUsage",void 0),Object(fn.a)(t),this.options={...si,...e},this.tileset=t,this.loader=t.loader,this.type=t.type,this.url=t.url,this.basePath=t.basePath||pn.b.dirname(this.url),this.modelMatrix=this.options.modelMatrix,this.ellipsoid=this.options.ellipsoid,this.lodMetricType=t.lodMetricType,this.lodMetricValue=t.lodMetricValue,this.refine=t.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 mn,this._requestScheduler=new he.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 hn.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(t)}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(t){const e=[];for(const r of Object.keys(t))e.push(`${r}=${t[r]}`);switch(e.length){case 0:return"";case 1:return`?${e[0]}`;default:return`?${e.join("&")}`}}(this._queryParams)),this._queryParamsString}setProps(t){this.options={...this.options,...t}}setOptions(t){this.options={...this.options,...t}}getTileUrl(t){return t.startsWith("data:")?t:`${t}${this.queryParams}`}hasExtension(t){return Boolean(this._extensionsUsed&&this._extensionsUsed.indexOf(t)>-1)}update(t){if("loadTiles"in this.options&&!this.options.loadTiles)return;if(this.traverseCounter>0)return;!t&&this.lastUpdatedVieports?t=this.lastUpdatedVieports:this.lastUpdatedVieports=t,t instanceof Array||(t=[t]),this._cache.reset(),this._frameNumber++,this.traverseCounter=t.length;const e=[];for(const r of t){const t=r.id;this._needTraverse(t)?e.push(t):this.traverseCounter--}for(const r of t){const t=r.id;if(this.roots[t]||(this.roots[t]=this._initializeTileHeaders(this.tileset,null)),!e.includes(t))continue;const n=bn(r,this._frameNumber);this._traverser.traverse(this.roots[t],n,this.options)}}_needTraverse(t){let e=t;return this.options.viewportTraversersMap&&(e=this.options.viewportTraversersMap[t]),e===t}_onTraversalEnd(t){const e=t.viewport.id;this.frameStateData[e]||(this.frameStateData[e]={selectedTiles:[],_requestedTiles:[],_emptyTiles:[]});const r=this.frameStateData[e],n=Object.values(this._traverser.selectedTiles);r.selectedTiles=n,r._requestedTiles=Object.values(this._traverser.requestedTiles),r._emptyTiles=Object.values(this._traverser.emptyTiles),this.traverseCounter--,this.traverseCounter>0||this._updateTiles()}_updateTiles(){this.selectedTiles=[],this._requestedTiles=[],this._emptyTiles=[];for(const t in this.frameStateData){const e=this.frameStateData[t];this.selectedTiles=this.selectedTiles.concat(e.selectedTiles),this._requestedTiles=this._requestedTiles.concat(e._requestedTiles),this._emptyTiles=this._emptyTiles.concat(e._emptyTiles)}this.selectedTiles=this.options.onTraversalComplete(this.selectedTiles);for(const t of this.selectedTiles)this._tiles[t.id]=t;this._loadTiles(),this._unloadTiles(),this._updateStats()}_tilesChanged(t,e){if(t.length!==e.length)return!0;const r=new Set(t.map(t=>t.id)),n=new Set(e.map(t=>t.id));let i=t.filter(t=>!n.has(t.id)).length>0;return i=i||e.filter(t=>!r.has(t.id)).length>0,i}_loadTiles(){for(const t of this._requestedTiles)t.contentUnloaded&&this._loadTile(t)}_unloadTiles(){this._cache.unloadTiles(this,(t,e)=>t._unloadTile(e))}_updateStats(){let t=0,e=0;for(const r of this.selectedTiles)r.contentAvailable&&r.content&&(t++,r.content.pointCount&&(e+=r.content.pointCount));this.stats.get("Tiles In View").count=this.selectedTiles.length,this.stats.get("Tiles To Render").count=t,this.stats.get("Points").count=e}_initializeTileSet(t){this.root=this._initializeTileHeaders(t,null),this.type===Dn&&this._initializeCesiumTileset(t),this.type===jn&&this._initializeI3STileset(),this._calculateViewProps()}_calculateViewProps(){const t=this.root;Object(fn.a)(t);const{center:e}=t.boundingVolume;if(!e)return console.warn("center was not pre-calculated for the root tile"),this.cartographicCenter=new Z.a,void(this.zoom=1);this.cartographicCenter=ln.WGS84.cartesianToCartographic(e,new Z.a),this.cartesianCenter=e,this.zoom=wn(t.boundingVolume)}_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(t,e){const r=new ti(this,t.root,e);if(e&&(e.children.push(r),r.depth=e.depth+1),this.type===Dn){const t=[];for(t.push(r);t.length>0;){const e=t.pop();this.stats.get("Tiles In Tileset(s)").incrementCount();const r=e.header.children||[];for(const n of r){const r=new ti(this,n,e);e.children.push(r),r.depth=e.depth+1,t.push(r)}}}return r}_initializeTraverser(){let t;switch(this.type){case Dn:t=ei;break;case jn:t=ai;break;default:t=$n}return new t({basePath:this.basePath,onTraversalEnd:this._onTraversalEnd.bind(this)})}_destroyTileHeaders(t){this._destroySubtree(t)}async _loadTile(t){let e;try{this._onStartTileLoading(),e=await t.loadContent()}catch(e){this._onTileLoadError(t,e)}finally{this._onEndTileLoading(),this._onTileLoad(t,e)}}_onTileLoadError(t,e){this.stats.get("Failed Tile Loads").incrementCount();const r=e.message||e.toString(),n=t.url;console.error(`A 3D tile failed to load: ${t.url} ${r}`),this.options.onTileError(t,r,n)}_onTileLoad(t,e){e&&(t&&t.content&&function(t,e){Object(fn.a)(t),Object(fn.a)(e);const{rtcCenter:r,gltfUpAxis:n}=e,{computedTransform:i,boundingVolume:{center:o}}=t;let a=new Mt.a(i);switch(r&&a.translate(r),n){case"Z":break;case"Y":const t=(new Mt.a).rotateX(Math.PI/2);a=a.multiplyRight(t);break;case"X":const e=(new Mt.a).rotateY(-Math.PI/2);a=a.multiplyRight(e)}e.isQuantized&&a.translate(e.quantizedVolumeOffset).scale(e.quantizedVolumeScale);const s=new Z.a(o);e.cartesianModelMatrix=a,e.cartesianOrigin=s;const u=ln.WGS84.cartesianToCartographic(s,new Z.a),c=ln.WGS84.eastNorthUpToFixedFrame(s).invert();e.cartographicModelMatrix=c.multiplyRight(a),e.cartographicOrigin=u,e.modelMatrix=e.cartographicModelMatrix}(t,t.content),this._addTileToCache(t),this.options.onTileLoad(t))}_onStartTileLoading(){this._pendingCount++,this.stats.get("Tiles Loading").incrementCount()}_onEndTileLoading(){this._pendingCount--,this.stats.get("Tiles Loading").decrementCount()}_addTileToCache(t){this._cache.add(this,t,e=>e._updateCacheStats(t))}_updateCacheStats(t){this.stats.get("Tiles Loaded").incrementCount(),this.stats.get("Tiles In Memory").incrementCount(),this.gpuMemoryUsageInBytes+=t.content.byteLength||0,this.stats.get("Tile Memory Use").count=this.gpuMemoryUsageInBytes}_unloadTile(t){this.gpuMemoryUsageInBytes-=t.content&&t.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(t),t.unloadContent()}_destroy(){const t=[];for(this.root&&t.push(this.root);t.length>0;){const e=t.pop();for(const r of e.children)t.push(r);this._destroyTile(e)}this.root=null}_destroySubtree(t){const e=t,r=[];for(r.push(e);r.length>0;){t=r.pop();for(const e of t.children)r.push(e);t!==e&&this._destroyTile(t)}e.children=[]}_destroyTile(t){this._cache.unloadTile(this,t),this._unloadTile(t),t.destroy()}_initializeCesiumTileset(t){if(this.asset=t.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=t.properties,this.geometricError=t.geometricError,this._extensionsUsed=t.extensionsUsed,this.extras=t.extras}_initializeI3STileset(){this.loadOptions.i3s&&"token"in this.loadOptions.i3s&&(this._queryParams.token=this.loadOptions.i3s.token)}}const ci={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect"};Object.keys(ci);function li(t,e,r){Object(fn.a)(t instanceof ArrayBuffer);const n=new TextDecoder("utf8"),i=new Uint8Array(t,e,r);return n.decode(i)}var hi=r(175);const fi={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},pi={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,...fi},di={[fi.DOUBLE]:Float64Array,[fi.FLOAT]:Float32Array,[fi.UNSIGNED_SHORT]:Uint16Array,[fi.UNSIGNED_INT]:Uint32Array,[fi.UNSIGNED_BYTE]:Uint8Array,[fi.BYTE]:Int8Array,[fi.SHORT]:Int16Array,[fi.INT]:Int32Array},Ai={DOUBLE:fi.DOUBLE,FLOAT:fi.FLOAT,UNSIGNED_SHORT:fi.UNSIGNED_SHORT,UNSIGNED_INT:fi.UNSIGNED_INT,UNSIGNED_BYTE:fi.UNSIGNED_BYTE,BYTE:fi.BYTE,SHORT:fi.SHORT,INT:fi.INT};class gi{static fromTypedArray(t){t=ArrayBuffer.isView(t)?t.constructor:t;for(const e in di){if(di[e]===t)return e}throw new Error("Failed to convert GL type")}static fromName(t){const e=Ai[t];if(!e)throw new Error("Failed to convert GL type");return e}static getArrayType(t){switch(t){case fi.UNSIGNED_SHORT_5_6_5:case fi.UNSIGNED_SHORT_4_4_4_4:case fi.UNSIGNED_SHORT_5_5_5_1:return Uint16Array;default:const e=di[t];if(!e)throw new Error("Failed to convert GL type");return e}}static getByteSize(t){return gi.getArrayType(t).BYTES_PER_ELEMENT}static validate(t){return Boolean(gi.getArrayType(t))}static createTypedArray(t,e,r=0,n){return void 0===n&&(n=(e.byteLength-r)/gi.getByteSize(t)),new(gi.getArrayType(t))(e,r,n)}}class mi{constructor(t,e){this.json=t,this.buffer=e,this.featuresLength=0,this._cachedTypedArrays={}}getExtension(t){return this.json.extensions&&this.json.extensions[t]}hasProperty(t){return Boolean(this.json[t])}getGlobalProperty(t,e=pi.UNSIGNED_INT,r=1){const n=this.json[t];return n&&Number.isFinite(n.byteOffset)?this._getTypedArrayFromBinary(t,e,r,1,n.byteOffset):n}getPropertyArray(t,e,r){const n=this.json[t];return n&&Number.isFinite(n.byteOffset)?("componentType"in n&&(e=gi.fromName(n.componentType)),this._getTypedArrayFromBinary(t,e,r,this.featuresLength,n.byteOffset)):this._getTypedArrayFromArray(t,e,n)}getProperty(t,e,r,n,i){const o=this.json[t];if(!o)return o;const a=this.getPropertyArray(t,e,r);if(1===r)return a[n];for(let t=0;t<r;++t)i[t]=a[r*n+t];return i}_getTypedArrayFromBinary(t,e,r,n,i){const o=this._cachedTypedArrays;let a=o[t];return a||(a=gi.createTypedArray(e,this.buffer.buffer,this.buffer.byteOffset+i,n*r),o[t]=a),a}_getTypedArrayFromArray(t,e,r){const n=this._cachedTypedArrays;let i=n[t];return i||(i=gi.createTypedArray(e,r),n[t]=i),i}}const yi={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},vi={SCALAR:(t,e)=>t[e],VEC2:(t,e)=>[t[2*e+0],t[2*e+1]],VEC3:(t,e)=>[t[3*e+0],t[3*e+1],t[3*e+2]],VEC4:(t,e)=>[t[4*e+0],t[4*e+1],t[4*e+2],t[4*e+3]],MAT2:(t,e)=>[t[4*e+0],t[4*e+1],t[4*e+2],t[4*e+3]],MAT3:(t,e)=>[t[9*e+0],t[9*e+1],t[9*e+2],t[9*e+3],t[9*e+4],t[9*e+5],t[9*e+6],t[9*e+7],t[9*e+8]],MAT4:(t,e)=>[t[16*e+0],t[16*e+1],t[16*e+2],t[16*e+3],t[16*e+4],t[16*e+5],t[16*e+6],t[16*e+7],t[16*e+8],t[16*e+9],t[16*e+10],t[16*e+11],t[16*e+12],t[16*e+13],t[16*e+14],t[16*e+15]]},_i={SCALAR:(t,e,r)=>{e[r]=t},VEC2:(t,e,r)=>{e[2*r+0]=t[0],e[2*r+1]=t[1]},VEC3:(t,e,r)=>{e[3*r+0]=t[0],e[3*r+1]=t[1],e[3*r+2]=t[2]},VEC4:(t,e,r)=>{e[4*r+0]=t[0],e[4*r+1]=t[1],e[4*r+2]=t[2],e[4*r+3]=t[3]},MAT2:(t,e,r)=>{e[4*r+0]=t[0],e[4*r+1]=t[1],e[4*r+2]=t[2],e[4*r+3]=t[3]},MAT3:(t,e,r)=>{e[9*r+0]=t[0],e[9*r+1]=t[1],e[9*r+2]=t[2],e[9*r+3]=t[3],e[9*r+4]=t[4],e[9*r+5]=t[5],e[9*r+6]=t[6],e[9*r+7]=t[7],e[9*r+8]=t[8],e[9*r+9]=t[9]},MAT4:(t,e,r)=>{e[16*r+0]=t[0],e[16*r+1]=t[1],e[16*r+2]=t[2],e[16*r+3]=t[3],e[16*r+4]=t[4],e[16*r+5]=t[5],e[16*r+6]=t[6],e[16*r+7]=t[7],e[16*r+8]=t[8],e[16*r+9]=t[9],e[16*r+10]=t[10],e[16*r+11]=t[11],e[16*r+12]=t[12],e[16*r+13]=t[13],e[16*r+14]=t[14],e[16*r+15]=t[15]}};const bi=t=>void 0!==t;function xi(t,e,r){if(!e)return null;let n=t.getExtension("3DTILES_batch_table_hierarchy");const i=e.HIERARCHY;return i&&(console.warn("3D Tile Parser: HIERARCHY is deprecated. Use 3DTILES_batch_table_hierarchy."),e.extensions=e.extensions||{},e.extensions["3DTILES_batch_table_hierarchy"]=i,n=i),n?function(t,e){let r,n,i;const o=t.instancesLength,a=t.classes;let s,u=t.classIds,c=t.parentCounts,l=t.parentIds,h=o;bi(u.byteOffset)&&(u.componentType=defaultValue(u.componentType,GL.UNSIGNED_SHORT),u.type=AttributeType.SCALAR,i=getBinaryAccessor(u),u=i.createArrayBufferView(e.buffer,e.byteOffset+u.byteOffset,o));if(bi(c))for(bi(c.byteOffset)&&(c.componentType=defaultValue(c.componentType,GL.UNSIGNED_SHORT),c.type=AttributeType.SCALAR,i=getBinaryAccessor(c),c=i.createArrayBufferView(e.buffer,e.byteOffset+c.byteOffset,o)),s=new Uint16Array(o),h=0,r=0;r<o;++r)s[r]=h,h+=c[r];bi(l)&&bi(l.byteOffset)&&(l.componentType=defaultValue(l.componentType,GL.UNSIGNED_SHORT),l.type=AttributeType.SCALAR,i=getBinaryAccessor(l),l=i.createArrayBufferView(e.buffer,e.byteOffset+l.byteOffset,h));const f=a.length;for(r=0;r<f;++r){const t=a[r].length,n=a[r].instances,i=getBinaryProperties(t,n,e);a[r].instances=combine(i,n)}const p=new Array(f).fill(0),d=new Uint16Array(o);for(r=0;r<o;++r)n=u[r],d[r]=p[n],++p[n];const A={classes:a,classIds:u,classIndexes:d,parentCounts:c,parentIndexes:s,parentIds:l};return function(t){const e=t.classIds.length;for(let r=0;r<e;++r)Ei(t,r,stack)}(A),A}(n,r):null}function wi(t,e,r){if(!t)return;const n=t.parentCounts;return t.parentIds?r(t,e):n>0?function(t,e,r){const n=t.classIds,i=t.parentCounts,o=t.parentIds,a=t.parentIndexes,s=n.length,u=scratchVisited;u.length=Math.max(u.length,s);const c=++marker,l=scratchStack;l.length=0,l.push(e);for(;l.length>0;){if(e=l.pop(),u[e]===c)continue;u[e]=c;const n=r(t,e);if(bi(n))return n;const s=i[e],h=a[e];for(let t=0;t<s;++t){const r=o[h+t];r!==e&&l.push(r)}}return null}(t,e,r):function(t,e,r){let n=!0;for(;n;){const i=r(t,e);if(bi(i))return i;const o=t.parentIds[e];n=o!==e,e=o}throw new Error("traverseHierarchySingleParent")}(t,e,r)}function Ei(t,e,r){const n=t.parentCounts,i=t.parentIds,o=t.parentIndexes,a=t.classIds.length;if(!bi(i))return;assert(e<a,`Parent index ${e} exceeds the total number of instances: ${a}`),assert(-1===r.indexOf(e),"Circular dependency detected in the batch table hierarchy."),r.push(e);const s=bi(n)?n[e]:1,u=bi(n)?o[e]:e;for(let n=0;n<s;++n){const o=i[u+n];o!==e&&Ei(t,o,r)}r.pop(e)}function Si(t){return null!=t}const Oi=(t,e)=>t,Ti={HIERARCHY:!0,extensions:!0,extras:!0};class Pi{constructor(t,e,r,n={}){var i;Object(fn.a)(r>=0),this.json=t||{},this.binary=e,this.featureCount=r,this._extensions=(null===(i=this.json)||void 0===i?void 0:i.extensions)||{},this._properties={};for(const t in this.json)Ti[t]||(this._properties[t]=this.json[t]);this._binaryProperties=this._initializeBinaryProperties(),n["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=xi(this,this.json,this.binary))}getExtension(t){return this.json&&this.json.extensions&&this.json.extensions[t]}memorySizeInBytes(){return 0}isClass(t,e){if(this._checkBatchId(t),Object(fn.a)("string"==typeof e,e),this._hierarchy){return Si(wi(this._hierarchy,t,(t,r)=>{const n=t.classIds[r];return t.classes[n].name===e}))}return!1}isExactClass(t,e){return Object(fn.a)("string"==typeof e,e),this.getExactClassName(t)===e}getExactClassName(t){if(this._checkBatchId(t),this._hierarchy){const e=this._hierarchy.classIds[t];return this._hierarchy.classes[e].name}}hasProperty(t,e){return this._checkBatchId(t),Object(fn.a)("string"==typeof e,e),Si(this._properties[e])||this._hasPropertyInHierarchy(t,e)}getPropertyNames(t,e){this._checkBatchId(t),(e=Si(e)?e:[]).length=0;const r=Object.keys(this._properties);return e.push(...r),this._hierarchy&&this._getPropertyNamesInHierarchy(t,e),e}getProperty(t,e){if(this._checkBatchId(t),Object(fn.a)("string"==typeof e,e),this._binaryProperties){const r=this._binaryProperties[e];if(Si(r))return this._getBinaryProperty(r,t)}const r=this._properties[e];if(Si(r))return Oi(r[t]);if(this._hierarchy){const r=this._getHierarchyProperty(t,e);if(Si(r))return r}}setProperty(t,e,r){const n=this.featureCount;if(this._checkBatchId(t),Object(fn.a)("string"==typeof e,e),this._binaryProperties){const n=this._binaryProperties[e];if(n)return void this._setBinaryProperty(n,t,r)}if(this._hierarchy&&this._setHierarchyProperty(this,t,e,r))return;let i=this._properties[e];Si(i)||(this._properties[e]=new Array(n),i=this._properties[e]),i[t]=Oi(r)}_checkBatchId(t){if(!(t>=0&&t<this.featureCount))throw new Error("batchId not in range [0, featureCount - 1].")}_getBinaryProperty(t,e){return t.unpack(t.typedArray,e)}_setBinaryProperty(t,e,r){t.pack(r,t.typedArray,e)}_initializeBinaryProperties(){let t=null;for(const e in this._properties){const r=this._properties[e],n=this._initializeBinaryProperty(e,r);n&&(t=t||{},t[e]=n)}return t}_initializeBinaryProperty(t,e){if("byteOffset"in e){const r=e;Object(fn.a)(this.binary,`Property ${t} requires a batch table binary.`),Object(fn.a)(r.type,`Property ${t} requires a type.`);const n=function(t,e,r,n){const{componentType:i}=t;Object(fn.a)(t.componentType);const o="string"==typeof i?gi.fromName(i):i,a=yi[t.type],s=vi[t.type],u=_i[t.type];return r+=t.byteOffset,{values:gi.createTypedArray(o,e,r,a*n),type:o,size:a,unpacker:s,packer:u}}(r,this.binary.buffer,0|this.binary.byteOffset,this.featureCount);return{typedArray:n.values,componentCount:n.size,unpack:n.unpacker,pack:n.packer}}return null}_hasPropertyInHierarchy(t,e){if(!this._hierarchy)return!1;const r=wi(this._hierarchy,t,(t,r)=>{const n=t.classIds[r];return Si(t.classes[n].instances[e])});return Si(r)}_getPropertyNamesInHierarchy(t,e){wi(this._hierarchy,t,(t,r)=>{const n=t.classIds[r],i=t.classes[n].instances;for(const t in i)i.hasOwnProperty(t)&&-1===e.indexOf(t)&&e.push(t)})}_getHierarchyProperty(t,e){return wi(this._hierarchy,t,(t,r)=>{const n=t.classIds[r],i=t.classes[n],o=t.classIndexes[r],a=i.instances[e];return Si(a)?Si(a.typedArray)?this._getBinaryProperty(a,o):Oi(a[o]):null})}_setHierarchyProperty(t,e,r,n){const i=wi(this._hierarchy,e,(t,i)=>{const o=t.classIds[i],a=t.classes[o],s=t.classIndexes[i],u=a.instances[r];return!!Si(u)&&(Object(fn.a)(i===e,`Inherited property "${r}" is read-only.`),Si(u.typedArray)?this._setBinaryProperty(u,s,n):u[s]=Oi(n),!0)});return Si(i)}}function Mi(t,e,r=0){const n=new DataView(e);if(t.magic=n.getUint32(r,!0),r+=4,t.version=n.getUint32(r,!0),r+=4,t.byteLength=n.getUint32(r,!0),r+=4,1!==t.version)throw new Error(`3D Tile Version ${t.version} not supported`);return r}function Ci(t,e,r){const n=new DataView(e);let i;t.header=t.header||{};let o=n.getUint32(r,!0);r+=4;let a=n.getUint32(r,!0);r+=4;let s=n.getUint32(r,!0);r+=4;let u=n.getUint32(r,!0);return r+=4,s>=570425344?(r-=8,i=o,s=a,u=0,o=0,a=0,console.warn("b3dm tile in legacy format.")):u>=570425344&&(r-=4,i=s,s=o,u=a,o=0,a=0,console.warn("b3dm tile in legacy format.")),t.header.featureTableJsonByteLength=o,t.header.featureTableBinaryByteLength=a,t.header.batchTableJsonByteLength=s,t.header.batchTableBinaryByteLength=u,t.header.batchLength=i,r}function Ii(t,e,r,n){return r=function(t,e,r,n){const{featureTableJsonByteLength:i,featureTableBinaryByteLength:o,batchLength:a}=t.header;if(t.featureTableJson={BATCH_LENGTH:a||0},i>0){const n=li(e,r,i);t.featureTableJson=JSON.parse(n)}return r+=i,t.featureTableBinary=new Uint8Array(e,r,o),r+=o}(t,e,r),r=function(t,e,r,n){const{batchTableJsonByteLength:i,batchTableBinaryByteLength:o}=t.header;if(i>0){const n=li(e,r,i);t.batchTableJson=JSON.parse(n),r+=i,o>0&&(t.batchTableBinary=new Uint8Array(e,r,o),t.batchTableBinary=new Uint8Array(t.batchTableBinary),r+=o)}return r}(t,e,r)}function ki(t,e=[0,0,0]){const r=t>>11&31,n=t>>5&63,i=31&t;return e[0]=r<<3,e[1]=n<<2,e[2]=i<<3,e}function Ri(t,e,r){if(!(e||t&&t.batchIds&&r))return null;const{batchIds:n,isRGB565:i,pointCount:o}=t;if(n&&r){const t=new Uint8ClampedArray(3*o);for(let e=0;e<o;e++){const i=n[e],o=r.getProperty(i,"dimensions").map(t=>255*t);t[3*e]=o[0],t[3*e+1]=o[1],t[3*e+2]=o[2]}return{type:pi.UNSIGNED_BYTE,value:t,size:3,normalized:!0}}if(i){const t=new Uint8ClampedArray(3*o);for(let r=0;r<o;r++){const n=ki(e[r]);t[3*r]=n[0],t[3*r+1]=n[1],t[3*r+2]=n[2]}return{type:pi.UNSIGNED_BYTE,value:t,size:3,normalized:!0}}return e&&e.length===3*o?{type:pi.UNSIGNED_BYTE,value:e,size:3,normalized:!0}:{type:pi.UNSIGNED_BYTE,value:e,size:4,normalized:!0}}var Li=r(219);function ji(t,e){if(!t)throw new Error(`math.gl assertion failed. ${e}`)}new Li.a,new Z.a,new Li.a,new Li.a,new Uint8Array(1);function Di(t,e=255){return Object(bt.a)(t,0,e)/e*2-1}function Bi(t){return t<0?-1:1}function Fi(t,e,r,n){if(ji(n),t<0||t>r||e<0||e>r)throw new Error(`x and y must be unsigned normalized integers between 0 and ${r}`);if(n.x=Di(t,r),n.y=Di(e,r),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){const t=n.x;n.x=(1-Math.abs(n.y))*Bi(t),n.y=(1-Math.abs(t))*Bi(n.y)}return n.normalize()}function zi(t,e,r){return Fi(t,e,255,r)}const Ni=new Z.a;function Ui(t,e,r){return t.isQuantized?r["3d-tiles"]&&r["3d-tiles"].decodeQuantizedPositions?(t.isQuantized=!1,function(t,e){const r=new Z.a,n=new Float32Array(3*t.pointCount);for(let i=0;i<t.pointCount;i++)r.set(e[3*i],e[3*i+1],e[3*i+2]).scale(1/t.quantizedRange).multiply(t.quantizedVolumeScale).add(t.quantizedVolumeOffset).toArray(n,3*i);return n}(t,e)):{type:pi.UNSIGNED_SHORT,value:e,size:3,normalized:!0}:e}async function Vi(t,e,r,n,i){r=Ii(t,e,r=Ci(t,e,r=Mi(t,e,r))),function(t){t.attributes={positions:null,colors:null,normals:null,batchIds:null},t.isQuantized=!1,t.isTranslucent=!1,t.isRGB565=!1,t.isOctEncoded16P=!1}(t);const{featureTable:o,batchTable:a}=function(t){const e=new mi(t.featureTableJson,t.featureTableBinary),r=e.getGlobalProperty("POINTS_LENGTH");if(!Number.isFinite(r))throw new Error("POINTS_LENGTH must be defined");e.featuresLength=r,t.featuresLength=r,t.pointsLength=r,t.pointCount=r,t.rtcCenter=e.getGlobalProperty("RTC_CENTER",pi.FLOAT,3);const n=function(t,e){let r=null;if(!t.batchIds&&e.hasProperty("BATCH_ID")&&(t.batchIds=e.getPropertyArray("BATCH_ID",pi.UNSIGNED_SHORT,1),t.batchIds)){const n=e.getGlobalProperty("BATCH_LENGTH");if(!n)throw new Error("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");const{batchTableJson:i,batchTableBinary:o}=t;r=new Pi(i,o,n)}return r}(t,e);return{featureTable:e,batchTable:n}}(t);return await async function(t,e,r,n,i){let o,a,s;const u=t.batchTableJson&&t.batchTableJson.extensions&&t.batchTableJson.extensions["3DTILES_draco_point_compression"];u&&(s=u.properties);const c=e.getExtension("3DTILES_draco_point_compression");if(c){a=c.properties;const e=c.byteOffset,r=c.byteLength;if(!a||!Number.isFinite(e)||!r)throw new Error("Draco properties, byteOffset, and byteLength must be defined");o=t.featureTableBinary.slice(e,e+r),t.hasPositions=Number.isFinite(a.POSITION),t.hasColors=Number.isFinite(a.RGB)||Number.isFinite(a.RGBA),t.hasNormals=Number.isFinite(a.NORMAL),t.hasBatchIds=Number.isFinite(a.BATCH_ID),t.isTranslucent=Number.isFinite(a.RGBA)}if(!o)return!0;const l={buffer:o,properties:{...a,...s},featureTableProperties:a,batchTableProperties:s,dequantizeInShader:!1};return await async function(t,e,r,n){const{parse:i}=n,o={...r,draco:{...r.draco,extraAttributes:e.batchTableProperties||{}}};delete o["3d-tiles"];const a=await i(e.buffer,hi.a,o),s=a.attributes.POSITION&&a.attributes.POSITION.value,u=a.attributes.COLOR_0&&a.attributes.COLOR_0.value,c=a.attributes.NORMAL&&a.attributes.NORMAL.value,l=a.attributes.BATCH_ID&&a.attributes.BATCH_ID.value,h=s&&a.attributes.POSITION.value.quantization,f=c&&a.attributes.NORMAL.value.quantization;if(h){const e=a.POSITION.data.quantization,r=e.range;t.quantizedVolumeScale=new Z.a(r,r,r),t.quantizedVolumeOffset=new Z.a(e.minValues),t.quantizedRange=(1<<e.quantizationBits)-1,t.isQuantizedDraco=!0}f&&(t.octEncodedRange=(1<<a.NORMAL.data.quantization.quantizationBits)-1,t.isOctEncodedDraco=!0);const p={};if(e.batchTableProperties)for(const t of Object.keys(e.batchTableProperties))a.attributes[t]&&a.attributes[t].value&&(p[t.toLowerCase()]=a.attributes[t].value);t.attributes={positions:s,colors:Ri(t,u),normals:c,batchIds:l,...p}}(t,l,n,i)}(t,o,0,n,i),function(t,e,r){if(!t.attributes.positions)if(e.hasProperty("POSITION"))t.attributes.positions=e.getPropertyArray("POSITION",pi.FLOAT,3);else if(e.hasProperty("POSITION_QUANTIZED")){const n=e.getPropertyArray("POSITION_QUANTIZED",pi.UNSIGNED_SHORT,3);if(t.isQuantized=!0,t.quantizedRange=65535,t.quantizedVolumeScale=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",pi.FLOAT,3),!t.quantizedVolumeScale)throw new Error("QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");if(t.quantizedVolumeOffset=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",pi.FLOAT,3),!t.quantizedVolumeOffset)throw new Error("QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");t.attributes.positions=Ui(t,n,r)}if(!t.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}(t,o,n),function(t,e,r){if(!t.attributes.colors){let n=null;e.hasProperty("RGBA")?(n=e.getPropertyArray("RGBA",pi.UNSIGNED_BYTE,4),t.isTranslucent=!0):e.hasProperty("RGB")?n=e.getPropertyArray("RGB",pi.UNSIGNED_BYTE,3):e.hasProperty("RGB565")&&(n=e.getPropertyArray("RGB565",pi.UNSIGNED_SHORT,1),t.isRGB565=!0),t.attributes.colors=Ri(t,n,r)}e.hasProperty("CONSTANT_RGBA")&&(t.constantRGBA=e.getGlobalProperty("CONSTANT_RGBA",pi.UNSIGNED_BYTE,4))}(t,o,a),function(t,e){if(!t.attributes.normals){let r=null;e.hasProperty("NORMAL")?r=e.getPropertyArray("NORMAL",pi.FLOAT,3):e.hasProperty("NORMAL_OCT16P")&&(r=e.getPropertyArray("NORMAL_OCT16P",pi.UNSIGNED_BYTE,2),t.isOctEncoded16P=!0),t.attributes.normals=function(t,e){if(!e)return null;if(t.isOctEncoded16P){const r=new Float32Array(3*t.pointsLength);for(let n=0;n<t.pointsLength;n++)zi(e[2*n],e[2*n+1],Ni),Ni.toArray(r,3*n);return{type:pi.FLOAT,size:2,value:r}}return{type:pi.FLOAT,size:2,value:e}}(t,r)}}(t,o),r}var Gi=r(291),Wi=r(78);const Hi=0,qi=1;function Zi(t,e,r,n){t.rotateYtoZ=!0;const i=t.byteOffset+t.byteLength-r;if(0===i)throw new Error("glTF byte length must be greater than 0.");return t.gltfUpAxis=n["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y",t.gltfArrayBuffer=Object(Wi.c)(e,r,i),t.gltfByteOffset=0,t.gltfByteLength=i,r%4==0||console.warn(`${t.type}: embedded glb is not aligned to a 4-byte boundary.`),t.byteOffset+t.byteLength}async function Xi(t,e,r,n){const i=r["3d-tiles"]||{};if(function(t,e,r){switch(e){case Hi:const e=new Uint8Array(t.gltfArrayBuffer,t.gltfByteOffset),r=(new TextDecoder).decode(e);t.gltfUrl=r.replace(/[\s\0]+$/,""),delete t.gltfArrayBuffer,delete t.gltfByteOffset,delete t.gltfByteLength;break;case qi:break;default:throw new Error("b3dm: Illegal glTF format field")}}(t,e),i.loadGLTF){const{parse:e,fetch:i}=n;t.gltfUrl&&(t.gltfArrayBuffer=await i(t.gltfUrl,r),t.gltfByteOffset=0),t.gltfArrayBuffer&&(t.gltf=await e(t.gltfArrayBuffer,Gi.a,r,n),delete t.gltfArrayBuffer,delete t.gltfByteOffset,delete t.gltfByteLength)}}async function Qi(t,e,r,n,i){var o;r=function(t,e,r,n,i){r=Mi(t,e,r),r=Ci(t,e,r),r=Ii(t,e,r),r=Zi(t,e,r,n);const o=new mi(t.featureTableJson,t.featureTableBinary);return t.rtcCenter=o.getGlobalProperty("RTC_CENTER",pi.FLOAT,3),r}(t,e,r,n),await Xi(t,qi,n,i);const a=null==t?void 0:null===(o=t.gltf)||void 0===o?void 0:o.extensions;return a&&a.CESIUM_RTC&&(t.rtcCenter=a.CESIUM_RTC.center),r}async function Yi(t,e,r,n,i){return r=function(t,e,r,n,i){if(r=Mi(t,e,r),1!==t.version)throw new Error(`Instanced 3D Model version ${t.version} is not supported`);r=Ci(t,e,r);const o=new DataView(e);if(t.gltfFormat=o.getUint32(r,!0),r=Ii(t,e,r+=4),r=Zi(t,e,r,n),0===t.featureTableJsonByteLength)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");const a=new mi(t.featureTableJson,t.featureTableBinary),s=a.getGlobalProperty("INSTANCES_LENGTH");if(a.featuresLength=s,!Number.isFinite(s))throw new Error("i3dm parser: INSTANCES_LENGTH must be defined");t.eastNorthUp=a.getGlobalProperty("EAST_NORTH_UP"),t.rtcCenter=a.getGlobalProperty("RTC_CENTER",pi.FLOAT,3);new Pi(t.batchTableJson,t.batchTableBinary,s);return function(t,e,r,n){const i=[new Array(n),t._batchTable][0],o=new Z.a,a=new Z.a,s=new Z.a,u=new Z.a,c=new et.a,l=new rt.a,h=new Z.a,f={},p=new Mt.a,d=[],A=[],g=new Z.a,m=new Z.a;for(let r=0;r<n;r++){let n;if(e.hasProperty("POSITION"))n=e.getProperty("POSITION",pi.FLOAT,3,r,o);else if(e.hasProperty("POSITION_QUANTIZED")){n=e.getProperty("POSITION_QUANTIZED",pi.UNSIGNED_SHORT,3,r,o);const t=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",pi.FLOAT,3,g);if(!t)throw new Error("i3dm parser: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");const i=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",pi.FLOAT,3,m);if(!i)throw new Error("i3dm parser: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");const a=65535;for(let e=0;e<3;e++)n[e]=n[e]/a*i[e]+t[e]}if(!n)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");o.copy(n),f.translation=o,t.normalUp=e.getProperty("NORMAL_UP",pi.FLOAT,3,r,d),t.normalRight=e.getProperty("NORMAL_RIGHT",pi.FLOAT,3,r,A);const y=!1;if(t.normalUp){if(!t.normalRight)throw new Error("i3dm: Custom orientation requires both NORMAL_UP and NORMAL_RIGHT.");t.hasCustomOrientation=!0}else{if(t.octNormalUp=e.getProperty("NORMAL_UP_OCT32P",pi.UNSIGNED_SHORT,2,d),t.octNormalRight=e.getProperty("NORMAL_RIGHT_OCT32P",pi.UNSIGNED_SHORT,2,A),t.octNormalUp){if(!t.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")}t.eastNorthUp?(ln.WGS84.eastNorthUpToFixedFrame(o,p),p.getRotationMatrix3(c)):c.identity()}y&&(u.copy(a).cross(s).normalize(),c.setColumn(0,a),c.setColumn(1,s),c.setColumn(2,u)),l.fromMatrix3(c),f.rotation=l,h.set(1,1,1);const v=e.getProperty("SCALE",pi.FLOAT,1,r);Number.isFinite(v)&&h.multiplyByScalar(v);const _=e.getProperty("SCALE_NON_UNIFORM",pi.FLOAT,3,r,d);_&&h.scale(_),f.scale=h;let b=e.getProperty("BATCH_ID",pi.UNSIGNED_SHORT,1,r);void 0===b&&(b=r);const x=(new Mt.a).fromQuaternion(f.rotation);p.identity(),p.translate(f.translation),p.multiplyRight(x),p.scale(f.scale);const w=p.clone();i[r]={modelMatrix:w,batchId:b}}t.instances=i}(t,a,0,s),r}(t,e,r,n),await Xi(t,t.gltfFormat,n,i),r}async function Ki(t,e=0,r,n,i={}){switch(i.byteOffset=e,i.type=function(t,e=0){const r=new DataView(t);return`${String.fromCharCode(r.getUint8(e+0))}${String.fromCharCode(r.getUint8(e+1))}${String.fromCharCode(r.getUint8(e+2))}${String.fromCharCode(r.getUint8(e+3))}`}(t,e),i.type){case ci.COMPOSITE:return await async function(t,e,r,n,i,o){r=Mi(t,e,r);const a=new DataView(e);for(t.tilesLength=a.getUint32(r,!0),r+=4,t.tiles=[];t.tiles.length<t.tilesLength&&t.byteLength-r>12;){const a={};t.tiles.push(a),r=await o(e,r,n,i,a)}return r}(i,t,e,r,n,Ki);case ci.BATCHED_3D_MODEL:return await Qi(i,t,e,r,n);case ci.INSTANCED_3D_MODEL:return await Yi(i,t,e,r,n);case ci.POINT_CLOUD:return await Vi(i,t,e,r,n);default:throw new Error(`3DTileLoader: unknown type ${i.type}`)}}function $i(t,e){if(t.content){const r=t.content.uri||t.content.url;t.contentUrl=`${e.basePath}/${r}`}return t.id=t.contentUrl,t.lodMetricType=Bn,t.lodMetricValue=t.geometricError,t.transformMatrix=t.transform,t.type=function(t){if(!t.contentUrl)return In;const e=t.contentUrl.split(".").pop();switch(e){case"pnts":return Rn;case"i3dm":case"b3dm":return kn;default:return e}}(t),t.refine=function(t){switch(t){case"REPLACE":case"replace":return Cn;case"ADD":case"add":return Mn;default:return t}}(t.refine),t}const Ji={id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:"3.0.8",extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:async function(t,e,r){const n=e["3d-tiles"]||{};let i;i="auto"===n.isTileset?r.url&&-1!==r.url.indexOf(".json"):n.isTileset;t=i?await async function(t,e,r){const n=JSON.parse((new TextDecoder).decode(t));return n.loader=e.loader||Ji,n.url=r.url,n.basePath=function(t){return pn.b.dirname(t.url)}(n),n.root=function(t){const e=t.basePath,r=$i(t.root,t),n=[];for(n.push(r);n.length>0;){const t=n.pop().children||[];for(const r of t)$i(r,{basePath:e}),n.push(r)}return r}(n),n.type=Dn,n.lodMetricType=Bn,n.lodMetricValue=n.root.lodMetricValue,n}(t,e,r):await async function(t,e,r){const n={content:{featureIds:null}};return await Ki(t,0,e,r,n.content),n.content}(t,e,r);return t},options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};function to(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function eo(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?to(Object(r),!0).forEach((function(e){g()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):to(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ro(t){var e=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(t){return!1}}();return function(){var r,n=l()(t);if(e){var i=l()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return u()(this,r)}}var no=[0],io={getPointColor:{type:"accessor",value:[0,0,0,255]},pointSize:1,data:null,loader:Ji,onTilesetLoad:{type:"function",value:function(t){},compare:!1},onTileLoad:{type:"function",value:function(t){},compare:!1},onTileUnload:{type:"function",value:function(t){},compare:!1},onTileError:{type:"function",value:function(t,e,r){},compare:!1},_getMeshColor:{type:"function",value:function(t){return[255,255,255]},compare:!1}},oo=function(t){a()(n,t);var e,r=ro(n);function n(){return i()(this,n),r.apply(this,arguments)}return d()(n,[{key:"initializeState",value:function(){"onTileLoadFail"in this.props&&V.a.removed("onTileLoadFail","onTileError")(),this.state={layerMap:{},tileset3d:null,activeViewports:{},lastUpdatedViewports:null}}},{key:"shouldUpdateState",value:function(t){return t.changeFlags.somethingChanged}},{key:"updateState",value:function(t){var e=t.props,r=t.oldProps,n=t.changeFlags;if(e.data&&e.data!==r.data&&this._loadTileset(e.data),n.viewportChanged){var i=this.state.activeViewports;Object.keys(i).length&&(this._updateTileset(i),this.state.lastUpdatedViewports=i,this.state.activeViewports={})}if(n.propsChanged){var o=this.state.layerMap;for(var a in o)o[a].needsUpdate=!0}}},{key:"activateViewport",value:function(t){var e=this.state,r=e.activeViewports,n=e.lastUpdatedViewports;this.internalState.viewport=t,r[t.id]=t;var i=null==n?void 0:n[t.id];i&&t.equals(i)||(this.setChangeFlags({viewportChanged:!0}),this.setNeedsUpdate())}},{key:"getPickingInfo",value:function(t){var e=t.info,r=t.sourceLayer,n=this.state.layerMap,i=r&&r.id;if(i){var o=i.substring(this.id.length+1),a=o.substring(o.indexOf("-")+1);e.object=n[a]&&n[a].tile}return e}},{key:"filterSubLayer",value:function(t){var e=t.layer,r=t.viewport,n=e.props.tile,i=r.id;return n.selected&&n.viewportIds.includes(i)}},{key:"_updateAutoHighlight",value:function(t){t.sourceLayer&&t.sourceLayer.updateAutoHighlight(t)}},{key:"_loadTileset",value:(e=U()(z.a.mark((function t(e){var r,n,i,o,a,s,u;return z.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.props.loadOptions,n=void 0===r?{}:r,i=this.props.loader||this.props.loaders,Array.isArray(i)&&(i=i[0]),o={loadOptions:eo({},n)},!i.preload){t.next=10;break}return t.next=7,i.preload(e,n);case 7:(a=t.sent).headers&&(o.loadOptions.fetch=eo(eo({},o.loadOptions.fetch),{},{headers:a.headers})),Object.assign(o,a);case 10:return t.next=12,Object(Fr.a)(e,i,o.loadOptions);case 12:s=t.sent,u=new ui(s,eo({onTileLoad:this._onTileLoad.bind(this),onTileUnload:this._onTileUnload.bind(this),onTileLoadFail:this.props.onTileError},o)),this.setState({tileset3d:u,layerMap:{}}),this._updateTileset(this.state.activeViewports),this.props.onTilesetLoad(u);case 17:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"_onTileLoad",value:function(t){var e=this.state.lastUpdatedViewports;this.props.onTileLoad(t),this._updateTileset(e),this.setNeedsUpdate()}},{key:"_onTileUnload",value:function(t){delete this.state.layerMap[t.id],this.props.onTileUnload(t)}},{key:"_updateTileset",value:function(t){var e=this.state.tileset3d,r=this.context.timeline,n=Object.keys(t).length;if(r&&n&&e){var i=e.update(Object.values(t));this.state.frameNumber!==i&&this.setState({frameNumber:i})}}},{key:"_getSubLayer",value:function(t,e){if(!t.content)return null;switch(t.type){case Rn:return this._makePointCloudLayer(t,e);case kn:return this._make3DModelLayer(t,e);case Ln:return this._makeSimpleMeshLayer(t,e);default:throw new Error("Tile3DLayer: Failed to render layer of type ".concat(t.content.type))}}},{key:"_makePointCloudLayer",value:function(t,e){var r=t.content,n=r.attributes,i=r.pointCount,o=r.constantRGBA,a=r.cartographicOrigin,s=r.modelMatrix,u=n.positions,c=n.normals,l=n.colors;if(!u)return null;var h=e&&e.props.data||{header:{vertexCount:i},attributes:{POSITION:u,NORMAL:c,COLOR_0:l}},f=this.props,p=f.pointSize,d=f.getPointColor;return new(this.getSubLayerClass("pointcloud",Pr.a))({pointSize:p},this.getSubLayerProps({id:"pointcloud"}),{id:"".concat(this.id,"-pointcloud-").concat(t.id),tile:t,data:h,coordinateSystem:Tr.a.METER_OFFSETS,coordinateOrigin:a,modelMatrix:s,getColor:o||d,_offset:0})}},{key:"_make3DModelLayer",value:function(t){var e=t.content,r=e.gltf,n=e.instances,i=e.cartographicOrigin,o=e.modelMatrix;return new(this.getSubLayerClass("scenegraph",Mr.a))({_lighting:"pbr"},this.getSubLayerProps({id:"scenegraph"}),{id:"".concat(this.id,"-scenegraph-").concat(t.id),tile:t,data:n||no,scenegraph:r,coordinateSystem:Tr.a.METER_OFFSETS,coordinateOrigin:i,modelMatrix:o,getTransformMatrix:function(t){return t.modelMatrix},getPosition:[0,0,0],_offset:0})}},{key:"_makeSimpleMeshLayer",value:function(t,e){var r=t.content,n=r.attributes,i=r.indices,o=r.modelMatrix,a=r.cartographicOrigin,s=r.material,u=r.featureIds,c=this.props._getMeshColor,l=e&&e.props.mesh||new Or.a({drawMode:4,attributes:ao(n),indices:i});return new(this.getSubLayerClass("mesh",Br))(this.getSubLayerProps({id:"mesh"}),{id:"".concat(this.id,"-mesh-").concat(t.id),tile:t,mesh:l,data:no,getColor:c(t),pbrMaterial:s,modelMatrix:o,coordinateOrigin:a,coordinateSystem:Tr.a.METER_OFFSETS,featureIds:u,_offset:0})}},{key:"renderLayers",value:function(){var t=this,e=this.state,r=e.tileset3d,n=e.layerMap;return r?r.tiles.map((function(e){var r=n[e.id]=n[e.id]||{tile:e},i=r.layer;return e.selected&&(i?r.needsUpdate&&(i=t._getSubLayer(e,i),r.needsUpdate=!1):i=t._getSubLayer(e)),r.layer=i,i})).filter(Boolean):null}},{key:"isLoaded",get:function(){var t=this.state.tileset3d;return t&&t.isLoaded()}}]),n}(m.a);function ao(t){var e={};return e.positions=eo(eo({},t.positions),{},{value:new Float32Array(t.positions.value)}),t.normals&&(e.normals=t.normals),t.texCoords&&(e.texCoords=t.texCoords),t.colors&&(e.colors=t.colors),t.uvRegions&&(e.uvRegions=t.uvRegions),e}oo.layerName="Tile3DLayer",oo.defaultProps=io;var so=r(105);const uo={name:"Terrain",id:"terrain",module:"terrain",version:"3.0.8",worker:!0,extensions:["png","pngraw"],mimeTypes:["image/png"],options:{terrain:{tesselator:"auto",bounds:null,meshMaxError:10,elevationDecoder:{rScaler:1,gScaler:0,bScaler:0,offset:0},skirtHeight:null}}};function co(t){var e=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(t){return!1}}();return function(){var r,n=l()(t);if(e){var i=l()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return u()(this,r)}}function lo(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ho(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?lo(Object(r),!0).forEach((function(e){g()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):lo(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var fo=[1],po=ho(ho({},we.defaultProps),{},{elevationData:re,texture:ho(ho({},re),{},{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:[uo]});function Ao(t){return Array.isArray(t)?t.join(";"):t}var go=function(t){a()(r,t);var e=co(r);function r(){return i()(this,r),e.apply(this,arguments)}return d()(r,[{key:"updateState",value:function(t){var e=t.props,r=t.oldProps,n=e.elevationData!==r.elevationData;if(n){var i=e.elevationData,o=i&&(Array.isArray(i)||i.includes("{x}")&&i.includes("{y}"));this.setState({isTiled:o})}var a=n||e.meshMaxError!==r.meshMaxError||e.elevationDecoder!==r.elevationDecoder||e.bounds!==r.bounds;if(!this.state.isTiled&&a){var s=this.loadTerrain(e);this.setState({terrain:s})}e.workerUrl&&V.a.removed("workerUrl","loadOptions.terrain.workerUrl")()}},{key:"loadTerrain",value:function(t){var e,r=t.elevationData,n=t.bounds,i=t.elevationDecoder,o=t.meshMaxError,a=t.signal;if(!r)return null;var s=this.getLoadOptions();return s=ho(ho({},s),{},{terrain:ho(ho({skirtHeight:this.state.isTiled?2*o:0},null===(e=s)||void 0===e?void 0:e.terrain),{},{bounds:n,meshMaxError:o,elevationDecoder:i})}),(0,this.props.fetch)(r,{propName:"elevationData",layer:this,loadOptions:s,signal:a})}},{key:"getTiledTerrainData",value:function(t){var e=this.props,r=e.elevationData,n=e.fetch,i=e.texture,o=e.elevationDecoder,a=e.meshMaxError,s=ie(r,t),u=ie(i,t),c=t.bbox,l=t.signal,h=t.z,f=new so.a({longitude:(c.west+c.east)/2,latitude:(c.north+c.south)/2,zoom:h}),p=f.projectFlat([c.west,c.south]),d=f.projectFlat([c.east,c.north]),A=[p[0],p[1],d[0],d[1]],g=this.loadTerrain({elevationData:s,bounds:A,elevationDecoder:o,meshMaxError:a,signal:l}),m=u?n(u,{propName:"texture",layer:this,loaders:[],signal:l}).catch((function(t){return null})):Promise.resolve(null);return Promise.all([g,m])}},{key:"renderSubLayers",value:function(t){var e=this.getSubLayerClass("mesh",Rr.a),r=t.data,n=t.color;if(!r)return null;var i=_()(r,2),o=i[0],a=i[1];return new e(t,{data:fo,mesh:o,texture:a,coordinateSystem:Tr.a.CARTESIAN,getPosition:function(t){return[0,0,0]},getColor:n})}},{key:"onViewportLoad",value:function(t){if(t){var e=this.state.zRange,r=t.map((function(t){return t.content})).filter(Boolean).map((function(t){return t[0].header.boundingBox.map((function(t){return t[2]}))}));if(0!==r.length){var n=Math.min.apply(Math,H()(r.map((function(t){return t[0]})))),i=Math.max.apply(Math,H()(r.map((function(t){return t[1]}))));(!e||n<e[0]||i>e[1])&&this.setState({zRange:[n,i]})}}}},{key:"renderLayers",value:function(){var t=this.props,e=t.color,r=t.material,n=t.elevationData,i=t.texture,o=t.wireframe,a=t.meshMaxError,s=t.elevationDecoder,u=t.tileSize,c=t.maxZoom,l=t.minZoom,h=t.extent,f=t.maxRequests,p=t.onTileLoad,d=t.onTileUnload,A=t.onTileError,g=t.maxCacheSize,m=t.maxCacheByteSize,y=t.refinementStrategy;return this.state.isTiled?new we(this.getSubLayerProps({id:"tiles"}),{wireframe:o,color:e,material:r,getTileData:this.getTiledTerrainData.bind(this),renderSubLayers:this.renderSubLayers.bind(this),updateTriggers:{getTileData:{elevationData:Ao(n),texture:Ao(i),meshMaxError:a,elevationDecoder:s}},onViewportLoad:this.onViewportLoad.bind(this),zRange:this.state.zRange||null,tileSize:u,maxZoom:c,minZoom:l,extent:h,maxRequests:f,onTileLoad:p,onTileUnload:d,onTileError:A,maxCacheSize:g,maxCacheByteSize:m,refinementStrategy:y}):new(this.getSubLayerClass("mesh",Rr.a))(this.getSubLayerProps({id:"mesh"}),{data:fo,mesh:this.state.terrain,texture:i,_instanced:!1,getPosition:function(t){return[0,0,0]},getColor:e,material:r,wireframe:o})}}]),r}(m.a);go.layerName="TerrainLayer",go.defaultProps=po;class mo{static get types(){return["Unknown","Point","LineString","Polygon"]}constructor(t,e,r,n,i){this.properties={},this.extent=r,this.type=0,this.id=null,this._pbf=t,this._geometry=-1,this._keys=n,this._values=i,t.readFields(vo,this,e)}loadGeometry(){const t=this._pbf;t.pos=this._geometry;const e=t.readVarint()+t.pos;let r=1,n=0,i=0,o=0;const a=[];let s;for(;t.pos<e;){if(n<=0){const e=t.readVarint();7&e,e>>3}if(1===r||2===r)t.readSVarint(),t.readSVarint(),1===r&&(s&&a.push(s),[]),s.push([i,o]);else{if(7!==r)throw new Error(`unknown command ${r}`);s&&s.push(s[0].slice())}}return s&&a.push(s),a}bbox(){const t=this._pbf;t.pos=this._geometry;const e=t.readVarint()+t.pos;let r=1,n=0,i=0,o=0,a=1/0,s=-1/0,u=1/0,c=-1/0;for(;t.pos<e;){if(n<=0){const e=t.readVarint();7&e,e>>3}if(1===r||2===r)t.readSVarint(),t.readSVarint(),i<a&&i,i>s&&i,o<u&&o,o>c&&o;else if(7!==r)throw new Error(`unknown command ${r}`)}return[a,u,s,c]}_toGeoJSON(t){let e,r,n=this.loadGeometry(),i=mo.types[this.type];switch(this.type){case 1:var o=[];for(0;e<n.length;e++)o[e]=n[e][0];o,t(n,this);break;case 2:for(0;e<n.length;e++)t(n[e],this);break;case 3:for(function(t){const e=t.length;if(e<=1)return[t];const r=[];let n,i;for(let o=0;o<e;o++){const e=yo(t[o]);0!==e&&(void 0===i&&e<0,i===e<0?(n&&r.push(n),[t[o]]):n.push(t[o]))}n&&r.push(n);return r}(n),0;e<n.length;e++)for(0;r<n[e].length;r++)t(n[e][r],this)}1===n.length?n[0]:`Multi${i}`;const a={type:"Feature",geometry:{type:i,coordinates:n},properties:this.properties};return null!==this.id&&(a.id=this.id),a}toGeoJSON(t){if("function"==typeof t)return this._toGeoJSON(t);const{x:e,y:r,z:n}=t,i=this.extent*Math.pow(2,n),o=this.extent*e,a=this.extent*r;return this._toGeoJSON((function(t){for(let e=0;e<t.length;e++){const r=t[e];r[0]=360*(r[0]+o)/i-180;const n=180-360*(r[1]+a)/i;r[1]=360/Math.PI*Math.atan(Math.exp(n*Math.PI/180))-90}}))}}function yo(t){let e=0;for(let e,r,n=0,i=t.length-1;n<t.length;n++)t[n],t[i],(r[0]-e[0])*(e[1]+r[1]);return e}function vo(t,e,r){1===t?e.id=r.readVarint():2===t?function(t,e){const r=t.readVarint()+t.pos;for(;t.pos<r;){const r=e._keys[t.readVarint()],n=e._values[t.readVarint()];e.properties[r]=n}}(r,e):3===t?e.type=r.readVarint():4===t&&(e._geometry=r.pos)}class _o{constructor(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(bo,this,e),this.length=this._features.length}feature(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];const e=this._pbf.readVarint()+this._pbf.pos;return new mo(this._pbf,e,this.extent,this._keys,this._values)}}function bo(t,e,r){15===t?e.version=r.readVarint():1===t?e.name=r.readString():5===t?e.extent=r.readVarint():2===t?e._features.push(r.pos):3===t?e._keys.push(r.readString()):4===t&&e._values.push(function(t){let e=null;const r=t.readVarint()+t.pos;for(;t.pos<r;){const e=t.readVarint()>>3;1===e?t.readString():2===e?t.readFloat():3===e?t.readDouble():4===e?t.readVarint64():5===e?t.readVarint():6===e?t.readSVarint():7===e?t.readBoolean():null}return e}(r))}class xo{constructor(t,e){this.layers=t.readFields(wo,{},e)}}function wo(t,e,r){if(3===t){const t=new _o(r,r.readVarint()+r.pos);t.length&&(e[t.name]=t)}}var Eo=r(38);let So,Oo,To,Po,Mo,Co,Io;class ko{static get types(){return["Unknown","Point","LineString","Polygon"]}constructor(t,e,r,n,i,o){this.properties={},this.extent=r,this.type=0,this.id=null,this._pbf=t,this._geometry=-1,this._keys=n,this._values=i,this._firstPassData=o,t.readFields(Lo,this,e)}loadGeometry(){const t=this._pbf;t.pos=this._geometry,t.readVarint()+t.pos,1,0,0,0,0;const e=[],r=[];for(;t.pos<So;)if(Po<=0&&(t.readVarint(),7&To,To>>3),1===Oo||2===Oo)t.readSVarint(),t.readSVarint(),1===Oo&&e.push(Io),r.push(Mo,Co),2;else{if(7!==Oo)throw new Error(`unknown command ${Oo}`);if(Io>0){const t=e[e.length-1];r.push(r[t],r[t+1]),2}}return{data:r,lines:e}}_toBinaryCoordinates(t){let e=this.loadGeometry();t(e.data,this);switch(this.type){case 1:this._firstPassData.pointFeaturesCount++,this._firstPassData.pointPositionsCount+=e.lines.length;break;case 2:this._firstPassData.lineFeaturesCount++,this._firstPassData.linePathsCount+=e.lines.length,this._firstPassData.linePositionsCount+=e.data.length/2;break;case 3:const t=Ro(e);this._firstPassData.polygonFeaturesCount++,this._firstPassData.polygonObjectsCount+=t.lines.length;for(const e of t.lines)this._firstPassData.polygonRingsCount+=e.length;this._firstPassData.polygonPositionsCount+=t.data.length/2,t}e.type=ko.types[this.type],e.lines.length>1&&(e.type=`Multi${e.type}`);const r={type:"Feature",geometry:e,properties:this.properties};return null!==this.id&&(r.id=this.id),r}toBinaryCoordinates(t){if("function"==typeof t)return this._toBinaryCoordinates(t);const{x:e,y:r,z:n}=t,i=this.extent*Math.pow(2,n),o=this.extent*e,a=this.extent*r;return this._toBinaryCoordinates((function(t){for(let e=0,r=t.length;e<r;e+=2){t[e]=360*(t[e]+o)/i-180;const r=180-360*(t[e+1]+a)/i;t[e+1]=360/Math.PI*Math.atan(Math.exp(r*Math.PI/180))-90}}))}}function Ro(t){const e=t.lines.length;if(e<=1)return{data:t.data,areas:[[Object(Eo.g)(t.data)]],lines:[t.lines]};const r=[],n=[];let i,o,a,s=0;for(let u,c,l=0;l<e;l++){t.lines[l]-s,t.lines[l+1]-s||t.data.length;const e=t.data.slice(u,c),h=Object(Eo.g)(e);if(0!==h)void 0===a&&h<0,a===h<0?(o&&(r.push(i),n.push(o)),[u],[h]):(i.push(h),o.push(u));else{const e=t.data.slice(0,u),r=t.data.slice(c);t.data=e.concat(r),c-u}}return i&&r.push(i),o&&n.push(o),{areas:r,lines:n,data:t.data}}function Lo(t,e,r){1===t?e.id=r.readVarint():2===t?function(t,e){const r=t.readVarint()+t.pos;for(;t.pos<r;){const r=e._keys[t.readVarint()],n=e._values[t.readVarint()];e.properties[r]=n}}(r,e):3===t?e.type=r.readVarint():4===t&&(e._geometry=r.pos)}class jo{constructor(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(Do,this,e),this.length=this._features.length}feature(t,e){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];const r=this._pbf.readVarint()+this._pbf.pos;return new ko(this._pbf,r,this.extent,this._keys,this._values,e)}}function Do(t,e,r){15===t?e.version=r.readVarint():1===t?e.name=r.readString():5===t?e.extent=r.readVarint():2===t?e._features.push(r.pos):3===t?e._keys.push(r.readString()):4===t&&e._values.push(function(t){let e=null;const r=t.readVarint()+t.pos;for(;t.pos<r;){const e=t.readVarint()>>3;1===e?t.readString():2===e?t.readFloat():3===e?t.readDouble():4===e?t.readVarint64():5===e?t.readVarint():6===e?t.readSVarint():7===e?t.readBoolean():null}return e}(r))}class Bo{constructor(t,e){this.layers=t.readFields(Fo,{},e)}}function Fo(t,e,r){if(3===t){const t=new jo(r,r.readVarint()+r.pos);t.length&&(e[t.name]=t)}}function zo(t){const e={};for(const n of t)if(n.properties)for(const t in n.properties){const i=e[t];if(i||void 0===i){const i=n.properties[t];e[t]=(i,Number.isFinite(r))}}var r;return Object.keys(e).filter(t=>e[t])}function No(t,e={},r={}){const{pointPositionsCount:n,pointFeaturesCount:i,linePositionsCount:o,linePathsCount:a,lineFeaturesCount:s,polygonPositionsCount:u,polygonObjectsCount:c,polygonRingsCount:l,polygonFeaturesCount:h}=e,{numericPropKeys:f,PositionDataType:p=Float32Array}=r,d=t[0]&&"id"in t[0],A=t.length>65535?Uint32Array:Uint16Array,g={positions:new p(2*n),globalFeatureIds:new A(n),featureIds:i>65535?new Uint32Array(n):new Uint16Array(n),numericProps:{},properties:[],fields:[]},m={pathIndices:o>65535?new Uint32Array(a+1):new Uint16Array(a+1),positions:new p(2*o),globalFeatureIds:new A(o),featureIds:s>65535?new Uint32Array(o):new Uint16Array(o),numericProps:{},properties:[],fields:[]},y={polygonIndices:u>65535?new Uint32Array(c+1):new Uint16Array(c+1),primitivePolygonIndices:u>65535?new Uint32Array(l+1):new Uint16Array(l+1),positions:new p(2*u),triangles:[],globalFeatureIds:new A(u),featureIds:h>65535?new Uint32Array(u):new Uint16Array(u),numericProps:{},properties:[],fields:[]};for(const t of[g,m,y])for(const e of f)t.numericProps[e]=new Float32Array(t.positions.length/2);m.pathIndices[a]=o,y.polygonIndices[c]=u,y.primitivePolygonIndices[l]=u;const v={pointPosition:0,pointFeature:0,linePosition:0,linePath:0,lineFeature:0,polygonPosition:0,polygonObject:0,polygonRing:0,polygonFeature:0,feature:0};for(const e of t){const t=e.geometry,r=e.properties||{};switch(t.type){case"Point":case"MultiPoint":Uo(t,g,v,2,r),g.properties.push(qo(r,f)),d&&g.fields.push({id:e.id}),v.pointFeature++;break;case"LineString":case"MultiLineString":Vo(t,m,v,2,r),m.properties.push(qo(r,f)),d&&m.fields.push({id:e.id}),v.lineFeature++;break;case"Polygon":case"MultiPolygon":Go(t,y,v,2,r),y.properties.push(qo(r,f)),d&&y.fields.push({id:e.id}),v.polygonFeature++;break;default:throw new Error("Invalid geometry type")}v.feature++}return function(t,e,r,n){const i={points:{...t,positions:{value:t.positions,size:n},globalFeatureIds:{value:t.globalFeatureIds,size:1},featureIds:{value:t.featureIds,size:1}},lines:{...e,pathIndices:{value:e.pathIndices,size:1},positions:{value:e.positions,size:n},globalFeatureIds:{value:e.globalFeatureIds,size:1},featureIds:{value:e.featureIds,size:1}},polygons:{...r,polygonIndices:{value:r.polygonIndices,size:1},primitivePolygonIndices:{value:r.primitivePolygonIndices,size:1},positions:{value:r.positions,size:n},triangles:{value:new Uint32Array(r.triangles),size:1},globalFeatureIds:{value:r.globalFeatureIds,size:1},featureIds:{value:r.featureIds,size:1}}};for(const t in i)for(const e in i[t].numericProps)i[t].numericProps[e]={value:i[t].numericProps[e],size:1};return i}(g,m,y,2)}function Uo(t,e,r,n,i){e.positions.set(t.data,r.pointPosition*n);const o=t.data.length/n;Ho(e,i,r.pointPosition,o),e.globalFeatureIds.fill(r.feature,r.pointPosition,r.pointPosition+o),e.featureIds.fill(r.pointFeature,r.pointPosition,r.pointPosition+o),r.pointPosition+=o}function Vo(t,e,r,n,i){e.positions.set(t.data,r.linePosition*n);const o=t.data.length/n;Ho(e,i,r.linePosition,o),e.globalFeatureIds.fill(r.feature,r.linePosition,r.linePosition+o),e.featureIds.fill(r.lineFeature,r.linePosition,r.linePosition+o);for(let i=0,o=t.lines.length;i<o;++i){const a=t.lines[i],s=i===o-1?t.data.length:t.lines[i+1];e.pathIndices[r.linePath++]=r.linePosition,r.linePosition+=(s-a)/n}}function Go(t,e,r,n,i){e.positions.set(t.data,r.polygonPosition*n);const o=t.data.length/n;Ho(e,i,r.polygonPosition,o),e.globalFeatureIds.fill(r.feature,r.polygonPosition,r.polygonPosition+o),e.featureIds.fill(r.polygonFeature,r.polygonPosition,r.polygonPosition+o);for(let i=0,o=t.lines.length;i<o;++i){const o=r.polygonPosition;e.polygonIndices[r.polygonObject++]=o;const a=t.areas[i],s=t.lines[i],u=t.lines[i+1];for(let i=0,o=s.length;i<o;++i){const a=s[i],c=i===o-1?void 0===u?t.data.length:u[0]:s[i+1];e.primitivePolygonIndices[r.polygonRing++]=r.polygonPosition,r.polygonPosition+=(c-a)/n}Wo(e,a,s,{startPosition:o,endPosition:r.polygonPosition,coordLength:n})}}function Wo(t,e,r,{startPosition:n,endPosition:i,coordLength:o}){const a=n*o,s=i*o,u=t.positions.subarray(a,s),c=r[0],l=r.slice(1).map(t=>(t-c)/o),h=Object(Eo.f)(u,l,o,e);for(let e=0,r=h.length;e<r;++e)t.triangles.push(n+h[e])}function Ho(t,e,r,n){for(const i in t.numericProps)i in e&&t.numericProps[i].fill(e[i],r,r+n)}function qo(t,e){const r={};for(const n in t)e.includes(n)||(r[n]=t[n]);return r}var Zo=r(193),Xo=r.n(Zo);function Qo(t,e){const r="binary"===function(t){const e="wgs84"==={...t,mvt:t.mvt||{},gis:t.gis||{}}.coordinates,{tileIndex:r}=t,n=r&&Number.isFinite(r.x)&&Number.isFinite(r.y)&&Number.isFinite(r.z);if(e&&!n)throw new Error("MVT Loader: WGS84 coordinates need tileIndex property. Check documentation.");return t}(e).gis.format,n=[],i={pointPositionsCount:0,pointFeaturesCount:0,linePositionsCount:0,linePathsCount:0,lineFeaturesCount:0,polygonPositionsCount:0,polygonObjectsCount:0,polygonRingsCount:0,polygonFeaturesCount:0};if(t.byteLength>0){const o=r?new Bo(new Xo.a(t)):new xo(new Xo.a(t)),a=e.mvt;(Array.isArray(a.layers)?a.layers:Object.keys(o.layers)).forEach(t=>{const e=o.layers[t],s={...a,layerName:t};if(e)for(let t=0;t<e.length;t++){const o=e.feature(t,i),a=r?Ko(o,s):Yo(o,s);n.push(a)}})}if(r){const r=function(t,e,r={}){return No(t,e,{numericPropKeys:r.numericPropKeys||zo(t),PositionDataType:r.PositionDataType||Float32Array})}(n,i,e.gis);return r.byteLength=t.byteLength,r}return n}function Yo(t,e={}){const r=t.toGeoJSON("wgs84"===e.coordinates?e.tileIndex:$o);return e.layerProperty&&(r.properties[e.layerProperty]=e.layerName),r}function Ko(t,e={}){const r=t.toBinaryCoordinates("wgs84"===e.coordinates?e.tileIndex:Jo);return e.layerProperty&&(r.properties[e.layerProperty]=e.layerName),r}function $o(t,e){const{extent:r}=e;for(let e=0;e<t.length;e++){const n=t[e];n[0]/=r,n[1]/=r}}function Jo(t,e){const{extent:r}=e;for(let e=0,n=t.length;e<n;++e)t[e]/=r}const ta={name:"Mapbox Vector Tile",id:"mvt",module:"mvt",version:"3.0.8",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 ea(t,e){const r=null==e?void 0:e.globalFeatureId;return void 0!==r?function(t,e){const r=ia(t);for(const t of r){let r=0,n=t.featureIds.value[0];for(let i=0;i<t.featureIds.value.length;i++){const o=t.featureIds.value[i];if(o!==n){if(e===t.globalFeatureIds.value[r])return oa(t,r,i);r=i,n=o}}if(e===t.globalFeatureIds.value[r])return oa(t,r,t.featureIds.value.length)}throw new Error(`featureId:${e} not found`)}(t,r):ra(t,null==e?void 0:e.type)}function ra(t,e){return function(t){const e=[];for(const r of t){if(0===r.featureIds.value.length)continue;let t=0,n=r.featureIds.value[0];for(let i=0;i<r.featureIds.value.length;i++){const o=r.featureIds.value[i];o!==n&&(e.push(oa(r,t,i)),t=i,n=o)}e.push(oa(r,t,r.featureIds.value.length))}return e}(ia(t,e))}function na(t,e,r){switch(t.type){case"Point":return function(t,e,r){const{positions:n}=t,i=aa(n,e,r);if(i.length>1)return{type:"MultiPoint",coordinates:i};return{type:"Point",coordinates:i[0]}}(t,e,r);case"LineString":return function(t,e=-1/0,r=1/0){const{positions:n}=t,i=t.pathIndices.value.filter(t=>t>=e&&t<=r);if(!(i.length>2)){return{type:"LineString",coordinates:aa(n,i[0],i[1])}}const o=[];for(let t=0;t<i.length-1;t++){const e=aa(n,i[t],i[t+1]);o.push(e)}return{type:"MultiLineString",coordinates:o}}(t,e,r);case"Polygon":return function t(e,r=-1/0,n=1/0){const{positions:i}=e,o=e.polygonIndices.value.filter(t=>t>=r&&t<=n),a=e.primitivePolygonIndices.value.filter(t=>t>=r&&t<=n);if(!(o.length>2)){const t=[];for(let e=0;e<a.length-1;e++){const r=a[e],n=a[e+1],o=aa(i,r,n);t.push(o)}return{type:"Polygon",coordinates:t}}const s=[];for(let r=0;r<o.length-1;r++){const n=o[r],i=o[r+1],a=t(e,n,i).coordinates;s.push(a)}return{type:"MultiPolygon",coordinates:s}}(t,e,r);default:const n=t;throw new Error(`Unsupported geometry type: ${null==n?void 0:n.type}`)}}function ia(t,e){if(!Boolean(t.points||t.lines||t.polygons))return t.type=e||function(t){if(t.pathIndices)return"LineString";if(t.polygonIndices)return"Polygon";return"Point"}(t),[t];const r=[];return t.points&&(t.points.type="Point",r.push(t.points)),t.lines&&(t.lines.type="LineString",r.push(t.lines)),t.polygons&&(t.polygons.type="Polygon",r.push(t.polygons)),r}function oa(t,e,r){return{type:"Feature",geometry:na(t,e,r),properties:function(t,e=0,r){const n=Object.assign({},t.properties[t.featureIds.value[e]]);for(const r in t.numericProps)n[r]=t.numericProps[r].value[e];return n}(t,e),...function(t,e=0,r){return t.fields&&t.fields[t.featureIds.value[e]]}(t,e)}}function aa(t,e,r){e=e||0,r=r||t.value.length/t.size;const n=[];for(let i=e;i<r;i++){const e=Array();for(let r=i*t.size;r<(i+1)*t.size;r++)e.push(Number(t.value[r]));n.push(e)}return n}var sa=r(208);function ua(t){var e=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(t){return!1}}();return function(){var r,n=l()(t);if(e){var i=l()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return u()(this,r)}}var ca={clipBounds:[0,0,1,1]},la="\nuniform vec4 clip_bounds;\n\nbool clip_isInBounds(vec2 position) {\n return position.x >= clip_bounds[0] && position.y >= clip_bounds[1] && position.x < clip_bounds[2] && position.y < clip_bounds[3];\n}\n",ha={name:"clip-vs",vs:la},fa={"vs:#decl":"\nvarying float clip_isVisible;\n","vs:DECKGL_FILTER_GL_POSITION":"\n clip_isVisible = float(clip_isInBounds(geometry.worldPosition.xy));\n","fs:#decl":"\nvarying float clip_isVisible;\n","fs:DECKGL_FILTER_COLOR":"\n if (clip_isVisible < 0.5) discard;\n"},pa={name:"clip-fs",fs:la},da={"vs:#decl":"\nvarying vec2 clip_commonPosition;\n","vs:DECKGL_FILTER_GL_POSITION":"\n clip_commonPosition = geometry.position.xy;\n","fs:#decl":"\nvarying vec2 clip_commonPosition;\n","fs:DECKGL_FILTER_COLOR":"\n if (!clip_isInBounds(clip_commonPosition)) discard;\n"},Aa=function(t){a()(r,t);var e=ua(r);function r(){return i()(this,r),e.apply(this,arguments)}return d()(r,[{key:"getShaders",value:function(){var t="instancePositions"in this.getAttributeManager().attributes;return"clipByInstance"in this.props&&(t=this.props.clipByInstance),this.state.clipByInstance=t,t?{modules:[ha],inject:fa}:{modules:[pa],inject:da}}},{key:"draw",value:function(t){var e=t.uniforms,r=this.props.clipBounds,n=void 0===r?ca.clipBounds:r;if(this.state.clipByInstance)e.clip_bounds=n;else{var i=this.projectPosition([n[0],n[1],0]),o=this.projectPosition([n[2],n[3],0]);e.clip_bounds=[Math.min(i[0],o[0]),Math.min(i[1],o[1]),Math.max(i[0],o[0]),Math.max(i[1],o[1])]}}}]),r}(sa.a);function ga(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ma(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ga(Object(r),!0).forEach((function(e){g()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ga(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}Aa.extensionName="ClipExtension",Aa.defaultProps=ca;var ya={Point:va,MultiPoint:function(t,e,r){return _a(t,e,r)},LineString:ba,MultiLineString:function(t,e,r){return t.map((function(t){return ba(t,e,r)}))},Polygon:xa,MultiPolygon:function(t,e,r){return t.map((function(t){return xa(t,e,r)}))}};function va(t,e,r){var n=_()(t,2),i=n[0],o=n[1],a=_()(e,2),s=a[0],u=a[1],c=Object(fe.f)(s[0],u[0],i),l=Object(fe.f)(s[1],u[1],o);return r.unprojectFlat([c,l])}function _a(t,e,r){return t.map((function(t){return va(t,e,r)}))}function ba(t,e,r){return _a(t,e,r)}function xa(t,e,r){return t.map((function(t){return _a(t,e,r)}))}function wa(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Ea(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ea(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Ea(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var Sa=["points","lines","polygons"];function Oa(t,e,r,n){var i=t.featureIds.value;if(!i.length)return-1;var o=0,a=i[i.length-1]+1;if(n){var s=function(t,e){if(!t.__layers){for(var r={},n=t.properties,i=0;i<n.length;i++){var o=n[i].layerName;o&&(r[o]?r[o][1]=i:r[o]=[i,i])}t.__layers=r}return t.__layers[e]}(t,n);if(!s)return-1;o=s[0],a=s[1]+1}var u=-1;if(e in t.numericProps){var c=t.numericProps[e].value.findIndex((function(t,e){return t===r&&i[e]>=o&&i[e]<a}));return c>=0?t.globalFeatureIds.value[c]:-1}return(u=e?Ta(t.properties,(function(t){return t[e]===r}),o,a):Ta(t.fields,(function(t){return t.id===r}),o,a))>=0?function(t,e){if(!t.__ids){for(var r=[],n=t.featureIds.value,i=t.globalFeatureIds.value,o=0;o<n.length;o++)r[n[o]]=i[o];t.__ids=r}return t.__ids[e]}(t,u):-1}function Ta(t,e,r,n){for(var i=r;i<n;i++)if(e(t[i],i))return i;return-1}function Pa(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Ma(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ma(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Ma(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ca(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Ia(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ca(Object(r),!0).forEach((function(e){g()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ca(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ka(t){var e=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(t){return!1}}();return function(){var r,n=l()(t);if(e){var i=l()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return u()(this,r)}}var Ra={uniqueIdProperty:{type:"string",value:""},highlightedFeatureId:null,loaders:[ta],binary:!0},La=function(t){a()(n,t);var e,r=ka(n);function n(){return i()(this,n),r.apply(this,arguments)}return d()(n,[{key:"initializeState",value:function(){Se()(l()(n.prototype),"initializeState",this).call(this),this.setState({data:null,tileJSON:null})}},{key:"updateState",value:function(t){var e=t.props,r=t.oldProps,i=t.context,o=t.changeFlags;o.dataChanged&&this._updateTileData(),this.state.data&&(Se()(l()(n.prototype),"updateState",this).call(this,{props:e,oldProps:r,context:i,changeFlags:o}),this._setWGS84PropertyForTiles())}},{key:"_updateTileData",value:(e=U()(z.a.mark((function t(){var e,r,n,i,o;return z.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=this.props.data,r=null,"string"!=typeof e||/(?=.*{z})(?=.*{x})(?=.*({y}|{-y}))/.test(e)){t.next=18;break}return n=this.props,i=n.onDataLoad,o=n.fetch,this.setState({data:null,tileJSON:null}),t.prev=5,t.next=8,o(e,{propName:"data",layer:this,loaders:[]});case 8:r=t.sent,t.next=15;break;case 11:t.prev=11,t.t0=t.catch(5),this.raiseError(t.t0,"loading TileJSON"),e=null;case 15:i&&i(r),t.next=19;break;case 18:e.tilejson&&(r=e);case 19:r&&(e=r.tiles),this.setState({data:e,tileJSON:r});case 21:case"end":return t.stop()}}),t,this,[[5,11]])}))),function(){return e.apply(this,arguments)})},{key:"_getTilesetOptions",value:function(t){var e=Se()(l()(n.prototype),"_getTilesetOptions",this).call(this,t),r=this.state.tileJSON;return r&&(Number.isFinite(r.minzoom)&&r.minzoom>t.minZoom&&(e.minZoom=r.minzoom),Number.isFinite(r.maxzoom)&&(!Number.isFinite(t.maxZoom)||r.maxzoom<t.maxZoom)&&(e.maxZoom=r.maxzoom)),e}},{key:"renderLayers",value:function(){return this.state.data?Se()(l()(n.prototype),"renderLayers",this).call(this):null}},{key:"getTileData",value:function(t){var e,r=ie(this.state.data,t);if(!r)return Promise.reject("Invalid URL");var n=this.getLoadOptions(),i=this.props,o=i.binary,a=i.fetch,s=t.signal,u=t.x,c=t.y,l=t.z;return a(r,{propName:"data",layer:this,loadOptions:n=Ia(Ia({},n),{},{mimeType:"application/x-protobuf",mvt:Ia(Ia({},null===(e=n)||void 0===e?void 0:e.mvt),{},{coordinates:this.context.viewport.resolution?"wgs84":"local",tileIndex:{x:u,y:c,z:l}}),gis:o?{format:"binary"}:{}}),signal:s})}},{key:"renderSubLayers",value:function(t){var e=t.tile,r=Math.pow(2,e.z),i=512/r,o=-i,a=512*e.x/r,s=512*(1-e.y/r),u=(new fe.a).scale([i,o,1]);t.autoHighlight=!1,this.context.viewport.resolution||(t.modelMatrix=u,t.coordinateOrigin=[a,s,0],t.coordinateSystem=Tr.a.CARTESIAN,t.extensions=[].concat(H()(t.extensions||[]),[new Aa]));var c=Se()(l()(n.prototype),"renderSubLayers",this).call(this,t);return!this.props.binary||c instanceof B.a||V.a.warn("renderSubLayers() must return GeoJsonLayer when using binary:true")(),c}},{key:"_updateAutoHighlight",value:function(t){var e,r,n=this.props.uniqueIdProperty,i=this.state,o=i.hoveredFeatureId,a=i.hoveredFeatureLayerName,s=t.object;s&&(e=ja(s,n),r=Da(s)),o===e&&a===r||this.setState({hoveredFeatureId:e,hoveredFeatureLayerName:r})}},{key:"getPickingInfo",value:function(t){var e=Se()(l()(n.prototype),"getPickingInfo",this).call(this,t),r=this.context.viewport.resolution;if(this.props.binary&&-1!==e.index){var i=t.sourceLayer.props.data;e.object=ea(i,{globalFeatureId:e.index})}return e.object&&!r&&(e.object=Fa(e.object,e.tile.bbox,this.context.viewport)),e}},{key:"getHighlightedObjectIndex",value:function(t){var e=this.state,r=e.hoveredFeatureId,n=e.hoveredFeatureLayerName,i=this.props,o=i.uniqueIdProperty,a=i.highlightedFeatureId,s=i.binary,u=t.content,c=Ba(a);if(!(Ba(r)||c))return-1;var l=c?a:r;return Array.isArray(u)?u.findIndex((function(t){var e=ja(t,o)===l,r=c||Da(t)===n;return e&&r})):u&&s?function(t,e,r,n){var i,o=wa(Sa);try{for(o.s();!(i=o.n()).done;){var a=i.value,s=t[a]&&Oa(t[a],e,r,n);if(s>=0)return s}}catch(t){o.e(t)}finally{o.f()}return-1}(u,o,l,c?"":n):-1}},{key:"_pickObjects",value:function(t){var e=this.context,r=e.deck,n=e.viewport,i=n.width,o=n.height,a=n.x,s=n.y,u=[this.id];return r.pickObjects({x:a,y:s,width:i,height:o,layerIds:u,maxObjects:t})}},{key:"getRenderedFeatures",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=this._pickObjects(e),n=new Set,i=[],o=Pa(r);try{for(o.s();!(t=o.n()).done;){var a=t.value,s=ja(a.object,this.props.uniqueIdProperty);void 0===s?i.push(a.object):n.has(s)||(n.add(s),i.push(a.object))}}catch(t){o.e(t)}finally{o.f()}return i}},{key:"_setWGS84PropertyForTiles",value:function(){var t=this;this.state.tileset.selectedTiles.forEach((function(e){e.hasOwnProperty("dataInWGS84")||Object.defineProperty(e,"dataInWGS84",{get:function(){if(!e.content)return null;if(t.props.binary&&Array.isArray(e.content)&&!e.content.length)return[];if(void 0===e._contentWGS84){var r=t.props.binary?ea(e.content):e.content;e._contentWGS84=r.map((function(r){return Fa(r,e.bbox,t.context.viewport)}))}return e._contentWGS84}})}))}},{key:"isLoaded",get:function(){return this.state.data&&this.state.tileset&&Se()(l()(n.prototype),"isLoaded",this)}}]),n}(we);function ja(t,e){return e?t.properties[e]:"id"in t?t.id:void 0}function Da(t){var e;return(null===(e=t.properties)||void 0===e?void 0:e.layerName)||null}function Ba(t){return null!=t&&""!==t}function Fa(t,e,r){var n=Ia(Ia({},t),{},{geometry:{type:t.geometry.type}});return Object.defineProperty(n.geometry,"coordinates",{get:function(){return function(t,e,r){var n=[r.projectFlat([e.west,e.north]),r.projectFlat([e.east,e.south])];return ma(ma({},t),{},{coordinates:ya[t.type](t.coordinates,n,r)})}(t.geometry,e,r).coordinates}}),n}La.layerName="MVTLayer",La.defaultProps=Ra,r.d(e,"GreatCircleLayer",(function(){return f})),r.d(e,"S2Layer",(function(){return j})),r.d(e,"TileLayer",(function(){return we})),r.d(e,"TripsLayer",(function(){return Me})),r.d(e,"H3ClusterLayer",(function(){return hr})),r.d(e,"H3HexagonLayer",(function(){return Sr})),r.d(e,"Tile3DLayer",(function(){return oo})),r.d(e,"TerrainLayer",(function(){return go})),r.d(e,"MVTLayer",(function(){return La}))},function(t,e,r){"use strict";r.r(e);var n=r(2),i=r.n(n),o=r(3),a=r.n(o),s=r(8),u=r.n(s),c=r(5),l=r.n(c),h=r(6),f=r.n(h),p=r(1),d=r.n(p),A=r(0),g=r.n(A),m=r(18),y=r(179),v=r(240),_=r(7),b=r(197),x=r(176),w=r(294);function E(t,e=[],r=0){const n=Math.fround(t),i=t-n;return e[r]=n,e[r+1]=i,e}function S(t){return t-Math.fround(t)}function O(t){const e=new Float32Array(32);for(let r=0;r<4;++r)for(let n=0;n<4;++n){const i=4*r+n;E(t[4*n+r],e,2*i)}return e}const T={ONE:1};const P={name:"fp64-arithmetic",vs:"uniform float ONE;\nvec2 split(float a) {\n const float SPLIT = 4097.0;\n float t = a * SPLIT;\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float a_hi = t * ONE - (t - a);\n float a_lo = a * ONE - a_hi;\n#else\n float a_hi = t - (t - a);\n float a_lo = a - a_hi;\n#endif\n return vec2(a_hi, a_lo);\n}\nvec2 split2(vec2 a) {\n vec2 b = split(a.x);\n b.y += a.y;\n return b;\n}\nvec2 quickTwoSum(float a, float b) {\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float sum = (a + b) * ONE;\n float err = b - (sum - a) * ONE;\n#else\n float sum = a + b;\n float err = b - (sum - a);\n#endif\n return vec2(sum, err);\n}\nvec2 twoSum(float a, float b) {\n float s = (a + b);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float v = (s * ONE - a) * ONE;\n float err = (a - (s - v) * ONE) * ONE * ONE * ONE + (b - v);\n#else\n float v = s - a;\n float err = (a - (s - v)) + (b - v);\n#endif\n return vec2(s, err);\n}\n\nvec2 twoSub(float a, float b) {\n float s = (a - b);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float v = (s * ONE - a) * ONE;\n float err = (a - (s - v) * ONE) * ONE * ONE * ONE - (b + v);\n#else\n float v = s - a;\n float err = (a - (s - v)) - (b + v);\n#endif\n return vec2(s, err);\n}\n\nvec2 twoSqr(float a) {\n float prod = a * a;\n vec2 a_fp64 = split(a);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float err = ((a_fp64.x * a_fp64.x - prod) * ONE + 2.0 * a_fp64.x *\n a_fp64.y * ONE * ONE) + a_fp64.y * a_fp64.y * ONE * ONE * ONE;\n#else\n float err = ((a_fp64.x * a_fp64.x - prod) + 2.0 * a_fp64.x * a_fp64.y) + a_fp64.y * a_fp64.y;\n#endif\n return vec2(prod, err);\n}\n\nvec2 twoProd(float a, float b) {\n float prod = a * b;\n vec2 a_fp64 = split(a);\n vec2 b_fp64 = split(b);\n float err = ((a_fp64.x * b_fp64.x - prod) + a_fp64.x * b_fp64.y +\n a_fp64.y * b_fp64.x) + a_fp64.y * b_fp64.y;\n return vec2(prod, err);\n}\n\nvec2 sum_fp64(vec2 a, vec2 b) {\n vec2 s, t;\n s = twoSum(a.x, b.x);\n t = twoSum(a.y, b.y);\n s.y += t.x;\n s = quickTwoSum(s.x, s.y);\n s.y += t.y;\n s = quickTwoSum(s.x, s.y);\n return s;\n}\n\nvec2 sub_fp64(vec2 a, vec2 b) {\n vec2 s, t;\n s = twoSub(a.x, b.x);\n t = twoSub(a.y, b.y);\n s.y += t.x;\n s = quickTwoSum(s.x, s.y);\n s.y += t.y;\n s = quickTwoSum(s.x, s.y);\n return s;\n}\n\nvec2 mul_fp64(vec2 a, vec2 b) {\n vec2 prod = twoProd(a.x, b.x);\n prod.y += a.x * b.y;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n prod = split2(prod);\n#endif\n prod = quickTwoSum(prod.x, prod.y);\n prod.y += a.y * b.x;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n prod = split2(prod);\n#endif\n prod = quickTwoSum(prod.x, prod.y);\n return prod;\n}\n\nvec2 div_fp64(vec2 a, vec2 b) {\n float xn = 1.0 / b.x;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n vec2 yn = mul_fp64(a, vec2(xn, 0));\n#else\n vec2 yn = a * xn;\n#endif\n float diff = (sub_fp64(a, mul_fp64(b, yn))).x;\n vec2 prod = twoProd(xn, diff);\n return sum_fp64(yn, prod);\n}\n\nvec2 sqrt_fp64(vec2 a) {\n if (a.x == 0.0 && a.y == 0.0) return vec2(0.0, 0.0);\n if (a.x < 0.0) return vec2(0.0 / 0.0, 0.0 / 0.0);\n\n float x = 1.0 / sqrt(a.x);\n float yn = a.x * x;\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n vec2 yn_sqr = twoSqr(yn) * ONE;\n#else\n vec2 yn_sqr = twoSqr(yn);\n#endif\n float diff = sub_fp64(a, yn_sqr).x;\n vec2 prod = twoProd(x * 0.5, diff);\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n return sum_fp64(split(yn), prod);\n#else\n return sum_fp64(vec2(yn, 0.0), prod);\n#endif\n}\n",fs:null,getUniforms:function(){return T},fp64ify:E,fp64LowPart:S,fp64ifyMatrix4:O};var M,C,I=r(153),k=r(207),R={SUM:1,MEAN:2,MIN:3,MAX:4};function L(t,e){return t+e}function j(t,e){return e>t?e:t}function D(t,e){return e<t?e:t}function B(t,e,r){var n=R[t]||R.SUM;switch(e=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Number.isFinite(t))return t;return function(r){return e.index=r.index,t(r.source,e)}}(e,r),n){case R.MIN:return function(t){return function(t,e){if(Number.isFinite(e))return t.length?e:null;var r=t.map(e).filter(Number.isFinite);return r.length?r.reduce(D,1/0):null}(t,e)};case R.SUM:return function(t){return function(t,e){if(Number.isFinite(e))return t.length?t.length*e:null;var r=t.map(e).filter(Number.isFinite);return r.length?r.reduce(L,0):null}(t,e)};case R.MEAN:return function(t){return function(t,e){if(Number.isFinite(e))return t.length?e:null;var r=t.map(e).filter(Number.isFinite);return r.length?r.reduce(L,0)/r.length:null}(t,e)};case R.MAX:return function(t){return function(t,e){if(Number.isFinite(e))return t.length?e:null;var r=t.map(e).filter(Number.isFinite);return r.length?r.reduce(j,-1/0):null}(t,e)};default:return null}}function F(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(r){return e.indices=r.map((function(t){return t.index})),t(r.map((function(t){return t.source})),e)}}var z,N={projectPoints:!1,viewport:null,createBufferObjects:!0,moduleSettings:{}},U=[32775,32774],V=[32776,32774],G=[32776,32775],W=(M={},g()(M,R.SUM,32774),g()(M,R.MEAN,32774),g()(M,R.MIN,U),g()(M,R.MAX,V),M),H={size:1,operation:R.SUM,needMin:!1,needMax:!1,combineMaxMin:!1},q=(C={},g()(C,10240,9728),g()(C,10241,9728),r(98)),Z=r(71),X=(z={},g()(z,10240,9728),g()(z,10241,9728),z);function Q(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.width,n=void 0===r?1:r,i=e.height,o=void 0===i?1:i,a=e.data,s=void 0===a?null:a,u=e.unpackFlipY,c=void 0===u||u,l=e.parameters,h=void 0===l?X:l,f=new q.a(t,{data:s,format:Object(_.j)(t)?34836:6408,type:5126,border:0,mipmaps:!1,parameters:h,dataFormat:6408,width:n,height:o,unpackFlipY:c});return f}function Y(t,e){var r=e.id,n=e.width,i=void 0===n?1:n,o=e.height,a=void 0===o?1:o,s=e.texture;return new Z.a(t,{id:r,width:i,height:a,attachments:g()({},36064,s)})}function K(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return $(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return $(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function $(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function J(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function tt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?J(Object(r),!0).forEach((function(e){g()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):J(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var et=["aggregationBuffer","maxMinBuffer","minBuffer","maxBuffer"],rt={maxData:"maxBuffer",minData:"minBuffer",maxMinData:"maxMinBuffer"},nt=[y.a.WEBGL2,y.a.COLOR_ATTACHMENT_RGBA32F,y.a.BLEND_EQUATION_MINMAX,y.a.FLOAT_BLEND,y.a.TEXTURE_FLOAT],it=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i()(this,t),this.id=r.id||"gpu-grid-aggregator",this.gl=e,this.state={weightAttributes:{},textures:{},meanTextures:{},buffers:{},framebuffers:{},maxMinFramebuffers:{},minFramebuffers:{},maxFramebuffers:{},equations:{},resources:{},results:{}},this._hasGPUSupport=Object(_.j)(e)&&Object(v.c)(this.gl,y.a.BLEND_EQUATION_MINMAX,y.a.COLOR_ATTACHMENT_RGBA32F,y.a.TEXTURE_FLOAT),this._hasGPUSupport&&this._setupModels()}return a()(t,null,[{key:"getAggregationData",value:function(t){var e=t.aggregationData,r=t.maxData,n=t.minData,i=t.maxMinData,o=4*t.pixelIndex,a={};return e&&(a.cellCount=e[o+3],a.cellWeight=e[o]),i?(a.maxCellWieght=i[0],a.minCellWeight=i[3]):(r&&(a.maxCellWieght=r[0],a.totalCount=r[3]),n&&(a.minCellWeight=n[0],a.totalCount=r[3])),a}},{key:"getCellData",value:function(t){for(var e=t.countsData,r=t.size,n=void 0===r?1:r,i=e.length/4,o=new Float32Array(i*n),a=new Uint32Array(i),s=0;s<i;s++){for(var u=0;u<n;u++)o[s*n+u]=e[4*s+u];a[s]=e[4*s+3]}return{cellCounts:a,cellWeights:o}}},{key:"isSupported",value:function(t){return Object(v.c)(t,nt)}}]),a()(t,[{key:"delete",value:function(){var t=this.gridAggregationModel,e=this.allAggregationModel,r=this.meanTransform,n=this.state,i=n.textures,o=n.framebuffers,a=n.maxMinFramebuffers,s=n.minFramebuffers,u=n.maxFramebuffers,c=n.meanTextures,l=n.resources;null==t||t.delete(),null==e||e.delete(),null==r||r.delete(),function(t){(t=Array.isArray(t)?t:[t]).forEach((function(t){for(var e in t)t[e].delete()}))}([o,i,a,s,u,c,l])}},{key:"run",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.setState({results:{}});var e=this._normalizeAggregationParams(t);return this._hasGPUSupport||m.a.log(1,"GPUGridAggregator: not supported")(),this._runAggregation(e)}},{key:"getData",value:function(t){var e={},r=this.state.results;for(var n in r[t].aggregationData||(r[t].aggregationData=r[t].aggregationBuffer.getData()),e.aggregationData=r[t].aggregationData,rt){var i=rt[n];(r[t][n]||r[t][i])&&(r[t][n]=r[t][n]||r[t][i].getData(),e[n]=r[t][n])}return e}},{key:"updateShaders",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.setState({shaderOptions:t,modelDirty:!0})}},{key:"_normalizeAggregationParams",value:function(t){var e=tt(tt({},N),t),r=e.weights;return r&&(e.weights=function(t){var e={};for(var r in t)e[r]=tt(tt({},H),t[r]);return e}(r)),e}},{key:"setState",value:function(t){Object.assign(this.state,t)}},{key:"_getAggregateData",value:function(t){var e={},r=this.state,n=r.textures,i=r.framebuffers,o=r.maxMinFramebuffers,a=r.minFramebuffers,s=r.maxFramebuffers,u=r.resources,c=t.weights;for(var l in c){e[l]={};var h=c[l],f=h.needMin,p=h.needMax,d=h.combineMaxMin;e[l].aggregationTexture=n[l],e[l].aggregationBuffer=Object(b.d)(i[l],{target:c[l].aggregationBuffer,sourceType:5126}),f&&p&&d?(e[l].maxMinBuffer=Object(b.d)(o[l],{target:c[l].maxMinBuffer,sourceType:5126}),e[l].maxMinTexture=u["".concat(l,"-maxMinTexture")]):(f&&(e[l].minBuffer=Object(b.d)(a[l],{target:c[l].minBuffer,sourceType:5126}),e[l].minTexture=u["".concat(l,"-minTexture")]),p&&(e[l].maxBuffer=Object(b.d)(s[l],{target:c[l].maxBuffer,sourceType:5126}),e[l].maxTexture=u["".concat(l,"-maxTexture")]))}return this._trackGPUResultBuffers(e,c),e}},{key:"_renderAggregateData",value:function(t){var e=t.cellSize,r=t.projectPoints,n=t.attributes,i=t.moduleSettings,o=t.numCol,a=t.numRow,s=t.weights,u=t.translation,c=t.scaling,l=this.state,h=l.maxMinFramebuffers,f=l.minFramebuffers,p=l.maxFramebuffers,d=[o,a],A={blend:!0,depthTest:!1,blendFunc:[1,1]},g={cellSize:e,gridSize:d,projectPoints:r,translation:u,scaling:c};for(var m in s){var y=s[m],v=y.needMin,_=y.needMax,b=v&&_&&s[m].combineMaxMin;this._renderToWeightsTexture({id:m,parameters:A,moduleSettings:i,uniforms:g,gridSize:d,attributes:n,weights:s}),b?this._renderToMaxMinTexture({id:m,parameters:tt(tt({},A),{},{blendEquation:G}),gridSize:d,minOrMaxFb:h[m],clearParams:{clearColor:[0,0,0,3402823466e29]},combineMaxMin:b}):(v&&this._renderToMaxMinTexture({id:m,parameters:tt(tt({},A),{},{blendEquation:U}),gridSize:d,minOrMaxFb:f[m],clearParams:{clearColor:[3402823466e29,3402823466e29,3402823466e29,0]},combineMaxMin:b}),_&&this._renderToMaxMinTexture({id:m,parameters:tt(tt({},A),{},{blendEquation:V}),gridSize:d,minOrMaxFb:p[m],clearParams:{clearColor:[0,0,0,0]},combineMaxMin:b}))}}},{key:"_renderToMaxMinTexture",value:function(t){var e=t.id,r=t.parameters,n=t.gridSize,i=t.minOrMaxFb,o=t.combineMaxMin,a=t.clearParams,s=void 0===a?{}:a,u=this.state.framebuffers,c=this.gl,l=this.allAggregationModel;Object(_.o)(c,tt(tt({},s),{},{framebuffer:i,viewport:[0,0,n[0],n[1]]}),(function(){c.clear(16384),l.draw({parameters:r,uniforms:{uSampler:u[e].texture,gridSize:n,combineMaxMin:o}})}))}},{key:"_renderToWeightsTexture",value:function(t){var e=t.id,r=t.parameters,n=t.moduleSettings,i=t.uniforms,o=t.gridSize,a=t.weights,s=this.state,u=s.framebuffers,c=s.equations,l=s.weightAttributes,h=this.gl,f=this.gridAggregationModel,p=a[e].operation,d=p===R.MIN?[3402823466e29,3402823466e29,3402823466e29,0]:[0,0,0,0];if(Object(_.o)(h,{framebuffer:u[e],viewport:[0,0,o[0],o[1]],clearColor:d},(function(){h.clear(16384);var t={weights:l[e]};f.draw({parameters:tt(tt({},r),{},{blendEquation:c[e]}),moduleSettings:n,uniforms:i,attributes:t})})),p===R.MEAN){var A=this.state,m=A.meanTextures,y=A.textures,v={_sourceTextures:{aggregationValues:m[e]},_targetTexture:y[e],elementCount:y[e].width*y[e].height};this.meanTransform?this.meanTransform.update(v):this.meanTransform=function(t,e){return new w.a(t,tt({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"},e))}(h,v),this.meanTransform.run({parameters:{blend:!1,depthTest:!1}}),u[e].attach(g()({},36064,y[e]))}}},{key:"_runAggregation",value:function(t){this._updateModels(t),this._setupFramebuffers(t),this._renderAggregateData(t);var e=this._getAggregateData(t);return this.setState({results:e}),e}},{key:"_setupFramebuffers",value:function(t){var e=this.state,r=e.textures,n=e.framebuffers,i=e.maxMinFramebuffers,o=e.minFramebuffers,a=e.maxFramebuffers,s=e.meanTextures,u=e.equations,c=t.weights,l=t.numCol,h=t.numRow,f={width:l,height:h};for(var p in c){var d=c[p],A=d.needMin,m=d.needMax,y=d.combineMaxMin,v=d.operation;r[p]=c[p].aggregationTexture||r[p]||Q(this.gl,{id:"".concat(p,"-texture"),width:l,height:h}),r[p].resize(f);var _=r[p];v===R.MEAN&&(s[p]=s[p]||Q(this.gl,{id:"".concat(p,"-mean-texture"),width:l,height:h}),s[p].resize(f),_=s[p]),n[p]?n[p].attach(g()({},36064,_)):n[p]=Y(this.gl,{id:"".concat(p,"-fb"),width:l,height:h,texture:_}),n[p].resize(f),u[p]=W[v]||W.SUM,(A||m)&&(A&&m&&y?i[p]||(_=c[p].maxMinTexture||this._getMinMaxTexture("".concat(p,"-maxMinTexture")),i[p]=Y(this.gl,{id:"".concat(p,"-maxMinFb"),texture:_})):(A&&(o[p]||(_=c[p].minTexture||this._getMinMaxTexture("".concat(p,"-minTexture")),o[p]=Y(this.gl,{id:"".concat(p,"-minFb"),texture:_}))),m&&(a[p]||(_=c[p].maxTexture||this._getMinMaxTexture("".concat(p,"-maxTexture")),a[p]=Y(this.gl,{id:"".concat(p,"-maxFb"),texture:_})))))}}},{key:"_getMinMaxTexture",value:function(t){var e=this.state.resources;return e[t]||(e[t]=Q(this.gl,{id:"resourceName"})),e[t]}},{key:"_setupModels",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.numCol,n=void 0===r?0:r,i=e.numRow,o=void 0===i?0:i,a=this.gl,s=this.state.shaderOptions;if(null===(t=this.gridAggregationModel)||void 0===t||t.delete(),this.gridAggregationModel=ot(a,s),!this.allAggregationModel){var u=n*o;this.allAggregationModel=at(a,u)}}},{key:"_setupWeightAttributes",value:function(t){var e=this.state.weightAttributes,r=t.weights;for(var n in r)e[n]=t.attributes[n]}},{key:"_trackGPUResultBuffers",value:function(t,e){var r=this.state.resources;for(var n in t)if(t[n]){var i,o=K(et);try{for(o.s();!(i=o.n()).done;){var a=i.value;if(t[n][a]&&e[n][a]!==t[n][a]){var s="gpu-result-".concat(n,"-").concat(a);r[s]&&r[s].delete(),r[s]=t[n][a]}}}catch(t){o.e(t)}finally{o.f()}}}},{key:"_updateModels",value:function(t){var e=t.vertexCount,r=t.attributes,n=t.numCol,i=t.numRow;this.state.modelDirty&&(this._setupModels(t),this.setState({modelDirty:!1})),this._setupWeightAttributes(t),this.gridAggregationModel.setVertexCount(e),this.gridAggregationModel.setAttributes(r),this.allAggregationModel.setInstanceCount(n*i)}}]),t}();function ot(t,e){var r=Object(I.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:[P,k.a]},e);return new x.a(t,tt({id:"Gird-Aggregation-Model",vertexCount:1,drawMode:0},r))}function at(t,e){return new x.a(t,{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:[P],vertexCount:1,drawMode:0,isInstanced:!0,instanceCount:e,attributes:{position:[0,0]}})}var st=r(62),ut=r(226),ct=r(155),lt=[[255,255,178],[254,217,118],[254,178,76],[253,141,60],[240,59,32],[189,0,38]];function ht(t){var e,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Float32Array;if(Number.isFinite(t[0]))e=new n(t);else{e=new n(4*t.length);for(var i=0,o=0;o<t.length;o++){var a=t[o];e[i++]=a[0],e[i++]=a[1],e[i++]=a[2],e[i++]=Number.isFinite(a[3])?a[3]:255}}if(r)for(var s=0;s<e.length;s++)e[s]/=255;return e}function ft(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function pt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ft(Object(r),!0).forEach((function(e){g()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ft(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function dt(t){var e=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(t){return!1}}();return function(){var r,n=d()(t);if(e){var i=d()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return f()(this,r)}}var At=[0,0,0,0],gt=[0,255,0,255],mt=["minColor","maxColor","colorRange","colorDomain"],yt={cellSizePixels:{value:100,min:1},cellMarginPixels:{value:2,min:0,max:5},colorDomain:null,colorRange:lt},vt=function(t){l()(r,t);var e=dt(r);function r(){return i()(this,r),e.apply(this,arguments)}return a()(r,[{key:"getShaders",value:function(){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:[ut.a]}}},{key:"initializeState",value:function(){var t=this.context.gl;this.getAttributeManager().addInstanced({instancePositions:{size:3,update:this.calculateInstancePositions},instanceCounts:{size:4,noAlloc:!0}}),this.setState({model:this._getModel(t)})}},{key:"shouldUpdateState",value:function(t){return t.changeFlags.somethingChanged}},{key:"updateState",value:function(t){var e=t.oldProps,n=t.props,i=t.changeFlags;u()(d()(r.prototype),"updateState",this).call(this,{oldProps:e,props:n,changeFlags:i});var o=this.getAttributeManager();n.numInstances!==e.numInstances?o.invalidateAll():e.cellSizePixels!==n.cellSizePixels&&o.invalidate("instancePositions"),this._updateUniforms(e,n,i)}},{key:"draw",value:function(t){var e=t.uniforms,r=this.props,n=r.parameters,i=r.maxTexture,o=this.props.minColor||At,a=this.props.maxColor||gt,s=this.props.colorDomain||[1,0];this.state.model.setUniforms(e).setUniforms({minColor:o,maxColor:a,maxTexture:i,colorDomain:s}).draw({parameters:pt({depthTest:!1,depthMask:!1},n)})}},{key:"calculateInstancePositions",value:function(t,e){for(var r=e.numInstances,n=this.context.viewport,i=n.width,o=n.height,a=this.props.cellSizePixels,s=Math.ceil(i/a),u=t.value,c=t.size,l=0;l<r;l++){var h=l%s,f=Math.floor(l/s);u[l*c+0]=h*a/i*2-1,u[l*c+1]=1-f*a/o*2,u[l*c+2]=0}}},{key:"_getModel",value:function(t){return new x.a(t,pt(pt({},this.getShaders()),{},{id:this.props.id,geometry:new st.a({drawMode:6,attributes:{positions:new Float32Array([0,0,0,1,0,0,1,1,0,0,1,0])}}),isInstanced:!0}))}},{key:"_shouldUseMinMax",value:function(){var t=this.props,e=t.minColor,r=t.maxColor,n=t.colorDomain,i=t.colorRange;return e||r?(m.a.deprecated("ScreenGridLayer props: minColor and maxColor","colorRange, colorDomain")(),!0):!n&&!i}},{key:"_updateUniforms",value:function(t,e,r){var n=this.state.model;if(mt.some((function(r){return t[r]!==e[r]}))&&n.setUniforms({shouldUseMinMax:this._shouldUseMinMax()}),t.colorRange!==e.colorRange&&n.setUniforms({colorRange:ht(e.colorRange)}),t.cellMarginPixels!==e.cellMarginPixels||t.cellSizePixels!==e.cellSizePixels||r.viewportChanged){var i=this.context.viewport,o=i.width,a=i.height,s=this.props,u=s.cellSizePixels,c=s.cellMarginPixels,l=u>c?c:0,h=new Float32Array([(u-l)/o*2,-(u-l)/a*2,1]);n.setUniforms({cellScale:h})}}}],[{key:"isSupported",value:function(t){return Object(v.c)(t,[y.a.TEXTURE_FLOAT])}}]),r}(ct.a);vt.layerName="ScreenGridCellLayer",vt.defaultProps=yt;var _t=r(129),bt=r(156),xt=r(190);function wt(t,e){var r={};for(var n in t)e.includes(n)||(r[n]=t[n]);return r}function Et(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return St(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return St(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function St(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ot(t){var e=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(t){return!1}}();return function(){var r,n=d()(t);if(e){var i=d()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return f()(this,r)}}var Tt=function(t){l()(r,t);var e=Ot(r);function r(){return i()(this,r),e.apply(this,arguments)}return a()(r,[{key:"initializeState",value:function(t){u()(d()(r.prototype),"initializeState",this).call(this),this.setState({ignoreProps:wt(this.constructor._propTypes,t.data.props),dimensions:t})}},{key:"updateState",value:function(t){if(u()(d()(r.prototype),"updateState",this).call(this,t),t.changeFlags.extensionsChanged){var e=this.getShaders({});e&&e.defines&&(e.defines.NON_INSTANCED_MODEL=1),this.updateShaders(e)}this._updateAttributes(t.props)}},{key:"updateAttributes",value:function(t){this.setState({changedAttributes:t})}},{key:"getAttributes",value:function(){return this.getAttributeManager().getShaderAttributes()}},{key:"getModuleSettings",value:function(){var t=this.context,e=t.viewport,r=t.mousePosition,n=t.gl;return Object.assign(Object.create(this.props),{viewport:e,mousePosition:r,pickingActive:0,devicePixelRatio:Object(_.e)(n)})}},{key:"updateShaders",value:function(t){}},{key:"isAggregationDirty",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.props,n=t.oldProps,i=t.changeFlags,o=e.compareAll,a=void 0!==o&&o,s=e.dimension,u=this.state.ignoreProps,c=s.props,l=s.accessors,h=void 0===l?[]:l,f=i.updateTriggersChanged;if(i.dataChanged)return!0;if(f){if(f.all)return!0;var p,d=Et(h);try{for(d.s();!(p=d.n()).done;){var A=p.value;if(f[A])return!0}}catch(t){d.e(t)}finally{d.f()}}if(a)return!!i.extensionsChanged||Object(_t.a)({oldProps:n,newProps:r,ignoreProps:u,propTypes:this.constructor._propTypes});var g,m=Et(c);try{for(m.s();!(g=m.n()).done;){var y=g.value;if(r[y]!==n[y])return!0}}catch(t){m.e(t)}finally{m.f()}return!1}},{key:"isAttributeChanged",value:function(t){var e=this.state.changedAttributes;return t?e&&void 0!==e[t]:!function(t){var e=!0;for(var r in t){e=!1;break}return e}(e)}},{key:"_getAttributeManager",value:function(){return new bt.a(this.context.gl,{id:this.props.id,stats:this.context.stats})}}]),r}(xt.a);Tt.layerName="AggregationLayer";var Pt=r(34),Mt=r(10),Ct=r.n(Mt);function It(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return kt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return kt(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function kt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Rt(t,e,r){var n=r;return n.domain=function(){return t},n.range=function(){return e},n}function Lt(t,e){return Rt(t,e,(function(r){return function(t,e,r){var n=t[1]-t[0];if(n<=0)return m.a.warn("quantizeScale: invalid domain, returning range[0]")(),e[0];var i=n/e.length,o=Math.floor((r-t[0])/i),a=Math.max(Math.min(o,e.length-1),0);return e[a]}(t,e,r)}))}function jt(t,e){return Rt(t,e,(function(r){return function(t,e,r){return(r-t[0])/(t[1]-t[0])*(e[1]-e[0])+e[0]}(t,e,r)}))}function Dt(t,e){for(var r=t.sort(Bt),n=0,i=Math.max(1,e.length),o=new Array(i-1);++n<i;)o[n-1]=Ft(r,n/i);var a=function(t){return function(t,e,r){return e[function(t,e){var r=0,n=t.length;for(;r<n;){var i=r+n>>>1;Bt(t[i],e)>0?n=i:r=i+1}return r}(t,r)]}(o,e,t)};return a.thresholds=function(){return o},Rt(t,e,a)}function Bt(t,e){return t-e}function Ft(t,e){var r=t.length;if(e<=0||r<2)return t[0];if(e>=1)return t[r-1];var n=(r-1)*e,i=Math.floor(n),o=t[i];return o+(t[i+1]-o)*(n-i)}function zt(t,e){var r,n=new Map,i=[],o=It(t);try{for(o.s();!(r=o.n()).done;){var a=r.value,s="".concat(a);n.has(s)||n.set(s,i.push(a))}}catch(t){o.e(t)}finally{o.f()}return Rt(t,e,(function(t){return function(t,e,r,n){var i="".concat(n),o=e.get(i);return void 0===o&&(o=t.push(n),e.set(i,o)),r[(o-1)%r.length]}(i,n,e,t)}))}function Nt(t){return null!=t}function Ut(t,e){return("function"==typeof e?t.map(e):t).filter(Nt)}function Vt(t,e){return Ut(t,e)}function Gt(t,e){return r=Ut(t,e),n=[],r.forEach((function(t){!n.includes(t)&&Nt(t)&&n.push(t)})),n;var r,n}function Wt(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Ht(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ht(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Ht(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var qt=function(t){return t.length},Zt=function(t){return t.points},Xt=function(t){return t.index},Qt=function(t,e){return t<e?-1:t>e?1:t>=e?0:NaN},Yt={getValue:qt,getPoints:Zt,getIndex:Xt,filterData:null},Kt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Yt;i()(this,t),this.aggregatedBins=this.getAggregatedBins(e,r),this._updateMinMaxValues(),this.binMap=this.getBinMap()}return a()(t,[{key:"getAggregatedBins",value:function(t,e){for(var r=e.getValue,n=void 0===r?qt:r,i=e.getPoints,o=void 0===i?Zt:i,a=e.getIndex,s=void 0===a?Xt:a,u=e.filterData,c="function"==typeof u,l=t.length,h=[],f=0,p=0;p<l;p++){var d=t[p],A=o(d),g=s(d),m=c?A.filter(u):A;d.filteredPoints=c?m:null;var y=m.length?n(m):null;null!=y&&(h[f]={i:Number.isFinite(g)?g:p,value:y,counts:m.length},f++)}return h}},{key:"_percentileToIndex",value:function(t){var e=this.sortedBins.length;if(e<2)return[0,0];var r=t.map((function(t){return e=t,r=0,n=100,Math.max(r,Math.min(n,e));var e,r,n})),n=Ct()(r,2),i=n[0],o=n[1];return[Math.ceil(i/100*(e-1)),Math.floor(o/100*(e-1))]}},{key:"getBinMap",value:function(){var t,e={},r=Wt(this.aggregatedBins);try{for(r.s();!(t=r.n()).done;){var n=t.value;e[n.i]=n}}catch(t){r.e(t)}finally{r.f()}return e}},{key:"_updateMinMaxValues",value:function(){var t,e=0,r=0,n=3402823466e29,i=0,o=Wt(this.aggregatedBins);try{for(o.s();!(t=o.n()).done;){var a=t.value;e=e>a.counts?e:a.counts,r=r>a.value?r:a.value,n=n<a.value?n:a.value,i+=a.counts}}catch(t){o.e(t)}finally{o.f()}this.maxCount=e,this.maxValue=r,this.minValue=n,this.totalCount=i}},{key:"getValueRange",value:function(t){if(this.sortedBins||(this.sortedBins=this.aggregatedBins.sort((function(t,e){return Qt(t.value,e.value)}))),!this.sortedBins.length)return[];var e=0,r=this.sortedBins.length-1;if(Array.isArray(t)){var n=this._percentileToIndex(t);e=n[0],r=n[1]}return[this.sortedBins[e].value,this.sortedBins[r].value]}},{key:"getValueDomainByScale",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=Ct()(e,2),n=r[0],i=void 0===n?0:n,o=r[1],a=void 0===o?100:o;if(this.sortedBins||(this.sortedBins=this.aggregatedBins.sort((function(t,e){return Qt(t.value,e.value)}))),!this.sortedBins.length)return[];var s=this._percentileToIndex([i,a]);return this._getScaleDomain(t,s)}},{key:"_getScaleDomain",value:function(t,e){var r=Ct()(e,2),n=r[0],i=r[1],o=this.sortedBins;switch(t){case"quantize":case"linear":return[o[n].value,o[i].value];case"quantile":return Vt(o.slice(n,i+1),(function(t){return t.value}));case"ordinal":return Gt(o,(function(t){return t.value}));default:return[o[n].value,o[i].value]}}}]),t}(),$t=r(53),Jt=r(14);function te(t){return Number.isFinite(t)?t:0}function ee(t,e){for(var r,n,i=t.positions.value,o=1/0,a=-1/0,s=1/0,u=-1/0,c=0;c<e;c++)n=i[3*c],o=(r=i[3*c+1])<o?r:o,a=r>a?r:a,s=n<s?n:s,u=n>u?n:u;return{xMin:te(s),xMax:te(u),yMin:te(o),yMax:te(a)}}function re(t,e){var r=t<0?-1:1,n=r<0?Math.abs(t)+e:Math.abs(t);return(n=Math.floor(n/e)*e)*r}function ne(t,e){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!r)return{xOffset:e,yOffset:e};var n=t.yMin,i=t.yMax,o=(n+i)/2;return oe(e,o)}function ie(t,e,r,n){var i=ne(t,e,n!==Jt.a.CARTESIAN),o=function(t,e,r,n){var i=n.width,o=n.height,a=r===Jt.a.CARTESIAN?[-i/2,-o/2]:[-180,-90];m.a.assert(r===Jt.a.CARTESIAN||r===Jt.a.LNGLAT||r===Jt.a.DEFAULT);var s=t.xMin,u=t.yMin;return[-1*(re(s-a[0],e.xOffset)+a[0]),-1*(re(u-a[1],e.yOffset)+a[1])]}(t,i,n,r),a=t.xMin,s=t.yMin,u=t.xMax,c=t.yMax,l=u-a+i.xOffset,h=c-s+i.yOffset;return{gridOffset:i,translation:o,width:l,height:h,numCol:Math.ceil(l/i.xOffset),numRow:Math.ceil(h/i.yOffset)}}function oe(t,e){var r;return{yOffset:t/6378e3*(180/Math.PI),xOffset:(r=e,t/6378e3*(180/Math.PI)/Math.cos(r*Math.PI/180))}}function ae(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function se(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ae(Object(r),!0).forEach((function(e){g()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ae(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ue(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return ce(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ce(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function ce(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function le(t,e){var r=function(t,e){var r=t.data,n=void 0===r?[]:r,i=t.cellSize,o=e.attributes,a=e.viewport,s=e.projectPoints,u=e.numInstances,c=o.positions.value,l=o.positions.getAccessor().size,h=e.boundingBox||function(t,e){for(var r,n,i=t.value,o=t.getAccessor().size,a=1/0,s=-1/0,u=1/0,c=-1/0,l=0;l<e;l++)n=i[l*o],r=i[l*o+1],Number.isFinite(n)&&Number.isFinite(r)&&(a=r<a?r:a,s=r>s?r:s,u=n<u?n:u,c=n>c?n:c);return{xMin:u,xMax:c,yMin:a,yMax:s}}(o.positions,u),f=e.posOffset||[180,90],p=e.gridOffset||ne(h,i);if(p.xOffset<=0||p.yOffset<=0)return{gridHash:{},gridOffset:p};var d,A=a.width,g=a.height,m=Math.ceil(A/p.xOffset),y=Math.ceil(g/p.yOffset),v={},_=Object($t.a)(n),b=_.iterable,x=_.objectInfo,w=new Array(3),E=ue(b);try{for(E.s();!(d=E.n()).done;){var S=d.value;x.index++,w[0]=c[x.index*l],w[1]=c[x.index*l+1],w[2]=l>=3?c[x.index*l+2]:0;var O=s?a.project(w):w,T=Ct()(O,2),P=T[0],M=T[1];if(Number.isFinite(P)&&Number.isFinite(M)){var C=Math.floor((M+f[1])/p.yOffset),I=Math.floor((P+f[0])/p.xOffset);if(!s||I>=0&&I<m&&C>=0&&C<y){var k="".concat(C,"-").concat(I);v[k]=v[k]||{count:0,points:[],lonIdx:I,latIdx:C},v[k].count+=1,v[k].points.push({source:S,index:x.index})}}}}catch(t){E.e(t)}finally{E.f()}return{gridHash:v,gridOffset:p,offsets:[-1*f[0],-1*f[1]]}}(t,e),n=function(t){var e=t.gridHash,r=t.gridOffset,n=t.offsets,i=new Array(Object.keys(e).length),o=0;for(var a in e){var s=a.split("-"),u=parseInt(s[0],10),c=parseInt(s[1],10),l=o++;i[l]=se({index:l,position:[n[0]+r.xOffset*c,n[1]+r.yOffset*u]},e[a])}return i}(r);return{gridHash:r.gridHash,gridOffset:r.gridOffset,data:n}}function he(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return fe(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return fe(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function fe(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function pe(t){var e=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(t){return!1}}();return function(){var r,n=d()(t);if(e){var i=d()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return f()(this,r)}}var de=function(t){l()(r,t);var e=pe(r);function r(){return i()(this,r),e.apply(this,arguments)}return a()(r,[{key:"initializeState",value:function(t){var e=t.dimensions,n=this.context.gl;u()(d()(r.prototype),"initializeState",this).call(this,e),this.setState({layerData:{},gpuGridAggregator:new it(n,{id:"".concat(this.id,"-gpu-aggregator")}),cpuGridAggregator:le})}},{key:"updateState",value:function(t){u()(d()(r.prototype),"updateState",this).call(this,t),this.updateAggregationState(t);var e=this.state,n=e.aggregationDataDirty,i=e.aggregationWeightsDirty,o=e.gpuAggregation;if(!(this.getNumInstances()<=0)){var a=!1;(n||o&&i)&&(this._updateAggregation(t),a=!0),o||!n&&!i||(this._updateWeightBins(),this._uploadAggregationResults(),a=!0),this.setState({aggregationDirty:a})}}},{key:"finalizeState",value:function(){var t,e=this.state.weights.count;e&&e.aggregationBuffer&&e.aggregationBuffer.delete(),null===(t=this.state.gpuGridAggregator)||void 0===t||t.delete(),u()(d()(r.prototype),"finalizeState",this).call(this)}},{key:"updateShaders",value:function(t){this.state.gpuAggregation&&this.state.gpuGridAggregator.updateShaders(t)}},{key:"updateAggregationState",value:function(t){m.a.assert(!1)}},{key:"allocateResources",value:function(t,e){if(this.state.numRow!==t||this.state.numCol!==e){var r=e*t*4*4,n=this.context.gl,i=this.state.weights;for(var o in i){var a=i[o];a.aggregationBuffer&&a.aggregationBuffer.delete(),a.aggregationBuffer=new Pt.a(n,{byteLength:r,accessor:{size:4,type:5126,divisor:1}})}}}},{key:"updateResults",value:function(t){var e=t.aggregationData,r=t.maxMinData,n=t.maxData,i=t.minData,o=this.state.weights.count;o&&(o.aggregationData=e,o.maxMinData=r,o.maxData=n,o.minData=i)}},{key:"_updateAggregation",value:function(t){var e=this.state,r=e.cpuGridAggregator,n=e.gpuGridAggregator,i=e.gridOffset,o=e.posOffset,a=e.translation,s=void 0===a?[0,0]:a,u=e.scaling,c=void 0===u?[0,0,0]:u,l=e.boundingBox,h=e.projectPoints,f=e.gpuAggregation,p=e.numCol,d=e.numRow,A=t.props,g=this.context.viewport,m=this.getAttributes(),y=this.getNumInstances();if(f){var v=this.state.weights;n.run({weights:v,cellSize:[i.xOffset,i.yOffset],numCol:p,numRow:d,translation:s,scaling:c,vertexCount:y,projectPoints:h,attributes:m,moduleSettings:this.getModuleSettings()})}else{var _=r(A,{gridOffset:i,projectPoints:h,attributes:m,viewport:g,posOffset:o,boundingBox:l});this.setState({layerData:_})}}},{key:"_updateWeightBins",value:function(){var t=this.state.getValue,e=new Kt(this.state.layerData.data||[],{getValue:t});this.setState({sortedBins:e})}},{key:"_uploadAggregationResults",value:function(){var t,e=this.state,r=e.numCol,n=e.numRow,i=this.state.layerData.data,o=this.state.sortedBins,a=o.aggregatedBins,s=o.minValue,u=o.maxValue,c=o.totalCount,l=new Float32Array(r*n*4).fill(0),h=he(a);try{for(h.s();!(t=h.n()).done;){var f=t.value,p=i[f.i],d=p.lonIdx,A=p.latIdx,g=f.value,m=f.counts,y=4*(d+A*r);l[y]=g,l[y+4-1]=m}}catch(t){h.e(t)}finally{h.f()}var v=new Float32Array([u,0,0,s]),_=new Float32Array([u,0,0,c]),b=new Float32Array([s,0,0,c]);this.updateResults({aggregationData:l,maxMinData:v,maxData:_,minData:b})}}]),r}(Tt);function Ae(t){var e=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(t){return!1}}();return function(){var r,n=d()(t);if(e){var i=d()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return f()(this,r)}}function ge(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function me(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ge(Object(r),!0).forEach((function(e){g()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ge(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}de.layerName="GridAggregationLayer";var ye=me(me({},vt.defaultProps),{},{getPosition:{type:"accessor",value:function(t){return t.position}},getWeight:{type:"accessor",value:1},gpuAggregation:!0,aggregation:"SUM"}),ve={data:{props:["cellSizePixels"]},weights:{props:["aggregation"],accessors:["getWeight"]}},_e=function(t){l()(r,t);var e=Ae(r);function r(){return i()(this,r),e.apply(this,arguments)}return a()(r,[{key:"initializeState",value:function(){var t,e=this.context.gl;if(!vt.isSupported(e))return this.setState({supported:!1}),void m.a.error("ScreenGridLayer: ".concat(this.id," is not supported on this browser"))();u()(d()(r.prototype),"initializeState",this).call(this,{dimensions:ve,getCellSize:function(t){return t.cellSizePixels}});var n={count:{size:1,operation:R.SUM,needMax:!0,maxTexture:Q(e,{id:"".concat(this.id,"-max-texture")})}};this.setState({supported:!0,projectPoints:!0,weights:n,subLayerData:{attributes:{}},maxTexture:n.count.maxTexture,positionAttributeName:"positions",posOffset:[0,0],translation:[1,-1]}),this.getAttributeManager().add((t={},g()(t,"positions",{size:3,accessor:"getPosition",type:5130,fp64:this.use64bitPositions()}),g()(t,"count",{size:3,accessor:"getWeight"}),t))}},{key:"shouldUpdateState",value:function(t){var e=t.changeFlags;return this.state.supported&&e.somethingChanged}},{key:"updateState",value:function(t){u()(d()(r.prototype),"updateState",this).call(this,t)}},{key:"renderLayers",value:function(){if(!this.state.supported)return[];var t=this.state,e=t.maxTexture,r=t.numRow,n=t.numCol,i=t.weights,o=this.props.updateTriggers,a=i.count.aggregationBuffer;return new(this.getSubLayerClass("cells",vt))(this.props,this.getSubLayerProps({id:"cell-layer",updateTriggers:o}),{data:{attributes:{instanceCounts:a}},maxTexture:e,numInstances:r*n})}},{key:"finalizeState",value:function(){u()(d()(r.prototype),"finalizeState",this).call(this);var t=this.state,e=t.aggregationBuffer,n=t.maxBuffer,i=t.maxTexture;null==e||e.delete(),null==n||n.delete(),null==i||i.delete()}},{key:"getPickingInfo",value:function(t){var e=t.info,r=(t.mode,e.index);if(r>=0){var n=this.state,i=n.gpuGridAggregator,o=n.gpuAggregation,a=n.weights,s=o?i.getData("count"):a.count;e.object=it.getAggregationData(me({pixelIndex:r},s))}return e}},{key:"updateResults",value:function(t){var e=t.aggregationData,r=t.maxData,n=this.state.weights.count;n.aggregationData=e,n.aggregationBuffer.setData({data:e}),n.maxData=r,n.maxTexture.setImageData({data:r})}},{key:"updateAggregationState",value:function(t){var e=t.props.cellSizePixels,r=t.oldProps.cellSizePixels!==e,n=t.changeFlags.viewportChanged,i=t.props.gpuAggregation;this.state.gpuAggregation!==t.props.gpuAggregation&&i&&!it.isSupported(this.context.gl)&&(m.a.warn("GPU Grid Aggregation not supported, falling back to CPU")(),i=!1);var o=i!==this.state.gpuAggregation;this.setState({gpuAggregation:i});var a=this.isAttributeChanged("positions"),s=this.state.dimensions,u=s.data,c=s.weights,l=a||o||n||this.isAggregationDirty(t,{compareAll:i,dimension:u}),h=this.isAggregationDirty(t,{dimension:c});this.setState({aggregationDataDirty:l,aggregationWeightsDirty:h});var f=this.context.viewport;if(n||r){var p=f.width,d=f.height,A=Math.ceil(p/e),g=Math.ceil(d/e);this.allocateResources(g,A),this.setState({scaling:[p/2,-d/2,1],gridOffset:{xOffset:e,yOffset:e},width:p,height:d,numCol:A,numRow:g})}h&&this._updateAccessors(t),(l||h)&&this._resetResults()}},{key:"_updateAccessors",value:function(t){var e=t.props,r=e.getWeight,n=e.aggregation,i=e.data,o=this.state.weights.count;o&&(o.getWeight=r,o.operation=R[n]),this.setState({getValue:B(n,r,{data:i})})}},{key:"_resetResults",value:function(){var t=this.state.weights.count;t&&(t.aggregationData=null)}}]),r}(de);_e.layerName="ScreenGridLayer",_e.defaultProps=ye;var be=r(214),xe=r(24),we=r.n(xe);function Ee(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Se(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ee(Object(r),!0).forEach((function(e){g()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ee(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Oe(){}var Te=["getBins","getDomain","getScaleFunc"],Pe=[{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}],Me=function(t){return t.cellSize},Ce=function(){function t(e){i()(this,t),this.state={layerData:{},dimensions:{}},this.changeFlags={},this.dimensionUpdaters={},this._getCellSize=e.getCellSize||Me,this._getAggregator=e.getAggregator,this._addDimension(e.dimensions||Pe)}return a()(t,[{key:"updateState",value:function(t,e){var r=t.oldProps,n=t.props,i=t.changeFlags;this.updateGetValueFuncs(r,n,i);var o=this.needsReProjectPoints(r,n,i),a=!1;i.dataChanged||o?(this.getAggregatedData(n,e),a=!0):((this.getDimensionChanges(r,n,i)||[]).forEach((function(t){return"function"==typeof t&&t()})),a=!0);return this.setState({aggregationDirty:a}),this.state}},{key:"setState",value:function(t){this.state=Se(Se({},this.state),t)}},{key:"setDimensionState",value:function(t,e){this.setState({dimensions:Se(Se({},this.state.dimensions),{},g()({},t,Se(Se({},this.state.dimensions[t]),e)))})}},{key:"normalizeResult",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.hexagons?Se({data:t.hexagons},t):t.layerData?Se({data:t.layerData},t):t}},{key:"getAggregatedData",value:function(t,e){var r=this._getAggregator(t)(t,e);this.setState({layerData:this.normalizeResult(r)}),this.changeFlags={layerData:!0},this.getSortedBins(t)}},{key:"updateGetValueFuncs",value:function(t,e,r){for(var n in this.dimensionUpdaters){var i=this.dimensionUpdaters[n].getBins.triggers,o=i.value,a=i.weight,s=i.aggregation,u=e[o.prop];this.needUpdateDimensionStep(this.dimensionUpdaters[n].getBins,t,e,r)&&(u=u?F(u,{data:e.data}):B(e[s.prop],e[a.prop],{data:e.data})),u&&this.setDimensionState(n,{getValue:u})}}},{key:"needsReProjectPoints",value:function(t,e,r){return this._getCellSize(t)!==this._getCellSize(e)||this._getAggregator(t)!==this._getAggregator(e)||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getPosition)}},{key:"addDimension",value:function(t){this._addDimension(t)}},{key:"_addDimension",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];e.forEach((function(e){var r=e.key;t.dimensionUpdaters[r]=t.getDimensionUpdaters(e),t.state.dimensions[r]={getValue:null,domain:null,sortedBins:null,scaleFunc:Oe}}))}},{key:"getDimensionUpdaters",value:function(t){var e=t.key,r=t.accessor,n=t.pickingInfo,i=t.getBins,o=t.getDomain,a=t.getScaleFunc,s=t.nullValue;return{key:e,accessor:r,pickingInfo:n,getBins:Se({updater:this.getDimensionSortedBins},i),getDomain:Se({updater:this.getDimensionValueDomain},o),getScaleFunc:Se({updater:this.getDimensionScale},a),attributeAccessor:this.getSubLayerDimensionAttribute(e,s)}}},{key:"needUpdateDimensionStep",value:function(t,e,r,n){return Object.values(t.triggers).some((function(t){return t.updateTrigger?n.dataChanged||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged[t.updateTrigger]):e[t.prop]!==r[t.prop]}))}},{key:"getDimensionChanges",value:function(t,e,r){var n=this,i=[],o=function(o){var a=Te.find((function(i){return n.needUpdateDimensionStep(n.dimensionUpdaters[o][i],t,e,r)}));a&&i.push(n.dimensionUpdaters[o][a].updater.bind(n,e,n.dimensionUpdaters[o]))};for(var a in this.dimensionUpdaters)o(a);return i.length?i:null}},{key:"getUpdateTriggers",value:function(t){var e=this,r=t.updateTriggers||{},n={},i=function(i){var o=e.dimensionUpdaters[i].accessor;n[o]={},Te.forEach((function(a){Object.values(e.dimensionUpdaters[i][a].triggers).forEach((function(e){var i=e.prop,a=e.updateTrigger;if(a){var s=r[a];"object"!==we()(s)||Array.isArray(s)?void 0!==s&&(n[o][i]=s):Object.assign(n[o],s)}else n[o][i]=t[i]}))}))};for(var o in this.dimensionUpdaters)i(o);return n}},{key:"getSortedBins",value:function(t){for(var e in this.dimensionUpdaters)this.getDimensionSortedBins(t,this.dimensionUpdaters[e])}},{key:"getDimensionSortedBins",value:function(t,e){var r=e.key,n=this.state.dimensions[r].getValue,i=new Kt(this.state.layerData.data||[],{getValue:n,filterData:t._filterData});this.setDimensionState(r,{sortedBins:i}),this.getDimensionValueDomain(t,e)}},{key:"getDimensionValueDomain",value:function(t,e){var r=e.getDomain,n=e.key,i=r.triggers,o=i.lowerPercentile,a=i.upperPercentile,s=i.scaleType,u=this.state.dimensions[n].sortedBins.getValueDomainByScale(t[s.prop],[t[o.prop],t[a.prop]]);this.setDimensionState(n,{valueDomain:u}),this.getDimensionScale(t,e)}},{key:"getDimensionScale",value:function(t,e){var r=e.key,n=e.getScaleFunc,i=e.getDomain,o=n.triggers,a=o.domain,s=o.range,u=i.triggers.scaleType,c=n.onSet,l=t[s.prop],h=t[a.prop]||this.state.dimensions[r].valueDomain,f=function(t){switch(t){case"quantize":return Lt;case"linear":return jt;case"quantile":return Dt;case"ordinal":return zt;default:return Lt}}(u&&t[u.prop])(h,l);"object"===we()(c)&&"function"==typeof t[c.props]&&t[c.props](f.domain()),this.setDimensionState(r,{scaleFunc:f})}},{key:"getSubLayerDimensionAttribute",value:function(t,e){var r=this;return function(n){var i=r.state.dimensions[t],o=i.sortedBins,a=i.scaleFunc,s=o.binMap[n.index];if(s&&0===s.counts)return e;var u=s&&s.value,c=a.domain();return u>=c[0]&&u<=c[c.length-1]?a(u):e}}},{key:"getSubLayerAccessors",value:function(t){var e={};for(var r in this.dimensionUpdaters){e[this.dimensionUpdaters[r].accessor]=this.getSubLayerDimensionAttribute(t,r)}return e}},{key:"getPickingInfo",value:function(t){var e=t.info,r=null;if(e.picked&&e.index>-1){var n=this.state.layerData.data[e.index],i={};for(var o in this.dimensionUpdaters){var a=this.dimensionUpdaters[o].pickingInfo,s=this.state.dimensions[o].sortedBins,u=s.binMap[n.index]&&s.binMap[n.index].value;i[a]=u}r=Object.assign(i,n,{points:n.filteredPoints||n.points})}return e.picked=Boolean(r),e.object=r,e}},{key:"getAccessor",value:function(t){return this.dimensionUpdaters.hasOwnProperty(t)?this.dimensionUpdaters[t].attributeAccessor:Oe}}],[{key:"defaultDimensions",value:function(){return Pe}}]),t}();function Ie(t){var e=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(t){return!1}}();return function(){var r,n=d()(t);if(e){var i=d()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return f()(this,r)}}function ke(){}var Re={colorDomain:null,colorRange:lt,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:ke,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:ke,gridAggregator:le,cellSize:{type:"number",min:0,max:1e3,value:1e3},coverage:{type:"number",min:0,max:1,value:1},getPosition:{type:"accessor",value:function(t){return t.position}},extruded:!1,material:!0,_filterData:{type:"function",value:null,optional:!0}},Le=function(t){l()(r,t);var e=Ie(r);function r(){return i()(this,r),e.apply(this,arguments)}return a()(r,[{key:"initializeState",value:function(){var t=new Ce({getAggregator:function(t){return t.gridAggregator},getCellSize:function(t){return t.cellSize}});this.state={cpuAggregator:t,aggregatorState:t.state},this.getAttributeManager().add({positions:{size:3,accessor:"getPosition"}})}},{key:"updateState",value:function(t){u()(d()(r.prototype),"updateState",this).call(this,t),this.setState({aggregatorState:this.state.cpuAggregator.updateState(t,{viewport:this.context.viewport,attributes:this.getAttributes(),numInstances:this.getNumInstances(t.props)})})}},{key:"getPickingInfo",value:function(t){var e=t.info;return this.state.cpuAggregator.getPickingInfo({info:e})}},{key:"_onGetSublayerColor",value:function(t){return this.state.cpuAggregator.getAccessor("fillColor")(t)}},{key:"_onGetSublayerElevation",value:function(t){return this.state.cpuAggregator.getAccessor("elevation")(t)}},{key:"_getSublayerUpdateTriggers",value:function(){return this.state.cpuAggregator.getUpdateTriggers(this.props)}},{key:"renderLayers",value:function(){var t=this.props,e=t.elevationScale,r=t.extruded,n=t.cellSize,i=t.coverage,o=t.material,a=t.transitions,s=this.state.cpuAggregator,u=this.getSubLayerClass("grid-cell",be.a),c=this._getSublayerUpdateTriggers();return new u({cellSize:n,coverage:i,material:o,elevationScale:e,extruded: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:"grid-cell",updateTriggers:c}),{data:s.state.layerData.data})}}]),r}(Tt);Le.layerName="CPUGridLayer",Le.defaultProps=Re;var je=r(157),De=Math.PI/3,Be=[0,De,2*De,3*De,4*De,5*De];function Fe(t){return t[0]}function ze(t){return t[1]}function Ne(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Ue(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ue(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Ue(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ve(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Ge(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ve(Object(r),!0).forEach((function(e){g()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ve(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function We(t){var e=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(t){return!1}}();return function(){var r,n=d()(t);if(e){var i=d()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return f()(this,r)}}function He(){}var qe={colorDomain:null,colorRange:lt,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:He,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:He,radius:{type:"number",value:1e3,min:1},coverage:{type:"number",min:0,max:1,value:1},extruded:!1,hexagonAggregator:function(t,e){var r,n=t.data,i=t.radius,o=e.viewport,a=e.attributes,s=n.length?function(t,e){var r,n=e.attributes,i=n.positions.value,o=n.positions.getAccessor().size,a=1/0,s=1/0,u=-1/0,c=-1/0;for(r=0;r<o*t.length;r+=o){var l=i[r],h=i[r+1];Number.isFinite(l)&&Number.isFinite(h)&&(a=Math.min(l,a),u=Math.max(l,u),s=Math.min(h,s),c=Math.max(h,c))}return[a,s,u,c].every(Number.isFinite)?[(a+u)/2,(s+c)/2]:null}(n,e):null,u=function(t,e,r){var n=e.getDistanceScales(r).unitsPerMeter;return t*n[0]}(i,o,s),c=[],l=Object($t.a)(n),h=l.iterable,f=l.objectInfo,p=a.positions.value,d=a.positions.getAccessor().size,A=Ne(h);try{for(A.s();!(r=A.n()).done;){var g=r.value;f.index++;var y=f.index*d,v=[p[y],p[y+1]];Number.isFinite(v[0])&&Number.isFinite(v[1])?c.push({screenCoord:o.projectFlat(v),source:g,index:f.index}):m.a.warn("HexagonLayer: invalid position")()}}catch(t){A.e(t)}finally{A.f()}return{hexagons:function(){var t,e,r,n=0,i=0,o=1,a=1,s=Fe,u=ze;function c(t){var n,i={},o=[],a=t.length;for(n=0;n<a;++n)if(!isNaN(l=+s.call(null,c=t[n],n,t))&&!isNaN(h=+u.call(null,c,n,t))){var c,l,h,f=Math.round(h/=r),p=Math.round(l=l/e-(1&f)/2),d=h-f;if(3*Math.abs(d)>1){var A=l-p,g=p+(l<p?-1:1)/2,m=f+(h<f?-1:1),y=l-g,v=h-m;A*A+d*d>y*y+v*v&&(p=g+(1&f?1:-1)/2,f=m)}var _=p+"-"+f,b=i[_];b?b.push(c):(o.push(b=i[_]=[c]),b.x=(p+(1&f)/2)*e,b.y=f*r)}return o}function l(t){var e=0,r=0;return Be.map((function(n){var i=Math.sin(n)*t,o=-Math.cos(n)*t,a=i-e,s=o-r;return e=i,r=o,[a,s]}))}return c.hexagon=function(e){return"m"+l(null==e?t:+e).join("l")+"z"},c.centers=function(){for(var s=[],u=Math.round(i/r),c=Math.round(n/e),l=u*r;l<a+t;l+=r,++u)for(var h=c*e+(1&u)*e/2;h<o+e/2;h+=e)s.push([h,l]);return s},c.mesh=function(){var e=l(t).slice(0,4).join("l");return c.centers().map((function(t){return"M"+t+"m"+e})).join("")},c.x=function(t){return arguments.length?(s=t,c):s},c.y=function(t){return arguments.length?(u=t,c):u},c.radius=function(n){return arguments.length?(e=2*(t=+n)*Math.sin(De),r=1.5*t,c):t},c.size=function(t){return arguments.length?(n=i=0,o=+t[0],a=+t[1],c):[o-n,a-i]},c.extent=function(t){return arguments.length?(n=+t[0][0],i=+t[0][1],o=+t[1][0],a=+t[1][1],c):[[n,i],[o,a]]},c.radius(1)}().radius(u).x((function(t){return t.screenCoord[0]})).y((function(t){return t.screenCoord[1]}))(c).map((function(t,e){return{position:o.unprojectFlat([t.x,t.y]),points:t,index:e}})),radiusCommon:u}},getPosition:{type:"accessor",value:function(t){return t.position}},material:!0,_filterData:{type:"function",value:null,optional:!0}},Ze=function(t){l()(r,t);var e=We(r);function r(){return i()(this,r),e.apply(this,arguments)}return a()(r,[{key:"initializeState",value:function(){var t=new Ce({getAggregator:function(t){return t.hexagonAggregator},getCellSize:function(t){return t.radius}});this.state={cpuAggregator:t,aggregatorState:t.state,vertices:null},this.getAttributeManager().add({positions:{size:3,accessor:"getPosition"}})}},{key:"updateState",value:function(t){if(u()(d()(r.prototype),"updateState",this).call(this,t),t.changeFlags.propsOrDataChanged){var e=this.state.cpuAggregator.updateState(t,{viewport:this.context.viewport,attributes:this.getAttributes()});if(this.state.aggregatorState.layerData!==e.layerData){var n=(e.layerData||{}).hexagonVertices;this.setState({vertices:n&&this.convertLatLngToMeterOffset(n)})}this.setState({aggregatorState:e})}}},{key:"convertLatLngToMeterOffset",value:function(t){var e=this.context.viewport;if(Array.isArray(t)&&6===t.length){var r=t[0],n=t[3],i=[(r[0]+n[0])/2,(r[1]+n[1])/2],o=e.projectFlat(i),a=e.getDistanceScales(i).metersPerUnit;return t.map((function(t){var r=e.projectFlat(t);return[(r[0]-o[0])*a[0],(r[1]-o[1])*a[1]]}))}return m.a.error("HexagonLayer: hexagonVertices needs to be an array of 6 points")(),null}},{key:"getPickingInfo",value:function(t){var e=t.info;return this.state.cpuAggregator.getPickingInfo({info:e})}},{key:"_onGetSublayerColor",value:function(t){return this.state.cpuAggregator.getAccessor("fillColor")(t)}},{key:"_onGetSublayerElevation",value:function(t){return this.state.cpuAggregator.getAccessor("elevation")(t)}},{key:"_getSublayerUpdateTriggers",value:function(){return this.state.cpuAggregator.getUpdateTriggers(this.props)}},{key:"renderLayers",value:function(){var t=this.props,e=t.elevationScale,r=t.extruded,n=t.coverage,i=t.material,o=t.transitions,a=this.state,s=a.aggregatorState,u=a.vertices,c=this.getSubLayerClass("hexagon-cell",je.a),l=this._getSublayerUpdateTriggers();return new c(Ge(Ge({},u?{vertices:u,radius:1}:{radius:s.layerData.radiusCommon||1,radiusUnits:"common",angle:90}),{},{diskResolution:6,elevationScale:e,extruded:r,coverage:n,material:i,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:"hexagon-cell",updateTriggers:l}),{data:s.layerData.data})}}]),r}(Tt);Ze.layerName="HexagonLayer",Ze.defaultProps=qe;var Xe,Qe=r(223),Ye=r(108),Ke={N:[0,.5],E:[.5,0],S:[0,-.5],W:[-.5,0],NE:[.5,.5],NW:[-.5,.5],SE:[.5,-.5],SW:[-.5,-.5]},$e=[Ke.W,Ke.SW,Ke.S],Je=[Ke.S,Ke.SE,Ke.E],tr=[Ke.E,Ke.NE,Ke.N],er=[Ke.NW,Ke.W,Ke.N],rr=[[-.5,1/6],[-.5,-1/6],[-1/6,-.5],[1/6,-.5]],nr=[[-1/6,-.5],[1/6,-.5],[.5,-1/6],[.5,1/6]],ir=[[.5,-1/6],[.5,1/6],[1/6,.5],[-1/6,.5]],or=[[-.5,1/6],[-.5,-1/6],[1/6,.5],[-1/6,.5]],ar=[Ke.W,Ke.SW,Ke.SE,Ke.E],sr=[Ke.S,Ke.SE,Ke.NE,Ke.N],ur=[Ke.NW,Ke.W,Ke.E,Ke.NE],cr=[Ke.NW,Ke.SW,Ke.S,Ke.N],lr=[[-.5,1/6],[-.5,-1/6],[.5,-1/6],[.5,1/6]],hr=[[-1/6,-.5],[1/6,-.5],[1/6,.5],[-1/6,.5]],fr=[Ke.NW,Ke.SW,Ke.SE,Ke.NE],pr=[Ke.NW,Ke.SW,Ke.SE,Ke.E,Ke.N],dr=[Ke.W,Ke.SW,Ke.SE,Ke.NE,Ke.N],Ar=[Ke.NW,Ke.W,Ke.S,Ke.SE,Ke.NE],gr=[Ke.NW,Ke.SW,Ke.S,Ke.E,Ke.NE],mr=[Ke.NW,Ke.W,[.5,-1/6],[.5,1/6],Ke.N],yr=[[-1/6,-.5],[1/6,-.5],Ke.E,Ke.NE,Ke.N],vr=[[-.5,1/6],[-.5,-1/6],Ke.S,Ke.SE,Ke.E],_r=[Ke.W,Ke.SW,Ke.S,[1/6,.5],[-1/6,.5]],br=[Ke.NW,Ke.W,[-1/6,-.5],[1/6,-.5],Ke.N],xr=[[-.5,1/6],[-.5,-1/6],Ke.E,Ke.NE,Ke.N],wr=[Ke.S,Ke.SE,Ke.E,[1/6,.5],[-1/6,.5]],Er=[Ke.W,Ke.SW,Ke.S,[.5,-1/6],[.5,1/6]],Sr=[Ke.W,Ke.SW,Ke.SE,Ke.E,[1/6,.5],[-1/6,.5]],Or=[[-.5,1/6],[-.5,-1/6],Ke.S,Ke.SE,Ke.NE,Ke.N],Tr=[Ke.NW,Ke.W,[-1/6,-.5],[1/6,-.5],Ke.E,Ke.NE],Pr=[Ke.NW,Ke.SW,Ke.S,[.5,-1/6],[.5,1/6],Ke.N],Mr=[Ke.W,Ke.SW,Ke.S,Ke.E,Ke.NE,Ke.N],Cr=[Ke.NW,Ke.W,Ke.S,Ke.SE,Ke.E,Ke.N],Ir=[[-.5,1/6],[-.5,-1/6],[-1/6,-.5],[1/6,-.5],Ke.E,Ke.NE,Ke.N],kr=[Ke.W,Ke.SW,Ke.S,[.5,-1/6],[.5,1/6],[1/6,.5],[-1/6,.5]],Rr=[Ke.NW,Ke.W,[-1/6,-.5],[1/6,-.5],[.5,-1/6],[.5,1/6],Ke.N],Lr=[[-.5,1/6],[-.5,-1/6],Ke.S,Ke.SE,Ke.E,[1/6,.5],[-1/6,.5]],jr=[[-.5,1/6],[-.5,-1/6],[-1/6,-.5],[1/6,-.5],[.5,-1/6],[.5,1/6],[1/6,.5],[-1/6,.5]],Dr={0:[],1:[[Ke.W,Ke.S]],2:[[Ke.S,Ke.E]],3:[[Ke.W,Ke.E]],4:[[Ke.N,Ke.E]],5:{0:[[Ke.W,Ke.S],[Ke.N,Ke.E]],1:[[Ke.W,Ke.N],[Ke.S,Ke.E]]},6:[[Ke.N,Ke.S]],7:[[Ke.W,Ke.N]],8:[[Ke.W,Ke.N]],9:[[Ke.N,Ke.S]],10:{0:[[Ke.W,Ke.N],[Ke.S,Ke.E]],1:[[Ke.W,Ke.S],[Ke.N,Ke.E]]},11:[[Ke.N,Ke.E]],12:[[Ke.W,Ke.E]],13:[[Ke.S,Ke.E]],14:[[Ke.W,Ke.S]],15:[]};function Br(t){return parseInt(t,4)}var Fr=(Xe={},g()(Xe,Br("0000"),[]),g()(Xe,Br("2222"),[]),g()(Xe,Br("2221"),[$e]),g()(Xe,Br("2212"),[Je]),g()(Xe,Br("2122"),[tr]),g()(Xe,Br("1222"),[er]),g()(Xe,Br("0001"),[$e]),g()(Xe,Br("0010"),[Je]),g()(Xe,Br("0100"),[tr]),g()(Xe,Br("1000"),[er]),g()(Xe,Br("2220"),[rr]),g()(Xe,Br("2202"),[nr]),g()(Xe,Br("2022"),[ir]),g()(Xe,Br("0222"),[or]),g()(Xe,Br("0002"),[rr]),g()(Xe,Br("0020"),[nr]),g()(Xe,Br("0200"),[ir]),g()(Xe,Br("2000"),[or]),g()(Xe,Br("0011"),[ar]),g()(Xe,Br("0110"),[sr]),g()(Xe,Br("1100"),[ur]),g()(Xe,Br("1001"),[cr]),g()(Xe,Br("2211"),[ar]),g()(Xe,Br("2112"),[sr]),g()(Xe,Br("1122"),[ur]),g()(Xe,Br("1221"),[cr]),g()(Xe,Br("2200"),[lr]),g()(Xe,Br("2002"),[hr]),g()(Xe,Br("0022"),[lr]),g()(Xe,Br("0220"),[hr]),g()(Xe,Br("1111"),[fr]),g()(Xe,Br("1211"),[pr]),g()(Xe,Br("2111"),[dr]),g()(Xe,Br("1112"),[Ar]),g()(Xe,Br("1121"),[gr]),g()(Xe,Br("1011"),[pr]),g()(Xe,Br("0111"),[dr]),g()(Xe,Br("1110"),[Ar]),g()(Xe,Br("1101"),[gr]),g()(Xe,Br("1200"),[mr]),g()(Xe,Br("0120"),[yr]),g()(Xe,Br("0012"),[vr]),g()(Xe,Br("2001"),[_r]),g()(Xe,Br("1022"),[mr]),g()(Xe,Br("2102"),[yr]),g()(Xe,Br("2210"),[vr]),g()(Xe,Br("0221"),[_r]),g()(Xe,Br("1002"),[br]),g()(Xe,Br("2100"),[xr]),g()(Xe,Br("0210"),[wr]),g()(Xe,Br("0021"),[Er]),g()(Xe,Br("1220"),[br]),g()(Xe,Br("0122"),[xr]),g()(Xe,Br("2012"),[wr]),g()(Xe,Br("2201"),[Er]),g()(Xe,Br("0211"),[Sr]),g()(Xe,Br("2110"),[Or]),g()(Xe,Br("1102"),[Tr]),g()(Xe,Br("1021"),[Pr]),g()(Xe,Br("2011"),[Sr]),g()(Xe,Br("0112"),[Or]),g()(Xe,Br("1120"),[Tr]),g()(Xe,Br("1201"),[Pr]),g()(Xe,Br("2101"),[Mr]),g()(Xe,Br("0121"),[Mr]),g()(Xe,Br("1012"),[Cr]),g()(Xe,Br("1210"),[Cr]),g()(Xe,Br("0101"),{0:[$e,tr],1:[Mr],2:[Mr]}),g()(Xe,Br("1010"),{0:[er,Je],1:[Cr],2:[Cr]}),g()(Xe,Br("2121"),{0:[Mr],1:[Mr],2:[$e,tr]}),g()(Xe,Br("1212"),{0:[Cr],1:[Cr],2:[er,Je]}),g()(Xe,Br("2120"),{0:[Ir],1:[Ir],2:[rr,tr]}),g()(Xe,Br("2021"),{0:[kr],1:[kr],2:[$e,ir]}),g()(Xe,Br("1202"),{0:[Rr],1:[Rr],2:[er,nr]}),g()(Xe,Br("0212"),{0:[Lr],1:[Lr],2:[Je,or]}),g()(Xe,Br("0102"),{0:[rr,tr],1:[Ir],2:[Ir]}),g()(Xe,Br("0201"),{0:[$e,ir],1:[kr],2:[kr]}),g()(Xe,Br("1020"),{0:[er,nr],1:[Rr],2:[Rr]}),g()(Xe,Br("2010"),{0:[Je,or],1:[Lr],2:[Lr]}),g()(Xe,Br("2020"),{0:[or,nr],1:[jr],2:[rr,ir]}),g()(Xe,Br("0202"),{0:[ir,rr],1:[jr],2:[or,nr]}),Xe);function zr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Nr(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?zr(Object(r),!0).forEach((function(e){g()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):zr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var Ur=1,Vr=2,Gr={zIndex:0,zOffset:.005};function Wr(t,e){return Array.isArray(e)?t<e[0]?0:t<e[1]?1:2:t>=e?1:0}function Hr(t){var e=t.cellWeights,r=t.x,n=t.y,i=t.width,o=t.height,a=t.threshold;t.thresholdValue&&(m.a.deprecated("thresholdValue","threshold")(),a=t.thresholdValue);var s=r<0,u=r>=i-1,c=n<0,l=n>=o-1,h=s||u||c||l,f={},p={};s||l?p.top=0:(f.top=e[(n+1)*i+r],p.top=Wr(f.top,a)),u||l?p.topRight=0:(f.topRight=e[(n+1)*i+r+1],p.topRight=Wr(f.topRight,a)),u||c?p.right=0:(f.right=e[n*i+r+1],p.right=Wr(f.right,a)),s||c?p.current=0:(f.current=e[n*i+r],p.current=Wr(f.current,a));var d=p.top,A=p.topRight,g=p.right,y=p.current,v=-1;Number.isFinite(a)&&(v=d<<3|A<<2|g<<1|y),Array.isArray(a)&&(v=d<<6|A<<4|g<<2|y);var _=0;return h||(_=Wr((f.top+f.topRight+f.right+f.current)/4,a)),{code:v,meanCode:_}}function qr(t){var e=t.gridOrigin,r=t.cellSize,n=t.x,i=t.y,o=t.code,a=t.meanCode,s=t.type,u=void 0===s?Ur:s,c=Nr(Nr({},Gr),t.thresholdData),l=u===Vr?Fr[o]:Dr[o];Array.isArray(l)||(l=l[a]);var h=c.zIndex*c.zOffset,f=(n+1)*r[0],p=(i+1)*r[1],d=e[0]+f,A=e[1]+p;if(u===Vr){var g=[];return l.forEach((function(t){var e=[];t.forEach((function(t){var n=d+t[0]*r[0],i=A+t[1]*r[1];e.push([n,i,h])})),g.push(e)})),g}var m=[];return l.forEach((function(t){t.forEach((function(t){var e=d+t[0]*r[0],n=A+t[1]*r[1];m.push([e,n,h])}))})),m}function Zr(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Xr(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Xr(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Xr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Qr(t){var e=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(t){return!1}}();return function(){var r,n=d()(t);if(e){var i=d()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return f()(this,r)}}var Yr=[255,255,255,255],Kr={cellSize:{type:"number",min:1,max:1e3,value:1e3},getPosition:{type:"accessor",value:function(t){return t.position}},getWeight:{type:"accessor",value:1},gpuAggregation:!0,aggregation:"SUM",contours:[{threshold:1}],zOffset:.005},$r={data:{props:["cellSize"]},weights:{props:["aggregation"],accessors:["getWeight"]}},Jr=function(t){l()(r,t);var e=Qr(r);function r(){return i()(this,r),e.apply(this,arguments)}return a()(r,[{key:"initializeState",value:function(){var t;u()(d()(r.prototype),"initializeState",this).call(this,{dimensions:$r}),this.setState({contourData:{},projectPoints:!1,weights:{count:{size:1,operation:R.SUM}}}),this.getAttributeManager().add((t={},g()(t,"positions",{size:3,accessor:"getPosition",type:5130,fp64:this.use64bitPositions()}),g()(t,"count",{size:3,accessor:"getWeight"}),t))}},{key:"updateState",value:function(t){u()(d()(r.prototype),"updateState",this).call(this,t);var e=!1,n=t.oldProps,i=t.props,o=this.state.aggregationDirty;n.contours===i.contours&&n.zOffset===i.zOffset||(e=!0,this._updateThresholdData(t.props)),this.getNumInstances()>0&&(o||e)&&this._generateContours()}},{key:"renderLayers",value:function(){var t=this.state.contourData,e=t.contourSegments,r=t.contourPolygons,n=this.getSubLayerClass("lines",Qe.a),i=this.getSubLayerClass("bands",Ye.a);return[e&&e.length>0&&new n(this.getSubLayerProps({id:"lines"}),{data:this.state.contourData.contourSegments,getSourcePosition:function(t){return t.start},getTargetPosition:function(t){return t.end},getColor:function(t){return t.contour.color||Yr},getWidth:function(t){return t.contour.strokeWidth||1}}),r&&r.length>0&&new i(this.getSubLayerProps({id:"bands"}),{data:this.state.contourData.contourPolygons,getPolygon:function(t){return t.vertices},getFillColor:function(t){return t.contour.color||Yr}})]}},{key:"updateAggregationState",value:function(t){var e=t.props,r=t.oldProps,n=e.cellSize,i=e.coordinateSystem,o=this.context.viewport,a=r.cellSize!==n,s=e.gpuAggregation;this.state.gpuAggregation!==e.gpuAggregation&&s&&!it.isSupported(this.context.gl)&&(m.a.warn("GPU Grid Aggregation not supported, falling back to CPU")(),s=!1);var u=s!==this.state.gpuAggregation;this.setState({gpuAggregation:s});var c=this.state.dimensions,l=this.isAttributeChanged("positions"),h=c.data,f=c.weights,p=this.state.boundingBox;if(l&&(p=ee(this.getAttributes(),this.getNumInstances()),this.setState({boundingBox:p})),l||a){var d=ie(p,n,o,i),A=d.gridOffset,g=d.translation,y=d.width,v=d.height,_=d.numCol,b=d.numRow;this.allocateResources(b,_),this.setState({gridOffset:A,boundingBox:p,translation:g,posOffset:g.slice(),gridOrigin:[-1*g[0],-1*g[1]],width:y,height:v,numCol:_,numRow:b})}var x=l||u||this.isAggregationDirty(t,{dimension:h,compareAll:s}),w=this.isAggregationDirty(t,{dimension:f});w&&this._updateAccessors(t),(x||w)&&this._resetResults(),this.setState({aggregationDataDirty:x,aggregationWeightsDirty:w})}},{key:"_updateAccessors",value:function(t){var e=t.props,r=e.getWeight,n=e.aggregation,i=e.data,o=this.state.weights.count;o&&(o.getWeight=r,o.operation=R[n]),this.setState({getValue:B(n,r,{data:i})})}},{key:"_resetResults",value:function(){var t=this.state.weights.count;t&&(t.aggregationData=null)}},{key:"_generateContours",value:function(){var t=this.state,e=t.numCol,r=t.numRow,n=t.gridOrigin,i=t.gridOffset,o=t.thresholdData,a=this.state.weights.count,s=a.aggregationData;s||(s=a.aggregationBuffer.getData(),a.aggregationData=s);var u=function(t){var e,r=t.thresholdData,n=(t.colors,t.cellWeights),i=t.gridSize,o=t.gridOrigin,a=t.cellSize,s=[],u=[],c=i[0],l=i[1],h=0,f=0,p=Zr(r);try{for(p.s();!(e=p.n()).done;)for(var d=e.value,A=d.contour,g=A.threshold,m=-1;m<c;m++)for(var y=-1;y<l;y++){var v=Hr({cellWeights:n,threshold:g,x:m,y:y,width:c,height:l}),_={gridOrigin:o,cellSize:a,x:m,y:y,width:c,height:l,code:v.code,meanCode:v.meanCode,thresholdData:d};if(Array.isArray(g)){_.type=Vr;var b,x=Zr(qr(_));try{for(x.s();!(b=x.n()).done;){var w=b.value;u[f++]={vertices:w,contour:A}}}catch(t){x.e(t)}finally{x.f()}}else{_.type=Ur;for(var E=qr(_),S=0;S<E.length;S+=2)s[h++]={start:E[S],end:E[S+1],contour:A}}}}catch(t){p.e(t)}finally{p.f()}return{contourSegments:s,contourPolygons:u}}({thresholdData:o,cellWeights:it.getCellData({countsData:s}).cellWeights,gridSize:[e,r],gridOrigin:n,cellSize:[i.xOffset,i.yOffset]});this.setState({contourData:u})}},{key:"_updateThresholdData",value:function(t){for(var e=t.contours,r=t.zOffset,n=e.length,i=new Array(n),o=0;o<n;o++){var a=e[o];i[o]={contour:a,zIndex:a.zIndex||o,zOffset:r}}this.setState({thresholdData:i})}}]),r}(de);Jr.layerName="ContourLayer",Jr.defaultProps=Kr;var tn=r(227),en=r(35),rn=r(275);function nn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function on(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?nn(Object(r),!0).forEach((function(e){g()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):nn(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function an(t){var e=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(t){return!1}}();return function(){var r,n=d()(t);if(e){var i=d()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return f()(this,r)}}var sn={colorDomain:null,colorRange:lt,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},un=function(t){l()(r,t);var e=an(r);function r(){return i()(this,r),e.apply(this,arguments)}return a()(r,[{key:"getShaders",value:function(){return u()(d()(r.prototype),"getShaders",this).call(this,{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 vec4 position_commonspace;\n gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64Low, pos, position_commonspace);\n\n vec3 normals_commonspace = project_normal(normals);\n\n if (extruded) {\n vec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, position_commonspace.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:[k.a,tn.a,ut.a,P]})}},{key:"initializeState",value:function(){var t=this.context.gl;this.getAttributeManager().addInstanced({colors:{size:4,noAlloc:!0},elevations:{size:4,noAlloc:!0}});var e=this._getModel(t);this._setupUniformBuffer(e),this.setState({model:e})}},{key:"_getModel",value:function(t){return new x.a(t,on(on({},this.getShaders()),{},{id:this.props.id,geometry:new rn.a,isInstanced:!0}))}},{key:"draw",value:function(t){var e=t.uniforms,r=this.props,n=r.cellSize,i=r.offset,o=r.extruded,a=r.elevationScale,s=r.coverage,u=r.gridSize,c=r.gridOrigin,l=r.gridOffset,h=r.elevationRange,f=r.colorMaxMinBuffer,p=r.elevationMaxMinBuffer,d=[Object(en.b)(c[0]),Object(en.b)(c[1])],A=[Object(en.b)(l[0]),Object(en.b)(l[1])],g=this.getDomainUniforms(),m=ht(this.props.colorRange);this.bindUniformBuffers(f,p),this.state.model.setUniforms(e).setUniforms(g).setUniforms({cellSize:n,offset:i,extruded:o,elevationScale:a,coverage:s,gridSize:u,gridOrigin:c,gridOriginLow:d,gridOffset:l,gridOffsetLow:A,colorRange:m,elevationRange:h}).draw(),this.unbindUniformBuffers(f,p)}},{key:"bindUniformBuffers",value:function(t,e){t.bind({target:35345,index:0}),e.bind({target:35345,index:1})}},{key:"unbindUniformBuffers",value:function(t,e){t.unbind({target:35345,index:0}),e.unbind({target:35345,index:1})}},{key:"getDomainUniforms",value:function(){var t=this.props,e=t.colorDomain,r=t.elevationDomain,n={};return null!==e?(n.colorDomainValid=!0,n.colorDomain=e):n.colorDomainValid=!1,null!==r?(n.elevationDomainValid=!0,n.elevationDomain=r):n.elevationDomainValid=!1,n}},{key:"_setupUniformBuffer",value:function(t){var e=this.context.gl,r=t.program.handle,n=e.getUniformBlockIndex(r,"ColorData"),i=e.getUniformBlockIndex(r,"ElevationData");e.uniformBlockBinding(r,n,0),e.uniformBlockBinding(r,i,1)}}]),r}(ct.a);function cn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ln(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?cn(Object(r),!0).forEach((function(e){g()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):cn(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function hn(t){var e=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(t){return!1}}();return function(){var r,n=d()(t);if(e){var i=d()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return f()(this,r)}}un.layerName="GPUGridCellLayer",un.defaultProps=sn;var fn={colorDomain:null,colorRange:lt,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:function(t){return t.position}},extruded:!1,material:!0},pn={data:{props:["cellSize","colorAggregation","elevationAggregation"]}},dn=function(t){l()(r,t);var e=hn(r);function r(){return i()(this,r),e.apply(this,arguments)}return a()(r,[{key:"initializeState",value:function(){var t,e=this.context.gl,n=it.isSupported(e);n||m.a.error("GPUGridLayer is not supported on this browser, use GridLayer instead")(),u()(d()(r.prototype),"initializeState",this).call(this,{dimensions:pn}),this.setState({gpuAggregation:!0,projectPoints:!1,isSupported:n,weights:{color:{needMin:!0,needMax:!0,combineMaxMin:!0,maxMinBuffer:new Pt.a(e,{byteLength:16,accessor:{size:4,type:5126,divisor:1}})},elevation:{needMin:!0,needMax:!0,combineMaxMin:!0,maxMinBuffer:new Pt.a(e,{byteLength:16,accessor:{size:4,type:5126,divisor:1}})}},positionAttributeName:"positions"}),this.getAttributeManager().add((t={},g()(t,"positions",{size:3,accessor:"getPosition",type:5130,fp64:this.use64bitPositions()}),g()(t,"color",{size:3,accessor:"getColorWeight"}),g()(t,"elevation",{size:3,accessor:"getElevationWeight"}),t))}},{key:"updateState",value:function(t){!1!==this.state.isSupported&&(u()(d()(r.prototype),"updateState",this).call(this,t),this.state.aggregationDirty&&this.setState({gridHash:null}))}},{key:"getHashKeyForIndex",value:function(t){var e=this.state,r=e.numRow,n=e.numCol,i=e.boundingBox,o=e.gridOffset,a=[n,r],s=[i.xMin,i.yMin],u=[o.xOffset,o.yOffset],c=Math.floor(t/a[0]),l=t-c*a[0],h=Math.floor((c*u[1]+s[1]+90+u[1]/2)/u[1]),f=Math.floor((l*u[0]+s[0]+180+u[0]/2)/u[0]);return"".concat(h,"-").concat(f)}},{key:"getPositionForIndex",value:function(t){var e=this.state,r=e.numRow,n=e.numCol,i=e.boundingBox,o=e.gridOffset,a=[n,r],s=[i.xMin,i.yMin],u=[o.xOffset,o.yOffset],c=Math.floor(t/a[0]);return[(t-c*a[0])*u[0]+s[0],c*u[1]+s[1]]}},{key:"getPickingInfo",value:function(t){var e=t.info,r=t.mode,n=e.index,i=null;if(n>=0){var o=this.state.gpuGridAggregator,a=this.getPositionForIndex(n),s=it.getAggregationData(ln({pixelIndex:n},o.getData("color"))),u=it.getAggregationData(ln({pixelIndex:n},o.getData("elevation")));if(i={colorValue:s.cellWeight,elevationValue:u.cellWeight,count:s.cellCount||u.cellCount,position:a,totalCount:s.totalCount||u.totalCount},"hover"!==r){var c=this.props,l=this.state.gridHash;if(!l){var h=this.state,f=h.gridOffset,p=h.translation,d=h.boundingBox,A=this.context.viewport;l=le(c,{gridOffset:f,attributes:this.getAttributes(),viewport:A,translation:p,boundingBox:d}).gridHash,this.setState({gridHash:l})}var g=l[this.getHashKeyForIndex(n)];Object.assign(i,g)}}return e.picked=Boolean(i),e.object=i,e}},{key:"renderLayers",value:function(){if(!this.state.isSupported)return null;var t=this.props,e=t.elevationScale,r=t.extruded,n=t.cellSize,i=t.coverage,o=t.material,a=t.elevationRange,s=t.colorDomain,u=t.elevationDomain,c=this.state,l=c.weights,h=c.numRow,f=c.numCol,p=c.gridOrigin,d=c.gridOffset,A=l.color,g=l.elevation,m=ht(this.props.colorRange);return new(this.getSubLayerClass("gpu-grid-cell",un))({gridSize:[f,h],gridOrigin:p,gridOffset:[d.xOffset,d.yOffset],colorRange:m,elevationRange:a,colorDomain:s,elevationDomain:u,cellSize:n,coverage:i,material:o,elevationScale:e,extruded:r},this.getSubLayerProps({id:"gpu-grid-cell"}),{data:{attributes:{colors:A.aggregationBuffer,elevations:g.aggregationBuffer}},colorMaxMinBuffer:A.maxMinBuffer,elevationMaxMinBuffer:g.maxMinBuffer,numInstances:f*h})}},{key:"finalizeState",value:function(){var t=this.state.weights;[t.color,t.elevation].forEach((function(t){var e=t.aggregationBuffer;t.maxMinBuffer.delete(),null==e||e.delete()})),u()(d()(r.prototype),"finalizeState",this).call(this)}},{key:"updateAggregationState",value:function(t){var e=t.props,r=t.oldProps,n=e.cellSize,i=e.coordinateSystem,o=this.context.viewport,a=r.cellSize!==n,s=this.state.dimensions,u=this.isAttributeChanged("positions"),c=u||this.isAttributeChanged(),l=this.state.boundingBox;if(u&&(l=ee(this.getAttributes(),this.getNumInstances()),this.setState({boundingBox:l})),u||a){var h=ie(l,n,o,i),f=h.gridOffset,p=h.translation,d=h.width,A=h.height,g=h.numCol,m=h.numRow;this.allocateResources(m,g),this.setState({gridOffset:f,translation:p,gridOrigin:[-1*p[0],-1*p[1]],width:d,height:A,numCol:g,numRow:m})}var y=c||this.isAggregationDirty(t,{dimension:s.data,compareAll:!0});y&&this._updateAccessors(t),this.setState({aggregationDataDirty:y})}},{key:"_updateAccessors",value:function(t){var e=t.props,r=e.colorAggregation,n=e.elevationAggregation,i=this.state.weights,o=i.color,a=i.elevation;o.operation=R[r],a.operation=R[n]}}]),r}(de);function An(t){var e=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(t){return!1}}();return function(){var r,n=d()(t);if(e){var i=d()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return f()(this,r)}}function gn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function mn(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?gn(Object(r),!0).forEach((function(e){g()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):gn(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}dn.layerName="GPUGridLayer",dn.defaultProps=fn;var yn=mn(mn(mn({},dn.defaultProps),Le.defaultProps),{},{gpuAggregation:!1}),vn=function(t){l()(r,t);var e=An(r);function r(){return i()(this,r),e.apply(this,arguments)}return a()(r,[{key:"initializeState",value:function(){this.state={useGPUAggregation:!0}}},{key:"updateState",value:function(t){t.oldProps;var e=t.props,r=(t.changeFlags,{});r.useGPUAggregation=this.canUseGPUAggregation(e),this.setState(r)}},{key:"renderLayers",value:function(){var t=this.props,e=t.data,r=t.updateTriggers,n=this.state.useGPUAggregation?"GPU":"CPU";return new(this.state.useGPUAggregation?this.getSubLayerClass("GPU",dn):this.getSubLayerClass("CPU",Le))(this.props,this.getSubLayerProps({id:n,updateTriggers:r}),{data:e})}},{key:"canUseGPUAggregation",value:function(t){var e=t.gpuAggregation,r=t.lowerPercentile,n=t.upperPercentile,i=t.getColorValue,o=t.getElevationValue,a=t.colorScaleType;return!!e&&(!!it.isSupported(this.context.gl)&&(0===r&&100===n&&(null===i&&null===o&&("quantile"!==a&&"ordinal"!==a))))}}]),r}(xt.a);function _n(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return bn(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return bn(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function bn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function xn(t){var e=t.map((function(t){return t[0]})),r=t.map((function(t){return t[1]})),n=Math.min.apply(null,e),i=Math.max.apply(null,e);return[n,Math.min.apply(null,r),i,Math.max.apply(null,r)]}function wn(t,e){return e[0]>=t[0]&&e[2]<=t[2]&&e[1]>=t[1]&&e[3]<=t[3]}vn.layerName="GridLayer",vn.defaultProps=yn;var En=new Float32Array(12);function Sn(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n=0,i=_n(t);try{for(i.s();!(e=i.n()).done;)for(var o=e.value,a=0;a<r;a++)En[n++]=o[a]||0}catch(t){i.e(t)}finally{i.f()}return En}function On(t,e,r){var n=Ct()(t,4),i=n[0],o=n[1],a=n[2],s=n[3],u=a-i,c=s-o,l=u,h=c;u/c<e/r?l=e/r*c:h=r/e*u,l<e&&(l=e,h=r);var f=(a+i)/2,p=(s+o)/2;return[f-l/2,p-h/2,f+l/2,p+h/2]}function Tn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Pn(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Tn(Object(r),!0).forEach((function(e){g()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Tn(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Mn(t){var e=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(t){return!1}}();return function(){var r,n=d()(t);if(e){var i=d()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return f()(this,r)}}var Cn=function(t){l()(r,t);var e=Mn(r);function r(){return i()(this,r),e.apply(this,arguments)}return a()(r,[{key:"getShaders",value:function(){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:[k.a]}}},{key:"initializeState",value:function(){var t=this.context.gl;this.getAttributeManager().add({positions:{size:3,noAlloc:!0},texCoords:{size:2,noAlloc:!0}}),this.setState({model:this._getModel(t)})}},{key:"_getModel",value:function(t){var e=this.props.vertexCount;return new x.a(t,Pn(Pn({},this.getShaders()),{},{id:this.props.id,geometry:new st.a({drawMode:6,vertexCount:e})}))}},{key:"draw",value:function(t){var e=t.uniforms,r=this.state.model,n=this.props,i=n.texture,o=n.maxTexture,a=n.colorTexture,s=n.intensity,u=n.threshold,c=n.aggregationMode,l=n.colorDomain;r.setUniforms(Pn(Pn({},e),{},{texture:i,maxTexture:o,colorTexture:a,intensity:s,threshold:u,aggregationMode:c,colorDomain:l})).draw()}}]),r}(ct.a);Cn.layerName="TriangleLayer";var In;function kn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Rn(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?kn(Object(r),!0).forEach((function(e){g()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):kn(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Ln(t){var e=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(t){return!1}}();return function(){var r,n=d()(t);if(e){var i=d()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return f()(this,r)}}var jn={mipmaps:!1,parameters:(In={},g()(In,10240,9729),g()(In,10241,9729),g()(In,10242,33071),g()(In,10243,33071),In),dataFormat:6408},Dn=[0,0],Bn={SUM:0,MEAN:1},Fn={getPosition:{type:"accessor",value:function(t){return t.position}},getWeight:{type:"accessor",value:1},intensity:{type:"number",min:0,value:1},radiusPixels:{type:"number",min:1,max:100,value:50},colorRange:lt,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}},zn=[y.a.BLEND_EQUATION_MINMAX,y.a.TEXTURE_FLOAT],Nn={data:{props:["radiusPixels"]}},Un=function(t){l()(r,t);var e=Ln(r);function r(){return i()(this,r),e.apply(this,arguments)}return a()(r,[{key:"initializeState",value:function(){var t=this.context.gl;if(!Object(v.c)(t,zn))return this.setState({supported:!1}),void m.a.error("HeatmapLayer: ".concat(this.id," is not supported on this browser"))();u()(d()(r.prototype),"initializeState",this).call(this,Nn),this.setState({supported:!0,colorDomain:Dn}),this._setupTextureParams(),this._setupAttributes(),this._setupResources()}},{key:"shouldUpdateState",value:function(t){return t.changeFlags.somethingChanged}},{key:"updateState",value:function(t){this.state.supported&&(u()(d()(r.prototype),"updateState",this).call(this,t),this._updateHeatmapState(t))}},{key:"_updateHeatmapState",value:function(t){var e=t.props,r=t.oldProps,n=this._getChangeFlags(t);(n.dataChanged||n.viewportChanged)&&(n.boundsChanged=this._updateBounds(n.dataChanged),this._updateTextureRenderingBounds()),n.dataChanged||n.boundsChanged?(clearTimeout(this.state.updateTimer),this.setState({isWeightMapDirty:!0})):n.viewportZoomChanged&&this._debouncedUpdateWeightmap(),e.colorRange!==r.colorRange&&this._updateColorTexture(t),this.state.isWeightMapDirty&&this._updateWeightmap(),this.setState({zoom:t.context.viewport.zoom})}},{key:"renderLayers",value:function(){if(!this.state.supported)return[];var t=this.state,e=t.weightsTexture,r=t.triPositionBuffer,n=t.triTexCoordBuffer,i=t.maxWeightsTexture,o=t.colorTexture,a=t.colorDomain,s=this.props,u=s.updateTriggers,c=s.intensity,l=s.threshold,h=s.aggregation;return new(this.getSubLayerClass("triangle",Cn))(this.getSubLayerProps({id:"triangle-layer",updateTriggers:u}),{coordinateSystem:Jt.a.DEFAULT,data:{attributes:{positions:r,texCoords:n}},vertexCount:4,maxTexture:i,colorTexture:o,aggregationMode:Bn[h]||0,texture:e,intensity:c,threshold:l,colorDomain:a})}},{key:"finalizeState",value:function(){u()(d()(r.prototype),"finalizeState",this).call(this);var t=this.state,e=t.weightsTransform,n=t.weightsTexture,i=t.maxWeightTransform,o=t.maxWeightsTexture,a=t.triPositionBuffer,s=t.triTexCoordBuffer,c=t.colorTexture,l=t.updateTimer;null==e||e.delete(),null==n||n.delete(),null==i||i.delete(),null==o||o.delete(),null==a||a.delete(),null==s||s.delete(),null==c||c.delete(),l&&clearTimeout(l)}},{key:"_getAttributeManager",value:function(){return new bt.a(this.context.gl,{id:this.props.id,stats:this.context.stats})}},{key:"_getChangeFlags",value:function(t){var e={},r=this.state.dimensions;e.dataChanged=this.isAttributeChanged()||this.isAggregationDirty(t,{compareAll:!0,dimension:r.data}),e.viewportChanged=t.changeFlags.viewportChanged;var n=this.state.zoom;return t.context.viewport&&t.context.viewport.zoom===n||(e.viewportZoomChanged=!0),e}},{key:"_createTextures",value:function(){var t=this.context.gl,e=this.state,r=e.textureSize,n=e.format,i=e.type;this.setState({weightsTexture:new q.a(t,Rn({width:r,height:r,format:n,type:i},jn)),maxWeightsTexture:new q.a(t,Rn({format:n,type:i},jn))})}},{key:"_setupAttributes",value:function(){this.getAttributeManager().add({positions:{size:3,type:5130,accessor:"getPosition"},weights:{size:1,accessor:"getWeight"}}),this.setState({positionAttributeName:"positions"})}},{key:"_setupTextureParams",value:function(){var t=this.context.gl,e=this.props.weightsTextureSize,r=Math.min(e,Object(_.f)(t,3379)),n=Object(v.c)(t,y.a.COLOR_ATTACHMENT_RGBA32F),i=function(t){var e=t.gl,r=t.floatTargetSupport;return{format:Object(_.j)(e)?34836:6408,type:r?5126:5121}}({gl:t,floatTargetSupport:n}),o=i.format,a=i.type,s=n?1:1/255;this.setState({textureSize:r,format:o,type:a,weightsScale:s}),n||m.a.warn("HeatmapLayer: ".concat(this.id," rendering to float texture not supported, fallingback to low precession format"))()}},{key:"getShaders",value:function(t){return u()(d()(r.prototype),"getShaders",this).call(this,"max-weights-transform"===t?{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"})}},{key:"_createWeightsTransform",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=this.context.gl,n=this.state.weightsTransform,i=this.state.weightsTexture;null===(t=n)||void 0===t||t.delete(),n=new w.a(r,Rn({id:"".concat(this.id,"-weights-transform"),elementCount:1,_targetTexture:i,_targetTextureVarying:"weightsTexture"},e)),this.setState({weightsTransform:n})}},{key:"_setupResources",value:function(){var t=this.context.gl;this._createTextures();var e=this.state,r=e.textureSize,n=e.weightsTexture,i=e.maxWeightsTexture,o=this.getShaders("weights-transform");this._createWeightsTransform(o);var a=this.getShaders("max-weights-transform"),s=new w.a(t,Rn(Rn({id:"".concat(this.id,"-max-weights-transform"),_sourceTextures:{inTexture:n},_targetTexture:i,_targetTextureVarying:"outTexture"},a),{},{elementCount:r*r}));this.setState({weightsTexture:n,maxWeightsTexture:i,maxWeightTransform:s,zoom:null,triPositionBuffer:new Pt.a(t,{byteLength:48,accessor:{size:3}}),triTexCoordBuffer:new Pt.a(t,{byteLength:48,accessor:{size:2}})})}},{key:"updateShaders",value:function(t){this._createWeightsTransform(t)}},{key:"_updateMaxWeightValue",value:function(){this.state.maxWeightTransform.run({parameters:{blend:!0,depthTest:!1,blendFunc:[1,1],blendEquation:32776}})}},{key:"_updateBounds",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.context.viewport,r=[e.unproject([0,0]),e.unproject([e.width,0]),e.unproject([e.width,e.height]),e.unproject([0,e.height])].map((function(t){return t.map(Math.fround)})),n=xn(r),i={visibleWorldBounds:n,viewportCorners:r},o=!1;if(t||!this.state.worldBounds||!wn(this.state.worldBounds,n)){var a=this._worldToCommonBounds(n),s=this._commonToWorldBounds(a);this.props.coordinateSystem===Jt.a.LNGLAT&&(s[1]=Math.max(s[1],-85.051129),s[3]=Math.min(s[3],85.051129),s[0]=Math.max(s[0],-360),s[2]=Math.min(s[2],360));var u=this._worldToCommonBounds(s);i.worldBounds=s,i.normalizedCommonBounds=u,o=!0}return this.setState(i),o}},{key:"_updateTextureRenderingBounds",value:function(){var t=this.state,e=t.triPositionBuffer,r=t.triTexCoordBuffer,n=t.normalizedCommonBounds,i=t.viewportCorners,o=this.context.viewport;e.subData(Sn(i,3));var a=i.map((function(t){return e=o.projectPosition(t),r=n,i=Ct()(r,4),a=i[0],s=i[1],u=i[2],c=i[3],[(e[0]-a)/(u-a),(e[1]-s)/(c-s)];var e,r,i,a,s,u,c}));r.subData(Sn(a,2))}},{key:"_updateColorTexture",value:function(t){var e=t.props.colorRange,r=this.state.colorTexture,n=ht(e,!1,Uint8Array);r?r.setImageData({data:n,width:e.length}):r=new q.a(this.context.gl,Rn({data:n,width:e.length,height:1},jn)),this.setState({colorTexture:r})}},{key:"_updateWeightmap",value:function(){var t,e=this.props,r=e.radiusPixels,n=e.colorDomain,i=e.aggregation,o=this.state,a=o.weightsTransform,s=o.worldBounds,u=o.textureSize,c=o.weightsTexture,l=o.weightsScale;this.state.isWeightMapDirty=!1;var h=this._worldToCommonBounds(s,{useLayerCoordinateSystem:!0});if(n&&"SUM"===i){var f=this.context.viewport.distanceScales.metersPerUnit[2]*(h[2]-h[0])/u;this.state.colorDomain=n.map((function(t){return t*f*l}))}else this.state.colorDomain=n||Dn;var p={radiusPixels:r,commonBounds:h,textureWidth:u,weightsScale:l};a.update({elementCount:this.getNumInstances()}),a.run({uniforms:p,parameters:{blend:!0,depthTest:!1,blendFunc:[1,1],blendEquation:32774},clearRenderTarget:!0,attributes:this.getAttributes(),moduleSettings:this.getModuleSettings()}),this._updateMaxWeightValue(),c.setParameters((t={},g()(t,10240,9729),g()(t,10241,9729),t))}},{key:"_debouncedUpdateWeightmap",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.state.updateTimer,r=this.props.debounceTimeout;t?(e=null,this._updateBounds(!0),this._updateTextureRenderingBounds(),this.setState({isWeightMapDirty:!0})):(this.setState({isWeightMapDirty:!1}),clearTimeout(e),e=setTimeout(this._debouncedUpdateWeightmap.bind(this,!0),r)),this.setState({updateTimer:e})}},{key:"_worldToCommonBounds",value:function(t){var e,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.useLayerCoordinateSystem,o=void 0!==i&&i,a=Ct()(t,4),s=a[0],u=a[1],c=a[2],l=a[3],h=this.context.viewport,f=this.state.textureSize,p=this.props.coordinateSystem,d=o&&(p===Jt.a.LNGLAT_OFFSETS||p===Jt.a.METER_OFFSETS),A=d?h.projectPosition(this.props.coordinateOrigin):[0,0],g=2*f/h.scale;return o&&!d?(e=this.projectPosition([s,u,0]),r=this.projectPosition([c,l,0])):(e=h.projectPosition([s,u,0]),r=h.projectPosition([c,l,0])),On([e[0]-A[0],e[1]-A[1],r[0]-A[0],r[1]-A[1]],g,g)}},{key:"_commonToWorldBounds",value:function(t){var e=Ct()(t,4),r=e[0],n=e[1],i=e[2],o=e[3],a=this.context.viewport,s=a.unprojectPosition([r,n]),u=a.unprojectPosition([i,o]);return s.slice(0,2).concat(u.slice(0,2))}}]),r}(Tt);Un.layerName="HeatmapLayer",Un.defaultProps=Fn,r.d(e,"ScreenGridLayer",(function(){return _e})),r.d(e,"CPUGridLayer",(function(){return Le})),r.d(e,"HexagonLayer",(function(){return Ze})),r.d(e,"ContourLayer",(function(){return Jr})),r.d(e,"GridLayer",(function(){return vn})),r.d(e,"GPUGridLayer",(function(){return dn})),r.d(e,"AGGREGATION_OPERATION",(function(){return R})),r.d(e,"HeatmapLayer",(function(){return Un})),r.d(e,"_GPUGridAggregator",(function(){return it})),r.d(e,"_CPUAggregator",(function(){return Ce})),r.d(e,"_AggregationLayer",(function(){return Tt})),r.d(e,"_BinSorter",(function(){return Kt}))},function(t,e,r){"use strict";r.r(e);var n=r(176),i=r(294),o=r(195),a=r(290),s=r(7),u=r(179),c=r(240),l=r(197),h=r(230),f=r(34),p=r(293),d=r(71),A=r(100),g=r(98),m=r(231),y=r(232),v=r(289),_=r(62),b=r(48);const x={x:[2,0,1],y:[0,1,2],z:[1,2,0]};class w extends _.a{constructor(t={}){const{id:e=Object(b.c)("truncated-code-geometry")}=t,{indices:r,attributes:n}=function(t){const{bottomRadius:e=0,topRadius:r=0,height:n=1,nradial:i=10,nvertical:o=10,verticalAxis:a="y",topCap:s=!1,bottomCap:u=!1}=t,c=(s?2:0)+(u?2:0),l=(i+1)*(o+1+c),h=Math.atan2(e-r,n),f=Math.sin,p=Math.cos,d=Math.PI,A=p(h),g=f(h),m=s?-2:0,y=o+(u?2:0),v=i+1,_=new Uint16Array(i*(o+c)*6),b=x[a],w=new Float32Array(3*l),E=new Float32Array(3*l),S=new Float32Array(2*l);let O=0,T=0;for(let t=m;t<=y;t++){let a,s=t/o,u=n*s;t<0?(u=0,s=1,a=e):t>o?(u=n,s=1,a=r):a=e+t/o*(r-e),-2!==t&&t!==o+2||(a=0,s=0),u-=n/2;for(let e=0;e<v;e++){const r=f(e*d*2/i),n=p(e*d*2/i);w[O+b[0]]=r*a,w[O+b[1]]=u,w[O+b[2]]=n*a,E[O+b[0]]=t<0||t>o?0:r*A,E[O+b[1]]=t<0?-1:t>o?1:g,E[O+b[2]]=t<0||t>o?0:n*A,S[T+0]=e/i,S[T+1]=s,T+=2,O+=3}}for(let t=0;t<o+c;t++)for(let e=0;e<i;e++){const r=6*(t*i+e);_[r+0]=v*(t+0)+0+e,_[r+1]=v*(t+0)+1+e,_[r+2]=v*(t+1)+1+e,_[r+3]=v*(t+0)+0+e,_[r+4]=v*(t+1)+1+e,_[r+5]=v*(t+1)+0+e}return{indices:_,attributes:{POSITION:{size:3,value:w},NORMAL:{size:3,value:E},TEXCOORD_0:{size:2,value:S}}}}(t);super({...t,id:e,indices:r,attributes:{...n,...t.attributes}})}}class E extends w{constructor(t={}){const{id:e=Object(b.c)("cone-geometry"),radius:r=1,cap:n=!0}=t;super({...t,id:e,topRadius:0,topCap:Boolean(n),bottomCap:Boolean(n),bottomRadius:r})}}var S=r(275);class O extends w{constructor(t={}){const{id:e=Object(b.c)("cylinder-geometry"),radius:r=1}=t;super({...t,id:e,bottomRadius:r,topRadius:r})}}var T=r(147);const P=[-1,0,0,0,1,0,0,0,-1,0,0,1,0,-1,0,1,0,0],M=[3,4,5,3,5,1,3,1,0,3,0,4,4,0,2,4,2,5,2,0,1,5,2,1];class C extends _.a{constructor(t={}){const{id:e=Object(b.c)("ico-sphere-geometry")}=t,{indices:r,attributes:n}=function(t){const{iterations:e=0}=t,r=Math.PI,n=2*r,i=[...P];let o=[...M];i.push(),o.push();const a=(()=>{const t={};return(e,r)=>{const n=`${(e*=3)<(r*=3)?e:r}|${e>r?e:r}`;if(n in t)return t[n];const o=i[e],a=i[e+1],s=i[e+2];let u=(o+i[r])/2,c=(a+i[r+1])/2,l=(s+i[r+2])/2;const h=Math.sqrt(u*u+c*c+l*l);return u/=h,c/=h,l/=h,i.push(u,c,l),t[n]=i.length/3-1}})();for(let t=0;t<e;t++){const t=[];for(let e=0;e<o.length;e+=3){const r=a(o[e+0],o[e+1]),n=a(o[e+1],o[e+2]),i=a(o[e+2],o[e+0]);t.push(i,o[e+0],r,r,o[e+1],n,n,o[e+2],i,r,n,i)}o=t}const s=new Array(i.length),u=new Array(i.length/3*2);for(let t=o.length-3;t>=0;t-=3){const e=o[t+0],a=o[t+1],c=o[t+2],l=3*e,h=3*a,f=3*c,p=2*e,d=2*a,A=2*c,g=i[l+0],m=i[l+1],y=i[l+2],v=Math.acos(y/Math.sqrt(g*g+m*m+y*y)),_=Math.atan2(m,g)+r,b=v/r,x=1-_/n,w=i[h+0],E=i[h+1],S=i[h+2],O=Math.acos(S/Math.sqrt(w*w+E*E+S*S)),P=Math.atan2(E,w)+r,M=O/r,C=1-P/n,I=i[f+0],k=i[f+1],R=i[f+2],L=Math.acos(R/Math.sqrt(I*I+k*k+R*R)),j=Math.atan2(k,I)+r,D=L/r,B=1-j/n,F=[I-w,k-E,R-S],z=[g-w,m-E,y-S],N=new T.a(F).cross(z).normalize();let U;(0===x||0===C||0===B)&&(0===x||x>.5)&&(0===C||C>.5)&&(0===B||B>.5)&&(i.push(i[l+0],i[l+1],i[l+2]),U=i.length/3-1,o.push(U),u[2*U+0]=1,u[2*U+1]=b,s[3*U+0]=N.x,s[3*U+1]=N.y,s[3*U+2]=N.z,i.push(i[h+0],i[h+1],i[h+2]),U=i.length/3-1,o.push(U),u[2*U+0]=1,u[2*U+1]=M,s[3*U+0]=N.x,s[3*U+1]=N.y,s[3*U+2]=N.z,i.push(i[f+0],i[f+1],i[f+2]),U=i.length/3-1,o.push(U),u[2*U+0]=1,u[2*U+1]=D,s[3*U+0]=N.x,s[3*U+1]=N.y,s[3*U+2]=N.z),s[l+0]=s[h+0]=s[f+0]=N.x,s[l+1]=s[h+1]=s[f+1]=N.y,s[l+2]=s[h+2]=s[f+2]=N.z,u[p+0]=x,u[p+1]=b,u[d+0]=C,u[d+1]=M,u[A+0]=B,u[A+1]=D}return{indices:{size:1,value:new Uint16Array(o)},attributes:{POSITION:{size:3,value:new Float32Array(i)},NORMAL:{size:3,value:new Float32Array(s)},TEXCOORD_0:{size:2,value:new Float32Array(u)}}}}(t);super({...t,id:e,indices:r,attributes:{...n,...t.attributes}})}}class I extends _.a{constructor(t={}){const{id:e=Object(b.c)("plane-geometry")}=t,{indices:r,attributes:n}=function(t){const{type:e="x,y",offset:r=0,flipCull:n=!1,unpack:i=!1}=t,o=e.split(",");let a=t[`${o[0]}len`]||1;const s=t[`${o[1]}len`]||1,u=t[`n${o[0]}`]||1,c=t[`n${o[1]}`]||1,l=(u+1)*(c+1),h=new Float32Array(3*l),f=new Float32Array(3*l),p=new Float32Array(2*l);n&&(a=-a);let d=0,A=0;for(let t=0;t<=c;t++)for(let i=0;i<=u;i++){const o=i/u,l=t/c;switch(p[d+0]=n?1-o:o,p[d+1]=l,e){case"x,y":h[A+0]=a*o-.5*a,h[A+1]=s*l-.5*s,h[A+2]=r,f[A+0]=0,f[A+1]=0,f[A+2]=n?1:-1;break;case"x,z":h[A+0]=a*o-.5*a,h[A+1]=r,h[A+2]=s*l-.5*s,f[A+0]=0,f[A+1]=n?1:-1,f[A+2]=0;break;case"y,z":h[A+0]=r,h[A+1]=a*o-.5*a,h[A+2]=s*l-.5*s,f[A+0]=n?1:-1,f[A+1]=0,f[A+2]=0;break;default:throw new Error("PlaneGeometry: unknown type")}d+=2,A+=3}const g=u+1,m=new Uint16Array(u*c*6);for(let t=0;t<c;t++)for(let e=0;e<u;e++){const r=6*(t*u+e);m[r+0]=(t+0)*g+e,m[r+1]=(t+1)*g+e,m[r+2]=(t+0)*g+e+1,m[r+3]=(t+1)*g+e,m[r+4]=(t+1)*g+e+1,m[r+5]=(t+0)*g+e+1}const y={indices:{size:1,value:m},attributes:{POSITION:{size:3,value:h},NORMAL:{size:3,value:f},TEXCOORD_0:{size:2,value:p}}};return i?function(t){const{indices:e,attributes:r}=t;if(!e)return t;const n=e.value.length,i={};for(const t in r){const o=r[t],{constant:a,value:s,size:u}=o;if(a||!u)continue;const c=new s.constructor(n*u);for(let t=0;t<n;++t){const r=e.value[t];for(let e=0;e<u;e++)c[t*u+e]=s[r*u+e]}i[t]={size:u,value:c}}return{attributes:Object.assign({},r,i)}}(y):y}(t);super({...t,id:e,indices:r,attributes:{...n,...t.attributes}})}}class k extends _.a{constructor(t={}){const{id:e=Object(b.c)("sphere-geometry")}=t,{indices:r,attributes:n}=function(t){const{nlat:e=10,nlong:r=10}=t;let{radius:n=1}=t;const i=Math.PI-0,o=2*Math.PI-0,a=(e+1)*(r+1);if("number"==typeof n){const t=n;n=(e,r,n,i,o)=>t}const s=new Float32Array(3*a),u=new Float32Array(3*a),c=new Float32Array(2*a),l=new(a>65535?Uint32Array:Uint16Array)(e*r*6);for(let t=0;t<=e;t++)for(let a=0;a<=r;a++){const l=a/r,h=t/e,f=a+t*(r+1),p=2*f,d=3*f,A=o*l,g=i*h,m=Math.sin(A),y=Math.cos(A),v=Math.sin(g),_=Math.cos(g),b=y*v,x=_,w=m*v,E=n(b,x,w,l,h);s[d+0]=E*b,s[d+1]=E*x,s[d+2]=E*w,u[d+0]=b,u[d+1]=x,u[d+2]=w,c[p+0]=l,c[p+1]=1-h}const h=r+1;for(let t=0;t<r;t++)for(let r=0;r<e;r++){const n=6*(t*e+r);l[n+0]=r*h+t,l[n+1]=r*h+t+1,l[n+2]=(r+1)*h+t,l[n+3]=(r+1)*h+t,l[n+4]=r*h+t+1,l[n+5]=(r+1)*h+t+1}return{indices:{size:1,value:l},attributes:{POSITION:{size:3,value:s},NORMAL:{size:3,value:u},TEXCOORD_0:{size:2,value:c}}}}(t);super({...t,id:e,indices:r,attributes:{...n,...t.attributes}})}}r.d(e,"Model",(function(){return n.a})),r.d(e,"Transform",(function(){return i.a})),r.d(e,"ProgramManager",(function(){return o.a})),r.d(e,"Timeline",(function(){return a.a})),r.d(e,"instrumentGLContext",(function(){return s.h})),r.d(e,"isWebGL2",(function(){return s.j})),r.d(e,"FEATURES",(function(){return u.a})),r.d(e,"hasFeatures",(function(){return c.c})),r.d(e,"getParameters",(function(){return s.f})),r.d(e,"setParameters",(function(){return s.n})),r.d(e,"withParameters",(function(){return s.o})),r.d(e,"cssToDeviceRatio",(function(){return s.e})),r.d(e,"readPixelsToBuffer",(function(){return l.d})),r.d(e,"copyToTexture",(function(){return l.b})),r.d(e,"cloneTextureFrom",(function(){return h.a})),r.d(e,"Buffer",(function(){return f.a})),r.d(e,"Program",(function(){return p.a})),r.d(e,"Framebuffer",(function(){return d.a})),r.d(e,"Renderbuffer",(function(){return A.a})),r.d(e,"Texture2D",(function(){return g.a})),r.d(e,"TextureCube",(function(){return m.a})),r.d(e,"Texture3D",(function(){return y.a})),r.d(e,"TransformFeedback",(function(){return v.a})),r.d(e,"Geometry",(function(){return _.a})),r.d(e,"ConeGeometry",(function(){return E})),r.d(e,"CubeGeometry",(function(){return S.a})),r.d(e,"CylinderGeometry",(function(){return O})),r.d(e,"IcoSphereGeometry",(function(){return C})),r.d(e,"PlaneGeometry",(function(){return I})),r.d(e,"SphereGeometry",(function(){return k})),r.d(e,"TruncatedConeGeometry",(function(){return w}))},function(t,e,r){"use strict";r.r(e);var n=r(0),i=r.n(n),o=r(2),a=r.n(o),s=r(3),u=r.n(s),c=r(7),l=r(191),h=r(11);function f(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function p(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?f(Object(r),!0).forEach((function(e){i()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function d(t,e,r,n){if(r){if(r.props.userData._googleMap===t)return r;g(r)}var i={click:null,dblclick:null,mousemove:null,mouseout:null};r=new l.a(p(p({},n),{},{style:null,parent:A(e,n.style),initialViewState:{longitude:0,latitude:0,zoom:1},controller:!1,userData:{_googleMap:t,_eventListeners:i}}));var o=function(e){i[e]=t.addListener(e,(function(t){return function(t,e,r){var n={type:e,offsetCenter:y(r,t),srcEvent:r};switch(e){case"click":t._lastPointerDownInfo=t.pickObject(p(p({},n.offsetCenter),{},{radius:t.props.pickingRadius})),n.tapCount=1,t._onEvent(n);break;case"dblclick":n.type="click",n.tapCount=2,t._onEvent(n);break;case"mousemove":n.type="pointermove",t._onPointerMove(n);break;case"mouseout":n.type="pointerleave",t._onPointerMove(n);break;default:return}}(r,e,t)}))};for(var a in i)o(a);return r}function A(t,e){var r=document.createElement("div");return r.style.position="absolute",Object.assign(r.style,e),t.getPanes?t.getPanes().overlayLayer.appendChild(r):t.getMap().getDiv().appendChild(r),r}function g(t){var e=t.props.userData._eventListeners;for(var r in e)e[r].remove();t.finalize()}function m(t){var e=t.getDiv().firstChild;return{width:e.offsetWidth,height:e.offsetHeight}}function y(t,e){if(t.pixel)return t.pixel;var r=e.getViewports()[0].project([t.latLng.lng(),t.latLng.lat()]);return{x:r[0],y:r[1]}}function v(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function _(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?v(Object(r),!0).forEach((function(e){i()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var b=function(){return!1},x={depthMask:!0,depthTest:!0,blend:!0,blendFunc:[770,771,1,771],blendEquation:32774},w=function(){function t(e){a()(this,t),this.props={},this._map=null,this.setProps(e)}return u()(t,[{key:"setMap",value:function(t){var e=this;if(t!==this._map&&(this._map&&(this._overlay.setMap(null),this._map=null),t)){this._map=t;var r=google.maps.RenderingType.UNINITIALIZED;t.getRenderingType()!==r?this._createOverlay(t):t.addListener("renderingtype_changed",(function(){e._createOverlay(t)}))}}},{key:"setProps",value:function(t){Object.assign(this.props,t),this._deck&&(t.style&&(Object.assign(this._deck.canvas.parentElement.style,t.style),t.style=null),this._deck.setProps(t))}},{key:"pickObject",value:function(t){return this._deck&&this._deck.pickObject(t)}},{key:"pickMultipleObjects",value:function(t){return this._deck&&this._deck.pickMultipleObjects(t)}},{key:"pickObjects",value:function(t){return this._deck&&this._deck.pickObjects(t)}},{key:"finalize",value:function(){this.setMap(null),this._deck&&(g(this._deck),this._deck=null)}},{key:"_createOverlay",value:function(t){var e=google.maps.RenderingType,r=e.VECTOR,n=e.UNINITIALIZED,i=t.getRenderingType();if(i!==n){var o=i===r&&google.maps.WebglOverlayView,a=new(o?google.maps.WebglOverlayView:google.maps.OverlayView);o?(a.onAdd=function(){},a.onContextLost=this._onContextLost.bind(this),a.onContextRestored=this._onContextRestored.bind(this),a.onDraw=this._onDrawVector.bind(this)):(a.onAdd=this._onAdd.bind(this),a.draw=this._onDrawRaster.bind(this)),a.onRemove=this._onRemove.bind(this),this._overlay=a,this._overlay.setMap(t)}}},{key:"_onAdd",value:function(){this._deck=d(this._map,this._overlay,this._deck,this.props)}},{key:"_onContextRestored",value:function(t){var e=this,r=d(this._map,this._overlay,this._deck,_({gl:t,_customRender:function(){e._overlay.requestRedraw()}},this.props));this._deck=r,r.animationLoop._renderFrame=function(){var e=t.getParameter(34964);Object(c.o)(t,{},(function(){r.animationLoop.onRender()})),t.bindBuffer(34962,e)}}},{key:"_onContextLost",value:function(){this._deck&&(g(this._deck),this._deck=null)}},{key:"_onRemove",value:function(){this._deck.setProps({layerFilter:b})}},{key:"_onDrawRaster",value:function(){var t=this._deck,e=function(t,e){var r=m(t),n=r.width,i=r.height,o=e.getProjection(),a=t.getBounds(),s=a.getNorthEast(),u=a.getSouthWest(),c=o.fromLatLngToDivPixel(s),l=o.fromLatLngToDivPixel(u),h=new google.maps.Point(0,0),f=o.fromContainerPixelToLatLng(h),p=o.fromLatLngToDivPixel(f),d=p.x,A=p.y,g=o.getWorldWidth(),y=Math.ceil(n/g);d-=Math.floor(y/2)*g;var v=i?(l.y-c.y)/i:1,_=Math.log2(v||1)+t.getZoom()-1,b=new google.maps.Point(n/2,i/2),x=o.fromContainerPixelToLatLng(b),w=x.lat(),E=x.lng();if(Math.abs(w)>85.05113){w=w>0?85.05113:-85.05113;var S=new google.maps.LatLng(w,E);A+=(b=o.fromLatLngToContainerPixel(S)).y-i/2}return{width:n,height:i,left:d,top:A,zoom:_,pitch:t.getTilt(),latitude:w,longitude:E}}(this._map,this._overlay),r=e.width,n=e.height,i=e.left,o=e.top,a=e.zoom,s=e.pitch,u=e.latitude,c=e.longitude,l=0===s,h=t.canvas.parentElement.style;h.left="".concat(i,"px"),h.top="".concat(o,"px"),t.setProps({width:r,height:n,viewState:{latitude:u,longitude:c,zoom:a,repeat:!0},layerFilter:l?this.props.layerFilter:b}),t.redraw()}},{key:"_onDrawVector",value:function(t,e){var r=this._deck;if(r.setProps(_({},function(t,e){var r=m(t),n=r.width,i=r.height,o=e.getCameraParams(),a=o.lat,s=o.lng,u=o.heading,c=o.tilt,l=o.zoom,f=n/i,p=(new h.a).perspective({fovy:25*Math.PI/180,aspect:f,near:.75,far:3e14});return{width:!1,height:!1,viewState:{altitude:.5*p[5],bearing:u,latitude:a,longitude:s,pitch:c,projectionMatrix:p,repeat:!0,zoom:l-1}}}(this._map,e))),r.layerManager){var n=Object(c.f)(t,36006);r.setProps({_framebuffer:n}),r.needsRedraw({clearRedrawFlags:!0}),Object(c.n)(t,{viewport:[0,0,t.canvas.width,t.canvas.height],scissor:[0,0,t.canvas.width,t.canvas.height],stencilFunc:[519,0,255,519,0,255]}),Object(c.o)(t,x,(function(){r._drawLayers("google-vector",{clearCanvas:!1})}))}}}]),t}();r.d(e,"GoogleMapsOverlay",(function(){return w}))},function(t,e,r){"use strict";r.r(e);var n=r(0),i=r.n(n),o=r(2),a=r.n(o),s=r(3),u=r.n(s),c=r(8),l=r.n(c),h=r(5),f=r.n(h),p=r(6),d=r.n(p),A=r(1),g=r.n(A),m=r(131),y=r(117);function v(t){switch(t){case"int8":return Int8Array;case"uint8":return Uint8Array;case"int16":return Int16Array;case"uint16":return Uint16Array;case"float32":return Float32Array;case"float64":return Float64Array;case"int32":return Int32Array;case"uint32":return Uint32Array;case"int64":return BigInt64Array;case"uint64":return BigUint64Array;default:throw new Error("Unrecognized dtype ".concat(t))}}function _(t,e){if(!t)return null;for(var r in t){var n=t[r].attributes;for(var i in n){var o=n[i],a=o.dtype,s=o.value,u=v(a);n[i].value=new u(s.buffer)}}return t}function b(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function x(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?b(Object(r),!0).forEach((function(e){i()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function w(t){var e=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(t){return!1}}();return function(){var r,n=g()(t);if(e){var i=g()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d()(this,r)}}r.d(e,"default",(function(){return E}));var E=function(t){f()(r,t);var e=w(r);function r(){return a()(this,r),e.apply(this,arguments)}return u()(r,[{key:"defaults",value:function(){return x(x({},l()(g()(r.prototype),"defaults",this).call(this)),{},{_model_name:r.model_name,_model_module:r.model_module,_model_module_version:r.model_module_version,_view_name:r.view_name,_view_module:r.view_module,_view_module_version:r.view_module_version,custom_libraries:[],json_input:null,mapbox_key:null,selected_data:[],data_buffer:null,tooltip:null,width:"100%",height:500,js_warning:!1})}}],[{key:"serializers",get:function(){return x(x({},m.DOMWidgetModel.serializers),{},{data_buffer:{deserialize:_}})}},{key:"model_name",get:function(){return"JupyterTransportModel"}},{key:"model_module",get:function(){return y.MODULE_NAME}},{key:"model_module_version",get:function(){return y.MODULE_VERSION}},{key:"view_name",get:function(){return"JupyterTransportView"}},{key:"view_module",get:function(){return y.MODULE_NAME}},{key:"view_module_version",get:function(){return y.MODULE_VERSION}}]),r}(m.DOMWidgetModel)},function(t,e,r){"use strict";r.r(e);var n=r(45),i=r(164),o=r(174),a=r(121),s=r(87);function u(){i.a.setCallbacks({onInitialize:function(t){var e=t.transport,r=function(t){var e=t.jupyterModel;if(!e)throw new Error("deck.gl playground currently only works with the Jupyter Widget Transport");return{width:e.get("width"),height:e.get("height"),customLibraries:e.get("custom_libraries"),mapboxApiKey:e.get("mapbox_key"),jsonInput:e.get("json_input"),tooltip:e.get("tooltip")}}(e),n=r.width,i=r.height,u=r.customLibraries,l=r.mapboxApiKey,h=r.jsonInput,f=r.tooltip;Object(a.b)();var p=e.getRootDOMElement(),d=Object(o.a)(n,i);p.appendChild(d);var A=JSON.parse(h),g=Object(s.createDeck)({mapboxApiKey:l,container:d,jsonInput:A,tooltip:f,handleEvent:function(t,r){return function(t,e,r){if("hover"===e&&!r.picked&&-1===r.index)return;var n=JSON.parse(JSON.stringify(r,c));t.sendJSONMessage(e,n)}(e,t,r)},customLibraries:u});e.userData.deck=g},onFinalize:function(t){t.transport.userData.deck.finalize()},onMessage:function(t){var e,r=t.transport,n=t.type,i=t.json,o=(t.binary,r.userData.deck);switch(n){case"json":e=s.jsonConverter.convert(i),o.setProps(e);break;case"json-with-binary":e=s.jsonConverter.convert(i);var a=function(t){for(var e=t.binary,r=t.convertedJson,n=0;n<r.layers.length;n++){var i=r.layers[n].id,o=r.layers[n];r.layers[n]=o.clone({data:e[i]})}return r}({binary:r.jupyterModel.get("data_buffer"),convertedJson:e});o.setProps(a)}}})}function c(t,e){return e instanceof n.Layer?e.id:e}r.d(e,"initPlayground",(function(){return u})),r.d(e,"createDeck",(function(){return s.createDeck})),r.d(e,"updateDeck",(function(){return s.updateDeck}))},function(t,e,r){"use strict";r.d(e,"a",(function(){return l}));var n=r(62),i=r(48);const o=new Uint16Array([0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]),a=new Float32Array([-1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,1,1,1,1,1,1,1,-1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1]),s=new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0]),u=new Float32Array([0,0,1,0,1,1,0,1,1,0,1,1,0,1,0,0,0,1,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,0,0,0,1,0,1,1,0,1]),c={POSITION:{size:3,value:new Float32Array(a)},NORMAL:{size:3,value:new Float32Array(s)},TEXCOORD_0:{size:2,value:new Float32Array(u)}};class l extends n.a{constructor(t={}){const{id:e=Object(i.c)("cube-geometry")}=t;super({...t,id:e,indices:{size:1,value:new Uint16Array(o)},attributes:{...c,...t.attributes}})}}},function(t,e,r){"use strict";var n=r(165);const i=Object(n.a)();class o{constructor(t,e,r="sessionStorage"){this.storage=function(t){try{const e=window[t],r="__storage_test__";return e.setItem(r,r),e.removeItem(r),e}catch(t){return null}}(r),this.id=t,this.config={},Object.assign(this.config,e),this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){return this.config={},this.updateConfiguration(t)}updateConfiguration(t){if(Object.assign(this.config,t),this.storage){const t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}return this}_loadConfiguration(){let t={};if(this.storage){const e=this.storage.getItem(this.id);t=e?JSON.parse(e):{}}return Object.assign(this.config,t),this}}function a(t,e,r,n=600){const i=t.src.replace(/\(/g,"%28").replace(/\)/g,"%29");t.width>n&&(r=Math.min(r,n/t.width));const o=t.width*r,a=t.height*r,s=["font-size:1px;","padding:".concat(Math.floor(a/2),"px ").concat(Math.floor(o/2),"px;"),"line-height:".concat(a,"px;"),"background:url(".concat(i,");"),"background-size:".concat(o,"px ").concat(a,"px;"),"color:transparent;"].join("");return["".concat(e," %c+"),s]}const s={BLACK:30,RED:31,GREEN:32,YELLOW:33,BLUE:34,MAGENTA:35,CYAN:36,WHITE:37,BRIGHT_BLACK:90,BRIGHT_RED:91,BRIGHT_GREEN:92,BRIGHT_YELLOW:93,BRIGHT_BLUE:94,BRIGHT_MAGENTA:95,BRIGHT_CYAN:96,BRIGHT_WHITE:97};function u(t){return"string"==typeof t?s[t.toUpperCase()]||s.WHITE:t}function c(t,e){if(!t)throw new Error(e||"Assertion failed")}var l=r(59);function h(){let t;if(i&&l.b.performance)t=l.b.performance.now();else if(l.a.hrtime){const e=l.a.hrtime();t=1e3*e[0]+e[1]/1e6}else t=Date.now();return t}r.d(e,"a",(function(){return y}));const f={debug:i&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},p={enabled:!0,level:0};function d(){}const A={},g={once:!0};function m(t){for(const e in t)for(const r in t[e])return r||"untitled";return"empty"}class y{constructor({id:t}={id:""}){this.id=t,this.VERSION="8.6.0-beta.1",this._startTs=h(),this._deltaTs=h(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new o("__probe-".concat(this.id,"__"),p),this.userData={},this.timeStamp("".concat(this.id," started")),function(t,e=["constructor"]){const r=Object.getPrototypeOf(t),n=Object.getOwnPropertyNames(r);for(const r of n)"function"==typeof t[r]&&(e.find(t=>r===t)||(t[r]=t[r].bind(t)))}(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((h()-this._startTs).toPrecision(10))}getDelta(){return Number((h()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(t=!0){return this._storage.updateConfiguration({enabled:t}),this}setLevel(t){return this._storage.updateConfiguration({level:t}),this}assert(t,e){c(t,e)}warn(t){return this._getLogFunction(0,t,f.warn,arguments,g)}error(t){return this._getLogFunction(0,t,f.error,arguments)}deprecated(t,e){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(e,"` instead"))}removed(t,e){return this.error("`".concat(t,"` has been removed. Use `").concat(e,"` instead"))}probe(t,e){return this._getLogFunction(t,e,f.log,arguments,{time:!0,once:!0})}log(t,e){return this._getLogFunction(t,e,f.debug,arguments)}info(t,e){return this._getLogFunction(t,e,console.info,arguments)}once(t,e){return this._getLogFunction(t,e,f.debug||f.info,arguments,g)}table(t,e,r){return e?this._getLogFunction(t,e,console.table||d,r&&[r],{tag:m(e)}):d}image({logLevel:t,priority:e,image:n,message:o="",scale:s=1}){return this._shouldLog(t||e)?i?function({image:t,message:e="",scale:r=1}){if("string"==typeof t){const n=new Image;return n.onload=()=>{const t=a(n,e,r);console.log(...t)},n.src=t,d}const n=t.nodeName||"";if("img"===n.toLowerCase())return console.log(...a(t,e,r)),d;if("canvas"===n.toLowerCase()){const n=new Image;return n.onload=()=>console.log(...a(n,e,r)),n.src=t.toDataURL(),d}return d}({image:n,message:o,scale:s}):function({image:t,message:e="",scale:n=1}){let i=null;try{i=r(252)}catch(t){}if(i)return()=>i(t,{fit:"box",width:"".concat(Math.round(80*n),"%")}).then(t=>console.log(t));return d}({image:n,message:o,scale:s}):d}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}get(t){return this._storage.config[t]}set(t,e){this._storage.updateConfiguration({[t]:e})}time(t,e){return this._getLogFunction(t,e,console.time?console.time:console.info)}timeEnd(t,e){return this._getLogFunction(t,e,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,e){return this._getLogFunction(t,e,console.timeStamp||d)}group(t,e,r={collapsed:!1}){r=_({logLevel:t,message:e,opts:r});const{collapsed:n}=r;return r.method=(n?console.groupCollapsed:console.group)||console.info,this._getLogFunction(r)}groupCollapsed(t,e,r={}){return this.group(t,e,Object.assign({},r,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||d)}withGroup(t,e,r){this.group(t,e)();try{r()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=v(t)}_getLogFunction(t,e,r,n=[],o){if(this._shouldLog(t)){o=_({logLevel:t,message:e,args:n,opts:o}),c(r=r||o.method),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=h();const a=o.tag||o.message;if(o.once){if(A[a])return d;A[a]=h()}return e=function(t,e,r){if("string"==typeof e){const s=r.time?function(t,e=8){const r=Math.max(e-t.length,0);return"".concat(" ".repeat(r)).concat(t)}(function(t){let e;return e=t<10?"".concat(t.toFixed(2),"ms"):t<100?"".concat(t.toFixed(1),"ms"):t<1e3?"".concat(t.toFixed(0),"ms"):"".concat((t/1e3).toFixed(2),"s"),e}(r.total)):"";e=r.time?"".concat(t,": ").concat(s," ").concat(e):"".concat(t,": ").concat(e),n=e,o=r.color,a=r.background,i||"string"!=typeof n||(o&&(o=u(o),n="[".concat(o,"m").concat(n,"")),a&&(o=u(a),n="[".concat(a+10,"m").concat(n,""))),e=n}var n,o,a;return e}(this.id,o.message,o),r.bind(console,e,...o.args)}return d}}function v(t){if(!t)return 0;let e;switch(typeof t){case"number":e=t;break;case"object":e=t.logLevel||t.priority||0;break;default:return 0}return c(Number.isFinite(e)&&e>=0),e}function _(t){const{logLevel:e,message:r}=t;t.logLevel=v(e);const n=t.args?Array.from(t.args):[];for(;n.length&&n.shift()!==r;);switch(t.args=n,typeof e){case"string":case"function":void 0!==r&&n.unshift(r),t.message=e;break;case"object":Object.assign(t,e)}"function"==typeof t.message&&(t.message=t.message());const i=typeof t.message;return c("string"===i||"object"===i),Object.assign(t,t.opts)}y.VERSION="8.6.0-beta.1"},,,,,,,,,,,,,function(t,e,r){"use strict";r.d(e,"a",(function(){return s}));var n=r(7),i=r(39),o=r(34),a=r(48);class s extends i.a{static isSupported(t){return Object(n.j)(t)}constructor(t,e={}){Object(n.a)(t),super(t,e),this.initialize(e),this.stubRemovedMethods("TransformFeedback","v6.0",["pause","resume"]),Object.seal(this)}initialize(t={}){return this.buffers={},this.unused={},this.configuration=null,this.bindOnUse=!0,Object(a.a)(this.buffers)||this.bind(()=>this._unbindBuffers()),this.setProps(t),this}setProps(t){"program"in t&&(this.configuration=t.program&&t.program.configuration),"configuration"in t&&(this.configuration=t.configuration),"bindOnUse"in t&&(t=t.bindOnUse),"buffers"in t&&this.setBuffers(t.buffers)}setBuffers(t={}){return this.bind(()=>{for(const e in t)this.setBuffer(e,t[e])}),this}setBuffer(t,e){const r=this._getVaryingIndex(t),{buffer:i,byteSize:o,byteOffset:a}=this._getBufferParams(e);return r<0?(this.unused[t]=i,n.k.warn(()=>`${this.id} unused varying buffer ${t}`)(),this):(this.buffers[r]=e,this.bindOnUse||this._bindBuffer(r,i,a,o),this)}begin(t=0){return this.gl.bindTransformFeedback(36386,this.handle),this._bindBuffers(),this.gl.beginTransformFeedback(t),this}end(){return this.gl.endTransformFeedback(),this._unbindBuffers(),this.gl.bindTransformFeedback(36386,null),this}_getBufferParams(t){let e,r,n;return t instanceof o.a==!1?(n=t.buffer,r=t.byteSize,e=t.byteOffset):n=t,void 0===e&&void 0===r||(e=e||0,r=r||n.byteLength-e),{buffer:n,byteOffset:e,byteSize:r}}_getVaryingInfo(t){return this.configuration&&this.configuration.getVaryingInfo(t)}_getVaryingIndex(t){if(this.configuration)return this.configuration.getVaryingInfo(t).location;const e=Number(t);return Number.isFinite(e)?e:-1}_bindBuffers(){if(this.bindOnUse)for(const t in this.buffers){const{buffer:e,byteSize:r,byteOffset:n}=this._getBufferParams(this.buffers[t]);this._bindBuffer(t,e,n,r)}}_unbindBuffers(){if(this.bindOnUse)for(const t in this.buffers)this._bindBuffer(t,null)}_bindBuffer(t,e,r=0,n){const i=e&&e.handle;return i&&void 0!==n?this.gl.bindBufferRange(35982,t,i,r,n):this.gl.bindBufferBase(35982,t,i),this}_createHandle(){return this.gl.createTransformFeedback()}_deleteHandle(){this.gl.deleteTransformFeedback(this.handle)}_bindHandle(t){this.gl.bindTransformFeedback(36386,this.handle)}}},function(t,e,r){"use strict";r.d(e,"a",(function(){return o}));let n=1,i=1;class o{constructor(){this.time=0,this.channels=new Map,this.animations=new Map,this.playing=!1,this.lastEngineTime=-1}addChannel(t){const{delay:e=0,duration:r=Number.POSITIVE_INFINITY,rate:i=1,repeat:o=1}=t,a=n++,s={time:0,delay:e,duration:r,rate:i,repeat:o};return this._setChannelTime(s,this.time),this.channels.set(a,s),a}removeChannel(t){this.channels.delete(t);for(const[e,r]of this.animations)r.channel===t&&this.detachAnimation(e)}isFinished(t){const e=this.channels.get(t);return void 0!==e&&this.time>=e.delay+e.duration*e.repeat}getTime(t){if(void 0===t)return this.time;const e=this.channels.get(t);return void 0===e?-1:e.time}setTime(t){this.time=Math.max(0,t);const e=this.channels.values();for(const t of e)this._setChannelTime(t,this.time);const r=this.animations.values();for(const t of r){const{animation:e,channel:r}=t;e.setTime(this.getTime(r))}}play(){this.playing=!0}pause(){this.playing=!1,this.lastEngineTime=-1}reset(){this.setTime(0)}attachAnimation(t,e){const r=i++;return this.animations.set(r,{animation:t,channel:e}),t.setTime(this.getTime(e)),r}detachAnimation(t){this.animations.delete(t)}update(t){this.playing&&(-1===this.lastEngineTime&&(this.lastEngineTime=t),this.setTime(this.time+(t-this.lastEngineTime)),this.lastEngineTime=t)}_setChannelTime(t,e){const r=e-t.delay;r>=t.duration*t.repeat?t.time=t.duration*t.rate:(t.time=Math.max(0,r)%t.duration,t.time*=t.rate)}}},function(t,e,r){"use strict";var n={};r.r(n),r.d(n,"decode",(function(){return M})),r.d(n,"encode",(function(){return C}));var i={};r.r(i),r.d(i,"decode",(function(){return R})),r.d(i,"encode",(function(){return L}));var o={};r.r(o),r.d(o,"decode",(function(){return j})),r.d(o,"encode",(function(){return D}));var a={};r.r(a),r.d(a,"decode",(function(){return B})),r.d(a,"encode",(function(){return F}));var s=r(292),u=r(218),c=r(78);function l(t,e){if(!t)throw new Error(e||"assert failed: gltf")}function h(t,e){if(t.startsWith("data:")||t.startsWith("http:")||t.startsWith("https:"))return t;const r=e.baseUri||e.uri;if(!r)throw new Error(`'baseUri' must be provided to resolve relative url ${t}`);return r.substr(0,r.lastIndexOf("/")+1)+t}function f(t,e,r){const n=t.bufferViews[r];l(n);const i=e[n.buffer];l(i);const o=(n.byteOffset||0)+i.byteOffset;return new Uint8Array(i.arrayBuffer,o,n.byteLength)}var p=r(175),d=r(4),A=r(172),g=r(145);const m=["SCALAR","VEC2","VEC3","VEC4"],y=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],v=new Map(y),_={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},b={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},x={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function w(t){return m[t-1]||m[0]}function E(t){const e=v.get(t.constructor);if(!e)throw new Error("Illegal typed array");return e}function S(t,e){const r=x[t.componentType],n=_[t.type],i=b[t.componentType],o=t.count*n,a=t.count*n*i;return l(a>=0&&a<=e.byteLength),{ArrayType:r,length:o,byteLength:a}}const O={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]};class T{constructor(t){Object(d.a)(this,"gltf",void 0),Object(d.a)(this,"sourceBuffers",void 0),Object(d.a)(this,"byteLength",void 0),this.gltf=t||{json:{...O},buffers:[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(t){return this.json[t]}getExtraData(t){return(this.json.extras||{})[t]}getExtension(t){const e=this.getUsedExtensions().find(e=>e===t),r=this.json.extensions||{};return e?r[t]||!0:null}getRequiredExtension(t){return this.getRequiredExtensions().find(e=>e===t)?this.getExtension(t):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getObjectExtension(t,e){return(t.extensions||{})[e]}getScene(t){return this.getObject("scenes",t)}getNode(t){return this.getObject("nodes",t)}getSkin(t){return this.getObject("skins",t)}getMesh(t){return this.getObject("meshes",t)}getMaterial(t){return this.getObject("materials",t)}getAccessor(t){return this.getObject("accessors",t)}getTexture(t){return this.getObject("textures",t)}getSampler(t){return this.getObject("samplers",t)}getImage(t){return this.getObject("images",t)}getBufferView(t){return this.getObject("bufferViews",t)}getBuffer(t){return this.getObject("buffers",t)}getObject(t,e){if("object"==typeof e)return e;const r=this.json[t]&&this.json[t][e];if(!r)throw new Error(`glTF file error: Could not find ${t}[${e}]`);return r}getTypedArrayForBufferView(t){const e=(t=this.getBufferView(t)).buffer,r=this.gltf.buffers[e];l(r);const n=(t.byteOffset||0)+r.byteOffset;return new Uint8Array(r.arrayBuffer,n,t.byteLength)}getTypedArrayForAccessor(t){t=this.getAccessor(t);const e=this.getBufferView(t.bufferView),r=this.getBuffer(e.buffer).data,{ArrayType:n,length:i}=S(t,e);return new n(r,e.byteOffset+t.byteOffset,i)}getTypedArrayForImageData(t){t=this.getAccessor(t);const e=this.getBufferView(t.bufferView),r=this.getBuffer(e.buffer).data,n=e.byteOffset||0;return new Uint8Array(r,n,e.byteLength)}addApplicationData(t,e){return this.json[t]=e,this}addExtraData(t,e){return this.json.extras=this.json.extras||{},this.json.extras[t]=e,this}addObjectExtension(t,e,r){return t.extensions=t.extensions||{},t.extensions[e]=r,this.registerUsedExtension(e),this}setObjectExtension(t,e,r){(t.extensions||{})[e]=r}removeObjectExtension(t,e){const r=t.extensions||{},n=r[e];return delete r[e],n}addExtension(t,e={}){return l(e),this.json.extensions=this.json.extensions||{},this.json.extensions[t]=e,this.registerUsedExtension(t),e}addRequiredExtension(t,e={}){return l(e),this.addExtension(t,e),this.registerRequiredExtension(t),e}registerUsedExtension(t){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(e=>e===t)||this.json.extensionsUsed.push(t)}registerRequiredExtension(t){this.registerUsedExtension(t),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(e=>e===t)||this.json.extensionsRequired.push(t)}removeExtension(t){this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,t),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,t),this.json.extensions&&delete this.json.extensions[t]}setDefaultScene(t){this.json.scene=t}addScene(t){const{nodeIndices:e}=t;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:e}),this.json.scenes.length-1}addNode(t){const{meshIndex:e,matrix:r}=t;this.json.nodes=this.json.nodes||[];const n={mesh:e};return r&&(n.matrix=r),this.json.nodes.push(n),this.json.nodes.length-1}addMesh(t){const{attributes:e,indices:r,material:n,mode:i=4}=t,o={primitives:[{attributes:this._addAttributes(e),mode:i}]};if(r){const t=this._addIndices(r);o.primitives[0].indices=t}return Number.isFinite(n)&&(o.primitives[0].material=n),this.json.meshes=this.json.meshes||[],this.json.meshes.push(o),this.json.meshes.length-1}addPointCloud(t){const e={primitives:[{attributes:this._addAttributes(t),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(e),this.json.meshes.length-1}addImage(t,e){const r=Object(A.a)(t),n=e||(null==r?void 0:r.mimeType),i={bufferView:this.addBufferView(t),mimeType:n};return this.json.images=this.json.images||[],this.json.images.push(i),this.json.images.length-1}addBufferView(t){const e=t.byteLength;l(Number.isFinite(e)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(t);const r={buffer:0,byteOffset:this.byteLength,byteLength:e};return this.byteLength+=Object(g.b)(e,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(r),this.json.bufferViews.length-1}addAccessor(t,e){const r={bufferView:t,type:w(e.size),componentType:e.componentType,count:e.count,max:e.max,min:e.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(r),this.json.accessors.length-1}addBinaryBuffer(t,e={size:3}){const r=this.addBufferView(t);let n={min:e.min,max:e.max};n.min&&n.max||(n=this._getAccessorMinMax(t,e.size));const i={size:e.size,componentType:E(t),count:Math.round(t.length/e.size),min:n.min,max:n.max};return this.addAccessor(r,Object.assign(i,e))}addTexture(t){const{imageIndex:e}=t,r={source:e};return this.json.textures=this.json.textures||[],this.json.textures.push(r),this.json.textures.length-1}addMaterial(t){return this.json.materials=this.json.materials||[],this.json.materials.push(t),this.json.materials.length-1}createBinaryChunk(){var t,e;this.gltf.buffers=[];const r=this.byteLength,n=new ArrayBuffer(r),i=new Uint8Array(n);let o=0;for(const t of this.sourceBuffers||[])o=Object(g.a)(t,i,o);null!==(t=this.json)&&void 0!==t&&null!==(e=t.buffers)&&void 0!==e&&e[0]?this.json.buffers[0].byteLength=r:this.json.buffers=[{byteLength:r}],this.gltf.binary=n,this.sourceBuffers=[n]}_removeStringFromArray(t,e){let r=!0;for(;r;){const n=t.indexOf(e);n>-1?t.splice(n,1):r=!1}}_addAttributes(t={}){const e={};for(const r in t){const n=t[r],i=this._getGltfAttributeName(r),o=this.addBinaryBuffer(n.value,n);e[i]=o}return e}_addIndices(t){return this.addBinaryBuffer(t,{size:1})}_getGltfAttributeName(t){switch(t.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return t}}_getAccessorMinMax(t,e){const r={min:null,max:null};if(t.length<e)return r;r.min=[],r.max=[];const n=t.subarray(0,e);for(const t of n)r.min.push(t),r.max.push(t);for(let n=e;n<t.length;n+=e)for(let i=0;i<e;i++)r.min[0+i]=Math.min(r.min[0+i],t[n+i]),r.max[0+i]=Math.max(r.max[0+i],t[n+i]);return r}}function P(t){const{buffer:e,size:r,count:n}=function(t){let e=t,r=1,n=0;t&&t.value&&(e=t.value,r=t.size||1);e&&(ArrayBuffer.isView(e)||(e=function(t,e,r=!1){if(!t)return null;if(Array.isArray(t))return new e(t);if(r&&!(t instanceof e))return new e(t);return t}(e,Float32Array)),n=e.length/r);return{buffer:e,size:r,count:n}}(t);return{value:e,size:r,byteOffset:0,count:n,type:w(r),componentType:E(e)}}async function M(t,e,r){var n;if(null==e||null===(n=e.gltf)||void 0===n||!n.decompressMeshes)return;const i=new T(t),o=[];for(const t of function*(t){for(const e of t.json.meshes||[])for(const t of e.primitives)yield t}(i))i.getObjectExtension(t,"KHR_draco_mesh_compression")&&o.push(I(i,t,e,r));await Promise.all(o),i.removeExtension("KHR_draco_mesh_compression")}function C(t,e={}){const r=new T(t);for(const t of r.json.meshes||[])k(t,e),r.addRequiredExtension("KHR_draco_mesh_compression")}async function I(t,e,r,n){const i=t.getObjectExtension(e,"KHR_draco_mesh_compression");if(!i)return;const o=t.getTypedArrayForBufferView(i.bufferView),a=Object(c.c)(o.buffer,o.byteOffset),{parse:s}=n,u={...r};delete u["3d-tiles"];const l=await s(a,p.a,u,n),h=function(t){const e={};for(const r in t){const n=t[r];if("indices"!==r){const t=P(n);e[r]=t}}return e}(l.attributes);for(const[r,n]of Object.entries(h))if(r in e.attributes){const i=e.attributes[r],o=t.getAccessor(i);null!=o&&o.min&&null!=o&&o.max&&(n.min=o.min,n.max=o.max)}e.attributes=h,l.indices&&(e.indices=P(l.indices)),function(t){if(!t.attributes&&Object.keys(t.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}(e)}function k(t,e,r=4,n,i){var o;if(!n.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");const a=n.DracoWriter.encodeSync({attributes:t}),s=null==i?void 0:null===(o=i.parseSync)||void 0===o?void 0:o.call(i,{attributes:t}),u=n._addFauxAttributes(s.attributes);return{primitives:[{attributes:u,mode:r,extensions:{KHR_draco_mesh_compression:{bufferView:n.addBufferView(a),attributes:u}}}]}}async function R(t){const e=new T(t),{json:r}=e;e.removeExtension("KHR_materials_unlit");for(const t of r.materials||[]){t.extensions&&t.extensions.KHR_materials_unlit&&(t.unlit=!0),e.removeObjectExtension(t,"KHR_materials_unlit")}}function L(t){const e=new T(t),{json:r}=e;if(e.materials)for(const t of r.materials||[])t.unlit&&(delete t.unlit,e.addObjectExtension(t,"KHR_materials_unlit",{}),e.addExtension("KHR_materials_unlit"))}async function j(t){const e=new T(t),{json:r}=e,n=e.getExtension("KHR_lights_punctual");n&&(e.json.lights=n.lights,e.removeExtension("KHR_lights_punctual"));for(const t of r.nodes||[]){const r=e.getObjectExtension(t,"KHR_lights_punctual");r&&(t.light=r.light),e.removeObjectExtension(t,"KHR_lights_punctual")}}async function D(t){const e=new T(t),{json:r}=e;if(r.lights){const t=e.addExtension("KHR_lights_punctual");l(!t.lights),t.lights=r.lights,delete r.lights}if(e.json.lights){for(const t of e.json.lights){const r=t.node;e.addObjectExtension(r,"KHR_lights_punctual",t)}delete e.json.lights}}async function B(t){const e=new T(t),{json:r}=e,n=e.getExtension("KHR_techniques_webgl");if(n){const t=function(t,e){const{programs:r=[],shaders:n=[],techniques:i=[]}=t,o=new TextDecoder;return n.forEach(t=>{if(!Number.isFinite(t.bufferView))throw new Error("KHR_techniques_webgl: no shader code");t.code=o.decode(e.getTypedArrayForBufferView(t.bufferView))}),r.forEach(t=>{t.fragmentShader=n[t.fragmentShader],t.vertexShader=n[t.vertexShader]}),i.forEach(t=>{t.program=r[t.program]}),i}(n,e);for(const n of r.materials||[]){const r=e.getObjectExtension(n,"KHR_techniques_webgl");r&&(n.technique=Object.assign({},r,t[r.technique]),n.technique.values=z(n.technique,e)),e.removeObjectExtension(n,"KHR_techniques_webgl")}e.removeExtension("KHR_techniques_webgl")}}async function F(t,e){}function z(t,e){const r=Object.assign({},t.values);return Object.keys(t.uniforms||{}).forEach(e=>{!t.uniforms[e].value||e in r||(r[e]=t.uniforms[e].value)}),Object.keys(r).forEach(t=>{"object"==typeof r[t]&&void 0!==r[t].index&&(r[t].texture=e.getTexture(r[t].index))}),r}const N={KHR_draco_mesh_compression:n,KHR_materials_unlit:i,KHR_lights_punctual:o,KHR_techniques_webgl:a};const U={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},V={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"};class G{constructor(t){this.idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}}normalize(t,e){this.json=t.json;const r=t.json;switch(r.asset&&r.asset.version){case"2.0":return;case void 0:case"1.0":break;default:return void console.warn(`glTF: Unknown version ${r.asset.version}`)}if(!e.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(r),this._convertTopLevelObjectsToArrays(r),function(t){const e=new T(t),{json:r}=e;for(const t of r.images||[]){const r=e.removeObjectExtension(t,"KHR_binary_glTF");r&&Object.assign(t,r)}r.buffers&&r.buffers[0]&&delete r.buffers[0].uri,e.removeExtension("KHR_binary_glTF")}(t),this._convertObjectIdsToArrayIndices(r),this._updateObjects(r),this._updateMaterial(r)}_addAsset(t){t.asset=t.asset||{},t.asset.version="2.0",t.asset.generator=t.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(t){for(const e in U)this._convertTopLevelObjectToArray(t,e)}_convertTopLevelObjectToArray(t,e){const r=t[e];if(r&&!Array.isArray(r)){t[e]=[];for(const n in r){const i=r[n];i.id=i.id||n;const o=t[e].length;t[e].push(i),this.idToIndexMap[e][n]=o}}}_convertObjectIdsToArrayIndices(t){for(const e in U)this._convertIdsToIndices(t,e);"scene"in t&&(t.scene=this._convertIdToIndex(t.scene,"scene"));for(const e of t.textures)this._convertTextureIds(e);for(const e of t.meshes)this._convertMeshIds(e);for(const e of t.nodes)this._convertNodeIds(e);for(const e of t.scenes)this._convertSceneIds(e)}_convertTextureIds(t){t.source&&(t.source=this._convertIdToIndex(t.source,"image"))}_convertMeshIds(t){for(const e of t.primitives){const{attributes:t,indices:r,material:n}=e;for(const e in t)t[e]=this._convertIdToIndex(t[e],"accessor");r&&(e.indices=this._convertIdToIndex(r,"accessor")),n&&(e.material=this._convertIdToIndex(n,"material"))}}_convertNodeIds(t){t.children&&(t.children=t.children.map(t=>this._convertIdToIndex(t,"node"))),t.meshes&&(t.meshes=t.meshes.map(t=>this._convertIdToIndex(t,"mesh")))}_convertSceneIds(t){t.nodes&&(t.nodes=t.nodes.map(t=>this._convertIdToIndex(t,"node")))}_convertIdsToIndices(t,e){t[e]||(console.warn(`gltf v1: json doesn't contain attribute ${e}`),t[e]=[]);for(const r of t[e])for(const t in r){const e=r[t],n=this._convertIdToIndex(e,t);r[t]=n}}_convertIdToIndex(t,e){const r=V[e];if(r in this.idToIndexMap){const n=this.idToIndexMap[r][t];if(!Number.isFinite(n))throw new Error(`gltf v1: failed to resolve ${e} with id ${t}`);return n}return t}_updateObjects(t){for(const t of this.json.buffers)delete t.type}_updateMaterial(t){for(const e of t.materials){e.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};const r=e.values&&e.values.tex,n=t.textures.findIndex(t=>t.id===r);-1!==n&&(e.pbrMetallicRoughness.baseColorTexture={index:n})}}}const W={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},H={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},q={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},Z={magFilter:q.TEXTURE_MAG_FILTER,minFilter:q.TEXTURE_MIN_FILTER,wrapS:q.TEXTURE_WRAP_S,wrapT:q.TEXTURE_WRAP_T},X={[q.TEXTURE_MAG_FILTER]:q.LINEAR,[q.TEXTURE_MIN_FILTER]:q.NEAREST_MIPMAP_LINEAR,[q.TEXTURE_WRAP_S]:q.REPEAT,[q.TEXTURE_WRAP_]:q.REPEAT};class Q{postProcess(t,e={}){const{json:r,buffers:n=[],images:i=[],baseUri:o=""}=t;return l(r),this.baseUri=o,this.json=r,this.buffers=n,this.images=i,this._resolveTree(this.json,e),this.json}_resolveTree(t,e={}){t.bufferViews&&(t.bufferViews=t.bufferViews.map((t,e)=>this._resolveBufferView(t,e))),t.images&&(t.images=t.images.map((t,e)=>this._resolveImage(t,e))),t.samplers&&(t.samplers=t.samplers.map((t,e)=>this._resolveSampler(t,e))),t.textures&&(t.textures=t.textures.map((t,e)=>this._resolveTexture(t,e))),t.accessors&&(t.accessors=t.accessors.map((t,e)=>this._resolveAccessor(t,e))),t.materials&&(t.materials=t.materials.map((t,e)=>this._resolveMaterial(t,e))),t.meshes&&(t.meshes=t.meshes.map((t,e)=>this._resolveMesh(t,e))),t.nodes&&(t.nodes=t.nodes.map((t,e)=>this._resolveNode(t,e))),t.skins&&(t.skins=t.skins.map((t,e)=>this._resolveSkin(t,e))),t.scenes&&(t.scenes=t.scenes.map((t,e)=>this._resolveScene(t,e))),void 0!==t.scene&&(t.scene=t.scenes[this.json.scene])}getScene(t){return this._get("scenes",t)}getNode(t){return this._get("nodes",t)}getSkin(t){return this._get("skins",t)}getMesh(t){return this._get("meshes",t)}getMaterial(t){return this._get("materials",t)}getAccessor(t){return this._get("accessors",t)}getCamera(t){return null}getTexture(t){return this._get("textures",t)}getSampler(t){return this._get("samplers",t)}getImage(t){return this._get("images",t)}getBufferView(t){return this._get("bufferViews",t)}getBuffer(t){return this._get("buffers",t)}_get(t,e){if("object"==typeof e)return e;const r=this.json[t]&&this.json[t][e];return r||console.warn(`glTF file error: Could not find ${t}[${e}]`),r}_resolveScene(t,e){return t.id=t.id||`scene-${e}`,t.nodes=(t.nodes||[]).map(t=>this.getNode(t)),t}_resolveNode(t,e){return t.id=t.id||`node-${e}`,t.children&&(t.children=t.children.map(t=>this.getNode(t))),void 0!==t.mesh?t.mesh=this.getMesh(t.mesh):void 0!==t.meshes&&t.meshes.length&&(t.mesh=t.meshes.reduce((t,e)=>{const r=this.getMesh(e);return t.id=r.id,t.primitives=t.primitives.concat(r.primitives),t},{primitives:[]})),void 0!==t.camera&&(t.camera=this.getCamera(t.camera)),void 0!==t.skin&&(t.skin=this.getSkin(t.skin)),t}_resolveSkin(t,e){return t.id=t.id||`skin-${e}`,t.inverseBindMatrices=this.getAccessor(t.inverseBindMatrices),t}_resolveMesh(t,e){return t.id=t.id||`mesh-${e}`,t.primitives&&(t.primitives=t.primitives.map(t=>{const e=(t={...t}).attributes;t.attributes={};for(const r in e)t.attributes[r]=this.getAccessor(e[r]);return void 0!==t.indices&&(t.indices=this.getAccessor(t.indices)),void 0!==t.material&&(t.material=this.getMaterial(t.material)),t})),t}_resolveMaterial(t,e){if(t.id=t.id||`material-${e}`,t.normalTexture&&(t.normalTexture={...t.normalTexture},t.normalTexture.texture=this.getTexture(t.normalTexture.index)),t.occlusionTexture&&(t.occlustionTexture={...t.occlustionTexture},t.occlusionTexture.texture=this.getTexture(t.occlusionTexture.index)),t.emissiveTexture&&(t.emmisiveTexture={...t.emmisiveTexture},t.emissiveTexture.texture=this.getTexture(t.emissiveTexture.index)),t.emissiveFactor||(t.emissiveFactor=t.emmisiveTexture?[1,1,1]:[0,0,0]),t.pbrMetallicRoughness){t.pbrMetallicRoughness={...t.pbrMetallicRoughness};const e=t.pbrMetallicRoughness;e.baseColorTexture&&(e.baseColorTexture={...e.baseColorTexture},e.baseColorTexture.texture=this.getTexture(e.baseColorTexture.index)),e.metallicRoughnessTexture&&(e.metallicRoughnessTexture={...e.metallicRoughnessTexture},e.metallicRoughnessTexture.texture=this.getTexture(e.metallicRoughnessTexture.index))}return t}_resolveAccessor(t,e){var r,n;if(t.id=t.id||`accessor-${e}`,void 0!==t.bufferView&&(t.bufferView=this.getBufferView(t.bufferView)),t.bytesPerComponent=(r=t.componentType,H[r]),t.components=(n=t.type,W[n]),t.bytesPerElement=t.bytesPerComponent*t.components,t.bufferView){const e=t.bufferView.buffer,{ArrayType:r,byteLength:n}=S(t,t.bufferView),i=(t.bufferView.byteOffset||0)+(t.byteOffset||0)+e.byteOffset,o=e.arrayBuffer.slice(i,i+n);t.value=new r(o)}return t}_resolveTexture(t,e){return t.id=t.id||`texture-${e}`,t.sampler="sampler"in t?this.getSampler(t.sampler):X,t.source=this.getImage(t.source),t}_resolveSampler(t,e){t.id=t.id||`sampler-${e}`,t.parameters={};for(const e in t){const r=this._enumSamplerParameter(e);void 0!==r&&(t.parameters[r]=t[e])}return t}_enumSamplerParameter(t){return Z[t]}_resolveImage(t,e){t.id=t.id||`image-${e}`,void 0!==t.bufferView&&(t.bufferView=this.getBufferView(t.bufferView));const r=this.images[e];return r&&(t.image=r),t}_resolveBufferView(t,e){t.id=t.id||`bufferView-${e}`;const r=t.buffer;t.buffer=this.buffers[r];const n=this.buffers[r].arrayBuffer;let i=this.buffers[r].byteOffset||0;return"byteOffset"in t&&(i+=t.byteOffset),t.data=new Uint8Array(n,i,t.byteLength),t}_resolveCamera(t,e){return t.id=t.id||`camera-${e}`,t.perspective,t.orthographic,t}}var Y=r(97);const K=1735152710;function $(t,e=0,r={}){const n=new DataView(t),{magic:i=K}=r,o=n.getUint32(e,!1);return o===i||o===K}function J(t,e,r=0,n={}){const i=new DataView(e),o=function(t,e=0){return`${String.fromCharCode(t.getUint8(e+0))}${String.fromCharCode(t.getUint8(e+1))}${String.fromCharCode(t.getUint8(e+2))}${String.fromCharCode(t.getUint8(e+3))}`}(i,r+0),a=i.getUint32(r+4,!0),s=i.getUint32(r+8,!0);switch(Object.assign(t,{header:{byteOffset:r,byteLength:s,hasBinChunk:!1},type:o,version:a,json:{},binChunks:[]}),r+=12,t.version){case 1:return function(t,e,r){Object(Y.a)(t.header.byteLength>20);const n=e.getUint32(r+0,!0),i=e.getUint32(r+4,!0);return r+=8,Object(Y.a)(0===i),tt(t,e,r,n),r+=n,r+=et(t,e,r,t.header.byteLength)}(t,i,r);case 2:return function(t,e,r,n){return Object(Y.a)(t.header.byteLength>20),function(t,e,r,n){for(;r+8<=t.header.byteLength;){const i=e.getUint32(r+0,!0),o=e.getUint32(r+4,!0);switch(r+=8,o){case 1313821514:tt(t,e,r,i);break;case 5130562:et(t,e,r,i);break;case 0:n.strict||tt(t,e,r,i);break;case 1:n.strict||et(t,e,r,i)}r+=Object(g.b)(i,4)}}(t,e,r,n),r+t.header.byteLength}(t,i,r,{});default:throw new Error(`Invalid GLB version ${t.version}. Only supports v1 and v2.`)}}function tt(t,e,r,n){const i=new Uint8Array(e.buffer,r,n),o=new TextDecoder("utf8").decode(i);return t.json=JSON.parse(o),Object(g.b)(n,4)}function et(t,e,r,n){return t.header.hasBinChunk=!0,t.binChunks.push({byteOffset:r,byteLength:n,arrayBuffer:e.buffer}),Object(g.b)(n,4)}async function rt(t,e,r=0,n,i){var o,a,s,c;!function(t,e,r,n){n.uri&&(t.baseUri=n.uri);if(e instanceof ArrayBuffer&&!$(e,r,n)){const t=new TextDecoder;e=t.decode(e)}if("string"==typeof e)t.json=Object(u.a)(e);else if(e instanceof ArrayBuffer){const i={};r=J(i,e,r,n.glb),l("glTF"===i.type,`Invalid GLB magic string ${i.type}`),t._glb=i,t.json=i.json}else l(!1,"GLTF: must be ArrayBuffer or string");const i=t.json.buffers||[];if(t.buffers=new Array(i.length).fill(null),t._glb&&t._glb.header.hasBinChunk){const{binChunks:e}=t._glb;t.buffers[0]={arrayBuffer:e[0].arrayBuffer,byteOffset:e[0].byteOffset,byteLength:e[0].byteLength}}const o=t.json.images||[];t.images=new Array(o.length).fill({})}(t,e,r,n),function(t,e={}){(new G).normalize(t,e)}(t,{normalize:null==n?void 0:null===(o=n.gltf)||void 0===o?void 0:o.normalize});const f=[];if(null!=n&&null!==(a=n.gltf)&&void 0!==a&&a.loadBuffers&&t.json.buffers&&await async function(t,e,r){for(let o=0;o<t.json.buffers.length;++o){const a=t.json.buffers[o];if(a.uri){var n,i;const{fetch:s}=r;l(s);const u=h(a.uri,e),c=await(null==r?void 0:null===(n=r.fetch)||void 0===n?void 0:n.call(r,u)),f=await(null==c?void 0:null===(i=c.arrayBuffer)||void 0===i?void 0:i.call(c));t.buffers[o]={arrayBuffer:f,byteOffset:0,byteLength:f.byteLength},delete a.uri}}}(t,n,i),null!=n&&null!==(s=n.gltf)&&void 0!==s&&s.loadImages){const e=async function(t,e,r){const n=t.json.images||[],i=[];for(let o=0;o<n.length;++o)i.push(nt(t,n[o],o,e,r));return await Promise.all(i)}(t,n,i);f.push(e)}const p=async function(t,e={},r){for(const i in N){var n;const o=(null==e?void 0:null===(n=e.gltf)||void 0===n?void 0:n.excludeExtensions)||{};if(!(i in o&&!o[i])){const n=N[i];await n.decode(t,e,r)}}}(t,n,i);return f.push(p),await Promise.all(f),null!=n&&null!==(c=n.gltf)&&void 0!==c&&c.postProcess?function(t,e){return(new Q).postProcess(t,e)}(t,n):t}async function nt(t,e,r,n,i){const{fetch:o,parse:a}=i;let u;if(e.uri){const t=h(e.uri,n),r=await o(t);u=await r.arrayBuffer()}if(Number.isFinite(e.bufferView)){const r=f(t.json,t.buffers,e.bufferView);u=Object(c.c)(r.buffer,r.byteOffset,r.byteLength)}l(u,"glTF image has no data");const p=await a(u,s.a,{},i);t.images[r]=p}r.d(e,"a",(function(){return it}));const it={name:"glTF",id:"gltf",module:"gltf",version:"3.0.8",extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:async function(t,e={},r){(e={...it.options,...e}).gltf={...it.options.gltf,...e.gltf};const{byteOffset:n=0}=e;return await rt({},t,n,e,r)},options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0,postProcess:!0},log:console},deprecatedOptions:{fetchImages:"gltf.loadImages",createImages:"gltf.loadImages",decompress:"gltf.decompressMeshes",postProcess:"gltf.postProcess",gltf:{decompress:"gltf.decompressMeshes"}}}},function(t,e,r){"use strict";function n(t,e){if(!t)throw new Error(e)}var i=r(135);const{_parseImageNode:o}=i.a,a="undefined"!=typeof Image,s="undefined"!=typeof ImageBitmap,u=Boolean(o),c=!!i.b||u;function l(t){const e=f(t);if(!e)throw new Error("Not an image");return e}function h(t){switch(l(t)){case"data":return t;case"image":case"imagebitmap":const e=document.createElement("canvas"),r=e.getContext("2d");if(!r)throw new Error("getImageData");return e.width=t.width,e.height=t.height,r.drawImage(t,0,0),r.getImageData(0,0,t.width,t.height);default:throw new Error("getImageData")}}function f(t){return"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?"imagebitmap":"undefined"!=typeof Image&&t instanceof Image?"image":t&&"object"==typeof t&&t.data&&t.width&&t.height?"data":null}const p=/^data:image\/svg\+xml/,d=/\.svg((\?|#).*)?$/;function A(t){return t&&(p.test(t)||d.test(t))}function g(t,e){if(A(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}async function m(t,e,r){const n=function(t,e){if(A(e)){const e=(new TextDecoder).decode(t);return`data:image/svg+xml;base64,${btoa(e)}`}return g(t,e)}(t,r),i=self.URL||self.webkitURL,o="string"!=typeof n&&i.createObjectURL(n);try{return await async function(t,e){const r=new Image;if(r.src=t,e.image&&e.image.decode&&r.decode)return await r.decode(),r;return await new Promise((e,n)=>{try{r.onload=()=>e(r),r.onerror=e=>n(new Error(`Could not load image ${t}: ${e}`))}catch(t){n(t)}})}(o||n,e)}finally{o&&i.revokeObjectURL(o)}}const y={};let v=!0;async function _(t,e,r){let n;if(A(r)){n=await m(t,e,r)}else n=g(t,r);const i=e&&e.imagebitmap;return await async function(t,e=null){!function(t){for(const e in t||y)return!1;return!0}(e)&&v||(e=null);if(e)try{return await createImageBitmap(t,e)}catch(t){console.warn(t),v=!1}return await createImageBitmap(t)}(n,i)}var b=r(172);r.d(e,"a",(function(){return x}));const x={id:"image",module:"images",name:"Images",version:"3.0.8",mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],extensions:["png","jpg","jpeg","gif","webp","bmp","ico","svg"],parse:async function(t,e,r){const o=((e=e||{}).image||{}).type||"auto",{url:u}=r||{};let l;switch(function(t){switch(t){case"auto":case"data":return function(){if(s)return"imagebitmap";if(a)return"image";if(c)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(t){switch(t){case"auto":return s||a||c;case"imagebitmap":return s;case"image":return a;case"data":return c;default:throw new Error(`@loaders.gl/images: image ${t} not supported in this environment`)}}(t),t}}(o)){case"imagebitmap":l=await _(t,e,u);break;case"image":l=await m(t,e,u);break;case"data":l=await function(t,e){const{mimeType:r}=Object(b.a)(t)||{},{_parseImageNode:o}=i.a;return n(o),o(t,r,e)}(t,e);break;default:n(!1)}return"data"===o&&(l=h(l)),l},tests:[t=>Boolean(Object(b.a)(new DataView(t)))],options:{image:{type:"auto",decode:!0}}}},function(t,e,r){"use strict";var n=r(39),i=r(55),o=r(71),a=r(7),s=r(100),u=r(9);const c={5126:w.bind(null,"uniform1fv",A,1,E),35664:w.bind(null,"uniform2fv",A,2,E),35665:w.bind(null,"uniform3fv",A,3,E),35666:w.bind(null,"uniform4fv",A,4,E),5124:w.bind(null,"uniform1iv",g,1,E),35667:w.bind(null,"uniform2iv",g,2,E),35668:w.bind(null,"uniform3iv",g,3,E),35669:w.bind(null,"uniform4iv",g,4,E),35670:w.bind(null,"uniform1iv",g,1,E),35671:w.bind(null,"uniform2iv",g,2,E),35672:w.bind(null,"uniform3iv",g,3,E),35673:w.bind(null,"uniform4iv",g,4,E),35674:w.bind(null,"uniformMatrix2fv",A,4,S),35675:w.bind(null,"uniformMatrix3fv",A,9,S),35676:w.bind(null,"uniformMatrix4fv",A,16,S),35678:x,35680:x,5125:w.bind(null,"uniform1uiv",m,1,E),36294:w.bind(null,"uniform2uiv",m,2,E),36295:w.bind(null,"uniform3uiv",m,3,E),36296:w.bind(null,"uniform4uiv",m,4,E),35685:w.bind(null,"uniformMatrix2x3fv",A,6,S),35686:w.bind(null,"uniformMatrix2x4fv",A,8,S),35687:w.bind(null,"uniformMatrix3x2fv",A,6,S),35688:w.bind(null,"uniformMatrix3x4fv",A,12,S),35689:w.bind(null,"uniformMatrix4x2fv",A,8,S),35690:w.bind(null,"uniformMatrix4x3fv",A,12,S),35678:x,35680:x,35679:x,35682:x,36289:x,36292:x,36293:x,36298:x,36299:x,36300:x,36303:x,36306:x,36307:x,36308:x,36311:x},l={},h={},f={},p=[0];function d(t,e,r,n){1===e&&"boolean"==typeof t&&(t=t?1:0),Number.isFinite(t)&&(p[0]=t,t=p);const i=t.length;if(i%e&&a.k.warn(`Uniform size should be multiples of ${e}`,t)(),t instanceof r)return t;let o=n[i];o||(o=new r(i),n[i]=o);for(let e=0;e<i;e++)o[e]=t[e];return o}function A(t,e){return d(t,e,Float32Array,l)}function g(t,e){return d(t,e,Int32Array,h)}function m(t,e){return d(t,e,Uint32Array,f)}function y(t,e,r){const n=c[r.type];if(!n)throw new Error(`Unknown GLSL uniform type ${r.type}`);return n().bind(null,t,e)}function v(t){if("]"!==t[t.length-1])return{name:t,length:1,isArray:!1};const e=t.match(/([^[]*)(\[[0-9]+\])?/);if(!e||e.length<2)throw new Error(`Failed to parse GLSL uniform name ${t}`);return{name:e[1],length:e[2]||1,isArray:Boolean(e[2])}}function _(t){return Array.isArray(t)||ArrayBuffer.isView(t)?function(t){if(0===t.length)return!1;const e=Math.min(t.length,16);for(let r=0;r<e;++r)if(!Number.isFinite(t[r]))return!1;return!0}(t):!!isFinite(t)||(!0===t||!1===t||(t instanceof i.a||(t instanceof s.a||t instanceof o.a&&Boolean(t.texture))))}function b(t,e,r){if(Array.isArray(r)||ArrayBuffer.isView(r))if(t[e]){const n=t[e];for(let t=0,e=r.length;t<e;++t)n[t]=r[t]}else t[e]=r.slice();else t[e]=r}function x(){let t=null;return(e,r,n)=>{const i=t!==n;return i&&(e.uniform1i(r,n),t=n),i}}function w(t,e,r,n){let i=null,o=null;return(a,s,c)=>{const l=e(c,r),h=l.length;let f=!1;if(null===i)i=new Float32Array(h),o=h,f=!0;else{Object(u.a)(o===h,"Uniform length cannot change.");for(let t=0;t<h;++t)if(l[t]!==i[t]){f=!0;break}}return f&&(n(a,t,s,l),i.set(l)),f}}function E(t,e,r,n){t[e](r,n)}function S(t,e,r,n){t[e](r,!1,n)}function O(t,e="unnamed"){const r=t.match(/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/);return r?r[1]:e}function T(t,e,r,n){const i=t.split(/\r?\n/),o={},a={},s=n||O(e)||"(unnamed)",u=`${function(t){switch(t){case 35632:return"fragment";case 35633:return"vertex";default:return"unknown type"}}(r)} shader ${s}`;for(let e=0;e<i.length;e++){const r=i[e];if(r.length<=1)continue;const n=r.split(":"),s=n[0],c=parseInt(n[2],10);if(isNaN(c))throw new Error(`GLSL compilation error in ${u}: ${t}`);"WARNING"!==s?o[c]=r:a[c]=r}const c=function(t,e=1,r=": "){const n=t.split(/\r?\n/),i=String(n.length+e-1).length;return n.map((t,n)=>{const o=String(n+e),a=o.length;return M(o,i-a)+r+t})}(e);return{shaderName:u,errors:P(o,c),warnings:P(a,c)}}function P(t,e){let r="";for(let n=0;n<e.length;n++){const i=e[n];if((t[n+3]||t[n+2]||t[n+1])&&(r+=`${i}\n`,t[n+1])){const e=t[n+1],i=e.split(":",3),o=i[0],a=parseInt(i[1],10)||0;r+=M(`^^^ ${o}: ${e.substring(i.join(":").length+1).trim()}\n\n`,a)}}return r}function M(t,e){let r="";for(let t=0;t<e;++t)r+=" ";return`${r}${t}`}var C=r(48);class I extends n.a{static getTypeName(t){switch(t){case 35633:return"vertex-shader";case 35632:return"fragment-shader";default:return Object(u.a)(!1),"unknown"}}constructor(t,e){Object(a.b)(t),Object(u.a)("string"==typeof e.source,"Shader: GLSL source code must be a JavaScript string"),super(t,{id:O(e.source,null)||e.id||Object(C.c)(`unnamed ${I.getTypeName(e.shaderType)}`)}),this.shaderType=e.shaderType,this.source=e.source,this.initialize(e)}initialize({source:t}){const e=O(t,null);e&&(this.id=Object(C.c)(e)),this._compile(t)}getParameter(t){return this.gl.getShaderParameter(this.handle,t)}toString(){return`${I.getTypeName(this.shaderType)}:${this.id}`}getName(){return O(this.source)||"unnamed-shader"}getSource(){return this.gl.getShaderSource(this.handle)}getTranslatedSource(){const t=this.gl.getExtension("WEBGL_debug_shaders");return t?t.getTranslatedShaderSource(this.handle):"No translated source available. WEBGL_debug_shaders not implemented"}_compile(t=this.source){if(t.startsWith("#version ")||(t=`#version 100\n${t}`),this.source=t,this.gl.shaderSource(this.handle,this.source),this.gl.compileShader(this.handle),!this.getParameter(35713)){const t=this.gl.getShaderInfoLog(this.handle),{shaderName:e,errors:r,warnings:n}=T(t,this.source,this.shaderType,this.id);throw a.k.error(`GLSL compilation errors in ${e}\n${r}`)(),a.k.warn(`GLSL compilation warnings in ${e}\n${n}`)(),new Error(`GLSL compilation errors in ${e}`)}}_deleteHandle(){this.gl.deleteShader(this.handle)}_getOptsFromHandle(){return{type:this.getParameter(35663),source:this.getSource()}}}class k extends I{constructor(t,e){"string"==typeof e&&(e={source:e}),super(t,Object.assign({},e,{shaderType:35633}))}_createHandle(){return this.gl.createShader(35633)}}class R extends I{constructor(t,e){"string"==typeof e&&(e={source:e}),super(t,Object.assign({},e,{shaderType:35632}))}_createHandle(){return this.gl.createShader(35632)}}var L=r(64),j=r(81);class D{constructor(t){this.id=t.id,this.attributeInfos=[],this.attributeInfosByName={},this.attributeInfosByLocation=[],this.varyingInfos=[],this.varyingInfosByName={},Object.seal(this),this._readAttributesFromProgram(t),this._readVaryingsFromProgram(t)}getAttributeInfo(t){const e=Number(t);return Number.isFinite(e)?this.attributeInfosByLocation[e]:this.attributeInfosByName[t]||null}getAttributeLocation(t){const e=this.getAttributeInfo(t);return e?e.location:-1}getAttributeAccessor(t){const e=this.getAttributeInfo(t);return e?e.accessor:null}getVaryingInfo(t){const e=Number(t);return Number.isFinite(e)?this.varyingInfos[e]:this.varyingInfosByName[t]||null}getVaryingIndex(t){const e=this.getVaryingInfo();return e?e.location:-1}getVaryingAccessor(t){const e=this.getVaryingInfo();return e?e.accessor:null}_readAttributesFromProgram(t){const{gl:e}=t,r=e.getProgramParameter(t.handle,35721);for(let n=0;n<r;n++){const{name:r,type:i,size:o}=e.getActiveAttrib(t.handle,n),a=e.getAttribLocation(t.handle,r);a>=0&&this._addAttribute(a,r,i,o)}this.attributeInfos.sort((t,e)=>t.location-e.location)}_readVaryingsFromProgram(t){const{gl:e}=t;if(!Object(a.j)(e))return;const r=e.getProgramParameter(t.handle,35971);for(let n=0;n<r;n++){const{name:r,type:i,size:o}=e.getTransformFeedbackVarying(t.handle,n);this._addVarying(n,r,i,o)}this.varyingInfos.sort((t,e)=>t.location-e.location)}_addAttribute(t,e,r,n){const{type:i,components:o}=Object(j.a)(r),a={type:i,size:n*o};this._inferProperties(t,e,a);const s={location:t,name:e,accessor:new L.a(a)};this.attributeInfos.push(s),this.attributeInfosByLocation[t]=s,this.attributeInfosByName[s.name]=s}_inferProperties(t,e,r){/instance/i.test(e)&&(r.divisor=1)}_addVarying(t,e,r,n){const{type:i,components:o}=Object(j.a)(r),a={location:t,name:e,accessor:new L.a({type:i,size:n*o})};this.varyingInfos.push(a),this.varyingInfosByName[a.name]=a}}var B=r(49);r.d(e,"a",(function(){return N}));const F=35981,z=["setVertexArray","setAttributes","setBuffers","unsetBuffers","use","getUniformCount","getUniformInfo","getUniformLocation","getUniformValue","getVarying","getFragDataLocation","getAttachedShaders","getAttributeCount","getAttributeLocation","getAttributeInfo"];class N extends n.a{constructor(t,e={}){super(t,e),this.stubRemovedMethods("Program","v6.0",z),this._isCached=!1,this.initialize(e),Object.seal(this),this._setId(e.id)}initialize(t={}){const{hash:e,vs:r,fs:n,varyings:i,bufferMode:o=F}=t;return this.hash=e||"",this.vs="string"==typeof r?new k(this.gl,{id:`${t.id}-vs`,source:r}):r,this.fs="string"==typeof n?new R(this.gl,{id:`${t.id}-fs`,source:n}):n,Object(u.a)(this.vs instanceof k),Object(u.a)(this.fs instanceof R),this.uniforms={},this._textureUniforms={},i&&i.length>0&&(Object(a.a)(this.gl),this.varyings=i,this.gl2.transformFeedbackVaryings(this.handle,i,o)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new D(this),this.setProps(t)}delete(t={}){return this._isCached?this:super.delete(t)}setProps(t){return"uniforms"in t&&this.setUniforms(t.uniforms),this}draw({logPriority:t,drawMode:e=4,vertexCount:r,offset:n=0,start:i,end:o,isIndexed:s=!1,indexType:c=5123,instanceCount:l=0,isInstanced:h=l>0,vertexArray:f=null,transformFeedback:p,framebuffer:d,parameters:A={},uniforms:g,samplers:m}){if((g||m)&&(a.k.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(g||{})),a.k.priority>=t){const n=d?d.id:"default",i=`mode=${Object(B.a)(this.gl,e)} verts=${r} `+`instances=${l} indexType=${Object(B.a)(this.gl,c)} `+`isInstanced=${h} isIndexed=${s} `+`Framebuffer=${n}`;a.k.log(t,i)()}return Object(u.a)(f),this.gl.useProgram(this.handle),!(!this._areTexturesRenderable()||0===r||h&&0===l)&&(f.bindForDraw(r,l,()=>{if(void 0!==d&&(A=Object.assign({},A,{framebuffer:d})),p){const t=Object(j.c)(e);p.begin(t)}this._bindTextures(),Object(a.o)(this.gl,A,()=>{s&&h?this.gl2.drawElementsInstanced(e,r,c,n,l):s&&Object(a.j)(this.gl)&&!isNaN(i)&&!isNaN(o)?this.gl2.drawRangeElements(e,i,o,r,c,n):s?this.gl.drawElements(e,r,c,n):h?this.gl2.drawArraysInstanced(e,n,r,l):this.gl.drawArrays(e,n,r)}),p&&p.end()}),!0)}setUniforms(t={}){a.k.priority>=2&&function(t,e,r){for(const n in t){const i=t[n];if((!r||Boolean(r[n]))&&!_(i))throw e=e?`${e} `:"",console.error(`${e} Bad uniform ${n}`,i),new Error(`${e} Bad uniform ${n}`)}}(t,this.id,this._uniformSetters),this.gl.useProgram(this.handle);for(const e in t){const r=t[e],n=this._uniformSetters[e];if(n){let t=r,a=!1;if(t instanceof o.a&&(t=t.texture),t instanceof i.a)if(a=this.uniforms[e]!==r,a){void 0===n.textureIndex&&(n.textureIndex=this._textureIndexCounter++);const r=t,{textureIndex:i}=n;r.bind(i),t=i,this._textureUniforms[e]=r}else t=n.textureIndex;else this._textureUniforms[e]&&delete this._textureUniforms[e];(n(t)||a)&&b(this.uniforms,e,r)}}return this}_areTexturesRenderable(){let t=!0;for(const e in this._textureUniforms){const r=this._textureUniforms[e];r.update(),t=t&&r.loaded}return t}_bindTextures(){for(const t in this._textureUniforms){const e=this._uniformSetters[t].textureIndex;this._textureUniforms[t].bind(e)}}_createHandle(){return this.gl.createProgram()}_deleteHandle(){this.gl.deleteProgram(this.handle)}_getOptionsFromHandle(t){const e=this.gl.getAttachedShaders(t),r={};for(const t of e){switch(this.gl.getShaderParameter(this.handle,35663)){case 35633:r.vs=new k({handle:t});break;case 35632:r.fs=new R({handle:t})}}return r}_getParameter(t){return this.gl.getProgramParameter(this.handle,t)}_setId(t){if(!t){const t=this._getName();this.id=Object(C.c)(t)}}_getName(){let t=this.vs.getName()||this.fs.getName();return t=t.replace(/shader/i,""),t=t?`${t}-program`:"program",t}_compileAndLink(){const{gl:t}=this;if(t.attachShader(this.handle,this.vs.handle),t.attachShader(this.handle,this.fs.handle),a.k.time(4,`linkProgram for ${this._getName()}`)(),t.linkProgram(this.handle),a.k.timeEnd(4,`linkProgram for ${this._getName()}`)(),t.debug||a.k.level>0){if(!t.getProgramParameter(this.handle,35714))throw new Error(`Error linking: ${t.getProgramInfoLog(this.handle)}`);if(t.validateProgram(this.handle),!t.getProgramParameter(this.handle,35715))throw new Error(`Error validating: ${t.getProgramInfoLog(this.handle)}`)}}_readUniformLocationsFromLinkedProgram(){const{gl:t}=this;this._uniformSetters={},this._uniformCount=this._getParameter(35718);for(let e=0;e<this._uniformCount;e++){const r=this.gl.getActiveUniform(this.handle,e),{name:n}=v(r.name);let i=t.getUniformLocation(this.handle,n);if(this._uniformSetters[n]=y(t,i,r),r.size>1)for(let e=0;e<r.size;e++)i=t.getUniformLocation(this.handle,`${n}[${e}]`),this._uniformSetters[`${n}[${e}]`]=y(t,i,r)}this._textureIndexCounter=0}getActiveUniforms(t,e){return this.gl2.getActiveUniforms(this.handle,t,e)}getUniformBlockIndex(t){return this.gl2.getUniformBlockIndex(this.handle,t)}getActiveUniformBlockParameter(t,e){return this.gl2.getActiveUniformBlockParameter(this.handle,t,e)}uniformBlockBinding(t,e){this.gl2.uniformBlockBinding(this.handle,t,e)}}},function(t,e,r){"use strict";var n=r(177);const i="out vec4 transform_output;\nvoid main() {\n transform_output = vec4(0);\n}",o=`#version 300 es\n${i}`;function a(t,e){e=Array.isArray(e)?e:[e];const r=t.replace(/^\s+/,"").split(/\s+/),[n,i,o]=r;return e.includes(n)&&i&&o?{qualifier:n,type:i,name:o.split(";")[0]}:null}function s(t={}){const{version:e=100,input:r,inputType:a,output:s}=t;if(!r)return 300===e?o:e>300?`#version ${e}\n${i}`:"void main() {gl_FragColor = vec4(0);}";const u=function(t,e){switch(e){case"float":return`vec4(${t}, 0.0, 0.0, 1.0)`;case"vec2":return`vec4(${t}, 0.0, 1.0)`;case"vec3":return`vec4(${t}, 1.0)`;case"vec4":return t;default:return Object(n.a)(!1),null}}(r,a);return e>=300?`#version ${e} ${300===e?"es":""}\nin ${a} ${r};\nout vec4 ${s};\nvoid main() {\n ${s} = ${u};\n}`:`varying ${a} ${r};\nvoid main() {\n gl_FragColor = ${u};\n}`}var u=r(7),c=r(34),l=r(289),h=r(9);class f{constructor(t,e={}){this.gl=t,this.currentIndex=0,this.feedbackMap={},this.varyings=null,this.bindings=[],this.resources={},this._initialize(e),Object.seal(this)}setupResources(t){for(const e of this.bindings)this._setupTransformFeedback(e,t)}updateModelProps(t={}){const{varyings:e}=this;return e.length>0&&(t=Object.assign({},t,{varyings:e})),t}getDrawOptions(t={}){const e=this.bindings[this.currentIndex],{sourceBuffers:r,transformFeedback:n}=e;return{attributes:Object.assign({},r,t.attributes),transformFeedback:n}}swap(){return!!this.feedbackMap&&(this.currentIndex=this._getNextIndex(),!0)}update(t={}){this._setupBuffers(t)}getBuffer(t){const{feedbackBuffers:e}=this.bindings[this.currentIndex],r=t?e[t]:null;return r?r instanceof c.a?r:r.buffer:null}getData(t={}){const{varyingName:e}=t,r=this.getBuffer(e);return r?r.getData():null}delete(){for(const t in this.resources)this.resources[t].delete()}_initialize(t={}){this._setupBuffers(t),this.varyings=t.varyings||Object.keys(this.bindings[this.currentIndex].feedbackBuffers),this.varyings.length>0&&Object(h.a)(Object(u.j)(this.gl))}_getFeedbackBuffers(t){const{sourceBuffers:e={}}=t,r={};if(this.bindings[this.currentIndex]&&Object.assign(r,this.bindings[this.currentIndex].feedbackBuffers),this.feedbackMap)for(const t in this.feedbackMap){const n=this.feedbackMap[t];t in e&&(r[n]=t)}Object.assign(r,t.feedbackBuffers);for(const t in r){const n=r[t];if("string"==typeof n){const i=e[n],{byteLength:o,usage:a,accessor:s}=i;r[t]=this._createNewBuffer(t,{byteLength:o,usage:a,accessor:s})}}return r}_setupBuffers(t={}){const{sourceBuffers:e=null}=t;Object.assign(this.feedbackMap,t.feedbackMap);const r=this._getFeedbackBuffers(t);this._updateBindings({sourceBuffers:e,feedbackBuffers:r})}_setupTransformFeedback(t,{model:e}){const{program:r}=e;t.transformFeedback=new l.a(this.gl,{program:r,buffers:t.feedbackBuffers})}_updateBindings(t){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],t),this.feedbackMap){const{sourceBuffers:t,feedbackBuffers:e}=this._swapBuffers(this.bindings[this.currentIndex]),r=this._getNextIndex();this.bindings[r]=this._updateBinding(this.bindings[r],{sourceBuffers:t,feedbackBuffers:e})}}_updateBinding(t,e){return t?(Object.assign(t.sourceBuffers,e.sourceBuffers),Object.assign(t.feedbackBuffers,e.feedbackBuffers),t.transformFeedback&&t.transformFeedback.setBuffers(t.feedbackBuffers),t):{sourceBuffers:Object.assign({},e.sourceBuffers),feedbackBuffers:Object.assign({},e.feedbackBuffers)}}_swapBuffers(t){if(!this.feedbackMap)return null;const e=Object.assign({},t.sourceBuffers),r=Object.assign({},t.feedbackBuffers);for(const n in this.feedbackMap){const i=this.feedbackMap[n];e[n]=t.feedbackBuffers[i],r[i]=t.sourceBuffers[n],Object(h.a)(r[i]instanceof c.a)}return{sourceBuffers:e,feedbackBuffers:r}}_createNewBuffer(t,e){const r=new c.a(this.gl,e);return this.resources[t]&&this.resources[t].delete(),this.resources[t]=r,r}_getNextIndex(){return(this.currentIndex+1)%2}}var p=r(197),d=r(98),A=r(71),g=r(230);function m(t){let e=100;const r=t.match(/[^\s]+/g);if(r.length>=2&&"#version"===r[0]){const t=parseInt(r[1],10);Number.isFinite(t)&&(e=t)}return e}var y=r(180);const v={name:"transform",vs:"attribute float transform_elementID;\nvec2 transform_getPixelSizeHalf(vec2 size) {\n return vec2(1.) / (2. * size);\n}\n\nvec2 transform_getPixelIndices(vec2 texSize, vec2 pixelSizeHalf) {\n float yIndex = floor((transform_elementID / texSize[0]) + pixelSizeHalf[1]);\n float xIndex = transform_elementID - (yIndex * texSize[0]);\n return vec2(xIndex, yIndex);\n}\nvec2 transform_getTexCoord(vec2 size) {\n vec2 pixelSizeHalf = transform_getPixelSizeHalf(size);\n vec2 indices = transform_getPixelIndices(size, pixelSizeHalf);\n vec2 coord = indices / size + pixelSizeHalf;\n return coord;\n}\nvec2 transform_getPos(vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec2 pos = (texCoord * (2.0, 2.0)) - (1., 1.);\n return pos;\n}\nvec4 transform_getInput(sampler2D texSampler, vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec4 textureColor = texture2D(texSampler, texCoord);\n return textureColor;\n}\n",fs:null};function _({vs:t,sourceTextureMap:e,targetTextureVarying:r,targetTexture:i}){let o=Object.keys(e).length,s=null;const u={};let c=t,l={};if(o>0||r){const t=c.split("\n"),f=t.slice();if(t.forEach((t,i,c)=>{if(o>0){const r=function(t,e){const r={},i=function(t){return a(t,["attribute","in"])}(t);if(!i)return null;const{type:o,name:s}=i;if(s&&e[s]){const e=`// ${t} => Replaced by Transform with a sampler`,{samplerName:i,sizeName:a,uniformDeclerations:u}=function(t){const e=`transform_uSampler_${t}`,r=`transform_uSize_${t}`;return{samplerName:e,sizeName:r,uniformDeclerations:` uniform sampler2D ${e};\n uniform vec2 ${r};`}}(s),c=function(t){switch(t){case"float":return"x";case"vec2":return"xy";case"vec3":return"xyz";case"vec4":return"xyzw";default:return Object(n.a)(!1),null}}(o),l=` ${o} ${s} = transform_getInput(${i}, ${a}).${c};\n`;return r[i]=s,{updatedLine:e,inject:{"vs:#decl":u,"vs:#main-start":l},samplerTextureMap:r}}return null}(t,e);if(r){const{updatedLine:t,inject:e}=r;f[i]=t,l=Object(y.b)([l,e]),Object.assign(u,r.samplerTextureMap),o--}}r&&!s&&(s=function(t,e){const r=a(t,["varying","out"]);if(!r)return null;return r.name===e?r.type:null}(t,r))}),r){Object(h.a)(i);const t=`transform_uSize_${r}`,e={"vs:#decl":`uniform vec2 ${t};\n`,"vs:#main-start":` vec2 transform_position = transform_getPos(${t});\n gl_Position = vec4(transform_position, 0, 1.);\n`};l=Object(y.b)([l,e])}c=f.join("\n")}return{vs:c,targetTextureType:s,inject:l,samplerTextureMap:u}}const b={10241:9728,10240:9728,10242:33071,10243:33071};class x{constructor(t,e={}){this.gl=t,this.id=this.currentIndex=0,this._swapTexture=null,this.targetTextureVarying=null,this.targetTextureType=null,this.samplerTextureMap=null,this.bindings=[],this.resources={},this._initialize(e),Object.seal(this)}updateModelProps(t={}){const e=this._processVertexShader(t);return Object.assign({},t,e)}getDrawOptions(t={}){const{sourceBuffers:e,sourceTextures:r,framebuffer:n,targetTexture:i}=this.bindings[this.currentIndex],o=Object.assign({},e,t.attributes),a=Object.assign({},t.uniforms),s=Object.assign({},t.parameters);let u=t.discard;if(this.hasSourceTextures||this.hasTargetTexture){o.transform_elementID=this.elementIDBuffer;for(const t in this.samplerTextureMap){const e=this.samplerTextureMap[t];a[t]=r[e]}this._setSourceTextureParameters();const t=function({sourceTextureMap:t,targetTextureVarying:e,targetTexture:r}){const n={};let i,o;e&&(({width:i,height:o}=r),n[`transform_uSize_${e}`]=[i,o]);for(const e in t)({width:i,height:o}=t[e]),n[`transform_uSize_${e}`]=[i,o];return n}({sourceTextureMap:r,targetTextureVarying:this.targetTextureVarying,targetTexture:i});Object.assign(a,t)}return this.hasTargetTexture&&(u=!1,s.viewport=[0,0,n.width,n.height]),{attributes:o,framebuffer:n,uniforms:a,discard:u,parameters:s}}swap(){return!!this._swapTexture&&(this.currentIndex=this._getNextIndex(),!0)}update(t={}){this._setupTextures(t)}getTargetTexture(){const{targetTexture:t}=this.bindings[this.currentIndex];return t}getData({packed:t=!1}={}){const{framebuffer:e}=this.bindings[this.currentIndex],r=Object(p.c)(e);if(!t)return r;const i=r.constructor,o=function(t){switch(t){case"float":return 1;case"vec2":return 2;case"vec3":return 3;case"vec4":return 4;default:return Object(n.a)(!1),null}}(this.targetTextureType),a=new i(r.length*o/4);let s=0;for(let t=0;t<r.length;t+=4)for(let e=0;e<o;e++)a[s++]=r[t+e];return a}getFramebuffer(){return this.bindings[this.currentIndex].framebuffer}delete(){this.ownTexture&&this.ownTexture.delete(),this.elementIDBuffer&&this.elementIDBuffer.delete()}_initialize(t={}){const{_targetTextureVarying:e,_swapTexture:r}=t;this._swapTexture=r,this.targetTextureVarying=e,this.hasTargetTexture=e,this._setupTextures(t)}_createTargetTexture(t){const{sourceTextures:e,textureOrReference:r}=t;if(r instanceof d.a)return r;const n=e[r];return n?(this._targetRefTexName=r,this._createNewTexture(n)):null}_setupTextures(t={}){const{sourceBuffers:e,_sourceTextures:r={},_targetTexture:n}=t,i=this._createTargetTexture({sourceTextures:r,textureOrReference:n});this.hasSourceTextures=this.hasSourceTextures||r&&Object.keys(r).length>0,this._updateBindings({sourceBuffers:e,sourceTextures:r,targetTexture:i}),"elementCount"in t&&this._updateElementIDBuffer(t.elementCount)}_updateElementIDBuffer(t){if("number"!=typeof t||this.elementCount>=t)return;const e=new Float32Array(t);e.forEach((t,e,r)=>{r[e]=e}),this.elementIDBuffer?this.elementIDBuffer.setData({data:e}):this.elementIDBuffer=new c.a(this.gl,{data:e,accessor:{size:1}}),this.elementCount=t}_updateBindings(t){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],t),this._swapTexture){const{sourceTextures:t,targetTexture:e}=this._swapTextures(this.bindings[this.currentIndex]),r=this._getNextIndex();this.bindings[r]=this._updateBinding(this.bindings[r],{sourceTextures:t,targetTexture:e})}}_updateBinding(t,e){const{sourceBuffers:r,sourceTextures:n,targetTexture:i}=e;if(t||(t={sourceBuffers:{},sourceTextures:{},targetTexture:null}),Object.assign(t.sourceTextures,n),Object.assign(t.sourceBuffers,r),i){t.targetTexture=i;const{width:e,height:r}=i,{framebuffer:n}=t;n?(n.update({attachments:{36064:i},resizeAttachments:!1}),n.resize({width:e,height:r})):t.framebuffer=new A.a(this.gl,{id:"transform-framebuffer",width:e,height:r,attachments:{36064:i}})}return t}_setSourceTextureParameters(){const t=this.currentIndex,{sourceTextures:e}=this.bindings[t];for(const t in e)e[t].setParameters(b)}_swapTextures(t){if(!this._swapTexture)return null;const e=Object.assign({},t.sourceTextures);return e[this._swapTexture]=t.targetTexture,{sourceTextures:e,targetTexture:t.sourceTextures[this._swapTexture]}}_createNewTexture(t){const e=Object(g.a)(t,{parameters:{10241:9728,10240:9728,10242:33071,10243:33071},pixelStore:{37440:!1}});return this.ownTexture&&this.ownTexture.delete(),this.ownTexture=e,e}_getNextIndex(){return(this.currentIndex+1)%2}_processVertexShader(t={}){const{sourceTextures:e,targetTexture:r}=this.bindings[this.currentIndex],{vs:n,uniforms:i,targetTextureType:o,inject:a,samplerTextureMap:u}=_({vs:t.vs,sourceTextureMap:e,targetTextureVarying:this.targetTextureVarying,targetTexture:r}),c=Object(y.b)([t.inject||{},a]);return this.targetTextureType=o,this.samplerTextureMap=u,{vs:n,fs:t._fs||s({version:m(n),input:this.targetTextureVarying,inputType:o,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[v].concat(t.modules||[]):t.modules,uniforms:i,inject:c}}}var w=r(48),E=r(176);r.d(e,"a",(function(){return S}));class S{static isSupported(t){return Object(u.j)(t)}constructor(t,e={}){this.gl=t,this.model=null,this.elementCount=0,this.bufferTransform=null,this.textureTransform=null,this.elementIDBuffer=null,this._initialize(e),Object.seal(this)}delete(){const{model:t,bufferTransform:e,textureTransform:r}=this;t&&t.delete(),e&&e.delete(),r&&r.delete()}run(t={}){const{clearRenderTarget:e=!0}=t,r=this._updateDrawOptions(t);e&&r.framebuffer&&r.framebuffer.clear({color:!0}),this.model.transform(r)}swap(){let t=!1;const e=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const r of e)t=t||r.swap();Object(h.a)(t,"Nothing to swap")}getBuffer(t=null){return this.bufferTransform&&this.bufferTransform.getBuffer(t)}getData(t={}){const e=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const r of e){const e=r.getData(t);if(e)return e}return null}getFramebuffer(){return this.textureTransform&&this.textureTransform.getFramebuffer()}update(t={}){"elementCount"in t&&this.model.setVertexCount(t.elementCount);const e=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const r of e)r.update(t)}_initialize(t={}){const{gl:e}=this;this._buildResourceTransforms(e,t),t=this._updateModelProps(t),this.model=new E.a(e,Object.assign({},t,{fs:t.fs||s({version:m(t.vs)}),id:t.id||"transform-model",drawMode:t.drawMode||0,vertexCount:t.elementCount})),this.bufferTransform&&this.bufferTransform.setupResources({model:this.model})}_updateModelProps(t){let e=Object.assign({},t);const r=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const t of r)e=t.updateModelProps(e);return e}_buildResourceTransforms(t,e){(function(t){if(!Object(w.a)(t.feedbackBuffers)||!Object(w.a)(t.feedbackMap)||t.varyings&&t.varyings.length>0)return!0;return!1})(e)&&(this.bufferTransform=new f(t,e)),function(t){if(!Object(w.a)(t._sourceTextures)||t._targetTexture||t._targetTextureVarying)return!0;return!1}(e)&&(this.textureTransform=new x(t,e)),Object(h.a)(this.bufferTransform||this.textureTransform,"must provide source/feedback buffers or source/target textures")}_updateDrawOptions(t){let e=Object.assign({},t);const r=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const t of r)e=Object.assign(e,t.getDrawOptions(e));return e}}},function(t,e,r){"use strict";var n=r(138);r.d(e,"a",(function(){return i}));const i={name:"pbr",vs:"uniform mat4 u_MVPMatrix;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_NormalMatrix;\n\nvarying vec3 pbr_vPosition;\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n# ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n# else\nvarying vec3 pbr_vNormal;\n# endif\n#endif\n\nvoid pbr_setPositionNormalTangentUV(vec4 position, vec4 normal, vec4 tangent, vec2 uv)\n{\n vec4 pos = u_ModelMatrix * position;\n pbr_vPosition = vec3(pos.xyz) / pos.w;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\n vec3 normalW = normalize(vec3(u_NormalMatrix * vec4(normal.xyz, 0.0)));\n vec3 tangentW = normalize(vec3(u_ModelMatrix * vec4(tangent.xyz, 0.0)));\n vec3 bitangentW = cross(normalW, tangentW) * tangent.w;\n pbr_vTBN = mat3(tangentW, bitangentW, normalW);\n#else\n pbr_vNormal = normalize(vec3(u_ModelMatrix * vec4(normal.xyz, 0.0)));\n#endif\n#endif\n\n#ifdef HAS_UV\n pbr_vUV = uv;\n#else\n pbr_vUV = vec2(0.,0.);\n#endif\n}\n",fs:"#if defined(USE_TEX_LOD) && !defined(FEATURE_GLSL_TEXTURE_LOD)\n# error PBR fragment shader: Texture LOD is not available\n#endif\n\n#if !defined(HAS_TANGENTS) && !defined(FEATURE_GLSL_DERIVATIVES)\n# error PBR fragment shader: Derivatives are not available\n#endif\n\n\n#if (__VERSION__ < 300)\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL1COND; INCR)\n#else\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL2COND; INCR)\n#endif\n\nprecision highp float;\n\nuniform bool pbr_uUnlit;\n\n#ifdef USE_IBL\nuniform samplerCube u_DiffuseEnvSampler;\nuniform samplerCube u_SpecularEnvSampler;\nuniform sampler2D u_brdfLUT;\nuniform vec2 u_ScaleIBLAmbient;\n#endif\n\n#ifdef HAS_BASECOLORMAP\nuniform sampler2D u_BaseColorSampler;\n#endif\n#ifdef HAS_NORMALMAP\nuniform sampler2D u_NormalSampler;\nuniform float u_NormalScale;\n#endif\n#ifdef HAS_EMISSIVEMAP\nuniform sampler2D u_EmissiveSampler;\nuniform vec3 u_EmissiveFactor;\n#endif\n#ifdef HAS_METALROUGHNESSMAP\nuniform sampler2D u_MetallicRoughnessSampler;\n#endif\n#ifdef HAS_OCCLUSIONMAP\nuniform sampler2D u_OcclusionSampler;\nuniform float u_OcclusionStrength;\n#endif\n\n#ifdef ALPHA_CUTOFF\nuniform float u_AlphaCutoff;\n#endif\n\nuniform vec2 u_MetallicRoughnessValues;\nuniform vec4 u_BaseColorFactor;\n\nuniform vec3 u_Camera;\n#ifdef PBR_DEBUG\nuniform vec4 u_ScaleDiffBaseMR;\nuniform vec4 u_ScaleFGDSpec;\n#endif\n\nvarying vec3 pbr_vPosition;\n\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n#else\nvarying vec3 pbr_vNormal;\n#endif\n#endif\n\n\nstruct PBRInfo\n{\n float NdotL;\n float NdotV;\n float NdotH;\n float LdotH;\n float VdotH;\n float perceptualRoughness;\n float metalness;\n vec3 reflectance0;\n vec3 reflectance90;\n float alphaRoughness;\n vec3 diffuseColor;\n vec3 specularColor;\n vec3 n;\n vec3 v;\n};\n\nconst float M_PI = 3.141592653589793;\nconst float c_MinRoughness = 0.04;\n\nvec4 SRGBtoLINEAR(vec4 srgbIn)\n{\n#ifdef MANUAL_SRGB\n#ifdef SRGB_FAST_APPROXIMATION\n vec3 linOut = pow(srgbIn.xyz,vec3(2.2));\n#else\n vec3 bLess = step(vec3(0.04045),srgbIn.xyz);\n vec3 linOut = mix( srgbIn.xyz/vec3(12.92), pow((srgbIn.xyz+vec3(0.055))/vec3(1.055),vec3(2.4)), bLess );\n#endif\n return vec4(linOut,srgbIn.w);;\n#else\n return srgbIn;\n#endif\n}\n\nvec3 getNormal()\n{\n#ifndef HAS_TANGENTS\n vec3 pos_dx = dFdx(pbr_vPosition);\n vec3 pos_dy = dFdy(pbr_vPosition);\n vec3 tex_dx = dFdx(vec3(pbr_vUV, 0.0));\n vec3 tex_dy = dFdy(vec3(pbr_vUV, 0.0));\n vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\n\n#ifdef HAS_NORMALS\n vec3 ng = normalize(pbr_vNormal);\n#else\n vec3 ng = cross(pos_dx, pos_dy);\n#endif\n\n t = normalize(t - ng * dot(ng, t));\n vec3 b = normalize(cross(ng, t));\n mat3 tbn = mat3(t, b, ng);\n#else\n mat3 tbn = pbr_vTBN;\n#endif\n\n#ifdef HAS_NORMALMAP\n vec3 n = texture2D(u_NormalSampler, pbr_vUV).rgb;\n n = normalize(tbn * ((2.0 * n - 1.0) * vec3(u_NormalScale, u_NormalScale, 1.0)));\n#else\n vec3 n = normalize(tbn[2].xyz);\n#endif\n\n return n;\n}\n\n\n#ifdef USE_IBL\nvec3 getIBLContribution(PBRInfo pbrInputs, vec3 n, vec3 reflection)\n{\n float mipCount = 9.0;\n float lod = (pbrInputs.perceptualRoughness * mipCount);\n vec3 brdf = SRGBtoLINEAR(texture2D(u_brdfLUT,\n vec2(pbrInputs.NdotV, 1.0 - pbrInputs.perceptualRoughness))).rgb;\n vec3 diffuseLight = SRGBtoLINEAR(textureCube(u_DiffuseEnvSampler, n)).rgb;\n\n#ifdef USE_TEX_LOD\n vec3 specularLight = SRGBtoLINEAR(textureCubeLod(u_SpecularEnvSampler, reflection, lod)).rgb;\n#else\n vec3 specularLight = SRGBtoLINEAR(textureCube(u_SpecularEnvSampler, reflection)).rgb;\n#endif\n\n vec3 diffuse = diffuseLight * pbrInputs.diffuseColor;\n vec3 specular = specularLight * (pbrInputs.specularColor * brdf.x + brdf.y);\n diffuse *= u_ScaleIBLAmbient.x;\n specular *= u_ScaleIBLAmbient.y;\n\n return diffuse + specular;\n}\n#endif\n\n\nvec3 diffuse(PBRInfo pbrInputs)\n{\n return pbrInputs.diffuseColor / M_PI;\n}\n\nvec3 specularReflection(PBRInfo pbrInputs)\n{\n return pbrInputs.reflectance0 +\n (pbrInputs.reflectance90 - pbrInputs.reflectance0) *\n pow(clamp(1.0 - pbrInputs.VdotH, 0.0, 1.0), 5.0);\n}\n\n\n\nfloat geometricOcclusion(PBRInfo pbrInputs)\n{\n float NdotL = pbrInputs.NdotL;\n float NdotV = pbrInputs.NdotV;\n float r = pbrInputs.alphaRoughness;\n\n float attenuationL = 2.0 * NdotL / (NdotL + sqrt(r * r + (1.0 - r * r) * (NdotL * NdotL)));\n float attenuationV = 2.0 * NdotV / (NdotV + sqrt(r * r + (1.0 - r * r) * (NdotV * NdotV)));\n return attenuationL * attenuationV;\n}\n\n\n\n\n\nfloat microfacetDistribution(PBRInfo pbrInputs)\n{\n float roughnessSq = pbrInputs.alphaRoughness * pbrInputs.alphaRoughness;\n float f = (pbrInputs.NdotH * roughnessSq - pbrInputs.NdotH) * pbrInputs.NdotH + 1.0;\n return roughnessSq / (M_PI * f * f);\n}\n\nvoid PBRInfo_setAmbientLight(inout PBRInfo pbrInputs) {\n pbrInputs.NdotL = 1.0;\n pbrInputs.NdotH = 0.0;\n pbrInputs.LdotH = 0.0;\n pbrInputs.VdotH = 1.0;\n}\n\nvoid PBRInfo_setDirectionalLight(inout PBRInfo pbrInputs, vec3 lightDirection) {\n vec3 n = pbrInputs.n;\n vec3 v = pbrInputs.v;\n vec3 l = normalize(lightDirection);\n vec3 h = normalize(l+v);\n\n pbrInputs.NdotL = clamp(dot(n, l), 0.001, 1.0);\n pbrInputs.NdotH = clamp(dot(n, h), 0.0, 1.0);\n pbrInputs.LdotH = clamp(dot(l, h), 0.0, 1.0);\n pbrInputs.VdotH = clamp(dot(v, h), 0.0, 1.0);\n}\n\nvoid PBRInfo_setPointLight(inout PBRInfo pbrInputs, PointLight pointLight) {\n vec3 light_direction = normalize(pointLight.position - pbr_vPosition);\n PBRInfo_setDirectionalLight(pbrInputs, light_direction);\n}\n\nvec3 calculateFinalColor(PBRInfo pbrInputs, vec3 lightColor) {\n vec3 F = specularReflection(pbrInputs);\n float G = geometricOcclusion(pbrInputs);\n float D = microfacetDistribution(pbrInputs);\n vec3 diffuseContrib = (1.0 - F) * diffuse(pbrInputs);\n vec3 specContrib = F * G * D / (4.0 * pbrInputs.NdotL * pbrInputs.NdotV);\n return pbrInputs.NdotL * lightColor * (diffuseContrib + specContrib);\n}\n\nvec4 pbr_filterColor(vec4 colorUnused)\n{\n#ifdef HAS_BASECOLORMAP\n vec4 baseColor = SRGBtoLINEAR(texture2D(u_BaseColorSampler, pbr_vUV)) * u_BaseColorFactor;\n#else\n vec4 baseColor = u_BaseColorFactor;\n#endif\n\n#ifdef ALPHA_CUTOFF\n if (baseColor.a < u_AlphaCutoff) {\n discard;\n }\n#endif\n\n vec3 color = vec3(0, 0, 0);\n\n if(pbr_uUnlit){\n color.rgb = baseColor.rgb;\n }\n else{\n\n\n float perceptualRoughness = u_MetallicRoughnessValues.y;\n float metallic = u_MetallicRoughnessValues.x;\n#ifdef HAS_METALROUGHNESSMAP\n\n vec4 mrSample = texture2D(u_MetallicRoughnessSampler, pbr_vUV);\n perceptualRoughness = mrSample.g * perceptualRoughness;\n metallic = mrSample.b * metallic;\n#endif\n perceptualRoughness = clamp(perceptualRoughness, c_MinRoughness, 1.0);\n metallic = clamp(metallic, 0.0, 1.0);\n\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n\n vec3 f0 = vec3(0.04);\n vec3 diffuseColor = baseColor.rgb * (vec3(1.0) - f0);\n diffuseColor *= 1.0 - metallic;\n vec3 specularColor = mix(f0, baseColor.rgb, metallic);\n float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\n\n\n\n float reflectance90 = clamp(reflectance * 25.0, 0.0, 1.0);\n vec3 specularEnvironmentR0 = specularColor.rgb;\n vec3 specularEnvironmentR90 = vec3(1.0, 1.0, 1.0) * reflectance90;\n\n vec3 n = getNormal();\n vec3 v = normalize(u_Camera - pbr_vPosition);\n\n float NdotV = clamp(abs(dot(n, v)), 0.001, 1.0);\n vec3 reflection = -normalize(reflect(v, n));\n\n PBRInfo pbrInputs = PBRInfo(\n 0.0,\n NdotV,\n 0.0,\n 0.0,\n 0.0,\n perceptualRoughness,\n metallic,\n specularEnvironmentR0,\n specularEnvironmentR90,\n alphaRoughness,\n diffuseColor,\n specularColor,\n n,\n v\n );\n\n#ifdef USE_LIGHTS\n PBRInfo_setAmbientLight(pbrInputs);\n color += calculateFinalColor(pbrInputs, lighting_uAmbientLight.color);\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uDirectionalLightCount, i++) {\n if (i < lighting_uDirectionalLightCount) {\n PBRInfo_setDirectionalLight(pbrInputs, lighting_uDirectionalLight[i].direction);\n color += calculateFinalColor(pbrInputs, lighting_uDirectionalLight[i].color);\n }\n }\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uPointLightCount, i++) {\n if (i < lighting_uPointLightCount) {\n PBRInfo_setPointLight(pbrInputs, lighting_uPointLight[i]);\n float attenuation = getPointLightAttenuation(lighting_uPointLight[i], distance(lighting_uPointLight[i].position, pbr_vPosition));\n color += calculateFinalColor(pbrInputs, lighting_uPointLight[i].color / attenuation);\n }\n }\n#endif\n#ifdef USE_IBL\n color += getIBLContribution(pbrInputs, n, reflection);\n#endif\n#ifdef HAS_OCCLUSIONMAP\n float ao = texture2D(u_OcclusionSampler, pbr_vUV).r;\n color = mix(color, color * ao, u_OcclusionStrength);\n#endif\n\n#ifdef HAS_EMISSIVEMAP\n vec3 emissive = SRGBtoLINEAR(texture2D(u_EmissiveSampler, pbr_vUV)).rgb * u_EmissiveFactor;\n color += emissive;\n#endif\n\n#ifdef PBR_DEBUG\n\n\n\n\n\n color = mix(color, baseColor.rgb, u_ScaleDiffBaseMR.y);\n color = mix(color, vec3(metallic), u_ScaleDiffBaseMR.z);\n color = mix(color, vec3(perceptualRoughness), u_ScaleDiffBaseMR.w);\n#endif\n\n }\n\n return vec4(pow(color,vec3(1.0/2.2)), baseColor.a);\n}\n",defines:{LIGHTING_FRAGMENT:1},dependencies:[n.a]}}])}));
//# sourceMappingURL=index.js.map