!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;rn=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;nt*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;r0&&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);r1&&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;o1&&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;e0&&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&&(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;e0&&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;e90)&&(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;e1&&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);hi&&(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;e180)&&(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=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);r0&&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"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-l0?f=l:ho?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;e0&&(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;l80*r){g=f=t[0],m=p=t[1];for(let e=r;ef&&(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=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;r0||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.xo.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.x&&r.x>=u&&n!==r.x&&v(io.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=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;oe[2]&&(r|=2),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;er&&(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=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;no?e:o,a=rs?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;ei&&(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;a180||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;it.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{}}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=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;f1&&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;fthis.initialize(Object.assign({},t,{pixels:e,data:e}))),this;const r="undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement;if(r&&e.readyStatethis.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{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=[];++h1)for(var r=1;r0&&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 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;e1&&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;e0&&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;++nn&&(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.lengththis.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{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;et 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=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);r0&&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;h0&&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;n0;)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.length0?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{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;n4)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=""}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=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);r0&&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);ih.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;t60?`${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;e0&&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;e0&&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);r0&&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);r2?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=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);r2&&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 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=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);r0){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;df&&(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;e0?", ":"")+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=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);r0&&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;a0?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 * 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||360)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>>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>>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<=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<>>32-t,this.unsigned):a(0,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=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=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):n1&&i[0].length=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;h1&&(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=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=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;c0&&(n+=o),n+=A(t[c],c);e.length>0&&(n+=a)}for(var l=0;l0&&!p&&(n+=o);var v=s&&u?t[y]:y;n+=A(e[l][v],y)}l0&&!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-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"];tObject(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;t1&&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=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);r0&&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=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);r2&&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=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);r4&&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=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;u0?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\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-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;nr[e]})):n.sort()),n}function k(t,e){for(var r,n,i=e[0].toUpperCase()+e.slice(1),o=0;o1&&!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=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-1&&n.splice(t,1)}),2500)}}function lt(t){for(var e=t.srcEvent.clientX,r=t.srcEvent.clientY,n=0;n-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;te.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.distancee.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.distance0&&(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=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=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?{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);r0}}]),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=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=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);r0&&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=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);r0&&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,nXt&&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=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;e0&&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=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=e[1])return t;for(var r=[],n=t.length,i=0,o=0;oe[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);r1&&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.byteLength1&&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.indexl?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=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=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 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;e1&&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;e0&&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;e0&&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 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.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);rn&&(as){var h=O(t,s,u,i);c+h>n&&(an&&(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;u0,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],_=y0&&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);r0&&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=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=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 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=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);r0}},{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=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);r1&&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 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);r0&&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;e0&&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=0&&t=0&&t1&&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=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=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;ff&&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;me[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;ti?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;nthis.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-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{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.elements&&this.setElementBuffer(this.elements);for(let t=0;t{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;t0;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;o0&&(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>> 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;tt+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{};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{},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);r0&&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;e0&&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);r0&&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;ef)d+=4*c;else for(var y=0;y=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=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);r1&&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=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=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=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=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);r0&&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);r0&&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>>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>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(;i239?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.pos127;);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;e268435455||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;o55295&&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=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":function(t,e){return t>e},"<=":function(t,e){return t<=e},">=":function(t,e){return t>=e},"<<":function(t,e){return t<>":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]{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;tNumber.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);r0&&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=o0)){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;et.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);r0&&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;tt>=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;nc){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;rc){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{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=0&&i2&&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;u0;)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=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 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 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 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 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 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{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.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=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;a80*r){n=u=t[0],s=c=t[1];for(var _=r;_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=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;e0||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.xo.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.x&&n.x>=l&&i!==n.x&&g(or.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=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;o0&&(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;u1?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=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=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=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=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<>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<>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<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.length2&&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(n=1))return n;for(;ro?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;r0;)e[r]=arguments[r+1];for(var n=0,i=e;n>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@\,;\:\\"\/\[\]\?\=\{\}\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=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&&mt0||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":"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;r255?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=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;n2){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=[];n1)&&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-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;o4?"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=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||ee))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=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;e0&&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;o1})))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=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)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;aNumber.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",(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":[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;r0&&"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;nn.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=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);ee?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=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=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=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=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=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;ethis.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);ethis.end)return this.prior=null,n;if(this.value.isDataDriven())return this.prior=null,n;if(r=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);nn.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.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>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);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;uho.max||a.yho.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;r1){if(_o(t,e))return!0;for(var n=0;n1?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;ae.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;ne.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.xi.x&&e.x>i.x||t.yi.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=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;pt.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;u80*r){n=o=t[0],i=a=t[1];for(var d=r;do&&(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=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;e0||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.xo.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.x&&n.x>=l&&i!==n.x&&la(or.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=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;on;){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);f0;)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 te?1:0}function Oa(t,e){var r=t.length;if(r<=1)return[t];for(var n,i,o=[],a=0;a1)for(var u=0;u0&&(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>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>3}if(n--,1===r||2===r)(i+=t.readSVarint())s&&(s=i),(o+=t.readSVarint())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>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=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=2&&t[l-1].equals(t[l-2]);)l--;for(var h=0;h0;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&&(wi&&(C="bevel"),"bevel"===C&&(w>2&&(C="flipbevel"),w100)_=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;D2*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=3)for(var o=0;o0?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<>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<>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<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>>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=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>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;i239?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.pos127;);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;e268435455||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;o55295&&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=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));_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=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=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=0,h=0,f=0;f-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;sn;)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;rc){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=0&&b=0&&x=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;I0&&(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;bi&&(w+=x-i),!(w=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)0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)};function wu(t,e){return te?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;ca)&&(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;gy.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;it.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=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>>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;hju&&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=0;a--)if(n.dist(o[a])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=0;for(var M=0,C=_.sections;M=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;u0;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;t0},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;i1||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=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",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(""===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(""===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:"",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: , lat: }, an object {lon: , lat: }, or an array of [, ]")};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<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>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.wrapt.wrap)&&(this.overscaledZt.overscaledZ)&&(this.canonical.xt.canonical.x)&&this.canonical.y=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=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=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=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=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.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.expirationTimeut&&(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=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=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);I1){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=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;r2){for(a=0;a=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>31}function B(t,e){for(var r=t.loadGeometry(),n=t.type,i=0,o=0,a=r.length,s=0;s>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);pf;)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;n0&&(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;pa)o=p,a=d;else if(d===a){var A=Math.abs(p-s);Ai&&(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;i1?1:r}function ht(t,e,r,n,i,o,a,s){if(n/=e,o>=(r/=e)&&a=n)return null;for(var u=[],c=0;c=r&&d=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=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;fr&&(u=l(c,p,d,g,m,r),a&&(c.start=h+s*u)):y>n?v=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&>(c,p,d,A),b=c.length-3,o&&b>=3&&(c[b]!==c[0]||c[b+1]!==c[1])&>(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;aa.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;s0&&e.size<(i?a:n))r.numPoints+=e.length/3;else{for(var s=[],u=0;ua)&&(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;n0===e)for(n=0,i=t.length;n24)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=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));l1?this._map(c,!0):null,g=(u<<5)+(e+1)+this.points.length,m=0,y=h;m>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<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<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<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=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=0?1.2:1))}function m(t,e,r,n,i,o,a){for(var s=0;s65535)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;ithis.height)return t.warnOnce("LineAtlas out of space"),null;for(var o=0,a=0;a=n&&e.x=i&&e.y0&&(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+10&&(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;ar.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];tthis.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];n1||(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);hthis._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=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=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=-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;mMath.abs(n.x-r.x)*i?{useVertical:!0}:(e===t.WritingMode.vertical?r.yn.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;O0?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;L0?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)=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;s0: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=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;ma*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;rT)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-O&&B=this.screenRightBoundary||n<100||e>this.screenBottomBoundary},ae.prototype.isInsideGrid=function(t,e,r,n){return r>=0&&t=0&&e0?(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;o0&&(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=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=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];a0||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;zt},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._currentTileIndex2};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;nt.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;l1?"@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;a0)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=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] 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>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();_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=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;I0){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":[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;he.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.dx0,h=e.dx<0,f=o;fu.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;i256&&this.clearStencil(),r.setColorMode(Ot.disabled),r.setDepthMode(Et.disabled);var i=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var o=0,a=e;o256&&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=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.currentLayer0?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&&re.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<=0&&u<=o)for(c=r;ca&&(i=a-g)}if(this.lngRange){var m=p.x,y=c.x/2;m-yu&&(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=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)180&&(p=180);var d=p/180;c+=h*p*(d/2),Math.abs(r._normalizeBearing(c,0))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)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())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=_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)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=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;re.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)-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()=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()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;o180;){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"}];le.getEast()||r.latitudee.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="×",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.ythis._map.transform.height-l?["bottom"]:[],o.xthis._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<=.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.length89.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;e0?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=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;is;)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=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*ar&&(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;n4&&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);fr&&(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);r0}),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 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=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);)++i;if(i-e>16&&t.subarray&&d)return d.decode(t.subarray(e,i));for(var o="";e>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>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>3]=.5*(+o[t>>3]+ +o[h>>3]),f=+o[(c=t+16|0)>>3],f=+Ot(.5*((p=+o[t+24>>3])+(f>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>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))>2]=1,s=c),(c=+re(15936,u))>2]=2,s=c),(c=+re(15960,u))>2]=3,s=c),(c=+re(15984,u))>2]=4,s=c),(c=+re(16008,u))>2]=5,s=c),(c=+re(16032,u))>2]=6,s=c),(c=+re(16056,u))>2]=7,s=c),(c=+re(16080,u))>2]=8,s=c),(c=+re(16104,u))>2]=9,s=c),(c=+re(16128,u))>2]=10,s=c),(c=+re(16152,u))>2]=11,s=c),(c=+re(16176,u))>2]=12,s=c),(c=+re(16200,u))>2]=13,s=c),(c=+re(16224,u))>2]=14,s=c),(c=+re(16248,u))>2]=15,s=c),(c=+re(16272,u))>2]=16,s=c),(c=+re(16296,u))>2]=17,s=c),(c=+re(16320,u))>2]=18,s=c),(c=+re(16344,u))>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]))>3]-+o[e+8>>3]))>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>>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>>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>>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>>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>>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>>0)){r=1;break}r=r+1|0}}else r=1}while(0);if(!(s>>>0>>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>>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>>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>>0)){r=1;break}r=r+1|0}}else r=1}while(0);if(!(s>>>0>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>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&OE?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),nl;)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),nl;)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),ah;){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),ah;){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>3]=l,p=l),A>3]=A,d=A),l>g?o[e>>3]=l:l=g,A>h&&(o[c>>3]=A,h=A),m=A>0&Ay?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<>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<>>=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<>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<>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>>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<>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<>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<>>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>>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<>>=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>>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<>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<>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<>>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<>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>>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<>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<>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<>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<>>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<>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>>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<>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<>>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<>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>>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>>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<>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<>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<>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<>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<>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<>>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<>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<>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<>>(u>>>0))&(e=d>>31),e&=l>>>(u>>>0),a=h<<(A=64-u|0)&(c=f>>31),u=(l<>>(d>>>0))&c|h<>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<>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>>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-32|0)}function ve(t,e,r){return t|=0,e|=0,(0|(r|=0))<32?(b(e<>>32-r|0),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>>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

>>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>>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>>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>>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>>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>>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>3]=c,f=c),d>3]=d,p=d),c>A?o[e>>3]=c:c=A,d>l&&(o[b>>3]=d,l=d),g=d>0&dm?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>3]=c,f=c),A>3]=A,p=A),c>d?o[_>>3]=c:c=d,A>l&&(o[w>>3]=A,l=A),g=A>0&Am?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>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>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=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=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);r180?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;c1&&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;et,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),ACt.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=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;tt[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;r0?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;tt,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{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;e255*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;rr||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;i12;){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;ee[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>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>3}if(1===r||2===r)t.readSVarint(),t.readSVarint(),is&&i,oc&&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=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>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>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=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>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(t-c)/o),h=Object(Eo.f)(u,l,o,e);for(let e=0,r=h.length;e0){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;t1)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;tt>=r&&t<=n),a=e.primitivePolygonIndices.value.filter(t=>t>=r&&t<=n);if(!(o.length>2)){const t=[];for(let e=0;e= 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=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=o&&i[e]=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=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);rt.minZoom&&(e.minZoom=r.minzoom),Number.isFinite(r.maxzoom)&&(!Number.isFinite(t.maxZoom)||r.maxzoom=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 e1&&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);r1&&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;s0&&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= 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;lc?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);r1&&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>>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);re?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;pa.counts?e:a.counts,r=r>a.value?r:a.value,n=n1&&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;ca?r:a,s=nu?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=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);rs?r:s,u=nc?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=0&&C=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=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;e0&&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);r1){var A=l-p,g=p+(ly*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=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);r0&&(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= (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=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=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=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 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 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;eo?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{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=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;tt}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;t85.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;en&&(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.length0)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{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{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{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=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;nt.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;e1)for(let e=0;e300?`#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;t0,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