@mapgis/webclient-mapboxgl-plugin 17.4.1 → 17.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +63 -1
- package/dist/es5/webclient-common.min.js +32 -6
- package/dist/es5/webclient-mapboxgl-plugin.min.js +1 -1
- package/dist/webclient-mapboxgl-plugin-es6.min.js +1 -1
- package/documention/EchartsLayer.html +2 -2
- package/documention/MapView.html +176 -87
- package/documention/MapViewMapboxgl.html +935 -287
- package/documention/Popup.html +3 -3
- package/documention/Screenshot.html +2 -2
- package/documention/SketchEditor.html +12 -12
- package/documention/SketchEditorMapboxgl.html +477 -241
- package/documention/global.html +942 -339
- package/documention/index.html +2 -2
- package/documention/initializeOptions.html +454 -0
- package/documention/module-%E5%AE%A2%E6%88%B7%E7%AB%AF%E5%8F%AF%E8%A7%86%E5%8C%96.MapvLayer.html +6 -2
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("@mapgis/webclient-common"));else if("function"==typeof define&&define.amd)define(["@mapgis/webclient-common"],e);else{var i="object"==typeof exports?e(require("@mapgis/webclient-common")):e(t["@mapgis/webclient-common"]);for(var r in i)("object"==typeof exports?exports:t)[r]=i[r]}}(window,function(t){return function(t){var e={};function i(r){if(e[r])return e[r].exports;var n=e[r]={i:r,l:!1,exports:{}};return t[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=t,i.c=e,i.d=function(t,e,r){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)i.d(r,n,function(e){return t[e]}.bind(null,n));return r},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=64)}([function(t,e,i){"use strict";e.__esModule=!0,e.default=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(e,i){e.exports=t},function(t,e,i){"use strict";e.__esModule=!0;var r=function(t){return t&&t.__esModule?t:{default:t}}(i(128));e.default=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),(0,r.default)(t,n.key,n)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}()},function(t,e){var i=t.exports={version:"2.6.12"};"number"==typeof __e&&(__e=i)},function(t,e,i){t.exports={default:i(126),__esModule:!0}},function(t,e,i){"use strict";e.__esModule=!0;var r=function(t){return t&&t.__esModule?t:{default:t}}(i(58));e.default=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==(void 0===e?"undefined":(0,r.default)(e))&&"function"!=typeof e?t:e}},function(t,e,i){"use strict";e.__esModule=!0;var r=o(i(145)),n=o(i(149)),a=o(i(58));function o(t){return t&&t.__esModule?t:{default:t}}e.default=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(void 0===e?"undefined":(0,a.default)(e)));t.prototype=(0,n.default)(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(r.default?(0,r.default)(t,e):t.__proto__=e)}},function(t,e,i){t.exports={default:i(105),__esModule:!0}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=s(i(0)),n=s(i(2)),a=i(1),o=s(i(84));function s(t){return t&&t.__esModule?t:{default:t}}var l=function(){function t(){(0,r.default)(this,t)}return(0,n.default)(t,null,[{key:"isMapboxExpression",value:function(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&"== != > < >= <= array at boolean case coalesce collator format image in interpolate interpolate-hcl interpolate-lab\nlength let literal match number number-format object step string to-boolean to-color to-number to-string var within".indexOf(t[0])>-1}},{key:"convertLineStyle",value:function(t,e){switch(t){case"dash":case"esriSLSDash":return e?[4,3]:[3,4];case"dash-dot":case"esriSLSDashDot":return e?[4,3,1,3]:[3,4,0,4];case"dot":case"esriSLSDot":return e?[1,3]:[0,4];case"long-dash":case"esriSLSLongDash":return e?[8,3]:[7,4];case"long-dash-dot":case"esriSLSLongDashDot":return e?[8,3,1,3]:[7,4,0,4];case"long-dash-dot-dot":case"esriSLSDashDotDot":return e?[8,3,1,3,1,3]:[7,4,0,4,0,4];case"short-dash":case"esriSLSShortDash":return e?[4,1]:[3,2];case"short-dash-dot":case"esriSLSShortDashDot":return e?[4,1,1,1]:[3,2,0,2];case"short-dash-dot-dot":case"esriSLSShortDashDotDot":return e?[4,1,1,1,1,1]:[3,2,0,2,0,2];case"short-dot":case"esriSLSShortDot":return e?[1,1]:[0,2];case"solid":case"esriSLSSolid":case"none":default:return}}},{key:"convertToGeoJSON",value:function(t){var e=t,i=e.geometry,r=i.spatialReference;return"4326"!==String(r.wkid)&&((e=t.clone()).geometry=a.Projection.project(i,new a.SpatialReference("EPSG:4326"))),t.additional&&t.additional.arc3&&(t.geometry=(0,a.editGeometryByArc3)(t.geometry,t.additional)),e.toGeoJSON()}},{key:"convertLngLatGeometry",value:function(t){return t&&t.spatialReference?t.spatialReference.isGeographic?t:a.Projection.project(t,new a.SpatialReference("EPSG:4326")):t}},{key:"convertClippingArea",value:function(e){if(!e)return e;var i=null;switch(e.type){case a.GeometryType.polygon:case a.GeometryType.multiPolygon:i=t.convertLngLatGeometry(e).toGeoJSON();break;case a.GeometryType.circle:i=t.convertLngLatGeometry(e).toPolygon().toGeoJSON();break;case a.GeometryType.extent:i=t.convertLngLatGeometry(e).toPolygon().toGeoJSON()}return i}},{key:"applyVisibleAndOpacityToColor",value:function(t,e,i){var r=a.Color.fromColor(t).clone(),n=i*(e?1:0);return r.alpha*=n,r}},{key:"createCRSByLayer",value:function(t){t&&t.spatialReference||a.Log.error("计算crsOptions错误");var e=a.TileInfoUtil.getTileInfoByLayer(t),i=t.spatialReference,r=e.origin.coordinates,n=t.extent,s={};e.lods.map(function(t){return t.clone()}).forEach(function(t){s[t.level]=t.resolution});var l="EPSG:"+i.wkid,u=i.wkt;return new o.default(l,u,{resolutions:s,origin:[r[0],r[1]],tileSize:e.getTileSize(),bounds:[n.xmin,n.ymin,n.xmax,n.ymax],unit:i.isGeographic?"degree":void 0})}}]),t}();e.default=l},function(t,e,i){var r=i(10),n=i(3),a=i(24),o=i(21),s=i(22),l=function(t,e,i){var u,h,c,p=t&l.F,f=t&l.G,d=t&l.S,y=t&l.P,m=t&l.B,v=t&l.W,g=f?n:n[e]||(n[e]={}),_=g.prototype,x=f?r:d?r[e]:(r[e]||{}).prototype;for(u in f&&(i=e),i)(h=!p&&x&&void 0!==x[u])&&s(g,u)||(c=h?x[u]:i[u],g[u]=f&&"function"!=typeof x[u]?i[u]:m&&h?a(c,r):v&&x[u]==c?function(t){var e=function(e,i,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,i)}return new t(e,i,r)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(c):y&&"function"==typeof c?a(Function.call,c):c,y&&((g.virtual||(g.virtual={}))[u]=c,t&l.R&&_&&!_[u]&&o(_,u,c)))};l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,t.exports=l},function(t,e){var i=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=i)},function(t,e,i){var r=i(50)("wks"),n=i(40),a=i(10).Symbol,o="function"==typeof a;(t.exports=function(t){return r[t]||(r[t]=o&&a[t]||(o?a:n)("Symbol."+t))}).store=r},function(t,e,i){t.exports=!i(25)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e,i){t.exports={default:i(121),__esModule:!0}},function(t,e,i){var r=i(18);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e,i){var r=i(14),n=i(65),a=i(45),o=Object.defineProperty;e.f=i(12)?Object.defineProperty:function(t,e,i){if(r(t),e=a(e,!0),r(i),n)try{return o(t,e,i)}catch(t){}if("get"in i||"set"in i)throw TypeError("Accessors not supported!");return"value"in i&&(t[e]=i.value),t}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Screenshot=e.Popup=e.ArcGISTileLayerUtil=e.ArcGISMapImageUtil=e.WebTileLayerUtil=e.VectorTileLayerUtil=e.WMTSLayerUtil=e.IGSTileLayerUtil=e.WMSLayerUtil=e.IGSMapImageUtil=void 0;var r=f(i(154)),n=f(i(62)),a=f(i(83)),o=f(i(88)),s=f(i(177)),l=f(i(89)),u=f(i(87)),h=f(i(86)),c=f(i(94)),p=f(i(95));function f(t){return t&&t.__esModule?t:{default:t}}e.IGSMapImageUtil=r.default,e.WMSLayerUtil=n.default,e.IGSTileLayerUtil=a.default,e.WMTSLayerUtil=o.default,e.VectorTileLayerUtil=s.default,e.WebTileLayerUtil=l.default,e.ArcGISMapImageUtil=u.default,e.ArcGISTileLayerUtil=h.default,e.Popup=c.default,e.Screenshot=p.default},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EchartsLayer=e.MapVLayer=e.initializeCRS=e.addStyleToMapboxglMap=e.initializeOptions=void 0;var r=m(i(38)),n=i(1),a=i(16),o=m(i(83)),s=m(i(86)),l=m(i(87)),u=m(i(88)),h=m(i(62)),c=m(i(89)),p=i(170),f=m(i(92)),d=m(i(93)),y=m(i(8));function m(t){return t&&t.__esModule?t:{default:t}}e.initializeOptions=function(t,e){e=e||{};var i={sources:{},layers:[]};switch(t.type){case n.LayerType.igsMapImage:i=a.IGSMapImageUtil.getSourcesAndStyleLayers(t);break;case n.LayerType.igsTile:i=o.default.getSourcesAndStyleLayers(t);break;case n.LayerType.arcgisVectorTile:case n.LayerType.igsVectorTile:i=a.VectorTileLayerUtil.getSourcesAndStyleLayers(t);break;case n.LayerType.arcgisTile:i=s.default.getSourcesAndStyleLayers(t);break;case n.LayerType.arcgisMapImage:i=l.default.getSourcesAndStyleLayers(t);break;case n.LayerType.wmts:i=u.default.getSourcesAndStyleLayers(t);break;case n.LayerType.wms:i=h.default.getSourcesAndStyleLayers(t);break;case n.LayerType.webTileLayer:i=c.default.getSourcesAndStyleLayers(t);break;case n.LayerType.igsFeature:case n.LayerType.geojson:case n.LayerType.wfs:i=(0,p.getGeoJSONSourcesAndStyleLayers)(t,e);break;case n.LayerType.graphics:i=(0,p.getGraphicsSourcesAndStyleLayers)(t,e);break;default:n.Log.error("未支持的图层类型")}return i},e.addStyleToMapboxglMap=function(t,e){for(var i=t.sources,n=t.layers,a=(0,r.default)(i),o=0;o<a.length;o++){var s=a[o];e.addSource(s[0],s[1])}for(var l=0;l<n.length;l++)e.addLayer(n[l]);return!0},e.initializeCRS=function(t){return y.default.createCRSByLayer(t)},e.MapVLayer=f.default,e.EchartsLayer=d.default},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,i){var r=i(68),n=i(46);t.exports=function(t){return r(n(t))}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getRasterLayer=e.getRasterSource=e.setOpacity=e.removeLayer=e.setVisible=void 0;var r=i(156);e.setVisible=r.setVisible,e.removeLayer=r.removeLayer,e.setOpacity=r.setOpacity,e.getRasterSource=r.getRasterSource,e.getRasterLayer=r.getRasterLayer},function(t,e,i){var r=i(15),n=i(30);t.exports=i(12)?function(t,e,i){return r.f(t,e,n(1,i))}:function(t,e,i){return t[e]=i,t}},function(t,e){var i={}.hasOwnProperty;t.exports=function(t,e){return i.call(t,e)}},function(t,e,i){"use strict";e.__esModule=!0;var r=a(i(157)),n=a(i(160));function a(t){return t&&t.__esModule?t:{default:t}}e.default=function(){return function(t,e){if(Array.isArray(t))return t;if((0,r.default)(Object(t)))return function(t,e){var i=[],r=!0,a=!1,o=void 0;try{for(var s,l=(0,n.default)(t);!(r=(s=l.next()).done)&&(i.push(s.value),!e||i.length!==e);r=!0);}catch(t){a=!0,o=t}finally{try{!r&&l.return&&l.return()}finally{if(a)throw o}}return i}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}()},function(t,e,i){var r=i(39);t.exports=function(t,e,i){if(r(t),void 0===e)return t;switch(i){case 1:return function(i){return t.call(e,i)};case 2:return function(i,r){return t.call(e,i,r)};case 3:return function(i,r,n){return t.call(e,i,r,n)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,i){var r=i(67),n=i(51);t.exports=Object.keys||function(t){return r(t,n)}},function(t,e){t.exports={}},function(t,e,i){var r=i(46);t.exports=function(t){return Object(r(t))}},function(t,e,i){"use strict";e.__esModule=!0;var r=a(i(4)),n=a(i(142));function a(t){return t&&t.__esModule?t:{default:t}}e.default=function t(e,i,a){null===e&&(e=Function.prototype);var o=(0,n.default)(e,i);if(void 0===o){var s=(0,r.default)(e);return null===s?void 0:t(s,i,a)}if("value"in o)return o.value;var l=o.get;return void 0!==l?l.call(a):void 0}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){var i={}.toString;t.exports=function(t){return i.call(t).slice(8,-1)}},function(t,e){t.exports=!0},function(t,e,i){"use strict";var r=i(106)(!0);i(70)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,i=this._i;return i>=e.length?{value:void 0,done:!0}:(t=r(e,i),this._i+=t.length,{value:t,done:!1})})},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,i){t.exports={default:i(124),__esModule:!0}},function(t,e,i){t.exports=function(){"use strict";var t,e,i;function r(r,n){if(t)if(e){var a="var sharedChunk = {}; ("+t+")(sharedChunk); ("+e+")(sharedChunk);",o={};t(o),(i=n(o)).workerUrl=window.URL.createObjectURL(new Blob([a],{type:"text/javascript"}))}else e=n;else t=n}return r(0,function(t){function e(t,e){return t(e={exports:{}},e.exports),e.exports}var i=r;function r(t,e,i,r){this.cx=3*t,this.bx=3*(i-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(r-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=r,this.p2x=i,this.p2y=r}r.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},r.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},r.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},r.prototype.solveCurveX=function(t,e){var i,r,n,a,o;for(void 0===e&&(e=1e-6),n=t,o=0;o<8;o++){if(a=this.sampleCurveX(n)-t,Math.abs(a)<e)return n;var s=this.sampleCurveDerivativeX(n);if(Math.abs(s)<1e-6)break;n-=a/s}if((n=t)<(i=0))return i;if(n>(r=1))return r;for(;i<r;){if(a=this.sampleCurveX(n),Math.abs(a-t)<e)return n;t>a?i=n:r=n,n=.5*(r-i)+i}return n},r.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var n=a;function a(t,e){this.x=t,this.y=e}function o(t,e,r,n){var a=new i(t,e,r,n);return function(t){return a.solve(t)}}a.prototype={clone:function(){return new a(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=e,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),i=Math.sin(t),r=i*this.x+e*this.y;return this.x=e*this.x-i*this.y,this.y=r,this},_rotateAround:function(t,e){var i=Math.cos(t),r=Math.sin(t),n=e.y+r*(this.x-e.x)+i*(this.y-e.y);return this.x=e.x+i*(this.x-e.x)-r*(this.y-e.y),this.y=n,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},a.convert=function(t){return t instanceof a?t:Array.isArray(t)?new a(t[0],t[1]):t};var s=o(.25,.1,.25,1);function l(t,e,i){return Math.min(i,Math.max(e,t))}function u(t,e,i){var r=i-e,n=((t-e)%r+r)%r+e;return n===e?i:n}function h(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];for(var r=0,n=e;r<n.length;r+=1){var a=n[r];for(var o in a)t[o]=a[o]}return t}function c(t,e){for(var i={},r=0;r<e.length;r++){var n=e[r];n in t&&(i[n]=t[n])}return i}var p=1;function f(){return p++}function d(){return function t(e){return e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function y(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 m(t,e){t.forEach(function(t){e[t]&&(e[t]=e[t].bind(e))})}function v(t,e){return-1!==t.indexOf(e,t.length-e.length)}function g(t,e,i){var r={};for(var n in t)r[n]=e.call(i||this,t[n],n,t);return r}function _(t,e,i){var r={};for(var n in t)e.call(i||this,t[n],n,t)&&(r[n]=t[n]);return r}function x(t){return Array.isArray(t)?t.map(x):"object"==typeof t&&t?g(t,x):t}var b={};function w(t){b[t]||("undefined"!=typeof console&&console.warn(t),b[t]=!0)}function S(t,e,i){return(i.y-t.y)*(e.x-t.x)>(e.y-t.y)*(i.x-t.x)}function M(t){for(var e=0,i=0,r=t.length,n=r-1,a=void 0,o=void 0;i<r;n=i++)e+=((o=t[n]).x-(a=t[i]).x)*(a.y+o.y);return e}function E(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}function k(t){var e={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,function(t,i,r,n){var a=r||n;return e[i]=!a||a.toLowerCase(),""}),e["max-age"]){var i=parseInt(e["max-age"],10);isNaN(i)?delete e["max-age"]:e["max-age"]=i}return e}var T=null;function I(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 C(t){try{var e=self[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var A,P,L,z,D=self.performance&&self.performance.now?self.performance.now.bind(self.performance):Date.now.bind(Date),R=self.requestAnimationFrame||self.mozRequestAnimationFrame||self.webkitRequestAnimationFrame||self.msRequestAnimationFrame,O=self.cancelAnimationFrame||self.mozCancelAnimationFrame||self.webkitCancelAnimationFrame||self.msCancelAnimationFrame,B={now:D,frame:function(t){var e=R(t);return{cancel:function(){return O(e)}}},getImageData:function(t,e){void 0===e&&(e=0);var i=self.document.createElement("canvas"),r=i.getContext("2d");if(!r)throw new Error("failed to create canvas 2d context");return i.width=t.width,i.height=t.height,r.drawImage(t,0,0,t.width,t.height),r.getImageData(-e,-e,t.width+2*e,t.height+2*e)},resolveURL:function(t){return A||(A=self.document.createElement("a")),A.href=t,A.href},hardwareConcurrency:self.navigator.hardwareConcurrency||4,get devicePixelRatio(){return self.devicePixelRatio},get prefersReducedMotion(){return!!self.matchMedia&&(null==P&&(P=self.matchMedia("(prefers-reduced-motion: reduce)")),P.matches)}},F={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return null},FEEDBACK_URL:"",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},V={supported:!1,testSupport:function(t){!U&&z&&(j?N(t):L=t)}},U=!1,j=!1;function N(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,z),t.isContextLost())return;V.supported=!0}catch(t){}t.deleteTexture(e),U=!0}self.document&&((z=self.document.createElement("img")).onload=function(){L&&N(L),L=null,j=!0},z.onerror=function(){U=!0,L=null},z.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var q="01",G=function(t,e){this._transformRequestFn=t,this._customAccessToken=e,this._createSkuToken()};function Z(t){return 0===t.indexOf("mapbox:")}G.prototype._createSkuToken=function(){var t=function(){for(var t="",e=0;e<10;e++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",q,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt},G.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},G.prototype.transformRequest=function(t,e,i){return this._transformRequestFn&&this._transformRequestFn(t,e,i)||{url:t}},G.prototype.normalizeStyleURL=function(t,e){if(!Z(t))return t;var i=H(t);return i.path="/styles/v1"+i.path,this._makeAPIURL(i,this._customAccessToken||e)},G.prototype.normalizeGlyphsURL=function(t,e){if(!Z(t))return t;var i=H(t);return i.path="/fonts/v1"+i.path,this._makeAPIURL(i,this._customAccessToken||e)},G.prototype.normalizeSourceURL=function(t,e){if(!Z(t))return t;var i=H(t);return i.path="/v4/"+i.authority+".json",i.params.push("secure"),this._makeAPIURL(i,this._customAccessToken||e)},G.prototype.normalizeSpriteURL=function(t,e,i,r){var n=H(t);return Z(t)?(n.path="/styles/v1"+n.path+"/sprite"+e+i,this._makeAPIURL(n,this._customAccessToken||r)):(n.path+=""+e+i,J(n))},G.prototype.normalizeTileURL=function(t,e){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!Z(t))return t;var i=H(t);i.path=i.path.replace(/(\.(png|jpg)\d*)(?=$)/,(B.devicePixelRatio>=2||512===e?"@2x":"")+(V.supported?".webp":"$1")),i.path=i.path.replace(/^.+\/v4\//,"/"),i.path="/v4"+i.path;var r=this._customAccessToken||function(t){for(var e=0,i=t;e<i.length;e+=1){var r=i[e].match(/^access_token=(.*)$/);if(r)return r[1]}return null}(i.params)||F.ACCESS_TOKEN;return F.REQUIRE_ACCESS_TOKEN&&r&&this._skuToken&&i.params.push("sku="+this._skuToken),this._makeAPIURL(i,r)},G.prototype.canonicalizeTileURL=function(t,e){var i=H(t);if(!i.path.match(/(^\/v4\/)/)||!i.path.match(/\.[\w]+$/))return t;var r="mapbox://tiles/";r+=i.path.replace("/v4/","");var n=i.params;return e&&(n=n.filter(function(t){return!t.match(/^access_token=/)})),n.length&&(r+="?"+n.join("&")),r},G.prototype.canonicalizeTileset=function(t,e){for(var i=!!e&&Z(e),r=[],n=0,a=t.tiles||[];n<a.length;n+=1){var o=a[n];W(o)?r.push(this.canonicalizeTileURL(o,i)):r.push(o)}return r},G.prototype._makeAPIURL=function(t,e){var i="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",r=H(F.API_URL);if(t.protocol=r.protocol,t.authority=r.authority,"/"!==r.path&&(t.path=""+r.path+t.path),!F.REQUIRE_ACCESS_TOKEN)return J(t);if(!(e=e||F.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+i);if("s"===e[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+i);return t.params=t.params.filter(function(t){return-1===t.indexOf("access_token")}),t.params.push("access_token="+e),J(t)};var X=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function W(t){return X.test(t)}var K=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function H(t){var e=t.match(K);if(!e)throw new Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}function J(t){var e=t.params.length?"?"+t.params.join("&"):"";return t.protocol+"://"+t.authority+t.path+e}function Y(t){if(!t)return null;var e=t.split(".");if(!e||3!==e.length)return null;try{return JSON.parse(decodeURIComponent(self.atob(e[1]).split("").map(function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)}).join("")))}catch(t){return null}}var Q=function(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};Q.prototype.getStorageKey=function(t){var e,i=Y(F.ACCESS_TOKEN);return e=i&&i.u?self.btoa(encodeURIComponent(i.u).replace(/%([0-9A-F]{2})/g,function(t,e){return String.fromCharCode(Number("0x"+e))})):F.ACCESS_TOKEN||"",t?"mapbox.eventData."+t+":"+e:"mapbox.eventData:"+e},Q.prototype.fetchEventData=function(){var t=C("localStorage"),e=this.getStorageKey(),i=this.getStorageKey("uuid");if(t)try{var r=self.localStorage.getItem(e);r&&(this.eventData=JSON.parse(r));var n=self.localStorage.getItem(i);n&&(this.anonId=n)}catch(t){w("Unable to read from LocalStorage")}},Q.prototype.saveEventData=function(){var t=C("localStorage"),e=this.getStorageKey(),i=this.getStorageKey("uuid");if(t)try{self.localStorage.setItem(i,this.anonId),Object.keys(this.eventData).length>=1&&self.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){w("Unable to write to LocalStorage")}},Q.prototype.processRequests=function(t){},Q.prototype.postEvent=function(t,e,i,r){var n=this;if(F.EVENTS_URL){var a=H(F.EVENTS_URL);a.params.push("access_token="+(r||F.ACCESS_TOKEN||""));var o={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"17.4.0",skuId:q,userId:this.anonId},s=e?h(o,e):o,l={url:J(a),headers:{"Content-Type":"text/plain"},body:JSON.stringify([s])};this.pendingRequest=wt(l,function(t){n.pendingRequest=null,i(t),n.saveEventData(),n.processRequests(r)})}},Q.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e)};var $,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)).constructor=e,e.prototype.postMapLoadEvent=function(t,e,i,r){this.skuToken=i,(F.EVENTS_URL&&r||F.ACCESS_TOKEN&&Array.isArray(t)&&t.some(function(t){return Z(t)||W(t)}))&&this.queueRequest({id:e,timestamp:Date.now()},r)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){var i=this.queue.shift(),r=i.id,n=i.timestamp;r&&this.success[r]||(this.anonId||this.fetchEventData(),y(this.anonId)||(this.anonId=d()),this.postEvent(n,{skuToken:this.skuToken},function(t){t||r&&(e.success[r]=!0)},t))}},e}(Q),it=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)).constructor=e,e.prototype.postTurnstileEvent=function(t,e){F.EVENTS_URL&&F.ACCESS_TOKEN&&Array.isArray(t)&&t.some(function(t){return Z(t)||W(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 i=Y(F.ACCESS_TOKEN),r=i?i.u:F.ACCESS_TOKEN,n=r!==this.eventData.tokenU;y(this.anonId)||(this.anonId=d(),n=!0);var a=this.queue.shift();if(this.eventData.lastSuccess){var o=new Date(this.eventData.lastSuccess),s=new Date(a),l=(a-this.eventData.lastSuccess)/864e5;n=n||l>=1||l<-1||o.getDate()!==s.getDate()}else n=!0;if(!n)return this.processRequests();this.postEvent(a,{"enabled.telemetry":!1},function(t){t||(e.eventData.lastSuccess=a,e.eventData.tokenU=r)},t)}},e}(Q)),rt=it.postTurnstileEvent.bind(it),nt=new et,at=nt.postMapLoadEvent.bind(nt),ot=500,st=50;function lt(){self.caches&&!$&&($=self.caches.open("mapbox-tiles"))}function ut(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}var ht,ct=1/0;function pt(t){++ct>st&&(t.getActor().send("enforceCacheSizeLimit",ot),ct=0)}function ft(){return null==ht&&(ht=self.OffscreenCanvas&&new self.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof self.createImageBitmap),ht}var dt={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(dt);var yt,mt,vt=function(t){function e(e,i,r){401===i&&W(r)&&(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=i,this.url=r,this.name=this.constructor.name,this.message=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},e}(Error),gt=E()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===self.location.protocol?self.parent:self).location.href},_t=function(t,e){if(!(/^file:/.test(i=t.url)||/^file:/.test(gt())&&!/^\w+:/.test(i))){if(self.fetch&&self.Request&&self.AbortController&&self.Request.prototype.hasOwnProperty("signal"))return function(t,e){var i,r=new self.AbortController,n=new self.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:gt(),signal:r.signal}),a=!1,o=!1,s=(i=n.url).indexOf("sku=")>0&&W(i);"json"===t.type&&n.headers.set("Accept","application/json");var l=function(i,r,a){if(!o){if(i&&"SecurityError"!==i.message&&w(i),r&&a)return u(r);var l=Date.now();self.fetch(n).then(function(i){if(i.ok){var r=s?i.clone():null;return u(i,r,l)}return e(new vt(i.statusText,i.status,t.url))}).catch(function(t){20!==t.code&&e(new Error(t.message))})}},u=function(i,r,s){("arrayBuffer"===t.type?i.arrayBuffer():"json"===t.type?i.json():i.text()).then(function(t){o||(r&&s&&function(t,e,i){if(lt(),$){var r={status:e.status,statusText:e.statusText,headers:new self.Headers};e.headers.forEach(function(t,e){return r.headers.set(e,t)});var n=k(e.headers.get("Cache-Control")||"");n["no-store"]||(n["max-age"]&&r.headers.set("Expires",new Date(i+1e3*n["max-age"]).toUTCString()),new Date(r.headers.get("Expires")).getTime()-i<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 i=new self.Response(e,r);lt(),$&&$.then(function(e){return e.put(ut(t.url),i)}).catch(function(t){return w(t.message)})}))}}(n,r,s),a=!0,e(null,t,i.headers.get("Cache-Control"),i.headers.get("Expires")))}).catch(function(t){o||e(new Error(t.message))})};return s?function(t,e){if(lt(),!$)return e(null);var i=ut(t.url);$.then(function(t){t.match(i).then(function(r){var n=function(t){if(!t)return!1;var e=new Date(t.headers.get("Expires")||0),i=k(t.headers.get("Cache-Control")||"");return e>Date.now()&&!i["no-cache"]}(r);t.delete(i),n&&t.put(i,r.clone()),e(null,r,n)}).catch(e)}).catch(e)}(n,l):l(null,null),{cancel:function(){o=!0,a||r.abort()}}}(t,e);if(E()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}var i;return function(t,e){var i=new self.XMLHttpRequest;for(var r in i.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(i.responseType="arraybuffer"),t.headers)i.setRequestHeader(r,t.headers[r]);return"json"===t.type&&(i.responseType="text",i.setRequestHeader("Accept","application/json")),i.withCredentials="include"===t.credentials,i.onerror=function(){e(new Error(i.statusText))},i.onload=function(){if((i.status>=200&&i.status<300||0===i.status)&&null!==i.response){var r=i.response;if("json"===t.type)try{r=JSON.parse(i.response)}catch(t){return e(t)}e(null,r,i.getResponseHeader("Cache-Control"),i.getResponseHeader("Expires"))}else e(new vt(i.statusText,i.status,t.url))},i.send(t.body),{cancel:function(){return i.abort()}}}(t,e)},xt=function(t,e){return _t(h(t,{type:"json"}),e)},bt=function(t,e){return _t(h(t,{type:"arrayBuffer"}),e)},wt=function(t,e){return _t(h(t,{method:"POST"}),e)};yt=[],mt=0;var St=function(t,e){if(V.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),mt>=F.MAX_PARALLEL_IMAGE_REQUESTS){var i={requestParameters:t,callback:e,cancelled:!1,cancel:function(){this.cancelled=!0}};return yt.push(i),i}mt++;var r=!1,n=function(){if(!r)for(r=!0,mt--;yt.length&&mt<F.MAX_PARALLEL_IMAGE_REQUESTS;){var t=yt.shift();t.cancelled||(t.cancel=St(t.requestParameters,t.callback).cancel)}},a=bt(t,function(t,i,r,a){n(),t?e(t):i&&(ft()?function(t,e){var i=new self.Blob([new Uint8Array(t)],{type:"image/png"});self.createImageBitmap(i).then(function(t){e(null,t)}).catch(function(t){e(new Error("Could not load image because of "+t.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))})}(i,e):function(t,e,i,r){var n=new self.Image,a=self.URL;n.onload=function(){e(null,n),a.revokeObjectURL(n.src)},n.onerror=function(){return e(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))};var o=new self.Blob([new Uint8Array(t)],{type:"image/png"});n.cacheControl=i,n.expires=r,n.src=t.byteLength?a.createObjectURL(o):"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII="}(i,e,r,a))});return{cancel:function(){a.cancel(),n()}}};function Mt(t,e,i){i[t]&&-1!==i[t].indexOf(e)||(i[t]=i[t]||[],i[t].push(e))}function Et(t,e,i){if(i&&i[t]){var r=i[t].indexOf(e);-1!==r&&i[t].splice(r,1)}}var kt=function(t,e){void 0===e&&(e={}),h(this,e),this.type=t},Tt=function(t){function e(e,i){void 0===i&&(i={}),t.call(this,"error",h({error:e},i))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(kt),It=function(){};It.prototype.on=function(t,e){return this._listeners=this._listeners||{},Mt(t,e,this._listeners),this},It.prototype.off=function(t,e){return Et(t,e,this._listeners),Et(t,e,this._oneTimeListeners),this},It.prototype.once=function(t,e){return this._oneTimeListeners=this._oneTimeListeners||{},Mt(t,e,this._oneTimeListeners),this},It.prototype.fire=function(t,e){"string"==typeof t&&(t=new kt(t,e||{}));var i=t.type;if(this.listens(i)){t.target=this;for(var r=0,n=this._listeners&&this._listeners[i]?this._listeners[i].slice():[];r<n.length;r+=1)n[r].call(this,t);for(var a=0,o=this._oneTimeListeners&&this._oneTimeListeners[i]?this._oneTimeListeners[i].slice():[];a<o.length;a+=1){var s=o[a];Et(i,s,this._oneTimeListeners),s.call(this,t)}var l=this._eventedParent;l&&(h(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),l.fire(t))}else t instanceof Tt&&console.error(t.error);return this},It.prototype.listens=function(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},It.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var Ct={$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_image_map"],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"},promoteId:{type:"promoteId"},"*":{type:"*"},clippingArea:{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:"*"},clippingArea:{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:"*"},clippingArea:{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},promoteId:{type:"promoteId"},isWrapData:{type:"boolean",default:!1},"*":{type:"*"},clippingArea:{type:"*"}},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"}},clippingArea:{type:"*"},"*":{type:"*"}},source_image_map:{type:{required:!0,type:"enum",values:{"image-map":{}}},url:{required:!0,type:"string"},coordinates:{required:!1,type:"array",length:4,value:{type:"array",length:2,value:"number"}},clippingArea:{type:"*"},"*":{type:"*"}},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:["宋体","宋体"],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"},within:{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:"#1890ff",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",default:"#ffffff",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:"#4F4F4F",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"}},promoteId:{"*":{type:"string"}}},At=function(t,e,i,r){this.message=(t?t+": ":"")+i,r&&(this.identifier=r),null!=e&&e.__line__&&(this.line=e.__line__)};function Pt(t){var e=t.value;return e?[new At(t.key,e,"constants have been deprecated as of v8")]:[]}function Lt(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];for(var r=0,n=e;r<n.length;r+=1){var a=n[r];for(var o in a)t[o]=a[o]}return t}function zt(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function Dt(t){if(Array.isArray(t))return t.map(Dt);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){var e={};for(var i in t)e[i]=Dt(t[i]);return e}return zt(t)}var Rt=function(t){function e(e,i){t.call(this,i),this.message=i,this.key=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(Error),Ot=function(t,e){void 0===e&&(e=[]),this.parent=t,this.bindings={};for(var i=0,r=e;i<r.length;i+=1){var n=r[i];this.bindings[n[0]]=n[1]}};Ot.prototype.concat=function(t){return new Ot(this,t)},Ot.prototype.get=function(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(t+" not found in scope.")},Ot.prototype.has=function(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)};var Bt={kind:"null"},Ft={kind:"number"},Vt={kind:"string"},Ut={kind:"boolean"},jt={kind:"color"},Nt={kind:"object"},qt={kind:"value"},Gt={kind:"collator"},Zt={kind:"formatted"},Xt={kind:"resolvedImage"};function Wt(t,e){return{kind:"array",itemType:t,N:e}}function Kt(t){if("array"===t.kind){var e=Kt(t.itemType);return"number"==typeof t.N?"array<"+e+", "+t.N+">":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var Ht=[Bt,Ft,Vt,Ut,jt,Zt,Nt,Wt(qt),Xt];function Jt(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Jt(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 i=0,r=Ht;i<r.length;i+=1)if(!Jt(r[i],e))return null}return"Expected "+Kt(t)+" but found "+Kt(e)+" instead."}var Yt=e(function(t,e){var i={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function r(t){return(t=Math.round(t))<0?0:t>255?255:t}function n(t){return r("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function a(t){return(e="%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))<0?0:e>1?1:e;var e}function o(t,e,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}try{e.parseCSSColor=function(t){var e,s=t.replace(/ /g,"").toLowerCase();if(s in i)return i[s].slice();if("#"===s[0])return 4===s.length?(e=parseInt(s.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===s.length&&(e=parseInt(s.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var l=s.indexOf("("),u=s.indexOf(")");if(-1!==l&&u+1===s.length){var h=s.substr(0,l),c=s.substr(l+1,u-(l+1)).split(","),p=1;switch(h){case"rgba":if(4!==c.length)return null;p=a(c.pop());case"rgb":return 3!==c.length?null:[n(c[0]),n(c[1]),n(c[2]),p];case"hsla":if(4!==c.length)return null;p=a(c.pop());case"hsl":if(3!==c.length)return null;var f=(parseFloat(c[0])%360+360)%360/360,d=a(c[1]),y=a(c[2]),m=y<=.5?y*(d+1):y+d-y*d,v=2*y-m;return[r(255*o(v,m,f+1/3)),r(255*o(v,m,f)),r(255*o(v,m,f-1/3)),p];default:return null}}return null}}catch(t){}}).parseCSSColor,Qt=function(t,e,i,r){void 0===r&&(r=1),this.r=t,this.g=e,this.b=i,this.a=r};Qt.parse=function(t){if(t){if(t instanceof Qt)return t;if("string"==typeof t){var e=Yt(t);if(e)return new Qt(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},Qt.prototype.toString=function(){var t=this.toArray(),e=t[1],i=t[2],r=t[3];return"rgba("+Math.round(t[0])+","+Math.round(e)+","+Math.round(i)+","+r+")"},Qt.prototype.toArray=function(){var t=this.a;return 0===t?[0,0,0,0]:[255*this.r/t,255*this.g/t,255*this.b/t,t]},Qt.black=new Qt(0,0,0,1),Qt.white=new Qt(1,1,1,1),Qt.transparent=new Qt(0,0,0,0),Qt.red=new Qt(1,0,0,1);var $t=function(t,e,i){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=i,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};$t.prototype.compare=function(t,e){return this.collator.compare(t,e)},$t.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var te=function(t,e,i,r,n){this.text=t,this.image=e,this.scale=i,this.fontStack=r,this.textColor=n},ee=function(t){this.sections=t};ee.fromString=function(t){return new ee([new te(t,null,null,null,null)])},ee.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})},ee.factory=function(t){return t instanceof ee?t:ee.fromString(t)},ee.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map(function(t){return t.text}).join("")},ee.prototype.serialize=function(){for(var t=["format"],e=0,i=this.sections;e<i.length;e+=1){var r=i[e];if(r.image)t.push(["image",r.image.name]);else{t.push(r.text);var n={};r.fontStack&&(n["text-font"]=["literal",r.fontStack.split(",")]),r.scale&&(n["font-scale"]=r.scale),r.textColor&&(n["text-color"]=["rgba"].concat(r.textColor.toArray())),t.push(n)}}return t};var ie=function(t){this.name=t.name,this.available=t.available};function re(t,e,i,r){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof i&&i>=0&&i<=255?void 0===r||"number"==typeof r&&r>=0&&r<=1?null:"Invalid rgba value ["+[t,e,i,r].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof r?[t,e,i,r]:[t,e,i]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function ne(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof Qt)return!0;if(t instanceof $t)return!0;if(t instanceof ee)return!0;if(t instanceof ie)return!0;if(Array.isArray(t)){for(var e=0,i=t;e<i.length;e+=1)if(!ne(i[e]))return!1;return!0}if("object"==typeof t){for(var r in t)if(!ne(t[r]))return!1;return!0}return!1}function ae(t){if(null===t)return Bt;if("string"==typeof t)return Vt;if("boolean"==typeof t)return Ut;if("number"==typeof t)return Ft;if(t instanceof Qt)return jt;if(t instanceof $t)return Gt;if(t instanceof ee)return Zt;if(t instanceof ie)return Xt;if(Array.isArray(t)){for(var e,i=t.length,r=0,n=t;r<n.length;r+=1){var a=ae(n[r]);if(e){if(e===a)continue;e=qt;break}e=a}return Wt(e||qt,i)}return Nt}function oe(t){var e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof Qt||t instanceof ee||t instanceof ie?t.toString():JSON.stringify(t)}ie.prototype.toString=function(){return this.name},ie.fromString=function(t){return t?new ie({name:t,available:!1}):null},ie.prototype.serialize=function(){return["image",this.name]};var se=function(t,e){this.type=t,this.value=e};se.parse=function(t,e){if(2!==t.length)return e.error("'literal' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(!ne(t[1]))return e.error("invalid value");var i=t[1],r=ae(i),n=e.expectedType;return"array"!==r.kind||0!==r.N||!n||"array"!==n.kind||"number"==typeof n.N&&0!==n.N||(r=n),new se(r,i)},se.prototype.evaluate=function(){return this.value},se.prototype.eachChild=function(){},se.prototype.outputDefined=function(){return!0},se.prototype.serialize=function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof Qt?["rgba"].concat(this.value.toArray()):this.value instanceof ee?this.value.serialize():this.value};var le=function(t){this.name="ExpressionEvaluationError",this.message=t};le.prototype.toJSON=function(){return this.message};var ue={string:Vt,number:Ft,boolean:Ut,object:Nt},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 i,r=1,n=t[0];if("array"===n){var a,o;if(t.length>2){var s=t[1];if("string"!=typeof s||!(s in ue)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);a=ue[s],r++}else a=qt;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);o=t[2],r++}i=Wt(a,o)}else i=ue[n];for(var l=[];r<t.length;r++){var u=e.parse(t[r],r,qt);if(!u)return null;l.push(u)}return new he(i,l)},he.prototype.evaluate=function(t){for(var e=0;e<this.args.length;e++){var i=this.args[e].evaluate(t);if(!Jt(this.type,ae(i)))return i;if(e===this.args.length-1)throw new le("Expected value to be of type "+Kt(this.type)+", but found "+Kt(ae(i))+" instead.")}return null},he.prototype.eachChild=function(t){this.args.forEach(t)},he.prototype.outputDefined=function(){return this.args.every(function(t){return t.outputDefined()})},he.prototype.serialize=function(){var t=this.type,e=[t.kind];if("array"===t.kind){var i=t.itemType;if("string"===i.kind||"number"===i.kind||"boolean"===i.kind){e.push(i.kind);var r=t.N;("number"==typeof r||this.args.length>1)&&e.push(r)}}return e.concat(this.args.map(function(t){return t.serialize()}))};var ce=function(t){this.type=Zt,this.sections=t};ce.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var i=t[1];if(!Array.isArray(i)&&"object"==typeof i)return e.error("First argument must be an image or text section.");for(var r=[],n=!1,a=1;a<=t.length-1;++a){var o=t[a];if(n&&"object"==typeof o&&!Array.isArray(o)){n=!1;var s=null;if(o["font-scale"]&&!(s=e.parse(o["font-scale"],1,Ft)))return null;var l=null;if(o["text-font"]&&!(l=e.parse(o["text-font"],1,Wt(Vt))))return null;var u=null;if(o["text-color"]&&!(u=e.parse(o["text-color"],1,jt)))return null;var h=r[r.length-1];h.scale=s,h.font=l,h.textColor=u}else{var c=e.parse(t[a],1,qt);if(!c)return null;var p=c.type.kind;if("string"!==p&&"value"!==p&&"null"!==p&&"resolvedImage"!==p)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");n=!0,r.push({content:c,scale:null,font:null,textColor:null})}}return new ce(r)},ce.prototype.evaluate=function(t){return new ee(this.sections.map(function(e){var i=e.content.evaluate(t);return ae(i)===Xt?new te("",i,null,null,null):new te(oe(i),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)}))},ce.prototype.eachChild=function(t){for(var e=0,i=this.sections;e<i.length;e+=1){var r=i[e];t(r.content),r.scale&&t(r.scale),r.font&&t(r.font),r.textColor&&t(r.textColor)}},ce.prototype.outputDefined=function(){return!1},ce.prototype.serialize=function(){for(var t=["format"],e=0,i=this.sections;e<i.length;e+=1){var r=i[e];t.push(r.content.serialize());var n={};r.scale&&(n["font-scale"]=r.scale.serialize()),r.font&&(n["text-font"]=r.font.serialize()),r.textColor&&(n["text-color"]=r.textColor.serialize()),t.push(n)}return t};var pe=function(t){this.type=Xt,this.input=t};pe.parse=function(t,e){if(2!==t.length)return e.error("Expected two arguments.");var i=e.parse(t[1],1,Vt);return i?new pe(i):e.error("No image name provided.")},pe.prototype.evaluate=function(t){var e=this.input.evaluate(t),i=ie.fromString(e);return i&&t.availableImages&&(i.available=t.availableImages.indexOf(e)>-1),i},pe.prototype.eachChild=function(t){t(this.input)},pe.prototype.outputDefined=function(){return!1},pe.prototype.serialize=function(){return["image",this.input.serialize()]};var fe={"to-boolean":Ut,"to-color":jt,"to-number":Ft,"to-string":Vt},de=function(t,e){this.type=t,this.args=e};de.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var i=t[0];if(("to-boolean"===i||"to-string"===i)&&2!==t.length)return e.error("Expected one argument.");for(var r=fe[i],n=[],a=1;a<t.length;a++){var o=e.parse(t[a],a,qt);if(!o)return null;n.push(o)}return new de(r,n)},de.prototype.evaluate=function(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){for(var e,i,r=0,n=this.args;r<n.length;r+=1){if(i=null,(e=n[r].evaluate(t))instanceof Qt)return e;if("string"==typeof e){var a=t.parseColor(e);if(a)return a}else if(Array.isArray(e)&&!(i=e.length<3||e.length>4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":re(e[0],e[1],e[2],e[3])))return new Qt(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new le(i||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var o=null,s=0,l=this.args;s<l.length;s+=1){if(null===(o=l[s].evaluate(t)))return 0;var u=Number(o);if(!isNaN(u))return u}throw new le("Could not convert "+JSON.stringify(o)+" to number.")}return"formatted"===this.type.kind?ee.fromString(oe(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?ie.fromString(oe(this.args[0].evaluate(t))):oe(this.args[0].evaluate(t))},de.prototype.eachChild=function(t){this.args.forEach(t)},de.prototype.outputDefined=function(){return this.args.every(function(t){return t.outputDefined()})},de.prototype.serialize=function(){if("formatted"===this.type.kind)return new ce([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new pe(this.args[0]).serialize();var t=["to-"+this.type.kind];return this.eachChild(function(e){t.push(e.serialize())}),t};var ye=["Unknown","Point","LineString","Polygon"],me=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};me.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},me.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?ye[this.feature.type]:this.feature.type:null},me.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},me.prototype.canonicalID=function(){return this.canonical},me.prototype.properties=function(){return this.feature&&this.feature.properties||{}},me.prototype.parseColor=function(t){var e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=Qt.parse(t)),e};var ve=function(t,e,i,r){this.name=t,this.type=e,this._evaluate=i,this.args=r};ve.prototype.evaluate=function(t){return this._evaluate(t,this.args)},ve.prototype.eachChild=function(t){this.args.forEach(t)},ve.prototype.outputDefined=function(){return!1},ve.prototype.serialize=function(){return[this.name].concat(this.args.map(function(t){return t.serialize()}))},ve.parse=function(t,e){var i,r=t[0],n=ve.definitions[r];if(!n)return e.error('Unknown expression "'+r+'". If you wanted a literal array, use ["literal", [...]].',0);for(var a=Array.isArray(n)?n[0]:n.type,o=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,s=o.filter(function(e){var i=e[0];return!Array.isArray(i)||i.length===t.length-1}),l=null,u=0,h=s;u<h.length;u+=1){var c=h[u],p=c[0],f=c[1];l=new ti(e.registry,e.path,null,e.scope);for(var d=[],y=!1,m=1;m<t.length;m++){var v=t[m],g=Array.isArray(p)?p[m-1]:p.type,_=l.parse(v,1+d.length,g);if(!_){y=!0;break}d.push(_)}if(!y)if(Array.isArray(p)&&p.length!==d.length)l.error("Expected "+p.length+" arguments, but found "+d.length+" instead.");else{for(var x=0;x<d.length;x++){var b=Array.isArray(p)?p[x]:p.type,w=d[x];l.concat(x+1).checkSubtype(b,w.type)}if(0===l.errors.length)return new ve(r,a,f,d)}}if(1===s.length)(i=e.errors).push.apply(i,l.errors);else{for(var S=(s.length?s:o).map(function(t){var e;return e=t[0],Array.isArray(e)?"("+e.map(Kt).join(", ")+")":"("+Kt(e.type)+"...)"}).join(" | "),M=[],E=1;E<t.length;E++){var k=e.parse(t[E],1+M.length);if(!k)return null;M.push(Kt(k.type))}e.error("Expected arguments of type "+S+", but found ("+M.join(", ")+") instead.")}return null},ve.register=function(t,e){for(var i in ve.definitions=e,e)t[i]=ve};var ge=function(t,e,i){this.type=Gt,this.locale=i,this.caseSensitive=t,this.diacriticSensitive=e};ge.parse=function(t,e){if(2!==t.length)return e.error("Expected one argument.");var i=t[1];if("object"!=typeof i||Array.isArray(i))return e.error("Collator options argument must be an object.");var r=e.parse(void 0!==i["case-sensitive"]&&i["case-sensitive"],1,Ut);if(!r)return null;var n=e.parse(void 0!==i["diacritic-sensitive"]&&i["diacritic-sensitive"],1,Ut);if(!n)return null;var a=null;return i.locale&&!(a=e.parse(i.locale,1,Vt))?null:new ge(r,n,a)},ge.prototype.evaluate=function(t){return new $t(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},ge.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)},ge.prototype.outputDefined=function(){return!1},ge.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 _e=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]))};_e.prototype.setNorthEast=function(t){return this._ne=t instanceof xe?new xe(t.lng,t.lat):xe.convert(t),this},_e.prototype.setSouthWest=function(t){return this._sw=t instanceof xe?new xe(t.lng,t.lat):xe.convert(t),this},_e.prototype.extend=function(t){var e,i,r=this._sw,n=this._ne;if(t instanceof xe)e=t,i=t;else{if(!(t instanceof _e))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(_e.convert(t)):this.extend(xe.convert(t)):this;if(i=t._ne,!(e=t._sw)||!i)return this}return r||n?(r.lng=Math.min(e.lng,r.lng),r.lat=Math.min(e.lat,r.lat),n.lng=Math.max(i.lng,n.lng),n.lat=Math.max(i.lat,n.lat)):(this._sw=new xe(e.lng,e.lat),this._ne=new xe(i.lng,i.lat)),this},_e.prototype.getCenter=function(){return new xe((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},_e.prototype.getSouthWest=function(){return this._sw},_e.prototype.getNorthEast=function(){return this._ne},_e.prototype.getNorthWest=function(){return new xe(this.getWest(),this.getNorth())},_e.prototype.getSouthEast=function(){return new xe(this.getEast(),this.getSouth())},_e.prototype.getWest=function(){return this._sw.lng},_e.prototype.getSouth=function(){return this._sw.lat},_e.prototype.getEast=function(){return this._ne.lng},_e.prototype.getNorth=function(){return this._ne.lat},_e.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},_e.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},_e.prototype.isEmpty=function(){return!(this._sw&&this._ne)},_e.prototype.contains=function(t){var e=xe.convert(t),i=e.lng,r=e.lat,n=this._sw.lng<=i&&i<=this._ne.lng;return this._sw.lng>this._ne.lng&&(n=this._sw.lng>=i&&i>=this._ne.lng),this._sw.lat<=r&&r<=this._ne.lat&&n},_e.convert=function(t){return!t||t instanceof _e?t:new _e(t)};var xe=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");this.lng=+t,this.lat=+e};xe.prototype.wrap=function(){return new xe(u(this.lng,-180,180),this.lat)},xe.prototype.toArray=function(){return[this.lng,this.lat]},xe.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},xe.prototype.distanceTo=function(t){var e=Math.PI/180,i=this.lat*e,r=t.lat*e,n=Math.sin(i)*Math.sin(r)+Math.cos(i)*Math.cos(r)*Math.cos((t.lng-this.lng)*e);return 6371008.8*Math.acos(Math.min(n,1))},xe.prototype.toBounds=function(t){void 0===t&&(t=0);var e=360*t/40075017,i=e/Math.cos(Math.PI/180*this.lat);return new _e(new xe(this.lng-i,this.lat-e),new xe(this.lng+i,this.lat+e))},xe.convert=function(t){if(t instanceof xe)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new xe(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new xe(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")};var be=function(){};be.prototype.project=function(t){var e,i;return Array.isArray(t)?(e=t[0],i=t[1]):(e=t.lng,i=t.lat),[e,i]},be.prototype.unproject=function(t){var e,i;return Array.isArray(t)?(e=t[0],i=t[1]):(e=t.x,i=t.y),[e,i]};var we=function(t){function e(){t.call(this),this.bounds=[-180,-90,180,90]}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.project=function(e){var i=t.prototype.project.call(this,e),r=i[1];return[l(i[0],this.bounds[0],this.bounds[2]),l(r,this.bounds[1],this.bounds[3])]},e.prototype.unproject=function(e){var i=t.prototype.unproject.call(this,e),r=i[1];return[l(i[0],this.bounds[0],this.bounds[2]),l(r,this.bounds[1],this.bounds[3])]},e}(be),Se=6378137,Me=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.project=function(e){var i=t.prototype.project.call(this,e),r=i[0],n=Math.PI/180,a=85.0511287798,o=Math.max(Math.min(a,i[1]),-a),s=Math.sin(o*n);return[Se*r*n,Se*Math.log((1+s)/(1-s))/2]},e.prototype.unproject=function(e){var i=t.prototype.unproject.call(this,e),r=180/Math.PI;return[i[0]*r/Se,(2*Math.atan(Math.exp(i[1]/Se))-Math.PI/2)*r]},e}(be),Ee=function(t,e){this._parseParams(arguments);var i=this.getExtent();if(!i)throw new Error("未设置坐标系范围bounds");if(!this.origin)throw new Error("未设置裁图原点");for(var r=0;r<23;r++)this.getResolution(r,this.tileSize);this._setProjection(),this.getCoordsInfo(i)},ke={width:{configurable:!0},height:{configurable:!0},originX:{configurable:!0},originY:{configurable:!0},lngLatExtent:{configurable:!0},isSquareResolution:{configurable:!0}};Ee.prototype._parseParams=function(t){this.epsgCode=t[0],this._parseOptions(t[1]||{})},Ee.prototype._parseOptions=function(t){this.origin=t.origin,this.dpi=t.dpi||96,this.unit=t.unit||"m",this.extent=t.bounds,this._resolutions=t.resolutions||{},this._scale={},this.tileSize=t.tileSize||256,this.projection=t.projection},Ee.prototype._setProjection=function(){this.projection||(this.projection=function(t){var e;switch(t){case"EPSG:4326":case"EPSG:4214":case"EPSG:4490":case"EPSG:4610":e=new we;break;case"EPSG:3857":e=new Me;break;default:throw new Error("未找到坐标系对应的投影信息")}return e}(this.epsgCode,this.getExtent()))},Ee.prototype.getExtent=function(){if(!this._rectifyExtent){var t,e=this.origin,i=Object.keys(this._resolutions).map(function(t){return parseInt(t)});if(i.length>0){for(var r=i[0],n=this._resolutions[r];r>0;)n*=2,r--;t=n*this.tileSize}else t=Math.max(this.extent[2]-e[0],e[1]-this.extent[1]);this._rectifyExtent=[e[0],e[1]-t,e[0]+t,e[1]]}return this._rectifyExtent},Ee.prototype.getOrigin=function(){return this.origin},Ee.prototype.getEpsgCode=function(){return this.epsgCode},Ee.prototype.getUnit=function(){return this.unit},Ee.prototype.getDpi=function(){return this.dpi},Ee.prototype.getMeterPerMapUnit=function(t){return"m"===t||"meter"===t?1:"degree"===t||"degrees"===t||"d"===t?2*Math.PI*6378137/360:"kilometer"===t||"km"===t?.001:"inch"===t?1/.025399999918:.3048},Ee.prototype.getResolution=function(t,e){if(!this._resolutions[t]){var i=this.getExtent(),r=Math.max(i[2]-i[0],i[3]-i[1]),n=Math.pow(2,t);this._resolutions[t]=r/n/e}return this._resolutions[t]},Ee.prototype.getScale=function(t,e){if(!this._scales[t]){var i=this.getDpi()*this.getResolution(t,e)*(1/.0254)*this.getMeterPerMapUnit(this.getUnit());this._scales[t]=1/i}return this._scales[t]},Ee.prototype.getCoordsInfo=function(t){if(!this.coordinateInfo){var e=this.origin,i=Math.min(this.extent[0],this.extent[2],e[0]),r=Math.max(this.extent[0],this.extent[2],e[0]),n=[i,Math.min(this.extent[1],this.extent[3],e[1]),r,Math.max(this.extent[1],this.extent[3],e[1])],a=this.projection.unproject([n[0],n[3]]),o=a[0],s=a[1],l=this.projection.unproject([n[2],n[1]]);this.coordinateInfo=this._initCoordinateInfo(t,[o,l[1],l[0],s])}return this.coordinateInfo},Ee.prototype._initCoordinateInfo=function(t,e){var i=t[2]-t[0],r=t[3]-t[1],n=(t[2]+t[0])/2,a=(t[3]+t[1])/2,o=this.origin,s=this.origin[0],l=this.origin[1],u=e[0],h=e[1],c=e[2],p=e[3];this._rectifyLngLatExtent=e;var f=c-u,d=p-h;return{width:i,height:r,centerX:n,centerY:a,origin:o,originX:s,originY:l,latlngBounds:e,latlngWidth:f,latlngHeight:d,latlngCenterX:u+f/2,latlngCenterY:h+d/2,latlngOrigin:[u,p],latlngOriginX:u,latlngOriginY:p}},Ee.prototype._isInRange=function(t,e){return!!(t>=e[0]&&t<=e[1])},Ee.prototype.pixelsPerMapUnit=function(t,e){return"m"!==this.unit&&"meter"!==this.unit?e/(this._rectifyExtent[3]-this._rectifyExtent[1]):e/(2*Math.PI*6378137*Math.abs(Math.cos(t*(Math.PI/180))))},Ee.prototype.getWorldSizeByTileZoom=function(t,e){var i=this.getResolution(0,this.tileSize);return t*(this.getResolution(e,this.tileSize)*Math.pow(2,e)/i)},ke.width.get=function(){return this._rectifyExtent[2]-this._rectifyExtent[0]},ke.height.get=function(){return this._rectifyExtent[3]-this._rectifyExtent[1]},ke.originX.get=function(){return this.origin[0]},ke.originY.get=function(){return this.origin[1]},ke.lngLatExtent.get=function(){return this._rectifyLngLatExtent},ke.isSquareResolution.get=function(){var t=Object.keys(this._resolutions);if(t.length<=1)return!0;for(var e=1;e<t.length;e++)if(Math.abs(this._resolutions[t[e-1]]-2*this._resolutions[t[e]])>1e-7)return!1;return!0},Object.defineProperties(Ee.prototype,ke),Ee.get=function(t){for(var e in Ee)if(Ee.hasOwnProperty(e)&&Ee[e].getEpsgCode&&Ee[e].getEpsgCode()===t)return Ee[e];return null},Ee.set=function(t){var e=t.getEpsgCode().replace(":","").toUpperCase();Ee[e]=t},Ee.EPSG4326=new Ee("EPSG:4326",{origin:[-180,90],bounds:[-180,-90,180,90],unit:"degree"}),Ee.EPSG4214=new Ee("EPSG:4214",{origin:[-180,90],bounds:[-180,-90,180,90],unit:"degree"}),Ee.EPSG4490=new Ee("EPSG:4490",{origin:[-180,90],bounds:[-180,-90,180,90],unit:"degree"}),Ee.EPSG4610=new Ee("EPSG:4610",{origin:[-180,90],bounds:[-180,-90,180,90],unit:"degree"}),Ee.EPSG3857=new Ee("EPSG:3857",{origin:[-20037508.3427892,20037508.3427892],bounds:[-20037508.3427892,-20037508.3427892,20037508.3427892,20037508.3427892]}),Ee.createCRS=function(t){var e=null;if(!t)return e;if("object"==typeof t)t instanceof Ee&&(e=t);else if("string"==typeof t){if(!Ee.get(t))throw new Error("crs "+t+" is not define");e=Ee.get(t)}return e};var Te=2*Math.PI*6371008.8;function Ie(t){return Te*Math.cos(t*Math.PI/180)}function Ce(t){return(180+t)/360}function Ae(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Pe(t,e){return t/Ie(e)}function Le(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}var ze=function(t,e,i){void 0===i&&(i=0),this.x=+t,this.y=+e,this.z=+i};function De(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function Re(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function Oe(t,e){var i=ze.fromLngLat({lng:t[0],lat:t[1]},0),r=Math.pow(2,e.z);return[Math.round(i.x*r*8192),Math.round(i.y*r*8192)]}function Be(t,e,i){return e[1]>t[1]!=i[1]>t[1]&&t[0]<(i[0]-e[0])*(t[1]-e[1])/(i[1]-e[1])+e[0]}function Fe(t,e){for(var i,r,n,a,o,s,l,u=!1,h=0,c=e.length;h<c;h++)for(var p=e[h],f=0,d=p.length;f<d-1;f++){if((a=(i=t)[0]-(r=p[f])[0])*(l=i[1]-(n=p[f+1])[1])-(s=i[0]-n[0])*(o=i[1]-r[1])==0&&a*s<=0&&o*l<=0)return!1;Be(t,p[f],p[f+1])&&(u=!u)}return u}function Ve(t,e){for(var i=0;i<e.length;i++)if(Fe(t,e[i]))return!0;return!1}function Ue(t,e,i,r){var n=r[0]-i[0],a=r[1]-i[1],o=(t[0]-i[0])*a-n*(t[1]-i[1]),s=(e[0]-i[0])*a-n*(e[1]-i[1]);return o>0&&s<0||o<0&&s>0}function je(t,e,i){for(var r=0,n=i;r<n.length;r+=1)for(var a=n[r],o=0;o<a.length-1;++o)if(0!=(c=[(h=a[o+1])[0]-(u=a[o])[0],h[1]-u[1]])[0]*(p=[(l=e)[0]-(s=t)[0],l[1]-s[1]])[1]-c[1]*p[0]&&Ue(s,l,u,h)&&Ue(u,h,s,l))return!0;var s,l,u,h,c,p;return!1}function Ne(t,e){for(var i=0;i<t.length;++i)if(!Fe(t[i],e))return!1;for(var r=0;r<t.length-1;++r)if(je(t[r],t[r+1],e))return!1;return!0}function qe(t,e){for(var i=0;i<e.length;i++)if(Ne(t,e[i]))return!0;return!1}function Ge(t,e,i){for(var r=[],n=0;n<t.length;n++){for(var a=[],o=0;o<t[n].length;o++){var s=Oe(t[n][o],i);De(e,s),a.push(s)}r.push(a)}return r}function Ze(t,e,i){for(var r=[],n=0;n<t.length;n++){var a=Ge(t[n],e,i);r.push(a)}return r}function Xe(t,e,i,r){if(t[0]<i[0]||t[0]>i[2]){var n=.5*r,a=t[0]-i[0]>n?-r:i[0]-t[0]>n?r:0;0===a&&(a=t[0]-i[2]>n?-r:i[2]-t[0]>n?r:0),t[0]+=a}De(e,t)}function We(t,e,i,r){for(var n=8192*Math.pow(2,r.z),a=[8192*r.x,8192*r.y],o=[],s=0,l=t;s<l.length;s+=1)for(var u=0,h=l[s];u<h.length;u+=1){var c=h[u],p=[c.x+a[0],c.y+a[1]];Xe(p,e,i,n),o.push(p)}return o}function Ke(t,e,i,r){for(var n,a=8192*Math.pow(2,r.z),o=[8192*r.x,8192*r.y],s=[],l=0,u=t;l<u.length;l+=1){for(var h=[],c=0,p=u[l];c<p.length;c+=1){var f=p[c],d=[f.x+o[0],f.y+o[1]];De(e,d),h.push(d)}s.push(h)}if(e[2]-e[0]<=a/2){(n=e)[0]=n[1]=1/0,n[2]=n[3]=-1/0;for(var y=0,m=s;y<m.length;y+=1)for(var v=0,g=m[y];v<g.length;v+=1)Xe(g[v],e,i,a)}return s}ze.fromLngLat=function(t,e,i){void 0===e&&(e=0);var r=xe.convert(t);if(i){var n=i.projection,a=i.getExtent(),o=i.getCoordsInfo(a),s=o.width,l=o.height,u=o.originX,h=o.originY,c=n.project(r);return new ze((c[0]-u)/s,(h-c[1])/l,Pe(e,r.lat))}return new ze(Ce(r.lng),Ae(r.lat),Pe(e,r.lat))},ze.prototype.toLngLat=function(t){if(t){var e=t.projection,i=t.getExtent(),r=t.getCoordsInfo(i),n=e.unproject([r.originX+this.x*r.width,r.originY-this.y*r.height]),a=n[0],o=n[1];return o=Math.max(-90,Math.min(90,o)),new xe(a,o)}return new xe(360*this.x-180,Le(this.y))},ze.prototype.toAltitude=function(){return this.z*Ie(Le(this.y))},ze.prototype.meterInMercatorCoordinateUnits=function(){return 1/Te*(t=Le(this.y),1/Math.cos(t*Math.PI/180));var t};var He=function(t,e){this.type=Ut,this.geojson=t,this.geometries=e};function Je(t){if(t instanceof ve){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof He)return!1;var e=!0;return t.eachChild(function(t){e&&!Je(t)&&(e=!1)}),e}function Ye(t){if(t instanceof ve&&"feature-state"===t.name)return!1;var e=!0;return t.eachChild(function(t){e&&!Ye(t)&&(e=!1)}),e}function Qe(t,e){if(t instanceof ve&&e.indexOf(t.name)>=0)return!1;var i=!0;return t.eachChild(function(t){i&&!Qe(t,e)&&(i=!1)}),i}He.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(ne(t[1])){var i=t[1];if("FeatureCollection"===i.type)for(var r=0;r<i.features.length;++r){var n=i.features[r].geometry.type;if("Polygon"===n||"MultiPolygon"===n)return new He(i,i.features[r].geometry)}else if("Feature"===i.type){var a=i.geometry.type;if("Polygon"===a||"MultiPolygon"===a)return new He(i,i.geometry)}else if("Polygon"===i.type||"MultiPolygon"===i.type)return new He(i,i)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")},He.prototype.evaluate=function(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){var i=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if("Polygon"===e.type){var a=Ge(e.coordinates,r,n),o=We(t.geometry(),i,r,n);if(!Re(i,r))return!1;for(var s=0,l=o;s<l.length;s+=1)if(!Fe(l[s],a))return!1}if("MultiPolygon"===e.type){var u=Ze(e.coordinates,r,n),h=We(t.geometry(),i,r,n);if(!Re(i,r))return!1;for(var c=0,p=h;c<p.length;c+=1)if(!Ve(p[c],u))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){var i=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if("Polygon"===e.type){var a=Ge(e.coordinates,r,n),o=Ke(t.geometry(),i,r,n);if(!Re(i,r))return!1;for(var s=0,l=o;s<l.length;s+=1)if(!Ne(l[s],a))return!1}if("MultiPolygon"===e.type){var u=Ze(e.coordinates,r,n),h=Ke(t.geometry(),i,r,n);if(!Re(i,r))return!1;for(var c=0,p=h;c<p.length;c+=1)if(!qe(p[c],u))return!1}return!0}(t,this.geometries)}return!1},He.prototype.eachChild=function(){},He.prototype.outputDefined=function(){return!0},He.prototype.serialize=function(){return["within",this.geojson]};var $e=function(t,e){this.type=e.type,this.name=t,this.boundExpression=e};$e.parse=function(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");var i=t[1];return e.scope.has(i)?new $e(i,e.scope.get(i)):e.error('Unknown variable "'+i+'". Make sure "'+i+'" has been bound in an enclosing "let" expression before using it.',1)},$e.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},$e.prototype.eachChild=function(){},$e.prototype.outputDefined=function(){return!1},$e.prototype.serialize=function(){return["var",this.name]};var ti=function(t,e,i,r,n){void 0===e&&(e=[]),void 0===r&&(r=new Ot),void 0===n&&(n=[]),this.registry=t,this.path=e,this.key=e.map(function(t){return"["+t+"]"}).join(""),this.scope=r,this.errors=n,this.expectedType=i};function ei(t,e){for(var i,r=t.length-1,n=0,a=r,o=0;n<=a;)if((i=t[o=Math.floor((n+a)/2)])<=e){if(o===r||e<t[o+1])return o;n=o+1}else{if(!(i>e))throw new le("Input is not a number.");a=o-1}return 0}ti.prototype.parse=function(t,e,i,r,n){return void 0===n&&(n={}),e?this.concat(e,i,r)._parse(t,n):this._parse(t,n)},ti.prototype._parse=function(t,e){function i(t,e,i){return"assert"===i?new he(e,[t]):"coerce"===i?new de(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 r=t[0];if("string"!=typeof r)return this.error("Expression name must be a string, but found "+typeof r+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var n=this.registry[r];if(n){var a=n.parse(t,this);if(!a)return null;if(this.expectedType){var o=this.expectedType,s=a.type;if("string"!==o.kind&&"number"!==o.kind&&"boolean"!==o.kind&&"object"!==o.kind&&"array"!==o.kind||"value"!==s.kind)if("color"!==o.kind&&"formatted"!==o.kind&&"resolvedImage"!==o.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(o,s))return null}else a=i(a,o,e.typeAnnotation||"coerce");else a=i(a,o,e.typeAnnotation||"assert")}if(!(a instanceof se)&&"resolvedImage"!==a.type.kind&&function t(e){if(e instanceof $e)return t(e.boundExpression);if(e instanceof ve&&"error"===e.name)return!1;if(e instanceof ge)return!1;if(e instanceof He)return!1;var i=e instanceof de||e instanceof he,r=!0;return e.eachChild(function(e){r=i?r&&t(e):r&&e instanceof se}),!!r&&Je(e)&&Qe(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(a)){var l=new me;try{a=new se(a.type,a.evaluate(l))}catch(t){return this.error(t.message),null}}return a}return this.error('Unknown expression "'+r+'". If you wanted a literal array, use ["literal", [...]].',0)}return this.error(void 0===t?"'undefined' value invalid. Use null instead.":"object"==typeof t?'Bare objects invalid. Use ["literal", {...}] instead.':"Expected an array, but found "+typeof t+" instead.")},ti.prototype.concat=function(t,e,i){var r="number"==typeof t?this.path.concat(t):this.path,n=i?this.scope.concat(i):this.scope;return new ti(this.registry,r,e||null,n,this.errors)},ti.prototype.error=function(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];var r=""+this.key+e.map(function(t){return"["+t+"]"}).join("");this.errors.push(new Rt(r,t))},ti.prototype.checkSubtype=function(t,e){var i=Jt(t,e);return i&&this.error(i),i};var ii=function(t,e,i){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var r=0,n=i;r<n.length;r+=1){var a=n[r],o=a[1];this.labels.push(a[0]),this.outputs.push(o)}};function ri(t,e,i){return t*(1-i)+e*i}ii.parse=function(t,e){if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");var i=e.parse(t[1],1,Ft);if(!i)return null;var r=[],n=null;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var a=1;a<t.length;a+=2){var o=1===a?-1/0:t[a],s=t[a+1],l=a,u=a+1;if("number"!=typeof o)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',l);if(r.length&&r[r.length-1][0]>=o)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var h=e.parse(s,u,n);if(!h)return null;n=n||h.type,r.push([o,h])}return new ii(n,i,r)},ii.prototype.evaluate=function(t){var e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);var r=this.input.evaluate(t);if(r<=e[0])return i[0].evaluate(t);var n=e.length;return r>=e[n-1]?i[n-1].evaluate(t):i[ei(e,r)].evaluate(t)},ii.prototype.eachChild=function(t){t(this.input);for(var e=0,i=this.outputs;e<i.length;e+=1)t(i[e])},ii.prototype.outputDefined=function(){return this.outputs.every(function(t){return t.outputDefined()})},ii.prototype.serialize=function(){for(var t=["step",this.input.serialize()],e=0;e<this.labels.length;e++)e>0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var ni=Object.freeze({__proto__:null,number:ri,color:function(t,e,i){return new Qt(ri(t.r,e.r,i),ri(t.g,e.g,i),ri(t.b,e.b,i),ri(t.a,e.a,i))},array:function(t,e,i){return t.map(function(t,r){return ri(t,e[r],i)})}}),ai=6/29*3*(6/29),oi=Math.PI/180,si=180/Math.PI;function li(t){return t>.008856451679035631?Math.pow(t,1/3):t/ai+4/29}function ui(t){return t>6/29?t*t*t:ai*(t-4/29)}function hi(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function ci(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function pi(t){var e=ci(t.r),i=ci(t.g),r=ci(t.b),n=li((.4124564*e+.3575761*i+.1804375*r)/.95047),a=li((.2126729*e+.7151522*i+.072175*r)/1);return{l:116*a-16,a:500*(n-a),b:200*(a-li((.0193339*e+.119192*i+.9503041*r)/1.08883)),alpha:t.a}}function fi(t){var e=(t.l+16)/116,i=isNaN(t.a)?e:e+t.a/500,r=isNaN(t.b)?e:e-t.b/200;return e=1*ui(e),i=.95047*ui(i),r=1.08883*ui(r),new Qt(hi(3.2404542*i-1.5371385*e-.4985314*r),hi(-.969266*i+1.8760108*e+.041556*r),hi(.0556434*i-.2040259*e+1.0572252*r),t.alpha)}var di={forward:pi,reverse:fi,interpolate:function(t,e,i){return{l:ri(t.l,e.l,i),a:ri(t.a,e.a,i),b:ri(t.b,e.b,i),alpha:ri(t.alpha,e.alpha,i)}}},yi={forward:function(t){var e=pi(t),i=e.l,r=e.a,n=e.b,a=Math.atan2(n,r)*si;return{h:a<0?a+360:a,c:Math.sqrt(r*r+n*n),l:i,alpha:t.a}},reverse:function(t){var e=t.h*oi,i=t.c;return fi({l:t.l,a:Math.cos(e)*i,b:Math.sin(e)*i,alpha:t.alpha})},interpolate:function(t,e,i){return{h:function(t,e,i){var r=e-t;return t+i*(r>180||r<-180?r-360*Math.round(r/360):r)}(t.h,e.h,i),c:ri(t.c,e.c,i),l:ri(t.l,e.l,i),alpha:ri(t.alpha,e.alpha,i)}}},mi=Object.freeze({__proto__:null,lab:di,hcl:yi}),vi=function(t,e,i,r,n){this.type=t,this.operator=e,this.interpolation=i,this.input=r,this.labels=[],this.outputs=[];for(var a=0,o=n;a<o.length;a+=1){var s=o[a],l=s[1];this.labels.push(s[0]),this.outputs.push(l)}};function gi(t,e,i,r){var n=r-i,a=t-i;return 0===n?0:1===e?a/n:(Math.pow(e,a)-1)/(Math.pow(e,n)-1)}vi.interpolationFactor=function(t,e,r,n){var a=0;if("exponential"===t.name)a=gi(e,t.base,r,n);else if("linear"===t.name)a=gi(e,1,r,n);else if("cubic-bezier"===t.name){var o=t.controlPoints;a=new i(o[0],o[1],o[2],o[3]).solve(gi(e,1,r,n))}return a},vi.parse=function(t,e){var i=t[0],r=t[1],n=t[2],a=t.slice(3);if(!Array.isArray(r)||0===r.length)return e.error("Expected an interpolation type expression.",1);if("linear"===r[0])r={name:"linear"};else if("exponential"===r[0]){var o=r[1];if("number"!=typeof o)return e.error("Exponential interpolation requires a numeric base.",1,1);r={name:"exponential",base:o}}else{if("cubic-bezier"!==r[0])return e.error("Unknown interpolation type "+String(r[0]),1,0);var s=r.slice(1);if(4!==s.length||s.some(function(t){return"number"!=typeof t||t<0||t>1}))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);r={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(!(n=e.parse(n,2,Ft)))return null;var l=[],u=null;"interpolate-hcl"===i||"interpolate-lab"===i?u=jt:e.expectedType&&"value"!==e.expectedType.kind&&(u=e.expectedType);for(var h=0;h<a.length;h+=2){var c=a[h],p=a[h+1],f=h+3,d=h+4;if("number"!=typeof c)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',f);if(l.length&&l[l.length-1][0]>=c)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',f);var y=e.parse(p,d,u);if(!y)return null;u=u||y.type,l.push([c,y])}return"number"===u.kind||"color"===u.kind||"array"===u.kind&&"number"===u.itemType.kind&&"number"==typeof u.N?new vi(u,i,r,n,l):e.error("Type "+Kt(u)+" is not interpolatable.")},vi.prototype.evaluate=function(t){var e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);var r=this.input.evaluate(t);if(r<=e[0])return i[0].evaluate(t);var n=e.length;if(r>=e[n-1])return i[n-1].evaluate(t);var a=ei(e,r),o=vi.interpolationFactor(this.interpolation,r,e[a],e[a+1]),s=i[a].evaluate(t),l=i[a+1].evaluate(t);return"interpolate"===this.operator?ni[this.type.kind.toLowerCase()](s,l,o):"interpolate-hcl"===this.operator?yi.reverse(yi.interpolate(yi.forward(s),yi.forward(l),o)):di.reverse(di.interpolate(di.forward(s),di.forward(l),o))},vi.prototype.eachChild=function(t){t(this.input);for(var e=0,i=this.outputs;e<i.length;e+=1)t(i[e])},vi.prototype.outputDefined=function(){return this.outputs.every(function(t){return t.outputDefined()})},vi.prototype.serialize=function(){var t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var e=[this.operator,t,this.input.serialize()],i=0;i<this.labels.length;i++)e.push(this.labels[i],this.outputs[i].serialize());return e};var _i=function(t,e){this.type=t,this.args=e};_i.parse=function(t,e){if(t.length<2)return e.error("Expectected at least one argument.");var i=null,r=e.expectedType;r&&"value"!==r.kind&&(i=r);for(var n=[],a=0,o=t.slice(1);a<o.length;a+=1){var s=e.parse(o[a],1+n.length,i,void 0,{typeAnnotation:"omit"});if(!s)return null;i=i||s.type,n.push(s)}var l=r&&n.some(function(t){return Jt(r,t.type)});return new _i(l?qt:i,n)},_i.prototype.evaluate=function(t){for(var e,i=null,r=0,n=0,a=this.args;n<a.length&&(r++,(i=a[n].evaluate(t))&&i instanceof ie&&!i.available&&(e||(e=i.name),i=null,r===this.args.length&&(i=e)),null===i);n+=1);return i},_i.prototype.eachChild=function(t){this.args.forEach(t)},_i.prototype.outputDefined=function(){return this.args.every(function(t){return t.outputDefined()})},_i.prototype.serialize=function(){var t=["coalesce"];return this.eachChild(function(e){t.push(e.serialize())}),t};var xi=function(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e};xi.prototype.evaluate=function(t){return this.result.evaluate(t)},xi.prototype.eachChild=function(t){for(var e=0,i=this.bindings;e<i.length;e+=1)t(i[e][1]);t(this.result)},xi.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found "+(t.length-1)+" instead.");for(var i=[],r=1;r<t.length-1;r+=2){var n=t[r];if("string"!=typeof n)return e.error("Expected string, but found "+typeof n+" instead.",r);if(/[^a-zA-Z0-9_]/.test(n))return e.error("Variable names must contain only alphanumeric characters or '_'.",r);var a=e.parse(t[r+1],r+1);if(!a)return null;i.push([n,a])}var o=e.parse(t[t.length-1],t.length-1,e.expectedType,i);return o?new xi(i,o):null},xi.prototype.outputDefined=function(){return this.result.outputDefined()},xi.prototype.serialize=function(){for(var t=["let"],e=0,i=this.bindings;e<i.length;e+=1){var r=i[e];t.push(r[0],r[1].serialize())}return t.push(this.result.serialize()),t};var bi=function(t,e,i){this.type=t,this.index=e,this.input=i};bi.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var i=e.parse(t[1],1,Ft),r=e.parse(t[2],2,Wt(e.expectedType||qt));return i&&r?new bi(r.type.itemType,i,r):null},bi.prototype.evaluate=function(t){var e=this.index.evaluate(t),i=this.input.evaluate(t);if(e<0)throw new le("Array index out of bounds: "+e+" < 0.");if(e>=i.length)throw new le("Array index out of bounds: "+e+" > "+(i.length-1)+".");if(e!==Math.floor(e))throw new le("Array index must be an integer, but found "+e+" instead.");return i[e]},bi.prototype.eachChild=function(t){t(this.index),t(this.input)},bi.prototype.outputDefined=function(){return!1},bi.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var wi=function(t,e){this.type=Ut,this.needle=t,this.haystack=e};wi.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var i,r=e.parse(t[1],1,qt),n=e.parse(t[2],2,qt);return r&&n?"boolean"!==(i=r.type).kind&&"string"!==i.kind&&"number"!==i.kind&&"null"!==i.kind&&"value"!==i.kind?e.error("Expected first argument to be of type boolean, string, number or null, but found "+Kt(r.type)+" instead"):new wi(r,n):null},wi.prototype.evaluate=function(t){var e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(null==e||!i)return!1;if("boolean"!=typeof e&&"string"!=typeof e&&"number"!=typeof e)throw new le("Expected first argument to be of type boolean, string or number, but found "+Kt(ae(e))+" instead.");if(!function(t){return Array.isArray(t)||"string"==typeof t}(i))throw new le("Expected second argument to be of type array or string, but found "+Kt(ae(i))+" instead.");return i.indexOf(e)>=0},wi.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},wi.prototype.outputDefined=function(){return!0},wi.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var Si=function(t,e,i,r,n,a){this.inputType=t,this.type=e,this.input=i,this.cases=r,this.outputs=n,this.otherwise=a};Si.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 i,r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(var n={},a=[],o=2;o<t.length-1;o+=2){var s=t[o],l=t[o+1];Array.isArray(s)||(s=[s]);var u=e.concat(o);if(0===s.length)return u.error("Expected at least one branch label.");for(var h=0,c=s;h<c.length;h+=1){var p=c[h];if("number"!=typeof p&&"string"!=typeof p)return u.error("Branch labels must be numbers or strings.");if("number"==typeof p&&Math.abs(p)>Number.MAX_SAFE_INTEGER)return u.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof p&&Math.floor(p)!==p)return u.error("Numeric branch labels must be integer values.");if(i){if(u.checkSubtype(i,ae(p)))return null}else i=ae(p);if(void 0!==n[String(p)])return u.error("Branch labels must be unique.");n[String(p)]=a.length}var f=e.parse(l,o,r);if(!f)return null;r=r||f.type,a.push(f)}var d=e.parse(t[1],1,qt);if(!d)return null;var y=e.parse(t[t.length-1],t.length-1,r);return y?"value"!==d.type.kind&&e.concat(1).checkSubtype(i,d.type)?null:new Si(i,r,d,n,a,y):null},Si.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(ae(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},Si.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},Si.prototype.outputDefined=function(){return this.outputs.every(function(t){return t.outputDefined()})&&this.otherwise.outputDefined()},Si.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],i=[],r={},n=0,a=Object.keys(this.cases).sort();n<a.length;n+=1){var o=a[n];void 0===(c=r[this.cases[o]])?(r[this.cases[o]]=i.length,i.push([this.cases[o],[o]])):i[c][1].push(o)}for(var s=function(e){return"number"===t.inputType.kind?Number(e):e},l=0,u=i;l<u.length;l+=1){var h=u[l],c=h[0],p=h[1];e.push(1===p.length?s(p[0]):p.map(s)),e.push(this.outputs[outputIndex$1].serialize())}return e.push(this.otherwise.serialize()),e};var Mi=function(t,e,i){this.type=t,this.branches=e,this.otherwise=i};function Ei(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function ki(t,e,i,r){return 0===r.compare(e,i)}function Ti(t,e,i){var r="=="!==t&&"!="!==t;return function(){function n(t,e,i){this.type=Ut,this.lhs=t,this.rhs=e,this.collator=i,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}return n.parse=function(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");var i=t[0],a=e.parse(t[1],1,qt);if(!a)return null;if(!Ei(i,a.type))return e.concat(1).error('"'+i+"\" comparisons are not supported for type '"+Kt(a.type)+"'.");var o=e.parse(t[2],2,qt);if(!o)return null;if(!Ei(i,o.type))return e.concat(2).error('"'+i+"\" comparisons are not supported for type '"+Kt(o.type)+"'.");if(a.type.kind!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return e.error("Cannot compare types '"+Kt(a.type)+"' and '"+Kt(o.type)+"'.");r&&("value"===a.type.kind&&"value"!==o.type.kind?a=new he(o.type,[a]):"value"!==a.type.kind&&"value"===o.type.kind&&(o=new he(a.type,[o])));var s=null;if(4===t.length){if("string"!==a.type.kind&&"string"!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return e.error("Cannot use collator to compare non-string types.");if(!(s=e.parse(t[3],3,Gt)))return null}return new n(a,o,s)},n.prototype.evaluate=function(n){var a=this.lhs.evaluate(n),o=this.rhs.evaluate(n);if(r&&this.hasUntypedArgument){var s=ae(a),l=ae(o);if(s.kind!==l.kind||"string"!==s.kind&&"number"!==s.kind)throw new le('Expected arguments for "'+t+'" to be (string, string) or (number, number), but found ('+s.kind+", "+l.kind+") instead.")}if(this.collator&&!r&&this.hasUntypedArgument){var u=ae(a),h=ae(o);if("string"!==u.kind||"string"!==h.kind)return e(n,a,o)}return this.collator?i(n,a,o,this.collator.evaluate(n)):e(n,a,o)},n.prototype.eachChild=function(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)},n.prototype.outputDefined=function(){return!0},n.prototype.serialize=function(){var e=[t];return this.eachChild(function(t){e.push(t.serialize())}),e},n}()}Mi.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found only "+(t.length-1)+".");if(t.length%2!=0)return e.error("Expected an odd number of arguments.");var i;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);for(var r=[],n=1;n<t.length-1;n+=2){var a=e.parse(t[n],n,Ut);if(!a)return null;var o=e.parse(t[n+1],n+1,i);if(!o)return null;r.push([a,o]),i=i||o.type}var s=e.parse(t[t.length-1],t.length-1,i);return s?new Mi(i,r,s):null},Mi.prototype.evaluate=function(t){for(var e=0,i=this.branches;e<i.length;e+=1){var r=i[e],n=r[1];if(r[0].evaluate(t))return n.evaluate(t)}return this.otherwise.evaluate(t)},Mi.prototype.eachChild=function(t){for(var e=0,i=this.branches;e<i.length;e+=1){var r=i[e],n=r[1];t(r[0]),t(n)}t(this.otherwise)},Mi.prototype.outputDefined=function(){return this.branches.every(function(t){return t[1].outputDefined()})&&this.otherwise.outputDefined()},Mi.prototype.serialize=function(){var t=["case"];return this.eachChild(function(e){t.push(e.serialize())}),t};var Ii=Ti("==",function(t,e,i){return e===i},ki),Ci=Ti("!=",function(t,e,i){return e!==i},function(t,e,i,r){return!ki(0,e,i,r)}),Ai=Ti("<",function(t,e,i){return e<i},function(t,e,i,r){return r.compare(e,i)<0}),Pi=Ti(">",function(t,e,i){return e>i},function(t,e,i,r){return r.compare(e,i)>0}),Li=Ti("<=",function(t,e,i){return e<=i},function(t,e,i,r){return r.compare(e,i)<=0}),zi=Ti(">=",function(t,e,i){return e>=i},function(t,e,i,r){return r.compare(e,i)>=0}),Di=function(t,e,i,r,n){this.type=Vt,this.number=t,this.locale=e,this.currency=i,this.minFractionDigits=r,this.maxFractionDigits=n};Di.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var i=e.parse(t[1],1,Ft);if(!i)return null;var r=t[2];if("object"!=typeof r||Array.isArray(r))return e.error("NumberFormat options argument must be an object.");var n=null;if(r.locale&&!(n=e.parse(r.locale,1,Vt)))return null;var a=null;if(r.currency&&!(a=e.parse(r.currency,1,Vt)))return null;var o=null;if(r["min-fraction-digits"]&&!(o=e.parse(r["min-fraction-digits"],1,Ft)))return null;var s=null;return r["max-fraction-digits"]&&!(s=e.parse(r["max-fraction-digits"],1,Ft))?null:new Di(i,n,a,o,s)},Di.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))},Di.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)},Di.prototype.outputDefined=function(){return!1},Di.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 Ri=function(t){this.type=Ft,this.input=t};Ri.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var i=e.parse(t[1],1);return i?"array"!==i.type.kind&&"string"!==i.type.kind&&"value"!==i.type.kind?e.error("Expected argument of type string or array, but found "+Kt(i.type)+" instead."):new Ri(i):null},Ri.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 le("Expected value to be of type string or array, but found "+Kt(ae(e))+" instead.")},Ri.prototype.eachChild=function(t){t(this.input)},Ri.prototype.outputDefined=function(){return!1},Ri.prototype.serialize=function(){var t=["length"];return this.eachChild(function(e){t.push(e.serialize())}),t};var Oi={"==":Ii,"!=":Ci,">":Pi,"<":Ai,">=":zi,"<=":Li,array:he,at:bi,boolean:he,case:Mi,coalesce:_i,collator:ge,format:ce,image:pe,in:wi,interpolate:vi,"interpolate-hcl":vi,"interpolate-lab":vi,length:Ri,let:xi,literal:se,match:Si,number:he,"number-format":Di,object:he,step:ii,string:he,"to-boolean":de,"to-color":de,"to-number":de,"to-string":de,var:$e,within:He};function Bi(t,e){var i=e[0],r=e[1],n=e[2],a=e[3];i=i.evaluate(t),r=r.evaluate(t),n=n.evaluate(t);var o=a?a.evaluate(t):1,s=re(i,r,n,o);if(s)throw new le(s);return new Qt(i/255*o,r/255*o,n/255*o,o)}function Fi(t,e){return t in e}function Vi(t,e){var i=e[t];return void 0===i?null:i}function Ui(t){return{type:t}}function ji(t){return{result:"success",value:t}}function Ni(t){return{result:"error",value:t}}function qi(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Gi(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function Zi(t){return!!t.expression&&t.expression.interpolated}function Xi(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function Wi(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function Ki(t){return t}function Hi(t,e,i){return void 0!==t?t:void 0!==e?e:void 0!==i?i:void 0}function Ji(t,e,i,r,n){return Hi(typeof i===n?r[i]:void 0,t.default,e.default)}function Yi(t,e,i){if("number"!==Xi(i))return Hi(t.default,e.default);var r=t.stops.length;if(1===r)return t.stops[0][1];if(i<=t.stops[0][0])return t.stops[0][1];if(i>=t.stops[r-1][0])return t.stops[r-1][1];var n=ei(t.stops.map(function(t){return t[0]}),i);return t.stops[n][1]}function Qi(t,e,i){var r=void 0!==t.base?t.base:1;if("number"!==Xi(i))return Hi(t.default,e.default);var n=t.stops.length;if(1===n)return t.stops[0][1];if(i<=t.stops[0][0])return t.stops[0][1];if(i>=t.stops[n-1][0])return t.stops[n-1][1];var a=ei(t.stops.map(function(t){return t[0]}),i),o=function(t,e,i,r){var n=r-i,a=t-i;return 0===n?0:1===e?a/n:(Math.pow(e,a)-1)/(Math.pow(e,n)-1)}(i,r,t.stops[a][0],t.stops[a+1][0]),s=t.stops[a][1],l=t.stops[a+1][1],u=ni[e.type]||Ki;if(t.colorSpace&&"rgb"!==t.colorSpace){var h=mi[t.colorSpace];u=function(t,e){return h.reverse(h.interpolate(h.forward(t),h.forward(e),o))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var i=s.evaluate.apply(void 0,t),r=l.evaluate.apply(void 0,t);if(void 0!==i&&void 0!==r)return u(i,r,o)}}:u(s,l,o)}function $i(t,e,i){return"color"===e.type?i=Qt.parse(i):"formatted"===e.type?i=ee.fromString(i.toString()):"resolvedImage"===e.type?i=ie.fromString(i.toString()):Xi(i)===e.type||"enum"===e.type&&e.values[i]||(i=void 0),Hi(i,t.default,e.default)}ve.register(Oi,{error:[{kind:"error"},[Vt],function(t,e){throw new le(e[0].evaluate(t))}],typeof:[Vt,[qt],function(t,e){return Kt(ae(e[0].evaluate(t)))}],"to-rgba":[Wt(Ft,4),[jt],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[jt,[Ft,Ft,Ft],Bi],rgba:[jt,[Ft,Ft,Ft,Ft],Bi],has:{type:Ut,overloads:[[[Vt],function(t,e){return Fi(e[0].evaluate(t),t.properties())}],[[Vt,Nt],function(t,e){var i=e[1];return Fi(e[0].evaluate(t),i.evaluate(t))}]]},get:{type:qt,overloads:[[[Vt],function(t,e){return Vi(e[0].evaluate(t),t.properties())}],[[Vt,Nt],function(t,e){var i=e[1];return Vi(e[0].evaluate(t),i.evaluate(t))}]]},"feature-state":[qt,[Vt],function(t,e){return Vi(e[0].evaluate(t),t.featureState||{})}],properties:[Nt,[],function(t){return t.properties()}],"geometry-type":[Vt,[],function(t){return t.geometryType()}],id:[qt,[],function(t){return t.id()}],zoom:[Ft,[],function(t){return t.globals.zoom}],"heatmap-density":[Ft,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[Ft,[],function(t){return t.globals.lineProgress||0}],accumulated:[qt,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[Ft,Ui(Ft),function(t,e){for(var i=0,r=0,n=e;r<n.length;r+=1)i+=n[r].evaluate(t);return i}],"*":[Ft,Ui(Ft),function(t,e){for(var i=1,r=0,n=e;r<n.length;r+=1)i*=n[r].evaluate(t);return i}],"-":{type:Ft,overloads:[[[Ft,Ft],function(t,e){var i=e[1];return e[0].evaluate(t)-i.evaluate(t)}],[[Ft],function(t,e){return-e[0].evaluate(t)}]]},"/":[Ft,[Ft,Ft],function(t,e){var i=e[1];return e[0].evaluate(t)/i.evaluate(t)}],"%":[Ft,[Ft,Ft],function(t,e){var i=e[1];return e[0].evaluate(t)%i.evaluate(t)}],ln2:[Ft,[],function(){return Math.LN2}],pi:[Ft,[],function(){return Math.PI}],e:[Ft,[],function(){return Math.E}],"^":[Ft,[Ft,Ft],function(t,e){var i=e[1];return Math.pow(e[0].evaluate(t),i.evaluate(t))}],sqrt:[Ft,[Ft],function(t,e){return Math.sqrt(e[0].evaluate(t))}],log10:[Ft,[Ft],function(t,e){return Math.log(e[0].evaluate(t))/Math.LN10}],ln:[Ft,[Ft],function(t,e){return Math.log(e[0].evaluate(t))}],log2:[Ft,[Ft],function(t,e){return Math.log(e[0].evaluate(t))/Math.LN2}],sin:[Ft,[Ft],function(t,e){return Math.sin(e[0].evaluate(t))}],cos:[Ft,[Ft],function(t,e){return Math.cos(e[0].evaluate(t))}],tan:[Ft,[Ft],function(t,e){return Math.tan(e[0].evaluate(t))}],asin:[Ft,[Ft],function(t,e){return Math.asin(e[0].evaluate(t))}],acos:[Ft,[Ft],function(t,e){return Math.acos(e[0].evaluate(t))}],atan:[Ft,[Ft],function(t,e){return Math.atan(e[0].evaluate(t))}],min:[Ft,Ui(Ft),function(t,e){return Math.min.apply(Math,e.map(function(e){return e.evaluate(t)}))}],max:[Ft,Ui(Ft),function(t,e){return Math.max.apply(Math,e.map(function(e){return e.evaluate(t)}))}],abs:[Ft,[Ft],function(t,e){return Math.abs(e[0].evaluate(t))}],round:[Ft,[Ft],function(t,e){var i=e[0].evaluate(t);return i<0?-Math.round(-i):Math.round(i)}],floor:[Ft,[Ft],function(t,e){return Math.floor(e[0].evaluate(t))}],ceil:[Ft,[Ft],function(t,e){return Math.ceil(e[0].evaluate(t))}],"filter-==":[Ut,[Vt,qt],function(t,e){var i=e[0],r=e[1];return t.properties()[i.value]===r.value}],"filter-id-==":[Ut,[qt],function(t,e){var i=e[0];return t.id()===i.value}],"filter-type-==":[Ut,[Vt],function(t,e){var i=e[0];return t.geometryType()===i.value}],"filter-<":[Ut,[Vt,qt],function(t,e){var i=e[0],r=e[1],n=t.properties()[i.value],a=r.value;return typeof n==typeof a&&n<a}],"filter-id-<":[Ut,[qt],function(t,e){var i=e[0],r=t.id(),n=i.value;return typeof r==typeof n&&r<n}],"filter->":[Ut,[Vt,qt],function(t,e){var i=e[0],r=e[1],n=t.properties()[i.value],a=r.value;return typeof n==typeof a&&n>a}],"filter-id->":[Ut,[qt],function(t,e){var i=e[0],r=t.id(),n=i.value;return typeof r==typeof n&&r>n}],"filter-<=":[Ut,[Vt,qt],function(t,e){var i=e[0],r=e[1],n=t.properties()[i.value],a=r.value;return typeof n==typeof a&&n<=a}],"filter-id-<=":[Ut,[qt],function(t,e){var i=e[0],r=t.id(),n=i.value;return typeof r==typeof n&&r<=n}],"filter->=":[Ut,[Vt,qt],function(t,e){var i=e[0],r=e[1],n=t.properties()[i.value],a=r.value;return typeof n==typeof a&&n>=a}],"filter-id->=":[Ut,[qt],function(t,e){var i=e[0],r=t.id(),n=i.value;return typeof r==typeof n&&r>=n}],"filter-has":[Ut,[qt],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[Ut,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[Ut,[Wt(Vt)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[Ut,[Wt(qt)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[Ut,[Vt,Wt(qt)],function(t,e){var i=e[0];return e[1].value.indexOf(t.properties()[i.value])>=0}],"filter-in-large":[Ut,[Vt,Wt(qt)],function(t,e){var i=e[0],r=e[1];return function(t,e,i,r){for(;i<=r;){var n=i+r>>1;if(e[n]===t)return!0;e[n]>t?r=n-1:i=n+1}return!1}(t.properties()[i.value],r.value,0,r.value.length-1)}],all:{type:Ut,overloads:[[[Ut,Ut],function(t,e){var i=e[1];return e[0].evaluate(t)&&i.evaluate(t)}],[Ui(Ut),function(t,e){for(var i=0,r=e;i<r.length;i+=1)if(!r[i].evaluate(t))return!1;return!0}]]},any:{type:Ut,overloads:[[[Ut,Ut],function(t,e){var i=e[1];return e[0].evaluate(t)||i.evaluate(t)}],[Ui(Ut),function(t,e){for(var i=0,r=e;i<r.length;i+=1)if(r[i].evaluate(t))return!0;return!1}]]},"!":[Ut,[Ut],function(t,e){return!e[0].evaluate(t)}],"is-supported-script":[Ut,[Vt],function(t,e){var i=t.globals&&t.globals.isSupportedScript;return!i||i(e[0].evaluate(t))}],upcase:[Vt,[Vt],function(t,e){return e[0].evaluate(t).toUpperCase()}],downcase:[Vt,[Vt],function(t,e){return e[0].evaluate(t).toLowerCase()}],concat:[Vt,Ui(qt),function(t,e){return e.map(function(e){return oe(e.evaluate(t))}).join("")}],"resolved-locale":[Vt,[Gt],function(t,e){return e[0].evaluate(t).resolvedLocale()}]});var tr=function(t,e){this.expression=t,this._warningHistory={},this._evaluator=new me,this._defaultValue=e?function(t){return"color"===t.type&&Wi(t.default)?new Qt(0,0,0,0):"color"===t.type?Qt.parse(t.default)||null:void 0===t.default?null:t.default}(e):null,this._enumValues=e&&"enum"===e.type?e.values:null};function er(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in Oi}function ir(t,e){var i=new ti(Oi,[],e?function(t){var e={color:jt,string:Vt,number:Ft,enum:Vt,boolean:Ut,formatted:Zt,resolvedImage:Xt};return"array"===t.type?Wt(e[t.value]||qt,t.length):e[t.type]}(e):void 0),r=i.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return r?ji(new tr(r,e)):Ni(i.errors)}tr.prototype.evaluateWithoutErrorHandling=function(t,e,i,r,n,a){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=i,this._evaluator.canonical=r,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)},tr.prototype.evaluate=function(t,e,i,r,n,a){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=i||null,this._evaluator.canonical=r,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=a||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 le("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 rr=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Ye(e.expression)};rr.prototype.evaluateWithoutErrorHandling=function(t,e,i,r,n,a){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,r,n,a)},rr.prototype.evaluate=function(t,e,i,r,n,a){return this._styleExpression.evaluate(t,e,i,r,n,a)};var nr=function(t,e,i,r){this.kind=t,this.zoomStops=i,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Ye(e.expression),this.interpolationType=r};function ar(t,e){if("error"===(t=ir(t,e)).result)return t;var i=t.value.expression,r=Je(i);if(!r&&!qi(e))return Ni([new Rt("","data expressions not supported")]);var n=Qe(i,["zoom"]);if(!n&&!Gi(e))return Ni([new Rt("","zoom expressions not supported")]);var a=function t(e){var i=null;if(e instanceof xi)i=t(e.result);else if(e instanceof _i)for(var r=0,n=e.args;r<n.length&&!(i=t(n[r]));r+=1);else(e instanceof ii||e instanceof vi)&&e.input instanceof ve&&"zoom"===e.input.name&&(i=e);return i instanceof Rt||e.eachChild(function(e){var r=t(e);r instanceof Rt?i=r:!i&&r?i=new Rt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):i&&r&&i!==r&&(i=new Rt("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),i}(i);return a||n?a instanceof Rt?Ni([a]):a instanceof vi&&!Zi(e)?Ni([new Rt("",'"interpolate" expressions cannot be used with this property')]):ji(a?new nr(r?"camera":"composite",t.value,a.labels,a instanceof vi?a.interpolation:void 0):new rr(r?"constant":"source",t.value)):Ni([new Rt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}nr.prototype.evaluateWithoutErrorHandling=function(t,e,i,r,n,a){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,r,n,a)},nr.prototype.evaluate=function(t,e,i,r,n,a){return this._styleExpression.evaluate(t,e,i,r,n,a)},nr.prototype.interpolationFactor=function(t,e,i){return this.interpolationType?vi.interpolationFactor(this.interpolationType,t,e,i):0};var or=function(t,e){this._parameters=t,this._specification=e,Lt(this,function t(e,i){var r,n,a,o="color"===i.type,s=e.stops&&"object"==typeof e.stops[0][0],l=s||!(s||void 0!==e.property),u=e.type||(Zi(i)?"exponential":"interval");if(o&&((e=Lt({},e)).stops&&(e.stops=e.stops.map(function(t){return[t[0],Qt.parse(t[1])]})),e.default=Qt.parse(e.default?e.default:i.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!mi[e.colorSpace])throw new Error("Unknown color space: "+e.colorSpace);if("exponential"===u)r=Qi;else if("interval"===u)r=Yi;else if("categorical"===u){r=Ji,n=Object.create(null);for(var h=0,c=e.stops;h<c.length;h+=1){var p=c[h];n[p[0]]=p[1]}a=typeof e.stops[0][0]}else{if("identity"!==u)throw new Error('Unknown function type "'+u+'"');r=$i}if(s){for(var f={},d=[],y=0;y<e.stops.length;y++){var m=e.stops[y],v=m[0].zoom;void 0===f[v]&&(f[v]={zoom:v,type:e.type,property:e.property,default:e.default,stops:[]},d.push(v)),f[v].stops.push([m[0].value,m[1]])}for(var g=[],_=0,x=d;_<x.length;_+=1){var b=x[_];g.push([f[b].zoom,t(f[b],i)])}var w={name:"linear"};return{kind:"composite",interpolationType:w,interpolationFactor:vi.interpolationFactor.bind(void 0,w),zoomStops:g.map(function(t){return t[0]}),evaluate:function(t,r){var n=t.zoom;return Qi({stops:g,base:e.base},i,n).evaluate(n,r)}}}if(l){var S="exponential"===u?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:S,interpolationFactor:vi.interpolationFactor.bind(void 0,S),zoomStops:e.stops.map(function(t){return t[0]}),evaluate:function(t){return r(e,i,t.zoom,n,a)}}}return{kind:"source",evaluate:function(t,o){var s=o&&o.properties?o.properties[e.property]:void 0;return void 0===s?Hi(e.default,i.default):r(e,i,s,n,a)}}}(this._parameters,this._specification))};function sr(t){var e=t.key,i=t.value,r=t.valueSpec||{},n=t.objectElementValidators||{},a=t.style,o=t.styleSpec,s=[],l=Xi(i);if("object"!==l)return[new At(e,i,"object expected, "+l+" found")];for(var u in i){var h=u.split(".")[0],c=r[h]||r["*"],p=void 0;if(n[h])p=n[h];else if(r[h])p=Lr;else if(n["*"])p=n["*"];else{if(!r["*"]){s.push(new At(e,i[u],'unknown property "'+u+'"'));continue}p=Lr}s=s.concat(p({key:(e?e+".":e)+u,value:i[u],valueSpec:c,style:a,styleSpec:o,object:i,objectKey:u},i))}for(var f in r)n[f]||r[f].required&&void 0===r[f].default&&void 0===i[f]&&s.push(new At(e,i,'missing required property "'+f+'"'));return s}function lr(t){var e=t.value,i=t.valueSpec,r=t.style,n=t.styleSpec,a=t.key,o=t.arrayElementValidator||Lr;if("array"!==Xi(e))return[new At(a,e,"array expected, "+Xi(e)+" found")];if(i.length&&e.length!==i.length)return[new At(a,e,"array length "+i.length+" expected, length "+e.length+" found")];if(i["min-length"]&&e.length<i["min-length"])return[new At(a,e,"array length at least "+i["min-length"]+" expected, length "+e.length+" found")];var s={type:i.value,values:i.values};n.$version<7&&(s.function=i.function),"object"===Xi(i.value)&&(s=i.value);for(var l=[],u=0;u<e.length;u++)l=l.concat(o({array:e,arrayIndex:u,value:e[u],valueSpec:s,style:r,styleSpec:n,key:a+"["+u+"]"}));return l}function ur(t){var e=t.key,i=t.value,r=t.valueSpec,n=Xi(i);return"number"===n&&i!=i&&(n="NaN"),"number"!==n?[new At(e,i,"number expected, "+n+" found")]:"minimum"in r&&i<r.minimum?[new At(e,i,i+" is less than the minimum value "+r.minimum)]:"maximum"in r&&i>r.maximum?[new At(e,i,i+" is greater than the maximum value "+r.maximum)]:[]}function hr(t){var e,i,r,n=t.valueSpec,a=zt(t.value.type),o={},s="categorical"!==a&&void 0===t.value.property,l=!s,u="array"===Xi(t.value.stops)&&"array"===Xi(t.value.stops[0])&&"object"===Xi(t.value.stops[0][0]),h=sr({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===a)return[new At(t.key,t.value,'identity function may not have a "stops" property')];var e=[],i=t.value;return e=e.concat(lr({key:t.key,value:i,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:c})),"array"===Xi(i)&&0===i.length&&e.push(new At(t.key,i,"array must have at least one stop")),e},default:function(t){return Lr({key:t.key,value:t.value,valueSpec:n,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===a&&s&&h.push(new At(t.key,t.value,'missing required property "property"')),"identity"===a||t.value.stops||h.push(new At(t.key,t.value,'missing required property "stops"')),"exponential"===a&&t.valueSpec.expression&&!Zi(t.valueSpec)&&h.push(new At(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!qi(t.valueSpec)?h.push(new At(t.key,t.value,"property functions not supported")):s&&!Gi(t.valueSpec)&&h.push(new At(t.key,t.value,"zoom functions not supported"))),"categorical"!==a&&!u||void 0!==t.value.property||h.push(new At(t.key,t.value,'"property" property is required')),h;function c(t){var e=[],a=t.value,s=t.key;if("array"!==Xi(a))return[new At(s,a,"array expected, "+Xi(a)+" found")];if(2!==a.length)return[new At(s,a,"array length 2 expected, length "+a.length+" found")];if(u){if("object"!==Xi(a[0]))return[new At(s,a,"object expected, "+Xi(a[0])+" found")];if(void 0===a[0].zoom)return[new At(s,a,"object stop key must have zoom")];if(void 0===a[0].value)return[new At(s,a,"object stop key must have value")];if(r&&r>zt(a[0].zoom))return[new At(s,a[0].zoom,"stop zoom values must appear in ascending order")];zt(a[0].zoom)!==r&&(r=zt(a[0].zoom),i=void 0,o={}),e=e.concat(sr({key:s+"[0]",value:a[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:ur,value:p}}))}else e=e.concat(p({key:s+"[0]",value:a[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},a));return er(Dt(a[1]))?e.concat([new At(s+"[1]",a[1],"expressions are not allowed in function stops.")]):e.concat(Lr({key:s+"[1]",value:a[1],valueSpec:n,style:t.style,styleSpec:t.styleSpec}))}function p(t,r){var s=Xi(t.value),l=zt(t.value),u=null!==t.value?t.value:r;if(e){if(s!==e)return[new At(t.key,u,s+" stop domain type must match previous stop domain type "+e)]}else e=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new At(t.key,u,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==a){var h="number expected, "+s+" found";return qi(n)&&void 0===a&&(h+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new At(t.key,u,h)]}return"categorical"!==a||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==a&&"number"===s&&void 0!==i&&l<i?[new At(t.key,u,"stop domain values must appear in ascending order")]:(i=l,"categorical"===a&&l in o?[new At(t.key,u,"stop domain values must be unique")]:(o[l]=!0,[])):[new At(t.key,u,"integer expected, found "+l)]}}function cr(t){var e=("property"===t.expressionContext?ar:ir)(Dt(t.value),t.valueSpec);if("error"===e.result)return e.value.map(function(e){return new At(""+t.key+e.key,t.value,e.message)});var i=e.value.expression||e.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&!i.outputDefined())return[new At(t.key,t.value,'Invalid data expression for "'+t.propertyKey+'". Output values must be contained as literals within the expression.')];if("property"===t.expressionContext&&"layout"===t.propertyType&&!Ye(i))return[new At(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext&&!Ye(i))return[new At(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!Qe(i,["zoom","feature-state"]))return[new At(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!Je(i))return[new At(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function pr(t){var e=t.key,i=t.value,r=t.valueSpec,n=[];return Array.isArray(r.values)?-1===r.values.indexOf(zt(i))&&n.push(new At(e,i,"expected one of ["+r.values.join(", ")+"], "+JSON.stringify(i)+" found")):-1===Object.keys(r.values).indexOf(zt(i))&&n.push(new At(e,i,"expected one of ["+Object.keys(r.values).join(", ")+"], "+JSON.stringify(i)+" found")),n}function fr(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||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,i=t.slice(1);e<i.length;e+=1){var r=i[e];if(!fr(r)&&"boolean"!=typeof r)return!1}return!0;default:return!0}}or.deserialize=function(t){return new or(t._parameters,t._specification)},or.serialize=function(t){return{_parameters:t._parameters,_specification:t._specification}};var dr={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function yr(t){if(null==t)return{filter:function(){return!0},needGeometry:!1};fr(t)||(t=vr(t));var e=ir(t,dr);if("error"===e.result)throw new Error(e.value.map(function(t){return t.key+": "+t.message}).join(", "));return{filter:function(t,i,r){return e.value.evaluate(t,i,{},r)},needGeometry:Array.isArray(t)&&0!==t.length&&"within"===t[0]}}function mr(t,e){return t<e?-1:t>e?1:0}function vr(t){if(!t)return!0;var e,i=t[0];return t.length<=1?"any"!==i:"=="===i?gr(t[1],t[2],"=="):"!="===i?br(gr(t[1],t[2],"==")):"<"===i||">"===i||"<="===i||">="===i?gr(t[1],t[2],i):"any"===i?(e=t.slice(1),["any"].concat(e.map(vr))):"all"===i?["all"].concat(t.slice(1).map(vr)):"none"===i?["all"].concat(t.slice(1).map(vr).map(br)):"in"===i?_r(t[1],t.slice(2)):"!in"===i?br(_r(t[1],t.slice(2))):"has"===i?xr(t[1]):"!has"!==i||br(xr(t[1]))}function gr(t,e,i){switch(t){case"$type":return["filter-type-"+i,e];case"$id":return["filter-id-"+i,e];default:return["filter-"+i,t,e]}}function _r(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(mr)]]:["filter-in-small",t,["literal",e]]}}function xr(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function br(t){return["!",t]}function wr(t){return fr(Dt(t.value))?cr(Lt({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var i=e.value,r=e.key;if("array"!==Xi(i))return[new At(r,i,"array expected, "+Xi(i)+" found")];var n,a=e.styleSpec,o=[];if(i.length<1)return[new At(r,i,"filter array must have at least 1 element")];switch(o=o.concat(pr({key:r+"[0]",value:i[0],valueSpec:a.filter_operator,style:e.style,styleSpec:e.styleSpec})),zt(i[0])){case"<":case"<=":case">":case">=":i.length>=2&&"$type"===zt(i[1])&&o.push(new At(r,i,'"$type" cannot be use with operator "'+i[0]+'"'));case"==":case"!=":3!==i.length&&o.push(new At(r,i,'filter array for operator "'+i[0]+'" must have 3 elements'));case"in":case"!in":i.length>=2&&"string"!==(n=Xi(i[1]))&&o.push(new At(r+"[1]",i[1],"string expected, "+n+" found"));for(var s=2;s<i.length;s++)n=Xi(i[s]),"$type"===zt(i[1])?o=o.concat(pr({key:r+"["+s+"]",value:i[s],valueSpec:a.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"!==n&&"number"!==n&&"boolean"!==n&&o.push(new At(r+"["+s+"]",i[s],"string, number, or boolean expected, "+n+" found"));break;case"any":case"all":case"none":for(var l=1;l<i.length;l++)o=o.concat(t({key:r+"["+l+"]",value:i[l],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":n=Xi(i[1]),2!==i.length?o.push(new At(r,i,'filter array for "'+i[0]+'" operator must have 2 elements')):"string"!==n&&o.push(new At(r+"[1]",i[1],"string expected, "+n+" found"))}return o}(t)}function Sr(t,e){var i=t.key,r=t.style,n=t.styleSpec,a=t.value,o=t.objectKey,s=n[e+"_"+t.layerType];if(!s)return[];var l=o.match(/^(.*)-transition$/);if("paint"===e&&l&&s[l[1]]&&s[l[1]].transition)return Lr({key:i,value:a,valueSpec:n.transition,style:r,styleSpec:n});var u,h=t.valueSpec||s[o];if(!h)return[new At(i,a,'unknown property "'+o+'"')];if("string"===Xi(a)&&qi(h)&&!h.tokens&&(u=/^{([^}]+)}$/.exec(a)))return[new At(i,a,'"'+o+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(u[1])+" }`.")];var c=[];return"symbol"===t.layerType&&("text-field"===o&&r&&!r.glyphs&&c.push(new At(i,a,'use of "text-field" requires a style "glyphs" property')),"text-font"===o&&Wi(Dt(a))&&"identity"===zt(a.type)&&c.push(new At(i,a,'"text-font" does not support identity functions'))),c.concat(Lr({key:t.key,value:a,valueSpec:h,style:r,styleSpec:n,expressionContext:"property",propertyType:e,propertyKey:o}))}function Mr(t){return Sr(t,"paint")}function Er(t){return Sr(t,"layout")}function kr(t){var e=[],i=t.value,r=t.key,n=t.style,a=t.styleSpec;i.type||i.ref||e.push(new At(r,i,'either "type" or "ref" is required'));var o,s=zt(i.type),l=zt(i.ref);if(i.id)for(var u=zt(i.id),h=0;h<t.arrayIndex;h++){var c=n.layers[h];zt(c.id)===u&&e.push(new At(r,i.id,'duplicate layer id "'+i.id+'", previously used at line '+c.id.__line__))}if("ref"in i)["type","source","source-layer","filter","layout"].forEach(function(t){t in i&&e.push(new At(r,i[t],'"'+t+'" is prohibited for ref layers'))}),n.layers.forEach(function(t){zt(t.id)===l&&(o=t)}),o?o.ref?e.push(new At(r,i.ref,"ref cannot reference another ref layer")):s=zt(o.type):e.push(new At(r,i.ref,'ref layer "'+l+'" not found'));else if("background"!==s)if(i.source){var p=n.sources&&n.sources[i.source],f=p&&zt(p.type);p?"vector"===f&&"raster"===s?e.push(new At(r,i.source,'layer "'+i.id+'" requires a raster source')):"raster"===f&&"raster"!==s?e.push(new At(r,i.source,'layer "'+i.id+'" requires a vector source')):"vector"!==f||i["source-layer"]?"raster-dem"===f&&"hillshade"!==s?e.push(new At(r,i.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==s||!i.paint||!i.paint["line-gradient"]||"geojson"===f&&p.lineMetrics||e.push(new At(r,i,'layer "'+i.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):e.push(new At(r,i,'layer "'+i.id+'" must specify a "source-layer"')):e.push(new At(r,i.source,'source "'+i.source+'" not found'))}else e.push(new At(r,i,'missing required property "source"'));return e=e.concat(sr({key:r,value:i,valueSpec:a.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return Lr({key:r+".type",value:i.type,valueSpec:a.layer.type,style:t.style,styleSpec:t.styleSpec,object:i,objectKey:"type"})},filter:wr,layout:function(t){return sr({layer:i,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return Er(Lt({layerType:s},t))}}})},paint:function(t){return sr({layer:i,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return Mr(Lt({layerType:s},t))}}})}}}))}function Tr(t){var e=t.value,i=t.key,r=Xi(e);return"string"!==r?[new At(i,e,"string expected, "+r+" found")]:[]}var Ir={promoteId:function(t){var e=t.key,i=t.value;if("string"===Xi(i))return Tr({key:e,value:i});var r=[];for(var n in i)r.push.apply(r,Tr({key:e+"."+n,value:i[n]}));return r}};function Cr(t){var e=t.value,i=t.key,r=t.styleSpec,n=t.style;if(!e.type)return[new At(i,e,'"type" is required')];var a,o=zt(e.type);switch(o){case"vector":case"raster":case"raster-dem":return sr({key:i,value:e,valueSpec:r["source_"+o.replace("-","_")],style:t.style,styleSpec:r,objectElementValidators:Ir});case"geojson":if(a=sr({key:i,value:e,valueSpec:r.source_geojson,style:n,styleSpec:r,objectElementValidators:Ir}),e.cluster)for(var s in e.clusterProperties){var l=e.clusterProperties[s],u=l[0],h="string"==typeof u?[u,["accumulated"],["get",s]]:u;a.push.apply(a,cr({key:i+"."+s+".map",value:l[1],expressionContext:"cluster-map"})),a.push.apply(a,cr({key:i+"."+s+".reduce",value:h,expressionContext:"cluster-reduce"}))}return a;case"video":return sr({key:i,value:e,valueSpec:r.source_video,style:n,styleSpec:r});case"image":return sr({key:i,value:e,valueSpec:r.source_image,style:n,styleSpec:r});case"image-map":return sr({key:i,value:e,valueSpec:r.source_image_map,style:n,styleSpec:r});case"canvas":return[new At(i,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return pr({key:i+".type",value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image","image-map"]},style:n,styleSpec:r})}}function Ar(t){var e=t.value,i=t.styleSpec,r=i.light,n=t.style,a=[],o=Xi(e);if(void 0===e)return a;if("object"!==o)return a.concat([new At("light",e,"object expected, "+o+" found")]);for(var s in e){var l=s.match(/^(.*)-transition$/);a=a.concat(l&&r[l[1]]&&r[l[1]].transition?Lr({key:s,value:e[s],valueSpec:i.transition,style:n,styleSpec:i}):r[s]?Lr({key:s,value:e[s],valueSpec:r[s],style:n,styleSpec:i}):[new At(s,e[s],'unknown property "'+s+'"')])}return a}var Pr={"*":function(){return[]},array:lr,boolean:function(t){var e=t.value,i=t.key,r=Xi(e);return"boolean"!==r?[new At(i,e,"boolean expected, "+r+" found")]:[]},number:ur,color:function(t){var e=t.key,i=t.value,r=Xi(i);return"string"!==r?[new At(e,i,"color expected, "+r+" found")]:null===Yt(i)?[new At(e,i,'color expected, "'+i+'" found')]:[]},constants:Pt,enum:pr,filter:wr,function:hr,layer:kr,object:sr,source:Cr,light:Ar,string:Tr,formatted:function(t){return 0===Tr(t).length?[]:cr(t)},resolvedImage:function(t){return 0===Tr(t).length?[]:cr(t)}};function Lr(t){var e=t.value,i=t.valueSpec,r=t.styleSpec;return i.expression&&Wi(zt(e))?hr(t):i.expression&&er(Dt(e))?cr(t):i.type&&Pr[i.type]?Pr[i.type](t):sr(Lt({},t,{valueSpec:i.type?r[i.type]:i}))}function zr(t){var e=t.value,i=t.key,r=Tr(t);return r.length||(-1===e.indexOf("{fontstack}")&&r.push(new At(i,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&r.push(new At(i,e,'"glyphs" url must include a "{range}" token'))),r}function Dr(t,e){void 0===e&&(e=Ct);var i=[];return i=i.concat(Lr({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:zr,"*":function(){return[]}}})),t.constants&&(i=i.concat(Pt({key:"constants",value:t.constants,style:t,styleSpec:e}))),Rr(i)}function Rr(t){return[].concat(t).sort(function(t,e){return t.line-e.line})}function Or(t){return function(){for(var e=[],i=arguments.length;i--;)e[i]=arguments[i];return Rr(t.apply(this,e))}}Dr.source=Or(Cr),Dr.light=Or(Ar),Dr.layer=Or(kr),Dr.filter=Or(wr),Dr.paintProperty=Or(Mr),Dr.layoutProperty=Or(Er);var Br=Dr,Fr=Br.light,Vr=Br.paintProperty,Ur=Br.layoutProperty;function jr(t,e){var i=!1;if(e&&e.length)for(var r=0,n=e;r<n.length;r+=1)t.fire(new Tt(new Error(n[r].message))),i=!0;return i}var Nr=qr;function qr(t,e,i){var r=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var n=new Int32Array(this.arrayBuffer);t=n[0],this.d=(e=n[1])+2*(i=n[2]);for(var a=0;a<this.d*this.d;a++){var o=n[3+a],s=n[3+a+1];r.push(o===s?null:n.subarray(o,s))}var l=n[3+r.length+1];this.keys=n.subarray(n[3+r.length],l),this.bboxes=n.subarray(l),this.insert=this._insertReadonly}else{this.d=e+2*i;for(var u=0;u<this.d*this.d;u++)r.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=i,this.scale=e/t,this.uid=0;var h=i/e*t;this.min=-h,this.max=t+h}qr.prototype.insert=function(t,e,i,r,n){this._forEachCell(e,i,r,n,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(i),this.bboxes.push(r),this.bboxes.push(n)},qr.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},qr.prototype._insertCell=function(t,e,i,r,n,a){this.cells[n].push(a)},qr.prototype.query=function(t,e,i,r,n){var a=this.min,o=this.max;if(t<=a&&e<=a&&o<=i&&o<=r&&!n)return Array.prototype.slice.call(this.keys);var s=[];return this._forEachCell(t,e,i,r,this._queryCell,s,{},n),s},qr.prototype._queryCell=function(t,e,i,r,n,a,o,s){var l=this.cells[n];if(null!==l)for(var u=this.keys,h=this.bboxes,c=0;c<l.length;c++){var p=l[c];if(void 0===o[p]){var f=4*p;(s?s(h[f+0],h[f+1],h[f+2],h[f+3]):t<=h[f+2]&&e<=h[f+3]&&i>=h[f+0]&&r>=h[f+1])?(o[p]=!0,a.push(u[p])):o[p]=!1}}},qr.prototype._forEachCell=function(t,e,i,r,n,a,o,s){for(var l=this._convertToCellCoord(t),u=this._convertToCellCoord(e),h=this._convertToCellCoord(i),c=this._convertToCellCoord(r),p=l;p<=h;p++)for(var f=u;f<=c;f++){var d=this.d*f+p;if((!s||s(this._convertFromCellCoord(p),this._convertFromCellCoord(f),this._convertFromCellCoord(p+1),this._convertFromCellCoord(f+1)))&&n.call(this,t,e,i,r,d,a,o,s))return}},qr.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},qr.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},qr.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=3+this.cells.length+1+1,i=0,r=0;r<this.cells.length;r++)i+=this.cells[r].length;var n=new Int32Array(e+i+this.keys.length+this.bboxes.length);n[0]=this.extent,n[1]=this.n,n[2]=this.padding;for(var a=e,o=0;o<t.length;o++){var s=t[o];n[3+o]=a,n.set(s,a),a+=s.length}return n[3+t.length]=a,n.set(this.keys,a),n[3+t.length+1]=a+=this.keys.length,n.set(this.bboxes,a),a+=this.bboxes.length,n.buffer};var Gr=self.ImageData,Zr=self.ImageBitmap,Xr={};function Wr(t,e,i){void 0===i&&(i={}),Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),Xr[t]={klass:e,omit:i.omit||[],shallow:i.shallow||[]}}for(var Kr in Wr("Object",Object),Nr.serialize=function(t,e){var i=t.toArrayBuffer();return e&&e.push(i),{buffer:i}},Nr.deserialize=function(t){return new Nr(t.buffer)},Wr("Grid",Nr),Wr("Color",Qt),Wr("Error",Error),Wr("ResolvedImage",ie),Wr("StylePropertyFunction",or),Wr("StyleExpression",tr,{omit:["_evaluator"]}),Wr("ZoomDependentExpression",nr),Wr("ZoomConstantExpression",rr),Wr("CompoundExpression",ve,{omit:["_evaluate"]}),Oi)Oi[Kr]._classRegistryKey||Wr("Expression_"+Kr,Oi[Kr]);function Hr(t){return t&&"undefined"!=typeof ArrayBuffer&&(t instanceof ArrayBuffer||t.constructor&&"ArrayBuffer"===t.constructor.name)}function Jr(t){return Zr&&t instanceof Zr}function Yr(t,e){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp)return t;if(Hr(t)||Jr(t))return e&&e.push(t),t;if(ArrayBuffer.isView(t)){var i=t;return e&&e.push(i.buffer),i}if(t instanceof Gr)return e&&e.push(t.data.buffer),t;if(Array.isArray(t)){for(var r=[],n=0,a=t;n<a.length;n+=1)r.push(Yr(a[n],e));return r}if("object"==typeof t){var o=t.constructor,s=o._classRegistryKey;if(!s)throw new Error("can't serialize object of unregistered class");var l=o.serialize?o.serialize(t,e):{};if(!o.serialize){for(var u in t)if(t.hasOwnProperty(u)&&!(Xr[s].omit.indexOf(u)>=0)){var h=t[u];l[u]=Xr[s].shallow.indexOf(u)>=0?h:Yr(h,e)}t instanceof Error&&(l.message=t.message)}if(l.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==s&&(l.$name=s),l}throw new Error("can't serialize object of type "+typeof t)}function Qr(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||Hr(t)||Jr(t)||ArrayBuffer.isView(t)||t instanceof Gr)return t;if(Array.isArray(t))return t.map(Qr);if("object"==typeof t){var e=t.$name||"Object",i=Xr[e].klass;if(!i)throw new Error("can't deserialize unregistered class "+e);if(i.deserialize)return i.deserialize(t);for(var r=Object.create(i.prototype),n=0,a=Object.keys(t);n<a.length;n+=1){var o=a[n];if("$name"!==o){var s=t[o];r[o]=Xr[e].shallow.indexOf(o)>=0?s:Qr(s)}}return r}throw new Error("can't deserialize object of type "+typeof t)}var $r=function(){this.first=!0};$r.prototype.update=function(t,e){var i=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=i,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=i,!0):(this.lastFloorZoom>i?(this.lastIntegerZoom=i+1,this.lastIntegerZoomTime=e):this.lastFloorZoom<i&&(this.lastIntegerZoom=i,this.lastIntegerZoomTime=e),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=i,!0))};var tn={"Latin-1 Supplement":function(t){return t>=128&&t<=255},Arabic:function(t){return t>=1536&&t<=1791},"Arabic Supplement":function(t){return t>=1872&&t<=1919},"Arabic Extended-A":function(t){return t>=2208&&t<=2303},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},Khmer:function(t){return t>=6016&&t<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Arabic Presentation Forms-A":function(t){return t>=64336&&t<=65023},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Arabic Presentation Forms-B":function(t){return t>=65136&&t<=65279},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}};function en(t){for(var e=0,i=t;e<i.length;e+=1)if(rn(i[e].charCodeAt(0)))return!0;return!1}function rn(t){return!(746!==t&&747!==t&&(t<4352||!(tn["Bopomofo Extended"](t)||tn.Bopomofo(t)||tn["CJK Compatibility Forms"](t)&&!(t>=65097&&t<=65103)||tn["CJK Compatibility Ideographs"](t)||tn["CJK Compatibility"](t)||tn["CJK Radicals Supplement"](t)||tn["CJK Strokes"](t)||!(!tn["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||tn["CJK Unified Ideographs Extension A"](t)||tn["CJK Unified Ideographs"](t)||tn["Enclosed CJK Letters and Months"](t)||tn["Hangul Compatibility Jamo"](t)||tn["Hangul Jamo Extended-A"](t)||tn["Hangul Jamo Extended-B"](t)||tn["Hangul Jamo"](t)||tn["Hangul Syllables"](t)||tn.Hiragana(t)||tn["Ideographic Description Characters"](t)||tn.Kanbun(t)||tn["Kangxi Radicals"](t)||tn["Katakana Phonetic Extensions"](t)||tn.Katakana(t)&&12540!==t||!(!tn["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)||!(!tn["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||tn["Unified Canadian Aboriginal Syllabics"](t)||tn["Unified Canadian Aboriginal Syllabics Extended"](t)||tn["Vertical Forms"](t)||tn["Yijing Hexagram Symbols"](t)||tn["Yi Syllables"](t)||tn["Yi Radicals"](t))))}function nn(t){return!(rn(t)||function(t){return!!(tn["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||tn["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)||tn["Letterlike Symbols"](t)||tn["Number Forms"](t)||tn["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)||tn["Control Pictures"](t)&&9251!==t||tn["Optical Character Recognition"](t)||tn["Enclosed Alphanumerics"](t)||tn["Geometric Shapes"](t)||tn["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||tn["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||tn["CJK Symbols and Punctuation"](t)||tn.Katakana(t)||tn["Private Use Area"](t)||tn["CJK Compatibility Forms"](t)||tn["Small Form Variants"](t)||tn["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 an(t){return t>=1424&&t<=2303||tn["Arabic Presentation Forms-A"](t)||tn["Arabic Presentation Forms-B"](t)}function on(t,e){return!(!e&&an(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||tn.Khmer(t))}function sn(t){for(var e=0,i=t;e<i.length;e+=1)if(an(i[e].charCodeAt(0)))return!0;return!1}var ln=null,un="unavailable",hn=null,cn=function(t){ln&&ln(t)};function pn(){fn.fire(new kt("pluginStateChange",{pluginStatus:un,pluginURL:hn}))}var fn=new It,dn=function(){return un},yn=function(){if("deferred"!==un||!hn)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");un="loading",pn(),hn&&bt({url:hn},function(t){t?cn(t):(un="loaded",pn())})},mn={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return"loaded"===un||null!=mn.applyArabicShaping},isLoading:function(){return"loading"===un},setState:function(t){un=t.pluginStatus,hn=t.pluginURL},isParsed:function(){return null!=mn.applyArabicShaping&&null!=mn.processBidirectionalText&&null!=mn.processStyledBidirectionalText},getPluginURL:function(){return hn}},vn=function(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new $r,this.transition={})};vn.prototype.isSupportedScript=function(t){return function(t,e){for(var i=0,r=t;i<r.length;i+=1)if(!on(r[i].charCodeAt(0),e))return!1;return!0}(t,mn.isLoaded())},vn.prototype.crossFadingFactor=function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},vn.prototype.getCrossfadeParameters=function(){var t=this.zoom,e=t-Math.floor(t),i=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*i}:{fromScale:.5,toScale:1,t:1-(1-i)*e}};var gn=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(Wi(t))return new or(t,e);if(er(t)){var i=ar(t,e);if("error"===i.result)throw new Error(i.value.map(function(t){return t.key+": "+t.message}).join(", "));return i.value}var r=t;return"string"==typeof t&&"color"===e.type&&(r=Qt.parse(t)),{kind:"constant",evaluate:function(){return r}}}(void 0===e?t.specification.default:e,t.specification)};gn.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},gn.prototype.possiblyEvaluate=function(t,e,i){return this.property.possiblyEvaluate(this,t,e,i)};var _n=function(t){this.property=t,this.value=new gn(t,void 0)};_n.prototype.transitioned=function(t,e){return new bn(this.property,this.value,e,h({},t.transition,this.transition),t.now)},_n.prototype.untransitioned=function(){return new bn(this.property,this.value,null,{},0)};var xn=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};xn.prototype.getValue=function(t){return x(this._values[t].value.value)},xn.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new _n(this._values[t].property)),this._values[t].value=new gn(this._values[t].property,null===e?void 0:x(e))},xn.prototype.getTransition=function(t){return x(this._values[t].transition)},xn.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new _n(this._values[t].property)),this._values[t].transition=x(e)||void 0},xn.prototype.serialize=function(){for(var t={},e=0,i=Object.keys(this._values);e<i.length;e+=1){var r=i[e],n=this.getValue(r);void 0!==n&&(t[r]=n);var a=this.getTransition(r);void 0!==a&&(t[r+"-transition"]=a)}return t},xn.prototype.transitioned=function(t,e){for(var i=new wn(this._properties),r=0,n=Object.keys(this._values);r<n.length;r+=1){var a=n[r];i._values[a]=this._values[a].transitioned(t,e._values[a])}return i},xn.prototype.untransitioned=function(){for(var t=new wn(this._properties),e=0,i=Object.keys(this._values);e<i.length;e+=1){var r=i[e];t._values[r]=this._values[r].untransitioned()}return t};var bn=function(t,e,i,r,n){this.property=t,this.value=e,this.begin=n+r.delay||0,this.end=this.begin+r.duration||0,t.specification.transition&&(r.delay||r.duration)&&(this.prior=i)};bn.prototype.possiblyEvaluate=function(t,e,i){var r=t.now||0,n=this.value.possiblyEvaluate(t,e,i),a=this.prior;if(a){if(r>this.end)return this.prior=null,n;if(this.value.isDataDriven())return this.prior=null,n;if(r<this.begin)return a.possiblyEvaluate(t,e,i);var o=(r-this.begin)/(this.end-this.begin);return this.property.interpolate(a.possiblyEvaluate(t,e,i),n,function(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,i=e*t;return 4*(t<.5?i:3*(t-e)+i-.75)}(o))}return n};var wn=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};wn.prototype.possiblyEvaluate=function(t,e){for(var i=new En(this._properties),r=0,n=Object.keys(this._values);r<n.length;r+=1){var a=n[r];i._values[a]=this._values[a].possiblyEvaluate(t,e)}return i},wn.prototype.hasTransition=function(){for(var t=0,e=Object.keys(this._values);t<e.length;t+=1)if(this._values[e[t]].prior)return!0;return!1};var Sn=function(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)};Sn.prototype.getValue=function(t){return x(this._values[t].value)},Sn.prototype.setValue=function(t,e){this._values[t]=new gn(this._values[t].property,null===e?void 0:x(e))},Sn.prototype.serialize=function(){for(var t={},e=0,i=Object.keys(this._values);e<i.length;e+=1){var r=i[e],n=this.getValue(r);void 0!==n&&(t[r]=n)}return t},Sn.prototype.possiblyEvaluate=function(t,e){for(var i=new En(this._properties),r=0,n=Object.keys(this._values);r<n.length;r+=1){var a=n[r];i._values[a]=this._values[a].possiblyEvaluate(t,e)}return i};var Mn=function(t,e,i){this.property=t,this.value=e,this.parameters=i};Mn.prototype.isConstant=function(){return"constant"===this.value.kind},Mn.prototype.constantOr=function(t){return"constant"===this.value.kind?this.value.value:t},Mn.prototype.evaluate=function(t,e,i,r){return this.property.evaluate(this.value,this.parameters,t,e,i,r)};var En=function(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)};En.prototype.get=function(t){return this._values[t]};var kn=function(t){this.specification=t};kn.prototype.possiblyEvaluate=function(t,e){return t.expression.evaluate(e)},kn.prototype.interpolate=function(t,e,i){var r=ni[this.specification.type];return r?r(t,e,i):t};var Tn=function(t,e){this.specification=t,this.overrides=e};Tn.prototype.possiblyEvaluate=function(t,e,i,r){return new Mn(this,"constant"===t.expression.kind||"camera"===t.expression.kind?{kind:"constant",value:t.expression.evaluate(e,null,{},i,r)}:t.expression,e)},Tn.prototype.interpolate=function(t,e,i){if("constant"!==t.value.kind||"constant"!==e.value.kind)return t;if(void 0===t.value.value||void 0===e.value.value)return new Mn(this,{kind:"constant",value:void 0},t.parameters);var r=ni[this.specification.type];return r?new Mn(this,{kind:"constant",value:r(t.value.value,e.value.value,i)},t.parameters):t},Tn.prototype.evaluate=function(t,e,i,r,n,a){return"constant"===t.kind?t.value:t.evaluate(e,i,r,n,a)};var In=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.possiblyEvaluate=function(t,e,i,r){if(void 0===t.value)return new Mn(this,{kind:"constant",value:void 0},e);if("constant"===t.expression.kind){var n=t.expression.evaluate(e,null,{},i,r),a="resolvedImage"===t.property.specification.type&&"string"!=typeof n?n.name:n,o=this._calculate(a,a,a,e);return new Mn(this,{kind:"constant",value:o},e)}if("camera"===t.expression.kind){var s=this._calculate(t.expression.evaluate({zoom:e.zoom-1}),t.expression.evaluate({zoom:e.zoom}),t.expression.evaluate({zoom:e.zoom+1}),e);return new Mn(this,{kind:"constant",value:s},e)}return new Mn(this,t.expression,e)},e.prototype.evaluate=function(t,e,i,r,n,a){if("source"===t.kind){var o=t.evaluate(e,i,r,n,a);return this._calculate(o,o,o,e)}return"composite"===t.kind?this._calculate(t.evaluate({zoom:Math.floor(e.zoom)-1},i,r),t.evaluate({zoom:Math.floor(e.zoom)},i,r),t.evaluate({zoom:Math.floor(e.zoom)+1},i,r),e):t.value},e.prototype._calculate=function(t,e,i,r){return r.zoom>r.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:i,to:e}},e.prototype.interpolate=function(t){return t},e}(Tn),Cn=function(t){this.specification=t};Cn.prototype.possiblyEvaluate=function(t,e,i,r){if(void 0!==t.value){if("constant"===t.expression.kind){var n=t.expression.evaluate(e,null,{},i,r);return this._calculate(n,n,n,e)}return this._calculate(t.expression.evaluate(new vn(Math.floor(e.zoom-1),e)),t.expression.evaluate(new vn(Math.floor(e.zoom),e)),t.expression.evaluate(new vn(Math.floor(e.zoom+1),e)),e)}},Cn.prototype._calculate=function(t,e,i,r){return r.zoom>r.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:i,to:e}},Cn.prototype.interpolate=function(t){return t};var An=function(t){this.specification=t};An.prototype.possiblyEvaluate=function(t,e,i,r){return!!t.expression.evaluate(e,null,{},i,r)},An.prototype.interpolate=function(){return!1};var Pn=function(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],t){var i=t[e];i.specification.overridable&&this.overridableProperties.push(e);var r=this.defaultPropertyValues[e]=new gn(i,void 0),n=this.defaultTransitionablePropertyValues[e]=new _n(i);this.defaultTransitioningPropertyValues[e]=n.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=r.possiblyEvaluate({})}};Wr("DataDrivenProperty",Tn),Wr("DataConstantProperty",kn),Wr("CrossFadedDataDrivenProperty",In),Wr("CrossFadedProperty",Cn),Wr("ColorRampProperty",An);var Ln=function(t){function e(e,i){if(t.call(this),this.id=e.id,this.type=e.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},"custom"!==e.type&&(this.metadata=(e=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),i.layout&&(this._unevaluatedLayout=new Sn(i.layout)),i.paint)){for(var r in this._transitionablePaint=new xn(i.paint),e.paint)this.setPaintProperty(r,e.paint[r],{validate:!1});for(var n in e.layout)this.setLayoutProperty(n,e.layout[n],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned()}}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i){void 0===i&&(i={}),null!=e&&this._validate(Ur,"layers."+this.id+".layout."+t,t,e,i)||("visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e)},e.prototype.getPaintProperty=function(t){return v(t,"-transition")?this._transitionablePaint.getTransition(t.slice(0,-"-transition".length)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,i){if(void 0===i&&(i={}),null!=e&&this._validate(Vr,"layers."+this.id+".paint."+t,t,e,i))return!1;if(v(t,"-transition"))return this._transitionablePaint.setTransition(t.slice(0,-"-transition".length),e||void 0),!1;var r=this._transitionablePaint._values[t],n="cross-faded-data-driven"===r.property.specification["property-type"],a=r.value.isDataDriven(),o=r.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var s=this._transitionablePaint._values[t].value;return s.isDataDriven()||a||n||this._handleOverridablePaintPropertyUpdate(t,o,s)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype._handleOverridablePaintPropertyUpdate=function(t,e,i){return!1},e.prototype.isHidden=function(t){return!!(this.minzoom&&t<this.minzoom)||!!(this.maxzoom&&t>=this.maxzoom)||"none"===this.visibility},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,e)},e.prototype.serialize=function(){var t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),_(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,i,r,n){return void 0===n&&(n={}),(!n||!1!==n.validate)&&jr(this,t.call(Br,{key:e,layerType:this.type,objectKey:i,value:r,styleSpec:Ct,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 Mn&&qi(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1},e}(It),zn={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Dn=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},Rn=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function On(t,e){void 0===e&&(e=1);var i=0,r=0;return{members:t.map(function(t){var n=zn[t.type].BYTES_PER_ELEMENT,a=i=Bn(i,Math.max(e,n)),o=t.components||1;return r=Math.max(r,n),i+=n*o,{name:t.name,type:t.type,components:o,offset:a}}),size:Bn(i,Math.max(r,e)),alignment:e}}function Bn(t,e){return Math.ceil(t/e)*e}Rn.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},Rn.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},Rn.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Rn.prototype.clear=function(){this.length=0},Rn.prototype.resize=function(t){this.reserve(t),this.length=t},Rn.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)}},Rn.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var Fn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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 i=this.length;return this.resize(i+1),this.emplace(i,t,e)},e.prototype.emplace=function(t,e,i){var r=2*t;return this.int16[r+0]=e,this.int16[r+1]=i,t},e}(Rn);Fn.prototype.bytesPerElement=4,Wr("StructArrayLayout2i4",Fn);var Vn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,i,r)},e.prototype.emplace=function(t,e,i,r,n){var a=4*t;return this.int16[a+0]=e,this.int16[a+1]=i,this.int16[a+2]=r,this.int16[a+3]=n,t},e}(Rn);Vn.prototype.bytesPerElement=8,Wr("StructArrayLayout4i8",Vn);var Un=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i,r,n,a){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,i,r,n,a)},e.prototype.emplace=function(t,e,i,r,n,a,o){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=i,this.int16[s+2]=r,this.int16[s+3]=n,this.int16[s+4]=a,this.int16[s+5]=o,t},e}(Rn);Un.prototype.bytesPerElement=12,Wr("StructArrayLayout2i4i12",Un);var jn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i,r,n,a){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,i,r,n,a)},e.prototype.emplace=function(t,e,i,r,n,a,o){var s=4*t,l=8*t;return this.int16[s+0]=e,this.int16[s+1]=i,this.uint8[l+4]=r,this.uint8[l+5]=n,this.uint8[l+6]=a,this.uint8[l+7]=o,t},e}(Rn);jn.prototype.bytesPerElement=8,Wr("StructArrayLayout2i4ub8",jn);var Nn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i,r,n,a,o,s,l,u){var h=this.length;return this.resize(h+1),this.emplace(h,t,e,i,r,n,a,o,s,l,u)},e.prototype.emplace=function(t,e,i,r,n,a,o,s,l,u,h){var c=9*t,p=18*t;return this.uint16[c+0]=e,this.uint16[c+1]=i,this.uint16[c+2]=r,this.uint16[c+3]=n,this.uint16[c+4]=a,this.uint16[c+5]=o,this.uint16[c+6]=s,this.uint16[c+7]=l,this.uint8[p+16]=u,this.uint8[p+17]=h,t},e}(Rn);Nn.prototype.bytesPerElement=18,Wr("StructArrayLayout8ui2ub18",Nn);var qn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i,r,n,a,o,s,l,u,h,c){var p=this.length;return this.resize(p+1),this.emplace(p,t,e,i,r,n,a,o,s,l,u,h,c)},e.prototype.emplace=function(t,e,i,r,n,a,o,s,l,u,h,c,p){var f=12*t;return this.int16[f+0]=e,this.int16[f+1]=i,this.int16[f+2]=r,this.int16[f+3]=n,this.uint16[f+4]=a,this.uint16[f+5]=o,this.uint16[f+6]=s,this.uint16[f+7]=l,this.int16[f+8]=u,this.int16[f+9]=h,this.int16[f+10]=c,this.int16[f+11]=p,t},e}(Rn);qn.prototype.bytesPerElement=24,Wr("StructArrayLayout4i4ui4i24",qn);var Gn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i){var r=this.length;return this.resize(r+1),this.emplace(r,t,e,i)},e.prototype.emplace=function(t,e,i,r){var n=3*t;return this.float32[n+0]=e,this.float32[n+1]=i,this.float32[n+2]=r,t},e}(Rn);Gn.prototype.bytesPerElement=12,Wr("StructArrayLayout3f12",Gn);var Zn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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){return this.uint32[1*t+0]=e,t},e}(Rn);Zn.prototype.bytesPerElement=4,Wr("StructArrayLayout1ul4",Zn);var Xn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i,r,n,a,o,s,l,u,h){var c=this.length;return this.resize(c+1),this.emplace(c,t,e,i,r,n,a,o,s,l,u,h)},e.prototype.emplace=function(t,e,i,r,n,a,o,s,l,u,h,c){var p=12*t,f=6*t;return this.int16[p+0]=e,this.int16[p+1]=i,this.int16[p+2]=r,this.int16[p+3]=n,this.int16[p+4]=a,this.int16[p+5]=o,this.uint32[f+3]=s,this.uint16[p+8]=l,this.uint16[p+9]=u,this.int16[p+10]=h,this.int16[p+11]=c,t},e}(Rn);Xn.prototype.bytesPerElement=24,Wr("StructArrayLayout6i1ul2ui2i24",Xn);var Wn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i,r,n,a){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,i,r,n,a)},e.prototype.emplace=function(t,e,i,r,n,a,o){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=i,this.int16[s+2]=r,this.int16[s+3]=n,this.int16[s+4]=a,this.int16[s+5]=o,t},e}(Rn);Wn.prototype.bytesPerElement=12,Wr("StructArrayLayout2i2i2i12",Wn);var Kn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,i,r)},e.prototype.emplace=function(t,e,i,r,n){var a=12*t,o=3*t;return this.uint8[a+0]=e,this.uint8[a+1]=i,this.float32[o+1]=r,this.float32[o+2]=n,t},e}(Rn);Kn.prototype.bytesPerElement=12,Wr("StructArrayLayout2ub2f12",Kn);var Hn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i,r,n,a,o,s,l,u,h,c,p,f,d,y,m){var v=this.length;return this.resize(v+1),this.emplace(v,t,e,i,r,n,a,o,s,l,u,h,c,p,f,d,y,m)},e.prototype.emplace=function(t,e,i,r,n,a,o,s,l,u,h,c,p,f,d,y,m,v){var g=24*t,_=12*t,x=48*t;return this.int16[g+0]=e,this.int16[g+1]=i,this.uint16[g+2]=r,this.uint16[g+3]=n,this.uint32[_+2]=a,this.uint32[_+3]=o,this.uint32[_+4]=s,this.uint16[g+10]=l,this.uint16[g+11]=u,this.uint16[g+12]=h,this.float32[_+7]=c,this.float32[_+8]=p,this.uint8[x+36]=f,this.uint8[x+37]=d,this.uint8[x+38]=y,this.uint32[_+10]=m,this.int16[g+22]=v,t},e}(Rn);Hn.prototype.bytesPerElement=48,Wr("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Hn);var Jn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i,r,n,a,o,s,l,u,h,c,p,f,d,y,m,v,g,_,x,b,w,S,M,E){var k=this.length;return this.resize(k+1),this.emplace(k,t,e,i,r,n,a,o,s,l,u,h,c,p,f,d,y,m,v,g,_,x,b,w,S,M,E)},e.prototype.emplace=function(t,e,i,r,n,a,o,s,l,u,h,c,p,f,d,y,m,v,g,_,x,b,w,S,M,E,k){var T=30*t,I=15*t;return this.int16[T+0]=e,this.int16[T+1]=i,this.int16[T+2]=r,this.int16[T+3]=n,this.int16[T+4]=a,this.int16[T+5]=o,this.int16[T+6]=s,this.int16[T+7]=l,this.uint16[T+8]=u,this.uint16[T+9]=h,this.uint16[T+10]=c,this.uint16[T+11]=p,this.uint16[T+12]=f,this.uint16[T+13]=d,this.uint16[T+14]=y,this.uint16[T+15]=m,this.uint16[T+16]=v,this.uint16[T+17]=g,this.uint16[T+18]=_,this.uint16[T+19]=x,this.uint16[T+20]=b,this.uint16[T+21]=w,this.uint32[I+11]=S,this.float32[I+12]=M,this.float32[I+13]=E,this.float32[I+14]=k,t},e}(Rn);Jn.prototype.bytesPerElement=60,Wr("StructArrayLayout8i14ui1ul3f60",Jn);var Yn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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){return this.float32[1*t+0]=e,t},e}(Rn);Yn.prototype.bytesPerElement=4,Wr("StructArrayLayout1f4",Yn);var Qn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i){var r=this.length;return this.resize(r+1),this.emplace(r,t,e,i)},e.prototype.emplace=function(t,e,i,r){var n=3*t;return this.int16[n+0]=e,this.int16[n+1]=i,this.int16[n+2]=r,t},e}(Rn);Qn.prototype.bytesPerElement=6,Wr("StructArrayLayout3i6",Qn);var $n=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i){var r=this.length;return this.resize(r+1),this.emplace(r,t,e,i)},e.prototype.emplace=function(t,e,i,r){var n=4*t;return this.uint32[2*t+0]=e,this.uint16[n+2]=i,this.uint16[n+3]=r,t},e}(Rn);$n.prototype.bytesPerElement=8,Wr("StructArrayLayout1ul2ui8",$n);var ta=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i){var r=this.length;return this.resize(r+1),this.emplace(r,t,e,i)},e.prototype.emplace=function(t,e,i,r){var n=3*t;return this.uint16[n+0]=e,this.uint16[n+1]=i,this.uint16[n+2]=r,t},e}(Rn);ta.prototype.bytesPerElement=6,Wr("StructArrayLayout3ui6",ta);var ea=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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 i=this.length;return this.resize(i+1),this.emplace(i,t,e)},e.prototype.emplace=function(t,e,i){var r=2*t;return this.uint16[r+0]=e,this.uint16[r+1]=i,t},e}(Rn);ea.prototype.bytesPerElement=4,Wr("StructArrayLayout2ui4",ea);var ia=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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){return this.uint16[1*t+0]=e,t},e}(Rn);ia.prototype.bytesPerElement=2,Wr("StructArrayLayout1ui2",ia);var ra=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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 i=this.length;return this.resize(i+1),this.emplace(i,t,e)},e.prototype.emplace=function(t,e,i){var r=2*t;return this.float32[r+0]=e,this.float32[r+1]=i,t},e}(Rn);ra.prototype.bytesPerElement=8,Wr("StructArrayLayout2f8",ra);var na=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,i,r)},e.prototype.emplace=function(t,e,i,r,n){var a=4*t;return this.float32[a+0]=e,this.float32[a+1]=i,this.float32[a+2]=r,this.float32[a+3]=n,t},e}(Rn);na.prototype.bytesPerElement=16,Wr("StructArrayLayout4f16",na);var aa=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var i={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 i.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},i.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},i.x1.get=function(){return this._structArray.int16[this._pos2+2]},i.y1.get=function(){return this._structArray.int16[this._pos2+3]},i.x2.get=function(){return this._structArray.int16[this._pos2+4]},i.y2.get=function(){return this._structArray.int16[this._pos2+5]},i.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},i.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},i.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},i.radius.get=function(){return this._structArray.int16[this._pos2+10]},i.signedDistanceFromAnchor.get=function(){return this._structArray.int16[this._pos2+11]},i.anchorPoint.get=function(){return new n(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,i),e}(Dn);aa.prototype.size=24;var oa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new aa(this,t)},e}(Xn);Wr("CollisionBoxArray",oa);var sa=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var i={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 i.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},i.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},i.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},i.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},i.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},i.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},i.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},i.segment.get=function(){return this._structArray.uint16[this._pos2+10]},i.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},i.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},i.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},i.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},i.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},i.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},i.placedOrientation.set=function(t){this._structArray.uint8[this._pos1+37]=t},i.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},i.hidden.set=function(t){this._structArray.uint8[this._pos1+38]=t},i.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},i.crossTileID.set=function(t){this._structArray.uint32[this._pos4+10]=t},i.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(e.prototype,i),e}(Dn);sa.prototype.size=48;var la=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new sa(this,t)},e}(Hn);Wr("PlacedSymbolArray",la);var ua=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var i={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 i.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},i.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},i.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},i.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},i.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},i.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},i.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},i.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},i.key.get=function(){return this._structArray.uint16[this._pos2+8]},i.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},i.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},i.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},i.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},i.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},i.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},i.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},i.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},i.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},i.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},i.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},i.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},i.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},i.crossTileID.get=function(){return this._structArray.uint32[this._pos4+11]},i.crossTileID.set=function(t){this._structArray.uint32[this._pos4+11]=t},i.textBoxScale.get=function(){return this._structArray.float32[this._pos4+12]},i.textOffset0.get=function(){return this._structArray.float32[this._pos4+13]},i.textOffset1.get=function(){return this._structArray.float32[this._pos4+14]},Object.defineProperties(e.prototype,i),e}(Dn);ua.prototype.size=60;var ha=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new ua(this,t)},e}(Jn);Wr("SymbolInstanceArray",ha);var ca=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e}(Yn);Wr("GlyphOffsetArray",ca);var pa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(Qn);Wr("SymbolLineVertexArray",pa);var fa=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var i={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return i.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},i.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},i.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(e.prototype,i),e}(Dn);fa.prototype.size=8;var da=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new fa(this,t)},e}($n);Wr("FeatureIndexArray",da);var ya=On([{name:"a_pos",components:2,type:"Int16"}],4).members,ma=function(t){void 0===t&&(t=[]),this.segments=t};function va(t,e){return 256*(t=l(Math.floor(t),0,255))+l(Math.floor(e),0,255)}ma.prototype.prepareSegment=function(t,e,i,r){var n=this.segments[this.segments.length-1];return t>ma.MAX_VERTEX_ARRAY_LENGTH&&w("Max vertices per segment is "+ma.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!n||n.vertexLength+t>ma.MAX_VERTEX_ARRAY_LENGTH||n.sortKey!==r)&&(n={vertexOffset:e.length,primitiveOffset:i.length,vertexLength:0,primitiveLength:0},void 0!==r&&(n.sortKey=r),this.segments.push(n)),n},ma.prototype.get=function(){return this.segments},ma.prototype.destroy=function(){for(var t=0,e=this.segments;t<e.length;t+=1){var i=e[t];for(var r in i.vaos)i.vaos[r].destroy()}},ma.simpleSegment=function(t,e,i,r){return new ma([{vertexOffset:t,primitiveOffset:e,vertexLength:i,primitiveLength:r,vaos:{},sortKey:0}])},ma.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Wr("SegmentVector",ma);var ga=e(function(t){t.exports=function(t,e){var i,r,n,a,o,s,l,u;for(r=t.length-(i=3&t.length),n=e,o=3432918353,s=461845907,u=0;u<r;)l=255&t.charCodeAt(u)|(255&t.charCodeAt(++u))<<8|(255&t.charCodeAt(++u))<<16|(255&t.charCodeAt(++u))<<24,++u,n=27492+(65535&(a=5*(65535&(n=(n^=l=(65535&(l=(l=(65535&l)*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|n>>>19))+((5*(n>>>16)&65535)<<16)&4294967295))+((58964+(a>>>16)&65535)<<16);switch(l=0,i){case 3:l^=(255&t.charCodeAt(u+2))<<16;case 2:l^=(255&t.charCodeAt(u+1))<<8;case 1:n^=l=(65535&(l=(l=(65535&(l^=255&t.charCodeAt(u)))*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return n^=t.length,n=2246822507*(65535&(n^=n>>>16))+((2246822507*(n>>>16)&65535)<<16)&4294967295,n=3266489909*(65535&(n^=n>>>13))+((3266489909*(n>>>16)&65535)<<16)&4294967295,(n^=n>>>16)>>>0}}),_a=ga,xa=e(function(t){t.exports=function(t,e){for(var i,r=t.length,n=e^r,a=0;r>=4;)i=1540483477*(65535&(i=255&t.charCodeAt(a)|(255&t.charCodeAt(++a))<<8|(255&t.charCodeAt(++a))<<16|(255&t.charCodeAt(++a))<<24))+((1540483477*(i>>>16)&65535)<<16),n=1540483477*(65535&n)+((1540483477*(n>>>16)&65535)<<16)^(i=1540483477*(65535&(i^=i>>>24))+((1540483477*(i>>>16)&65535)<<16)),r-=4,++a;switch(r){case 3:n^=(255&t.charCodeAt(a+2))<<16;case 2:n^=(255&t.charCodeAt(a+1))<<8;case 1:n=1540483477*(65535&(n^=255&t.charCodeAt(a)))+((1540483477*(n>>>16)&65535)<<16)}return n=1540483477*(65535&(n^=n>>>13))+((1540483477*(n>>>16)&65535)<<16),(n^=n>>>15)>>>0}});_a.murmur3=ga,_a.murmur2=xa;var ba=function(){this.ids=[],this.positions=[],this.indexed=!1};ba.prototype.add=function(t,e,i,r){this.ids.push(Sa(t)),this.positions.push(e,i,r)},ba.prototype.getPositions=function(t){for(var e=Sa(t),i=0,r=this.ids.length-1;i<r;){var n=i+r>>1;this.ids[n]>=e?r=n:i=n+1}for(var a=[];this.ids[i]===e;)a.push({index:this.positions[3*i],start:this.positions[3*i+1],end:this.positions[3*i+2]}),i++;return a},ba.serialize=function(t,e){var i=new Float64Array(t.ids),r=new Uint32Array(t.positions);return function t(e,i,r,n){if(!(r>=n)){for(var a=e[r+n>>1],o=r-1,s=n+1;;){do{o++}while(e[o]<a);do{s--}while(e[s]>a);if(o>=s)break;Ma(e,o,s),Ma(i,3*o,3*s),Ma(i,3*o+1,3*s+1),Ma(i,3*o+2,3*s+2)}t(e,i,r,s),t(e,i,s+1,n)}}(i,r,0,i.length-1),e&&e.push(i.buffer,r.buffer),{ids:i,positions:r}},ba.deserialize=function(t){var e=new ba;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e};var wa=Math.pow(2,53)-1;function Sa(t){var e=+t;return!isNaN(e)&&e<=wa?e:_a(String(t))}function Ma(t,e,i){var r=t[e];t[e]=t[i],t[i]=r}Wr("FeaturePositionMap",ba);var Ea=function(t,e){this.gl=t.gl,this.location=e},ka=function(t){function e(e,i){t.call(this,e,i),this.current=0}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1i(this.location,t))},e}(Ea),Ta=function(t){function e(e,i){t.call(this,e,i),this.current=0}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))},e}(Ea),Ia=function(t){function e(e,i){t.call(this,e,i),this.current=[0,0]}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(Ea),Ca=function(t){function e(e,i){t.call(this,e,i),this.current=[0,0,0]}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(Ea),Aa=function(t){function e(e,i){t.call(this,e,i),this.current=[0,0,0,0]}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(Ea),Pa=function(t){function e(e,i){t.call(this,e,i),this.current=Qt.transparent}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(Ea),La=new Float32Array(16),za=function(t){function e(e,i){t.call(this,e,i),this.current=La}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(Ea);function Da(t){return[va(255*t.r,255*t.g),va(255*t.b,255*t.a)]}var Ra=function(t,e,i){this.value=t,this.uniformNames=e.map(function(t){return"u_"+t}),this.type=i};Ra.prototype.setUniform=function(t,e,i){t.set(i.constantOr(this.value))},Ra.prototype.getBinding=function(t,e,i){return"color"===this.type?new Pa(t,e):new Ta(t,e)};var Oa=function(t,e){this.uniformNames=e.map(function(t){return"u_"+t}),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1};Oa.prototype.setConstantPatternPositions=function(t,e){this.pixelRatioFrom=e.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=e.tlbr,this.patternTo=t.tlbr},Oa.prototype.setUniform=function(t,e,i,r){var n="u_pattern_to"===r?this.patternTo:"u_pattern_from"===r?this.patternFrom:"u_pixel_ratio_to"===r?this.pixelRatioTo:"u_pixel_ratio_from"===r?this.pixelRatioFrom:null;n&&t.set(n)},Oa.prototype.getBinding=function(t,e,i){return"u_pattern"===i.substr(0,9)?new Aa(t,e):new Ta(t,e)};var Ba=function(t,e,i,r){this.expression=t,this.type=i,this.maxValue=0,this.paintVertexAttributes=e.map(function(t){return{name:"a_"+t,type:"Float32",components:"color"===i?2:1,offset:0}}),this.paintVertexArray=new r};Ba.prototype.populatePaintArray=function(t,e,i,r,n){var a=this.paintVertexArray.length,o=this.expression.evaluate(new vn(0),e,{},r,[],n);this.paintVertexArray.resize(t),this._setPaintValue(a,t,o)},Ba.prototype.updatePaintArray=function(t,e,i,r){var n=this.expression.evaluate({zoom:0},i,r);this._setPaintValue(t,e,n)},Ba.prototype._setPaintValue=function(t,e,i){if("color"===this.type)for(var r=Da(i),n=t;n<e;n++)this.paintVertexArray.emplace(n,r[0],r[1]);else{for(var a=t;a<e;a++)this.paintVertexArray.emplace(a,i);this.maxValue=Math.max(this.maxValue,Math.abs(i))}},Ba.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Ba.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()};var Fa=function(t,e,i,r,n,a){this.expression=t,this.uniformNames=e.map(function(t){return"u_"+t+"_t"}),this.type=i,this.useIntegerZoom=r,this.zoom=n,this.maxValue=0,this.paintVertexAttributes=e.map(function(t){return{name:"a_"+t,type:"Float32",components:"color"===i?4:2,offset:0}}),this.paintVertexArray=new a};Fa.prototype.populatePaintArray=function(t,e,i,r,n){var a=this.expression.evaluate(new vn(this.zoom),e,{},r,[],n),o=this.expression.evaluate(new vn(this.zoom+1),e,{},r,[],n),s=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(s,t,a,o)},Fa.prototype.updatePaintArray=function(t,e,i,r){var n=this.expression.evaluate({zoom:this.zoom},i,r),a=this.expression.evaluate({zoom:this.zoom+1},i,r);this._setPaintValue(t,e,n,a)},Fa.prototype._setPaintValue=function(t,e,i,r){if("color"===this.type)for(var n=Da(i),a=Da(r),o=t;o<e;o++)this.paintVertexArray.emplace(o,n[0],n[1],a[0],a[1]);else{for(var s=t;s<e;s++)this.paintVertexArray.emplace(s,i,r);this.maxValue=Math.max(this.maxValue,Math.abs(i),Math.abs(r))}},Fa.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Fa.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},Fa.prototype.setUniform=function(t,e){var i=this.useIntegerZoom?Math.floor(e.zoom):e.zoom,r=l(this.expression.interpolationFactor(i,this.zoom,this.zoom+1),0,1);t.set(r)},Fa.prototype.getBinding=function(t,e,i){return new Ta(t,e)};var Va=function(t,e,i,r,n,a,o){this.expression=t,this.type=i,this.useIntegerZoom=r,this.zoom=n,this.layerId=o,this.paintVertexAttributes=e.map(function(t){return{name:"a_"+t,type:"Uint16",components:4,offset:0}}),this.zoomInPaintVertexArray=new a,this.zoomOutPaintVertexArray=new a};Va.prototype.populatePaintArray=function(t,e,i){var r=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(t),this.zoomOutPaintVertexArray.resize(t),this._setPaintValues(r,t,e.patterns&&e.patterns[this.layerId],i)},Va.prototype.updatePaintArray=function(t,e,i,r,n){this._setPaintValues(t,e,i.patterns&&i.patterns[this.layerId],n)},Va.prototype._setPaintValues=function(t,e,i,r){if(r&&i){var n=r[i.min],a=r[i.mid],o=r[i.max];if(n&&a&&o)for(var s=t;s<e;s++)this.zoomInPaintVertexArray.emplace(s,a.tl[0],a.tl[1],a.br[0],a.br[1],n.tl[0],n.tl[1],n.br[0],n.br[1],a.pixelRatio,n.pixelRatio),this.zoomOutPaintVertexArray.emplace(s,a.tl[0],a.tl[1],a.br[0],a.br[1],o.tl[0],o.tl[1],o.br[0],o.br[1],a.pixelRatio,o.pixelRatio)}},Va.prototype.upload=function(t){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Va.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()};var Ua=function(t,e,i,r){this.binders={},this.layoutAttributes=r,this._buffers=[];var n=[];for(var a in t.paint._values)if(i(a)){var o=t.paint.get(a);if(o instanceof Mn&&qi(o.property.specification)){var s=Na(a,t.type),l=o.value,u=o.property.specification.type,h=o.property.useIntegerZoom,c=o.property.specification["property-type"],p="cross-faded"===c||"cross-faded-data-driven"===c;if("constant"===l.kind)this.binders[a]=p?new Oa(l.value,s):new Ra(l.value,s,u),n.push("/u_"+a);else if("source"===l.kind||p){var f=qa(a,u,"source");this.binders[a]=p?new Va(l,s,u,h,e,f,t.id):new Ba(l,s,u,f),n.push("/a_"+a)}else{var d=qa(a,u,"composite");this.binders[a]=new Fa(l,s,u,h,e,d),n.push("/z_"+a)}}}this.cacheKey=n.sort().join("")};Ua.prototype.getMaxValue=function(t){var e=this.binders[t];return e instanceof Ba||e instanceof Fa?e.maxValue:0},Ua.prototype.populatePaintArrays=function(t,e,i,r,n){for(var a in this.binders){var o=this.binders[a];(o instanceof Ba||o instanceof Fa||o instanceof Va)&&o.populatePaintArray(t,e,i,r,n)}},Ua.prototype.setConstantPatternPositions=function(t,e){for(var i in this.binders){var r=this.binders[i];r instanceof Oa&&r.setConstantPatternPositions(t,e)}},Ua.prototype.updatePaintArrays=function(t,e,i,r,n){var a=!1;for(var o in t)for(var s=0,l=e.getPositions(o);s<l.length;s+=1){var u=l[s],h=i.feature(u.index);for(var c in this.binders){var p=this.binders[c];if((p instanceof Ba||p instanceof Fa||p instanceof Va)&&!0===p.expression.isStateDependent){var f=r.paint.get(c);p.expression=f.value,p.updatePaintArray(u.start,u.end,h,t[o],n),a=!0}}}return a},Ua.prototype.defines=function(){var t=[];for(var e in this.binders){var i=this.binders[e];(i instanceof Ra||i instanceof Oa)&&t.push.apply(t,i.uniformNames.map(function(t){return"#define HAS_UNIFORM_"+t}))}return t},Ua.prototype.getPaintVertexBuffers=function(){return this._buffers},Ua.prototype.getUniforms=function(t,e){var i=[];for(var r in this.binders){var n=this.binders[r];if(n instanceof Ra||n instanceof Oa||n instanceof Fa)for(var a=0,o=n.uniformNames;a<o.length;a+=1){var s=o[a];if(e[s]){var l=n.getBinding(t,e[s],s);i.push({name:s,property:r,binding:l})}}}return i},Ua.prototype.setUniforms=function(t,e,i,r){for(var n=0,a=e;n<a.length;n+=1){var o=a[n],s=o.name,l=o.property;this.binders[l].setUniform(o.binding,r,i.get(l),s)}},Ua.prototype.updatePaintBuffers=function(t){for(var e in this._buffers=[],this.binders){var i=this.binders[e];if(t&&i instanceof Va){var r=2===t.fromScale?i.zoomInPaintVertexBuffer:i.zoomOutPaintVertexBuffer;r&&this._buffers.push(r)}else(i instanceof Ba||i instanceof Fa)&&i.paintVertexBuffer&&this._buffers.push(i.paintVertexBuffer)}},Ua.prototype.upload=function(t){for(var e in this.binders){var i=this.binders[e];(i instanceof Ba||i instanceof Fa||i instanceof Va)&&i.upload(t)}this.updatePaintBuffers()},Ua.prototype.destroy=function(){for(var t in this.binders){var e=this.binders[t];(e instanceof Ba||e instanceof Fa||e instanceof Va)&&e.destroy()}};var ja=function(t,e,i,r){void 0===r&&(r=function(){return!0}),this.programConfigurations={};for(var n=0,a=e;n<a.length;n+=1){var o=a[n];this.programConfigurations[o.id]=new Ua(o,i,r,t)}this.needsUpload=!1,this._featureMap=new ba,this._bufferOffset=0};function Na(t,e){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[t]||[t.replace(e+"-","").replace(/-/g,"_")]}function qa(t,e,i){var r={color:{source:ra,composite:na},number:{source:Yn,composite:ra}},n=function(t){return{"line-pattern":{source:Nn,composite:Nn},"fill-pattern":{source:Nn,composite:Nn},"fill-extrusion-pattern":{source:Nn,composite:Nn}}[t]}(t);return n&&n[i]||r[e][i]}ja.prototype.populatePaintArrays=function(t,e,i,r,n,a){for(var o in this.programConfigurations)this.programConfigurations[o].populatePaintArrays(t,e,r,n,a);void 0!==e.id&&this._featureMap.add(e.id,i,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0},ja.prototype.updatePaintArrays=function(t,e,i,r){for(var n=0,a=i;n<a.length;n+=1){var o=a[n];this.needsUpload=this.programConfigurations[o.id].updatePaintArrays(t,this._featureMap,e,o,r)||this.needsUpload}},ja.prototype.get=function(t){return this.programConfigurations[t]},ja.prototype.upload=function(t){if(this.needsUpload){for(var e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}},ja.prototype.destroy=function(){for(var t in this.programConfigurations)this.programConfigurations[t].destroy()},Wr("ConstantBinder",Ra),Wr("CrossFadedConstantBinder",Oa),Wr("SourceExpressionBinder",Ba),Wr("CrossFadedCompositeBinder",Va),Wr("CompositeExpressionBinder",Fa),Wr("ProgramConfiguration",Ua,{omit:["_buffers"]}),Wr("ProgramConfigurationSet",ja);var Ga={min:-1*Math.pow(2,14),max:Math.pow(2,14)-1};function Za(t){for(var e=8192/t.extent,i=t.loadGeometry(),r=0;r<i.length;r++)for(var n=i[r],a=0;a<n.length;a++){var o=n[a];o.x=Math.round(o.x*e),o.y=Math.round(o.y*e),(o.x<Ga.min||o.x>Ga.max||o.y<Ga.min||o.y>Ga.max)&&(w("Geometry exceeds allowed extent, reduce your vector tile buffer size"),o.x=l(o.x,Ga.min,Ga.max),o.y=l(o.y,Ga.min,Ga.max))}return i}function Xa(t,e,i,r,n){t.emplaceBack(2*e+(r+1)/2,2*i+(n+1)/2)}var Wa=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 Fn,this.indexArray=new ta,this.segments=new ma,this.programConfigurations=new ja(ya,t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter(function(t){return t.isStateDependent()}).map(function(t){return t.id})};function Ka(t,e){for(var i=0;i<t.length;i++)if(ro(e,t[i]))return!0;for(var r=0;r<e.length;r++)if(ro(t,e[r]))return!0;return!!Qa(t,e)}function Ha(t,e,i){return!!ro(t,e)||!!to(e,t,i)}function Ja(t,e){if(1===t.length)return io(e,t[0]);for(var i=0;i<e.length;i++)for(var r=e[i],n=0;n<r.length;n++)if(ro(t,r[n]))return!0;for(var a=0;a<t.length;a++)if(io(e,t[a]))return!0;for(var o=0;o<e.length;o++)if(Qa(t,e[o]))return!0;return!1}function Ya(t,e,i){if(t.length>1){if(Qa(t,e))return!0;for(var r=0;r<e.length;r++)if(to(e[r],t,i))return!0}for(var n=0;n<t.length;n++)if(to(t[n],e,i))return!0;return!1}function Qa(t,e){if(0===t.length||0===e.length)return!1;for(var i=0;i<t.length-1;i++)for(var r=t[i],n=t[i+1],a=0;a<e.length-1;a++)if($a(r,n,e[a],e[a+1]))return!0;return!1}function $a(t,e,i,r){return S(t,i,r)!==S(e,i,r)&&S(t,e,i)!==S(t,e,r)}function to(t,e,i){var r=i*i;if(1===e.length)return t.distSqr(e[0])<r;for(var n=1;n<e.length;n++)if(eo(t,e[n-1],e[n])<r)return!0;return!1}function eo(t,e,i){var r=e.distSqr(i);if(0===r)return t.distSqr(e);var n=((t.x-e.x)*(i.x-e.x)+(t.y-e.y)*(i.y-e.y))/r;return t.distSqr(n<0?e:n>1?i:i.sub(e)._mult(n)._add(e))}function io(t,e){for(var i,r,n,a=!1,o=0;o<t.length;o++)for(var s=0,l=(i=t[o]).length-1;s<i.length;l=s++)(r=i[s]).y>e.y!=(n=i[l]).y>e.y&&e.x<(n.x-r.x)*(e.y-r.y)/(n.y-r.y)+r.x&&(a=!a);return a}function ro(t,e){for(var i=!1,r=0,n=t.length-1;r<t.length;n=r++){var a=t[r],o=t[n];a.y>e.y!=o.y>e.y&&e.x<(o.x-a.x)*(e.y-a.y)/(o.y-a.y)+a.x&&(i=!i)}return i}function no(t,e,i){var r=i[0],n=i[2];if(t.x<r.x&&e.x<r.x||t.x>n.x&&e.x>n.x||t.y<r.y&&e.y<r.y||t.y>n.y&&e.y>n.y)return!1;var a=S(t,e,i[0]);return a!==S(t,e,i[1])||a!==S(t,e,i[2])||a!==S(t,e,i[3])}function ao(t,e,i){var r=e.paint.get(t).value;return"constant"===r.kind?r.value:i.programConfigurations.get(e.id).getMaxValue(t)}function oo(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function so(t,e,i,r,a){if(!e[0]&&!e[1])return t;var o=n.convert(e)._mult(a);"viewport"===i&&o._rotate(-r);for(var s=[],l=0;l<t.length;l++)s.push(t[l].sub(o));return s}Wa.prototype.populate=function(t,e,i){var r=this.layers[0],n=[],a=null;"circle"===r.type&&(a=r.layout.get("circle-sort-key"));for(var o=0,s=t;o<s.length;o+=1){var l=s[o],u=l.feature,h=l.id,c=l.index,p=l.sourceLayerIndex,f=this.layers[0]._featureFilter.needGeometry,d={type:u.type,id:h,properties:u.properties,geometry:f?Za(u):[]};if(this.layers[0]._featureFilter.filter(new vn(this.zoom),d,i)){f||(d.geometry=Za(u));var y=a?a.evaluate(d,{},i):void 0;n.push({id:h,properties:u.properties,type:u.type,sourceLayerIndex:p,index:c,geometry:d.geometry,patterns:{},sortKey:y})}}a&&n.sort(function(t,e){return t.sortKey-e.sortKey});for(var m=0,v=n;m<v.length;m+=1){var g=v[m],_=g.geometry,x=g.index,b=g.sourceLayerIndex,w=t[x].feature;this.addFeature(g,_,x,i),e.featureIndex.insert(w,_,x,b,this.index)}},Wa.prototype.update=function(t,e,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,i)},Wa.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Wa.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Wa.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ya),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},Wa.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Wa.prototype.addFeature=function(t,e,i,r){for(var n=0,a=e;n<a.length;n+=1)for(var o=0,s=a[n];o<s.length;o+=1){var l=s[o],u=l.x,h=l.y;if(!(u<0||u>=8192||h<0||h>=8192)){var c=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),p=c.vertexLength;Xa(this.layoutVertexArray,u,h,-1,-1),Xa(this.layoutVertexArray,u,h,1,-1),Xa(this.layoutVertexArray,u,h,1,1),Xa(this.layoutVertexArray,u,h,-1,1),this.indexArray.emplaceBack(p,p+1,p+2),this.indexArray.emplaceBack(p,p+3,p+2),c.vertexLength+=4,c.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,{},r)},Wr("CircleBucket",Wa,{omit:["layers"]});var lo,uo=new Pn({"circle-sort-key":new Tn(Ct.layout_circle["circle-sort-key"])}),ho={paint:new Pn({"circle-radius":new Tn(Ct.paint_circle["circle-radius"]),"circle-color":new Tn(Ct.paint_circle["circle-color"]),"circle-blur":new Tn(Ct.paint_circle["circle-blur"]),"circle-opacity":new Tn(Ct.paint_circle["circle-opacity"]),"circle-translate":new kn(Ct.paint_circle["circle-translate"]),"circle-translate-anchor":new kn(Ct.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new kn(Ct.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new kn(Ct.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Tn(Ct.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Tn(Ct.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Tn(Ct.paint_circle["circle-stroke-opacity"])}),layout:uo},co="undefined"!=typeof Float32Array?Float32Array:Array;function po(t,e,i){var r=e[0],n=e[1],a=e[2],o=e[3];return t[0]=i[0]*r+i[4]*n+i[8]*a+i[12]*o,t[1]=i[1]*r+i[5]*n+i[9]*a+i[13]*o,t[2]=i[2]*r+i[6]*n+i[10]*a+i[14]*o,t[3]=i[3]*r+i[7]*n+i[11]*a+i[15]*o,t}Math.hypot||(Math.hypot=function(){for(var t=arguments,e=0,i=arguments.length;i--;)e+=t[i]*t[i];return Math.sqrt(e)}),lo=new co(3),co!=Float32Array&&(lo[0]=0,lo[1]=0,lo[2]=0),function(){var t=new co(4);co!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0)}();var fo=(function(){var t=new co(2);co!=Float32Array&&(t[0]=0,t[1]=0)}(),function(t){function e(e){t.call(this,e,ho)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new Wa(t)},e.prototype.queryRadius=function(t){var e=t;return ao("circle-radius",this,e)+ao("circle-stroke-width",this,e)+oo(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,i,r,n,a,o,s){for(var l=so(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),a.angle,o),u=this.paint.get("circle-radius").evaluate(e,i)+this.paint.get("circle-stroke-width").evaluate(e,i),h="map"===this.paint.get("circle-pitch-alignment"),c=h?l:function(t,e){return l.map(function(t){return yo(t,e)})}(0,s),p=h?u*o:u,f=0,d=r;f<d.length;f+=1)for(var y=0,m=d[f];y<m.length;y+=1){var v=m[y],g=h?v:yo(v,s),_=p,x=po([],[v.x,v.y,0,1],s);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?_*=x[3]/a.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(_*=a.cameraToCenterDistance/x[3]),Ha(c,g,_))return!0}return!1},e}(Ln));function yo(t,e){var i=po([],[t.x,t.y,0,1],e);return new n(i[0]/i[3],i[1]/i[3])}var mo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(Wa);function vo(t,e,i,r){var n=e.width,a=e.height;if(r){if(r instanceof Uint8ClampedArray)r=new Uint8Array(r.buffer);else if(r.length!==n*a*i)throw new RangeError("mismatched image size")}else r=new Uint8Array(n*a*i);return t.width=n,t.height=a,t.data=r,t}function go(t,e,i){var r=e.width,n=e.height;if(r!==t.width||n!==t.height){var a=vo({},{width:r,height:n},i);_o(t,a,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,r),height:Math.min(t.height,n)},i),t.width=r,t.height=n,t.data=a.data}}function _o(t,e,i,r,n,a){if(0===n.width||0===n.height)return e;if(n.width>t.width||n.height>t.height||i.x>t.width-n.width||i.y>t.height-n.height)throw new RangeError("out of range source coordinates for image copy");if(n.width>e.width||n.height>e.height||r.x>e.width-n.width||r.y>e.height-n.height)throw new RangeError("out of range destination coordinates for image copy");for(var o=t.data,s=e.data,l=0;l<n.height;l++)for(var u=((i.y+l)*t.width+i.x)*a,h=((r.y+l)*e.width+r.x)*a,c=0;c<n.width*a;c++)s[h+c]=o[u+c];return e}Wr("HeatmapBucket",mo,{omit:["layers"]});var xo=function(t,e){vo(this,t,1,e)};xo.prototype.resize=function(t){go(this,t,1)},xo.prototype.clone=function(){return new xo({width:this.width,height:this.height},new Uint8Array(this.data))},xo.copy=function(t,e,i,r,n){_o(t,e,i,r,n,1)};var bo=function(t,e){vo(this,t,4,e)};bo.prototype.resize=function(t){go(this,t,4)},bo.prototype.replace=function(t,e){e?this.data.set(t):this.data=t instanceof Uint8ClampedArray?new Uint8Array(t.buffer):t},bo.prototype.clone=function(){return new bo({width:this.width,height:this.height},new Uint8Array(this.data))},bo.copy=function(t,e,i,r,n){_o(t,e,i,r,n,4)},Wr("AlphaImage",xo),Wr("RGBAImage",bo);var wo={paint:new Pn({"heatmap-radius":new Tn(Ct.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Tn(Ct.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new kn(Ct.paint_heatmap["heatmap-intensity"]),"heatmap-color":new An(Ct.paint_heatmap["heatmap-color"]),"heatmap-opacity":new kn(Ct.paint_heatmap["heatmap-opacity"])})};function So(t,e){for(var i=new Uint8Array(1024),r={},n=0,a=0;n<256;n++,a+=4){r[e]=n/255;var o=t.evaluate(r);i[a+0]=Math.floor(255*o.r/o.a),i[a+1]=Math.floor(255*o.g/o.a),i[a+2]=Math.floor(255*o.b/o.a),i[a+3]=Math.floor(255*o.a)}return new bo({width:256,height:1},i)}var Mo=function(t){function e(e){t.call(this,e,wo),this._updateColorRamp()}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new mo(t)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){"heatmap-color"===t&&this._updateColorRamp()},e.prototype._updateColorRamp=function(){this.colorRamp=So(this._transitionablePaint._values["heatmap-color"].value.expression,"heatmapDensity"),this.colorRampTexture=null},e.prototype.resize=function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return!1},e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility},e}(Ln),Eo={paint:new Pn({"hillshade-illumination-direction":new kn(Ct.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new kn(Ct.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new kn(Ct.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new kn(Ct.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new kn(Ct.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new kn(Ct.paint_hillshade["hillshade-accent-color"])})},ko=function(t){function e(e){t.call(this,e,Eo)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility},e}(Ln),To=On([{name:"a_pos",components:2,type:"Int16"}],4).members,Io=Ao,Co=Ao;function Ao(t,e,i){i=i||2;var r,n,a,o,s,l,u,h=e&&e.length,c=h?e[0]*i:t.length,p=Po(t,0,c,i,!0),f=[];if(!p||p.next===p.prev)return f;if(h&&(p=function(t,e,i,r){var n,a,o,s=[];for(n=0,a=e.length;n<a;n++)(o=Po(t,e[n]*r,n<a-1?e[n+1]*r:t.length,r,!1))===o.next&&(o.steiner=!0),s.push(No(o));for(s.sort(Fo),n=0;n<s.length;n++)i=Vo(s[n],i);return i}(t,e,p,i)),t.length>80*i){r=a=t[0],n=o=t[1];for(var d=i;d<c;d+=i)(s=t[d])<r&&(r=s),(l=t[d+1])<n&&(n=l),s>a&&(a=s),l>o&&(o=l);u=0!==(u=Math.max(a-r,o-n))?32767/u:0}return zo(p,f,i,r,n,u,0),f}function Po(t,e,i,r,n){var a,o;if(n===es(t,e,i,r)>0)for(a=e;a<i;a+=r)o=Qo(a,t[a],t[a+1],o);else for(a=i-r;a>=e;a-=r)o=Qo(a,t[a],t[a+1],o);return o&&Xo(o,o.next)&&($o(o),o=o.next),o}function Lo(t,e){if(!t)return t;e||(e=t);var i,r=t;do{if(i=!1,r.steiner||!Xo(r,r.next)&&0!==Zo(r.prev,r,r.next))r=r.next;else{if($o(r),(r=e=r.prev)===r.next)break;i=!0}}while(i||r!==e);return e}function zo(t,e,i,r,n,a,o){if(t){!o&&a&&function(t,e,i,r){var n=t;do{0===n.z&&(n.z=jo(n.x,n.y,e,i,r)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,function(t){var e,i,r,n,a,o,s,l,u=1;do{for(i=t,t=null,a=null,o=0;i;){for(o++,r=i,s=0,e=0;e<u&&(s++,r=r.nextZ);e++);for(l=u;s>0||l>0&&r;)0!==s&&(0===l||!r||i.z<=r.z)?(n=i,i=i.nextZ,s--):(n=r,r=r.nextZ,l--),a?a.nextZ=n:t=n,n.prevZ=a,a=n;i=r}a.nextZ=null,u*=2}while(o>1)}(n)}(t,r,n,a);for(var s,l,u=t;t.prev!==t.next;)if(s=t.prev,l=t.next,a?Ro(t,r,n,a):Do(t))e.push(s.i/i|0),e.push(t.i/i|0),e.push(l.i/i|0),$o(t),t=l.next,u=l.next;else if((t=l)===u){o?1===o?zo(t=Oo(Lo(t),e,i),e,i,r,n,a,2):2===o&&Bo(t,e,i,r,n,a):zo(Lo(t),e,i,r,n,a,1);break}}}function Do(t){var e=t.prev,i=t,r=t.next;if(Zo(e,i,r)>=0)return!1;for(var n=e.x,a=i.x,o=r.x,s=e.y,l=i.y,u=r.y,h=n<a?n<o?n:o:a<o?a:o,c=s<l?s<u?s:u:l<u?l:u,p=n>a?n>o?n:o:a>o?a:o,f=s>l?s>u?s:u:l>u?l:u,d=r.next;d!==e;){if(d.x>=h&&d.x<=p&&d.y>=c&&d.y<=f&&qo(n,s,a,l,o,u,d.x,d.y)&&Zo(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function Ro(t,e,i,r){var n=t.prev,a=t,o=t.next;if(Zo(n,a,o)>=0)return!1;for(var s=n.x,l=a.x,u=o.x,h=n.y,c=a.y,p=o.y,f=s<l?s<u?s:u:l<u?l:u,d=h<c?h<p?h:p:c<p?c:p,y=s>l?s>u?s:u:l>u?l:u,m=h>c?h>p?h:p:c>p?c:p,v=jo(f,d,e,i,r),g=jo(y,m,e,i,r),_=t.prevZ,x=t.nextZ;_&&_.z>=v&&x&&x.z<=g;){if(_.x>=f&&_.x<=y&&_.y>=d&&_.y<=m&&_!==n&&_!==o&&qo(s,h,l,c,u,p,_.x,_.y)&&Zo(_.prev,_,_.next)>=0)return!1;if(_=_.prevZ,x.x>=f&&x.x<=y&&x.y>=d&&x.y<=m&&x!==n&&x!==o&&qo(s,h,l,c,u,p,x.x,x.y)&&Zo(x.prev,x,x.next)>=0)return!1;x=x.nextZ}for(;_&&_.z>=v;){if(_.x>=f&&_.x<=y&&_.y>=d&&_.y<=m&&_!==n&&_!==o&&qo(s,h,l,c,u,p,_.x,_.y)&&Zo(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;x&&x.z<=g;){if(x.x>=f&&x.x<=y&&x.y>=d&&x.y<=m&&x!==n&&x!==o&&qo(s,h,l,c,u,p,x.x,x.y)&&Zo(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function Oo(t,e,i){var r=t;do{var n=r.prev,a=r.next.next;!Xo(n,a)&&Wo(n,r,r.next,a)&&Jo(n,a)&&Jo(a,n)&&(e.push(n.i/i|0),e.push(r.i/i|0),e.push(a.i/i|0),$o(r),$o(r.next),r=t=a),r=r.next}while(r!==t);return Lo(r)}function Bo(t,e,i,r,n,a){var o=t;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&Go(o,s)){var l=Yo(o,s);return o=Lo(o,o.next),l=Lo(l,l.next),zo(o,e,i,r,n,a,0),void zo(l,e,i,r,n,a,0)}s=s.next}o=o.next}while(o!==t)}function Fo(t,e){return t.x-e.x}function Vo(t,e){var i=function(t,e){var i,r=e,n=t.x,a=t.y,o=-1/0;do{if(a<=r.y&&a>=r.next.y&&r.next.y!==r.y){var s=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=n&&s>o&&(o=s,i=r.x<r.next.x?r:r.next,s===n))return i}r=r.next}while(r!==e);if(!i)return null;var l,u=i,h=i.x,c=i.y,p=1/0;r=i;do{n>=r.x&&r.x>=h&&n!==r.x&&qo(a<c?n:o,a,h,c,a<c?o:n,a,r.x,r.y)&&(l=Math.abs(a-r.y)/(n-r.x),Jo(r,t)&&(l<p||l===p&&(r.x>i.x||r.x===i.x&&Uo(i,r)))&&(i=r,p=l)),r=r.next}while(r!==u);return i}(t,e);if(!i)return e;var r=Yo(i,t);return Lo(r,r.next),Lo(i,i.next)}function Uo(t,e){return Zo(t.prev,t,e.prev)<0&&Zo(e.next,t,t.next)<0}function jo(t,e,i,r,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*n|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*n|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function No(t){var e=t,i=t;do{(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next}while(e!==t);return i}function qo(t,e,i,r,n,a,o,s){return(n-o)*(e-s)>=(t-o)*(a-s)&&(t-o)*(r-s)>=(i-o)*(e-s)&&(i-o)*(a-s)>=(n-o)*(r-s)}function Go(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&Wo(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(Jo(t,e)&&Jo(e,t)&&function(t,e){var i=t,r=!1,n=(t.x+e.x)/2,a=(t.y+e.y)/2;do{i.y>a!=i.next.y>a&&i.next.y!==i.y&&n<(i.next.x-i.x)*(a-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next}while(i!==t);return r}(t,e)&&(Zo(t.prev,t,e.prev)||Zo(t,e.prev,e))||Xo(t,e)&&Zo(t.prev,t,t.next)>0&&Zo(e.prev,e,e.next)>0)}function Zo(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function Xo(t,e){return t.x===e.x&&t.y===e.y}function Wo(t,e,i,r){var n=Ho(Zo(t,e,i)),a=Ho(Zo(t,e,r)),o=Ho(Zo(i,r,t)),s=Ho(Zo(i,r,e));return n!==a&&o!==s||!(0!==n||!Ko(t,i,e))||!(0!==a||!Ko(t,r,e))||!(0!==o||!Ko(i,t,r))||!(0!==s||!Ko(i,e,r))}function Ko(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function Ho(t){return t>0?1:t<0?-1:0}function Jo(t,e){return Zo(t.prev,t,t.next)<0?Zo(t,e,t.next)>=0&&Zo(t,t.prev,e)>=0:Zo(t,e,t.prev)<0||Zo(t,t.next,e)<0}function Yo(t,e){var i=new ts(t.i,t.x,t.y),r=new ts(e.i,e.x,e.y),n=t.next,a=e.prev;return t.next=e,e.prev=t,i.next=n,n.prev=i,r.next=i,i.prev=r,a.next=r,r.prev=a,r}function Qo(t,e,i,r){var n=new ts(t,e,i);return r?(n.next=r.next,n.prev=r,r.next.prev=n,r.next=n):(n.prev=n,n.next=n),n}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 ts(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function es(t,e,i,r){for(var n=0,a=e,o=i-r;a<i;a+=r)n+=(t[o]-t[a])*(t[a+1]+t[o+1]),o=a;return n}function is(t,e,i,r,n){!function t(e,i,r,n,a){for(;n>r;){if(n-r>600){var o=n-r+1,s=i-r+1,l=Math.log(o),u=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*u*(o-u)/o)*(s-o/2<0?-1:1);t(e,i,Math.max(r,Math.floor(i-s*u/o+h)),Math.min(n,Math.floor(i+(o-s)*u/o+h)),a)}var c=e[i],p=r,f=n;for(rs(e,r,i),a(e[n],c)>0&&rs(e,r,n);p<f;){for(rs(e,p,f),p++,f--;a(e[p],c)<0;)p++;for(;a(e[f],c)>0;)f--}0===a(e[r],c)?rs(e,r,f):rs(e,++f,n),f<=i&&(r=f+1),i<=f&&(n=f-1)}}(t,e,i||0,r||t.length-1,n||ns)}function rs(t,e,i){var r=t[e];t[e]=t[i],t[i]=r}function ns(t,e){return t<e?-1:t>e?1:0}function as(t,e){var i=t.length;if(i<=1)return[t];for(var r,n,a=[],o=0;o<i;o++){var s=M(t[o]);0!==s&&(t[o].area=Math.abs(s),void 0===n&&(n=s<0),n===s<0?(r&&a.push(r),r=[t[o]]):r.push(t[o]))}if(r&&a.push(r),e>1)for(var l=0;l<a.length;l++)a[l].length<=e||(is(a[l],e,1,a[l].length-1,os),a[l]=a[l].slice(0,e));return a}function os(t,e){return e.area-t.area}function ss(t,e,i){for(var r=i.patternDependencies,n=!1,a=0,o=e;a<o.length;a+=1){var s=o[a].paint.get(t+"-pattern");s.isConstant()||(n=!0);var l=s.constantOr(null);l&&(n=!0,r[l.to]=!0,r[l.from]=!0)}return n}function ls(t,e,i,r,n){for(var a=n.patternDependencies,o=0,s=e;o<s.length;o+=1){var l=s[o],u=l.paint.get(t+"-pattern").value;if("constant"!==u.kind){var h=u.evaluate({zoom:r-1},i,{},n.availableImages),c=u.evaluate({zoom:r},i,{},n.availableImages),p=u.evaluate({zoom:r+1},i,{},n.availableImages);c=c&&c.name?c.name:c,p=p&&p.name?p.name:p,a[h=h&&h.name?h.name:h]=!0,a[c]=!0,a[p]=!0,i.patterns[l.id]={min:h,mid:c,max:p}}}return i}Ao.deviation=function(t,e,i,r){var n=e&&e.length,a=Math.abs(es(t,0,n?e[0]*i:t.length,i));if(n)for(var o=0,s=e.length;o<s;o++)a-=Math.abs(es(t,e[o]*i,o<s-1?e[o+1]*i:t.length,i));var l=0;for(o=0;o<r.length;o+=3){var u=r[o]*i,h=r[o+1]*i,c=r[o+2]*i;l+=Math.abs((t[u]-t[c])*(t[h+1]-t[u+1])-(t[u]-t[h])*(t[c+1]-t[u+1]))}return 0===a&&0===l?0:Math.abs((l-a)/a)},Ao.flatten=function(t){for(var e=t[0][0].length,i={vertices:[],holes:[],dimensions:e},r=0,n=0;n<t.length;n++){for(var a=0;a<t[n].length;a++)for(var o=0;o<e;o++)i.vertices.push(t[n][a][o]);n>0&&i.holes.push(r+=t[n-1].length)}return i},Io.default=Co;var us=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 Fn,this.indexArray=new ta,this.indexArray2=new ea,this.programConfigurations=new ja(To,t.layers,t.zoom),this.segments=new ma,this.segments2=new ma,this.stateDependentLayerIds=this.layers.filter(function(t){return t.isStateDependent()}).map(function(t){return t.id})};us.prototype.populate=function(t,e,i){this.hasPattern=ss("fill",this.layers,e);for(var r=this.layers[0].layout.get("fill-sort-key"),n=[],a=0,o=t;a<o.length;a+=1){var s=o[a],l=s.feature,u=s.id,h=s.index,c=s.sourceLayerIndex,p=this.layers[0]._featureFilter.needGeometry,f={type:l.type,id:u,properties:l.properties,geometry:p?Za(l):[]};if(this.layers[0]._featureFilter.filter(new vn(this.zoom),f,i)){p||(f.geometry=Za(l));var d=r?r.evaluate(f,{},i,e.availableImages):void 0;n.push({id:u,properties:l.properties,type:l.type,sourceLayerIndex:c,index:h,geometry:f.geometry,patterns:{},sortKey:d})}}r&&n.sort(function(t,e){return t.sortKey-e.sortKey});for(var y=0,m=n;y<m.length;y+=1){var v=m[y],g=v.geometry,_=v.index,x=v.sourceLayerIndex;if(this.hasPattern){var b=ls("fill",this.layers,v,this.zoom,e);this.patternFeatures.push(b)}else this.addFeature(v,g,_,i,{});e.featureIndex.insert(t[_].feature,g,_,x,this.index)}},us.prototype.update=function(t,e,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,i)},us.prototype.addFeatures=function(t,e,i){for(var r=0,n=this.patternFeatures;r<n.length;r+=1){var a=n[r];this.addFeature(a,a.geometry,a.index,e,i)}},us.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},us.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},us.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,To),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0},us.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},us.prototype.addFeature=function(t,e,i,r,n){for(var a=0,o=as(e,500);a<o.length;a+=1){for(var s=o[a],l=0,u=0,h=s;u<h.length;u+=1)l+=h[u].length;for(var c=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray),p=c.vertexLength,f=[],d=[],y=0,m=s;y<m.length;y+=1){var v=m[y];if(0!==v.length){v!==s[0]&&d.push(f.length/2);var g=this.segments2.prepareSegment(v.length,this.layoutVertexArray,this.indexArray2),_=g.vertexLength;this.layoutVertexArray.emplaceBack(v[0].x,v[0].y),this.indexArray2.emplaceBack(_+v.length-1,_),f.push(v[0].x),f.push(v[0].y);for(var x=1;x<v.length;x++)this.layoutVertexArray.emplaceBack(v[x].x,v[x].y),this.indexArray2.emplaceBack(_+x-1,_+x),f.push(v[x].x),f.push(v[x].y);g.vertexLength+=v.length,g.primitiveLength+=v.length}}for(var b=Io(f,d),w=0;w<b.length;w+=3)this.indexArray.emplaceBack(p+b[w],p+b[w+1],p+b[w+2]);c.vertexLength+=l,c.primitiveLength+=b.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,n,r)},Wr("FillBucket",us,{omit:["layers","patternFeatures"]});var hs=new Pn({"fill-sort-key":new Tn(Ct.layout_fill["fill-sort-key"])}),cs={paint:new Pn({"fill-antialias":new kn(Ct.paint_fill["fill-antialias"]),"fill-opacity":new Tn(Ct.paint_fill["fill-opacity"]),"fill-color":new Tn(Ct.paint_fill["fill-color"]),"fill-outline-color":new Tn(Ct.paint_fill["fill-outline-color"]),"fill-translate":new kn(Ct.paint_fill["fill-translate"]),"fill-translate-anchor":new kn(Ct.paint_fill["fill-translate-anchor"]),"fill-pattern":new In(Ct.paint_fill["fill-pattern"])}),layout:hs},ps=function(t){function e(e){t.call(this,e,cs)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.recalculate=function(e,i){t.prototype.recalculate.call(this,e,i);var r=this.paint._values["fill-outline-color"];"constant"===r.value.kind&&void 0===r.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},e.prototype.createBucket=function(t){return new us(t)},e.prototype.queryRadius=function(){return oo(this.paint.get("fill-translate"))},e.prototype.queryIntersectsFeature=function(t,e,i,r,n,a,o){return Ja(so(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),a.angle,o),r)},e.prototype.isTileClipped=function(){return!0},e}(Ln),fs=On([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,ds=ys;function ys(t,e,i,r,n){this.properties={},this.extent=i,this.type=0,this._pbf=t,this._geometry=-1,this._keys=r,this._values=n,t.readFields(ms,this,e)}function ms(t,e,i){1==t?e.id=i.readVarint():2==t?function(t,e){for(var i=t.readVarint()+t.pos;t.pos<i;){var r=e._keys[t.readVarint()],n=e._values[t.readVarint()];e.properties[r]=n}}(i,e):3==t?e.type=i.readVarint():4==t&&(e._geometry=i.pos)}function vs(t){for(var e,i,r=0,n=0,a=t.length,o=a-1;n<a;o=n++)r+=((i=t[o]).x-(e=t[n]).x)*(e.y+i.y);return r}ys.types=["Unknown","Point","LineString","Polygon"],ys.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,i=t.readVarint()+t.pos,r=1,a=0,o=0,s=0,l=[];t.pos<i;){if(a<=0){var u=t.readVarint();r=7&u,a=u>>3}if(a--,1===r||2===r)o+=t.readSVarint(),s+=t.readSVarint(),1===r&&(e&&l.push(e),e=[]),e.push(new n(o,s));else{if(7!==r)throw new Error("unknown command "+r);e&&e.push(e[0].clone())}}return e&&l.push(e),l},ys.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,i=1,r=0,n=0,a=0,o=1/0,s=-1/0,l=1/0,u=-1/0;t.pos<e;){if(r<=0){var h=t.readVarint();i=7&h,r=h>>3}if(r--,1===i||2===i)(n+=t.readSVarint())<o&&(o=n),n>s&&(s=n),(a+=t.readSVarint())<l&&(l=a),a>u&&(u=a);else if(7!==i)throw new Error("unknown command "+i)}return[o,l,s,u]},ys.prototype.toGeoJSON=function(t,e,i,r){console.log("epsg",r),r=r||"EPSG:3857";var n,a,o=this.extent*Math.pow(2,i),s=this.extent*t,l=this.extent*e,u=this.loadGeometry(),h=ys.types[this.type];function c(t){if("EPSG:3857"===r)for(var e=0;e<t.length;e++)t[e]=[360*((i=t[e]).x+s)/o-180,360/Math.PI*Math.atan(Math.exp((180-360*(i.y+l)/o)*Math.PI/180))-90];else if("EPSG:4326"===r)for(e=0;e<t.length;e++){var i;t[e]=[360*((i=t[e]).x+s)/o-180,90-360*(i.y+l)/o]}}switch(this.type){case 1:var p=[];for(n=0;n<u.length;n++)p[n]=u[n][0];c(u=p);break;case 2:for(n=0;n<u.length;n++)c(u[n]);break;case 3:for(u=function(t){var e=t.length;if(e<=1)return[t];for(var i,r,n=[],a=0;a<e;a++){var o=vs(t[a]);0!==o&&(void 0===r&&(r=o<0),r===o<0?(i&&n.push(i),i=[t[a]]):i.push(t[a]))}return i&&n.push(i),n}(u),n=0;n<u.length;n++)for(a=0;a<u[n].length;a++)c(u[n][a])}1===u.length?u=u[0]:h="Multi"+h;var f={type:"Feature",geometry:{type:h,coordinates:u},properties:this.properties};return"id"in this&&(f.id=this.id),f};var gs=_s;function _s(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(xs,this,e),this.length=this._features.length}function xs(t,e,i){15===t?e.version=i.readVarint():1===t?e.name=i.readString():5===t?e.extent=i.readVarint():2===t?e._features.push(i.pos):3===t?e._keys.push(i.readString()):4===t&&e._values.push(function(t){for(var e=null,i=t.readVarint()+t.pos;t.pos<i;){var r=t.readVarint()>>3;e=1===r?t.readString():2===r?t.readFloat():3===r?t.readDouble():4===r?t.readVarint64():5===r?t.readVarint():6===r?t.readSVarint():7===r?t.readBoolean():null}return e}(i))}function bs(t,e,i){if(3===t){var r=new gs(i,i.readVarint()+i.pos);r.length&&(e[r.name]=r)}}_s.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 ds(this._pbf,e,this.extent,this._keys,this._values)};var ws={VectorTile:function(t,e){this.layers=t.readFields(bs,{},e)},VectorTileFeature:ds,VectorTileLayer:gs},Ss=ws.VectorTileFeature.types,Ms=Math.pow(2,13);function Es(t,e,i,r,n,a,o,s){t.emplaceBack(e,i,2*Math.floor(r*Ms)+o,n*Ms*2,a*Ms*2,Math.round(s))}var ks=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 Un,this.indexArray=new ta,this.programConfigurations=new ja(fs,t.layers,t.zoom),this.segments=new ma,this.stateDependentLayerIds=this.layers.filter(function(t){return t.isStateDependent()}).map(function(t){return t.id})};function Ts(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}ks.prototype.populate=function(t,e,i){this.features=[],this.hasPattern=ss("fill-extrusion",this.layers,e);for(var r=0,n=t;r<n.length;r+=1){var a=n[r],o=a.feature,s=a.id,l=a.index,u=a.sourceLayerIndex,h=this.layers[0]._featureFilter.needGeometry,c={type:o.type,id:s,properties:o.properties,geometry:h?Za(o):[]};if(this.layers[0]._featureFilter.filter(new vn(this.zoom),c,i)){var p={id:s,sourceLayerIndex:u,index:l,geometry:h?c.geometry:Za(o),properties:o.properties,type:o.type,patterns:{}};void 0!==o.id&&(p.id=o.id),this.hasPattern?this.features.push(ls("fill-extrusion",this.layers,p,this.zoom,e)):this.addFeature(p,p.geometry,l,i,{}),e.featureIndex.insert(o,p.geometry,l,u,this.index,!0)}}},ks.prototype.addFeatures=function(t,e,i){for(var r=0,n=this.features;r<n.length;r+=1){var a=n[r];this.addFeature(a,a.geometry,a.index,e,i)}},ks.prototype.update=function(t,e,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,i)},ks.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},ks.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},ks.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,fs),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},ks.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},ks.prototype.addFeature=function(t,e,i,r,n){for(var a=0,o=as(e,500);a<o.length;a+=1){for(var s=o[a],l=0,u=0,h=s;u<h.length;u+=1)l+=h[u].length;for(var c=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),p=0,f=s;p<f.length;p+=1){var d=f[p];if(0!==d.length&&!((L=d).every(function(t){return t.x<0})||L.every(function(t){return t.x>8192})||L.every(function(t){return t.y<0})||L.every(function(t){return t.y>8192})))for(var y=0,m=0;m<d.length;m++){var v=d[m];if(m>=1){var g=d[m-1];if(!Ts(v,g)){c.vertexLength+4>ma.MAX_VERTEX_ARRAY_LENGTH&&(c=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var _=v.sub(g)._perp()._unit(),x=g.dist(v);y+x>32768&&(y=0),Es(this.layoutVertexArray,v.x,v.y,_.x,_.y,0,0,y),Es(this.layoutVertexArray,v.x,v.y,_.x,_.y,0,1,y),Es(this.layoutVertexArray,g.x,g.y,_.x,_.y,0,0,y+=x),Es(this.layoutVertexArray,g.x,g.y,_.x,_.y,0,1,y);var b=c.vertexLength;this.indexArray.emplaceBack(b,b+2,b+1),this.indexArray.emplaceBack(b+1,b+2,b+3),c.vertexLength+=4,c.primitiveLength+=2}}}}if(c.vertexLength+l>ma.MAX_VERTEX_ARRAY_LENGTH&&(c=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray)),"Polygon"===Ss[t.type]){for(var w=[],S=[],M=c.vertexLength,E=0,k=s;E<k.length;E+=1){var T=k[E];if(0!==T.length){T!==s[0]&&S.push(w.length/2);for(var I=0;I<T.length;I++){var C=T[I];Es(this.layoutVertexArray,C.x,C.y,0,0,1,1,0),w.push(C.x),w.push(C.y)}}}for(var A=Io(w,S),P=0;P<A.length;P+=3)this.indexArray.emplaceBack(M+A[P],M+A[P+2],M+A[P+1]);c.primitiveLength+=A.length/3,c.vertexLength+=l}}var L;this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,n,r)},Wr("FillExtrusionBucket",ks,{omit:["layers","features"]});var Is={paint:new Pn({"fill-extrusion-opacity":new kn(Ct["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Tn(Ct["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new kn(Ct["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new kn(Ct["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new In(Ct["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Tn(Ct["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Tn(Ct["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new kn(Ct["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})},Cs=function(t){function e(e){t.call(this,e,Is)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new ks(t)},e.prototype.queryRadius=function(){return oo(this.paint.get("fill-extrusion-translate"))},e.prototype.is3D=function(){return!0},e.prototype.queryIntersectsFeature=function(t,e,i,r,a,o,s,l){var u=so(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),o.angle,s),h=this.paint.get("fill-extrusion-height").evaluate(e,i),c=this.paint.get("fill-extrusion-base").evaluate(e,i),p=function(t,e,i,r){for(var a=[],o=0,s=t;o<s.length;o+=1){var l=s[o],u=[l.x,l.y,0,1];po(u,u,e),a.push(new n(u[0]/u[3],u[1]/u[3]))}return a}(u,l),f=function(t,e,i,r){for(var a=[],o=[],s=r[8]*e,l=r[9]*e,u=r[10]*e,h=r[11]*e,c=r[8]*i,p=r[9]*i,f=r[10]*i,d=r[11]*i,y=0,m=t;y<m.length;y+=1){for(var v=[],g=[],_=0,x=m[y];_<x.length;_+=1){var b=x[_],w=b.x,S=b.y,M=r[0]*w+r[4]*S+r[12],E=r[1]*w+r[5]*S+r[13],k=r[2]*w+r[6]*S+r[14],T=r[3]*w+r[7]*S+r[15],I=k+u,C=T+h,A=M+c,P=E+p,L=k+f,z=T+d,D=new n((M+s)/C,(E+l)/C);D.z=I/C,v.push(D);var R=new n(A/z,P/z);R.z=L/z,g.push(R)}a.push(v),o.push(g)}return[a,o]}(r,c,h,l);return function(t,e,i){var r=1/0;Ja(i,e)&&(r=Ps(i,e[0]));for(var n=0;n<e.length;n++)for(var a=e[n],o=t[n],s=0;s<a.length-1;s++){var l=a[s],u=[l,a[s+1],o[s+1],o[s],l];Ka(i,u)&&(r=Math.min(r,Ps(i,u)))}return r!==1/0&&r}(f[0],f[1],p)},e}(Ln);function As(t,e){return t.x*e.x+t.y*e.y}function Ps(t,e){if(1===t.length){for(var i,r=0,n=e[r++];!i||n.equals(i);)if(!(i=e[r++]))return 1/0;for(;r<e.length;r++){var a=e[r],o=t[0],s=i.sub(n),l=a.sub(n),u=o.sub(n),h=As(s,s),c=As(s,l),p=As(l,l),f=As(u,s),d=As(u,l),y=h*p-c*c,m=(p*f-c*d)/y,v=(h*d-c*f)/y,g=n.z*(1-m-v)+i.z*m+a.z*v;if(isFinite(g))return g}return 1/0}for(var _=1/0,x=0,b=e;x<b.length;x+=1)_=Math.min(_,b[x].z);return _}var Ls=On([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,zs=ws.VectorTileFeature.types,Ds=Math.cos(Math.PI/180*37.5),Rs=Math.pow(2,14)/.5,Os=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 jn,this.indexArray=new ta,this.programConfigurations=new ja(Ls,t.layers,t.zoom),this.segments=new ma,this.stateDependentLayerIds=this.layers.filter(function(t){return t.isStateDependent()}).map(function(t){return t.id})};Os.prototype.populate=function(t,e,i){this.hasPattern=ss("line",this.layers,e);for(var r=this.layers[0].layout.get("line-sort-key"),n=[],a=0,o=t;a<o.length;a+=1){var s=o[a],l=s.feature,u=s.id,h=s.index,c=s.sourceLayerIndex,p=this.layers[0]._featureFilter.needGeometry,f={type:l.type,id:u,properties:l.properties,geometry:p?Za(l):[]};if(this.layers[0]._featureFilter.filter(new vn(this.zoom),f,i)){p||(f.geometry=Za(l));var d=r?r.evaluate(f,{},i):void 0;n.push({id:u,properties:l.properties,type:l.type,sourceLayerIndex:c,index:h,geometry:f.geometry,patterns:{},sortKey:d})}}r&&n.sort(function(t,e){return t.sortKey-e.sortKey});for(var y=0,m=n;y<m.length;y+=1){var v=m[y],g=v.geometry,_=v.index,x=v.sourceLayerIndex;if(this.hasPattern){var b=ls("line",this.layers,v,this.zoom,e);this.patternFeatures.push(b)}else this.addFeature(v,g,_,i,{});e.featureIndex.insert(t[_].feature,g,_,x,this.index)}},Os.prototype.update=function(t,e,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,i)},Os.prototype.addFeatures=function(t,e,i){for(var r=0,n=this.patternFeatures;r<n.length;r+=1){var a=n[r];this.addFeature(a,a.geometry,a.index,e,i)}},Os.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Os.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Os.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ls),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},Os.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Os.prototype.addFeature=function(t,e,i,r,n){for(var a=this.layers[0].layout,o=a.get("line-join").evaluate(t,{}),s=a.get("line-cap"),l=a.get("line-miter-limit"),u=a.get("line-round-limit"),h=0,c=e;h<c.length;h+=1)this.addLine(c[h],t,o,s,l,u);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,n,r)},Os.prototype.addLine=function(t,e,i,r,n,a){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,e.properties&&e.properties.hasOwnProperty("mapbox_clip_start")&&e.properties.hasOwnProperty("mapbox_clip_end")){this.clipStart=+e.properties.mapbox_clip_start,this.clipEnd=+e.properties.mapbox_clip_end;for(var o=0;o<t.length-1;o++)this.totalDistance+=t[o].dist(t[o+1]);this.updateScaledDistance()}for(var s="Polygon"===zs[e.type],l=t.length;l>=2&&t[l-1].equals(t[l-2]);)l--;for(var u=0;u<l-1&&t[u].equals(t[u+1]);)u++;if(!(l<(s?3:2))){"bevel"===i&&(n=1.05);var h,c=this.overscaling<=16?122880/(512*this.overscaling):0,p=this.segments.prepareSegment(10*l,this.layoutVertexArray,this.indexArray),f=void 0,d=void 0,y=void 0,m=void 0;this.e1=this.e2=-1,s&&(m=t[u].sub(h=t[l-2])._unit()._perp());for(var v=u;v<l;v++)if(!(d=v===l-1?s?t[u+1]:void 0:t[v+1])||!t[v].equals(d)){m&&(y=m),h&&(f=h),h=t[v],m=d?d.sub(h)._unit()._perp():y;var g=(y=y||m).add(m);0===g.x&&0===g.y||g._unit();var _=y.x*m.x+y.y*m.y,x=g.x*m.x+g.y*m.y,b=0!==x?1/x:1/0,w=2*Math.sqrt(2-2*x),S=x<Ds&&f&&d,M=y.x*m.y-y.y*m.x>0;if(S&&v>u){var E=h.dist(f);if(E>2*c){var k=h.sub(h.sub(f)._mult(c/E)._round());this.updateDistance(f,k),this.addCurrentVertex(k,y,0,0,p),f=k}}var T=f&&d,I=T?i:s?"butt":r;if(T&&"round"===I&&(b<a?I="miter":b<=2&&(I="fakeround")),"miter"===I&&b>n&&(I="bevel"),"bevel"===I&&(b>2&&(I="flipbevel"),b<n&&(I="miter")),f&&this.updateDistance(f,h),"miter"===I)g._mult(b),this.addCurrentVertex(h,g,0,0,p);else if("flipbevel"===I){if(b>100)g=m.mult(-1);else{var C=b*y.add(m).mag()/y.sub(m).mag();g._perp()._mult(C*(M?-1:1))}this.addCurrentVertex(h,g,0,0,p),this.addCurrentVertex(h,g.mult(-1),0,0,p)}else if("bevel"===I||"fakeround"===I){var A=-Math.sqrt(b*b-1),P=M?A:0,L=M?0:A;if(f&&this.addCurrentVertex(h,y,P,L,p),"fakeround"===I)for(var z=Math.round(180*w/Math.PI/20),D=1;D<z;D++){var R=D/z;if(.5!==R){var O=R-.5;R+=R*O*(R-1)*((1.0904+_*(_*(3.55645-1.43519*_)-3.2452))*O*O+(.848013+_*(.215638*_-1.06021)))}var B=m.sub(y)._mult(R)._add(y)._unit()._mult(M?-1:1);this.addHalfVertex(h,B.x,B.y,!1,M,0,p)}d&&this.addCurrentVertex(h,m,-P,-L,p)}else if("butt"===I)this.addCurrentVertex(h,g,0,0,p);else if("square"===I){var F=f?1:-1;this.addCurrentVertex(h,g,F,F,p)}else"round"===I&&(f&&(this.addCurrentVertex(h,y,0,0,p),this.addCurrentVertex(h,y,1,1,p,!0)),d&&(this.addCurrentVertex(h,m,-1,-1,p,!0),this.addCurrentVertex(h,m,0,0,p)));if(S&&v<l-1){var V=h.dist(d);if(V>2*c){var U=h.add(d.sub(h)._mult(c/V)._round());this.updateDistance(h,U),this.addCurrentVertex(U,m,0,0,p),h=U}}}}},Os.prototype.addCurrentVertex=function(t,e,i,r,n,a){void 0===a&&(a=!1);var o=e.y*r-e.x,s=-e.y-e.x*r;this.addHalfVertex(t,e.x+e.y*i,e.y-e.x*i,a,!1,i,n),this.addHalfVertex(t,o,s,a,!0,-r,n),this.distance>Rs/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,i,r,n,a))},Os.prototype.addHalfVertex=function(t,e,i,r,n,a,o){var s=.5*this.scaledDistance;this.layoutVertexArray.emplaceBack((t.x<<1)+(r?1:0),(t.y<<1)+(n?1:0),Math.round(63*e)+128,Math.round(63*i)+128,1+(0===a?0:a<0?-1:1)|(63&s)<<2,s>>6);var l=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,l),o.primitiveLength++),n?this.e2=l:this.e1=l},Os.prototype.updateScaledDistance=function(){this.scaledDistance=this.totalDistance>0?(this.clipStart+(this.clipEnd-this.clipStart)*this.distance/this.totalDistance)*(Rs-1):this.distance},Os.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.updateScaledDistance()},Wr("LineBucket",Os,{omit:["layers","patternFeatures"]});var Bs=new Pn({"line-cap":new kn(Ct.layout_line["line-cap"]),"line-join":new Tn(Ct.layout_line["line-join"]),"line-miter-limit":new kn(Ct.layout_line["line-miter-limit"]),"line-round-limit":new kn(Ct.layout_line["line-round-limit"]),"line-sort-key":new Tn(Ct.layout_line["line-sort-key"])}),Fs={paint:new Pn({"line-opacity":new Tn(Ct.paint_line["line-opacity"]),"line-color":new Tn(Ct.paint_line["line-color"]),"line-translate":new kn(Ct.paint_line["line-translate"]),"line-translate-anchor":new kn(Ct.paint_line["line-translate-anchor"]),"line-width":new Tn(Ct.paint_line["line-width"]),"line-gap-width":new Tn(Ct.paint_line["line-gap-width"]),"line-offset":new Tn(Ct.paint_line["line-offset"]),"line-blur":new Tn(Ct.paint_line["line-blur"]),"line-dasharray":new Cn(Ct.paint_line["line-dasharray"]),"line-pattern":new In(Ct.paint_line["line-pattern"]),"line-gradient":new An(Ct.paint_line["line-gradient"])}),layout:Bs},Vs=new(function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.possiblyEvaluate=function(e,i){return i=new vn(Math.floor(i.zoom),{now:i.now,fadeDuration:i.fadeDuration,zoomHistory:i.zoomHistory,transition:i.transition}),t.prototype.possiblyEvaluate.call(this,e,i)},e.prototype.evaluate=function(e,i,r,n){return i=h({},i,{zoom:Math.floor(i.zoom)}),t.prototype.evaluate.call(this,e,i,r,n)},e}(Tn))(Fs.paint.properties["line-width"].specification);Vs.useIntegerZoom=!0;var Us=function(t){function e(e){t.call(this,e,Fs)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&this._updateGradient()},e.prototype._updateGradient=function(){this.gradient=So(this._transitionablePaint._values["line-gradient"].value.expression,"lineProgress"),this.gradientTexture=null},e.prototype.recalculate=function(e,i){t.prototype.recalculate.call(this,e,i),this.paint._values["line-floorwidth"]=Vs.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new Os(t)},e.prototype.queryRadius=function(t){var e=t,i=js(ao("line-width",this,e),ao("line-gap-width",this,e)),r=ao("line-offset",this,e);return i/2+Math.abs(r)+oo(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,i,r,a,o,s){var l=so(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),o.angle,s),u=s/2*js(this.paint.get("line-width").evaluate(e,i),this.paint.get("line-gap-width").evaluate(e,i)),h=this.paint.get("line-offset").evaluate(e,i);return h&&(r=function(t,e){for(var i=[],r=new n(0,0),a=0;a<t.length;a++){for(var o=t[a],s=[],l=0;l<o.length;l++){var u=o[l],h=o[l+1],c=0===l?r:u.sub(o[l-1])._unit()._perp(),p=l===o.length-1?r:h.sub(u)._unit()._perp(),f=c._add(p)._unit();f._mult(1/(f.x*p.x+f.y*p.y)),s.push(f._mult(e)._add(u))}i.push(s)}return i}(r,h*s)),function(t,e,i){for(var r=0;r<e.length;r++){var n=e[r];if(t.length>=3)for(var a=0;a<n.length;a++)if(ro(t,n[a]))return!0;if(Ya(t,n,i))return!0}return!1}(l,r,u)},e.prototype.isTileClipped=function(){return!0},e}(Ln);function js(t,e){return e>0?e+2*t:t}var Ns=On([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),qs=On([{name:"a_projected_pos",components:3,type:"Float32"}],4),Gs=(On([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),On([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Zs=(On([{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"}]),On([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),Xs=On([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4);function Ws(t,e,i){return t.sections.forEach(function(t){t.text=function(t,e,i){var r=e.layout.get("text-transform").evaluate(i,{});return"uppercase"===r?t=t.toLocaleUpperCase():"lowercase"===r&&(t=t.toLocaleLowerCase()),mn.applyArabicShaping&&(t=mn.applyArabicShaping(t)),t}(t.text,e,i)}),t}On([{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"}]),On([{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"}]),On([{type:"Float32",name:"offsetX"}]),On([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Ks={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},Hs=function(t,e,i,r,n){var a,o,s=8*n-r-1,l=(1<<s)-1,u=l>>1,h=-7,c=i?n-1:0,p=i?-1:1,f=t[e+c];for(c+=p,a=f&(1<<-h)-1,f>>=-h,h+=s;h>0;a=256*a+t[e+c],c+=p,h-=8);for(o=a&(1<<-h)-1,a>>=-h,h+=r;h>0;o=256*o+t[e+c],c+=p,h-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,r),a-=u}return(f?-1:1)*o*Math.pow(2,a-r)},Js=function(t,e,i,r,n,a){var o,s,l,u=8*a-n-1,h=(1<<u)-1,c=h>>1,p=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:a-1,d=r?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=h):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+c>=1?p/l:p*Math.pow(2,1-c))*l>=2&&(o++,l/=2),o+c>=h?(s=0,o=h):o+c>=1?(s=(e*l-1)*Math.pow(2,n),o+=c):(s=e*Math.pow(2,c-1)*Math.pow(2,n),o=0));n>=8;t[i+f]=255&s,f+=d,s/=256,n-=8);for(o=o<<n|s,u+=n;u>0;t[i+f]=255&o,f+=d,o/=256,u-=8);t[i+f-d]|=128*y},Ys=Qs;function Qs(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Qs.Varint=0,Qs.Fixed64=1,Qs.Bytes=2,Qs.Fixed32=5;var $s="undefined"==typeof TextDecoder?null:new TextDecoder("utf-8");function tl(t){return t.type===Qs.Bytes?t.readVarint()+t.pos:t.pos+1}function el(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function il(t,e,i){var r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(r);for(var n=i.pos-1;n>=t;n--)i.buf[n+r]=i.buf[n]}function rl(t,e){for(var i=0;i<t.length;i++)e.writeVarint(t[i])}function nl(t,e){for(var i=0;i<t.length;i++)e.writeSVarint(t[i])}function al(t,e){for(var i=0;i<t.length;i++)e.writeFloat(t[i])}function ol(t,e){for(var i=0;i<t.length;i++)e.writeDouble(t[i])}function sl(t,e){for(var i=0;i<t.length;i++)e.writeBoolean(t[i])}function ll(t,e){for(var i=0;i<t.length;i++)e.writeFixed32(t[i])}function ul(t,e){for(var i=0;i<t.length;i++)e.writeSFixed32(t[i])}function hl(t,e){for(var i=0;i<t.length;i++)e.writeFixed64(t[i])}function cl(t,e){for(var i=0;i<t.length;i++)e.writeSFixed64(t[i])}function pl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function fl(t,e,i){t[i]=e,t[i+1]=e>>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function dl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function yl(t,e,i){1===t&&i.readMessage(ml,e)}function ml(t,e,i){if(3===t){var r=i.readMessage(vl,{}),n=r.width,a=r.height,o=r.left,s=r.top,l=r.advance;e.push({id:r.id,bitmap:new xo({width:n+6,height:a+6},r.bitmap),metrics:{width:n,height:a,left:o,top:s,advance:l}})}}function vl(t,e,i){1===t?e.id=i.readVarint():2===t?e.bitmap=i.readBytes():3===t?e.width=i.readVarint():4===t?e.height=i.readVarint():5===t?e.left=i.readSVarint():6===t?e.top=i.readSVarint():7===t&&(e.advance=i.readVarint())}function gl(t){for(var e=0,i=0,r=0,n=t;r<n.length;r+=1){var a=n[r];e+=a.w*a.h,i=Math.max(i,a.w)}t.sort(function(t,e){return e.h-t.h});for(var o=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),i),h:1/0}],s=0,l=0,u=0,h=t;u<h.length;u+=1)for(var c=h[u],p=o.length-1;p>=0;p--){var f=o[p];if(!(c.w>f.w||c.h>f.h)){if(c.x=f.x,c.y=f.y,l=Math.max(l,c.y+c.h),s=Math.max(s,c.x+c.w),c.w===f.w&&c.h===f.h){var d=o.pop();p<o.length&&(o[p]=d)}else c.h===f.h?(f.x+=c.w,f.w-=c.w):c.w===f.w?(f.y+=c.h,f.h-=c.h):(o.push({x:f.x+c.w,y:f.y,w:f.w-c.w,h:c.h}),f.y+=c.h,f.h-=c.h);break}}return{w:s,h:l,fill:e/(s*l)||0}}Qs.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos<i;){var r=this.readVarint(),n=r>>3,a=this.pos;this.type=7&r,t(n,e,this),this.pos===a&&this.skip(r)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=pl(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=dl(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=pl(this.buf,this.pos)+4294967296*pl(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=pl(this.buf,this.pos)+4294967296*dl(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=Hs(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Hs(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,i,r=this.buf;return e=127&(i=r[this.pos++]),i<128?e:(e|=(127&(i=r[this.pos++]))<<7,i<128?e:(e|=(127&(i=r[this.pos++]))<<14,i<128?e:(e|=(127&(i=r[this.pos++]))<<21,i<128?e:function(t,e,i){var r,n,a=i.buf;if(r=(112&(n=a[i.pos++]))>>4,n<128)return el(t,r,e);if(r|=(127&(n=a[i.pos++]))<<3,n<128)return el(t,r,e);if(r|=(127&(n=a[i.pos++]))<<10,n<128)return el(t,r,e);if(r|=(127&(n=a[i.pos++]))<<17,n<128)return el(t,r,e);if(r|=(127&(n=a[i.pos++]))<<24,n<128)return el(t,r,e);if(r|=(1&(n=a[i.pos++]))<<31,n<128)return el(t,r,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(i=r[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&&$s?function(t,e,i){return $s.decode(t.subarray(e,i))}(this.buf,e,t):function(t,e,i){for(var r="",n=e;n<i;){var a,o,s,l=t[n],u=null,h=l>239?4:l>223?3:l>191?2:1;if(n+h>i)break;1===h?l<128&&(u=l):2===h?128==(192&(a=t[n+1]))&&(u=(31&l)<<6|63&a)<=127&&(u=null):3===h?(o=t[n+2],128==(192&(a=t[n+1]))&&128==(192&o)&&((u=(15&l)<<12|(63&a)<<6|63&o)<=2047||u>=55296&&u<=57343)&&(u=null)):4===h&&(o=t[n+2],s=t[n+3],128==(192&(a=t[n+1]))&&128==(192&o)&&128==(192&s)&&((u=(15&l)<<18|(63&a)<<12|(63&o)<<6|63&s)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,h=1):u>65535&&(u-=65536,r+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),r+=String.fromCharCode(u),n+=h}return r}(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!==Qs.Bytes)return t.push(this.readVarint(e));var i=tl(this);for(t=t||[];this.pos<i;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==Qs.Bytes)return t.push(this.readSVarint());var e=tl(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==Qs.Bytes)return t.push(this.readBoolean());var e=tl(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==Qs.Bytes)return t.push(this.readFloat());var e=tl(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==Qs.Bytes)return t.push(this.readDouble());var e=tl(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==Qs.Bytes)return t.push(this.readFixed32());var e=tl(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==Qs.Bytes)return t.push(this.readSFixed32());var e=tl(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==Qs.Bytes)return t.push(this.readFixed64());var e=tl(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==Qs.Bytes)return t.push(this.readSFixed64());var e=tl(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===Qs.Varint)for(;this.buf[this.pos++]>127;);else if(e===Qs.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Qs.Fixed32)this.pos+=4;else{if(e!==Qs.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var i=new Uint8Array(e);i.set(this.buf),this.buf=i,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),fl(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),fl(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),fl(this.buf,-1&t,this.pos),fl(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),fl(this.buf,-1&t,this.pos),fl(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var i,r;if(t>=0?(i=t%4294967296|0,r=t/4294967296|0):(r=~(-t/4294967296),4294967295^(i=~(-t%4294967296))?i=i+1|0:(i=0,r=r+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,i){i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,i.buf[i.pos]=127&(t>>>=7)}(i,0,e),function(t,e){var i=(7&t)<<4;e.buf[e.pos++]|=i|((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)))))}(r,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,i){for(var r,n,a=0;a<e.length;a++){if((r=e.charCodeAt(a))>55295&&r<57344){if(!n){r>56319||a+1===e.length?(t[i++]=239,t[i++]=191,t[i++]=189):n=r;continue}if(r<56320){t[i++]=239,t[i++]=191,t[i++]=189,n=r;continue}r=n-55296<<10|r-56320|65536,n=null}else n&&(t[i++]=239,t[i++]=191,t[i++]=189,n=null);r<128?t[i++]=r:(r<2048?t[i++]=r>>6|192:(r<65536?t[i++]=r>>12|224:(t[i++]=r>>18|240,t[i++]=r>>12&63|128),t[i++]=r>>6&63|128),t[i++]=63&r|128)}return i}(this.buf,t,this.pos);var i=this.pos-e;i>=128&&il(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),Js(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Js(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 i=0;i<e;i++)this.buf[this.pos++]=t[i]},writeRawMessage:function(t,e){this.pos++;var i=this.pos;t(e,this);var r=this.pos-i;r>=128&&il(i,r,this),this.pos=i-1,this.writeVarint(r),this.pos+=r},writeMessage:function(t,e,i){this.writeTag(t,Qs.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,rl,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,nl,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,sl,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,al,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,ol,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,ll,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,ul,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,hl,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,cl,e)},writeBytesField:function(t,e){this.writeTag(t,Qs.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Qs.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Qs.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Qs.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Qs.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Qs.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Qs.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Qs.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Qs.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Qs.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var _l=function(t,e){var i=e.pixelRatio,r=e.version,n=e.stretchX,a=e.stretchY,o=e.content;this.paddedRect=t,this.pixelRatio=i,this.stretchX=n,this.stretchY=a,this.content=o,this.version=r},xl={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};xl.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},xl.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},xl.tlbr.get=function(){return this.tl.concat(this.br)},xl.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(_l.prototype,xl);var bl=function(t,e){var i={},r={};this.haveRenderCallbacks=[];var n=[];this.addImages(t,i,n),this.addImages(e,r,n);var a=gl(n),o=new bo({width:a.w||1,height:a.h||1});for(var s in t){var l=t[s],u=i[s].paddedRect;bo.copy(l.data,o,{x:0,y:0},{x:u.x+1,y:u.y+1},l.data)}for(var h in e){var c=e[h],p=r[h].paddedRect,f=p.x+1,d=p.y+1,y=c.data.width,m=c.data.height;bo.copy(c.data,o,{x:0,y:0},{x:f,y:d},c.data),bo.copy(c.data,o,{x:0,y:m-1},{x:f,y:d-1},{width:y,height:1}),bo.copy(c.data,o,{x:0,y:0},{x:f,y:d+m},{width:y,height:1}),bo.copy(c.data,o,{x:y-1,y:0},{x:f-1,y:d},{width:1,height:m}),bo.copy(c.data,o,{x:0,y:0},{x:f+y,y:d},{width:1,height:m})}this.image=o,this.iconPositions=i,this.patternPositions=r};bl.prototype.addImages=function(t,e,i){for(var r in t){var n=t[r],a={x:0,y:0,w:n.data.width+2,h:n.data.height+2};i.push(a),e[r]=new _l(a,n),n.hasRenderCallback&&this.haveRenderCallbacks.push(r)}},bl.prototype.patchUpdatedImages=function(t,e){for(var i in t.dispatchRenderCallbacks(this.haveRenderCallbacks),t.updatedImages)this.patchUpdatedImage(this.iconPositions[i],t.getImage(i),e),this.patchUpdatedImage(this.patternPositions[i],t.getImage(i),e)},bl.prototype.patchUpdatedImage=function(t,e,i){if(t&&e&&t.version!==e.version){t.version=e.version;var r=t.tl;i.update(e.data,void 0,{x:r[0],y:r[1]})}},Wr("ImagePosition",_l),Wr("ImageAtlas",bl);var wl={horizontal:1,vertical:2,horizontalOnly:3},Sl=function(){this.scale=1,this.fontStack="",this.imageName=null};Sl.forText=function(t,e){var i=new Sl;return i.scale=t||1,i.fontStack=e,i},Sl.forImage=function(t){var e=new Sl;return e.imageName=t,e};var Ml=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function El(t,e,i,r,n,a,o,s,l,u,h,c,p,f,d,y){var m,v=Ml.fromFeature(t,n);c===wl.vertical&&v.verticalizePunctuation();var g=mn.processBidirectionalText,_=mn.processStyledBidirectionalText;if(g&&1===v.sections.length){m=[];for(var x=0,b=g(v.toString(),Ll(v,u,a,e,r,f,d));x<b.length;x+=1){var w=b[x],S=new Ml;S.text=w,S.sections=v.sections;for(var M=0;M<w.length;M++)S.sectionIndex.push(0);m.push(S)}}else if(_){m=[];for(var E=0,k=_(v.text,v.sectionIndex,Ll(v,u,a,e,r,f,d));E<k.length;E+=1){var T=k[E],I=new Ml;I.text=T[0],I.sectionIndex=T[1],I.sections=v.sections,m.push(I)}}else m=function(t,e){for(var i=[],r=t.text,n=0,a=0,o=e;a<o.length;a+=1){var s=o[a];i.push(t.substring(n,s)),n=s}return n<r.length&&i.push(t.substring(n,r.length)),i}(v,Ll(v,u,a,e,r,f,d));var C=[],A={positionedLines:C,text:v.toString(),top:h[1],bottom:h[1],left:h[0],right:h[0],writingMode:c,iconsInText:!1,verticalizable:!1};return function(t,e,i,r,n,a,o,s,l,u,h,c){for(var p=0,f=-17,d=0,y=0,m="right"===s?1:"left"===s?0:.5,v=0,g=0,_=n;g<_.length;g+=1){var x=_[g];x.trim();var b=x.getMaxScale(),w=24*(b-1),S={positionedGlyphs:[],lineOffset:0};t.positionedLines[v]=S;var M=S.positionedGlyphs,E=0;if(x.length()){for(var k=0;k<x.length();k++){var T=x.getSection(k),I=x.getSectionIndex(k),C=x.getCharCode(k),A=0,P=null,L=null,z=null,D=24,R=!(l===wl.horizontal||!h&&!rn(C)||h&&(kl[C]||(G=C,tn.Arabic(G)||tn["Arabic Supplement"](G)||tn["Arabic Extended-A"](G)||tn["Arabic Presentation Forms-A"](G)||tn["Arabic Presentation Forms-B"](G))));if(T.imageName){var O=r[T.imageName];if(!O)continue;z=T.imageName,t.iconsInText=t.iconsInText||!0,L=O.paddedRect;var B=O.displaySize;T.scale=24*T.scale/c,A=w+(24-B[1]*T.scale),D=(P={width:B[0],height:B[1],left:1,top:-3,advance:R?B[1]:B[0]}).advance;var F=R?B[0]*T.scale-24*b:B[1]*T.scale-24*b;F>0&&F>E&&(E=F)}else{var V=i[T.fontStack],U=V&&V[C];if(U&&U.rect)L=U.rect,P=U.metrics;else{var j=e[T.fontStack],N=j&&j[C];if(!N)continue;P=N.metrics}A=24*(b-T.scale)}R?(t.verticalizable=!0,M.push({glyph:C,imageName:z,x:p,y:f+A,vertical:R,scale:T.scale,fontStack:T.fontStack,sectionIndex:I,metrics:P,rect:L}),p+=D*T.scale+u):(M.push({glyph:C,imageName:z,x:p,y:f+A,vertical:R,scale:T.scale,fontStack:T.fontStack,sectionIndex:I,metrics:P,rect:L}),p+=P.advance*T.scale+u)}0!==M.length&&(d=Math.max(p-u,d),Dl(M,0,M.length-1,m,E)),p=0;var q=a*b+E;S.lineOffset=Math.max(E,w),f+=q,y=Math.max(q,y),++v}else f+=a,++v}var G,Z=f- -17,X=zl(o),W=X.horizontalAlign,K=X.verticalAlign;(function(t,e,i,r,n,a,o,s,l){var u,h=(e-i)*n;u=a!==o?-s*r- -17:(-r*l+.5)*o;for(var c=0,p=t;c<p.length;c+=1)for(var f=0,d=p[c].positionedGlyphs;f<d.length;f+=1){var y=d[f];y.x+=h,y.y+=u}})(t.positionedLines,m,W,K,d,y,a,Z,n.length),t.top+=-K*Z,t.bottom=t.top+Z,t.left+=-W*d,t.right=t.left+d}(A,e,i,r,m,o,s,l,c,u,p,y),!function(t){for(var e=0,i=C;e<i.length;e+=1)if(0!==i[e].positionedGlyphs.length)return!1;return!0}()&&A}Ml.fromFeature=function(t,e){for(var i=new Ml,r=0;r<t.sections.length;r++){var n=t.sections[r];n.image?i.addImageSection(n):i.addTextSection(n,e)}return i},Ml.prototype.length=function(){return this.text.length},Ml.prototype.getSection=function(t){return this.sections[this.sectionIndex[t]]},Ml.prototype.getSectionIndex=function(t){return this.sectionIndex[t]},Ml.prototype.getCharCode=function(t){return this.text.charCodeAt(t)},Ml.prototype.verticalizePunctuation=function(){this.text=function(t){for(var e="",i=0;i<t.length;i++){var r=t.charCodeAt(i+1)||null,n=t.charCodeAt(i-1)||null;e+=r&&nn(r)&&!Ks[t[i+1]]||n&&nn(n)&&!Ks[t[i-1]]||!Ks[t[i]]?t[i]:Ks[t[i]]}return e}(this.text)},Ml.prototype.trim=function(){for(var t=0,e=0;e<this.text.length&&kl[this.text.charCodeAt(e)];e++)t++;for(var i=this.text.length,r=this.text.length-1;r>=0&&r>=t&&kl[this.text.charCodeAt(r)];r--)i--;this.text=this.text.substring(t,i),this.sectionIndex=this.sectionIndex.slice(t,i)},Ml.prototype.substring=function(t,e){var i=new Ml;return i.text=this.text.substring(t,e),i.sectionIndex=this.sectionIndex.slice(t,e),i.sections=this.sections,i},Ml.prototype.toString=function(){return this.text},Ml.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce(function(e,i){return Math.max(e,t.sections[i].scale)},0)},Ml.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(Sl.forText(t.scale,t.fontStack||e));for(var i=this.sections.length-1,r=0;r<t.text.length;++r)this.sectionIndex.push(i)},Ml.prototype.addImageSection=function(t){var e=t.image?t.image.name:"";if(0!==e.length){var i=this.getNextImageSectionCharCode();i?(this.text+=String.fromCharCode(i),this.sections.push(Sl.forImage(e)),this.sectionIndex.push(this.sections.length-1)):w("Reached maximum number of images 6401")}else w("Can't add FormattedSection with an empty image.")},Ml.prototype.getNextImageSectionCharCode=function(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var kl={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Tl={};function Il(t,e,i,r,n,a){if(e.imageName){var o=r[e.imageName];return o?o.displaySize[0]*e.scale*24/a+n:0}var s=i[e.fontStack],l=s&&s[t];return l?l.metrics.advance*e.scale+n:0}function Cl(t,e,i,r){var n=Math.pow(t-e,2);return r?t<e?n/2:2*n:n+Math.abs(i)*i}function Al(t,e,i){var r=0;return 10===t&&(r-=1e4),i&&(r+=150),40!==t&&65288!==t||(r+=50),41!==e&&65289!==e||(r+=50),r}function Pl(t,e,i,r,n,a){for(var o=null,s=Cl(e,i,n,a),l=0,u=r;l<u.length;l+=1){var h=u[l],c=Cl(e-h.x,i,n,a)+h.badness;c<=s&&(o=h,s=c)}return{index:t,x:e,priorBreak:o,badness:s}}function Ll(t,e,i,r,n,a,o){if("point"!==a)return[];if(!t)return[];for(var s,l=[],u=function(t,e,i,r,n,a){for(var o=0,s=0;s<t.length();s++){var l=t.getSection(s);o+=Il(t.getCharCode(s),l,r,n,e,a)}return o/Math.max(1,Math.ceil(o/i))}(t,e,i,r,n,o),h=t.text.indexOf("")>=0,c=0,p=0;p<t.length();p++){var f=t.getSection(p),d=t.getCharCode(p);if(kl[d]||(c+=Il(d,f,r,n,e,o)),p<t.length()-1){var y=!((s=d)<11904||!(tn["Bopomofo Extended"](s)||tn.Bopomofo(s)||tn["CJK Compatibility Forms"](s)||tn["CJK Compatibility Ideographs"](s)||tn["CJK Compatibility"](s)||tn["CJK Radicals Supplement"](s)||tn["CJK Strokes"](s)||tn["CJK Symbols and Punctuation"](s)||tn["CJK Unified Ideographs Extension A"](s)||tn["CJK Unified Ideographs"](s)||tn["Enclosed CJK Letters and Months"](s)||tn["Halfwidth and Fullwidth Forms"](s)||tn.Hiragana(s)||tn["Ideographic Description Characters"](s)||tn["Kangxi Radicals"](s)||tn["Katakana Phonetic Extensions"](s)||tn.Katakana(s)||tn["Vertical Forms"](s)||tn["Yi Radicals"](s)||tn["Yi Syllables"](s)));(Tl[d]||y||f.imageName)&&l.push(Pl(p+1,c,u,l,Al(d,t.getCharCode(p+1),y&&h),!1))}}return function t(e){return e?t(e.priorBreak).concat(e.index):[]}(Pl(t.length(),c,u,l,0,!0))}function zl(t){var e=.5,i=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(t){case"bottom":case"bottom-right":case"bottom-left":i=1;break;case"top":case"top-right":case"top-left":i=0}return{horizontalAlign:e,verticalAlign:i}}function Dl(t,e,i,r,n){if(r||n)for(var a=t[i],o=(t[i].x+a.metrics.advance*a.scale)*r,s=e;s<=i;s++)t[s].x-=o,t[s].y+=n}function Rl(t,e,i,r,n,a){var o,s=t.image;if(s.content){var l=s.content,u=s.pixelRatio||1;o=[l[0]/u,l[1]/u,s.displaySize[0]-l[2]/u,s.displaySize[1]-l[3]/u]}var h,c,p,f,d=e.left*a,y=e.right*a;"width"===i||"both"===i?(f=n[0]+d-r[3],c=n[0]+y+r[1]):c=(f=n[0]+(d+y-s.displaySize[0])/2)+s.displaySize[0];var m=e.top*a,v=e.bottom*a;return"height"===i||"both"===i?(h=n[1]+m-r[0],p=n[1]+v+r[2]):p=(h=n[1]+(m+v-s.displaySize[1])/2)+s.displaySize[1],{image:s,top:h,right:c,bottom:p,left:f,collisionPadding:o}}Tl[10]=!0,Tl[32]=!0,Tl[38]=!0,Tl[40]=!0,Tl[41]=!0,Tl[43]=!0,Tl[45]=!0,Tl[47]=!0,Tl[173]=!0,Tl[183]=!0,Tl[8203]=!0,Tl[8208]=!0,Tl[8211]=!0,Tl[8231]=!0;var Ol=function(t){function e(e,i,r,n){t.call(this,e,i),this.angle=r,void 0!==n&&(this.segment=n)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.clone=function(){return new e(this.x,this.y,this.angle,this.segment)},e}(n);function Bl(t,e){var i=e.expression;if("constant"===i.kind)return{kind:"constant",layoutSize:i.evaluate(new vn(t+1))};if("source"===i.kind)return{kind:"source"};for(var r=i.zoomStops,n=i.interpolationType,a=0;a<r.length&&r[a]<=t;)a++;for(var o=a=Math.max(0,a-1);o<r.length&&r[o]<t+1;)o++;o=Math.min(r.length-1,o);var s=r[a],l=r[o];return"composite"===i.kind?{kind:"composite",minZoom:s,maxZoom:l,interpolationType:n}:{kind:"camera",minZoom:s,maxZoom:l,minSize:i.evaluate(new vn(s)),maxSize:i.evaluate(new vn(l)),interpolationType:n}}function Fl(t,e,i){var r=e.uSize,n=i.lowerSize;return"source"===t.kind?n/128:"composite"===t.kind?ri(n/128,i.upperSize/128,e.uSizeT):r}function Vl(t,e){var i=0,r=0;if("constant"===t.kind)r=t.layoutSize;else if("source"!==t.kind){var n=t.interpolationType,a=n?l(vi.interpolationFactor(n,e,t.minZoom,t.maxZoom),0,1):0;"camera"===t.kind?r=ri(t.minSize,t.maxSize,a):i=a}return{uSizeT:i,uSize:r}}Wr("Anchor",Ol);var Ul=Object.freeze({__proto__:null,getSizeData:Bl,evaluateSizeForFeature:Fl,evaluateSizeForZoom:Vl,SIZE_PACK_FACTOR:128});function jl(t,e,i,r,n){if(void 0===e.segment)return!0;for(var a=e,o=e.segment+1,s=0;s>-i/2;){if(--o<0)return!1;s-=t[o].dist(a),a=t[o]}s+=t[o].dist(t[o+1]),o++;for(var l=[],u=0;s<i/2;){var h=t[o],c=t[o+1];if(!c)return!1;var p=t[o-1].angleTo(h)-h.angleTo(c);for(p=Math.abs((p+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:s,angleDelta:p}),u+=p;s-l[0].distance>r;)u-=l.shift().angleDelta;if(u>n)return!1;o++,s+=h.dist(c)}return!0}function Nl(t){for(var e=0,i=0;i<t.length-1;i++)e+=t[i].dist(t[i+1]);return e}function ql(t,e,i){return t?.6*e*i:0}function Gl(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function Zl(t,e,i,r,n,a){for(var o=ql(i,n,a),s=Gl(i,r)*a,l=0,u=Nl(t)/2,h=0;h<t.length-1;h++){var c=t[h],p=t[h+1],f=c.dist(p);if(l+f>u){var d=(u-l)/f,y=ri(c.x,p.x,d),m=ri(c.y,p.y,d),v=new Ol(y,m,p.angleTo(c),h);return v._round(),!o||jl(t,v,s,o,e)?v:void 0}l+=f}}function Xl(t,e,i,r,n,a,o,s,l){var u=ql(r,a,o),h=Gl(r,n),c=h*o,p=0===t[0].x||t[0].x===l||0===t[0].y||t[0].y===l;return e-c<e/4&&(e=c+e/4),function t(e,i,r,n,a,o,s,l,u){for(var h=o/2,c=Nl(e),p=0,f=i-r,d=[],y=0;y<e.length-1;y++){for(var m=e[y],v=e[y+1],g=m.dist(v),_=v.angleTo(m);f+r<p+g;){var x=((f+=r)-p)/g,b=ri(m.x,v.x,x),w=ri(m.y,v.y,x);if(b>=0&&b<u&&w>=0&&w<u&&f-h>=0&&f+h<=c){var S=new Ol(b,w,_,y);S._round(),n&&!jl(e,S,o,n,a)||d.push(S)}}p+=g}return l||d.length||s||(d=t(e,p/2,r,n,a,o,s,!0,u)),d}(t,p?e/2*s%e:(h/2+2*a)*o*s%e,e,u,i,c,p,!1,l)}function Wl(t,e,i,r){var a=[],o=t.image,s=o.pixelRatio,l=o.paddedRect.w-2,u=o.paddedRect.h-2,h=t.right-t.left,c=t.bottom-t.top,p=o.stretchX||[[0,l]],f=o.stretchY||[[0,u]],d=function(t,e){return t+e[1]-e[0]},y=p.reduce(d,0),m=f.reduce(d,0),v=l-y,g=u-m,_=0,x=y,b=0,w=m,S=0,M=v,E=0,k=g;if(o.content&&r){var T=o.content;_=Kl(p,0,T[0]),b=Kl(f,0,T[1]),x=Kl(p,T[0],T[2]),w=Kl(f,T[1],T[3]),S=T[0]-_,E=T[1]-b,M=T[2]-T[0]-x,k=T[3]-T[1]-w}var I=function(r,a,l,u){var p=Jl(r.stretch-_,x,h,t.left),f=Yl(r.fixed-S,M,r.stretch,y),d=Jl(a.stretch-b,w,c,t.top),v=Yl(a.fixed-E,k,a.stretch,m),g=Jl(l.stretch-_,x,h,t.left),T=Yl(l.fixed-S,M,l.stretch,y),I=Jl(u.stretch-b,w,c,t.top),C=Yl(u.fixed-E,k,u.stretch,m),A=new n(p,d),P=new n(g,d),L=new n(g,I),z=new n(p,I),D=new n(f/s,v/s),R=new n(T/s,C/s),O=e*Math.PI/180;if(O){var B=Math.sin(O),F=Math.cos(O),V=[F,-B,B,F];A._matMult(V),P._matMult(V),z._matMult(V),L._matMult(V)}var U=r.stretch+r.fixed,j=a.stretch+a.fixed;return{tl:A,tr:P,bl:z,br:L,tex:{x:o.paddedRect.x+1+U,y:o.paddedRect.y+1+j,w:l.stretch+l.fixed-U,h:u.stretch+u.fixed-j},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:D,pixelOffsetBR:R,minFontScaleX:M/s/h,minFontScaleY:k/s/c,isSDF:i}};if(r&&(o.stretchX||o.stretchY))for(var C=Hl(p,v,y),A=Hl(f,g,m),P=0;P<C.length-1;P++)for(var L=C[P],z=C[P+1],D=0;D<A.length-1;D++)a.push(I(L,A[D],z,A[D+1]));else a.push(I({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:l+1},{fixed:0,stretch:u+1}));return a}function Kl(t,e,i){for(var r=0,n=0,a=t;n<a.length;n+=1){var o=a[n];r+=Math.max(e,Math.min(i,o[1]))-Math.max(e,Math.min(i,o[0]))}return r}function Hl(t,e,i){for(var r=[{fixed:-1,stretch:0}],n=0,a=t;n<a.length;n+=1){var o=a[n],s=o[0],l=o[1],u=r[r.length-1];r.push({fixed:s-u.stretch,stretch:u.stretch}),r.push({fixed:s-u.stretch,stretch:u.stretch+(l-s)})}return r.push({fixed:e+1,stretch:i}),r}function Jl(t,e,i,r){return t/e*i+r}function Yl(t,e,i,r){return t-e*i/r}var Ql=function(t,e,i,r,a,o,s,l,u,h,c,p){var f=s.top*l-u,d=s.bottom*l+u,y=s.left*l-u,m=s.right*l+u,v=s.collisionPadding;if(v&&(y-=v[0]*l,f-=v[1]*l,m+=v[2]*l,d+=v[3]*l),this.boxStartIndex=t.length,h){var g=d-f,_=m-y;g>0&&(g=Math.max(10*l,g),this._addLineCollisionCircles(t,e,i,i.segment,_,g,r,a,o,c))}else{if(p){var x=new n(y,f),b=new n(m,f),w=new n(y,d),S=new n(m,d),M=p*Math.PI/180;x._rotate(M),b._rotate(M),w._rotate(M),S._rotate(M),y=Math.min(x.x,b.x,w.x,S.x),m=Math.max(x.x,b.x,w.x,S.x),f=Math.min(x.y,b.y,w.y,S.y),d=Math.max(x.y,b.y,w.y,S.y)}t.emplaceBack(i.x,i.y,y,f,m,d,r,a,o,0,0)}this.boxEndIndex=t.length};Ql.prototype._addLineCollisionCircles=function(t,e,i,r,n,a,o,s,l,u){var h=a/2,c=Math.floor(n/h)||1,p=1+.4*Math.log(u)/Math.LN2,f=Math.floor(c*p/2),d=-a/2,y=i,m=r+1,v=d,g=-n/2,_=g-n/4;do{if(--m<0){if(v>g)return;m=0;break}v-=e[m].dist(y),y=e[m]}while(v>_);for(var x=e[m].dist(e[m+1]),b=-f;b<c+f;b++){var w=b*h,S=g+w;if(w<0&&(S+=w),w>n&&(S+=w-n),!(S<v)){for(;v+x<S;){if(v+=x,++m+1>=e.length)return;x=e[m].dist(e[m+1])}var M=S-v,E=e[m],k=e[m+1].sub(E)._unit()._mult(M)._add(E)._round(),T=Math.abs(S-d)<h?0:.8*(S-d);t.emplaceBack(k.x,k.y,-a/2,-a/2,a/2,a/2,o,s,l,a/2,T)}}};var $l=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=tu),this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(var i=(this.length>>1)-1;i>=0;i--)this._down(i)};function tu(t,e){return t<e?-1:t>e?1:0}function eu(t,e,i){void 0===e&&(e=1),void 0===i&&(i=!1);for(var r=1/0,a=1/0,o=-1/0,s=-1/0,l=t[0],u=0;u<l.length;u++){var h=l[u];(!u||h.x<r)&&(r=h.x),(!u||h.y<a)&&(a=h.y),(!u||h.x>o)&&(o=h.x),(!u||h.y>s)&&(s=h.y)}var c=Math.min(o-r,s-a),p=c/2,f=new $l([],iu);if(0===c)return new n(r,a);for(var d=r;d<o;d+=c)for(var y=a;y<s;y+=c)f.push(new ru(d+p,y+p,p,t));for(var m=function(t){for(var e=0,i=0,r=0,n=t[0],a=0,o=n.length,s=o-1;a<o;s=a++){var l=n[a],u=n[s],h=l.x*u.y-u.x*l.y;i+=(l.x+u.x)*h,r+=(l.y+u.y)*h,e+=3*h}return new ru(i/e,r/e,0,t)}(t),v=f.length;f.length;){var g=f.pop();(g.d>m.d||!m.d)&&(m=g,i&&console.log("found best %d after %d probes",Math.round(1e4*g.d)/1e4,v)),g.max-m.d<=e||(f.push(new ru(g.p.x-(p=g.h/2),g.p.y-p,p,t)),f.push(new ru(g.p.x+p,g.p.y-p,p,t)),f.push(new ru(g.p.x-p,g.p.y+p,p,t)),f.push(new ru(g.p.x+p,g.p.y+p,p,t)),v+=4)}return i&&(console.log("num probes: "+v),console.log("best distance: "+m.d)),m.p}function iu(t,e){return e.max-t.max}function ru(t,e,i,r){this.p=new n(t,e),this.h=i,this.d=function(t,e){for(var i=!1,r=1/0,n=0;n<e.length;n++)for(var a=e[n],o=0,s=a.length,l=s-1;o<s;l=o++){var u=a[o],h=a[l];u.y>t.y!=h.y>t.y&&t.x<(h.x-u.x)*(t.y-u.y)/(h.y-u.y)+u.x&&(i=!i),r=Math.min(r,eo(t,u,h))}return(i?1:-1)*Math.sqrt(r)}(this.p,r),this.max=this.d+this.h*Math.SQRT2}$l.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},$l.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}},$l.prototype.peek=function(){return this.data[0]},$l.prototype._up=function(t){for(var e=this.data,i=this.compare,r=e[t];t>0;){var n=t-1>>1,a=e[n];if(i(r,a)>=0)break;e[t]=a,t=n}e[t]=r},$l.prototype._down=function(t){for(var e=this.data,i=this.compare,r=this.length>>1,n=e[t];t<r;){var a=1+(t<<1),o=e[a],s=a+1;if(s<this.length&&i(e[s],o)<0&&(a=s,o=e[s]),i(o,n)>=0)break;e[t]=o,t=a}e[t]=n};var nu=Number.POSITIVE_INFINITY;function au(t,e){return e[1]!==nu?function(t,e,i){var r=0,n=0;switch(e=Math.abs(e),i=Math.abs(i),t){case"top-right":case"top-left":case"top":n=i-7;break;case"bottom-right":case"bottom-left":case"bottom":n=7-i}switch(t){case"top-right":case"bottom-right":case"right":r=-e;break;case"top-left":case"bottom-left":case"left":r=e}return[r,n]}(t,e[0],e[1]):function(t,e){var i=0,r=0;e<0&&(e=0);var n=e/Math.sqrt(2);switch(t){case"top-right":case"top-left":r=n-7;break;case"bottom-right":case"bottom-left":r=7-n;break;case"bottom":r=7-e;break;case"top":r=e-7}switch(t){case"top-right":case"bottom-right":i=-n;break;case"top-left":case"bottom-left":i=n;break;case"left":i=e;break;case"right":i=-e}return[i,r]}(t,e[0])}function ou(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"}function su(t,e,i,r,a,o,s,l,u,h,c,p,f,d,y){var m=function(t,e,i,r,a,o,s,l){for(var u=r.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,h=[],c=0,p=e.positionedLines;c<p.length;c+=1)for(var f=p[c],d=0,y=f.positionedGlyphs;d<y.length;d+=1){var m=y[d];if(m.rect){var v=m.rect||{},g=4,_=!0,x=1,b=0,w=(a||l)&&m.vertical,S=m.metrics.advance*m.scale/2;if(l&&e.verticalizable&&(b=f.lineOffset/2-(m.imageName?-(24-m.metrics.width*m.scale)/2:24*(m.scale-1))),m.imageName){var M=s[m.imageName];_=M.sdf,g=1/(x=M.pixelRatio)}var E=a?[m.x+S,m.y]:[0,0],k=a?[0,0]:[m.x+S+i[0],m.y+i[1]-b],T=[0,0];w&&(T=k,k=[0,0]);var I=(m.metrics.left-g)*m.scale-S+k[0],C=(-m.metrics.top-g)*m.scale+k[1],A=I+v.w*m.scale/x,P=C+v.h*m.scale/x,L=new n(I,C),z=new n(A,C),D=new n(I,P),R=new n(A,P);if(w){var O=new n(-S,S- -17),B=-Math.PI/2,F=12-S,V=new n(22-F,-(m.imageName?F:0)),U=new(Function.prototype.bind.apply(n,[null].concat(T)));L._rotateAround(B,O)._add(V)._add(U),z._rotateAround(B,O)._add(V)._add(U),D._rotateAround(B,O)._add(V)._add(U),R._rotateAround(B,O)._add(V)._add(U)}if(u){var j=Math.sin(u),N=Math.cos(u),q=[N,-j,j,N];L._matMult(q),z._matMult(q),D._matMult(q),R._matMult(q)}var G=new n(0,0),Z=new n(0,0);h.push({tl:L,tr:z,bl:D,br:R,tex:v,writingMode:e.writingMode,glyphOffset:E,sectionIndex:m.sectionIndex,isSDF:_,pixelOffsetTL:G,pixelOffsetBR:Z,minFontScaleX:0,minFontScaleY:0})}}return h}(0,i,l,a,o,s,r,t.allowVerticalPlacement),v=t.textSizeData,g=null;"source"===v.kind?(g=[128*a.layout.get("text-size").evaluate(s,{})])[0]>32640&&w(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):"composite"===v.kind&&((g=[128*d.compositeTextSizes[0].evaluate(s,{},y),128*d.compositeTextSizes[1].evaluate(s,{},y)])[0]>32640||g[1]>32640)&&w(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),t.addSymbols(t.text,m,g,l,o,s,h,e,u.lineStartIndex,u.lineLength,f,y);for(var _=0,x=c;_<x.length;_+=1)p[x[_]]=t.text.placedSymbolArray.length-1;return 4*m.length}function lu(t){for(var e in t)return t[e];return null}function uu(t,e,i,r){var n=t.compareText;if(e in n){for(var a=n[e],o=a.length-1;o>=0;o--)if(r.dist(a[o])<i)return!0}else n[e]=[];return n[e].push(r),!1}var hu=ws.VectorTileFeature.types,cu=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function pu(t,e,i,r,n,a,o,s,l,u,h,c,p){var f=s?Math.min(32640,Math.round(s[0])):0,d=s?Math.min(32640,Math.round(s[1])):0;t.emplaceBack(e,i,Math.round(32*r),Math.round(32*n),a,o,(f<<1)+(l?1:0),d,16*u,16*h,256*c,256*p)}function fu(t,e,i){t.emplaceBack(e.x,e.y,i),t.emplaceBack(e.x,e.y,i),t.emplaceBack(e.x,e.y,i),t.emplaceBack(e.x,e.y,i)}function du(t){for(var e=0,i=t.sections;e<i.length;e+=1)if(sn(i[e].text))return!0;return!1}var yu=function(t){this.layoutVertexArray=new qn,this.indexArray=new ta,this.programConfigurations=t,this.segments=new ma,this.dynamicLayoutVertexArray=new Gn,this.opacityVertexArray=new Zn,this.placedSymbolArray=new la};yu.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length},yu.prototype.upload=function(t,e,i,r){this.isEmpty()||(i&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ns.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,qs.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,cu,!0),this.opacityVertexBuffer.itemSize=1),(i||r)&&this.programConfigurations.upload(t))},yu.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},Wr("SymbolBuffers",yu);var mu=function(t,e,i){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new i,this.segments=new ma,this.collisionVertexArray=new Kn};mu.prototype.upload=function(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,Gs.members,!0)},mu.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},Wr("CollisionBuffers",mu);var vu=function(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(function(t){return t.id}),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[];var e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Bl(this.zoom,e["text-size"]),this.iconSizeData=Bl(this.zoom,e["icon-size"]);var i=this.layers[0].layout,r=i.get("symbol-sort-key"),n=i.get("symbol-z-order");this.sortFeaturesByKey="viewport-y"!==n&&void 0!==r.constantOr(1),this.sortFeaturesByY=("viewport-y"===n||"auto"===n&&!this.sortFeaturesByKey)&&(i.get("text-allow-overlap")||i.get("icon-allow-overlap")||i.get("text-ignore-placement")||i.get("icon-ignore-placement")),"point"===i.get("symbol-placement")&&(this.writingModes=i.get("text-writing-mode").map(function(t){return wl[t]})),this.stateDependentLayerIds=this.layers.filter(function(t){return t.isStateDependent()}).map(function(t){return t.id}),this.sourceID=t.sourceID};vu.prototype.createArrays=function(){this.text=new yu(new ja(Ns.members,this.layers,this.zoom,function(t){return/^text/.test(t)})),this.icon=new yu(new ja(Ns.members,this.layers,this.zoom,function(t){return/^icon/.test(t)})),this.glyphOffsetArray=new ca,this.lineVertexArray=new pa,this.symbolInstances=new ha},vu.prototype.calculateGlyphDependencies=function(t,e,i,r,n){for(var a=0;a<t.length;a++)if(e[t.charCodeAt(a)]=!0,(i||r)&&n){var o=Ks[t.charAt(a)];o&&(e[o.charCodeAt(0)]=!0)}},vu.prototype.populate=function(t,e,i){var r=this.layers[0],n=r.layout,a=n.get("text-font"),o=n.get("text-field"),s=n.get("icon-image"),l=("constant"!==o.value.kind||o.value.value instanceof ee&&!o.value.value.isEmpty()||o.value.value.toString().length>0)&&("constant"!==a.value.kind||a.value.value.length>0),u="constant"!==s.value.kind||!!s.value.value||Object.keys(s.parameters).length>0,h=n.get("symbol-sort-key");if(this.features=[],l||u){for(var c=e.iconDependencies,p=e.glyphDependencies,f=e.availableImages,d=new vn(this.zoom),y=0,m=t;y<m.length;y+=1){var v=m[y],g=v.feature,_=v.id,x=v.index,b=v.sourceLayerIndex,w=r._featureFilter.needGeometry,S={type:g.type,id:_,properties:g.properties,geometry:w?Za(g):[]};if(r._featureFilter.filter(d,S,i)){w||(S.geometry=Za(g));var M=void 0;if(l){var E=r.getValueAndResolveTokens("text-field",S,i,f),k=ee.factory(E);du(k)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===dn()||this.hasRTLText&&mn.isParsed())&&(M=Ws(k,r,S))}var T=void 0;if(u){var I=r.getValueAndResolveTokens("icon-image",S,i,f);T=I instanceof ie?I:ie.fromString(I)}if(M||T){var C=this.sortFeaturesByKey?h.evaluate(S,{},i):void 0,A={id:_,text:M,icon:T,index:x,sourceLayerIndex:b,geometry:Za(g),properties:g.properties,type:hu[g.type],sortKey:C};if(this.features.push(A),T&&(c[T.name]=!0),M){var P=a.evaluate(S,{},i).join(","),L="map"===n.get("text-rotation-alignment")&&"point"!==n.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(wl.vertical)>=0;for(var z=0,D=M.sections;z<D.length;z+=1){var R=D[z];if(R.image)c[R.image.name]=!0;else{var O=en(M.toString()),B=R.fontStack||P,F=p[B]=p[B]||{};this.calculateGlyphDependencies(R.text,F,L,this.allowVerticalPlacement,O)}}}}}}"line"===n.get("symbol-placement")&&(this.features=function(t){var e={},i={},r=[],n=0;function a(e){r.push(t[e]),n++}function o(t,e,n){var a=i[t];return delete i[t],i[e]=a,r[a].geometry[0].pop(),r[a].geometry[0]=r[a].geometry[0].concat(n[0]),a}function s(t,i,n){var a=e[i];return delete e[i],e[t]=a,r[a].geometry[0].shift(),r[a].geometry[0]=n[0].concat(r[a].geometry[0]),a}function l(t,e,i){var r=i?e[0][e[0].length-1]:e[0][0];return t+":"+r.x+":"+r.y}for(var u=0;u<t.length;u++){var h=t[u],c=h.geometry,p=h.text?h.text.toString():null;if(p){var f=l(p,c),d=l(p,c,!0);if(f in i&&d in e&&i[f]!==e[d]){var y=s(f,d,c),m=o(f,d,r[y].geometry);delete e[f],delete i[d],i[l(p,r[m].geometry,!0)]=m,r[y].geometry=null}else f in i?o(f,d,c):d in e?s(f,d,c):(a(u),e[f]=n-1,i[d]=n-1)}else a(u)}return r.filter(function(t){return t.geometry})}(this.features)),this.sortFeaturesByKey&&this.features.sort(function(t,e){return t.sortKey-e.sortKey})}},vu.prototype.update=function(t,e,i){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,i),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,i))},vu.prototype.isEmpty=function(){return 0===this.symbolInstances.length&&!this.hasRTLText},vu.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},vu.prototype.upload=function(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t),this.textCollisionCircle.upload(t),this.iconCollisionCircle.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0},vu.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy(),this.textCollisionCircle.destroy(),this.iconCollisionCircle.destroy()},vu.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()},vu.prototype.addToLineVertexArray=function(t,e){var i=this.lineVertexArray.length;if(void 0!==t.segment){for(var r=t.dist(e[t.segment+1]),n=t.dist(e[t.segment]),a={},o=t.segment+1;o<e.length;o++)a[o]={x:e[o].x,y:e[o].y,tileUnitDistanceFromAnchor:r},o<e.length-1&&(r+=e[o+1].dist(e[o]));for(var s=t.segment||0;s>=0;s--)a[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:n},s>0&&(n+=e[s-1].dist(e[s]));for(var l=0;l<e.length;l++){var u=a[l];this.lineVertexArray.emplaceBack(u.x,u.y,u.tileUnitDistanceFromAnchor)}}return{lineStartIndex:i,lineLength:this.lineVertexArray.length-i}},vu.prototype.addSymbols=function(t,e,i,r,n,a,o,s,l,u,h,c){for(var p=t.indexArray,f=t.layoutVertexArray,d=t.segments.prepareSegment(4*e.length,f,p,a.sortKey),y=this.glyphOffsetArray.length,m=d.vertexLength,v=this.allowVerticalPlacement&&o===wl.vertical?Math.PI/2:0,g=a.text&&a.text.sections,_=0;_<e.length;_++){var x=e[_],b=x.tl,w=x.tr,S=x.bl,M=x.br,E=x.tex,k=x.pixelOffsetTL,T=x.pixelOffsetBR,I=x.minFontScaleX,C=x.minFontScaleY,A=x.glyphOffset,P=x.isSDF,L=x.sectionIndex,z=d.vertexLength,D=A[1];pu(f,s.x,s.y,b.x,D+b.y,E.x,E.y,i,P,k.x,k.y,I,C),pu(f,s.x,s.y,w.x,D+w.y,E.x+E.w,E.y,i,P,T.x,k.y,I,C),pu(f,s.x,s.y,S.x,D+S.y,E.x,E.y+E.h,i,P,k.x,T.y,I,C),pu(f,s.x,s.y,M.x,D+M.y,E.x+E.w,E.y+E.h,i,P,T.x,T.y,I,C),fu(t.dynamicLayoutVertexArray,s,v),p.emplaceBack(z,z+1,z+2),p.emplaceBack(z+1,z+2,z+3),d.vertexLength+=4,d.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(A[0]),_!==e.length-1&&L===e[_+1].sectionIndex||t.programConfigurations.populatePaintArrays(f.length,a,a.index,{},c,g&&g[L])}t.placedSymbolArray.emplaceBack(s.x,s.y,y,this.glyphOffsetArray.length-y,m,l,u,s.segment,i?i[0]:0,i?i[1]:0,r[0],r[1],o,0,!1,0,h)},vu.prototype._addCollisionDebugVertex=function(t,e,i,r,n,a){return e.emplaceBack(0,0),t.emplaceBack(i.x,i.y,r,n,Math.round(a.x),Math.round(a.y))},vu.prototype.addCollisionDebugVertices=function(t,e,i,r,a,o,s,l){var u=a.segments.prepareSegment(4,a.layoutVertexArray,a.indexArray),h=u.vertexLength,c=a.layoutVertexArray,p=a.collisionVertexArray,f=s.anchorX,d=s.anchorY;if(this._addCollisionDebugVertex(c,p,o,f,d,new n(t,e)),this._addCollisionDebugVertex(c,p,o,f,d,new n(i,e)),this._addCollisionDebugVertex(c,p,o,f,d,new n(i,r)),this._addCollisionDebugVertex(c,p,o,f,d,new n(t,r)),u.vertexLength+=4,l){var y=a.indexArray;y.emplaceBack(h,h+1,h+2),y.emplaceBack(h,h+2,h+3),u.primitiveLength+=2}else{var m=a.indexArray;m.emplaceBack(h,h+1),m.emplaceBack(h+1,h+2),m.emplaceBack(h+2,h+3),m.emplaceBack(h+3,h),u.primitiveLength+=4}},vu.prototype.addDebugCollisionBoxes=function(t,e,i,r){for(var n=t;n<e;n++){var a=this.collisionBoxArray.get(n),o=a.radius>0;this.addCollisionDebugVertices(a.x1,a.y1,a.x2,a.y2,o?r?this.textCollisionCircle:this.iconCollisionCircle:r?this.textCollisionBox:this.iconCollisionBox,a.anchorPoint,i,o)}},vu.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new mu(Wn,Zs.members,ea),this.iconCollisionBox=new mu(Wn,Zs.members,ea),this.textCollisionCircle=new mu(Wn,Xs.members,ta),this.iconCollisionCircle=new mu(Wn,Xs.members,ta);for(var t=0;t<this.symbolInstances.length;t++){var e=this.symbolInstances.get(t);this.addDebugCollisionBoxes(e.textBoxStartIndex,e.textBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.verticalTextBoxStartIndex,e.verticalTextBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.iconBoxStartIndex,e.iconBoxEndIndex,e,!1),this.addDebugCollisionBoxes(e.verticalIconBoxStartIndex,e.verticalIconBoxEndIndex,e,!1)}},vu.prototype._deserializeCollisionBoxesForSymbol=function(t,e,i,r,n,a,o,s,l){for(var u={},h=e;h<i;h++){var c=t.get(h);if(0===c.radius){u.textBox={x1:c.x1,y1:c.y1,x2:c.x2,y2:c.y2,anchorPointX:c.anchorPointX,anchorPointY:c.anchorPointY},u.textFeatureIndex=c.featureIndex;break}u.textCircles||(u.textCircles=[],u.textFeatureIndex=c.featureIndex),u.textCircles.push(c.anchorPointX,c.anchorPointY,c.radius,c.signedDistanceFromAnchor,1)}for(var p=r;p<n;p++){var f=t.get(p);if(0===f.radius){u.verticalTextBox={x1:f.x1,y1:f.y1,x2:f.x2,y2:f.y2,anchorPointX:f.anchorPointX,anchorPointY:f.anchorPointY},u.verticalTextFeatureIndex=f.featureIndex;break}}for(var d=a;d<o;d++){var y=t.get(d);if(0===y.radius){u.iconBox={x1:y.x1,y1:y.y1,x2:y.x2,y2:y.y2,anchorPointX:y.anchorPointX,anchorPointY:y.anchorPointY},u.iconFeatureIndex=y.featureIndex;break}}for(var m=s;m<l;m++){var v=t.get(m);if(0===v.radius){u.verticalIconBox={x1:v.x1,y1:v.y1,x2:v.x2,y2:v.y2,anchorPointX:v.anchorPointX,anchorPointY:v.anchorPointY},u.verticalIconFeatureIndex=v.featureIndex;break}}return u},vu.prototype.deserializeCollisionBoxes=function(t){this.collisionArrays=[];for(var e=0;e<this.symbolInstances.length;e++){var i=this.symbolInstances.get(e);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,i.textBoxStartIndex,i.textBoxEndIndex,i.verticalTextBoxStartIndex,i.verticalTextBoxEndIndex,i.iconBoxStartIndex,i.iconBoxEndIndex,i.verticalIconBoxStartIndex,i.verticalIconBoxEndIndex))}},vu.prototype.hasTextData=function(){return this.text.segments.get().length>0},vu.prototype.hasIconData=function(){return this.icon.segments.get().length>0},vu.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox&&this.textCollisionCircle&&this.iconCollisionCircle},vu.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},vu.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},vu.prototype.hasTextCollisionCircleData=function(){return this.hasDebugData()&&this.textCollisionCircle.segments.get().length>0},vu.prototype.hasIconCollisionCircleData=function(){return this.hasDebugData()&&this.iconCollisionCircle.segments.get().length>0},vu.prototype.addIndicesForPlacedSymbol=function(t,e){for(var i=t.placedSymbolArray.get(e),r=i.vertexStartIndex+4*i.numGlyphs,n=i.vertexStartIndex;n<r;n+=4)t.indexArray.emplaceBack(n,n+1,n+2),t.indexArray.emplaceBack(n+1,n+2,n+3)},vu.prototype.getSortedSymbolIndexes=function(t){if(this.sortedAngle===t&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;for(var e=Math.sin(t),i=Math.cos(t),r=[],n=[],a=[],o=0;o<this.symbolInstances.length;++o){a.push(o);var s=this.symbolInstances.get(o);r.push(0|Math.round(e*s.anchorX+i*s.anchorY)),n.push(s.featureIndex)}return a.sort(function(t,e){return r[t]-r[e]||n[e]-n[t]}),a},vu.prototype.addToSortKeyRanges=function(t,e){var i=this.sortKeyRanges[this.sortKeyRanges.length-1];i&&i.sortKey===e?i.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:e,symbolInstanceStart:t,symbolInstanceEnd:t+1})},vu.prototype.sortFeatures=function(t){var e=this;if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var i=0,r=this.symbolInstanceIndexes;i<r.length;i+=1){var n=this.symbolInstances.get(r[i]);this.featureSortOrder.push(n.featureIndex),[n.rightJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.leftJustifiedTextSymbolIndex].forEach(function(t,i,r){t>=0&&r.indexOf(t)===i&&e.addIndicesForPlacedSymbol(e.text,t)}),n.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,n.verticalPlacedTextSymbolIndex),n.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,n.placedIconSymbolIndex),n.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,n.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},Wr("SymbolBucket",vu,{omit:["layers","collisionBoxArray","features","compareText"]}),vu.MAX_GLYPHS=65535,vu.addDynamicAttributes=fu;var gu=new Pn({"symbol-placement":new kn(Ct.layout_symbol["symbol-placement"]),"symbol-spacing":new kn(Ct.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new kn(Ct.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Tn(Ct.layout_symbol["symbol-sort-key"]),"symbol-z-order":new kn(Ct.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new kn(Ct.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new kn(Ct.layout_symbol["icon-ignore-placement"]),"icon-optional":new kn(Ct.layout_symbol["icon-optional"]),"icon-rotation-alignment":new kn(Ct.layout_symbol["icon-rotation-alignment"]),"icon-size":new Tn(Ct.layout_symbol["icon-size"]),"icon-text-fit":new kn(Ct.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new kn(Ct.layout_symbol["icon-text-fit-padding"]),"icon-image":new Tn(Ct.layout_symbol["icon-image"]),"icon-rotate":new Tn(Ct.layout_symbol["icon-rotate"]),"icon-padding":new kn(Ct.layout_symbol["icon-padding"]),"icon-keep-upright":new kn(Ct.layout_symbol["icon-keep-upright"]),"icon-offset":new Tn(Ct.layout_symbol["icon-offset"]),"icon-anchor":new Tn(Ct.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new kn(Ct.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new kn(Ct.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new kn(Ct.layout_symbol["text-rotation-alignment"]),"text-field":new Tn(Ct.layout_symbol["text-field"]),"text-font":new Tn(Ct.layout_symbol["text-font"]),"text-size":new Tn(Ct.layout_symbol["text-size"]),"text-max-width":new Tn(Ct.layout_symbol["text-max-width"]),"text-line-height":new kn(Ct.layout_symbol["text-line-height"]),"text-letter-spacing":new Tn(Ct.layout_symbol["text-letter-spacing"]),"text-justify":new Tn(Ct.layout_symbol["text-justify"]),"text-radial-offset":new Tn(Ct.layout_symbol["text-radial-offset"]),"text-variable-anchor":new kn(Ct.layout_symbol["text-variable-anchor"]),"text-anchor":new Tn(Ct.layout_symbol["text-anchor"]),"text-max-angle":new kn(Ct.layout_symbol["text-max-angle"]),"text-writing-mode":new kn(Ct.layout_symbol["text-writing-mode"]),"text-rotate":new Tn(Ct.layout_symbol["text-rotate"]),"text-padding":new kn(Ct.layout_symbol["text-padding"]),"text-keep-upright":new kn(Ct.layout_symbol["text-keep-upright"]),"text-transform":new Tn(Ct.layout_symbol["text-transform"]),"text-offset":new Tn(Ct.layout_symbol["text-offset"]),"text-allow-overlap":new kn(Ct.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new kn(Ct.layout_symbol["text-ignore-placement"]),"text-optional":new kn(Ct.layout_symbol["text-optional"])}),_u={paint:new Pn({"icon-opacity":new Tn(Ct.paint_symbol["icon-opacity"]),"icon-color":new Tn(Ct.paint_symbol["icon-color"]),"icon-halo-color":new Tn(Ct.paint_symbol["icon-halo-color"]),"icon-halo-width":new Tn(Ct.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Tn(Ct.paint_symbol["icon-halo-blur"]),"icon-translate":new kn(Ct.paint_symbol["icon-translate"]),"icon-translate-anchor":new kn(Ct.paint_symbol["icon-translate-anchor"]),"text-opacity":new Tn(Ct.paint_symbol["text-opacity"]),"text-color":new Tn(Ct.paint_symbol["text-color"],{runtimeType:jt,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new Tn(Ct.paint_symbol["text-halo-color"]),"text-halo-width":new Tn(Ct.paint_symbol["text-halo-width"]),"text-halo-blur":new Tn(Ct.paint_symbol["text-halo-blur"]),"text-translate":new kn(Ct.paint_symbol["text-translate"]),"text-translate-anchor":new kn(Ct.paint_symbol["text-translate-anchor"])}),layout:gu},xu=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:Bt,this.defaultValue=t};xu.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},xu.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},xu.prototype.outputDefined=function(){return!1},xu.prototype.serialize=function(){return null},Wr("FormatSectionOverride",xu,{omit:["defaultValue"]});var bu=function(t){function e(e){t.call(this,e,_u)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.recalculate=function(e,i){if(t.prototype.recalculate.call(this,e,i),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"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 r=this.layout.get("text-writing-mode");if(r){for(var n=[],a=0,o=r;a<o.length;a+=1){var s=o[a];n.indexOf(s)<0&&n.push(s)}this.layout._values["text-writing-mode"]=n}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()},e.prototype.getValueAndResolveTokens=function(t,e,i,r){var n=this.layout.get(t).evaluate(e,{},i,r),a=this._unevaluatedLayout._values[t];return a.isDataDriven()||er(a.value)||!n?n:function(t,e){return n.replace(/{([^{}]+)}/g,function(e,i){return i in t?String(t[i]):""})}(e.properties)},e.prototype.createBucket=function(t){return new vu(t)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return!1},e.prototype._setPaintOverrides=function(){for(var t=0,i=_u.paint.overridableProperties;t<i.length;t+=1){var r=i[t];if(e.hasPaintOverride(this.layout,r)){var n,a=this.paint.get(r),o=new xu(a),s=new tr(o,a.property.specification);n="constant"===a.value.kind||"source"===a.value.kind?new rr("source",s):new nr("composite",s,a.value.zoomStops,a.value._interpolationType),this.paint._values[r]=new Mn(a.property,n,a.parameters)}}},e.prototype._handleOverridablePaintPropertyUpdate=function(t,i,r){return!(!this.layout||i.isDataDriven()||r.isDataDriven())&&e.hasPaintOverride(this.layout,t)},e.hasPaintOverride=function(t,e){var i=t.get("text-field"),r=_u.paint.properties[e],n=!1,a=function(t){for(var e=0,i=t;e<i.length;e+=1)if(r.overrides&&r.overrides.hasOverride(i[e]))return void(n=!0)};if("constant"===i.value.kind&&i.value.value instanceof ee)a(i.value.value.sections);else if("source"===i.value.kind){var o=function(t){n||(t instanceof se&&ae(t.value)===Zt?a(t.value.sections):t instanceof ce?a(t.sections):t.eachChild(o))},s=i.value;s._styleExpression&&o(s._styleExpression.expression)}return n},e}(Ln),wu={paint:new Pn({"background-color":new kn(Ct.paint_background["background-color"]),"background-pattern":new Cn(Ct.paint_background["background-pattern"]),"background-opacity":new kn(Ct.paint_background["background-opacity"])})},Su=function(t){function e(e){t.call(this,e,wu)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(Ln),Mu={paint:new Pn({"raster-opacity":new kn(Ct.paint_raster["raster-opacity"]),"raster-hue-rotate":new kn(Ct.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new kn(Ct.paint_raster["raster-brightness-min"]),"raster-brightness-max":new kn(Ct.paint_raster["raster-brightness-max"]),"raster-saturation":new kn(Ct.paint_raster["raster-saturation"]),"raster-contrast":new kn(Ct.paint_raster["raster-contrast"]),"raster-resampling":new kn(Ct.paint_raster["raster-resampling"]),"raster-fade-duration":new kn(Ct.paint_raster["raster-fade-duration"])})},Eu=function(t){function e(e){t.call(this,e,Mu)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(Ln),ku=function(t){function e(e){t.call(this,e,{}),this.implementation=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.is3D=function(){return"3d"===this.implementation.renderingMode},e.prototype.hasOffscreenPass=function(){return void 0!==this.implementation.prerender},e.prototype.recalculate=function(){},e.prototype.updateTransitions=function(){},e.prototype.hasTransition=function(){},e.prototype.serialize=function(){},e.prototype.onAdd=function(t){this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl)},e.prototype.onRemove=function(t){this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl)},e}(Ln),Tu={circle:fo,heatmap:Mo,hillshade:ko,fill:ps,"fill-extrusion":Cs,line:Us,symbol:bu,background:Su,raster:Eu},Iu=self.HTMLImageElement,Cu=self.HTMLCanvasElement,Au=self.HTMLVideoElement,Pu=self.ImageData,Lu=self.ImageBitmap,zu=function(t,e,i,r){this.context=t,this.format=i,this.texture=t.gl.createTexture(),this.update(e,r)};zu.prototype.update=function(t,e,i){var r=t.width,n=t.height,a=!(this.size&&this.size[0]===r&&this.size[1]===n||i),o=this.context,s=o.gl;if(this.useMipmap=Boolean(e&&e.useMipmap),s.bindTexture(s.TEXTURE_2D,this.texture),o.pixelStoreUnpackFlipY.set(!1),o.pixelStoreUnpack.set(1),o.pixelStoreUnpackPremultiplyAlpha.set(this.format===s.RGBA&&(!e||!1!==e.premultiply)),a)this.size=[r,n],t instanceof Iu||t instanceof Cu||t instanceof Au||t instanceof Pu||Lu&&t instanceof Lu?s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,s.UNSIGNED_BYTE,t):s.texImage2D(s.TEXTURE_2D,0,this.format,r,n,0,this.format,s.UNSIGNED_BYTE,t.data);else{var l=i||{x:0,y:0},u=l.x,h=l.y;t instanceof Iu||t instanceof Cu||t instanceof Au||t instanceof Pu||Lu&&t instanceof Lu?s.texSubImage2D(s.TEXTURE_2D,0,u,h,s.RGBA,s.UNSIGNED_BYTE,t):s.texSubImage2D(s.TEXTURE_2D,0,u,h,r,n,s.RGBA,s.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&s.generateMipmap(s.TEXTURE_2D)},zu.prototype.bind=function(t,e,i){var r=this.context.gl;r.bindTexture(r.TEXTURE_2D,this.texture),i!==r.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(i=r.LINEAR),t!==this.filter&&(r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,t),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,i||t),this.filter=t),e!==this.wrap&&(r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,e),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,e),this.wrap=e)},zu.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},zu.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null};var Du=function(t){var e=this;this._callback=t,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){e._triggered=!1,e._callback()})};Du.prototype.trigger=function(){var t=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(function(){t._triggered=!1,t._callback()},0))},Du.prototype.remove=function(){delete this._channel,this._callback=function(){}};var Ru=function(t,e,i){this.target=t,this.parent=e,this.mapId=i,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},m(["receive","process"],this),this.invoker=new Du(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=E()?t:self};function Ou(t,e,i){var r=2*Math.PI*6378137/256/Math.pow(2,i);return[t*r-2*Math.PI*6378137/2,e*r-2*Math.PI*6378137/2]}Ru.prototype.send=function(t,e,i,r,n){var a=this;void 0===n&&(n=!1);var o=Math.round(1e18*Math.random()).toString(36).substring(0,10);i&&(this.callbacks[o]=i);var s=I(this.globalScope)?void 0:[];return this.target.postMessage({id:o,type:t,hasCallback:!!i,targetMapId:r,mustQueue:n,sourceMapId:this.mapId,data:Yr(e,s)},s),{cancel:function(){i&&delete a.callbacks[o],a.target.postMessage({id:o,type:"<cancel>",targetMapId:r,sourceMapId:a.mapId})}}},Ru.prototype.receive=function(t){var e=t.data,i=e.id;if(i&&(!e.targetMapId||this.mapId===e.targetMapId))if("<cancel>"===e.type){delete this.tasks[i];var r=this.cancelCallbacks[i];delete this.cancelCallbacks[i],r&&r()}else E()||e.mustQueue?(this.tasks[i]=e,this.taskQueue.push(i),this.invoker.trigger()):this.processTask(i,e)},Ru.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)}},Ru.prototype.processTask=function(t,e){var i=this;if("<response>"===e.type){var r=this.callbacks[t];delete this.callbacks[t],r&&(e.error?r(Qr(e.error)):r(null,Qr(e.data)))}else{var n=!1,a=I(this.globalScope)?void 0:[],o=e.hasCallback?function(e,r){n=!0,delete i.cancelCallbacks[t],i.target.postMessage({id:t,type:"<response>",sourceMapId:i.mapId,error:e?Yr(e):null,data:Yr(r,a)},a)}:function(t){n=!0},s=null,l=Qr(e.data);if(this.parent[e.type])s=this.parent[e.type](e.sourceMapId,l,o);else if(this.parent.getWorkerSource){var u=e.type.split(".");s=this.parent.getWorkerSource(e.sourceMapId,u[0],l.source)[u[1]](l,o)}else o(new Error("Could not find function "+e.type));!n&&s&&s.cancel&&(this.cancelCallbacks[t]=s.cancel)}},Ru.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var Bu=function(t,e,i){this.z=t,this.x=e,this.y=i,this.key=Uu(0,t,t,e,i),this.z_replace=void 0,this.x_replace=void 0,this.y_replace=void 0};Bu.prototype.offsetZ=function(t){t&&(this.z+=t)},Bu.prototype.replaceX=function(t){this.x_replace=t},Bu.prototype.replaceY=function(t){this.y_replace=t},Bu.prototype.replaceZ=function(t){this.z_replace=t},Bu.prototype.format=function(t,e){var i=t.length;if(i>=e)t=t.substring(i-e,i);else{for(var r="",n=0;n<e;n++)r+="0";t=r.substring(0,r.length-i)+t}return t},Bu.prototype.replaceRule=function(t,e){var i=t.fixlength,r=t.prefix,n=t.postfix,a=e;switch(t.type){case"hex":a=e.toString(16).toUpperCase();break;case"dec":a=e.toString(10).toUpperCase();break;case"oct":a=e.toString(8).toUpperCase();break;case"bin":a=e.toString(2).toUpperCase()}return i&&(a=this.format(a,i)),r&&(a=r+a),n&&(a+=n),a},Bu.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},Bu.prototype._getBBox=function(t,e){var i=this.getTileBBox(this.x,this.y,this.z,e);if(t){var r=i.split(",");i=r[1]+","+r[0]+","+r[3]+","+r[2]}return i},Bu.prototype.url=function(t,e,i){var r=this.x_replace,n=this.y_replace,a=this.z_replace,o=t[Math.abs(this.x+this.y)%t.length],s=o.indexOf("reversebbox=true")>=0,l=this.getTileBBox(this.x,this.y,this.z,i);if(s){var u=l.split(",");l=u[1]+","+u[0]+","+u[3]+","+u[2],console.warn("reverse",l)}var h=function(t,e,i){for(var r,n="",a=t;a>0;a--)n+=(e&(r=1<<a-1)?1:0)+(i&r?2:0);return n}(this.z,this.x,this.y),c=this.z,p=this.x,f=this.y;return(r||n||a)&&(a&&(c=this.replaceRule(a,this.z)),r&&(p=this.replaceRule(r,this.x)),n&&(f=this.replaceRule(n,this.y))),o.replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(c)).replace("{x}",String(p)).replace("{y}",String("tms"===e?-this.y-1:f)).replace("{quadkey}",h).replace("{bbox}",l)},Bu.prototype.getTilePoint=function(t){var e=Math.pow(2,this.z);return new n(8192*(t.x*e-this.x),8192*(t.y*e-this.y))},Bu.prototype.getCRS=function(){return Ee.EPSG3857},Bu.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y},Bu.prototype.getTileBBox=function(t,e,i,r){if(r){var n,a=r.originX,o=r.originY,s=r.tileSize;return(n=s<0?Math.max(r.width,r.height)/Math.pow(2,this.z):r.getResolution(this.z,s)*s)*t+a+","+(o-n*(e+1))+","+(n*(t+1)+a)+","+(o-n*e)}return function(t,e,i){var r=Ou(256*t,256*(e=Math.pow(2,i)-e-1),i),n=Ou(256*(t+1),256*(e+1),i);return r[0]+","+r[1]+","+n[0]+","+n[1]}(t,e,i)};var Fu=function(t,e){this.wrap=t,this.canonical=e,this.key=Uu(t,e.z,e.z,e.x,e.y)},Vu=function(t,e,i,r,n){this.overscaledZ=t,this.wrap=e,this.canonical=new Bu(i,+r,+n),this.key=Uu(e,t,i,r,n)};function Uu(t,e,i,r,n){(t*=2)<0&&(t=-1*t-1);var a=1<<i;return(a*a*t+a*n+r).toString(36)+r.toString(36)+n.toString(36)+i.toString(36)+e.toString(36)}function ju(t,e,i){var r=function(r,n){if(r)return i(r);if(n){var a=c(h(n,t),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);n.vector_layers&&(a.vectorLayers=n.vector_layers,a.vectorLayerIds=a.vectorLayers.map(function(t){return t.id})),a.tiles=e.canonicalizeTileset(a,t.url),i(null,a)}};return t.url?xt(e.transformRequest(e.normalizeSourceURL(t.url),dt.Source),r):B.frame(function(){return r(null,t)})}Vu.prototype.equals=function(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)},Vu.prototype.scaledTo=function(t){var e=this.canonical.z-t;return t>this.canonical.z?new Vu(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Vu(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},Vu.prototype.calculateScaledKey=function(t,e){var i=this.canonical.z-t;return t>this.canonical.z?Uu(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):Uu(this.wrap*+e,t,t,this.canonical.x>>i,this.canonical.y>>i)},Vu.prototype.isChildOf=function(t){if(t.wrap!==this.wrap)return!1;var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ<this.overscaledZ&&t.canonical.x===this.canonical.x>>e&&t.canonical.y===this.canonical.y>>e},Vu.prototype.children=function(t){if(this.overscaledZ>=t)return[new Vu(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,i=2*this.canonical.x,r=2*this.canonical.y;return[new Vu(e,this.wrap,e,i,r),new Vu(e,this.wrap,e,i+1,r),new Vu(e,this.wrap,e,i,r+1),new Vu(e,this.wrap,e,i+1,r+1)]},Vu.prototype.isLessThan=function(t){return this.wrap<t.wrap||!(this.wrap>t.wrap)&&(this.overscaledZ<t.overscaledZ||!(this.overscaledZ>t.overscaledZ)&&(this.canonical.x<t.canonical.x||!(this.canonical.x>t.canonical.x)&&this.canonical.y<t.canonical.y))},Vu.prototype.wrapped=function(){return new Vu(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},Vu.prototype.unwrapTo=function(t){return new Vu(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)},Vu.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},Vu.prototype.toUnwrapped=function(){return new Fu(this.wrap,this.canonical)},Vu.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},Vu.prototype.getTilePoint=function(t){return this.canonical.getTilePoint(new ze(t.x-this.wrap,t.y))},Wr("CanonicalTileID",Bu),Wr("OverscaledTileID",Vu,{omit:["posMatrix"]});var Nu=function(t,e,i){this.bounds=_e.convert(this.validateBounds(t)),this.minzoom=e||0,this.maxzoom=i||24};Nu.prototype.validateBounds=function(t){return Array.isArray(t)&&4===t.length?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]},Nu.prototype.contains=function(t){var e;if(t.crsParams){var i=t.getCRS(),r=i.getExtent(),n=i.getCoordsInfo(r),a=n.width,o=n.height,s=n.originX,l=n.originY,u=Math.pow(2,t.z);e={minX:Math.floor((this.bounds.getWest()-s)*u/a),minY:Math.floor((l-this.bounds.getNorth())*u/o),maxX:Math.ceil((this.bounds.getEast()-s)*u/a),maxY:Math.ceil((l-this.bounds.getSouth())*u/o)}}else{var h=Math.pow(2,t.z);e={minX:Math.floor(Ce(this.bounds.getWest())*h),minY:Math.floor(Ae(this.bounds.getNorth())*h),maxX:Math.ceil(Ce(this.bounds.getEast())*h),maxY:Math.ceil(Ae(this.bounds.getSouth())*h)}}return t.x>=e.minX&&t.x<e.maxX&&t.y>=e.minY&&t.y<e.maxY};var qu=function(t){var e=t||{};if(this.uploaded=!1,this.layoutVertexArray=new ra,this.indexArray=new ta,this.segments=new ma,this.crs=e.crs,!this.crs)throw new Error("缺少crs参数")};qu.prototype.destroy=function(){this.layoutVertexArray.resize(0),this.indexArray.resize(0),this.layoutVertexBuffer&&this.layoutVertexBuffer.destroy(),this.indexBuffer&&this.indexBuffer.destroy(),this.segments.destroy(),this.uploaded=!1},qu.prototype.upload=function(t,e){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,e),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.uploaded=!0},qu.prototype.addPolygonCoordinates=function(t){for(var e=0,i=as(t,500);e<i.length;e+=1){for(var r=i[e],n=0,a=0,o=r;a<o.length;a+=1)n+=o[a].length;for(var s=this.segments.prepareSegment(n,this.layoutVertexArray,this.indexArray),l=s.vertexLength,u=[],h=[],c=0,p=r;c<p.length;c+=1){var f=p[c];if(0!==f.length){f!==r[0]&&h.push(u.length/2);var d=ze.fromLngLat({lng:f[0][0],lat:f[0][1]},0,this.crs);this.layoutVertexArray.emplaceBack(d.x,d.y),u.push(d.x),u.push(d.y);for(var y=1;y<f.length;y++){var m=ze.fromLngLat({lng:f[y][0],lat:f[y][1]},0,this.crs);this.layoutVertexArray.emplaceBack(m.x,m.y),u.push(m.x),u.push(m.y)}}}for(var v=Io(u,h),g=0;g<v.length;g+=3)this.indexArray.emplaceBack(l+v[g],l+v[g+1],l+v[g+2]);s.vertexLength+=n,s.primitiveLength+=v.length/3}};var Gu=function(t){function e(){t.call(this)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.load=function(){},e.prototype.onAdd=function(t){this.map=t,this.load();var e=this._options||this.options;e&&this.setClippingArea(e.clippingArea)},e.prototype.setClippingArea=function(t){(function(t){var e=this;if(t){var i=t;"Feature"==t.type&&t.geometry&&(i=t.geometry);var r=i.type;if("MultiPolygon"!==r&&"Polygon"!==r)throw new Error("不支持传入区或多区之外的裁剪几何对象");this._clippingFeature&&this._clippingFeature.destroy(),this._clippingFeature=new qu({crs:this.crs}),"MultiPolygon"===i.type?i.coordinates.forEach(function(t){e._clippingFeature.addPolygonCoordinates(t)}):this._clippingFeature.addPolygonCoordinates(i.coordinates)}else this._clippingFeature&&this._clippingFeature.destroy(),this._clippingFeature=null}).call(this,t),this.map._update()},e.prototype.getClippingArea=function(){return this._clippingFeature},e}(It),Zu=function(t){function e(e,i,r,n){t.call(this),this.id=e,this.dispatcher=r,this.crs=n.crs,this.setEventedParent(n),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=h({type:"raster"},i),h(this,c(i,["url","scheme","tileSize"]))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.load=function(){var t=this;this._loaded=!1,this.fire(new kt("dataloading",{dataType:"source"})),this._tileJSONRequest=ju(this._options,this.map._requestManager,function(e,i){t._tileJSONRequest=null,t._loaded=!0,e?t.fire(new Tt(e)):i&&(h(t,i),i.bounds&&(t.tileBounds=new Nu(i.bounds,t.minzoom,t.maxzoom)),rt(i.tiles),at(i.tiles,t.map._getMapId(),t.map._requestManager._skuToken),t.fire(new kt("data",{dataType:"source",sourceDataType:"metadata"})),t.fire(new kt("data",{dataType:"source",sourceDataType:"content"})))})},e.prototype.loaded=function(){return this._loaded},e.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},e.prototype.serialize=function(){return h({},this._options)},e.prototype.hasTile=function(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)},e.prototype.loadTile=function(t,e){var i=this,r=this._options.tileUrlReplace;r&&r.length>=3&&(t.tileID.canonical.replaceX(r[0]),t.tileID.canonical.replaceY(r[1]),t.tileID.canonical.replaceZ(r[2]));var n,a=this._options&&this._options.requestParams?this._options.requestParams:{};if(a&&"POST"===a.method){var o=(n=this.map._requestManager.normalizeTileURL(this.tiles,this.tileSize)).indexOf("reversebbox=true")>=0;a.data.bbox=t.tileID.canonical._getBBox(o,this.crs)}else n=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme,this.crs),this.tileSize);t.request=St(this.map._requestManager.transformRequest(n,dt.Tile,a),function(r,n){if(delete t.request,t.aborted)t.state="unloaded",e(null);else if(r)t.state="errored",e(r);else if(n){i.map._refreshExpiredTiles&&t.setExpiryData(n),delete n.cacheControl,delete n.expires;var a=i.map.painter.context,o=a.gl;t.texture=i.map.painter.getTileTexture(n.width),t.texture?t.texture.update(n,{useMipmap:!0}):(t.texture=new zu(a,n,o.RGBA,{useMipmap:!0}),t.texture.bind(o.LINEAR,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST),a.extTextureFilterAnisotropic&&o.texParameterf(o.TEXTURE_2D,a.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,a.extTextureFilterAnisotropicMax)),t.state="loaded",pt(i.dispatcher),e(null)}})},e.prototype.abortTile=function(t,e){t.request&&(t.request.cancel(),delete t.request),e()},e.prototype.unloadTile=function(t,e){t.texture&&this.map.painter.saveTileTexture(t.texture),e()},e.prototype.hasTransition=function(){return!1},e}(Gu),Xu=function(t,e,i){if(this.uid=t,e.height!==e.width)throw new RangeError("DEM tiles must be square");if(i&&"mapbox"!==i&&"terrarium"!==i)return w('"'+i+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');this.stride=e.height;var r=this.dim=e.height-2;this.data=new Uint32Array(e.data.buffer),this.encoding=i||"mapbox";for(var n=0;n<r;n++)this.data[this._idx(-1,n)]=this.data[this._idx(0,n)],this.data[this._idx(r,n)]=this.data[this._idx(r-1,n)],this.data[this._idx(n,-1)]=this.data[this._idx(n,0)],this.data[this._idx(n,r)]=this.data[this._idx(n,r-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(r,-1)]=this.data[this._idx(r-1,0)],this.data[this._idx(-1,r)]=this.data[this._idx(0,r-1)],this.data[this._idx(r,r)]=this.data[this._idx(r-1,r-1)]};Xu.prototype.get=function(t,e){var i=new Uint8Array(this.data.buffer),r=4*this._idx(t,e);return("terrarium"===this.encoding?this._unpackTerrarium:this._unpackMapbox)(i[r],i[r+1],i[r+2])},Xu.prototype.getUnpackVector=function(){return"terrarium"===this.encoding?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},Xu.prototype._idx=function(t,e){if(t<-1||t>=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)},Xu.prototype._unpackMapbox=function(t,e,i){return(256*t*256+256*e+i)/10-1e4},Xu.prototype._unpackTerrarium=function(t,e,i){return 256*t+e+i/256-32768},Xu.prototype.getPixels=function(){return new bo({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Xu.prototype.backfillBorder=function(t,e,i){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var r=e*this.dim,n=e*this.dim+this.dim,a=i*this.dim,o=i*this.dim+this.dim;switch(e){case-1:r=n-1;break;case 1:n=r+1}switch(i){case-1:a=o-1;break;case 1:o=a+1}for(var s=-e*this.dim,l=-i*this.dim,u=a;u<o;u++)for(var h=r;h<n;h++)this.data[this._idx(h,u)]=t.data[this._idx(h+s,u+l)]},Wr("DEMData",Xu);var Wu=function(t){this._stringToNumber={},this._numberToString=[];for(var e=0;e<t.length;e++){var i=t[e];this._stringToNumber[i]=e,this._numberToString[e]=i}};Wu.prototype.encode=function(t){return this._stringToNumber[t]},Wu.prototype.decode=function(t){return this._numberToString[t]};var Ku=function(t,e,i,r,n,a){this.epsg=a||"EPSG:3857",this.type="Feature",this._vectorTileFeature=t,t._z=e,t._x=i,t._y=r,this.properties=t.properties,this.id=n},Hu={geometry:{configurable:!0}};Hu.geometry.get=function(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z,this.epsg).geometry),this._geometry},Hu.geometry.set=function(t){this._geometry=t},Ku.prototype.toJSON=function(){var t={geometry:this.geometry};for(var e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&(t[e]=this[e]);return t},Object.defineProperties(Ku.prototype,Hu);var Ju=function(){this.state={},this.stateChanges={},this.deletedStates={}};Ju.prototype.updateState=function(t,e,i){var r=String(e);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][r]=this.stateChanges[t][r]||{},h(this.stateChanges[t][r],i),null===this.deletedStates[t])for(var n in this.deletedStates[t]={},this.state[t])n!==r&&(this.deletedStates[t][n]=null);else if(this.deletedStates[t]&&null===this.deletedStates[t][r])for(var a in this.deletedStates[t][r]={},this.state[t][r])i[a]||(this.deletedStates[t][r][a]=null);else for(var o in i)this.deletedStates[t]&&this.deletedStates[t][r]&&null===this.deletedStates[t][r][o]&&delete this.deletedStates[t][r][o]},Ju.prototype.removeFeatureState=function(t,e,i){if(null!==this.deletedStates[t]){var r=String(e);if(this.deletedStates[t]=this.deletedStates[t]||{},i&&void 0!==e)null!==this.deletedStates[t][r]&&(this.deletedStates[t][r]=this.deletedStates[t][r]||{},this.deletedStates[t][r][i]=null);else if(void 0!==e)if(this.stateChanges[t]&&this.stateChanges[t][r])for(i in this.deletedStates[t][r]={},this.stateChanges[t][r])this.deletedStates[t][r][i]=null;else this.deletedStates[t][r]=null;else this.deletedStates[t]=null}},Ju.prototype.getState=function(t,e){var i=String(e),r=h({},(this.state[t]||{})[i],(this.stateChanges[t]||{})[i]);if(null===this.deletedStates[t])return{};if(this.deletedStates[t]){var n=this.deletedStates[t][e];if(null===n)return{};for(var a in n)delete r[a]}return r},Ju.prototype.initializeTileState=function(t,e){t.setFeatureState(this.state,e)},Ju.prototype.coalesceChanges=function(t,e){var i={};for(var r in this.stateChanges){this.state[r]=this.state[r]||{};var n={};for(var a in this.stateChanges[r])this.state[r][a]||(this.state[r][a]={}),h(this.state[r][a],this.stateChanges[r][a]),n[a]=this.state[r][a];i[r]=n}for(var o in this.deletedStates){this.state[o]=this.state[o]||{};var s={};if(null===this.deletedStates[o])for(var l in this.state[o])s[l]={},this.state[o][l]={};else for(var u in this.deletedStates[o]){if(null===this.deletedStates[o][u])this.state[o][u]={};else for(var c=0,p=Object.keys(this.deletedStates[o][u]);c<p.length;c+=1)delete this.state[o][u][p[c]];s[u]=this.state[o][u]}i[o]=i[o]||{},h(i[o],s)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(i).length)for(var f in t)t[f].setFeatureState(i,e)};var Yu=function(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new Nr(8192,16,0),this.grid3D=new Nr(8192,16,0),this.featureIndexArray=new da,this.promoteId=e};function Qu(t,e,i,r,n){return g(t,function(t,a){var o=e instanceof En?e.get(a):null;return o&&o.evaluate?o.evaluate(i,r,n):o})}function $u(t){for(var e=1/0,i=1/0,r=-1/0,n=-1/0,a=0,o=t;a<o.length;a+=1){var s=o[a];e=Math.min(e,s.x),i=Math.min(i,s.y),r=Math.max(r,s.x),n=Math.max(n,s.y)}return{minX:e,minY:i,maxX:r,maxY:n}}function th(t,e){return e-t}Yu.prototype.insert=function(t,e,i,r,n,a){var o=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(i,r,n);for(var s=a?this.grid3D:this.grid,l=0;l<e.length;l++){for(var u=e[l],h=[1/0,1/0,-1/0,-1/0],c=0;c<u.length;c++){var p=u[c];h[0]=Math.min(h[0],p.x),h[1]=Math.min(h[1],p.y),h[2]=Math.max(h[2],p.x),h[3]=Math.max(h[3],p.y)}h[0]<8192&&h[1]<8192&&h[2]>=0&&h[3]>=0&&s.insert(o,h[0],h[1],h[2],h[3])}},Yu.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new ws.VectorTile(new Ys(this.rawTileData)).layers,this.sourceLayerCoder=new Wu(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Yu.prototype.query=function(t,e,i,r){var a=this;this.loadVTLayers();for(var o=t.params||{},s=8192/t.tileSize/t.scale,l=yr(o.filter),u=t.queryGeometry,h=t.queryPadding*s,c=$u(u),p=this.grid.query(c.minX-h,c.minY-h,c.maxX+h,c.maxY+h),f=$u(t.cameraQueryGeometry),d=0,y=this.grid3D.query(f.minX-h,f.minY-h,f.maxX+h,f.maxY+h,function(e,i,r,a){return function(t,e,i,r,a){for(var o=0,s=t;o<s.length;o+=1){var l=s[o];if(e<=l.x&&i<=l.y&&r>=l.x&&a>=l.y)return!0}var u=[new n(e,i),new n(e,a),new n(r,a),new n(r,i)];if(t.length>2)for(var h=0,c=u;h<c.length;h+=1)if(ro(t,c[h]))return!0;for(var p=0;p<t.length-1;p++)if(no(t[p],t[p+1],u))return!0;return!1}(t.cameraQueryGeometry,e-h,i-h,r+h,a+h)});d<y.length;d+=1)p.push(y[d]);p.sort(th);for(var m,v={},g=function(n){var h=p[n];if(h!==m){m=h;var c=a.featureIndexArray.get(h),f=null;a.loadMatchingFeature(v,c.bucketIndex,c.sourceLayerIndex,c.featureIndex,l,o.layers,o.availableImages,e,i,r,function(e,i,r){return f||(f=Za(e)),i.queryIntersectsFeature(u,e,r,f,a.z,t.transform,s,t.pixelPosMatrix)})}},_=0;_<p.length;_++)g(_);return v},Yu.prototype.loadMatchingFeature=function(t,e,i,r,n,a,o,s,l,u,h){var c=this.bucketLayerIDs[e];if(!a||function(t,e){for(var i=0;i<t.length;i++)if(e.indexOf(t[i])>=0)return!0;return!1}(a,c)){var p=this.sourceLayerCoder.decode(i),f=this.vtLayers[p].feature(r);if(n.filter(new vn(this.tileID.overscaledZ),f))for(var d=this.getId(f,p),y=new Bu(0,0,0),m=0;m<c.length;m++){var v=c[m];if(!(a&&a.indexOf(v)<0)){var g=s[v];if(g){var _={};void 0!==d&&u&&(_=u.getState(g.sourceLayer||"_geojsonTileLayer",d));var x=l[v];x.paint=Qu(x.paint,g.paint,f,_,o),x.layout=Qu(x.layout,g.layout,f,_,o);var b=!h||h(f,g,_);if(b){var w=new Ku(f,this.z,this.x,this.y,d,y.getCRS().getEpsgCode());w.layer=x;var S=t[v];void 0===S&&(S=t[v]=[]),S.push({featureIndex:r,feature:w,intersectionZ:b})}}}}}},Yu.prototype.lookupSymbolFeatures=function(t,e,i,r,n,a,o,s){var l={};this.loadVTLayers();for(var u=yr(n),h=0,c=t;h<c.length;h+=1)this.loadMatchingFeature(l,i,r,c[h],u,a,o,s,e);return l},Yu.prototype.hasLayer=function(t){for(var e=0,i=this.bucketLayerIDs;e<i.length;e+=1)for(var r=0,n=i[e];r<n.length;r+=1)if(t===n[r])return!0;return!1},Yu.prototype.getId=function(t,e){var i=t.id;return this.promoteId&&"boolean"==typeof(i=t.properties["string"==typeof this.promoteId?this.promoteId:this.promoteId[e]])&&(i=Number(i)),i},Wr("FeatureIndex",Yu,{omit:["rawTileData","sourceLayerCoder"]});var eh=function(t,e){this.tileID=t,this.uid=f(),this.uses=0,this.tileSize=e,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.expiredRequestCount=0,this.state="loading"};eh.prototype.registerFadeDuration=function(t){var e=t+this.timeAdded;e<B.now()||this.fadeEndTime&&e<this.fadeEndTime||(this.fadeEndTime=e)},eh.prototype.wasRequested=function(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state},eh.prototype.loadVectorData=function(t,e,i){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){for(var r in t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestFeatureIndex.rawTileData=t.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=function(t,e){var i={};if(!e)return i;for(var r=function(){var t=a[n],r=t.layerIds.map(function(t){return e.getLayer(t)}).filter(Boolean);if(0!==r.length){t.layers=r,t.stateDependentLayerIds&&(t.stateDependentLayers=t.stateDependentLayerIds.map(function(t){return r.filter(function(e){return e.id===t})[0]}));for(var o=0,s=r;o<s.length;o+=1)i[s[o].id]=t}},n=0,a=t;n<a.length;n+=1)r();return i}(t.buckets,e.style),this.hasSymbolBuckets=!1,this.buckets){var n=this.buckets[r];if(n instanceof vu){if(this.hasSymbolBuckets=!0,!i)break;n.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(var a in this.buckets){var o=this.buckets[a];if(o instanceof vu&&o.hasRTLText){this.hasRTLText=!0,mn.isLoading()||mn.isLoaded()||"deferred"!==dn()||yn();break}}for(var s in this.queryPadding=0,this.buckets){var l=this.buckets[s];this.queryPadding=Math.max(this.queryPadding,e.style.getLayer(s).queryRadius(l))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new oa},eh.prototype.unloadVectorData=function(){for(var t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"},eh.prototype.getBucket=function(t){return this.buckets[t.id]},eh.prototype.upload=function(t){for(var e in this.buckets){var i=this.buckets[e];i.uploadPending()&&i.upload(t)}var r=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new zu(t,this.imageAtlas.image,r.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new zu(t,this.glyphAtlasImage,r.ALPHA),this.glyphAtlasImage=null)},eh.prototype.prepare=function(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)},eh.prototype.queryRenderedFeatures=function(t,e,i,r,n,a,o,s,l,u){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:r,cameraQueryGeometry:n,scale:a,tileSize:this.tileSize,pixelPosMatrix:u,transform:s,params:o,queryPadding:this.queryPadding*l},t,e,i):{}},eh.prototype.querySourceFeatures=function(t,e){var i=this.latestFeatureIndex;if(i&&i.rawTileData){var r=i.loadVTLayers(),n=e?e.sourceLayer:"",a=r._geojsonTileLayer||r[n];if(a)for(var o=yr(e&&e.filter),s=this.tileID.canonical,l=s.z,u=s.x,h=s.y,c={z:l,x:u,y:h},p=0;p<a.length;p++){var f=a.feature(p);if(o.filter(new vn(this.tileID.overscaledZ),f)){var d=i.getId(f,n),y=new Ku(f,l,u,h,d);y.tile=c,t.push(y)}}}},eh.prototype.hasData=function(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state},eh.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},eh.prototype.setExpiryData=function(t){var e=this.expirationTime;if(t.cacheControl){var i=k(t.cacheControl);i["max-age"]&&(this.expirationTime=Date.now()+1e3*i["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){var r=Date.now(),n=!1;if(this.expirationTime>r)n=!1;else if(e)if(this.expirationTime<e)n=!0;else{var a=this.expirationTime-e;a?this.expirationTime=r+Math.max(a,3e4):n=!0}else n=!0;n?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}},eh.prototype.getExpiryTimeout=function(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-(new Date).getTime(),Math.pow(2,31)-1)},eh.prototype.setFeatureState=function(t,e){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData&&0!==Object.keys(t).length){var i=this.latestFeatureIndex.loadVTLayers();for(var r in this.buckets)if(e.style.hasLayer(r)){var n=this.buckets[r],a=n.layers[0].sourceLayer||"_geojsonTileLayer",o=i[a],s=t[a];if(o&&s&&0!==Object.keys(s).length){n.update(s,o,this.imageAtlas&&this.imageAtlas.patternPositions||{});var l=e&&e.style&&e.style.getLayer(r);l&&l.paint&&(this.queryPadding=Math.max(this.queryPadding,l.queryRadius(n)))}}}},eh.prototype.holdingForFade=function(){return void 0!==this.symbolFadeHoldUntil},eh.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<B.now()},eh.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},eh.prototype.setHoldDuration=function(t){this.symbolFadeHoldUntil=B.now()+t},eh.prototype.setDependencies=function(t,e){for(var i={},r=0,n=e;r<n.length;r+=1)i[n[r]]=!0;this.dependencies[t]=i},eh.prototype.hasDependency=function(t,e){for(var i=0,r=t;i<r.length;i+=1){var n=this.dependencies[r[i]];if(n)for(var a=0,o=e;a<o.length;a+=1)if(n[o[a]])return!0}return!1};var ih=self.performance,rh=function(t){this._marks={start:[t.url,"start"].join("#"),end:[t.url,"end"].join("#"),measure:t.url.toString()},ih.mark(this._marks.start)};rh.prototype.finish=function(){ih.mark(this._marks.end);var t=ih.getEntriesByName(this._marks.measure);return 0===t.length&&(ih.measure(this._marks.measure,this._marks.start,this._marks.end),t=ih.getEntriesByName(this._marks.measure),ih.clearMarks(this._marks.start),ih.clearMarks(this._marks.end),ih.clearMeasures(this._marks.measure)),t};var nh=function(){};nh.openDatabase=function(t){var e=t.split("/").slice(-1)[0],i=this;return console.log("openDatabase",self),"sqlitePlugin"in self?"device"in self?new Promise(function(t,e){"Android"===device.platform?resolveLocalFileSystemURL(cordova.file.applicationStorageDirectory,function(e){e.getDirectory("databases",{create:!0},function(e){t(e)})},e):"iOS"===device.platform?resolveLocalFileSystemURL(cordova.file.documentsDirectory,t,e):e("Platform not supported")}).then(function(r){return new Promise(function(t,i){r.getFile(e,{},t,i)}).catch(function(){return i.copyDatabaseFile(t,e,r)})}).then(function(){var t={name:e};return"iOS"===device.platform?t.iosDatabaseLocation="Documents":t.location="default",sqlitePlugin.openDatabase(t)}):Promise.reject(new Error("cordova-plugin-device not available. Please install the plugin and make sure this code is run after onDeviceReady event")):Promise.reject(new Error("cordova-sqlite-ext plugin not available. Please install the plugin and make sure this code is run after onDeviceReady event"))},nh.copyDatabaseFile=function(t,e,i){return console.log("Copying database to application storage directory"),new Promise(function(e,i){var r=cordova.file.externalRootDirectory+"/"+t;resolveLocalFileSystemURL(r,e,i)}).then(function(t){return new Promise(function(r,n){t.copyTo(i,e,r,n)}).then(function(){console.log("Database copied")})})};var ah=function(t){function e(e,i,r,n){t.call(this,e,i,r,n),this.id=e,this.dispatcher=r,this.setEventedParent(n),this.type="rasteroffline",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this.imageFormat="png",this._loaded=!1,this._options=h({},i),h(this,c(i,["scheme","tileSize","imageFormat"])),this._transparentPngUrl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=",this.db=this.openDatabase(i.path)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.openDatabase=function(t){return nh.openDatabase(t)},e.prototype.copyDatabaseFile=function(t,e,i){return nh.copyDatabaseFile(t,e,i)},e.prototype.loadTile=function(t,e){t.request=this._getImage(t.tileID.canonical,function(i,r){if(delete t.request,t.aborted)t.state="unloaded",e(null);else if(i)t.state="errored",e(i);else if(r){this.map._refreshExpiredTiles&&t.setExpiryData(r),delete r.cacheControl,delete r.expires;var n=this.map.painter.context,a=n.gl;t.texture=this.map.painter.getTileTexture(r.width),t.texture?t.texture.update(r,{useMipmap:!0}):(t.texture=new zu(n,r,a.RGBA,{useMipmap:!0}),t.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),n.extTextureFilterAnisotropic&&a.texParameterf(a.TEXTURE_2D,n.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,n.extTextureFilterAnisotropicMax)),t.state="loaded",e(null)}}.bind(this))},e.prototype._getBlob=function(t,e){var i=this,r=Math.pow(2,t.z)-1-t.y,n=[t.z,t.x,r],a="data:image/"+this.imageFormat+";base64,";this.db.then(function(t){t.transaction(function(t){t.executeSql("SELECT BASE64(tile_data) AS base64_tile_data FROM tiles WHERE zoom_level = ? AND tile_column = ? AND tile_row = ?",n,function(t,r){r.rows.length?e(void 0,{data:a+r.rows.item(0).base64_tile_data,cacheControl:null,expires:null}):(console.error("tile "+n.join(",")+" not found"),e(void 0,{data:i._transparentPngUrl,cacheControl:null,expires:null}))})},function(t){e(t)})}).catch(function(t){e(t)})},e.prototype._getImage=function(t,e){return this._getBlob(t,function(t,i){if(t)return e(t);var r=new window.Image,n=window.URL||window.webkitURL;r.onload=function(){e(null,r),n.revokeObjectURL(r.src)},r.cacheControl=i.cacheControl,r.expires=i.expires,r.src=i.data})},e}(Zu);t.Actor=Ru,t.AlphaImage=xo,t.CRS=Ee,t.CanonicalTileID=Bu,t.CollisionBoxArray=oa,t.Color=Qt,t.DEMData=Xu,t.DataConstantProperty=kn,t.Database=nh,t.DictionaryCoder=Wu,t.EXTENT=8192,t.ErrorEvent=Tt,t.EvaluationParameters=vn,t.Event=kt,t.Evented=It,t.FeatureIndex=Yu,t.FillBucket=us,t.FillExtrusionBucket=ks,t.GeoJSONFeature=Ku,t.ImageAtlas=bl,t.ImagePosition=_l,t.LineBucket=Os,t.LngLat=xe,t.LngLatBounds=_e,t.MercatorCoordinate=ze,t.ONE_EM=24,t.OverscaledTileID=Vu,t.Point=n,t.Point$1=n,t.Projection=be,t.Properties=Pn,t.Protobuf=Ys,t.RGBAImage=bo,t.RasterTileSource=Zu,t.RasterTileSourceOffline=ah,t.RequestManager=G,t.RequestPerformance=rh,t.ResourceType=dt,t.SegmentVector=ma,t.SourceEnhance=Gu,t.SourceFeatureState=Ju,t.StructArrayLayout1ui2=ia,t.StructArrayLayout2i4=Fn,t.StructArrayLayout3ui6=ta,t.StructArrayLayout4i8=Vn,t.SymbolBucket=vu,t.Texture=zu,t.Tile=eh,t.TileBounds=Nu,t.Transitionable=xn,t.Uniform1f=Ta,t.Uniform1i=ka,t.Uniform2f=Ia,t.Uniform3f=Ca,t.Uniform4f=Aa,t.UniformColor=Pa,t.UniformMatrix4f=za,t.UnwrappedTileID=Fu,t.ValidationError=At,t.WritingMode=wl,t.ZoomHistory=$r,t.add=function(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t},t.addDynamicAttributes=fu,t.asyncAll=function(t,e,i){if(!t.length)return i(null,[]);var r=t.length,n=new Array(t.length),a=null;t.forEach(function(t,o){e(t,function(t,e){t&&(a=t),n[o]=e,0==--r&&i(a,n)})})},t.bezier=o,t.bindAll=m,t.browser=B,t.cacheEntryPossiblyAdded=pt,t.clamp=l,t.clearTileCache=function(t){var e=self.caches.delete("mapbox-tiles");t&&e.catch(t).then(function(){return t()})},t.clone=function(t){var e=new co(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=x,t.clone$2=function(t){var e=new co(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},t.config=F,t.create=function(){var t=new co(16);return co!=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 co(9);return co!=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 co(4);return co!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},t.createCommonjsModule=e,t.createExpression=ir,t.createLayout=On,t.createStyleLayer=function(t){return"custom"===t.type?new ku(t):new Tu[t.type](t)},t.cross=function(t,e,i){var r=e[0],n=e[1],a=e[2],o=i[0],s=i[1],l=i[2];return t[0]=n*l-a*s,t[1]=a*o-r*l,t[2]=r*s-n*o,t},t.deepEqual=function t(e,i){if(Array.isArray(e)){if(!Array.isArray(i)||e.length!==i.length)return!1;for(var r=0;r<e.length;r++)if(!t(e[r],i[r]))return!1;return!0}if("object"==typeof e&&null!==e&&null!==i){if("object"!=typeof i)return!1;if(Object.keys(e).length!==Object.keys(i).length)return!1;for(var n in e)if(!t(e[n],i[n]))return!1;return!0}return e===i},t.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]},t.dot$1=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},t.ease=s,t.emitValidationErrors=jr,t.endsWith=v,t.enforceCacheSizeLimit=function(t){lt(),$&&$.then(function(e){e.keys().then(function(i){for(var r=0;r<i.length-t;r++)e.delete(i[r])})})},t.evaluateSizeForFeature=Fl,t.evaluateSizeForZoom=Vl,t.evaluateVariableOffset=au,t.evented=fn,t.extend=h,t.featureFilter=yr,t.filterObject=_,t.fromRotation=function(t,e){var i=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=i,t[2]=0,t[3]=-i,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},t.getAnchorAlignment=zl,t.getAnchorJustification=ou,t.getArrayBuffer=bt,t.getImage=St,t.getJSON=xt,t.getRTLTextPluginStatus=dn,t.getReferrer=gt,t.getVideo=function(t,e){var i,r,n=self.document.createElement("video");n.muted=!0,n.onloadstart=function(){e(null,n)};for(var a=0;a<t.length;a++){var o=self.document.createElement("source");i=t[a],r=void 0,(r=self.document.createElement("a")).href=i,(r.protocol!==self.document.location.protocol||r.host!==self.document.location.host)&&(n.crossOrigin="Anonymous"),o.src=t[a],n.appendChild(o)}return{cancel:function(){}}},t.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},t.invert=function(t,e){var i=e[0],r=e[1],n=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],h=e[8],c=e[9],p=e[10],f=e[11],d=e[12],y=e[13],m=e[14],v=e[15],g=i*s-r*o,_=i*l-n*o,x=i*u-a*o,b=r*l-n*s,w=r*u-a*s,S=n*u-a*l,M=h*y-c*d,E=h*m-p*d,k=h*v-f*d,T=c*m-p*y,I=c*v-f*y,C=p*v-f*m,A=g*C-_*I+x*T+b*k-w*E+S*M;return A?(t[0]=(s*C-l*I+u*T)*(A=1/A),t[1]=(n*I-r*C-a*T)*A,t[2]=(y*S-m*w+v*b)*A,t[3]=(p*w-c*S-f*b)*A,t[4]=(l*k-o*C-u*E)*A,t[5]=(i*C-n*k+a*E)*A,t[6]=(m*x-d*S-v*_)*A,t[7]=(h*S-p*x+f*_)*A,t[8]=(o*I-s*k+u*M)*A,t[9]=(r*k-i*I-a*M)*A,t[10]=(d*w-y*x+v*g)*A,t[11]=(c*x-h*w-f*g)*A,t[12]=(s*E-o*T-l*M)*A,t[13]=(i*T-r*E+n*M)*A,t[14]=(y*_-d*b-m*g)*A,t[15]=(h*b-c*_+p*g)*A,t):null},t.isChar=tn,t.isMapboxURL=Z,t.keysDifference=function(t,e){var i=[];for(var r in t)r in e||i.push(r);return i},t.loadTileJSON=ju,t.makeRequest=_t,t.mapObject=g,t.mercatorZfromAltitude=Pe,t.multiply=function(t,e,i){var r=e[0],n=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],h=e[7],c=e[8],p=e[9],f=e[10],d=e[11],y=e[12],m=e[13],v=e[14],g=e[15],_=i[0],x=i[1],b=i[2],w=i[3];return t[0]=_*r+x*s+b*c+w*y,t[1]=_*n+x*l+b*p+w*m,t[2]=_*a+x*u+b*f+w*v,t[3]=_*o+x*h+b*d+w*g,t[4]=(_=i[4])*r+(x=i[5])*s+(b=i[6])*c+(w=i[7])*y,t[5]=_*n+x*l+b*p+w*m,t[6]=_*a+x*u+b*f+w*v,t[7]=_*o+x*h+b*d+w*g,t[8]=(_=i[8])*r+(x=i[9])*s+(b=i[10])*c+(w=i[11])*y,t[9]=_*n+x*l+b*p+w*m,t[10]=_*a+x*u+b*f+w*v,t[11]=_*o+x*h+b*d+w*g,t[12]=(_=i[12])*r+(x=i[13])*s+(b=i[14])*c+(w=i[15])*y,t[13]=_*n+x*l+b*p+w*m,t[14]=_*a+x*u+b*f+w*v,t[15]=_*o+x*h+b*d+w*g,t},t.mvt=ws,t.normalize=function(t,e){var i=e[0],r=e[1],n=e[2],a=i*i+r*r+n*n;return a>0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t},t.number=ri,t.offscreenCanvasSupported=ft,t.ortho=function(t,e,i,r,n,a,o){var s=1/(e-i),l=1/(r-n),u=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+i)*s,t[13]=(n+r)*l,t[14]=(o+a)*u,t[15]=1,t},t.parseGlyphPBF=function(t){return new Ys(t).readFields(yl,[])},t.pbf=Ys,t.performSymbolLayout=function(t,e,i,r,a,o,s){t.createArrays(),t.tilePixelRatio=8192/(512*t.overscaling),t.compareText={},t.iconsNeedLinear=!1;var l=t.layers[0].layout,u=t.layers[0]._unevaluatedLayout._values,h={};if("composite"===t.textSizeData.kind){var c=t.textSizeData,p=c.maxZoom;h.compositeTextSizes=[u["text-size"].possiblyEvaluate(new vn(c.minZoom),s),u["text-size"].possiblyEvaluate(new vn(p),s)]}if("composite"===t.iconSizeData.kind){var f=t.iconSizeData,d=f.maxZoom;h.compositeIconSizes=[u["icon-size"].possiblyEvaluate(new vn(f.minZoom),s),u["icon-size"].possiblyEvaluate(new vn(d),s)]}h.layoutTextSize=u["text-size"].possiblyEvaluate(new vn(t.zoom+1),s),h.layoutIconSize=u["icon-size"].possiblyEvaluate(new vn(t.zoom+1),s),h.textMaxSize=u["text-size"].possiblyEvaluate(new vn(18));for(var y=24*l.get("text-line-height"),m="map"===l.get("text-rotation-alignment")&&"point"!==l.get("symbol-placement"),v=l.get("text-keep-upright"),g=l.get("text-size"),_=function(){var o=b[x],u=l.get("text-font").evaluate(o,{},s).join(","),c=g.evaluate(o,{},s),p=h.layoutTextSize.evaluate(o,{},s),f=h.layoutIconSize.evaluate(o,{},s),d={horizontal:{},vertical:void 0},_=o.text,S=[0,0];if(_){var M=_.toString(),E=24*l.get("text-letter-spacing").evaluate(o,{},s),k=function(t){for(var e=0,i=M;e<i.length;e+=1)if(r=i[e].charCodeAt(0),tn.Arabic(r)||tn["Arabic Supplement"](r)||tn["Arabic Extended-A"](r)||tn["Arabic Presentation Forms-A"](r)||tn["Arabic Presentation Forms-B"](r))return!1;var r;return!0}()?E:0,T=l.get("text-anchor").evaluate(o,{},s),I=l.get("text-variable-anchor");if(!I){var C=l.get("text-radial-offset").evaluate(o,{},s);S=C?au(T,[24*C,nu]):l.get("text-offset").evaluate(o,{},s).map(function(t){return 24*t})}var A=m?"center":l.get("text-justify").evaluate(o,{},s),P=l.get("symbol-placement"),L="point"===P?24*l.get("text-max-width").evaluate(o,{},s):0,z=function(){t.allowVerticalPlacement&&en(M)&&(d.vertical=El(_,e,i,a,u,L,y,T,"left",k,S,wl.vertical,!0,P,p,c))};if(!m&&I){for(var D="auto"===A?I.map(function(t){return ou(t)}):[A],R=!1,O=0;O<D.length;O++){var B=D[O];if(!d.horizontal[B])if(R)d.horizontal[B]=d.horizontal[0];else{var F=El(_,e,i,a,u,L,y,"center",B,k,S,wl.horizontal,!1,P,p,c);F&&(d.horizontal[B]=F,R=1===F.positionedLines.length)}}z()}else{"auto"===A&&(A=ou(T));var V=El(_,e,i,a,u,L,y,T,A,k,S,wl.horizontal,!1,P,p,c);V&&(d.horizontal[A]=V),z(),en(M)&&m&&v&&(d.vertical=El(_,e,i,a,u,L,y,T,A,k,S,wl.vertical,!1,P,p,c))}}var U=void 0,j=!1;if(o.icon&&o.icon.name){var N=r[o.icon.name];N&&(U=function(t,e,i){var r=zl(l.get("icon-anchor").evaluate(o,{},s)),n=e[0]-t.displaySize[0]*r.horizontalAlign,a=e[1]-t.displaySize[1]*r.verticalAlign;return{image:t,top:a,bottom:a+t.displaySize[1],left:n,right:n+t.displaySize[0]}}(a[o.icon.name],l.get("icon-offset").evaluate(o,{},s)),j=N.sdf,void 0===t.sdfIcons?t.sdfIcons=N.sdf:t.sdfIcons!==N.sdf&&w("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(N.pixelRatio!==t.pixelRatio||0!==l.get("icon-rotate").constantOr(1))&&(t.iconsNeedLinear=!0))}var q=lu(d.horizontal)||d.vertical;t.iconsInText=!!q&&q.iconsInText,(q||U)&&function(t,e,i,r,a,o,s,l,u,h,c){var p=o.textMaxSize.evaluate(e,{});void 0===p&&(p=s);var f,d=t.layers[0].layout,y=d.get("icon-offset").evaluate(e,{},c),m=lu(i.horizontal),v=s/24,g=t.tilePixelRatio*v,_=t.tilePixelRatio*p/24,x=t.tilePixelRatio*l,b=t.tilePixelRatio*d.get("symbol-spacing"),S=d.get("text-padding")*t.tilePixelRatio,M=d.get("icon-padding")*t.tilePixelRatio,E=d.get("text-max-angle")/180*Math.PI,k="map"===d.get("text-rotation-alignment")&&"point"!==d.get("symbol-placement"),T="map"===d.get("icon-rotation-alignment")&&"point"!==d.get("symbol-placement"),I=d.get("symbol-placement"),C=b/2,A=d.get("icon-text-fit");r&&"none"!==A&&(t.allowVerticalPlacement&&i.vertical&&(f=Rl(r,i.vertical,A,d.get("icon-text-fit-padding"),y,v)),m&&(r=Rl(r,m,A,d.get("icon-text-fit-padding"),y,v)));var P=function(n,s){s.x<0||s.x>=8192||s.y<0||s.y>=8192||function(t,e,i,r,n,a,o,s,l,u,h,c,p,f,d,y,m,v,g,_,x,b,S,M){var E,k,T,I,C,A=t.addToLineVertexArray(e,i),P=0,L=0,z=0,D=0,R=-1,O=-1,B={},F=_a(""),V=0,U=0;if(void 0===s._unevaluatedLayout.getValue("text-radial-offset")?(V=(E=s.layout.get("text-offset").evaluate(x,{},M).map(function(t){return 24*t}))[0],U=E[1]):(V=24*s.layout.get("text-radial-offset").evaluate(x,{},M),U=nu),t.allowVerticalPlacement&&r.vertical){var j=s.layout.get("text-rotate").evaluate(x,{},M)+90;I=new Ql(l,i,e,u,h,c,r.vertical,p,f,d,t.overscaling,j),o&&(C=new Ql(l,i,e,u,h,c,o,m,v,d,t.overscaling,j))}if(n){var N=s.layout.get("icon-rotate").evaluate(x,{}),q="none"!==s.layout.get("icon-text-fit"),G=Wl(n,N,S,q),Z=o?Wl(o,N,S,q):void 0;T=new Ql(l,i,e,u,h,c,n,m,v,!1,t.overscaling,N),P=4*G.length;var X=t.iconSizeData,W=null;"source"===X.kind?(W=[128*s.layout.get("icon-size").evaluate(x,{})])[0]>32640&&w(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):"composite"===X.kind&&((W=[128*b.compositeIconSizes[0].evaluate(x,{},M),128*b.compositeIconSizes[1].evaluate(x,{},M)])[0]>32640||W[1]>32640)&&w(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),t.addSymbols(t.icon,G,W,_,g,x,!1,e,A.lineStartIndex,A.lineLength,-1,M),R=t.icon.placedSymbolArray.length-1,Z&&(L=4*Z.length,t.addSymbols(t.icon,Z,W,_,g,x,wl.vertical,e,A.lineStartIndex,A.lineLength,-1,M),O=t.icon.placedSymbolArray.length-1)}for(var K in r.horizontal){var H=r.horizontal[K];if(!k){F=_a(H.text);var J=s.layout.get("text-rotate").evaluate(x,{},M);k=new Ql(l,i,e,u,h,c,H,p,f,d,t.overscaling,J)}var Y=1===H.positionedLines.length;if(z+=su(t,e,H,a,s,d,x,y,A,r.vertical?wl.horizontal:wl.horizontalOnly,Y?Object.keys(r.horizontal):[K],B,R,b,M),Y)break}r.vertical&&(D+=su(t,e,r.vertical,a,s,d,x,y,A,wl.vertical,["vertical"],B,O,b,M));var Q=k?k.boxStartIndex:t.collisionBoxArray.length,$=k?k.boxEndIndex:t.collisionBoxArray.length,tt=I?I.boxStartIndex:t.collisionBoxArray.length,et=I?I.boxEndIndex:t.collisionBoxArray.length,it=T?T.boxStartIndex:t.collisionBoxArray.length,rt=T?T.boxEndIndex:t.collisionBoxArray.length,nt=C?C.boxStartIndex:t.collisionBoxArray.length,at=C?C.boxEndIndex:t.collisionBoxArray.length;t.glyphOffsetArray.length>=vu.MAX_GLYPHS&&w("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==x.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,x.sortKey),t.symbolInstances.emplaceBack(e.x,e.y,B.right>=0?B.right:-1,B.center>=0?B.center:-1,B.left>=0?B.left:-1,B.vertical||-1,R,O,F,Q,$,tt,et,it,rt,nt,at,u,z,D,P,L,0,p,V,U)}(t,s,n,i,r,a,f,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,g,S,k,u,x,M,T,y,e,o,h,c)};if("line"===I)for(var L=0,z=function(t,e,i,r,a){for(var o=[],s=0;s<t.length;s++)for(var l=t[s],u=void 0,h=0;h<l.length-1;h++){var c=l[h],p=l[h+1];c.x<0&&p.x<0||(c.x<0?c=new n(0,c.y+(0-c.x)/(p.x-c.x)*(p.y-c.y))._round():p.x<0&&(p=new n(0,c.y+(0-c.x)/(p.x-c.x)*(p.y-c.y))._round()),c.y<0&&p.y<0||(c.y<0?c=new n(c.x+(0-c.y)/(p.y-c.y)*(p.x-c.x),0)._round():p.y<0&&(p=new n(c.x+(0-c.y)/(p.y-c.y)*(p.x-c.x),0)._round()),c.x>=r&&p.x>=r||(c.x>=r?c=new n(r,c.y+(r-c.x)/(p.x-c.x)*(p.y-c.y))._round():p.x>=r&&(p=new n(r,c.y+(r-c.x)/(p.x-c.x)*(p.y-c.y))._round()),c.y>=a&&p.y>=a||(c.y>=a?c=new n(c.x+(a-c.y)/(p.y-c.y)*(p.x-c.x),a)._round():p.y>=a&&(p=new n(c.x+(a-c.y)/(p.y-c.y)*(p.x-c.x),a)._round()),u&&c.equals(u[u.length-1])||o.push(u=[c]),u.push(p)))))}return o}(e.geometry,0,0,8192,8192);L<z.length;L+=1)for(var D=z[L],R=0,O=Xl(D,b,E,i.vertical||m,r,24,_,t.overscaling,8192);R<O.length;R+=1){var B=O[R];m&&uu(t,m.text,C,B)||P(D,B)}else if("line-center"===I)for(var F=0,V=e.geometry;F<V.length;F+=1){var U=V[F];if(U.length>1){var j=Zl(U,E,i.vertical||m,r,24,_);j&&P(U,j)}}else if("Polygon"===e.type)for(var N=0,q=as(e.geometry,0);N<q.length;N+=1){var G=q[N],Z=eu(G,16);P(G[0],new Ol(Z.x,Z.y,0))}else if("LineString"===e.type)for(var X=0,W=e.geometry;X<W.length;X+=1){var K=W[X];P(K,new Ol(K[0].x,K[0].y,0))}else if("Point"===e.type)for(var H=0,J=e.geometry;H<J.length;H+=1)for(var Y=0,Q=J[H];Y<Q.length;Y+=1){var $=Q[Y];P([$],new Ol($.x,$.y,0))}}(t,o,d,U,r,h,p,f,S,j,s)},x=0,b=t.features;x<b.length;x+=1)_();o&&t.generateCollisionDebugBuffers()},t.perspective=function(t,e,i,r,n){var a,o=1/Math.tan(e/2);return t[0]=o/i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=n&&n!==1/0?(t[10]=(n+r)*(a=1/(r-n)),t[14]=2*n*r*a):(t[10]=-1,t[14]=-2*r),t},t.pick=c,t.plugin=mn,t.polygonIntersectsPolygon=Ka,t.postMapLoadEvent=at,t.postTurnstileEvent=rt,t.potpack=gl,t.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],t.register=Wr,t.registerForPluginStateChange=function(t){return t({pluginStatus:un,pluginURL:hn}),fn.on("pluginStateChange",t),t},t.rotate=function(t,e,i){var r=e[0],n=e[1],a=e[2],o=e[3],s=Math.sin(i),l=Math.cos(i);return t[0]=r*l+a*s,t[1]=n*l+o*s,t[2]=r*-s+a*l,t[3]=n*-s+o*l,t},t.rotateX=function(t,e,i){var r=Math.sin(i),n=Math.cos(i),a=e[4],o=e[5],s=e[6],l=e[7],u=e[8],h=e[9],c=e[10],p=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=a*n+u*r,t[5]=o*n+h*r,t[6]=s*n+c*r,t[7]=l*n+p*r,t[8]=u*n-a*r,t[9]=h*n-o*r,t[10]=c*n-s*r,t[11]=p*n-l*r,t},t.rotateZ=function(t,e,i){var r=Math.sin(i),n=Math.cos(i),a=e[0],o=e[1],s=e[2],l=e[3],u=e[4],h=e[5],c=e[6],p=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*n+u*r,t[1]=o*n+h*r,t[2]=s*n+c*r,t[3]=l*n+p*r,t[4]=u*n-a*r,t[5]=h*n-o*r,t[6]=c*n-s*r,t[7]=p*n-l*r,t},t.scale=function(t,e,i){var r=i[0],n=i[1],a=i[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},t.scale$1=function(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t},t.scale$2=function(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t},t.setCacheLimits=function(t,e){ot=t,st=e},t.setRTLTextPlugin=function(t,e,i){if(void 0===i&&(i=!1),"deferred"===un||"loading"===un||"loaded"===un)throw new Error("setRTLTextPlugin cannot be called multiple times.");hn=B.resolveURL(t),un="deferred",ln=e,pn(),i||yn()},t.sphericalToCartesian=function(t){var e=t[0],i=t[1],r=t[2];return i+=90,i*=Math.PI/180,r*=Math.PI/180,{x:e*Math.cos(i)*Math.sin(r),y:e*Math.sin(i)*Math.sin(r),z:e*Math.cos(r)}},t.sqrLen=function(t){var e=t[0],i=t[1];return e*e+i*i},t.styleSpec=Ct,t.sub=function(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t},t.symbolSize=Ul,t.transformMat3=function(t,e,i){var r=e[0],n=e[1],a=e[2];return t[0]=r*i[0]+n*i[3]+a*i[6],t[1]=r*i[1]+n*i[4]+a*i[7],t[2]=r*i[2]+n*i[5]+a*i[8],t},t.transformMat4=po,t.translate=function(t,e,i){var r,n,a,o,s,l,u,h,c,p,f,d,y=i[0],m=i[1],v=i[2];return e===t?(t[12]=e[0]*y+e[4]*m+e[8]*v+e[12],t[13]=e[1]*y+e[5]*m+e[9]*v+e[13],t[14]=e[2]*y+e[6]*m+e[10]*v+e[14],t[15]=e[3]*y+e[7]*m+e[11]*v+e[15]):(n=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],h=e[7],c=e[8],p=e[9],f=e[10],d=e[11],t[0]=r=e[0],t[1]=n,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t[6]=u,t[7]=h,t[8]=c,t[9]=p,t[10]=f,t[11]=d,t[12]=r*y+s*m+c*v+e[12],t[13]=n*y+l*m+p*v+e[13],t[14]=a*y+u*m+f*v+e[14],t[15]=o*y+h*m+d*v+e[15]),t},t.triggerPluginCompletionEvent=cn,t.uniqueId=f,t.validateCustomStyleLayer=function(t){var e=[],i=t.id;return void 0===i&&e.push({message:"layers."+i+': missing required property "id"'}),void 0===t.render&&e.push({message:"layers."+i+': missing required method "render"'}),t.renderingMode&&"2d"!==t.renderingMode&&"3d"!==t.renderingMode&&e.push({message:"layers."+i+': property "renderingMode" must be either "2d" or "3d"'}),e},t.validateLight=Fr,t.validateStyle=Br,t.values=function(t){var e=[];for(var i in t)e.push(t[i]);return e},t.vectorTile=ws,t.version="17.4.0",t.warnOnce=w,t.webpSupported=V,t.window=self,t.wrap=u}),r(0,function(t){function e(t){var i=typeof t;if("number"===i||"boolean"===i||"string"===i||null==t)return JSON.stringify(t);if(Array.isArray(t)){for(var r="[",n=0,a=t;n<a.length;n+=1)r+=e(a[n])+",";return r+"]"}for(var o=Object.keys(t).sort(),s="{",l=0;l<o.length;l++)s+=JSON.stringify(o[l])+":"+e(t[o[l]])+",";return s+"}"}function i(i){for(var r="",n=0,a=t.refProperties;n<a.length;n+=1)r+="/"+e(i[a[n]]);return r}var r=function(t){this.keyCache={},t&&this.replace(t)};r.prototype.replace=function(t){this._layerConfigs={},this._layers={},this.update(t,[])},r.prototype.update=function(e,r){for(var n=this,a=0,o=e;a<o.length;a+=1){var s=o[a];this._layerConfigs[s.id]=s;var l=this._layers[s.id]=t.createStyleLayer(s);l._featureFilter=t.featureFilter(l.filter),this.keyCache[s.id]&&delete this.keyCache[s.id]}for(var u=0,h=r;u<h.length;u+=1){var c=h[u];delete this.keyCache[c],delete this._layerConfigs[c],delete this._layers[c]}this.familiesBySource={};for(var p=0,f=function(t,e){for(var r={},n=0;n<t.length;n++){var a=e&&e[t[n].id]||i(t[n]);e&&(e[t[n].id]=a);var o=r[a];o||(o=r[a]=[]),o.push(t[n])}var s=[];for(var l in r)s.push(r[l]);return s}(t.values(this._layerConfigs),this.keyCache);p<f.length;p+=1){var d=f[p].map(function(t){return n._layers[t.id]}),y=d[0];if("none"!==y.visibility){var m=y.source||"",v=this.familiesBySource[m];v||(v=this.familiesBySource[m]={});var g=y.sourceLayer||"_geojsonTileLayer",_=v[g];_||(_=v[g]=[]),_.push(d)}}};var n=function(e){var i={},r=[];for(var n in e){var a=e[n],o=i[n]={};for(var s in a){var l=a[+s];if(l&&0!==l.bitmap.width&&0!==l.bitmap.height){var u={x:0,y:0,w:l.bitmap.width+2,h:l.bitmap.height+2};r.push(u),o[s]={rect:u,metrics:l.metrics}}}}var h=t.potpack(r),c=new t.AlphaImage({width:h.w||1,height:h.h||1});for(var p in e){var f=e[p];for(var d in f){var y=f[+d];if(y&&0!==y.bitmap.width&&0!==y.bitmap.height){var m=i[p][d].rect;t.AlphaImage.copy(y.bitmap,c,{x:0,y:0},{x:m.x+1,y:m.y+1},y.bitmap)}}}this.image=c,this.positions=i};t.register("GlyphAtlas",n);var a=function(e){this.tileID=new t.OverscaledTileID(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.uid=e.uid,this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=e.showCollisionBoxes,this.collectResourceTiming=!!e.collectResourceTiming,this.returnDependencies=!!e.returnDependencies,this.promoteId=e.promoteId};function o(e,i,r){for(var n=new t.EvaluationParameters(i),a=0,o=e;a<o.length;a+=1)o[a].recalculate(n,r)}function s(e,i){var r=t.getArrayBuffer(e.request,function(e,r,n,a){e?i(e):r&&i(null,{vectorTile:new t.vectorTile.VectorTile(new t.pbf(r)),rawData:r,cacheControl:n,expires:a})});return function(){r.cancel(),i()}}a.prototype.parse=function(e,i,r,a,s){var l=this;this.status="parsing",this.data=e,this.collisionBoxArray=new t.CollisionBoxArray;var u=new t.DictionaryCoder(Object.keys(e.layers).sort()),h=new t.FeatureIndex(this.tileID,this.promoteId);h.bucketLayerIDs=[];var c,p,f,d,y={},m={featureIndex:h,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:r},v=i.familiesBySource[this.source];for(var g in v){var _=e.layers[g];if(_){1===_.version&&t.warnOnce('Vector tile source "'+this.source+'" layer "'+g+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var x=u.encode(g),b=[],w=0;w<_.length;w++){var S=_.feature(w),M=h.getId(S,g);b.push({feature:S,id:M,index:w,sourceLayerIndex:x})}for(var E=0,k=v[g];E<k.length;E+=1){var T=k[E],I=T[0];I.minzoom&&this.zoom<Math.floor(I.minzoom)||I.maxzoom&&this.zoom>=I.maxzoom||"none"!==I.visibility&&(o(T,this.zoom,r),(y[I.id]=I.createBucket({index:h.bucketLayerIDs.length,layers:T,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:x,sourceID:this.source})).populate(b,m,this.tileID.canonical),h.bucketLayerIDs.push(T.map(function(t){return t.id})))}}}var C=t.mapObject(m.glyphDependencies,function(t){return Object.keys(t).map(Number)});Object.keys(C).length?a.send("getGlyphs",{uid:this.uid,stacks:C},function(t,e){c||(c=t,p=e,L.call(l))}):p={};var A=Object.keys(m.iconDependencies);A.length?a.send("getImages",{icons:A,source:this.source,tileID:this.tileID,type:"icons"},function(t,e){c||(c=t,f=e,L.call(l))}):f={};var P=Object.keys(m.patternDependencies);function L(){if(c)return s(c);if(p&&f&&d){var e=new n(p),i=new t.ImageAtlas(f,d);for(var a in y){var l=y[a];l instanceof t.SymbolBucket?(o(l.layers,this.zoom,r),t.performSymbolLayout(l,p,e.positions,f,i.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):l.hasPattern&&(l instanceof t.LineBucket||l instanceof t.FillBucket||l instanceof t.FillExtrusionBucket)&&(o(l.layers,this.zoom,r),l.addFeatures(m,this.tileID.canonical,i.patternPositions))}this.status="done",s(null,{buckets:t.values(y).filter(function(t){return!t.isEmpty()}),featureIndex:h,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:e.image,imageAtlas:i,glyphMap:this.returnDependencies?p:null,iconMap:this.returnDependencies?f:null,glyphPositions:this.returnDependencies?e.positions:null})}}P.length?a.send("getImages",{icons:P,source:this.source,tileID:this.tileID,type:"patterns"},function(t,e){c||(c=t,d=e,L.call(l))}):d={},L.call(this)};var l=function(t,e,i,r){this.actor=t,this.layerIndex=e,this.availableImages=i,this.loadVectorData=r||s,this.loading={},this.loaded={}};l.prototype.loadTile=function(e,i){var r=this,n=e.uid;this.loading||(this.loading={});var o=!!(e&&e.request&&e.request.collectResourceTiming)&&new t.RequestPerformance(e.request),s=this.loading[n]=new a(e);s.abort=this.loadVectorData(e,function(e,a){if(delete r.loading[n],e||!a)return s.status="done",r.loaded[n]=s,i(e);var l=a.rawData,u={};a.expires&&(u.expires=a.expires),a.cacheControl&&(u.cacheControl=a.cacheControl);var h={};if(o){var c=o.finish();c&&(h.resourceTiming=JSON.parse(JSON.stringify(c)))}s.vectorTile=a.vectorTile,s.parse(a.vectorTile,r.layerIndex,r.availableImages,r.actor,function(e,r){if(e||!r)return i(e);i(null,t.extend({rawTileData:l.slice(0)},r,u,h))}),r.loaded=r.loaded||{},r.loaded[n]=s})},l.prototype.reloadTile=function(t,e){var i=this,r=this.loaded,n=t.uid,a=this;if(r&&r[n]){var o=r[n];o.showCollisionBoxes=t.showCollisionBoxes;var s=function(t,r){var n=o.reloadCallback;n&&(delete o.reloadCallback,o.parse(o.vectorTile,a.layerIndex,i.availableImages,a.actor,n)),e(t,r)};"parsing"===o.status?o.reloadCallback=s:"done"===o.status&&(o.vectorTile?o.parse(o.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s())}},l.prototype.abortTile=function(t,e){var i=this.loading,r=t.uid;i&&i[r]&&i[r].abort&&(i[r].abort(),delete i[r]),e()},l.prototype.removeTile=function(t,e){var i=this.loaded,r=t.uid;i&&i[r]&&delete i[r],e()};var u=t.window.ImageBitmap,h=function(){this.loaded={}};function c(t,e){if(0!==t.length){p(t[0],e);for(var i=1;i<t.length;i++)p(t[i],!e)}}function p(t,e){for(var i=0,r=0,n=0,a=t.length,o=a-1;n<a;o=n++){var s=(t[n][0]-t[o][0])*(t[o][1]+t[n][1]),l=i+s;r+=Math.abs(i)>=Math.abs(s)?i-l+s:s-l+i,i=l}i+r>=0!=!!e&&t.reverse()}h.prototype.loadTile=function(e,i){var r=e.uid,n=e.encoding,a=e.rawImageData,o=u&&a instanceof u?this.getImageData(a):a,s=new t.DEMData(r,o,n);this.loaded=this.loaded||{},this.loaded[r]=s,i(null,s)},h.prototype.getImageData=function(e){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(e.width,e.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=e.width,this.offscreenCanvas.height=e.height,this.offscreenCanvasContext.drawImage(e,0,0,e.width,e.height);var i=this.offscreenCanvasContext.getImageData(-1,-1,e.width+2,e.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new t.RGBAImage({width:i.width,height:i.height},i.data)},h.prototype.removeTile=function(t){var e=this.loaded,i=t.uid;e&&e[i]&&delete e[i]};var f=t.vectorTile.VectorTileFeature.prototype.toGeoJSON,d=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))};d.prototype.loadGeometry=function(){if(1===this._feature.type){for(var e=[],i=0,r=this._feature.geometry;i<r.length;i+=1){var n=r[i];e.push([new t.Point$1(n[0],n[1])])}return e}for(var a=[],o=0,s=this._feature.geometry;o<s.length;o+=1){for(var l=[],u=0,h=s[o];u<h.length;u+=1){var c=h[u];l.push(new t.Point$1(c[0],c[1]))}a.push(l)}return a},d.prototype.toGeoJSON=function(t,e,i,r){return f.call(this,t,e,i,r)};var y=function(e){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=t.EXTENT,this.length=e.length,this._features=e};y.prototype.feature=function(t){return new d(this._features[t])};var m=t.vectorTile.VectorTileFeature,v=g;function g(t,e){this.options=e||{},this.features=t,this.length=t.length}function _(t,e){this.id="number"==typeof t.id?t.id:void 0,this.type=t.type,this.rawGeometry=1===t.type?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=e||4096}g.prototype.feature=function(t){return new _(this.features[t],this.options.extent)},_.prototype.loadGeometry=function(){var e=this.rawGeometry;this.geometry=[];for(var i=0;i<e.length;i++){for(var r=e[i],n=[],a=0;a<r.length;a++)n.push(new t.Point$1(r[a][0],r[a][1]));this.geometry.push(n)}return this.geometry},_.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var t=this.geometry,e=1/0,i=-1/0,r=1/0,n=-1/0,a=0;a<t.length;a++)for(var o=t[a],s=0;s<o.length;s++){var l=o[s];e=Math.min(e,l.x),i=Math.max(i,l.x),r=Math.min(r,l.y),n=Math.max(n,l.y)}return[e,r,i,n]},_.prototype.toGeoJSON=m.prototype.toGeoJSON;var x=w,b=v;function w(e){var i=new t.pbf;return function(t,e){for(var i in t.layers)e.writeMessage(3,S,t.layers[i])}(e,i),i.finish()}function S(t,e){var i;e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||""),e.writeVarintField(5,t.extent||4096);var r={keys:[],values:[],keycache:{},valuecache:{}};for(i=0;i<t.length;i++)r.feature=t.feature(i),e.writeMessage(2,M,r);var n=r.keys;for(i=0;i<n.length;i++)e.writeStringField(3,n[i]);var a=r.values;for(i=0;i<a.length;i++)e.writeMessage(4,C,a[i])}function M(t,e){var i=t.feature;void 0!==i.id&&e.writeVarintField(1,i.id),e.writeMessage(2,E,t),e.writeVarintField(3,i.type),e.writeMessage(4,I,i)}function E(t,e){var i=t.feature,r=t.keys,n=t.values,a=t.keycache,o=t.valuecache;for(var s in i.properties){var l=i.properties[s],u=a[s];if(null!==l){void 0===u&&(r.push(s),a[s]=u=r.length-1),e.writeVarint(u);var h=typeof l;"string"!==h&&"boolean"!==h&&"number"!==h&&(l=JSON.stringify(l));var c=h+":"+l,p=o[c];void 0===p&&(n.push(l),o[c]=p=n.length-1),e.writeVarint(p)}}}function k(t,e){return(e<<3)+(7&t)}function T(t){return t<<1^t>>31}function I(t,e){for(var i=t.loadGeometry(),r=t.type,n=0,a=0,o=i.length,s=0;s<o;s++){var l=i[s],u=1;1===r&&(u=l.length),e.writeVarint(k(1,u));for(var h=3===r?l.length-1:l.length,c=0;c<h;c++){1===c&&1!==r&&e.writeVarint(k(2,h-1));var p=l[c].x-n,f=l[c].y-a;e.writeVarint(T(p)),e.writeVarint(T(f)),n+=p,a+=f}3===r&&e.writeVarint(k(7,1))}}function C(t,e){var i=typeof t;"string"===i?e.writeStringField(1,t):"boolean"===i?e.writeBooleanField(7,t):"number"===i&&(t%1!=0?e.writeDoubleField(3,t):t<0?e.writeSVarintField(6,t):e.writeVarintField(5,t))}function A(t,e,i,r){P(t,i,r),P(e,2*i,2*r),P(e,2*i+1,2*r+1)}function P(t,e,i){var r=t[e];t[e]=t[i],t[i]=r}function L(t,e,i,r){var n=t-i,a=e-r;return n*n+a*a}x.fromVectorTileJs=w,x.fromGeojsonVt=function(t,e){e=e||{};var i={};for(var r in t)i[r]=new v(t[r].features,e),i[r].name=r,i[r].version=e.version,i[r].extent=e.extent;return w({layers:i})},x.GeoJSONWrapper=b;var z=function(t){return t[0]},D=function(t){return t[1]},R=function(t,e,i,r,n){void 0===e&&(e=z),void 0===i&&(i=D),void 0===r&&(r=64),void 0===n&&(n=Float64Array),this.nodeSize=r,this.points=t;for(var a=t.length<65536?Uint16Array:Uint32Array,o=this.ids=new a(t.length),s=this.coords=new n(2*t.length),l=0;l<t.length;l++)o[l]=l,s[2*l]=e(t[l]),s[2*l+1]=i(t[l]);!function t(e,i,r,n,a,o){if(!(a-n<=r)){var s=n+a>>1;!function t(e,i,r,n,a,o){for(;a>n;){if(a-n>600){var s=a-n+1,l=r-n+1,u=Math.log(s),h=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*h*(s-h)/s)*(l-s/2<0?-1:1);t(e,i,r,Math.max(n,Math.floor(r-l*h/s+c)),Math.min(a,Math.floor(r+(s-l)*h/s+c)),o)}var p=i[2*r+o],f=n,d=a;for(A(e,i,n,r),i[2*a+o]>p&&A(e,i,n,a);f<d;){for(A(e,i,f,d),f++,d--;i[2*f+o]<p;)f++;for(;i[2*d+o]>p;)d--}i[2*n+o]===p?A(e,i,n,d):A(e,i,++d,a),d<=r&&(n=d+1),r<=d&&(a=d-1)}}(e,i,s,n,a,o%2),t(e,i,r,n,s-1,o+1),t(e,i,r,s+1,a,o+1)}}(o,s,r,0,o.length-1,0)};R.prototype.range=function(t,e,i,r){return function(t,e,i,r,n,a,o){for(var s,l,u=[0,t.length-1,0],h=[];u.length;){var c=u.pop(),p=u.pop(),f=u.pop();if(p-f<=o)for(var d=f;d<=p;d++)l=e[2*d+1],(s=e[2*d])>=i&&s<=n&&l>=r&&l<=a&&h.push(t[d]);else{var y=Math.floor((f+p)/2);l=e[2*y+1],(s=e[2*y])>=i&&s<=n&&l>=r&&l<=a&&h.push(t[y]);var m=(c+1)%2;(0===c?i<=s:r<=l)&&(u.push(f),u.push(y-1),u.push(m)),(0===c?n>=s:a>=l)&&(u.push(y+1),u.push(p),u.push(m))}}return h}(this.ids,this.coords,t,e,i,r,this.nodeSize)},R.prototype.within=function(t,e,i){return function(t,e,i,r,n,a){for(var o=[0,t.length-1,0],s=[],l=n*n;o.length;){var u=o.pop(),h=o.pop(),c=o.pop();if(h-c<=a)for(var p=c;p<=h;p++)L(e[2*p],e[2*p+1],i,r)<=l&&s.push(t[p]);else{var f=Math.floor((c+h)/2),d=e[2*f],y=e[2*f+1];L(d,y,i,r)<=l&&s.push(t[f]);var m=(u+1)%2;(0===u?i-n<=d:r-n<=y)&&(o.push(c),o.push(f-1),o.push(m)),(0===u?i+n>=d:r+n>=y)&&(o.push(f+1),o.push(h),o.push(m))}}return s}(this.ids,this.coords,t,e,i,this.nodeSize)};var O={crs:"EPSG:3857",minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(t){return t}},B=function(t){this.options=G(Object.create(O),t),this.trees=new Array(this.options.maxZoom+1)};function F(t,e,i,r,n){return{x:t,y:e,zoom:1/0,id:i,parentId:-1,numPoints:r,properties:n}}function V(t,e,i){var r=t.geometry.coordinates,n=r[1];return{x:N(r[0]),y:q(n,i),zoom:1/0,index:e,parentId:-1}}function U(t,e){return{type:"Feature",id:t.id,properties:j(t),geometry:{type:"Point",coordinates:[(i=t.x,360*(i-.5)),function(t,e){if(e&&"EPSG:3857"!==e)return 90-360*t;var i=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(i))/Math.PI-90}(t.y,e)]}};var i}function j(t){var e=t.numPoints,i=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return G(G({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:i})}function N(t,e){return t/360+.5}function q(t,e){var i;if(e&&"EPSG:3857"!==e)i=(90-t)/360;else{var r=Math.sin(t*Math.PI/180);i=.5-.25*Math.log((1+r)/(1-r))/Math.PI}return i<0?0:i>1?1:i}function G(t,e){for(var i in e)t[i]=e[i];return t}function Z(t){return t.x}function X(t){return t.y}B.prototype.load=function(t){var e=this.options,i=e.log,r=e.minZoom,n=e.maxZoom,a=e.nodeSize,o=e.crs;i&&console.time("total time");var s="prepare "+t.length+" points";i&&console.time(s),this.points=t;for(var l=[],u=0;u<t.length;u++)t[u].geometry&&l.push(V(t[u],u,o));this.trees[n+1]=new R(l,Z,X,a,Float32Array),i&&console.timeEnd(s);for(var h=n;h>=r;h--){var c=+Date.now();l=this._cluster(l,h),this.trees[h]=new R(l,Z,X,a,Float32Array),i&&console.log("z%d: %d clusters in %dms",h,l.length,+Date.now()-c)}return i&&console.timeEnd("total time"),this},B.prototype.getClusters=function(t,e){var i=this.crs,r=((t[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,t[1])),a=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,a=180;else if(r>a){var s=this.getClusters([r,n,180,o],e),l=this.getClusters([-180,n,a,o],e);return s.concat(l)}for(var u=this.trees[this._limitZoom(e)],h=[],c=0,p=u.range(N(r),q(o,i),N(a),q(n,i));c<p.length;c+=1){var f=u.points[p[c]];h.push(f.numPoints?U(f,i):this.points[f.index])}return h},B.prototype.getChildren=function(t){var e=this.crs,i=this._getOriginId(t),r=this._getOriginZoom(t),n="No cluster with the specified id.",a=this.trees[r];if(!a)throw new Error(n);var o=a.points[i];if(!o)throw new Error(n);for(var s=this.options.radius/(this.options.extent*Math.pow(2,r-1)),l=[],u=0,h=a.within(o.x,o.y,s);u<h.length;u+=1){var c=a.points[h[u]];c.parentId===t&&l.push(c.numPoints?U(c,e):this.points[c.index])}if(0===l.length)throw new Error(n);return l},B.prototype.getLeaves=function(t,e,i){var r=[];return this._appendLeaves(r,t,e=e||10,i=i||0,0),r},B.prototype.getTile=function(t,e,i){var r=this.trees[this._limitZoom(t)],n=Math.pow(2,t),a=this.options,o=a.radius/a.extent,s=(i-o)/n,l=(i+1+o)/n,u={features:[]};return this._addTileFeatures(r.range((e-o)/n,s,(e+1+o)/n,l),r.points,e,i,n,u),0===e&&this._addTileFeatures(r.range(1-o/n,s,1,l),r.points,n,i,n,u),e===n-1&&this._addTileFeatures(r.range(0,s,o/n,l),r.points,-1,i,n,u),u.features.length?u:null},B.prototype.getClusterExpansionZoom=function(t){for(var e=this._getOriginZoom(t)-1;e<=this.options.maxZoom;){var i=this.getChildren(t);if(e++,1!==i.length)break;t=i[0].properties.cluster_id}return e},B.prototype._appendLeaves=function(t,e,i,r,n){for(var a=0,o=this.getChildren(e);a<o.length;a+=1){var s=o[a],l=s.properties;if(l&&l.cluster?n+l.point_count<=r?n+=l.point_count:n=this._appendLeaves(t,l.cluster_id,i,r,n):n<r?n++:t.push(s),t.length===i)break}return n},B.prototype._addTileFeatures=function(t,e,i,r,n,a){for(var o=0,s=t;o<s.length;o+=1){var l=e[s[o]],u=l.numPoints,h={type:1,geometry:[[Math.round(this.options.extent*(l.x*n-i)),Math.round(this.options.extent*(l.y*n-r))]],tags:u?j(l):this.points[l.index].properties},c=void 0;u?c=l.id:this.options.generateId?c=l.index:this.points[l.index].id&&(c=this.points[l.index].id),void 0!==c&&(h.id=c),a.features.push(h)}},B.prototype._limitZoom=function(t){return Math.max(this.options.minZoom,Math.min(+t,this.options.maxZoom+1))},B.prototype._cluster=function(t,e){for(var i=[],r=this.options,n=r.reduce,a=r.minPoints,o=r.radius/(r.extent*Math.pow(2,e)),s=0;s<t.length;s++){var l=t[s];if(!(l.zoom<=e)){l.zoom=e;for(var u=this.trees[e+1],h=u.within(l.x,l.y,o),c=l.numPoints||1,p=c,f=0,d=h;f<d.length;f+=1){var y=u.points[d[f]];y.zoom>e&&(p+=y.numPoints||1)}if(p>=a){for(var m=l.x*c,v=l.y*c,g=n&&c>1?this._map(l,!0):null,_=(s<<5)+(e+1)+this.points.length,x=0,b=h;x<b.length;x+=1){var w=u.points[b[x]];if(!(w.zoom<=e)){w.zoom=e;var S=w.numPoints||1;m+=w.x*S,v+=w.y*S,w.parentId=_,n&&(g||(g=this._map(l,!0)),n(g,this._map(w)))}}l.parentId=_,i.push(F(m/p,v/p,_,p,g))}else if(i.push(l),p>1)for(var M=0,E=h;M<E.length;M+=1){var k=u.points[E[M]];k.zoom<=e||(k.zoom=e,i.push(k))}}}return i},B.prototype._getOriginId=function(t){return t-this.points.length>>5},B.prototype._getOriginZoom=function(t){return(t-this.points.length)%32},B.prototype._map=function(t,e){if(t.numPoints)return e?G({},t.properties):t.properties;var i=this.points[t.index].properties,r=this.options.map(i);return e&&r===i?G({},r):r};var W=484813681109536e-20,K=Math.PI/2,H=.017453292519943295,J=57.29577951308232,Y=Math.PI/4,Q=2*Math.PI,$=3.14159265359,tt={greenwich:0,lisbon:-9.131906111111,paris:2.337229166667,bogota:-74.080916666667,madrid:-3.687938888889,rome:12.452333333333,bern:7.439583333333,jakarta:106.807719444444,ferro:-17.666666666667,brussels:4.367975,stockholm:18.058277777778,athens:23.7163375,oslo:10.722916666667},et={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}},it=/[\s_\-\/\(\)]/g;function rt(t,e){if(t[e])return t[e];for(var i,r=Object.keys(t),n=e.toLowerCase().replace(it,""),a=-1;++a<r.length;)if((i=r[a]).toLowerCase().replace(it,"")===n)return t[i]}function nt(t){var e,i,r,n={},a=t.split("+").map(function(t){return t.trim()}).filter(function(t){return t}).reduce(function(t,e){var i=e.split("=");return i.push(!0),t[i[0].toLowerCase()]=i[1],t},{}),o={proj:"projName",datum:"datumCode",rf:function(t){n.rf=parseFloat(t)},lat_0:function(t){n.lat0=t*H},lat_1:function(t){n.lat1=t*H},lat_2:function(t){n.lat2=t*H},lat_ts:function(t){n.lat_ts=t*H},lon_0:function(t){n.long0=t*H},lon_1:function(t){n.long1=t*H},lon_2:function(t){n.long2=t*H},alpha:function(t){n.alpha=parseFloat(t)*H},gamma:function(t){n.rectified_grid_angle=parseFloat(t)},lonc:function(t){n.longc=t*H},x_0:function(t){n.x0=parseFloat(t)},y_0:function(t){n.y0=parseFloat(t)},k_0:function(t){n.k0=parseFloat(t)},k:function(t){n.k0=parseFloat(t)},a:function(t){n.a=parseFloat(t)},b:function(t){n.b=parseFloat(t)},r:function(t){n.a=n.b=parseFloat(t)},r_a:function(){n.R_A=!0},zone:function(t){n.zone=parseInt(t,10)},south:function(){n.utmSouth=!0},towgs84:function(t){n.datum_params=t.split(",").map(function(t){return parseFloat(t)})},to_meter:function(t){n.to_meter=parseFloat(t)},units:function(t){n.units=t;var e=rt(et,t);e&&(n.to_meter=e.to_meter)},from_greenwich:function(t){n.from_greenwich=t*H},pm:function(t){var e=rt(tt,t);n.from_greenwich=(e||parseFloat(t))*H},nadgrids:function(t){"@null"===t?n.datumCode="none":n.nadgrids=t},axis:function(t){3===t.length&&-1!=="ewnsud".indexOf(t.substr(0,1))&&-1!=="ewnsud".indexOf(t.substr(1,1))&&-1!=="ewnsud".indexOf(t.substr(2,1))&&(n.axis=t)},approx:function(){n.approx=!0}};for(e in a)i=a[e],e in o?"function"==typeof(r=o[e])?r(i):n[r]=i:n[e]=i;return"string"==typeof n.datumCode&&"WGS84"!==n.datumCode&&(n.datumCode=n.datumCode.toLowerCase()),n}var at=/\s/,ot=/[A-Za-z]/,st=/[A-Za-z84_]/,lt=/[,\]]/,ut=/[\d\.E\-\+]/;function ht(t){if("string"!=typeof t)throw new Error("not a string");this.text=t.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=1}function ct(t,e,i){Array.isArray(e)&&(i.unshift(e),e=null);var r=i.reduce(function(t,e){return pt(e,t),t},e?{}:t);e&&(t[e]=r)}function pt(t,e){if(Array.isArray(t)){var i=t.shift();if("PARAMETER"===i&&(i=t.shift()),1===t.length)return Array.isArray(t[0])?(e[i]={},void pt(t[0],e[i])):void(e[i]=t[0]);if(t.length)if("TOWGS84"!==i){if("AXIS"===i)return i in e||(e[i]=[]),void e[i].push(t);var r;switch(Array.isArray(i)||(e[i]={}),i){case"UNIT":case"PRIMEM":case"VERT_DATUM":return e[i]={name:t[0].toLowerCase(),convert:t[1]},void(3===t.length&&pt(t[2],e[i]));case"SPHEROID":case"ELLIPSOID":return e[i]={name:t[0],a:t[1],rf:t[2]},void(4===t.length&&pt(t[3],e[i]));case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"EDATUM":case"ENGINEERINGDATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":case"COMPD_CS":case"COMPOUNDCRS":case"ENGINEERINGCRS":case"ENGCRS":case"FITTED_CS":case"LOCAL_DATUM":case"DATUM":return t[0]=["name",t[0]],void ct(e,i,t);default:for(r=-1;++r<t.length;)if(!Array.isArray(t[r]))return pt(t,e[i]);return ct(e,i,t)}}else e[i]=t;else e[i]=!0}else e[t]=!0}function ft(t){return.017453292519943295*t}function dt(t){var e=new ht(t).output(),i=e.shift(),r=e.shift();e.unshift(["name",r]),e.unshift(["type",i]);var n={};return pt(e,n),function(t){if("GEOGCS"===t.type?t.projName="longlat":"LOCAL_CS"===t.type?(t.projName="identity",t.local=!0):t.projName="object"==typeof t.PROJECTION?Object.keys(t.PROJECTION)[0]:t.PROJECTION,t.AXIS){for(var e="",i=0,r=t.AXIS.length;i<r;++i){var n=[t.AXIS[i][0].toLowerCase(),t.AXIS[i][1].toLowerCase()];-1!==n[0].indexOf("north")||("y"===n[0]||"lat"===n[0])&&"north"===n[1]?e+="n":-1!==n[0].indexOf("south")||("y"===n[0]||"lat"===n[0])&&"south"===n[1]?e+="s":-1!==n[0].indexOf("east")||("x"===n[0]||"lon"===n[0])&&"east"===n[1]?e+="e":-1===n[0].indexOf("west")&&("x"!==n[0]&&"lon"!==n[0]||"west"!==n[1])||(e+="w")}2===e.length&&(e+="u"),3===e.length&&(t.axis=e)}t.UNIT&&(t.units=t.UNIT.name.toLowerCase(),"metre"===t.units&&(t.units="meter"),t.UNIT.convert&&("GEOGCS"===t.type?t.DATUM&&t.DATUM.SPHEROID&&(t.to_meter=t.UNIT.convert*t.DATUM.SPHEROID.a):t.to_meter=t.UNIT.convert));var a=t.GEOGCS;function o(e){return e*(t.to_meter||1)}"GEOGCS"===t.type&&(a=t),a&&(t.datumCode=a.DATUM?a.DATUM.name.toLowerCase():a.name.toLowerCase(),"d_"===t.datumCode.slice(0,2)&&(t.datumCode=t.datumCode.slice(2)),"new_zealand_geodetic_datum_1949"!==t.datumCode&&"new_zealand_1949"!==t.datumCode||(t.datumCode="nzgd49"),"wgs_1984"!==t.datumCode&&"world_geodetic_system_1984"!==t.datumCode||("Mercator_Auxiliary_Sphere"===t.PROJECTION&&(t.sphere=!0),t.datumCode="wgs84"),"_ferro"===t.datumCode.slice(-6)&&(t.datumCode=t.datumCode.slice(0,-6)),"_jakarta"===t.datumCode.slice(-8)&&(t.datumCode=t.datumCode.slice(0,-8)),~t.datumCode.indexOf("belge")&&(t.datumCode="rnb72"),a.DATUM&&a.DATUM.SPHEROID&&(t.ellps=a.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),"international"===t.ellps.toLowerCase().slice(0,13)&&(t.ellps="intl"),t.a=a.DATUM.SPHEROID.a,t.rf=parseFloat(a.DATUM.SPHEROID.rf,10)),a.DATUM&&a.DATUM.TOWGS84&&(t.datum_params=a.DATUM.TOWGS84),~t.datumCode.indexOf("osgb_1936")&&(t.datumCode="osgb36"),~t.datumCode.indexOf("osni_1952")&&(t.datumCode="osni52"),(~t.datumCode.indexOf("tm65")||~t.datumCode.indexOf("geodetic_datum_of_1965"))&&(t.datumCode="ire65"),"ch1903+"===t.datumCode&&(t.datumCode="ch1903"),~t.datumCode.indexOf("israel")&&(t.datumCode="isr93")),t.b&&!isFinite(t.b)&&(t.b=t.a),[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",ft],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",ft],["x0","false_easting",o],["y0","false_northing",o],["long0","central_meridian",ft],["lat0","latitude_of_origin",ft],["lat0","standard_parallel_1",ft],["lat1","standard_parallel_1",ft],["lat2","standard_parallel_2",ft],["azimuth","Azimuth"],["alpha","azimuth",ft],["srsCode","name"]].forEach(function(e){return function(t,e){var i=e[0],r=e[1];!(i in t)&&r in t&&(t[i]=t[r],3===e.length&&(t[i]=e[2](t[i])))}(t,e)}),t.long0||!t.longc||"Albers_Conic_Equal_Area"!==t.projName&&"Lambert_Azimuthal_Equal_Area"!==t.projName||(t.long0=t.longc),t.lat_ts||!t.lat1||"Stereographic_South_Pole"!==t.projName&&"Polar Stereographic (variant B)"!==t.projName?!t.lat_ts&&t.lat0&&"Polar_Stereographic"===t.projName&&(t.lat_ts=t.lat0,t.lat0=ft(t.lat0>0?90:-90)):(t.lat0=ft(t.lat1>0?90:-90),t.lat_ts=t.lat1)}(n),n}function yt(t){var e=this;if(2===arguments.length){var i=arguments[1];yt[t]="string"==typeof i?"+"===i.charAt(0)?nt(arguments[1]):dt(arguments[1]):i}else if(1===arguments.length){if(Array.isArray(t))return t.map(function(t){Array.isArray(t)?yt.apply(e,t):yt(t)});if("string"==typeof t){if(t in yt)return yt[t]}else"EPSG"in t?yt["EPSG:"+t.EPSG]=t:"ESRI"in t?yt["ESRI:"+t.ESRI]=t:"IAU2000"in t?yt["IAU2000:"+t.IAU2000]=t:console.log(t);return}}ht.prototype.readCharicter=function(){var t=this.text[this.place++];if(4!==this.state)for(;at.test(t);){if(this.place>=this.text.length)return;t=this.text[this.place++]}switch(this.state){case 1:return this.neutral(t);case 2:return this.keyword(t);case 4:return this.quoted(t);case 5:return this.afterquote(t);case 3:return this.number(t);case-1:return}},ht.prototype.afterquote=function(t){if('"'===t)return this.word+='"',void(this.state=4);if(lt.test(t))return this.word=this.word.trim(),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in afterquote yet, index '+this.place)},ht.prototype.afterItem=function(t){return","===t?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=1)):"]"===t?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=1,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},ht.prototype.number=function(t){if(!ut.test(t)){if(lt.test(t))return this.word=parseFloat(this.word),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in number yet, index '+this.place)}this.word+=t},ht.prototype.quoted=function(t){'"'!==t?this.word+=t:this.state=5},ht.prototype.keyword=function(t){if(st.test(t))this.word+=t;else{if("["===t){var e=[];return e.push(this.word),this.level++,null===this.root?this.root=e:this.currentObject.push(e),this.stack.push(this.currentObject),this.currentObject=e,void(this.state=1)}if(!lt.test(t))throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place);this.afterItem(t)}},ht.prototype.neutral=function(t){if(ot.test(t))return this.word=t,void(this.state=2);if('"'===t)return this.word="",void(this.state=4);if(ut.test(t))return this.word=t,void(this.state=3);if(!lt.test(t))throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place);this.afterItem(t)},ht.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(-1===this.state)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)},function(t){t("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),t("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),t("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),t.WGS84=t["EPSG:4326"],t["EPSG:3785"]=t["EPSG:3857"],t.GOOGLE=t["EPSG:3857"],t["EPSG:900913"]=t["EPSG:3857"],t["EPSG:102113"]=t["EPSG:3857"]}(yt);var mt=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"],vt=["3857","900913","3785","102113"];function gt(t,e){var i,r;if(t=t||{},!e)return t;for(r in e)void 0!==(i=e[r])&&(t[r]=i);return t}function _t(t,e,i){var r=t*e;return i/Math.sqrt(1-r*r)}function xt(t){return t<0?-1:1}function bt(t){return Math.abs(t)<=$?t:t-xt(t)*Q}function wt(t,e,i){var r=t*i;return r=Math.pow((1-r)/(1+r),.5*t),Math.tan(.5*(K-e))/r}function St(t,e){for(var i,r,n=.5*t,a=K-2*Math.atan(e),o=0;o<=15;o++)if(i=t*Math.sin(a),a+=r=K-2*Math.atan(e*Math.pow((1-i)/(1+i),n))-a,Math.abs(r)<=1e-10)return a;return-9999}function Mt(t){return t}var Et=[{init:function(){var t=this.b/this.a;this.es=1-t*t,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.k0=this.sphere?Math.cos(this.lat_ts):_t(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k0=this.k?this.k:1)},forward:function(t){var e,i,r=t.x,n=t.y;if(n*J>90&&n*J<-90&&r*J>180&&r*J<-180)return null;if(Math.abs(Math.abs(n)-K)<=1e-10)return null;if(this.sphere)e=this.x0+this.a*this.k0*bt(r-this.long0),i=this.y0+this.a*this.k0*Math.log(Math.tan(Y+.5*n));else{var a=Math.sin(n),o=wt(this.e,n,a);e=this.x0+this.a*this.k0*bt(r-this.long0),i=this.y0-this.a*this.k0*Math.log(o)}return t.x=e,t.y=i,t},inverse:function(t){var e,i,r=t.x-this.x0,n=t.y-this.y0;if(this.sphere)i=K-2*Math.atan(Math.exp(-n/(this.a*this.k0)));else{var a=Math.exp(-n/(this.a*this.k0));if(-9999===(i=St(this.e,a)))return null}return e=bt(this.long0+r/(this.a*this.k0)),t.x=e,t.y=i,t},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:Mt,inverse:Mt,names:["longlat","identity"]}],kt={},Tt=[];function It(t,e){var i=Tt.length;return t.names?(Tt[i]=t,t.names.forEach(function(t){kt[t.toLowerCase()]=i}),this):(console.log(e),!0)}var Ct={start:function(){Et.forEach(It)},add:It,get:function(t){if(!t)return!1;var e=t.toLowerCase();return void 0!==kt[e]&&Tt[kt[e]]?Tt[kt[e]]:void 0}},At={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:6378249.2,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"}},Pt=At.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};At.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var Lt={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},militargeographische_institut:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Militar-Geographische Institut"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"}},zt={};function Dt(t){if(0===t.length)return null;var e="@"===t[0];return e&&(t=t.slice(1)),"null"===t?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:t,mandatory:!e,grid:zt[t]||null,isNull:!1}}function Rt(t){return t/3600*Math.PI/180}function Ot(t,e,i){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(e,i)))}function Bt(t){return t.map(function(t){return[Rt(t.longitudeShift),Rt(t.latitudeShift)]})}function Ft(t,e,i){return{name:Ot(t,e+8,e+16).trim(),parent:Ot(t,e+24,e+24+8).trim(),lowerLatitude:t.getFloat64(e+72,i),upperLatitude:t.getFloat64(e+88,i),lowerLongitude:t.getFloat64(e+104,i),upperLongitude:t.getFloat64(e+120,i),latitudeInterval:t.getFloat64(e+136,i),longitudeInterval:t.getFloat64(e+152,i),gridNodeCount:t.getInt32(e+168,i)}}function Vt(t,e,i,r){for(var n=e+176,a=[],o=0;o<i.gridNodeCount;o++){var s={latitudeShift:t.getFloat32(n+16*o,r),longitudeShift:t.getFloat32(n+16*o+4,r),latitudeAccuracy:t.getFloat32(n+16*o+8,r),longitudeAccuracy:t.getFloat32(n+16*o+12,r)};a.push(s)}return a}function Ut(t,e){if(!(this instanceof Ut))return new Ut(t);e=e||function(t){if(t)throw t};var i=function(t){if(!function(t){return"string"==typeof t}(t))return t;if(function(t){return t in yt}(t))return yt[t];if(function(t){return mt.some(function(e){return t.indexOf(e)>-1})}(t)){var e=dt(t);if(function(t){var e=rt(t,"authority");if(e){var i=rt(e,"epsg");return i&&vt.indexOf(i)>-1}}(e))return yt["EPSG:3857"];var i=function(t){var e=rt(t,"extension");if(e)return rt(e,"proj4")}(e);return i?nt(i):e}return function(t){return"+"===t[0]}(t)?nt(t):void 0}(t);if("object"==typeof i){var r=Ut.projections.get(i.projName);if(r){if(i.datumCode&&"none"!==i.datumCode){var n=rt(Lt,i.datumCode);n&&(i.datum_params=i.datum_params||(n.towgs84?n.towgs84.split(","):null),i.ellps=n.ellipse,i.datumName=n.datumName?n.datumName:i.datumCode)}i.k0=i.k0||1,i.axis=i.axis||"enu",i.ellps=i.ellps||"wgs84",i.lat1=i.lat1||i.lat0;var a,o,s,l,u,h,c=function(t,e,i,r,n){if(!t){var a=rt(At,r);a||(a=Pt),t=a.a,e=a.b,i=a.rf}return i&&!e&&(e=(1-1/i)*t),(0===i||Math.abs(t-e)<1e-10)&&(n=!0,e=t),{a:t,b:e,rf:i,sphere:n}}(i.a,i.b,i.rf,i.ellps,i.sphere),p=(u=((s=(a=c.a)*a)-(l=(o=c.b)*o))/s,h=0,i.R_A?(s=(a*=1-u*(.16666666666666666+u*(.04722222222222222+.022156084656084655*u)))*a,u=0):h=Math.sqrt(u),{es:u,e:h,ep2:(s-l)/l}),f=function(t){return void 0===t?null:t.split(",").map(Dt)}(i.nadgrids),d=i.datum||function(t,e,i,r,n,a,o){var s={};return s.datum_type=void 0===t||"none"===t?5:4,e&&(s.datum_params=e.map(parseFloat),0===s.datum_params[0]&&0===s.datum_params[1]&&0===s.datum_params[2]||(s.datum_type=1),s.datum_params.length>3&&(0===s.datum_params[3]&&0===s.datum_params[4]&&0===s.datum_params[5]&&0===s.datum_params[6]||(s.datum_type=2,s.datum_params[3]*=W,s.datum_params[4]*=W,s.datum_params[5]*=W,s.datum_params[6]=s.datum_params[6]/1e6+1))),o&&(s.datum_type=3,s.grids=o),s.a=i,s.b=r,s.es=n,s.ep2=a,s}(i.datumCode,i.datum_params,c.a,c.b,p.es,p.ep2,f);gt(this,i),gt(this,r),this.a=c.a,this.b=c.b,this.rf=c.rf,this.sphere=c.sphere,this.es=p.es,this.e=p.e,this.ep2=p.ep2,this.datum=d,this.init(),e(null,this)}else e("Could not get projection name from: "+t)}else e("Could not parse to valid json: "+t)}function jt(t,e,i){var r,n,a,o=t.x,s=t.y,l=t.z?t.z:0;if(s<-K&&s>-1.001*K)s=-K;else if(s>K&&s<1.001*K)s=K;else{if(s<-K)return{x:-1/0,y:-1/0,z:t.z};if(s>K)return{x:1/0,y:1/0,z:t.z}}return o>Math.PI&&(o-=2*Math.PI),n=Math.sin(s),a=Math.cos(s),{x:((r=i/Math.sqrt(1-e*(n*n)))+l)*a*Math.cos(o),y:(r+l)*a*Math.sin(o),z:(r*(1-e)+l)*n}}function Nt(t,e,i,r){var n,a,o,s,l,u,h,c,p,f,d,y,m,v,g,_=t.x,x=t.y,b=t.z?t.z:0;if(n=Math.sqrt(_*_+x*x),a=Math.sqrt(_*_+x*x+b*b),n/i<1e-12){if(v=0,a/i<1e-12)return g=-r,{x:t.x,y:t.y,z:t.z}}else v=Math.atan2(x,_);o=b/a,c=(s=n/a)*(1-e)*(l=1/Math.sqrt(1-e*(2-e)*s*s)),p=o*l,m=0;do{m++,u=e*(h=i/Math.sqrt(1-e*p*p))/(h+(g=n*c+b*p-h*(1-e*p*p))),y=(d=o*(l=1/Math.sqrt(1-u*(2-u)*s*s)))*c-(f=s*(1-u)*l)*p,c=f,p=d}while(y*y>1e-24&&m<30);return{x:v,y:Math.atan(d/Math.abs(f)),z:g}}function qt(t){return 1===t||2===t}function Gt(t,e,i){if(null===t.grids||0===t.grids.length)return console.log("Grid shift grids not found"),-1;var r={x:-i.x,y:i.y},n={x:Number.NaN,y:Number.NaN},a=[];t:for(var o=0;o<t.grids.length;o++){var s=t.grids[o];if(a.push(s.name),s.isNull){n=r;break}if(null!==s.grid)for(var l=s.grid.subgrids,u=0,h=l.length;u<h;u++){var c=l[u],p=(Math.abs(c.del[1])+Math.abs(c.del[0]))/1e4;if(!(c.ll[1]-p>r.y||c.ll[0]-p>r.x||c.ll[1]+(c.lim[1]-1)*c.del[1]+p<r.y||c.ll[0]+(c.lim[0]-1)*c.del[0]+p<r.x||(n=Zt(r,e,c),isNaN(n.x))))break t}else if(s.mandatory)return console.log("Unable to find mandatory grid '"+s.name+"'"),-1}return isNaN(n.x)?(console.log("Failed to find a grid shift table for location '"+-r.x*J+" "+r.y*J+" tried: '"+a+"'"),-1):(i.x=-n.x,i.y=n.y,0)}function Zt(t,e,i){var r={x:Number.NaN,y:Number.NaN};if(isNaN(t.x))return r;var n={x:t.x,y:t.y};n.x-=i.ll[0],n.y-=i.ll[1],n.x=bt(n.x-Math.PI)+Math.PI;var a=Xt(n,i);if(e){if(isNaN(a.x))return r;a.x=n.x-a.x,a.y=n.y-a.y;var o,s,l=9;do{if(s=Xt(a,i),isNaN(s.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}a.x+=(o={x:n.x-(s.x+a.x),y:n.y-(s.y+a.y)}).x,a.y+=o.y}while(l--&&Math.abs(o.x)>1e-12&&Math.abs(o.y)>1e-12);if(l<0)return console.log("Inverse grid shift iterator failed to converge."),r;r.x=bt(a.x+i.ll[0]),r.y=a.y+i.ll[1]}else isNaN(a.x)||(r.x=t.x+a.x,r.y=t.y+a.y);return r}function Xt(t,e){var i,r={x:t.x/e.del[0],y:t.y/e.del[1]},n=Math.floor(r.x),a=Math.floor(r.y),o=r.x-1*n,s=r.y-1*a,l={x:Number.NaN,y:Number.NaN};if(n<0||n>=e.lim[0])return l;if(a<0||a>=e.lim[1])return l;var u=e.cvs[i=a*e.lim[0]+n][0],h=e.cvs[i][1];i++;var c=e.cvs[i][0],p=e.cvs[i][1],f=e.cvs[i+=e.lim[0]][0],d=e.cvs[i][1];i--;var y=e.cvs[i][1],m=o*s,v=o*(1-s),g=(1-o)*(1-s),_=(1-o)*s;return l.x=g*u+v*c+_*e.cvs[i][0]+m*f,l.y=g*h+v*p+_*y+m*d,l}function Wt(t,e,i){var r,n,a,o=i.x,s=i.y,l=i.z||0,u={};for(a=0;a<3;a++)if(!e||2!==a||void 0!==i.z)switch(0===a?(r=o,n=-1!=="ew".indexOf(t.axis[a])?"x":"y"):1===a?(r=s,n=-1!=="ns".indexOf(t.axis[a])?"y":"x"):(r=l,n="z"),t.axis[a]){case"e":u[n]=r;break;case"w":u[n]=-r;break;case"n":u[n]=r;break;case"s":u[n]=-r;break;case"u":void 0!==i[n]&&(u.z=r);break;case"d":void 0!==i[n]&&(u.z=-r);break;default:return null}return u}function Kt(t){var e={x:t[0],y:t[1]};return t.length>2&&(e.z=t[2]),t.length>3&&(e.m=t[3]),e}function Ht(t){if("function"==typeof Number.isFinite){if(Number.isFinite(t))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof t||t!=t||!isFinite(t))throw new TypeError("coordinates must be finite numbers")}function Jt(t,e,i,r){var n,a=void 0!==(i=Array.isArray(i)?Kt(i):{x:i.x,y:i.y,z:i.z,m:i.m}).z;if(function(t){Ht(t.x),Ht(t.y)}(i),t.datum&&e.datum&&function(t,e){return(1===t.datum.datum_type||2===t.datum.datum_type||3===t.datum.datum_type)&&"WGS84"!==e.datumCode||(1===e.datum.datum_type||2===e.datum.datum_type||3===e.datum.datum_type)&&"WGS84"!==t.datumCode}(t,e)&&(i=Jt(t,n=new Ut("WGS84"),i,r),t=n),r&&"enu"!==t.axis&&(i=Wt(t,!1,i)),"longlat"===t.projName)i={x:i.x*H,y:i.y*H,z:i.z||0};else if(t.to_meter&&(i={x:i.x*t.to_meter,y:i.y*t.to_meter,z:i.z||0}),!(i=t.inverse(i)))return;if(t.from_greenwich&&(i.x+=t.from_greenwich),i=function(t,e,i){if(function(t,e){return t.datum_type===e.datum_type&&!(t.a!==e.a||Math.abs(t.es-e.es)>5e-11)&&(1===t.datum_type?t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]:2!==t.datum_type||t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]&&t.datum_params[3]===e.datum_params[3]&&t.datum_params[4]===e.datum_params[4]&&t.datum_params[5]===e.datum_params[5]&&t.datum_params[6]===e.datum_params[6])}(t,e))return i;if(5===t.datum_type||5===e.datum_type)return i;var r=t.a,n=t.es;if(3===t.datum_type){if(0!==Gt(t,!1,i))return;r=6378137,n=.0066943799901413165}var a=e.a,o=e.b,s=e.es;return 3===e.datum_type&&(a=6378137,o=6356752.314,s=.0066943799901413165),n!==s||r!==a||qt(t.datum_type)||qt(e.datum_type)?(i=jt(i,n,r),qt(t.datum_type)&&(i=function(t,e,i){if(1===e)return{x:t.x+i[0],y:t.y+i[1],z:t.z+i[2]};if(2===e){var r=i[3],n=i[4],a=i[5],o=i[6];return{x:o*(t.x-a*t.y+n*t.z)+i[0],y:o*(a*t.x+t.y-r*t.z)+i[1],z:o*(-n*t.x+r*t.y+t.z)+i[2]}}}(i,t.datum_type,t.datum_params)),qt(e.datum_type)&&(i=function(t,e,i){if(1===e)return{x:t.x-i[0],y:t.y-i[1],z:t.z-i[2]};if(2===e){var r=i[3],n=i[4],a=i[5],o=i[6],s=(t.x-i[0])/o,l=(t.y-i[1])/o,u=(t.z-i[2])/o;return{x:s+a*l-n*u,y:-a*s+l+r*u,z:n*s-r*l+u}}}(i,e.datum_type,e.datum_params)),i=Nt(i,s,a,o),3!==e.datum_type||0===Gt(e,!0,i)?i:void 0):i}(t.datum,e.datum,i))return e.from_greenwich&&(i={x:i.x-e.from_greenwich,y:i.y,z:i.z||0}),"longlat"===e.projName?i={x:i.x*J,y:i.y*J,z:i.z||0}:(i=e.forward(i),e.to_meter&&(i={x:i.x/e.to_meter,y:i.y/e.to_meter,z:i.z||0})),r&&"enu"!==e.axis?Wt(e,!0,i):(i&&!a&&delete i.z,i)}(Ut.projections=Ct).start();var Yt=Ut("WGS84");function Qt(t,e,i,r){var n,a,o;return Array.isArray(i)?(n=Jt(t,e,i,r)||{x:NaN,y:NaN},i.length>2?void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name?"number"==typeof n.z?[n.x,n.y,n.z].concat(i.slice(3)):[n.x,n.y,i[2]].concat(i.slice(3)):[n.x,n.y].concat(i.slice(2)):[n.x,n.y]):(a=Jt(t,e,i,r),2===(o=Object.keys(i)).length||o.forEach(function(r){if(void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name){if("x"===r||"y"===r||"z"===r)return}else if("x"===r||"y"===r)return;a[r]=i[r]}),a)}function $t(t){return t instanceof Ut?t:t.oProj?t.oProj:Ut(t)}function te(t,e,i){t=$t(t);var r,n=!1;return void 0===e?(e=t,t=Yt,n=!0):(void 0!==e.x||Array.isArray(e))&&(i=e,e=t,t=Yt,n=!0),e=$t(e),i?Qt(t,e,i):(r={forward:function(i,r){return Qt(t,e,i,r)},inverse:function(i,r){return Qt(e,t,i,r)}},n&&(r.oProj=e),r)}var ee=65,ie=73,re=79,ne={forward:ae,inverse:function(t){var e=ue(ce(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat,e.lon,e.lat]:[e.left,e.bottom,e.right,e.top]},toPoint:oe};function ae(t,e){return e=e||5,function(t,e){var i,r,n,a,o,s,l,u,h,c,p,f="00000"+t.easting,d="00000"+t.northing;return t.zoneNumber+t.zoneLetter+(h=t.easting,c=t.northing,p=he(t.zoneNumber),i=Math.floor(h/1e5),r=Math.floor(c/1e5)%20,a="AJSAJS".charCodeAt(n=p-1),o="AFAFAF".charCodeAt(n),u=!1,(s=a+i-1)>90&&(s=s-90+ee-1,u=!0),(s===ie||a<ie&&s>ie||(s>ie||a<ie)&&u)&&s++,(s===re||a<re&&s>re||(s>re||a<re)&&u)&&++s===ie&&s++,s>90&&(s=s-90+ee-1),(l=o+r)>86?(l=l-86+ee-1,u=!0):u=!1,(l===ie||o<ie&&l>ie||(l>ie||o<ie)&&u)&&l++,(l===re||o<re&&l>re||(l>re||o<re)&&u)&&++l===ie&&l++,l>86&&(l=l-86+ee-1),String.fromCharCode(s)+String.fromCharCode(l))+f.substr(f.length-5,e)+d.substr(d.length-5,e)}(function(t){var e,i,r,n,a,o,s=t.lat,l=t.lon,u=6378137,h=se(s),c=se(l);o=Math.floor((l+180)/6)+1,180===l&&(o=60),s>=56&&s<64&&l>=3&&l<12&&(o=32),s>=72&&s<84&&(l>=0&&l<9?o=31:l>=9&&l<21?o=33:l>=21&&l<33?o=35:l>=33&&l<42&&(o=37)),a=se(6*(o-1)-180+3),e=u/Math.sqrt(1-.00669438*Math.sin(h)*Math.sin(h)),i=Math.tan(h)*Math.tan(h),r=.006739496752268451*Math.cos(h)*Math.cos(h);var p,f,d=.9996*e*((n=Math.cos(h)*(c-a))+(1-i+r)*n*n*n/6+(5-18*i+i*i+72*r-.39089081163157013)*n*n*n*n*n/120)+5e5,y=.9996*(u*(.9983242984503243*h-.002514607064228144*Math.sin(2*h)+2639046602129982e-21*Math.sin(4*h)-3.418046101696858e-9*Math.sin(6*h))+e*Math.tan(h)*(n*n/2+(5-i+9*r+4*r*r)*n*n*n*n/24+(61-58*i+i*i+600*r-2.2240339282485886)*n*n*n*n*n*n/720));return s<0&&(y+=1e7),{northing:Math.round(y),easting:Math.round(d),zoneNumber:o,zoneLetter:(p=s,f="Z",84>=p&&p>=72?f="X":72>p&&p>=64?f="W":64>p&&p>=56?f="V":56>p&&p>=48?f="U":48>p&&p>=40?f="T":40>p&&p>=32?f="S":32>p&&p>=24?f="R":24>p&&p>=16?f="Q":16>p&&p>=8?f="P":8>p&&p>=0?f="N":0>p&&p>=-8?f="M":-8>p&&p>=-16?f="L":-16>p&&p>=-24?f="K":-24>p&&p>=-32?f="J":-32>p&&p>=-40?f="H":-40>p&&p>=-48?f="G":-48>p&&p>=-56?f="F":-56>p&&p>=-64?f="E":-64>p&&p>=-72?f="D":-72>p&&p>=-80&&(f="C"),f)}}({lat:t[1],lon:t[0]}),e)}function oe(t){var e=ue(ce(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function se(t){return t*(Math.PI/180)}function le(t){return t/Math.PI*180}function ue(t){var e=t.northing,i=t.easting,r=t.zoneLetter,n=t.zoneNumber;if(n<0||n>60)return null;var a,o,s,l,u,h,c,p,f=6378137,d=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),y=i-5e5,m=e;r<"N"&&(m-=1e7),h=6*(n-1)-180+3,p=(c=m/.9996/6367449.145945056)+(3*d/2-27*d*d*d/32)*Math.sin(2*c)+(21*d*d/16-55*d*d*d*d/32)*Math.sin(4*c)+151*d*d*d/96*Math.sin(6*c),a=f/Math.sqrt(1-.00669438*Math.sin(p)*Math.sin(p)),o=Math.tan(p)*Math.tan(p),s=.006739496752268451*Math.cos(p)*Math.cos(p),l=.99330562*f/Math.pow(1-.00669438*Math.sin(p)*Math.sin(p),1.5),u=y/(.9996*a);var v=p-a*Math.tan(p)/l*(u*u/2-(5+3*o+10*s-4*s*s-.06065547077041606)*u*u*u*u/24+(61+90*o+298*s+45*o*o-1.6983531815716497-3*s*s)*u*u*u*u*u*u/720);v=le(v);var g,_=(u-(1+2*o+s)*u*u*u/6+(5-2*s+28*o-3*s*s+.05391597401814761+24*o*o)*u*u*u*u*u/120)/Math.cos(p);if(_=h+le(_),t.accuracy){var x=ue({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});g={top:x.lat,right:x.lon,bottom:v,left:_}}else g={lat:v,lon:_};return g}function he(t){var e=t%6;return 0===e&&(e=6),e}function ce(t){if(t&&0===t.length)throw"MGRSPoint coverting from nothing";for(var e,i=t.length,r=null,n="",a=0;!/[A-Z]/.test(e=t.charAt(a));){if(a>=2)throw"MGRSPoint bad conversion from: "+t;n+=e,a++}var o=parseInt(n,10);if(0===a||a+3>i)throw"MGRSPoint bad conversion from: "+t;var s=t.charAt(a++);if(s<="A"||"B"===s||"Y"===s||s>="Z"||"I"===s||"O"===s)throw"MGRSPoint zone letter "+s+" not handled: "+t;r=t.substring(a,a+=2);for(var l=he(o),u=function(t,e){for(var i="AJSAJS".charCodeAt(l-1),r=1e5,n=!1;i!==t.charCodeAt(0);){if(++i===ie&&i++,i===re&&i++,i>90){if(n)throw"Bad character: "+t;i=ee,n=!0}r+=1e5}return r}(r.charAt(0)),h=function(t,e){if(t>"V")throw"MGRSPoint given invalid Northing "+t;for(var i="AFAFAF".charCodeAt(e-1),r=0,n=!1;i!==t.charCodeAt(0);){if(++i===ie&&i++,i===re&&i++,i>86){if(n)throw"Bad character: "+t;i=ee,n=!0}r+=1e5}return r}(r.charAt(1),l);h<pe(s);)h+=2e6;var c=i-a;if(c%2!=0)throw"MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters"+t;var p,f,d,y=c/2,m=0,v=0;return y>0&&(p=1e5/Math.pow(10,y),f=t.substring(a,a+y),m=parseFloat(f)*p,d=t.substring(a+y),v=parseFloat(d)*p),{easting:m+u,northing:v+h,zoneLetter:s,zoneNumber:o,accuracy:p}}function pe(t){var e;switch(t){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1}if(e>=0)return e;throw"Invalid zone letter: "+t}function fe(t,e,i){if(!(this instanceof fe))return new fe(t,e,i);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if("object"==typeof t)this.x=t.x,this.y=t.y,this.z=t.z||0;else if("string"==typeof t&&void 0===e){var r=t.split(",");this.x=parseFloat(r[0],10),this.y=parseFloat(r[1],10),this.z=parseFloat(r[2],10)||0}else this.x=t,this.y=e,this.z=i||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}fe.fromMGRS=function(t){return new fe(oe(t))},fe.prototype.toMGRS=function(t){return ae([this.x,this.y],t)};var de=.01068115234375;function ye(t){var e=[];e[0]=1-t*(.25+t*(.046875+t*(.01953125+t*de))),e[1]=t*(.75-t*(.046875+t*(.01953125+t*de)));var i=t*t;return e[2]=i*(.46875-t*(.013020833333333334+.007120768229166667*t)),e[3]=(i*=t)*(.3645833333333333-.005696614583333333*t),e[4]=i*t*.3076171875,e}function me(t,e,i,r){return r[0]*t-(i*=e)*(r[1]+(e*=e)*(r[2]+e*(r[3]+e*r[4])))}function ve(t,e,i){for(var r=1/(1-e),n=t,a=20;a;--a){var o=Math.sin(n),s=1-e*o*o;if(n-=s=(me(n,o,Math.cos(n),i)-t)*(s*Math.sqrt(s))*r,Math.abs(s)<1e-10)return n}return n}var ge={init:function(){this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.es&&(this.en=ye(this.es),this.ml0=me(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))},forward:function(t){var e,i,r,n=t.y,a=bt(t.x-this.long0),o=Math.sin(n),s=Math.cos(n);if(this.es){var l=s*a,u=Math.pow(l,2),h=this.ep2*Math.pow(s,2),c=Math.pow(h,2),p=Math.abs(s)>1e-10?Math.tan(n):0,f=Math.pow(p,2),d=Math.pow(f,2);e=1-this.es*Math.pow(o,2),l/=Math.sqrt(e);var y=me(n,o,s,this.en);i=this.a*(this.k0*l*(1+u/6*(1-f+h+u/20*(5-18*f+d+14*h-58*f*h+u/42*(61+179*d-d*f-479*f)))))+this.x0,r=this.a*(this.k0*(y-this.ml0+o*a*l/2*(1+u/12*(5-f+9*h+4*c+u/30*(61+d-58*f+270*h-330*f*h+u/56*(1385+543*d-d*f-3111*f))))))+this.y0}else{var m=s*Math.sin(a);if(Math.abs(Math.abs(m)-1)<1e-10)return 93;if(i=.5*this.a*this.k0*Math.log((1+m)/(1-m))+this.x0,r=s*Math.cos(a)/Math.sqrt(1-Math.pow(m,2)),(m=Math.abs(r))>=1){if(m-1>1e-10)return 93;r=0}else r=Math.acos(r);n<0&&(r=-r),r=this.a*this.k0*(r-this.lat0)+this.y0}return t.x=i,t.y=r,t},inverse:function(t){var e,i,r,n,a=1/this.a*(t.x-this.x0),o=1/this.a*(t.y-this.y0);if(this.es)if(i=ve(e=this.ml0+o/this.k0,this.es,this.en),Math.abs(i)<K){var s=Math.sin(i),l=Math.cos(i),u=Math.abs(l)>1e-10?Math.tan(i):0,h=this.ep2*Math.pow(l,2),c=Math.pow(h,2),p=Math.pow(u,2),f=Math.pow(p,2);e=1-this.es*Math.pow(s,2);var d=a*Math.sqrt(e)/this.k0,y=Math.pow(d,2);r=i-(e*=u)*y/(1-this.es)*.5*(1-y/12*(5+3*p-9*h*p+h-4*c-y/30*(61+90*p-252*h*p+45*f+46*h-y/56*(1385+3633*p+4095*f+1574*f*p)))),n=bt(this.long0+d*(1-y/6*(1+2*p+h-y/20*(5+28*p+24*f+8*h*p+6*h-y/42*(61+662*p+1320*f+720*f*p))))/l)}else r=K*xt(o),n=0;else{var m=Math.exp(a/this.k0),v=.5*(m-1/m),g=Math.cos(this.lat0+o/this.k0);e=Math.sqrt((1-Math.pow(g,2))/(1+Math.pow(v,2))),r=Math.asin(e),o<0&&(r=-r),n=0===v&&0===g?0:bt(Math.atan2(v,g)+this.long0)}return t.x=n,t.y=r,t},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]};function _e(t){var e=Math.exp(t);return(e-1/e)/2}function xe(t,e){t=Math.abs(t),e=Math.abs(e);var i=Math.max(t,e),r=Math.min(t,e)/(i||1);return i*Math.sqrt(1+Math.pow(r,2))}function be(t,e){for(var i,r=2*Math.cos(2*e),n=t.length-1,a=t[n],o=0;--n>=0;)i=r*a-o+t[n],o=a,a=i;return e+i*Math.sin(2*e)}function we(t,e,i){for(var r,n,a=Math.sin(e),o=Math.cos(e),s=_e(i),l=function(t){var e=Math.exp(t);return(e+1/e)/2}(i),u=2*o*l,h=-2*a*s,c=t.length-1,p=t[c],f=0,d=0,y=0;--c>=0;)r=d,n=f,p=u*(d=p)-r-h*(f=y)+t[c],y=h*d-n+u*f;return[(u=a*l)*p-(h=o*s)*y,u*y+h*p]}var Se={init:function(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(ge.init.apply(this),this.forward=ge.forward,this.inverse=ge.inverse),this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es)),e=t/(2-t),i=e;this.cgb[0]=e*(2+e*(-2/3+e*(e*(116/45+e*(26/45+e*(-2854/675)))-2))),this.cbg[0]=e*(e*(2/3+e*(4/3+e*(-82/45+e*(32/45+e*(4642/4725)))))-2),this.cgb[1]=(i*=e)*(7/3+e*(e*(-227/45+e*(2704/315+e*(2323/945)))-1.6)),this.cbg[1]=i*(5/3+e*(-16/15+e*(-13/9+e*(904/315+e*(-1522/945))))),this.cgb[2]=(i*=e)*(56/15+e*(-136/35+e*(-1262/105+e*(73814/2835)))),this.cbg[2]=i*(-26/15+e*(34/21+e*(1.6+e*(-12686/2835)))),this.cgb[3]=(i*=e)*(4279/630+e*(-332/35+e*(-399572/14175))),this.cbg[3]=i*(1237/630+e*(e*(-24832/14175)-2.4)),this.cgb[4]=(i*=e)*(4174/315+e*(-144838/6237)),this.cbg[4]=i*(-734/315+e*(109598/31185)),this.cgb[5]=(i*=e)*(601676/22275),this.cbg[5]=i*(444337/155925),i=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+i*(.25+i*(1/64+i/256))),this.utg[0]=e*(e*(2/3+e*(-37/96+e*(1/360+e*(81/512+e*(-96199/604800)))))-.5),this.gtu[0]=e*(.5+e*(-2/3+e*(5/16+e*(41/180+e*(-127/288+e*(7891/37800)))))),this.utg[1]=i*(-1/48+e*(-1/15+e*(437/1440+e*(-46/105+e*(1118711/3870720))))),this.gtu[1]=i*(13/48+e*(e*(557/1440+e*(281/630+e*(-1983433/1935360)))-.6)),this.utg[2]=(i*=e)*(-17/480+e*(37/840+e*(209/4480+e*(-5569/90720)))),this.gtu[2]=i*(61/240+e*(-103/140+e*(15061/26880+e*(167603/181440)))),this.utg[3]=(i*=e)*(-4397/161280+e*(11/504+e*(830251/7257600))),this.gtu[3]=i*(49561/161280+e*(-179/168+e*(6601661/7257600))),this.utg[4]=(i*=e)*(-4583/161280+e*(108847/3991680)),this.gtu[4]=i*(34729/80640+e*(-3418889/1995840)),this.utg[5]=-.03233083094085698*(i*=e),this.gtu[5]=.6650675310896665*i;var r=be(this.cbg,this.lat0);this.Zb=-this.Qn*(r+function(t,e){for(var i,r=2*Math.cos(e),n=t.length-1,a=t[n],o=0;--n>=0;)i=r*a-o+t[n],o=a,a=i;return Math.sin(e)*i}(this.gtu,2*r))},forward:function(t){var e=bt(t.x-this.long0),i=t.y;i=be(this.cbg,i);var r=Math.sin(i),n=Math.cos(i),a=Math.sin(e),o=Math.cos(e);i=Math.atan2(r,o*n),e=Math.atan2(a*n,xe(r,n*o)),e=function(t){var e=Math.abs(t);return e=function(t){var e=1+t,i=e-1;return 0===i?t:t*Math.log(e)/i}(e*(1+e/(xe(1,e)+1))),t<0?-e:e}(Math.tan(e));var s,l,u=we(this.gtu,2*i,2*e);return i+=u[0],e+=u[1],Math.abs(e)<=2.623395162778?(s=this.a*(this.Qn*e)+this.x0,l=this.a*(this.Qn*i+this.Zb)+this.y0):(s=1/0,l=1/0),t.x=s,t.y=l,t},inverse:function(t){var e,i,r=1/this.a*(t.x-this.x0),n=1/this.a*(t.y-this.y0);if(n=(n-this.Zb)/this.Qn,r/=this.Qn,Math.abs(r)<=2.623395162778){var a=we(this.utg,2*n,2*r);n+=a[0],r+=a[1],r=Math.atan(_e(r));var o=Math.sin(n),s=Math.cos(n),l=Math.sin(r),u=Math.cos(r);n=Math.atan2(o*u,xe(l,u*s)),e=bt((r=Math.atan2(l,u*s))+this.long0),i=be(this.cgb,n)}else e=1/0,i=1/0;return t.x=e,t.y=i,t},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"]},Me={init:function(){var t=function(t,e){if(void 0===t){if((t=Math.floor(30*(bt(e)+Math.PI)/Math.PI)+1)<0)return 0;if(t>60)return 60}return t}(this.zone,this.long0);if(void 0===t)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*H,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,Se.init.apply(this),this.forward=Se.forward,this.inverse=Se.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"};function Ee(t,e){return Math.pow((1-t)/(1+t),e)}var ke={init:function(){var t=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+Y)/(Math.pow(Math.tan(.5*this.lat0+Y),this.C)*Ee(this.e*t,this.ratexp))},forward:function(t){var e=t.x,i=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*i+Y),this.C)*Ee(this.e*Math.sin(i),this.ratexp))-K,t.x=this.C*e,t},inverse:function(t){for(var e=t.x/this.C,i=t.y,r=Math.pow(Math.tan(.5*i+Y)/this.K,1/this.C),n=20;n>0&&(i=2*Math.atan(r*Ee(this.e*Math.sin(t.y),-.5*this.e))-K,!(Math.abs(i-t.y)<1e-14));--n)t.y=i;return n?(t.x=e,t.y=i,t):null},names:["gauss"]},Te={init:function(){ke.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))},forward:function(t){var e,i,r,n;return t.x=bt(t.x-this.long0),ke.forward.apply(this,[t]),e=Math.sin(t.y),i=Math.cos(t.y),r=Math.cos(t.x),t.x=(n=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*i*r))*i*Math.sin(t.x),t.y=n*(this.cosc0*e-this.sinc0*i*r),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){var e,i,r,n,a;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,a=xe(t.x,t.y)){var o=2*Math.atan2(a,this.R2);e=Math.sin(o),i=Math.cos(o),n=Math.asin(i*this.sinc0+t.y*e*this.cosc0/a),r=Math.atan2(t.x*e,a*this.cosc0*i-t.y*this.sinc0*e)}else n=this.phic0,r=0;return t.x=r,t.y=n,ke.inverse.apply(this,[t]),t.x=bt(t.x+this.long0),t},names:["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]},Ie={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=1e-10&&(this.k0=.5*(1+xt(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=1e-10&&(this.con=this.lat0>0?1:-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=1e-10&&Math.abs(Math.cos(this.lat_ts))>1e-10&&(this.k0=.5*this.cons*_t(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/wt(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=_t(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-K,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(t){var e,i,r,n,a,o,s=t.x,l=t.y,u=Math.sin(l),h=Math.cos(l),c=bt(s-this.long0);return Math.abs(Math.abs(s-this.long0)-Math.PI)<=1e-10&&Math.abs(l+this.lat0)<=1e-10?(t.x=NaN,t.y=NaN,t):this.sphere?(e=2*this.k0/(1+this.sinlat0*u+this.coslat0*h*Math.cos(c)),t.x=this.a*e*h*Math.sin(c)+this.x0,t.y=this.a*e*(this.coslat0*u-this.sinlat0*h*Math.cos(c))+this.y0,t):(i=2*Math.atan(this.ssfn_(l,u,this.e))-K,n=Math.cos(i),r=Math.sin(i),Math.abs(this.coslat0)<=1e-10?(a=wt(this.e,l*this.con,this.con*u),t.x=this.x0+(o=2*this.a*this.k0*a/this.cons)*Math.sin(s-this.long0),t.y=this.y0-this.con*o*Math.cos(s-this.long0),t):(Math.abs(this.sinlat0)<1e-10?(e=2*this.a*this.k0/(1+n*Math.cos(c)),t.y=e*r):(e=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*r+this.cosX0*n*Math.cos(c))),t.y=e*(this.cosX0*r-this.sinX0*n*Math.cos(c))+this.y0),t.x=e*n*Math.sin(c)+this.x0,t))},inverse:function(t){var e,i,r,n;t.x-=this.x0,t.y-=this.y0;var a=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var o=2*Math.atan(a/(2*this.a*this.k0));return e=this.long0,i=this.lat0,a<=1e-10?(t.x=e,t.y=i,t):(i=Math.asin(Math.cos(o)*this.sinlat0+t.y*Math.sin(o)*this.coslat0/a),e=Math.abs(this.coslat0)<1e-10?bt(this.lat0>0?this.long0+Math.atan2(t.x,-1*t.y):this.long0+Math.atan2(t.x,t.y)):bt(this.long0+Math.atan2(t.x*Math.sin(o),a*this.coslat0*Math.cos(o)-t.y*this.sinlat0*Math.sin(o))),t.x=e,t.y=i,t)}if(Math.abs(this.coslat0)<=1e-10){if(a<=1e-10)return i=this.lat0,t.x=e=this.long0,t.y=i,t;t.x*=this.con,t.y*=this.con,i=this.con*St(this.e,a*this.cons/(2*this.a*this.k0)),e=this.con*bt(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else r=2*Math.atan(a*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,a<=1e-10?n=this.X0:(n=Math.asin(Math.cos(r)*this.sinX0+t.y*Math.sin(r)*this.cosX0/a),e=bt(this.long0+Math.atan2(t.x*Math.sin(r),a*this.cosX0*Math.cos(r)-t.y*this.sinX0*Math.sin(r)))),i=-1*St(this.e,Math.tan(.5*(K+n)));return t.x=e,t.y=i,t},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)","Polar_Stereographic"],ssfn_:function(t,e,i){return e*=i,Math.tan(.5*(K+t))*Math.pow((1-e)/(1+e),.5*i)}},Ce={init:function(){var t=this.lat0;this.lambda0=this.long0;var e=Math.sin(t),i=this.a,r=1/this.rf,n=2*r-Math.pow(r,2),a=this.e=Math.sqrt(n);this.R=this.k0*i*Math.sqrt(1-n)/(1-n*Math.pow(e,2)),this.alpha=Math.sqrt(1+n/(1-n)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(e/this.alpha);var o=Math.log(Math.tan(Math.PI/4+this.b0/2)),s=Math.log(Math.tan(Math.PI/4+t/2)),l=Math.log((1+a*e)/(1-a*e));this.K=o-this.alpha*s+this.alpha*a/2*l},forward:function(t){var e=Math.log(Math.tan(Math.PI/4-t.y/2)),i=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),r=2*(Math.atan(Math.exp(-this.alpha*(e+i)+this.K))-Math.PI/4),n=this.alpha*(t.x-this.lambda0),a=Math.atan(Math.sin(n)/(Math.sin(this.b0)*Math.tan(r)+Math.cos(this.b0)*Math.cos(n))),o=Math.asin(Math.cos(this.b0)*Math.sin(r)-Math.sin(this.b0)*Math.cos(r)*Math.cos(n));return t.y=this.R/2*Math.log((1+Math.sin(o))/(1-Math.sin(o)))+this.y0,t.x=this.R*a+this.x0,t},inverse:function(t){for(var e=(t.x-this.x0)/this.R,i=2*(Math.atan(Math.exp((t.y-this.y0)/this.R))-Math.PI/4),r=Math.asin(Math.cos(this.b0)*Math.sin(i)+Math.sin(this.b0)*Math.cos(i)*Math.cos(e)),n=Math.atan(Math.sin(e)/(Math.cos(this.b0)*Math.cos(e)-Math.sin(this.b0)*Math.tan(i))),a=this.lambda0+n/this.alpha,o=0,s=r,l=-1e3,u=0;Math.abs(s-l)>1e-7;){if(++u>20)return;o=1/this.alpha*(Math.log(Math.tan(Math.PI/4+r/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(s))/2)),l=s,s=2*Math.atan(Math.exp(o))-Math.PI/2}return t.x=a,t.y=s,t},names:["somerc"]},Ae={init:function(){var t,e,i,r,n,a,o,s,l,u,h,c,p,f=0,d=0,y=0,m=0,v=0,g=0,_=0;this.no_off=(p="object"==typeof(c=this).PROJECTION?Object.keys(c.PROJECTION)[0]:c.PROJECTION,"no_uoff"in c||"no_off"in c||-1!==["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"].indexOf(p)),this.no_rot="no_rot"in this;var x=!1;"alpha"in this&&(x=!0);var b=!1;if("rectified_grid_angle"in this&&(b=!0),x&&(_=this.alpha),b&&(f=this.rectified_grid_angle*H),x||b)d=this.longc;else if(y=this.long1,v=this.lat1,m=this.long2,g=this.lat2,Math.abs(v-g)<=1e-7||(t=Math.abs(v))<=1e-7||Math.abs(t-K)<=1e-7||Math.abs(Math.abs(this.lat0)-K)<=1e-7||Math.abs(Math.abs(g)-K)<=1e-7)throw new Error;var w=1-this.es;e=Math.sqrt(w),Math.abs(this.lat0)>1e-10?(s=Math.sin(this.lat0),i=Math.cos(this.lat0),t=1-this.es*s*s,this.B=i*i,this.B=Math.sqrt(1+this.es*this.B*this.B/w),this.A=this.B*this.k0*e/t,(n=(r=this.B*e/(i*Math.sqrt(t)))*r-1)<=0?n=0:(n=Math.sqrt(n),this.lat0<0&&(n=-n)),this.E=n+=r,this.E*=Math.pow(wt(this.e,this.lat0,s),this.B)):(this.B=1/e,this.A=this.k0,this.E=r=n=1),x||b?(x?(h=Math.asin(Math.sin(_)/r),b||(f=_)):(h=f,_=Math.asin(r*Math.sin(h))),this.lam0=d-Math.asin(.5*(n-1/n)*Math.tan(h))/this.B):(a=Math.pow(wt(this.e,v,Math.sin(v)),this.B),o=Math.pow(wt(this.e,g,Math.sin(g)),this.B),n=this.E/a,l=(o-a)/(o+a),u=((u=this.E*this.E)-o*a)/(u+o*a),(t=y-m)<-Math.pi?m-=Q:t>Math.pi&&(m+=Q),this.lam0=bt(.5*(y+m)-Math.atan(u*Math.tan(.5*this.B*(y-m))/l)/this.B),h=Math.atan(2*Math.sin(this.B*bt(y-this.lam0))/(n-1/n)),f=_=Math.asin(r*Math.sin(h))),this.singam=Math.sin(h),this.cosgam=Math.cos(h),this.sinrot=Math.sin(f),this.cosrot=Math.cos(f),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(r*r-1)/Math.cos(_))),this.lat0<0&&(this.u_0=-this.u_0)),n=.5*h,this.v_pole_n=this.ArB*Math.log(Math.tan(Y-n)),this.v_pole_s=this.ArB*Math.log(Math.tan(Y+n))},forward:function(t){var e,i,r,n,a,o,s,l,u={};if(t.x=t.x-this.lam0,Math.abs(Math.abs(t.y)-K)>1e-10){if(e=.5*((a=this.E/Math.pow(wt(this.e,t.y,Math.sin(t.y)),this.B))-(o=1/a)),i=.5*(a+o),n=Math.sin(this.B*t.x),r=(e*this.singam-n*this.cosgam)/i,Math.abs(Math.abs(r)-1)<1e-10)throw new Error;l=.5*this.ArB*Math.log((1-r)/(1+r)),o=Math.cos(this.B*t.x),s=Math.abs(o)<1e-7?this.A*t.x:this.ArB*Math.atan2(e*this.cosgam+n*this.singam,o)}else l=t.y>0?this.v_pole_n:this.v_pole_s,s=this.ArB*t.y;return this.no_rot?(u.x=s,u.y=l):(u.x=l*this.cosrot+(s-=this.u_0)*this.sinrot,u.y=s*this.cosrot-l*this.sinrot),u.x=this.a*u.x+this.x0,u.y=this.a*u.y+this.y0,u},inverse:function(t){var e,i,r,n,a,o,s,l={};if(t.x=1/this.a*(t.x-this.x0),t.y=1/this.a*(t.y-this.y0),this.no_rot?(i=t.y,e=t.x):(i=t.x*this.cosrot-t.y*this.sinrot,e=t.y*this.cosrot+t.x*this.sinrot+this.u_0),n=.5*((r=Math.exp(-this.BrA*i))-1/r),a=.5*(r+1/r),s=((o=Math.sin(this.BrA*e))*this.cosgam+n*this.singam)/a,Math.abs(Math.abs(s)-1)<1e-10)l.x=0,l.y=s<0?-K:K;else{if(l.y=this.E/Math.sqrt((1+s)/(1-s)),l.y=St(this.e,Math.pow(l.y,1/this.B)),l.y===1/0)throw new Error;l.x=-this.rB*Math.atan2(n*this.cosgam-o*this.singam,Math.cos(this.BrA*e))}return l.x+=this.lam0,l},names:["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"]},Pe={init:function(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<1e-10)){var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var e=Math.sin(this.lat1),i=Math.cos(this.lat1),r=_t(this.e,e,i),n=wt(this.e,this.lat1,e),a=Math.sin(this.lat2),o=Math.cos(this.lat2),s=_t(this.e,a,o),l=wt(this.e,this.lat2,a),u=wt(this.e,this.lat0,Math.sin(this.lat0));this.ns=Math.abs(this.lat1-this.lat2)>1e-10?Math.log(r/s)/Math.log(n/l):e,isNaN(this.ns)&&(this.ns=e),this.f0=r/(this.ns*Math.pow(n,this.ns)),this.rh=this.a*this.f0*Math.pow(u,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(t){var e=t.x,i=t.y;Math.abs(2*Math.abs(i)-Math.PI)<=1e-10&&(i=xt(i)*(K-2e-10));var r,n,a=Math.abs(Math.abs(i)-K);if(a>1e-10)r=wt(this.e,i,Math.sin(i)),n=this.a*this.f0*Math.pow(r,this.ns);else{if((a=i*this.ns)<=0)return null;n=0}var o=this.ns*bt(e-this.long0);return t.x=this.k0*(n*Math.sin(o))+this.x0,t.y=this.k0*(this.rh-n*Math.cos(o))+this.y0,t},inverse:function(t){var e,i,r,n,a,o=(t.x-this.x0)/this.k0,s=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(o*o+s*s),i=1):(e=-Math.sqrt(o*o+s*s),i=-1);var l=0;if(0!==e&&(l=Math.atan2(i*o,i*s)),0!==e||this.ns>0){if(i=1/this.ns,r=Math.pow(e/(this.a*this.f0),i),-9999===(n=St(this.e,r)))return null}else n=-K;return a=bt(l/this.ns+this.long0),t.x=a,t.y=n,t},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"]},Le={init:function(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq},forward:function(t){var e,i,r,n,a,o,s,l=t.y,u=bt(t.x-this.long0);return e=Math.pow((1+this.e*Math.sin(l))/(1-this.e*Math.sin(l)),this.alfa*this.e/2),i=2*(Math.atan(this.k*Math.pow(Math.tan(l/2+this.s45),this.alfa)/e)-this.s45),r=-u*this.alfa,n=Math.asin(Math.cos(this.ad)*Math.sin(i)+Math.sin(this.ad)*Math.cos(i)*Math.cos(r)),a=Math.asin(Math.cos(i)*Math.sin(r)/Math.cos(n)),o=this.n*a,s=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(n/2+this.s45),this.n),t.y=s*Math.cos(o)/1,t.x=s*Math.sin(o)/1,this.czech||(t.y*=-1,t.x*=-1),t},inverse:function(t){var e,i,r,n,a,o,s,l=t.x;t.x=t.y,t.y=l,this.czech||(t.y*=-1,t.x*=-1),a=Math.sqrt(t.x*t.x+t.y*t.y),n=Math.atan2(t.y,t.x)/Math.sin(this.s0),r=2*(Math.atan(Math.pow(this.ro0/a,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(r)-Math.sin(this.ad)*Math.cos(r)*Math.cos(n)),i=Math.asin(Math.cos(r)*Math.sin(n)/Math.cos(e)),t.x=this.long0-i/this.alfa,o=e,s=0;var u=0;do{t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(o))/(1-this.e*Math.sin(o)),this.e/2))-this.s45),Math.abs(o-t.y)<1e-10&&(s=1),o=t.y,u+=1}while(0===s&&u<15);return u>=15?null:t},names:["Krovak","krovak"]};function ze(t,e,i,r,n){return t*n-e*Math.sin(2*n)+i*Math.sin(4*n)-r*Math.sin(6*n)}function De(t){return 1-.25*t*(1+t/16*(3+1.25*t))}function Re(t){return.375*t*(1+.25*t*(1+.46875*t))}function Oe(t){return.05859375*t*t*(1+.75*t)}function Be(t){return t*t*t*(35/3072)}function Fe(t,e,i){var r=e*i;return t/Math.sqrt(1-r*r)}function Ve(t){return Math.abs(t)<K?t:t-xt(t)*Math.PI}function Ue(t,e,i,r,n){var a,o;a=t/e;for(var s=0;s<15;s++)if(a+=o=(t-(e*a-i*Math.sin(2*a)+r*Math.sin(4*a)-n*Math.sin(6*a)))/(e-2*i*Math.cos(2*a)+4*r*Math.cos(4*a)-6*n*Math.cos(6*a)),Math.abs(o)<=1e-10)return a;return NaN}var je={init:function(){this.sphere||(this.e0=De(this.es),this.e1=Re(this.es),this.e2=Oe(this.es),this.e3=Be(this.es),this.ml0=this.a*ze(this.e0,this.e1,this.e2,this.e3,this.lat0))},forward:function(t){var e,i,r=t.x,n=t.y;if(r=bt(r-this.long0),this.sphere)e=this.a*Math.asin(Math.cos(n)*Math.sin(r)),i=this.a*(Math.atan2(Math.tan(n),Math.cos(r))-this.lat0);else{var a=Math.sin(n),o=Math.cos(n),s=Fe(this.a,this.e,a),l=Math.tan(n)*Math.tan(n),u=r*Math.cos(n),h=u*u,c=this.es*o*o/(1-this.es);e=s*u*(1-h*l*(1/6-(8-l+8*c)*h/120)),i=this.a*ze(this.e0,this.e1,this.e2,this.e3,n)-this.ml0+s*a/o*h*(.5+(5-l+6*c)*h/24)}return t.x=e+this.x0,t.y=i+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var e,i,r=t.x/this.a,n=t.y/this.a;if(this.sphere){var a=n+this.lat0;e=Math.asin(Math.sin(a)*Math.cos(r)),i=Math.atan2(Math.tan(r),Math.cos(a))}else{var o=Ue(this.ml0/this.a+n,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(o)-K)<=1e-10)return t.x=this.long0,t.y=K,n<0&&(t.y*=-1),t;var s=Fe(this.a,this.e,Math.sin(o)),l=s*s*s/this.a/this.a*(1-this.es),u=Math.pow(Math.tan(o),2),h=r*this.a/s,c=h*h;e=o-s*Math.tan(o)/l*h*h*(.5-(1+3*u)*h*h/24),i=h*(1-c*(u/3+(1+3*u)*u*c/15))/Math.cos(o)}return t.x=bt(i+this.long0),t.y=Ve(e),t},names:["Cassini","Cassini_Soldner","cass"]};function Ne(t,e){var i;return t>1e-7?(1-t*t)*(e/(1-(i=t*e)*i)-.5/t*Math.log((1-i)/(1+i))):2*e}var qe={init:function(){var t,e=Math.abs(this.lat0);if(this.mode=Math.abs(e-K)<1e-10?this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(e)<1e-10?this.EQUIT:this.OBLIQ,this.es>0)switch(this.qp=Ne(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(t){var e,i=[];return i[0]=.3333333333333333*t,i[0]+=.17222222222222222*(e=t*t),i[1]=.06388888888888888*e,i[0]+=.10257936507936508*(e*=t),i[1]+=.0664021164021164*e,i[2]=.016415012942191543*e,i}(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=Ne(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))},forward:function(t){var e,i,r,n,a,o,s,l,u,h,c=t.x,p=t.y;if(c=bt(c-this.long0),this.sphere){if(a=Math.sin(p),h=Math.cos(p),r=Math.cos(c),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((i=this.mode===this.EQUIT?1+h*r:1+this.sinph0*a+this.cosph0*h*r)<=1e-10)return null;e=(i=Math.sqrt(2/i))*h*Math.sin(c),i*=this.mode===this.EQUIT?a:this.cosph0*a-this.sinph0*h*r}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(r=-r),Math.abs(p+this.lat0)<1e-10)return null;i=Y-.5*p,e=(i=2*(this.mode===this.S_POLE?Math.cos(i):Math.sin(i)))*Math.sin(c),i*=r}}else{switch(s=0,l=0,u=0,r=Math.cos(c),n=Math.sin(c),a=Math.sin(p),o=Ne(this.e,a),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(s=o/this.qp,l=Math.sqrt(1-s*s)),this.mode){case this.OBLIQ:u=1+this.sinb1*s+this.cosb1*l*r;break;case this.EQUIT:u=1+l*r;break;case this.N_POLE:u=K+p,o=this.qp-o;break;case this.S_POLE:u=p-K,o=this.qp+o}if(Math.abs(u)<1e-10)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:u=Math.sqrt(2/u),i=this.mode===this.OBLIQ?this.ymf*u*(this.cosb1*s-this.sinb1*l*r):(u=Math.sqrt(2/(1+l*r)))*s*this.ymf,e=this.xmf*u*l*n;break;case this.N_POLE:case this.S_POLE:o>=0?(e=(u=Math.sqrt(o))*n,i=r*(this.mode===this.S_POLE?u:-u)):e=i=0}}return t.x=this.a*e+this.x0,t.y=this.a*i+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var e,i,r,n,a,o,s,l,u,h,c=t.x/this.a,p=t.y/this.a;if(this.sphere){var f,d=0,y=0;if((i=.5*(f=Math.sqrt(c*c+p*p)))>1)return null;switch(i=2*Math.asin(i),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(y=Math.sin(i),d=Math.cos(i)),this.mode){case this.EQUIT:i=Math.abs(f)<=1e-10?0:Math.asin(p*y/f),c*=y,p=d*f;break;case this.OBLIQ:i=Math.abs(f)<=1e-10?this.lat0:Math.asin(d*this.sinph0+p*y*this.cosph0/f),c*=y*this.cosph0,p=(d-Math.sin(i)*this.sinph0)*f;break;case this.N_POLE:p=-p,i=K-i;break;case this.S_POLE:i-=K}e=0!==p||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(c,p):0}else{if(s=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(c/=this.dd,p*=this.dd,(o=Math.sqrt(c*c+p*p))<1e-10)return t.x=this.long0,t.y=this.lat0,t;n=2*Math.asin(.5*o/this.rq),r=Math.cos(n),c*=n=Math.sin(n),this.mode===this.OBLIQ?(a=this.qp*(s=r*this.sinb1+p*n*this.cosb1/o),p=o*this.cosb1*r-p*this.sinb1*n):(a=this.qp*(s=p*n/o),p=o*r)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(p=-p),!(a=c*c+p*p))return t.x=this.long0,t.y=this.lat0,t;s=1-a/this.qp,this.mode===this.S_POLE&&(s=-s)}e=Math.atan2(c,p),h=(l=Math.asin(s))+l,i=l+(u=this.apa)[0]*Math.sin(h)+u[1]*Math.sin(h+h)+u[2]*Math.sin(h+h+h)}return t.x=bt(this.long0+e),t.y=i,t},names:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4};function Ge(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)}var Ze={init:function(){Math.abs(this.lat1+this.lat2)<1e-10||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=_t(this.e3,this.sin_po,this.cos_po),this.qs1=Ne(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=_t(this.e3,this.sin_po,this.cos_po),this.qs2=Ne(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=Ne(this.e3,this.sin_po),this.ns0=Math.abs(this.lat1-this.lat2)>1e-10?(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)},forward:function(t){var e=t.x,i=t.y;this.sin_phi=Math.sin(i),this.cos_phi=Math.cos(i);var r=Ne(this.e3,this.sin_phi),n=this.a*Math.sqrt(this.c-this.ns0*r)/this.ns0,a=this.ns0*bt(e-this.long0),o=n*Math.sin(a)+this.x0,s=this.rh-n*Math.cos(a)+this.y0;return t.x=o,t.y=s,t},inverse:function(t){var e,i,r,n,a;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(e=Math.sqrt(t.x*t.x+t.y*t.y),i=1):(e=-Math.sqrt(t.x*t.x+t.y*t.y),i=-1),r=0,0!==e&&(r=Math.atan2(i*t.x,i*t.y)),i=e*this.ns0/this.a,a=this.sphere?Math.asin((this.c-i*i)/(2*this.ns0)):this.phi1z(this.e3,(this.c-i*i)/this.ns0),n=bt(r/this.ns0+this.long0),t.x=n,t.y=a,t},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(t,e){var i,r,n,a,o=Ge(.5*e);if(t<1e-10)return o;for(var s=t*t,l=1;l<=25;l++)if(o+=a=.5*(n=1-(r=t*(i=Math.sin(o)))*r)*n/Math.cos(o)*(e/(1-s)-i/n+.5/t*Math.log((1-r)/(1+r))),Math.abs(a)<=1e-7)return o;return null}},Xe={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1},forward:function(t){var e,i,r,n,a,o,s,l=t.y;return r=bt(t.x-this.long0),e=Math.sin(l),i=Math.cos(l),n=Math.cos(r),(a=this.sin_p14*e+this.cos_p14*i*n)>0||Math.abs(a)<=1e-10?(o=this.x0+1*this.a*i*Math.sin(r)/a,s=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*i*n)/a):(o=this.x0+this.infinity_dist*i*Math.sin(r),s=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*i*n)),t.x=o,t.y=s,t},inverse:function(t){var e,i,r,n,a,o;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(e=Math.sqrt(t.x*t.x+t.y*t.y))?(n=Math.atan2(e,this.rc),i=Math.sin(n),o=Ge((r=Math.cos(n))*this.sin_p14+t.y*i*this.cos_p14/e),a=Math.atan2(t.x*i,e*this.cos_p14*r-t.y*this.sin_p14*i),a=bt(this.long0+a)):(o=this.phic0,a=0),t.x=a,t.y=o,t},names:["gnom"]},We={init:function(){this.sphere||(this.k0=_t(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(t){var e,i,r=t.y,n=bt(t.x-this.long0);if(this.sphere)e=this.x0+this.a*n*Math.cos(this.lat_ts),i=this.y0+this.a*Math.sin(r)/Math.cos(this.lat_ts);else{var a=Ne(this.e,Math.sin(r));e=this.x0+this.a*this.k0*n,i=this.y0+this.a*a*.5/this.k0}return t.x=e,t.y=i,t},inverse:function(t){var e,i;return t.x-=this.x0,t.y-=this.y0,this.sphere?(e=bt(this.long0+t.x/this.a/Math.cos(this.lat_ts)),i=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(i=function(t,e){var i=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(e)-i)<1e-6)return e<0?-1*K:K;for(var r,n,a,o,s=Math.asin(.5*e),l=0;l<30;l++)if(n=Math.sin(s),a=Math.cos(s),o=t*n,s+=r=Math.pow(1-o*o,2)/(2*a)*(e/(1-t*t)-n/(1-o*o)+.5/t*Math.log((1-o)/(1+o))),Math.abs(r)<=1e-10)return s;return NaN}(this.e,2*t.y*this.k0/this.a),e=bt(this.long0+t.x/(this.a*this.k0))),t.x=e,t.y=i,t},names:["cea"]},Ke={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)},forward:function(t){var e=t.y,i=bt(t.x-this.long0),r=Ve(e-this.lat0);return t.x=this.x0+this.a*i*this.rc,t.y=this.y0+this.a*r,t},inverse:function(t){var e=t.y;return t.x=bt(this.long0+(t.x-this.x0)/(this.a*this.rc)),t.y=Ve(this.lat0+(e-this.y0)/this.a),t},names:["Equirectangular","Equidistant_Cylindrical","eqc"]},He={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=De(this.es),this.e1=Re(this.es),this.e2=Oe(this.es),this.e3=Be(this.es),this.ml0=this.a*ze(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(t){var e,i,r,n=t.y,a=bt(t.x-this.long0);if(r=a*Math.sin(n),this.sphere)Math.abs(n)<=1e-10?(e=this.a*a,i=-1*this.a*this.lat0):(e=this.a*Math.sin(r)/Math.tan(n),i=this.a*(Ve(n-this.lat0)+(1-Math.cos(r))/Math.tan(n)));else if(Math.abs(n)<=1e-10)e=this.a*a,i=-1*this.ml0;else{var o=Fe(this.a,this.e,Math.sin(n))/Math.tan(n);e=o*Math.sin(r),i=this.a*ze(this.e0,this.e1,this.e2,this.e3,n)-this.ml0+o*(1-Math.cos(r))}return t.x=e+this.x0,t.y=i+this.y0,t},inverse:function(t){var e,i,r,n,a,o,s,l,u;if(r=t.x-this.x0,n=t.y-this.y0,this.sphere)if(Math.abs(n+this.a*this.lat0)<=1e-10)e=bt(r/this.a+this.long0),i=0;else{var h;for(s=r*r/this.a/this.a+(o=this.lat0+n/this.a)*o,l=o,a=20;a;--a)if(l+=u=-1*(o*(l*(h=Math.tan(l))+1)-l-.5*(l*l+s)*h)/((l-o)/h-1),Math.abs(u)<=1e-10){i=l;break}e=bt(this.long0+Math.asin(r*Math.tan(l)/this.a)/Math.sin(i))}else if(Math.abs(n+this.ml0)<=1e-10)i=0,e=bt(this.long0+r/this.a);else{var c,p,f,d,y;for(s=r*r/this.a/this.a+(o=(this.ml0+n)/this.a)*o,l=o,a=20;a;--a)if(y=this.e*Math.sin(l),c=Math.sqrt(1-y*y)*Math.tan(l),p=this.a*ze(this.e0,this.e1,this.e2,this.e3,l),f=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),l-=u=(o*(c*(d=p/this.a)+1)-d-.5*c*(d*d+s))/(this.es*Math.sin(2*l)*(d*d+s-2*o*d)/(4*c)+(o-d)*(c*f-2/Math.sin(2*l))-f),Math.abs(u)<=1e-10){i=l;break}c=Math.sqrt(1-this.es*Math.pow(Math.sin(i),2))*Math.tan(i),e=bt(this.long0+Math.asin(r*c/this.a)/Math.sin(i))}return t.x=e,t.y=i,t},names:["Polyconic","poly"]},Je={init:function(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013},forward:function(t){var e,i=(t.y-this.lat0)/W*1e-5,r=t.x-this.long0,n=1,a=0;for(e=1;e<=10;e++)a+=this.A[e]*(n*=i);var o,s=a,l=r,u=1,h=0,c=0,p=0;for(e=1;e<=6;e++)o=h*s+u*l,c=c+this.B_re[e]*(u=u*s-h*l)-this.B_im[e]*(h=o),p=p+this.B_im[e]*u+this.B_re[e]*h;return t.x=p*this.a+this.x0,t.y=c*this.a+this.y0,t},inverse:function(t){var e,i,r=(t.y-this.y0)/this.a,n=(t.x-this.x0)/this.a,a=1,o=0,s=0,l=0;for(e=1;e<=6;e++)i=o*r+a*n,s=s+this.C_re[e]*(a=a*r-o*n)-this.C_im[e]*(o=i),l=l+this.C_im[e]*a+this.C_re[e]*o;for(var u=0;u<this.iterations;u++){var h,c=s,p=l,f=r,d=n;for(e=2;e<=6;e++)h=p*s+c*l,f+=(e-1)*(this.B_re[e]*(c=c*s-p*l)-this.B_im[e]*(p=h)),d+=(e-1)*(this.B_im[e]*c+this.B_re[e]*p);c=1,p=0;var y=this.B_re[1],m=this.B_im[1];for(e=2;e<=6;e++)h=p*s+c*l,y+=e*(this.B_re[e]*(c=c*s-p*l)-this.B_im[e]*(p=h)),m+=e*(this.B_im[e]*c+this.B_re[e]*p);var v=y*y+m*m;s=(f*y+d*m)/v,l=(d*y-f*m)/v}var g=s,_=l,x=1,b=0;for(e=1;e<=9;e++)b+=this.D[e]*(x*=g);var w=this.lat0+b*W*1e5;return t.x=this.long0+_,t.y=w,t},names:["New_Zealand_Map_Grid","nzmg"]},Ye={init:function(){},forward:function(t){var e=t.y,i=bt(t.x-this.long0),r=this.x0+this.a*i,n=this.y0+this.a*Math.log(Math.tan(Math.PI/4+e/2.5))*1.25;return t.x=r,t.y=n,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var e=bt(this.long0+t.x/this.a),i=2.5*(Math.atan(Math.exp(.8*t.y/this.a))-Math.PI/4);return t.x=e,t.y=i,t},names:["Miller_Cylindrical","mill"]},Qe={init:function(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=ye(this.es)},forward:function(t){var e,i,r=t.x,n=t.y;if(r=bt(r-this.long0),this.sphere){if(this.m)for(var a=this.n*Math.sin(n),o=20;o;--o){var s=(this.m*n+Math.sin(n)-a)/(this.m+Math.cos(n));if(n-=s,Math.abs(s)<1e-10)break}else n=1!==this.n?Math.asin(this.n*Math.sin(n)):n;e=this.a*this.C_x*r*(this.m+Math.cos(n)),i=this.a*this.C_y*n}else{var l=Math.sin(n),u=Math.cos(n);i=this.a*me(n,l,u,this.en),e=this.a*r*u/Math.sqrt(1-this.es*l*l)}return t.x=e,t.y=i,t},inverse:function(t){var e,i,r;return t.x-=this.x0,i=t.x/this.a,t.y-=this.y0,e=t.y/this.a,this.sphere?(e/=this.C_y,i/=this.C_x*(this.m+Math.cos(e)),this.m?e=Ge((this.m*e+Math.sin(e))/this.n):1!==this.n&&(e=Ge(Math.sin(e)/this.n)),i=bt(i+this.long0),e=Ve(e)):(e=ve(t.y/this.a,this.es,this.en),(r=Math.abs(e))<K?(r=Math.sin(e),i=bt(this.long0+t.x*Math.sqrt(1-this.es*r*r)/(this.a*Math.cos(e)))):r-1e-10<K&&(i=this.long0)),t.x=i,t.y=e,t},names:["Sinusoidal","sinu"]},$e={init:function(){},forward:function(t){for(var e=t.y,i=bt(t.x-this.long0),r=e,n=Math.PI*Math.sin(e);;){var a=-(r+Math.sin(r)-n)/(1+Math.cos(r));if(r+=a,Math.abs(a)<1e-10)break}r/=2,Math.PI/2-Math.abs(e)<1e-10&&(i=0);var o=.900316316158*this.a*i*Math.cos(r)+this.x0,s=1.4142135623731*this.a*Math.sin(r)+this.y0;return t.x=o,t.y=s,t},inverse:function(t){var e,i;t.x-=this.x0,t.y-=this.y0,i=t.y/(1.4142135623731*this.a),Math.abs(i)>.999999999999&&(i=.999999999999),e=Math.asin(i);var r=bt(this.long0+t.x/(.900316316158*this.a*Math.cos(e)));r<-Math.PI&&(r=-Math.PI),r>Math.PI&&(r=Math.PI),i=(2*e+Math.sin(2*e))/Math.PI,Math.abs(i)>1&&(i=1);var n=Math.asin(i);return t.x=r,t.y=n,t},names:["Mollweide","moll"]},ti={init:function(){Math.abs(this.lat1+this.lat2)<1e-10||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=De(this.es),this.e1=Re(this.es),this.e2=Oe(this.es),this.e3=Be(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=_t(this.e,this.sinphi,this.cosphi),this.ml1=ze(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<1e-10?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=_t(this.e,this.sinphi,this.cosphi),this.ml2=ze(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=ze(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))},forward:function(t){var e,i=t.x,r=t.y;if(this.sphere)e=this.a*(this.g-r);else{var n=ze(this.e0,this.e1,this.e2,this.e3,r);e=this.a*(this.g-n)}var a=this.ns*bt(i-this.long0),o=this.x0+e*Math.sin(a),s=this.y0+this.rh-e*Math.cos(a);return t.x=o,t.y=s,t},inverse:function(t){var e,i,r,n;t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns>=0?(i=Math.sqrt(t.x*t.x+t.y*t.y),e=1):(i=-Math.sqrt(t.x*t.x+t.y*t.y),e=-1);var a=0;return 0!==i&&(a=Math.atan2(e*t.x,e*t.y)),this.sphere?(n=bt(this.long0+a/this.ns),r=Ve(this.g-i/this.a),t.x=n,t.y=r,t):(r=Ue(this.g-i/this.a,this.e0,this.e1,this.e2,this.e3),n=bt(this.long0+a/this.ns),t.x=n,t.y=r,t)},names:["Equidistant_Conic","eqdc"]},ei={init:function(){this.R=this.a},forward:function(t){var e,i,r=t.y,n=bt(t.x-this.long0);Math.abs(r)<=1e-10&&(e=this.x0+this.R*n,i=this.y0);var a=Ge(2*Math.abs(r/Math.PI));(Math.abs(n)<=1e-10||Math.abs(Math.abs(r)-K)<=1e-10)&&(e=this.x0,i=r>=0?this.y0+Math.PI*this.R*Math.tan(.5*a):this.y0+Math.PI*this.R*-Math.tan(.5*a));var o=.5*Math.abs(Math.PI/n-n/Math.PI),s=o*o,l=Math.sin(a),u=Math.cos(a),h=u/(l+u-1),c=h*(2/l-1),p=c*c,f=Math.PI*this.R*(o*(h-p)+Math.sqrt(s*(h-p)*(h-p)-(p+s)*(h*h-p)))/(p+s);n<0&&(f=-f),e=this.x0+f;var d=s+h;return f=Math.PI*this.R*(c*d-o*Math.sqrt((p+s)*(s+1)-d*d))/(p+s),i=r>=0?this.y0+f:this.y0-f,t.x=e,t.y=i,t},inverse:function(t){var e,i,r,n,a,o,s,l,u,h,c,p;return t.x-=this.x0,t.y-=this.y0,c=Math.PI*this.R,a=(r=t.x/c)*r+(n=t.y/c)*n,c=3*(n*n/(l=-2*(o=-Math.abs(n)*(1+a))+1+2*n*n+a*a)+(2*(s=o-2*n*n+r*r)*s*s/l/l/l-9*o*s/l/l)/27)/(u=(o-s*s/3/l)/l)/(h=2*Math.sqrt(-u/3)),Math.abs(c)>1&&(c=c>=0?1:-1),p=Math.acos(c)/3,i=t.y>=0?(-h*Math.cos(p+Math.PI/3)-s/3/l)*Math.PI:-(-h*Math.cos(p+Math.PI/3)-s/3/l)*Math.PI,e=Math.abs(r)<1e-10?this.long0:bt(this.long0+Math.PI*(a-1+Math.sqrt(1+2*(r*r-n*n)+a*a))/2/r),t.x=e,t.y=i,t},names:["Van_der_Grinten_I","VanDerGrinten","vandg"]},ii={init:function(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)},forward:function(t){var e,i,r,n,a,o,s,l,u,h,c,p,f,d,y,m,v,g,_,x,b,w,S=t.x,M=t.y,E=Math.sin(t.y),k=Math.cos(t.y),T=bt(S-this.long0);return this.sphere?Math.abs(this.sin_p12-1)<=1e-10?(t.x=this.x0+this.a*(K-M)*Math.sin(T),t.y=this.y0-this.a*(K-M)*Math.cos(T),t):Math.abs(this.sin_p12+1)<=1e-10?(t.x=this.x0+this.a*(K+M)*Math.sin(T),t.y=this.y0+this.a*(K+M)*Math.cos(T),t):(g=this.sin_p12*E+this.cos_p12*k*Math.cos(T),v=(m=Math.acos(g))?m/Math.sin(m):1,t.x=this.x0+this.a*v*k*Math.sin(T),t.y=this.y0+this.a*v*(this.cos_p12*E-this.sin_p12*k*Math.cos(T)),t):(e=De(this.es),i=Re(this.es),r=Oe(this.es),n=Be(this.es),Math.abs(this.sin_p12-1)<=1e-10?(a=this.a*ze(e,i,r,n,K),o=this.a*ze(e,i,r,n,M),t.x=this.x0+(a-o)*Math.sin(T),t.y=this.y0-(a-o)*Math.cos(T),t):Math.abs(this.sin_p12+1)<=1e-10?(a=this.a*ze(e,i,r,n,K),o=this.a*ze(e,i,r,n,M),t.x=this.x0+(a+o)*Math.sin(T),t.y=this.y0+(a+o)*Math.cos(T),t):(s=E/k,l=Fe(this.a,this.e,this.sin_p12),u=Fe(this.a,this.e,E),h=Math.atan((1-this.es)*s+this.es*l*this.sin_p12/(u*k)),_=0===(c=Math.atan2(Math.sin(T),this.cos_p12*Math.tan(h)-this.sin_p12*Math.cos(T)))?Math.asin(this.cos_p12*Math.sin(h)-this.sin_p12*Math.cos(h)):Math.abs(Math.abs(c)-Math.PI)<=1e-10?-Math.asin(this.cos_p12*Math.sin(h)-this.sin_p12*Math.cos(h)):Math.asin(Math.sin(T)*Math.cos(h)/Math.sin(c)),p=this.e*this.sin_p12/Math.sqrt(1-this.es),f=this.e*this.cos_p12*Math.cos(c)/Math.sqrt(1-this.es),t.x=this.x0+(m=l*_*(1-(x=_*_)*(y=f*f)*(1-y)/6+(b=x*_)/8*(d=p*f)*(1-2*y)+(w=b*_)/120*(y*(4-7*y)-3*p*p*(1-7*y))-w*_/48*d))*Math.sin(c),t.y=this.y0+m*Math.cos(c),t))},inverse:function(t){var e,i,r,n,a,o,s,l,u,h,c,p,f,d,y,m,v,g,_,x,b,w,S;if(t.x-=this.x0,t.y-=this.y0,this.sphere){if((e=Math.sqrt(t.x*t.x+t.y*t.y))>2*K*this.a)return;return i=e/this.a,r=Math.sin(i),n=Math.cos(i),a=this.long0,Math.abs(e)<=1e-10?o=this.lat0:(o=Ge(n*this.sin_p12+t.y*r*this.cos_p12/e),s=Math.abs(this.lat0)-K,a=Math.abs(s)<=1e-10?bt(this.lat0>=0?this.long0+Math.atan2(t.x,-t.y):this.long0-Math.atan2(-t.x,t.y)):bt(this.long0+Math.atan2(t.x*r,e*this.cos_p12*n-t.y*this.sin_p12*r))),t.x=a,t.y=o,t}return l=De(this.es),u=Re(this.es),h=Oe(this.es),c=Be(this.es),Math.abs(this.sin_p12-1)<=1e-10?(o=Ue(((p=this.a*ze(l,u,h,c,K))-(e=Math.sqrt(t.x*t.x+t.y*t.y)))/this.a,l,u,h,c),a=bt(this.long0+Math.atan2(t.x,-1*t.y)),t.x=a,t.y=o,t):Math.abs(this.sin_p12+1)<=1e-10?(p=this.a*ze(l,u,h,c,K),o=Ue(((e=Math.sqrt(t.x*t.x+t.y*t.y))-p)/this.a,l,u,h,c),a=bt(this.long0+Math.atan2(t.x,t.y)),t.x=a,t.y=o,t):(e=Math.sqrt(t.x*t.x+t.y*t.y),y=Math.atan2(t.x,t.y),f=Fe(this.a,this.e,this.sin_p12),m=Math.cos(y),_=3*this.es*(1-(g=-(v=this.e*this.cos_p12*m)*v/(1-this.es)))*this.sin_p12*this.cos_p12*m/(1-this.es),w=1-g*(b=(x=e/f)-g*(1+g)*Math.pow(x,3)/6-_*(1+3*g)*Math.pow(x,4)/24)*b/2-x*b*b*b/6,d=Math.asin(this.sin_p12*Math.cos(b)+this.cos_p12*Math.sin(b)*m),a=bt(this.long0+Math.asin(Math.sin(y)*Math.sin(b)/Math.cos(d))),S=Math.sin(d),o=Math.atan2((S-this.es*w*this.sin_p12)*Math.tan(d),S*(1-this.es)),t.x=a,t.y=o,t)},names:["Azimuthal_Equidistant","aeqd"]},ri={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(t){var e,i,r,n,a,o,s,l=t.y;return r=bt(t.x-this.long0),e=Math.sin(l),i=Math.cos(l),n=Math.cos(r),((a=this.sin_p14*e+this.cos_p14*i*n)>0||Math.abs(a)<=1e-10)&&(o=1*this.a*i*Math.sin(r),s=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*i*n)),t.x=o,t.y=s,t},inverse:function(t){var e,i,r,n,a,o,s;return t.x-=this.x0,t.y-=this.y0,i=Ge((e=Math.sqrt(t.x*t.x+t.y*t.y))/this.a),r=Math.sin(i),n=Math.cos(i),o=this.long0,Math.abs(e)<=1e-10?(s=this.lat0,t.x=o,t.y=s,t):(s=Ge(n*this.sin_p14+t.y*r*this.cos_p14/e),a=Math.abs(this.lat0)-K,Math.abs(a)<=1e-10?(o=bt(this.lat0>=0?this.long0+Math.atan2(t.x,-t.y):this.long0-Math.atan2(-t.x,t.y)),t.x=o,t.y=s,t):(o=bt(this.long0+Math.atan2(t.x*r,e*this.cos_p14*n-t.y*this.sin_p14*r)),t.x=o,t.y=s,t))},names:["ortho"]};function ni(t,e,i,r){var n;return t<1e-10?(r.value=1,n=0):(n=Math.atan2(e,i),Math.abs(n)<=Y?r.value=1:n>Y&&n<=K+Y?(r.value=2,n-=K):n>K+Y||n<=-(K+Y)?(r.value=3,n=n>=0?n-$:n+$):(r.value=4,n+=K)),n}function ai(t,e){var i=t+e;return i<-$?i+=Q:i>+$&&(i-=Q),i}var oi={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.face=this.lat0>=K-Y/2?5:this.lat0<=-(K-Y/2)?6:Math.abs(this.long0)<=Y?1:Math.abs(this.long0)<=K+Y?this.long0>0?2:4:3,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)},forward:function(t){var e,i,r,n,a,o,s={x:0,y:0},l={value:0};if(t.x-=this.long0,e=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(t.y)):t.y,i=t.x,5===this.face)n=K-e,i>=Y&&i<=K+Y?(l.value=1,r=i-K):i>K+Y||i<=-(K+Y)?(l.value=2,r=i>0?i-$:i+$):i>-(K+Y)&&i<=-Y?(l.value=3,r=i+K):(l.value=4,r=i);else if(6===this.face)n=K+e,i>=Y&&i<=K+Y?(l.value=1,r=-i+K):i<Y&&i>=-Y?(l.value=2,r=-i):i<-Y&&i>=-(K+Y)?(l.value=3,r=-i-K):(l.value=4,r=i>0?-i+$:-i-$);else{var u,h,c,p,f,d;2===this.face?i=ai(i,+K):3===this.face?i=ai(i,+$):4===this.face&&(i=ai(i,-K)),p=Math.sin(e),f=Math.cos(e),d=Math.sin(i),u=f*Math.cos(i),h=f*d,c=p,1===this.face?r=ni(n=Math.acos(u),c,h,l):2===this.face?r=ni(n=Math.acos(h),c,-u,l):3===this.face?r=ni(n=Math.acos(-u),c,-h,l):4===this.face?r=ni(n=Math.acos(-h),c,u,l):(n=r=0,l.value=1)}return o=Math.atan(12/$*(r+Math.acos(Math.sin(r)*Math.cos(Y))-K)),a=Math.sqrt((1-Math.cos(n))/(Math.cos(o)*Math.cos(o))/(1-Math.cos(Math.atan(1/Math.cos(r))))),2===l.value?o+=K:3===l.value?o+=$:4===l.value&&(o+=1.5*$),s.x=a*Math.cos(o),s.y=a*Math.sin(o),s.x=s.x*this.a+this.x0,s.y=s.y*this.a+this.y0,t.x=s.x,t.y=s.y,t},inverse:function(t){var e,i,r,n,a,o,s,l,u,h,c,p,f={lam:0,phi:0},d={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,i=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),e=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?d.value=1:t.y>=0&&t.y>=Math.abs(t.x)?(d.value=2,e-=K):t.x<0&&-t.x>=Math.abs(t.y)?(d.value=3,e=e<0?e+$:e-$):(d.value=4,e+=K),u=$/12*Math.tan(e),a=Math.sin(u)/(Math.cos(u)-1/Math.sqrt(2)),o=Math.atan(a),(s=1-(r=Math.cos(e))*r*(n=Math.tan(i))*n*(1-Math.cos(Math.atan(1/Math.cos(o)))))<-1?s=-1:s>1&&(s=1),5===this.face)l=Math.acos(s),f.phi=K-l,f.lam=1===d.value?o+K:2===d.value?o<0?o+$:o-$:3===d.value?o-K:o;else if(6===this.face)l=Math.acos(s),f.phi=l-K,f.lam=1===d.value?-o+K:2===d.value?-o:3===d.value?-o-K:o<0?-o-$:-o+$;else{var y,m,v;u=(y=s)*y,m=(u+=(v=u>=1?0:Math.sqrt(1-u)*Math.sin(o))*v)>=1?0:Math.sqrt(1-u),2===d.value?(u=m,m=-v,v=u):3===d.value?(m=-m,v=-v):4===d.value&&(u=m,m=v,v=-u),2===this.face?(u=y,y=-m,m=u):3===this.face?(y=-y,m=-m):4===this.face&&(u=y,y=m,m=-u),f.phi=Math.acos(-v)-K,f.lam=Math.atan2(m,y),2===this.face?f.lam=ai(f.lam,-K):3===this.face?f.lam=ai(f.lam,-$):4===this.face&&(f.lam=ai(f.lam,+K))}return 0!==this.es&&(h=f.phi<0?1:0,c=Math.tan(f.phi),p=this.b/Math.sqrt(c*c+this.one_minus_f_squared),f.phi=Math.atan(Math.sqrt(this.a*this.a-p*p)/(this.one_minus_f*p)),h&&(f.phi=-f.phi)),f.lam+=this.long0,t.x=f.lam,t.y=f.phi,t},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]},si=[[1,2.2199e-17,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],li=[[-5.20417e-18,.0124,1.21431e-18,-8.45284e-11],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],ui=function(t,e){return t[0]+e*(t[1]+e*(t[2]+e*t[3]))},hi={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"},forward:function(t){var e=bt(t.x-this.long0),i=Math.abs(t.y),r=Math.floor(11.459155902616464*i);r<0?r=0:r>=18&&(r=17);var n={x:ui(si[r],i=J*(i-.08726646259971647*r))*e,y:ui(li[r],i)};return t.y<0&&(n.y=-n.y),n.x=n.x*this.a*.8487+this.x0,n.y=n.y*this.a*1.3523+this.y0,n},inverse:function(t){var e={x:(t.x-this.x0)/(.8487*this.a),y:Math.abs(t.y-this.y0)/(1.3523*this.a)};if(e.y>=1)e.x/=si[18][0],e.y=t.y<0?-K:K;else{var i=Math.floor(18*e.y);for(i<0?i=0:i>=18&&(i=17);;)if(li[i][0]>e.y)--i;else{if(!(li[i+1][0]<=e.y))break;++i}var r=li[i],n=5*(e.y-r[0])/(li[i+1][0]-r[0]);n=function(t,e,i,r){for(var n=e;r;--r){var a=t(n);if(n-=a,Math.abs(a)<1e-10)break}return n}(function(t){return(ui(r,t)-e.y)/function(t,e){return t[1]+e*(2*t[2]+3*e*t[3])}(r,t)},n,0,100),e.x/=ui(si[i],n),e.y=(5*i+n)*H,t.y<0&&(e.y=-e.y)}return e.x=bt(e.x+this.long0),e},names:["Robinson","robin"]},ci={init:function(){this.name="geocent"},forward:function(t){return jt(t,this.es,this.a)},inverse:function(t){return Nt(t,this.es,this.a,this.b)},names:["Geocentric","geocentric","geocent","Geocent"]},pi={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}},fi={init:function(){if(Object.keys(pi).forEach(function(t){if(void 0===this[t])this[t]=pi[t].def;else{if(pi[t].num&&isNaN(this[t]))throw new Error("Invalid parameter value, must be numeric "+t+" = "+this[t]);pi[t].num&&(this[t]=parseFloat(this[t]))}pi[t].degrees&&(this[t]=this[t]*H)}.bind(this)),Math.abs(Math.abs(this.lat0)-K)<1e-10?this.mode=this.lat0<0?1:0:Math.abs(this.lat0)<1e-10?this.mode=2:(this.mode=3,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var t=this.tilt,e=this.azi;this.cg=Math.cos(e),this.sg=Math.sin(e),this.cw=Math.cos(t),this.sw=Math.sin(t)},forward:function(t){t.x-=this.long0;var e,i,r,n,a=Math.sin(t.y),o=Math.cos(t.y),s=Math.cos(t.x);switch(this.mode){case 3:i=this.sinph0*a+this.cosph0*o*s;break;case 2:i=o*s;break;case 1:i=-a;break;case 0:i=a}switch(e=(i=this.pn1/(this.p-i))*o*Math.sin(t.x),this.mode){case 3:i*=this.cosph0*a-this.sinph0*o*s;break;case 2:i*=a;break;case 0:i*=-o*s;break;case 1:i*=o*s}return e=(e*this.cg-i*this.sg)*this.cw*(n=1/((r=i*this.cg+e*this.sg)*this.sw*this.h1+this.cw)),i=r*n,t.x=e*this.a,t.y=i*this.a,t},inverse:function(t){t.x/=this.a,t.y/=this.a;var e,i,r,n={x:t.x,y:t.y};t.x=(e=this.pn1*t.x*(r=1/(this.pn1-t.y*this.sw)))*this.cg+(i=this.pn1*t.y*this.cw*r)*this.sg,t.y=i*this.cg-e*this.sg;var a=xe(t.x,t.y);if(Math.abs(a)<1e-10)n.x=0,n.y=t.y;else{var o,s;switch(s=1-a*a*this.pfact,s=(this.p-Math.sqrt(s))/(this.pn1/a+a/this.pn1),o=Math.sqrt(1-s*s),this.mode){case 3:n.y=Math.asin(o*this.sinph0+t.y*s*this.cosph0/a),t.y=(o-this.sinph0*Math.sin(n.y))*a,t.x*=s*this.cosph0;break;case 2:n.y=Math.asin(t.y*s/a),t.y=o*a,t.x*=s;break;case 0:n.y=Math.asin(o),t.y=-t.y;break;case 1:n.y=-Math.asin(o)}n.x=Math.atan2(t.x,t.y)}return t.x=n.x+this.long0,t.y=n.y,t},names:["Tilted_Perspective","tpers"]},di={init:function(){if(this.flip_axis="x"===this.sweep?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,0!==this.es){var t=1-this.es,e=1/t;this.radius_p=Math.sqrt(t),this.radius_p2=t,this.radius_p_inv2=e,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")},forward:function(t){var e,i,r,n,a=t.x,o=t.y;if(a-=this.long0,"ellipse"===this.shape){o=Math.atan(this.radius_p2*Math.tan(o));var s=this.radius_p/xe(this.radius_p*Math.cos(o),Math.sin(o));if(i=s*Math.cos(a)*Math.cos(o),r=s*Math.sin(a)*Math.cos(o),n=s*Math.sin(o),(this.radius_g-i)*i-r*r-n*n*this.radius_p_inv2<0)return t.x=Number.NaN,t.y=Number.NaN,t;e=this.radius_g-i,this.flip_axis?(t.x=this.radius_g_1*Math.atan(r/xe(n,e)),t.y=this.radius_g_1*Math.atan(n/e)):(t.x=this.radius_g_1*Math.atan(r/e),t.y=this.radius_g_1*Math.atan(n/xe(r,e)))}else"sphere"===this.shape&&(e=Math.cos(o),i=Math.cos(a)*e,r=Math.sin(a)*e,n=Math.sin(o),e=this.radius_g-i,this.flip_axis?(t.x=this.radius_g_1*Math.atan(r/xe(n,e)),t.y=this.radius_g_1*Math.atan(n/e)):(t.x=this.radius_g_1*Math.atan(r/e),t.y=this.radius_g_1*Math.atan(n/xe(r,e))));return t.x=t.x*this.a,t.y=t.y*this.a,t},inverse:function(t){var e,i,r,n,a=-1,o=0,s=0;if(t.x=t.x/this.a,t.y=t.y/this.a,"ellipse"===this.shape){this.flip_axis?(s=Math.tan(t.y/this.radius_g_1),o=Math.tan(t.x/this.radius_g_1)*xe(1,s)):(o=Math.tan(t.x/this.radius_g_1),s=Math.tan(t.y/this.radius_g_1)*xe(1,o));var l=s/this.radius_p;if((r=(i=2*this.radius_g*a)*i-4*(e=o*o+l*l+a*a)*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;n=(-i-Math.sqrt(r))/(2*e),a=this.radius_g+n*a,o*=n,s*=n,t.x=Math.atan2(o,a),t.y=Math.atan(s*Math.cos(t.x)/a),t.y=Math.atan(this.radius_p_inv2*Math.tan(t.y))}else if("sphere"===this.shape){if(this.flip_axis?(s=Math.tan(t.y/this.radius_g_1),o=Math.tan(t.x/this.radius_g_1)*Math.sqrt(1+s*s)):(o=Math.tan(t.x/this.radius_g_1),s=Math.tan(t.y/this.radius_g_1)*Math.sqrt(1+o*o)),(r=(i=2*this.radius_g*a)*i-4*(e=o*o+s*s+a*a)*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;n=(-i-Math.sqrt(r))/(2*e),a=this.radius_g+n*a,o*=n,s*=n,t.x=Math.atan2(o,a),t.y=Math.atan(s*Math.cos(t.x)/a)}return t.x=t.x+this.long0,t},names:["Geostationary Satellite View","Geostationary_Satellite","geos"]},yi=1.340264,mi=-.081106,vi=893e-6,gi=.003796,_i=Math.sqrt(3)/2,xi={init:function(){this.es=0,this.long0=void 0!==this.long0?this.long0:0},forward:function(t){var e=bt(t.x-this.long0),i=Math.asin(_i*Math.sin(t.y)),r=i*i,n=r*r*r;return t.x=e*Math.cos(i)/(_i*(yi+3*mi*r+n*(7*vi+9*gi*r))),t.y=i*(yi+mi*r+n*(vi+gi*r)),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a;var e,i,r,n,a=t.y;for(n=0;n<12&&(a-=r=(a*(yi+mi*(e=a*a)+(i=e*e*e)*(vi+gi*e))-t.y)/(yi+3*mi*e+i*(7*vi+9*gi*e)),!(Math.abs(r)<1e-9));++n);return t.x=_i*t.x*(yi+3*mi*(e=a*a)+(i=e*e*e)*(7*vi+9*gi*e))/Math.cos(a),t.y=Math.asin(Math.sin(a)/_i),t.x=bt(t.x+this.long0),t},names:["eqearth","Equal Earth","Equal_Earth"]};function bi(t){var e,i,r,n=bt(t.x-(this.long0||0)),a=t.y;return e=this.am1+this.m1-me(a,i=Math.sin(a),r=Math.cos(a),this.en),i=r*n/(e*Math.sqrt(1-this.es*i*i)),t.x=e*Math.sin(i),t.y=this.am1-e*Math.cos(i),t.x=this.a*t.x+(this.x0||0),t.y=this.a*t.y+(this.y0||0),t}function wi(t){var e,i,r,n;if(t.x=(t.x-(this.x0||0))/this.a,t.y=(t.y-(this.y0||0))/this.a,i=xe(t.x,t.y=this.am1-t.y),n=ve(this.am1+this.m1-i,this.es,this.en),(e=Math.abs(n))<K)e=Math.sin(n),r=i*Math.atan2(t.x,t.y)*Math.sqrt(1-this.es*e*e)/Math.cos(n);else{if(!(Math.abs(e-K)<=1e-10))throw new Error;r=0}return t.x=bt(r+(this.long0||0)),t.y=Ve(n),t}function Si(t){var e,i,r=bt(t.x-(this.long0||0)),n=t.y;return i=this.cphi1+this.phi1-n,Math.abs(i)>1e-10?(t.x=i*Math.sin(e=r*Math.cos(n)/i),t.y=this.cphi1-i*Math.cos(e)):t.x=t.y=0,t.x=this.a*t.x+(this.x0||0),t.y=this.a*t.y+(this.y0||0),t}function Mi(t){var e,i;t.x=(t.x-(this.x0||0))/this.a,t.y=(t.y-(this.y0||0))/this.a;var r=xe(t.x,t.y=this.cphi1-t.y);if(i=this.cphi1+this.phi1-r,Math.abs(i)>K)throw new Error;return e=Math.abs(Math.abs(i)-K)<=1e-10?0:r*Math.atan2(t.x,t.y)/Math.cos(i),t.x=bt(e+(this.long0||0)),t.y=Ve(i),t}var Ei={init:function(){var t;if(this.phi1=this.lat1,Math.abs(this.phi1)<1e-10)throw new Error;this.es?(this.en=ye(this.es),this.m1=me(this.phi1,this.am1=Math.sin(this.phi1),t=Math.cos(this.phi1),this.en),this.am1=t/(Math.sqrt(1-this.es*this.am1*this.am1)*this.am1),this.inverse=wi,this.forward=bi):(this.cphi1=Math.abs(this.phi1)+1e-10>=K?0:1/Math.tan(this.phi1),this.inverse=Mi,this.forward=Si)},names:["bonne","Bonne (Werner lat_1=90)"]};te.defaultDatum="WGS84",te.Proj=Ut,te.WGS84=new te.Proj("WGS84"),te.Point=fe,te.toPoint=Kt,te.defs=yt,te.nadgrid=function(t,e){var i=new DataView(e),r=function(t){var e=t.getInt32(8,!1);return 11!==e&&(11!==(e=t.getInt32(8,!0))&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}(i),n=function(t,e){return{nFields:t.getInt32(8,e),nSubgridFields:t.getInt32(24,e),nSubgrids:t.getInt32(40,e),shiftType:Ot(t,56,64).trim(),fromSemiMajorAxis:t.getFloat64(120,e),fromSemiMinorAxis:t.getFloat64(136,e),toSemiMajorAxis:t.getFloat64(152,e),toSemiMinorAxis:t.getFloat64(168,e)}}(i,r),a={header:n,subgrids:function(t,e,i){for(var r=176,n=[],a=0;a<e.nSubgrids;a++){var o=Ft(t,r,i),s=Vt(t,r,o,i),l=Math.round(1+(o.upperLongitude-o.lowerLongitude)/o.longitudeInterval),u=Math.round(1+(o.upperLatitude-o.lowerLatitude)/o.latitudeInterval);n.push({ll:[Rt(o.lowerLongitude),Rt(o.lowerLatitude)],del:[Rt(o.longitudeInterval),Rt(o.latitudeInterval)],lim:[l,u],count:o.gridNodeCount,cvs:Bt(s)}),r+=176+16*o.gridNodeCount}return n}(i,n,r)};return zt[t]=a,a},te.transform=Jt,te.mgrs=ne,te.version="__VERSION__",function(t){t.Proj.projections.add(ge),t.Proj.projections.add(Se),t.Proj.projections.add(Me),t.Proj.projections.add(Te),t.Proj.projections.add(Ie),t.Proj.projections.add(Ce),t.Proj.projections.add(Ae),t.Proj.projections.add(Pe),t.Proj.projections.add(Le),t.Proj.projections.add(je),t.Proj.projections.add(qe),t.Proj.projections.add(Ze),t.Proj.projections.add(Xe),t.Proj.projections.add(We),t.Proj.projections.add(Ke),t.Proj.projections.add(He),t.Proj.projections.add(Je),t.Proj.projections.add(Ye),t.Proj.projections.add(Qe),t.Proj.projections.add($e),t.Proj.projections.add(ti),t.Proj.projections.add(ei),t.Proj.projections.add(ii),t.Proj.projections.add(ri),t.Proj.projections.add(oi),t.Proj.projections.add(hi),t.Proj.projections.add(ci),t.Proj.projections.add(fi),t.Proj.projections.add(di),t.Proj.projections.add(xi),t.Proj.projections.add(Ei)}(te);var ki=function(t,e,i,r,n){if(this.bounds=i,this.width=r,this.height=n,!e)throw new Error("自定义参考系必须指定参数系信息def");if(!te)throw new Error("proj4对象不存在,自定义投影必须引入proj4对象");var a=this._isProj4Obj(t);this._proj=a?t:this._projFromCodeDef(t,e)};function Ti(t,e,i,r,n,a){var o=n-i,s=a-r;if(0!==o||0!==s){var l=((t-i)*o+(e-r)*s)/(o*o+s*s);l>1?(i=n,r=a):l>0&&(i+=o*l,r+=s*l)}return(o=t-i)*o+(s=e-r)*s}function Ii(t,e,i,r){var n={id:null==t?null:t,type:e,geometry:i,tags:r,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if("Point"===e||"MultiPoint"===e||"LineString"===e)Ci(n,i);else if("Polygon"===e)Ci(n,i[0]);else if("MultiLineString"===e)for(var a=0,o=i;a<o.length;a+=1)Ci(n,o[a]);else if("MultiPolygon"===e)for(var s=0,l=i;s<l.length;s+=1)Ci(n,l[s][0]);return n}function Ci(t,e){for(var i=0;i<e.length;i+=3)t.minX=Math.min(t.minX,e[i]),t.minY=Math.min(t.minY,e[i+1]),t.maxX=Math.max(t.maxX,e[i]),t.maxY=Math.max(t.maxY,e[i+1])}function Ai(t,e,i,r){if(e.geometry){var n,a=i.crs,o=i.projectionParams;o&&o.def&&(n=new ki(o.code,o.def,o.bounds,o.width,o.height));var s=e.geometry.coordinates,l=e.geometry.type,u=Math.pow(i.tolerance/((1<<i.maxZoom)*i.extent),2),h=[],c=e.id;if(i.promoteId?c=e.properties[i.promoteId]:i.generateId&&(c=r||0),"Point"===l)Pi(s,h,a,n);else if("MultiPoint"===l)for(var p=0,f=s;p<f.length;p+=1)Pi(f[p],h,a,n);else if("LineString"===l)Li(s,h,u,!1,a,n);else if("MultiLineString"===l){if(i.lineMetrics){for(var d=0,y=s;d<y.length;d+=1)Li(y[d],h=[],u,!1,a,n),t.push(Ii(c,"LineString",h,e.properties));return}zi(s,h,u,!1,a,n)}else if("Polygon"===l)zi(s,h,u,!0,a,n);else{if("MultiPolygon"!==l){if("GeometryCollection"===l){for(var m=0,v=e.geometry.geometries;m<v.length;m+=1)Ai(t,{id:c,geometry:v[m],properties:e.properties},i,r);return}throw new Error("Input data is not a valid GeoJSON object.")}for(var g=0,_=s;g<_.length;g+=1){var x=[];zi(_[g],x,u,!0,a,n),h.push(x)}}t.push(Ii(c,l,h,e.properties))}}function Pi(t,e,i,r){var n=Di(t,i,r);e.push(n[0],n[1],0)}function Li(t,e,i,r,n,a){for(var o,s,l=0,u=0;u<t.length;u++){var h=Di(t[u],n,a),c=h[0],p=h[1];e.push(c,p,0),u>0&&(l+=r?(o*p-c*s)/2:Math.sqrt(Math.pow(c-o,2)+Math.pow(p-s,2))),o=c,s=p}var f=e.length-3;e[2]=1,function t(e,i,r,n){for(var a,o=n,s=r-i>>1,l=r-i,u=e[i],h=e[i+1],c=e[r],p=e[r+1],f=i+3;f<r;f+=3){var d=Ti(e[f],e[f+1],u,h,c,p);if(d>o)a=f,o=d;else if(d===o){var y=Math.abs(f-s);y<l&&(a=f,l=y)}}o>n&&(a-i>3&&t(e,i,a,n),e[a+2]=o,r-a>3&&t(e,a,r,n))}(e,0,f,i),e[f+2]=1,e.size=Math.abs(l),e.start=0,e.end=e.size}function zi(t,e,i,r,n,a){for(var o=0;o<t.length;o++){var s=[];Li(t[o],s,i,r,n,a),e.push(s)}}function Di(t,e,i){var r=[];if(i)r=i.project([t[0],t[1]]);else if("EPSG:3857"===e){var n=t[0]/360+.5,a=Math.sin(t[1]*Math.PI/180);r=[n,.5-.25*Math.log((1+a)/(1-a))/Math.PI]}else{if("EPSG:4326"!==e)throw new Error("未预定义投影转换方法");r=[t[0]/360+.5,(90-t[1])/360]}return r}function Ri(t,e,i,r,n,a,o,s){if(r/=e,a>=(i/=e)&&o<r)return t;if(o<i||a>=r)return null;for(var l=[],u=0,h=t;u<h.length;u+=1){var c=h[u],p=c.geometry,f=c.type,d=0===n?c.minX:c.minY,y=0===n?c.maxX:c.maxY;if(d>=i&&y<r)l.push(c);else if(!(y<i||d>=r)){var m=[];if("Point"===f||"MultiPoint"===f)Oi(p,m,i,r,n);else if("LineString"===f)Bi(p,m,i,r,n,!1,s.lineMetrics);else if("MultiLineString"===f)Vi(p,m,i,r,n,!1);else if("Polygon"===f)Vi(p,m,i,r,n,!0);else if("MultiPolygon"===f)for(var v=0,g=p;v<g.length;v+=1){var _=[];Vi(g[v],_,i,r,n,!0),_.length&&m.push(_)}if(m.length){if(s.lineMetrics&&"LineString"===f){for(var x=0,b=m;x<b.length;x+=1)l.push(Ii(c.id,f,b[x],c.tags));continue}"LineString"!==f&&"MultiLineString"!==f||(1===m.length?(f="LineString",m=m[0]):f="MultiLineString"),"Point"!==f&&"MultiPoint"!==f||(f=3===m.length?"Point":"MultiPoint"),l.push(Ii(c.id,f,m,c.tags))}}}return l.length?l:null}function Oi(t,e,i,r,n){for(var a=0;a<t.length;a+=3){var o=t[a+n];o>=i&&o<=r&&Ui(e,t[a],t[a+1],t[a+2])}}function Bi(t,e,i,r,n,a,o){for(var s,l,u=Fi(t),h=0===n?ji:Ni,c=t.start,p=0;p<t.length-3;p+=3){var f=t[p],d=t[p+1],y=t[p+2],m=t[p+3],v=t[p+4],g=0===n?f:d,_=0===n?m:v,x=!1;o&&(s=Math.sqrt(Math.pow(f-m,2)+Math.pow(d-v,2))),g<i?_>i&&(l=h(u,f,d,m,v,i),o&&(u.start=c+s*l)):g>r?_<r&&(l=h(u,f,d,m,v,r),o&&(u.start=c+s*l)):Ui(u,f,d,y),_<i&&g>=i&&(l=h(u,f,d,m,v,i),x=!0),_>r&&g<=r&&(l=h(u,f,d,m,v,r),x=!0),!a&&x&&(o&&(u.end=c+s*l),e.push(u),u=Fi(t)),o&&(c+=s)}var b=t.length-3,w=t[b],S=t[b+1],M=0===n?w:S;M>=i&&M<=r&&Ui(u,w,S,t[b+2]),b=u.length-3,a&&b>=3&&(u[b]!==u[0]||u[b+1]!==u[1])&&Ui(u,u[0],u[1],u[2]),u.length&&e.push(u)}function Fi(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function Vi(t,e,i,r,n,a){for(var o=0,s=t;o<s.length;o+=1)Bi(s[o],e,i,r,n,a,!1)}function Ui(t,e,i,r){t.push(e,i,r)}function ji(t,e,i,r,n,a){var o=(a-e)/(r-e);return Ui(t,a,i+(n-i)*o,1),o}function Ni(t,e,i,r,n,a){var o=(a-i)/(n-i);return Ui(t,e+(r-e)*o,a,1),o}function qi(t,e){if(t.transformed)return t;for(var i=1<<t.z,r=t.x,n=t.y,a=0,o=t.features;a<o.length;a+=1){var s=o[a],l=s.geometry,u=s.type;if(s.geometry=[],1===u)for(var h=0;h<l.length;h+=2)s.geometry.push(Gi(l[h],l[h+1],e,i,r,n));else for(var c=0;c<l.length;c++){for(var p=[],f=0;f<l[c].length;f+=2)p.push(Gi(l[c][f],l[c][f+1],e,i,r,n));s.geometry.push(p)}}return t.transformed=!0,t}function Gi(t,e,i,r,n,a){return[Math.round(i*(t*r-n)),Math.round(i*(e*r-a))]}function Zi(t,e,i,r,n){for(var a=e===n.maxZoom?0:n.tolerance/((1<<e)*n.extent),o={features:[],numPoints:0,numSimplified:0,numFeatures:t.length,source:null,x:i,y:r,z:e,transformed:!1,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0},s=0,l=t;s<l.length;s+=1)Xi(o,l[s],a,n);return o}function Xi(t,e,i,r){var n=e.geometry,a=e.type,o=[];if(t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),"Point"===a||"MultiPoint"===a)for(var s=0;s<n.length;s+=3)o.push(n[s],n[s+1]),t.numPoints++,t.numSimplified++;else if("LineString"===a)Wi(o,n,t,i,!1,!1);else if("MultiLineString"===a||"Polygon"===a)for(var l=0;l<n.length;l++)Wi(o,n[l],t,i,"Polygon"===a,0===l);else if("MultiPolygon"===a)for(var u=0;u<n.length;u++)for(var h=n[u],c=0;c<h.length;c++)Wi(o,h[c],t,i,!0,0===c);if(o.length){var p=e.tags||null;if("LineString"===a&&r.lineMetrics){for(var f in p={},e.tags)p[f]=e.tags[f];p.mapbox_clip_start=n.start/n.size,p.mapbox_clip_end=n.end/n.size}var d={geometry:o,type:"Polygon"===a||"MultiPolygon"===a?3:"LineString"===a||"MultiLineString"===a?2:1,tags:p};null!==e.id&&(d.id=e.id),t.features.push(d)}}function Wi(t,e,i,r,n,a){var o=r*r;if(r>0&&e.size<(n?o:r))i.numPoints+=e.length/3;else{for(var s=[],l=0;l<e.length;l+=3)(0===r||e[l+2]>o)&&(i.numSimplified++,s.push(e[l],e[l+1])),i.numPoints++;n&&function(t,e){for(var i=0,r=0,n=t.length,a=n-2;r<n;a=r,r+=2)i+=(t[r]-t[a])*(t[r+1]+t[a+1]);if(i>0===e)for(var o=0,s=t.length;o<s/2;o+=2){var l=t[o],u=t[o+1];t[o]=t[s-2-o],t[o+1]=t[s-1-o],t[s-2-o]=l,t[s-1-o]=u}}(s,a),t.push(s)}}ki.prototype.project=function(t){var e,i;Array.isArray(t)?(e=t[0],i=t[1]):(e=t.lng,i=t.lat);var r=this._proj.forward([e,i]),n=this.bounds;return[(r[0]-n[0])/this.width,(n[3]-r[1])/this.height]},ki.prototype.unproject=function(t){var e,i;return Array.isArray(t)?(e=t[0],i=t[1]):(e=t.x,i=t.y),this._proj.inverse([e,i])},ki.prototype._projFromCodeDef=function(t,e){if(e)te.defs(t,e);else if(void 0===te.defs[t]){var i=t.split(":");if(i.length>3&&(t=i[i.length-3]+":"+i[i.length-1]),void 0===te.defs[t])throw new Error("No projection definition for code "+t)}return te(t)},ki.prototype._isProj4Obj=function(t){return void 0!==t.inverse&&void 0!==t.forward};var Ki={crs:"EPSG:3857",maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0,isWrapData:!1},Hi=function(t,e){var i=(e=this.options=function(t,e){for(var i in e)t[i]=e[i];return t}(Object.create(Ki),e)).debug;if(i&&console.time("preprocess data"),e.maxZoom<0||e.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var r=function(t,e){var i=[];if("FeatureCollection"===t.type)for(var r=0;r<t.features.length;r++)Ai(i,t.features[r],e,r);else Ai(i,"Feature"===t.type?t:{geometry:t},e);return i}(t,e);this.features=r,this.tiles={},this.tileCoords=[],i&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0)};function Ji(t,e,i){return e.toString(36)+i.toString(36)+t.toString(36)}function Yi(t,e){var i=t.tileID.canonical;if(!this._geoJSONIndex)return e(null,null);var r=this._geoJSONIndex.getTile(i.z,i.x,i.y);if(!r)return e(null,null);var n=new y(r.features),a=x(n);0===a.byteOffset&&a.byteLength===a.buffer.byteLength||(a=new Uint8Array(a)),e(null,{vectorTile:n,rawData:a.buffer})}Hi.prototype.splitTile=function(t,e,i,r,n,a,o){for(var s=[t,e,i,r],l=this.options,u=l.debug;s.length;){r=s.pop(),i=s.pop(),e=s.pop(),t=s.pop();var h=1<<e,c=Ji(e,i,r),p=this.tiles[c];if(!p&&(u>1&&console.time("creation"),p=this.tiles[c]=Zi(t,e,i,r,l),this.tileCoords.push({z:e,x:i,y:r}),u)){u>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,i,r,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd("creation"));var f="z"+e;this.stats[f]=(this.stats[f]||0)+1,this.total++}if(p.source=t,null==n){if(e===l.indexMaxZoom||p.numPoints<=l.indexMaxPoints)continue}else{if(e===l.maxZoom||e===n)continue;if(null!=n){var d=n-e;if(i!==a>>d||r!==o>>d)continue}}if(p.source=null,0!==t.length){u>1&&console.time("clipping");var y=.5*l.buffer/l.extent,m=.5-y,v=.5+y,g=1+y,_=null,x=null,b=null,w=null,S=Ri(t,h,i-y,i+v,0,p.minX,p.maxX,l),M=Ri(t,h,i+m,i+g,0,p.minX,p.maxX,l);t=null,S&&(_=Ri(S,h,r-y,r+v,1,p.minY,p.maxY,l),x=Ri(S,h,r+m,r+g,1,p.minY,p.maxY,l),S=null),M&&(b=Ri(M,h,r-y,r+v,1,p.minY,p.maxY,l),w=Ri(M,h,r+m,r+g,1,p.minY,p.maxY,l),M=null),u>1&&console.timeEnd("clipping"),s.push(_||[],e+1,2*i,2*r),s.push(x||[],e+1,2*i,2*r+1),s.push(b||[],e+1,2*i+1,2*r),s.push(w||[],e+1,2*i+1,2*r+1)}}},Hi.prototype._createZeroTile=function(t,e,i){var r,n=.5*i.buffer/i.extent,a=Ji(0,t,e),o=1*e,s=1*(e+1),l=Ri(this.features,1,1*t-n,1*(t+1)+n,0,-1/0,1/0,i);if(l){var u=Ri(l,1,o-n,s+n,1,-1/0,1/0,i);u&&(this.tiles[a]=qi(Zi(u,0,t,e,i),i.extent),this.tiles[a].source=u,r=this.tiles[a])}return r},Hi.prototype.getTile=function(t,e,i){var r=this.options,n=r.extent,a=r.debug;if((t=+t)<0||t>24)return null;var o=Ji(t,e=+e,i=+i);if(this.tiles[o])return qi(this.tiles[o],n);if(0===t)return this._createZeroTile(e,i,r);a>1&&console.log("drilling down to z%d-%d-%d",t,e,i);for(var s,l=t,u=e,h=i;!s&&l>0;){var c=Ji(--l,u>>=1,h>>=1);s=this.tiles[c],0!==l||s||(s=this._createZeroTile(u,h,r))}return s&&s.source?(a>1&&(console.log("found parent tile z%d-%d-%d",l,u,h),console.time("drilling down")),this.splitTile(s.source,l,u,h,t,e,i),a>1&&console.timeEnd("drilling down"),this.tiles[o]?qi(this.tiles[o],n):null):null};var Qi=function(e){function i(t,i,r,n){e.call(this,t,i,r,Yi),n&&(this.loadGeoJSON=n)}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.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())},i.prototype._loadData=function(){var e=this;if(this._pendingCallback&&this._pendingLoadDataParams){var i=this._pendingCallback,r=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var n=!!(r&&r.request&&r.request.collectResourceTiming)&&new t.RequestPerformance(r.request);this.loadGeoJSON(r,function(a,o){if(a||!o)return i(a);if("object"!=typeof o)return i(new Error("Input data given to '"+r.source+"' is not a valid GeoJSON object."));!function t(e,i){var r,n=e&&e.type;if("FeatureCollection"===n)for(r=0;r<e.features.length;r++)t(e.features[r],i);else if("GeometryCollection"===n)for(r=0;r<e.geometries.length;r++)t(e.geometries[r],i);else if("Feature"===n)t(e.geometry,i);else if("Polygon"===n)c(e.coordinates,i);else if("MultiPolygon"===n)for(r=0;r<e.coordinates.length;r++)c(e.coordinates[r],i);return e}(o,!0);try{e._geoJSONIndex=r.cluster?new B(function(e){var i=e.superclusterOptions,r=e.clusterProperties;if(!r||!i)return i;for(var n={},a={},o={accumulated:null,zoom:0},s={properties:null},l=Object.keys(r),u=0,h=l;u<h.length;u+=1){var c=h[u],p=r[c],f=p[0],d=t.createExpression(p[1]),y=t.createExpression("string"==typeof f?[f,["accumulated"],["get",c]]:f);n[c]=d.value,a[c]=y.value}return i.map=function(t){s.properties=t;for(var e={},i=0,r=l;i<r.length;i+=1){var a=r[i];e[a]=n[a].evaluate(o,s)}return e},i.reduce=function(t,e){s.properties=e;for(var i=0,r=l;i<r.length;i+=1){var n=r[i];o.accumulated=t[n],t[n]=a[n].evaluate(o,s)}},i}(r)).load(o.features):function(t,e){return new Hi(t,e)}(o,r.geojsonVtOptions)}catch(a){return i(a)}e.loaded={};var s={};if(n){var l=n.finish();l&&(s.resourceTiming={},s.resourceTiming[r.source]=JSON.parse(JSON.stringify(l)))}i(null,s)})}},i.prototype.coalesce=function(){"Coalescing"===this._state?this._state="Idle":"NeedsLoadData"===this._state&&(this._state="Coalescing",this._loadData())},i.prototype.reloadTile=function(t,i){var r=this.loaded;return r&&r[t.uid]?e.prototype.reloadTile.call(this,t,i):this.loadTile(t,i)},i.prototype.loadGeoJSON=function(e,i){if(e.request)t.getJSON(e.request,i);else{if("string"!=typeof e.data)return i(new Error("Input data given to '"+e.source+"' is not a valid GeoJSON object."));try{return i(null,JSON.parse(e.data))}catch(t){return i(new Error("Input data given to '"+e.source+"' is not a valid GeoJSON object."))}}},i.prototype.removeSource=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),e()},i.prototype.getClusterExpansionZoom=function(t,e){try{e(null,this._geoJSONIndex.getClusterExpansionZoom(t.clusterId))}catch(t){e(t)}},i.prototype.getClusterChildren=function(t,e){try{e(null,this._geoJSONIndex.getChildren(t.clusterId))}catch(t){e(t)}},i.prototype.getClusterLeaves=function(t,e){try{e(null,this._geoJSONIndex.getLeaves(t.clusterId,t.limit,t.offset))}catch(t){e(t)}},i}(l),$i=function(e){var i=this;this.self=e,this.actor=new t.Actor(e,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:l,mbtiles:l,geojson:Qi,rasteroffline:t.RasterTileSourceOffline},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(t,e){if(i.workerSourceTypes[t])throw new Error('Worker source with name "'+t+'" already registered.');i.workerSourceTypes[t]=e},this.self.registerRTLTextPlugin=function(e){if(t.plugin.isParsed())throw new Error("RTL text plugin already registered.");t.plugin.applyArabicShaping=e.applyArabicShaping,t.plugin.processBidirectionalText=e.processBidirectionalText,t.plugin.processStyledBidirectionalText=e.processStyledBidirectionalText}};return $i.prototype.setReferrer=function(t,e){this.referrer=e},$i.prototype.setImages=function(t,e,i){this.availableImages[t]=e,i()},$i.prototype.setLayers=function(t,e,i){this.getLayerIndex(t).replace(e),i()},$i.prototype.updateLayers=function(t,e,i){this.getLayerIndex(t).update(e.layers,e.removedIds),i()},$i.prototype.loadTile=function(t,e,i){this.getWorkerSource(t,e.type,e.source).loadTile(e,i)},$i.prototype.loadDEMTile=function(t,e,i){this.getDEMWorkerSource(t,e.source).loadTile(e,i)},$i.prototype.reloadTile=function(t,e,i){this.getWorkerSource(t,e.type,e.source).reloadTile(e,i)},$i.prototype.abortTile=function(t,e,i){this.getWorkerSource(t,e.type,e.source).abortTile(e,i)},$i.prototype.removeTile=function(t,e,i){this.getWorkerSource(t,e.type,e.source).removeTile(e,i)},$i.prototype.removeDEMTile=function(t,e){this.getDEMWorkerSource(t,e.source).removeTile(e)},$i.prototype.removeSource=function(t,e,i){if(this.workerSources[t]&&this.workerSources[t][e.type]&&this.workerSources[t][e.type][e.source]){var r=this.workerSources[t][e.type][e.source];delete this.workerSources[t][e.type][e.source],void 0!==r.removeSource?r.removeSource(e,i):i()}},$i.prototype.loadWorkerSource=function(t,e,i){try{this.self.importScripts(e.url),i()}catch(t){i(t.toString())}},$i.prototype.syncRTLPluginState=function(e,i,r){try{t.plugin.setState(i);var n=t.plugin.getPluginURL();if(t.plugin.isLoaded()&&!t.plugin.isParsed()&&null!=n){this.self.importScripts(n);var a=t.plugin.isParsed();r(a?void 0:new Error("RTL Text Plugin failed to import scripts from "+n),a)}}catch(t){r(t.toString())}},$i.prototype.getAvailableImages=function(t){var e=this.availableImages[t];return e||(e=[]),e},$i.prototype.getLayerIndex=function(t){var e=this.layerIndexes[t];return e||(e=this.layerIndexes[t]=new r),e},$i.prototype.getWorkerSource=function(t,e,i){var r=this;return this.workerSources[t]||(this.workerSources[t]={}),this.workerSources[t][e]||(this.workerSources[t][e]={}),this.workerSources[t][e][i]||(this.workerSources[t][e][i]=new this.workerSourceTypes[e]({send:function(e,i,n){r.actor.send(e,i,n,t)}},this.getLayerIndex(t),this.getAvailableImages(t))),this.workerSources[t][e][i]},$i.prototype.getDEMWorkerSource=function(t,e){return this.demWorkerSources[t]||(this.demWorkerSources[t]={}),this.demWorkerSources[t][e]||(this.demWorkerSources[t][e]=new h),this.demWorkerSources[t][e]},$i.prototype.enforceCacheSizeLimit=function(e,i){t.enforceCacheSizeLimit(i)},"undefined"!=typeof WorkerGlobalScope&&void 0!==t.window&&t.window instanceof WorkerGlobalScope&&(t.window.worker=new $i(t.window)),$i}),r(0,function(t){var e=t.createCommonjsModule(function(t){function e(t){return!i(t)}function i(t){return"undefined"==typeof window||"undefined"==typeof document?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var t,e,i=new Blob([""],{type:"text/javascript"}),r=URL.createObjectURL(i);try{e=new Worker(r),t=!0}catch(e){t=!1}return e&&e.terminate(),URL.revokeObjectURL(r),t}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var t=document.createElement("canvas");t.width=t.height=1;var e=t.getContext("2d");if(!e)return!1;var i=e.getImageData(0,0,1,1);return i&&i.width===t.width}()?(void 0===r[i=t&&t.failIfMajorPerformanceCaveat]&&(r[i]=function(t){var i=function(t){var i=document.createElement("canvas"),r=Object.create(e.webGLContextAttributes);return r.failIfMajorPerformanceCaveat=t,i.probablySupportsContext?i.probablySupportsContext("webgl",r)||i.probablySupportsContext("experimental-webgl",r):i.supportsContext?i.supportsContext("webgl",r)||i.supportsContext("experimental-webgl",r):i.getContext("webgl",r)||i.getContext("experimental-webgl",r)}(t);if(!i)return!1;var r=i.createShader(i.VERTEX_SHADER);return!(!r||i.isContextLost())&&(i.shaderSource(r,"void main() {}"),i.compileShader(r),!0===i.getShaderParameter(r,i.COMPILE_STATUS))}(i)),r[i]?void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var i}t.exports?t.exports=e:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=e,window.mapboxgl.notSupportedReason=i);var r={};e.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}}),i={create:function(e,i,r){var n=t.window.document.createElement(e);return void 0!==i&&(n.className=i),r&&r.appendChild(n),n},createNS:function(e,i){return t.window.document.createElementNS(e,i)}},r=t.window.document.documentElement.style;function n(t){if(!r)return t[0];for(var e=0;e<t.length;e++)if(t[e]in r)return t[e];return t[0]}var a,o=n(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);i.disableDrag=function(){r&&o&&(a=r[o],r[o]="none")},i.enableDrag=function(){r&&o&&(r[o]=a)};var s=n(["transform","WebkitTransform"]);i.setTransform=function(t,e){t.style[s]=e};var l=!1;try{var u=Object.defineProperty({},"passive",{get:function(){l=!0}});t.window.addEventListener("test",u,u),t.window.removeEventListener("test",u,u)}catch(t){l=!1}i.addEventListener=function(t,e,i,r){void 0===r&&(r={}),t.addEventListener(e,i,"passive"in r&&l?r:r.capture)},i.removeEventListener=function(t,e,i,r){void 0===r&&(r={}),t.removeEventListener(e,i,"passive"in r&&l?r:r.capture)};var h=function(e){e.preventDefault(),e.stopPropagation(),t.window.removeEventListener("click",h,!0)};function c(t){var e=t.userImage;return!!(e&&e.render&&e.render())&&(t.data.replace(new Uint8Array(e.data.buffer)),!0)}i.suppressClick=function(){t.window.addEventListener("click",h,!0),t.window.setTimeout(function(){t.window.removeEventListener("click",h,!0)},0)},i.mousePos=function(e,i){var r=e.getBoundingClientRect(),n=t.window.TouchEvent&&i instanceof t.window.TouchEvent?i.touches[0]:i;return new t.Point(n.clientX-r.left-e.clientLeft,n.clientY-r.top-e.clientTop)},i.touchPos=function(e,i){for(var r=e.getBoundingClientRect(),n=[],a="touchend"===i.type?i.changedTouches:i.touches,o=0;o<a.length;o++)n.push(new t.Point(a[o].clientX-r.left-e.clientLeft,a[o].clientY-r.top-e.clientTop));return n},i.mouseButton=function(e){return void 0!==t.window.InstallTrigger&&2===e.button&&e.ctrlKey&&t.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:e.button},i.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)};var p=function(e){function i(){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&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.isLoaded=function(){return this.loaded},i.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t,t)){for(var e=0,i=this.requestors;e<i.length;e+=1){var r=i[e];this._notify(r.ids,r.callback)}this.requestors=[]}},i.prototype.getImage=function(t){return this.images[t]},i.prototype.addImage=function(t,e){this._validate(t,e)&&(this.images[t]=e)},i.prototype._validate=function(e,i){var r=!0;return this._validateStretch(i.stretchX,i.data&&i.data.width)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "stretchX" value'))),r=!1),this._validateStretch(i.stretchY,i.data&&i.data.height)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "stretchY" value'))),r=!1),this._validateContent(i.content,i)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "content" value'))),r=!1),r},i.prototype._validateStretch=function(t,e){if(!t)return!0;for(var i=0,r=0,n=t;r<n.length;r+=1){var a=n[r];if(a[0]<i||a[1]<a[0]||e<a[1])return!1;i=a[1]}return!0},i.prototype._validateContent=function(t,e){return!(t&&(4!==t.length||t[0]<0||e.data.width<t[0]||t[1]<0||e.data.height<t[1]||t[2]<0||e.data.width<t[2]||t[3]<0||e.data.height<t[3]||t[2]<t[0]||t[3]<t[1]))},i.prototype.updateImage=function(t,e){e.version=this.images[t].version+1,this.images[t]=e,this.updatedImages[t]=!0},i.prototype.removeImage=function(t){var e=this.images[t];delete this.images[t],delete this.patterns[t],e.userImage&&e.userImage.onRemove&&e.userImage.onRemove()},i.prototype.listImages=function(){return Object.keys(this.images)},i.prototype.getImages=function(t,e){var i=!0;if(!this.isLoaded())for(var r=0,n=t;r<n.length;r+=1)this.images[n[r]]||(i=!1);this.isLoaded()||i?this._notify(t,e):this.requestors.push({ids:t,callback:e})},i.prototype._notify=function(e,i){for(var r={},n=0,a=e;n<a.length;n+=1){var o=a[n];this.images[o]||this.fire(new t.Event("styleimagemissing",{id:o}));var s=this.images[o];s?r[o]={data:s.data.clone(),pixelRatio:s.pixelRatio,sdf:s.sdf,version:s.version,stretchX:s.stretchX,stretchY:s.stretchY,content:s.content,hasRenderCallback:Boolean(s.userImage&&s.userImage.render)}:t.warnOnce('Image "'+o+'" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.')}i(null,r)},i.prototype.getPixelSize=function(){var t=this.atlasImage;return{width:t.width,height:t.height}},i.prototype.getPattern=function(e){var i=this.patterns[e],r=this.getImage(e);if(!r)return null;if(i&&i.position.version===r.version)return i.position;if(i)i.position.version=r.version;else{var n={w:r.data.width+2,h:r.data.height+2,x:0,y:0},a=new t.ImagePosition(n,r);this.patterns[e]={bin:n,position:a}}return this._updatePatternAtlas(),this.patterns[e].position},i.prototype.bind=function(e){var i=e.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new t.Texture(e,this.atlasImage,i.RGBA),this.atlasTexture.bind(i.LINEAR,i.CLAMP_TO_EDGE)},i.prototype._updatePatternAtlas=function(){var e=[];for(var i in this.patterns)e.push(this.patterns[i].bin);var r=t.potpack(e),n=r.w,a=r.h,o=this.atlasImage;for(var s in o.resize({width:n||1,height:a||1}),this.patterns){var l=this.patterns[s].bin,u=l.x+1,h=l.y+1,c=this.images[s].data,p=c.width,f=c.height;t.RGBAImage.copy(c,o,{x:0,y:0},{x:u,y:h},{width:p,height:f}),t.RGBAImage.copy(c,o,{x:0,y:f-1},{x:u,y:h-1},{width:p,height:1}),t.RGBAImage.copy(c,o,{x:0,y:0},{x:u,y:h+f},{width:p,height:1}),t.RGBAImage.copy(c,o,{x:p-1,y:0},{x:u-1,y:h},{width:1,height:f}),t.RGBAImage.copy(c,o,{x:0,y:0},{x:u+p,y:h},{width:1,height:f})}this.dirty=!0},i.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={}},i.prototype.dispatchRenderCallbacks=function(t){for(var e=0,i=t;e<i.length;e+=1){var r=i[e];if(!this.callbackDispatchedThisFrame[r]){this.callbackDispatchedThisFrame[r]=!0;var n=this.images[r];c(n)&&this.updateImage(r,n)}}},i}(t.Evented),f=m,d=m,y=1e20;function m(t,e,i,r,n,a){this.fontSize=t||24,this.buffer=void 0===e?3:e,this.cutoff=r||.25,this.fontFamily=n||"sans-serif",this.fontWeight=a||"normal",this.radius=i||8;var o=this.size=this.fontSize+2*this.buffer,s=o+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=o,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textAlign="left",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(s*s),this.gridInner=new Float64Array(s*s),this.f=new Float64Array(s),this.z=new Float64Array(s+1),this.v=new Uint16Array(s),this.useMetrics=void 0!==this.ctx.measureText("A").actualBoundingBoxLeft,this.middle=Math.round(o/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function v(t,e,i,r,n,a){for(var o=0;o<e;o++)g(t,o,e,i,r,n,a);for(var s=0;s<i;s++)g(t,s*e,1,e,r,n,a)}function g(t,e,i,r,n,a,o){var s,l,u,h;for(a[0]=0,o[0]=-y,o[1]=y,s=0;s<r;s++)n[s]=t[e+s*i];for(s=1,l=0,u=0;s<r;s++){do{u=(n[s]-n[h=a[l]]+s*s-h*h)/(s-h)/2}while(u<=o[l]&&--l>-1);a[++l]=s,o[l]=u,o[l+1]=y}for(s=0,l=0;s<r;s++){for(;o[l+1]<s;)l++;t[e+s*i]=n[h=a[l]]+(s-h)*(s-h)}}m.prototype._draw=function(t,e){var i,r,n,a,o,s,l,u,h,c=this.ctx.measureText(t),p=c.width,f=2*this.buffer;e&&this.useMetrics?(o=Math.floor(c.actualBoundingBoxAscent),u=this.buffer+Math.ceil(c.actualBoundingBoxAscent),s=this.buffer,l=this.buffer,i=(r=Math.min(this.size,Math.ceil(c.actualBoundingBoxRight-c.actualBoundingBoxLeft)))+f,n=(a=Math.min(this.size-s,Math.ceil(c.actualBoundingBoxAscent+c.actualBoundingBoxDescent)))+f,this.ctx.textBaseline="alphabetic"):(i=r=this.size,n=a=this.size,o=19*this.fontSize/24,s=l=0,u=this.middle,this.ctx.textBaseline="middle"),r&&a&&(this.ctx.clearRect(l,s,r,a),this.ctx.fillText(t,this.buffer,u),h=this.ctx.getImageData(l,s,r,a));var d=new Uint8ClampedArray(i*n);return function(t,e,i,r,n,a,o){a.fill(y,0,e*i),o.fill(0,0,e*i);for(var s=(e-r)/2,l=0;l<n;l++)for(var u=0;u<r;u++){var h=(l+s)*e+u+s,c=t.data[4*(l*r+u)+3]/255;if(1===c)a[h]=0,o[h]=y;else if(0===c)a[h]=y,o[h]=0;else{var p=Math.max(0,.5-c),f=Math.max(0,c-.5);a[h]=p*p,o[h]=f*f}}}(h,i,n,r,a,this.gridOuter,this.gridInner),v(this.gridOuter,i,n,this.f,this.v,this.z),v(this.gridInner,i,n,this.f,this.v,this.z),function(t,e,i,r,n,a,o){for(var s=0;s<e*i;s++){var l=Math.sqrt(r[s])-Math.sqrt(n[s]);t[s]=Math.round(255-255*(l/a+o))}}(d,i,n,this.gridOuter,this.gridInner,this.radius,this.cutoff),{data:d,metrics:{width:r,height:a,sdfWidth:i,sdfHeight:n,top:o,left:0,advance:p}}},m.prototype.draw=function(t){return this._draw(t,!1).data},m.prototype.drawWithMetrics=function(t){return this._draw(t,!0)},f.default=d;var _=function(t,e){this.requestManager=t,this.localIdeographFontFamily=e,this.entries={}};_.prototype.setURL=function(t){this.url=t},_.prototype.getGlyphs=function(e,i){var r=this,n=[];for(var a in e)for(var o=0,s=e[a];o<s.length;o+=1)n.push({stack:a,id:s[o]});t.asyncAll(n,function(t,e){var i=t.stack,n=t.id,a=r.entries[i];a||(a=r.entries[i]={glyphs:{},requests:{},ranges:{}});var o=a.glyphs[n];if(void 0===o){if(o=r._tinySDF(a,i,n))return a.glyphs[n]=o,void e(null,{stack:i,id:n,glyph:o});var s=Math.floor(n/256);if(256*s>65535)e(new Error("glyphs > 65535 not supported"));else if(a.ranges[s])e(null,{stack:i,id:n,glyph:o});else{var l=a.requests[s];l||(l=a.requests[s]=[],_.loadGlyphRange(i,s,r.url,r.requestManager,function(t,e){if(e){for(var i in e)r._doesCharSupportLocalGlyph(+i)||(a.glyphs[+i]=e[+i]);a.ranges[s]=!0}for(var n=0,o=l;n<o.length;n+=1)(0,o[n])(t,e);delete a.requests[s]})),l.push(function(t,r){t?e(t):r&&e(null,{stack:i,id:n,glyph:r[n]||null})})}}else e(null,{stack:i,id:n,glyph:o})},function(t,e){if(t)i(t);else if(e){for(var r={},n=0,a=e;n<a.length;n+=1){var o=a[n],s=o.stack,l=o.id,u=o.glyph;(r[s]||(r[s]={}))[l]=u&&{id:u.id,bitmap:u.bitmap.clone(),metrics:u.metrics}}i(null,r)}})},_.prototype._doesCharSupportLocalGlyph=function(e){return!!this.localIdeographFontFamily&&(t.isChar["CJK Unified Ideographs"](e)||t.isChar["Hangul Syllables"](e)||t.isChar.Hiragana(e)||t.isChar.Katakana(e))},_.prototype._tinySDF=function(e,i,r){var n=this.localIdeographFontFamily;if(n&&this._doesCharSupportLocalGlyph(r)){var a=e.tinySDF;if(!a){var o="400";/bold/i.test(i)?o="900":/medium/i.test(i)?o="500":/light/i.test(i)&&(o="200"),a=e.tinySDF=new _.TinySDF(24,3,8,.25,n,o)}return{id:r,bitmap:new t.AlphaImage({width:30,height:30},a.draw(String.fromCharCode(r))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},_.loadGlyphRange=function(e,i,r,n,a){var o=256*i,s=o+255,l=n.transformRequest(n.normalizeGlyphsURL(r).replace("{fontstack}",e).replace("{range}",o+"-"+s),t.ResourceType.Glyphs);t.getArrayBuffer(l,function(e,i){if(e)a(e);else if(i){for(var r={},n=0,o=t.parseGlyphPBF(i);n<o.length;n+=1){var s=o[n];r[s.id]=s}a(null,r)}})},_.TinySDF=f;var x=function(){this.specification=t.styleSpec.light.position};x.prototype.possiblyEvaluate=function(e,i){return t.sphericalToCartesian(e.expression.evaluate(i))},x.prototype.interpolate=function(e,i,r){return{x:t.number(e.x,i.x,r),y:t.number(e.y,i.y,r),z:t.number(e.z,i.z,r)}};var b=new t.Properties({anchor:new t.DataConstantProperty(t.styleSpec.light.anchor),position:new x,color:new t.DataConstantProperty(t.styleSpec.light.color),intensity:new t.DataConstantProperty(t.styleSpec.light.intensity)}),w=function(e){function i(i){e.call(this),this._transitionable=new t.Transitionable(b),this.setLight(i),this._transitioning=this._transitionable.untransitioned()}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.getLight=function(){return this._transitionable.serialize()},i.prototype.setLight=function(e,i){if(void 0===i&&(i={}),!this._validate(t.validateLight,e,i))for(var r in e){var n=e[r];t.endsWith(r,"-transition")?this._transitionable.setTransition(r.slice(0,-"-transition".length),n):this._transitionable.setValue(r,n)}},i.prototype.updateTransitions=function(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)},i.prototype.hasTransition=function(){return this._transitioning.hasTransition()},i.prototype.recalculate=function(t){this.properties=this._transitioning.possiblyEvaluate(t)},i.prototype._validate=function(e,i,r){return(!r||!1!==r.validate)&&t.emitValidationErrors(this,e.call(t.validateStyle,t.extend({value:i,style:{glyphs:!0,sprite:!0},styleSpec:t.styleSpec})))},i}(t.Evented),S=function(t,e){this.width=t,this.height=e,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}};S.prototype.getDash=function(t,e){var i=t.join(",")+String(e);return this.dashEntry[i]||(this.dashEntry[i]=this.addDash(t,e)),this.dashEntry[i]},S.prototype.getDashRanges=function(t,e,i){var r=[],n=t.length%2==1?-t[t.length-1]*i:0,a=t[0]*i,o=!0;r.push({left:n,right:a,isDash:o,zeroLength:0===t[0]});for(var s=t[0],l=1;l<t.length;l++){var u=t[l];r.push({left:n=s*i,right:a=(s+=u)*i,isDash:o=!o,zeroLength:0===u})}return r},S.prototype.addRoundDash=function(t,e,i){for(var r=e/2,n=-i;n<=i;n++)for(var a=this.width*(this.nextRow+i+n),o=0,s=t[o],l=0;l<this.width;l++){l/s.right>1&&(s=t[++o]);var u=Math.abs(l-s.left),h=Math.abs(l-s.right),c=Math.min(u,h),p=void 0,f=n/i*(r+1);if(s.isDash){var d=r-Math.abs(f);p=Math.sqrt(c*c+d*d)}else p=r-Math.sqrt(c*c+f*f);this.data[a+l]=Math.max(0,Math.min(255,p+128))}},S.prototype.addRegularDash=function(t){for(var e=t.length-1;e>=0;--e){var i=t[e],r=t[e+1];i.zeroLength?t.splice(e,1):r&&r.isDash===i.isDash&&(r.left=i.left,t.splice(e,1))}var n=t[0],a=t[t.length-1];n.isDash===a.isDash&&(n.left=a.left-this.width,a.right=n.right+this.width);for(var o=this.width*this.nextRow,s=0,l=t[s],u=0;u<this.width;u++){u/l.right>1&&(l=t[++s]);var h=Math.abs(u-l.left),c=Math.abs(u-l.right),p=Math.min(h,c);this.data[o+u]=Math.max(0,Math.min(255,(l.isDash?p:-p)+128))}},S.prototype.addDash=function(e,i){var r=i?7:0,n=2*r+1;if(this.nextRow+n>this.height)return t.warnOnce("LineAtlas out of space"),null;for(var a=0,o=0;o<e.length;o++)a+=e[o];if(0!==a){var s=this.width/a,l=this.getDashRanges(e,this.width,s);i?this.addRoundDash(l,s,r):this.addRegularDash(l)}var u={y:(this.nextRow+r+.5)/this.height,height:2*r/this.height,width:a};return this.nextRow+=n,this.dirty=!0,u},S.prototype.bind=function(t){var e=t.gl;this.texture?(e.bindTexture(e.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,e.texSubImage2D(e.TEXTURE_2D,0,0,0,this.width,this.height,e.ALPHA,e.UNSIGNED_BYTE,this.data))):(this.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texImage2D(e.TEXTURE_2D,0,e.ALPHA,this.width,this.height,0,e.ALPHA,e.UNSIGNED_BYTE,this.data))};var M=function e(i,r){this.workerPool=i,this.actors=[],this.currentActor=0,this.id=t.uniqueId();for(var n=this.workerPool.acquire(this.id),a=0;a<n.length;a++){var o=new e.Actor(n[a],r,this.id);o.name="Worker "+a,this.actors.push(o)}};M.prototype.broadcast=function(e,i,r){t.asyncAll(this.actors,function(t,r){t.send(e,i,r)},r=r||function(){})},M.prototype.getActor=function(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]},M.prototype.remove=function(){this.actors.forEach(function(t){t.remove()}),this.actors=[],this.workerPool.release(this.id)},M.Actor=t.Actor;var E=function(e){function i(i,r,n,a){if(e.call(this),this.id=i,this.dispatcher=n,this.crs=a.crs,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,t.extend(this,t.pick(r,["url","scheme","tileSize","promoteId"])),this._options=t.extend({type:"vector"},r),this._collectResourceTiming=r.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(a)}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.load=function(){var e=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=t.loadTileJSON(this._options,this.map._requestManager,function(i,r){e._tileJSONRequest=null,e._loaded=!0,i?e.fire(new t.ErrorEvent(i)):r&&(t.extend(e,r),r.bounds&&(e.tileBounds=new t.TileBounds(r.bounds,e.minzoom,e.maxzoom)),t.postTurnstileEvent(r.tiles,e.map._requestManager._customAccessToken),t.postMapLoadEvent(r.tiles,e.map._getMapId(),e.map._requestManager._skuToken,e.map._requestManager._customAccessToken),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})))})},i.prototype.loaded=function(){return this._loaded},i.prototype.hasTile=function(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)},i.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},i.prototype.serialize=function(){return t.extend({},this._options)},i.prototype.loadTile=function(e,i){var r=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme,this.crs)),n={request:this.map._requestManager.transformRequest(r,t.ResourceType.Tile),uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function a(r,n){return delete e.request,e.aborted?i(null):r&&404!==r.status?i(r):(n&&n.resourceTiming&&(e.resourceTiming=n.resourceTiming),this.map._refreshExpiredTiles&&n&&e.setExpiryData(n),e.loadVectorData(n,this.map.painter),t.cacheEntryPossiblyAdded(this.dispatcher),i(null),void(e.reloadCallback&&(this.loadTile(e,e.reloadCallback),e.reloadCallback=null)))}n.request.collectResourceTiming=this._collectResourceTiming,e.actor&&"expired"!==e.state?"loading"===e.state?e.reloadCallback=i:e.request=e.actor.send("reloadTile",n,a.bind(this)):(e.actor=this.dispatcher.getActor(),e.request=e.actor.send("loadTile",n,a.bind(this)))},i.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.actor&&t.actor.send("abortTile",{uid:t.uid,type:this.type,source:this.id},void 0)},i.prototype.unloadTile=function(t){t.unloadVectorData(),t.actor&&t.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id},void 0)},i.prototype.hasTransition=function(){return!1},i}(t.SourceEnhance),k=function(e){function i(i,r,n,a){e.call(this,i,r,n,a),this.type="raster-dem",this.maxzoom=22,this._options=t.extend({type:"raster-dem"},r),this.encoding=r.encoding||"mapbox",this.crs=a.crs}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.serialize=function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},i.prototype.loadTile=function(e,i){var r=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme,this.crs),this.tileSize);e.request=t.getImage(this.map._requestManager.transformRequest(r,t.ResourceType.Tile),function(r,n){if(delete e.request,e.aborted)e.state="unloaded",i(null);else if(r)e.state="errored",i(r);else if(n){this.map._refreshExpiredTiles&&e.setExpiryData(n),delete n.cacheControl,delete n.expires;var a=t.window.ImageBitmap&&n instanceof t.window.ImageBitmap&&t.offscreenCanvasSupported()?n:t.browser.getImageData(n,1),o={uid:e.uid,coord:e.tileID,source:this.id,rawImageData:a,encoding:this.encoding};e.actor&&"expired"!==e.state||(e.actor=this.dispatcher.getActor(),e.actor.send("loadDEMTile",o,function(t,r){t&&(e.state="errored",i(t)),r&&(e.dem=r,e.needsHillshadePrepare=!0,e.state="loaded",i(null))}.bind(this)))}}.bind(this)),e.neighboringTiles=this._getNeighboringTiles(e.tileID)},i.prototype._getNeighboringTiles=function(e){var i=e.canonical,r=Math.pow(2,i.z),n=(i.x-1+r)%r,a=0===i.x?e.wrap-1:e.wrap,o=(i.x+1+r)%r,s=i.x+1===r?e.wrap+1:e.wrap,l={};return l[new t.OverscaledTileID(e.overscaledZ,a,i.z,n,i.y).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,i.z,o,i.y).key]={backfilled:!1},i.y>0&&(l[new t.OverscaledTileID(e.overscaledZ,a,i.z,n,i.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,i.z,i.x,i.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,i.z,o,i.y-1).key]={backfilled:!1}),i.y+1<r&&(l[new t.OverscaledTileID(e.overscaledZ,a,i.z,n,i.y+1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,i.z,i.x,i.y+1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,i.z,o,i.y+1).key]={backfilled:!1}),l},i.prototype.unloadTile=function(t){t.demTexture&&this.map.painter.saveTileTexture(t.demTexture),t.fbo&&(t.fbo.destroy(),delete t.fbo),t.dem&&delete t.dem,delete t.neighboringTiles,t.state="unloaded",t.actor&&t.actor.send("removeDEMTile",{uid:t.uid,source:this.id})},i}(t.RasterTileSource),T=t.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),I=function(e){function i(t,i,r,n){e.call(this),this.id=t,this.dispatcher=r,this.crs=n.crs,this.coordinates=i.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(n),this.options=i}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.load=function(e,i){var r=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(n,a){r._loaded=!0,n?r.fire(new t.ErrorEvent(n)):a&&(r.image=a,e&&(r.coordinates=e),i&&i(),r._finishLoading())})},i.prototype.loaded=function(){return this._loaded},i.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},i.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})))},i.prototype.setCoordinates=function(e){var i=this;this.coordinates=e;var r=this.crs,n=e.map(function(e){return t.MercatorCoordinate.fromLngLat(e,null,r)});this.tileID=function(e){for(var i=1/0,r=1/0,n=-1/0,a=-1/0,o=0,s=e;o<s.length;o+=1){var l=s[o];i=Math.min(i,l.x),r=Math.min(r,l.y),n=Math.max(n,l.x),a=Math.max(a,l.y)}var u=Math.max(n-i,a-r),h=Math.max(0,Math.floor(-Math.log(u)/Math.LN2)),c=Math.pow(2,h);return new t.CanonicalTileID(h,Math.floor((i+n)/2*c),Math.floor((r+a)/2*c))}(n),this.minzoom=this.maxzoom=this.tileID.z;var a=n.map(function(t){return i.tileID.getTilePoint(t)._round()});return this._boundsArray=new t.StructArrayLayout4i8,this._boundsArray.emplaceBack(a[0].x,a[0].y,0,0),this._boundsArray.emplaceBack(a[1].x,a[1].y,t.EXTENT,0),this._boundsArray.emplaceBack(a[3].x,a[3].y,0,t.EXTENT),this._boundsArray.emplaceBack(a[2].x,a[2].y,t.EXTENT,t.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})),this},i.prototype.prepare=function(){if(0!==Object.keys(this.tiles).length&&this.image){var e=this.map.painter.context,i=e.gl;for(var r in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,T.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new t.Texture(e,this.image,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE)),this.tiles){var n=this.tiles[r];"loaded"!==n.state&&(n.state="loaded",n.texture=this.texture)}}},i.prototype.loadTile=function(t,e){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={},e(null)):(t.state="errored",e(null))},i.prototype.serialize=function(){return t.extend({},this.options,{type:this.type,coordinates:this.coordinates})},i.prototype.hasTransition=function(){return!1},i}(t.SourceEnhance),C=function(e){function i(t,i,r,n){e.call(this,t,i,r,n),this.rebaseRequestUrl=i.rebaseRequestUrl||function(t){return t},this.coordinates=[],this.type="image-map",this.crs=n.crs}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.getCoordinates=function(){return this.coordinates},i.prototype.onAdd=function(t){this.map=t,t.on("resize",this.innerResize.bind(this)),t.on("rotateend",this.innnerRotateEnd.bind(this)),t.on("pitchend",this.innnerPitchEnd.bind(this)),t.on("moveend",this.innerMoveEnd.bind(this));var e=this._options||this.options;e&&this.setClippingArea(e.clippingArea),this.load()},i.prototype.innerResize=function(){this.loadImage()},i.prototype.innnerRotateEnd=function(){this.loadImage()},i.prototype.innnerPitchEnd=function(){this.loadImage()},i.prototype.innerMoveEnd=function(){this.loadImage()},i.prototype.loadImage=function(){this.load()},i.prototype.load=function(e,i){var r=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this.url=this.options.url;var n,a=e||this.transfromMapCoords(),o=this.map._containerDimensions(),s=this.options&&this.options.requestParams?this.options.requestParams:{};if(s&&"POST"===s.method){s.data.size=o[0]+","+o[1];var l=this.url.indexOf("reversebbox=true")>=0;s.data.bbox=this._getBbox(a,l),n=this.url}else n=this.applyUrl(this.url,a,o[0],o[1]);t.getImage(this.map._requestManager.transformRequest(n,t.ResourceType.Image,s),function(e,n){r._loaded=!0,e?r.fire(new t.ErrorEvent(e)):n&&(r.image=n,a&&(r.coordinates=a),i&&i(),r._finishLoading())})},i.prototype.loadTile=function(t,e){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.refreshedUponExpiration=!0,t.buckets={},e(null)):(t.state="errored",e(null))},i.prototype.transfromMapCoords=function(){var t=this.map.getBounds().toArray();return[[t[0][0],t[1][1]],[t[1][0],t[1][1]],[t[1][0],t[0][1]],[t[0][0],t[0][1]]]},i.prototype.transfromCoordsToBound=function(t){var e=[],i=[];return t.forEach(function(t){e.push(t[0]),i.push(t[1])}),[Math.min.apply(Math,e),Math.min.apply(Math,i),Math.max.apply(Math,e),Math.max.apply(Math,i)]},i.prototype._getBbox=function(t,e){var i=this.transfromCoordsToBound(t);if(e){var r=i[0],n=i[2],a=i[3];i[0]=i[1],i[1]=r,i[2]=a,i[3]=n}return i.toString()},i.prototype.applyUrl=function(e,i,r,n){var a=this.transfromCoordsToBound(i),o=this._project(new t.LngLat(a[0],a[1])),s=this._project(new t.LngLat(a[2],a[3])),l=[o.x,o.y,s.x,s.y];return e.indexOf("reversebbox=true")>=0&&[a,l].forEach(function(t){var e=t[0],i=t[2],r=t[3];t[0]=t[1],t[1]=e,t[2]=r,t[3]=i}),this.rebaseRequestUrl(e,{latlngBounds:a,mercatorBound:l,imageSize:[r,n]})},i.prototype._project=function(t){var e={};e.x=t.lng*Math.PI/180*6378137;var i=t.lat*Math.PI/180;return e.y=3189068.5*Math.log((1+Math.sin(i))/(1-Math.sin(i))),e},i.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})))},i.prototype.updateImage=function(t){var e=this;return this.image&&t.url?(this.options.url=t.url,this.load(this.coordinates,function(){e.texture=null}),this):this},i.prototype.setCoordinates=function(e){var i=this;this.coordinates=e;var r=this.crs,n=e.map(function(e){return t.MercatorCoordinate.fromLngLat(e,null,r)});this.tileID=function(e){for(var i=1/0,r=1/0,n=-1/0,a=-1/0,o=0,s=e;o<s.length;o+=1){var l=s[o];i=Math.min(i,l.x),r=Math.min(r,l.y),n=Math.max(n,l.x),a=Math.max(a,l.y)}var u=Math.max(n-i,a-r),h=Math.max(0,Math.floor(-Math.log(u)/Math.LN2)),c=Math.pow(2,h);return new t.CanonicalTileID(h,Math.floor((i+n)/2*c),Math.floor((r+a)/2*c))}(n),this.minzoom=this.maxzoom=this.tileID.z;var a=n.map(function(t){return i.tileID.getTilePoint(t)._round()});return this._boundsArray=new t.StructArrayLayout4i8,this._boundsArray.emplaceBack(a[0].x,a[0].y,0,0),this._boundsArray.emplaceBack(a[1].x,a[1].y,t.EXTENT,0),this._boundsArray.emplaceBack(a[3].x,a[3].y,0,t.EXTENT),this._boundsArray.emplaceBack(a[2].x,a[2].y,t.EXTENT,t.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})),this},i.prototype.prepare=function(){if(0!==Object.keys(this.tiles).length&&this.image){var e=this.map.painter.context,i=e.gl;for(var r in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,T.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new t.Texture(e,this.image,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE)),this.texture.update(this.image),this.tiles){var n=this.tiles[r];"loaded"!==n.state&&(n.state="loaded",n.texture=this.texture)}}},i.prototype.serialize=function(){return t.extend({},this.options,{type:this.type,coordinates:this.transfromMapCoords()})},i}(I);function A(t){var e=(90+t)/180*90;return e||45+e/2}function P(t){return t.geometry.coordinates=t.geometry.coordinates.map(function(t){return t[1]=A(t[1]),t}),t}function L(t){return t.geometry.coordinates=t.geometry.coordinates.map(function(t){return t.map(function(t){return t[1]=A(t[1]),t})}),t}function z(t){return t.geometry.coordinates=t.geometry.coordinates.map(function(t){return t.map(function(t){return t.map(function(t){return t[1]=A(t[1]),t})}),t}),t}var D=function(e){function i(i,r,n,a){e.call(this),this.id=i,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._loaded=!1,this.actor=n.getActor(),this.crs=a.crs,this.setEventedParent(a),this._data=r.data,this._options=t.extend({},r),this._collectResourceTiming=r.collectResourceTiming,this._resourceTiming=[],void 0!==r.maxzoom&&(this.maxzoom=r.maxzoom),r.type&&(this.type=r.type),r.attribution&&(this.attribution=r.attribution);var o=r.isWrapData;this.promoteId=r.promoteId;var s=t.EXTENT/this.tileSize;this.workerOptions=t.extend({crs:this.getEpsgCode(),source:this.id,cluster:r.cluster||!1,geojsonVtOptions:{buffer:(void 0!==r.buffer?r.buffer:128)*s,tolerance:(void 0!==r.tolerance?r.tolerance:.375)*s,extent:t.EXTENT,maxZoom:this.maxzoom,lineMetrics:r.lineMetrics||!1,generateId:r.generateId||!1,crs:this.getEpsgCode(),projectionParams:this.getProjectionParams(),isWrapData:!!o},superclusterOptions:{maxZoom:void 0!==r.clusterMaxZoom?Math.min(r.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,extent:t.EXTENT,radius:(r.clusterRadius||50)*s,log:!1,generateId:r.generateId||!1,crs:this.getEpsgCode()},clusterProperties:r.clusterProperties},r.workerOptions)}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.getEpsgCode=function(){return this.crs?this.crs.epsgCode:"EPSG:3857"},i.prototype.getProjectionParams=function(){var t=this.crs,e=t.projection,i=t.getExtent(),r=t.getCoordsInfo(i);return{code:t.epsgCode,def:t.def||e._def,originX:r.originX,originY:r.originY,width:r.width,height:r.height,bounds:Array.from(i)}},i.prototype.fixCrsData=function(e){return this.getEpsgCode()!==t.CRS.EPSG3857.getEpsgCode()&&(e=function(t,e){return"FeatureCollection"===t.type?t=function(t){return t.features=t.features.map(function(e){var i;return"Point"===e.geometry.type?((i=e).geometry.coordinates[1]=A(i.geometry.coordinates[1]),e=i):"LineString"===e.geometry.type||"MultiPoint"===t.type?e=P(e):"Polygon"===e.geometry.type||"MultiLineString"===t.type?e=L(e):"MultiPolygon"===e.geometry.type&&(e=z(e)),e}),t}(t):"Point"===t.type?t=oopPoint(t):"LineString"===t.type||"MultiPoint"===t.type?t=P(t):"Polygon"===t.type||"MultiLineString"===t.type?t=L(t):"MultiPolygon"===t.type&&(t=z(t)),console.log("loopdata",t),t}(e)),e},i.prototype.load=function(){var e=this;this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(i){if(i)e.fire(new t.ErrorEvent(i));else{var r={dataType:"source",sourceDataType:"metadata"};e._collectResourceTiming&&e._resourceTiming&&e._resourceTiming.length>0&&(r.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new t.Event("data",r))}})},i.prototype.onAdd=function(t){this.map=t,this.load();var e=this._options||this.options;e&&this.setClippingArea(e.clippingArea)},i.prototype.setData=function(e){var i=this;return this._data=e,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(e){if(e)i.fire(new t.ErrorEvent(e));else{var r={dataType:"source",sourceDataType:"content"};i._collectResourceTiming&&i._resourceTiming&&i._resourceTiming.length>0&&(r.resourceTiming=i._resourceTiming,i._resourceTiming=[]),i.fire(new t.Event("data",r))}}),this},i.prototype.getClusterExpansionZoom=function(t,e){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},e),this},i.prototype.getClusterChildren=function(t,e){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},e),this},i.prototype.getClusterLeaves=function(t,e,i,r){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:i},r),this},i.prototype._updateWorkerData=function(e){var i=this;this._loaded=!1;var r=t.extend({},this.workerOptions),n=this._data;"string"==typeof n?(r.request=this.map._requestManager.transformRequest(t.browser.resolveURL(n),t.ResourceType.Source),r.request.collectResourceTiming=this._collectResourceTiming):r.data=JSON.stringify(n),this.actor.send(this.type+".loadData",r,function(t,n){i._removed||n&&n.abandoned||(i._loaded=!0,n&&n.resourceTiming&&n.resourceTiming[i.id]&&(i._resourceTiming=n.resourceTiming[i.id].slice(0)),i.actor.send(i.type+".coalesce",{source:r.source},null),e(t))})},i.prototype.loaded=function(){return this._loaded},i.prototype.loadTile=function(e,i){var r=this,n=e.actor?"reloadTile":"loadTile";e.actor=this.actor,e.request=this.actor.send(n,{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,promoteId:this.promoteId},function(t,a){return delete e.request,e.unloadVectorData(),e.aborted?i(null):t?i(t):(e.loadVectorData(a,r.map.painter,"reloadTile"===n),i(null))})},i.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0},i.prototype.unloadTile=function(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})},i.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},i.prototype.serialize=function(){var e=t.extend({},this._options,{type:this.type,data:this._data});return delete e.crs,e},i.prototype.hasTransition=function(){return!1},i}(t.SourceEnhance),R=function(e){function i(t,i,r,n){e.call(this,t,i,r,n),this.roundZoom=!0,this.type="video",this.options=i}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.load=function(){var e=this;this._loaded=!1;var i=this.options;this.urls=[];for(var r=0,n=i.urls;r<n.length;r+=1)this.urls.push(this.map._requestManager.transformRequest(n[r],t.ResourceType.Source).url);t.getVideo(this.urls,function(i,r){e._loaded=!0,i?e.fire(new t.ErrorEvent(i)):r&&(e.video=r,e.video.loop=!0,e.video.addEventListener("playing",function(){e.map.triggerRepaint()}),e.map&&e.video.play(),e._finishLoading())})},i.prototype.pause=function(){this.video&&this.video.pause()},i.prototype.play=function(){this.video&&this.video.play()},i.prototype.seek=function(e){if(this.video){var i=this.video.seekable;e<i.start(0)||e>i.end(0)?this.fire(new t.ErrorEvent(new t.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+i.start(0)+" and "+i.end(0)+"-second mark."))):this.video.currentTime=e}},i.prototype.getVideo=function(){return this.video},i.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},i.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var e=this.map.painter.context,i=e.gl;for(var r in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,T.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE),i.texSubImage2D(i.TEXTURE_2D,0,0,0,i.RGBA,i.UNSIGNED_BYTE,this.video)):(this.texture=new t.Texture(e,this.video,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE)),this.tiles){var n=this.tiles[r];"loaded"!==n.state&&(n.state="loaded",n.texture=this.texture)}}},i.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},i.prototype.hasTransition=function(){return this.video&&!this.video.paused},i}(I),O=function(e){function i(i,r,n,a){e.call(this,i,r,n,a),r.coordinates?Array.isArray(r.coordinates)&&4===r.coordinates.length&&!r.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."+i,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+i,null,'missing required property "coordinates"'))),r.animate&&"boolean"!=typeof r.animate&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+i,null,'optional "animate" property must be a boolean value'))),r.canvas?"string"==typeof r.canvas||r.canvas instanceof t.window.HTMLCanvasElement||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+i,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."+i,null,'missing required property "canvas"'))),this.options=r,this.animate=void 0===r.animate||r.animate}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.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())},i.prototype.getCanvas=function(){return this.canvas},i.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()},i.prototype.onRemove=function(){this.pause()},i.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 i=this.map.painter.context,r=i.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=i.createVertexBuffer(this._boundsArray,T.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(i,this.canvas,r.RGBA,{premultiply:!0}),this.tiles){var a=this.tiles[n];"loaded"!==a.state&&(a.state="loaded",a.texture=this.texture)}}},i.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},i.prototype.hasTransition=function(){return this._playing},i.prototype._hasInvalidDimensions=function(){for(var t=0,e=[this.canvas.width,this.canvas.height];t<e.length;t+=1){var i=e[t];if(isNaN(i)||i<=0)return!0}return!1},i}(I),B={vector:E,raster:t.RasterTileSource,"raster-dem":k,"image-map":C,geojson:D,video:R,image:I,canvas:O};function F(e,i){var r=t.identity([]);return t.translate(r,r,[1,1,0]),t.scale(r,r,[.5*e.width,.5*e.height,1]),t.multiply(r,r,e.calculatePosMatrix(i.toUnwrapped()))}function V(t,e,i,r,n,a){var o=function(t,e,i){if(t)for(var r=0,n=t;r<n.length;r+=1){var a=e[n[r]];if(a&&a.source===i&&"fill-extrusion"===a.type)return!0}else for(var o in e){var s=e[o];if(s.source===i&&"fill-extrusion"===s.type)return!0}return!1}(n&&n.layers,e,t.id),s=a.maxPitchScaleFactor(),l=t.tilesIn(r,s,o);l.sort(U);for(var u=[],h=0,c=l;h<c.length;h+=1){var p=c[h];u.push({wrappedTileID:p.tileID.wrapped().key,queryResults:p.tile.queryRenderedFeatures(e,i,t._state,p.queryGeometry,p.cameraQueryGeometry,p.scale,n,a,s,F(t.transform,p.tileID))})}var f=function(t){for(var e={},i={},r=0,n=t;r<n.length;r+=1){var a=n[r],o=a.queryResults,s=a.wrappedTileID,l=i[s]=i[s]||{};for(var u in o)for(var h=o[u],c=l[u]=l[u]||{},p=e[u]=e[u]||[],f=0,d=h;f<d.length;f+=1){var y=d[f];c[y.featureIndex]||(c[y.featureIndex]=!0,p.push(y))}}return e}(u);for(var d in f)f[d].forEach(function(e){var i=e.feature,r=t.getFeatureState(i.layer["source-layer"],i.id);i.source=i.layer.source,i.layer["source-layer"]&&(i.sourceLayer=i.layer["source-layer"]),i.state=r});return f}function U(t,e){var i=t.tileID,r=e.tileID;return i.overscaledZ-r.overscaledZ||i.canonical.y-r.canonical.y||i.wrap-r.wrap||i.canonical.x-r.canonical.x}var j=function(t,e){this.max=t,this.onRemove=e,this.reset()};j.prototype.reset=function(){for(var t in this.data)for(var e=0,i=this.data[t];e<i.length;e+=1){var r=i[e];r.timeout&&clearTimeout(r.timeout),this.onRemove(r.value)}return this.data={},this.order=[],this},j.prototype.add=function(t,e,i){var r=this,n=t.wrapped().key;void 0===this.data[n]&&(this.data[n]=[]);var a={value:e,timeout:void 0};if(void 0!==i&&(a.timeout=setTimeout(function(){r.remove(t,a)},i)),this.data[n].push(a),this.order.push(n),this.order.length>this.max){var o=this._getAndRemoveByKey(this.order[0]);o&&this.onRemove(o)}return this},j.prototype.has=function(t){return t.wrapped().key in this.data},j.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},j.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},j.prototype.getByKey=function(t){var e=this.data[t];return e?e[0].value:null},j.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},j.prototype.remove=function(t,e){if(!this.has(t))return this;var i=t.wrapped().key,r=void 0===e?0:this.data[i].indexOf(e),n=this.data[i][r];return this.data[i].splice(r,1),n.timeout&&clearTimeout(n.timeout),0===this.data[i].length&&delete this.data[i],this.onRemove(n.value),this.order.splice(this.order.indexOf(i),1),this},j.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},j.prototype.filter=function(t){var e=[];for(var i in this.data)for(var r=0,n=this.data[i];r<n.length;r+=1){var a=n[r];t(a.value)||e.push(a)}for(var o=0,s=e;o<s.length;o+=1){var l=s[o];this.remove(l.value.tileID,l)}};var N=function(t,e,i){this.context=t;var r=t.gl;this.buffer=r.createBuffer(),this.dynamicDraw=Boolean(i),this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),r.bufferData(r.ELEMENT_ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?r.DYNAMIC_DRAW:r.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer};N.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},N.prototype.updateData=function(t){var e=this.context.gl;this.context.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)},N.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var q={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},G=function(t,e,i,r){this.length=e.length,this.attributes=i,this.itemSize=e.bytesPerElement,this.dynamicDraw=r,this.context=t;var n=t.gl;this.buffer=n.createBuffer(),t.bindVertexBuffer.set(this.buffer),n.bufferData(n.ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer};G.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},G.prototype.updateData=function(t){var e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer)},G.prototype.enableAttributes=function(t,e){for(var i=0;i<this.attributes.length;i++){var r=e.attributes[this.attributes[i].name];void 0!==r&&t.enableVertexAttribArray(r)}},G.prototype.setVertexAttribPointers=function(t,e,i){for(var r=0;r<this.attributes.length;r++){var n=this.attributes[r],a=e.attributes[n.name];void 0!==a&&t.vertexAttribPointer(a,n.components,t[q[n.type]],!1,this.itemSize,n.offset+this.itemSize*(i||0))}},G.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var Z=function(t){this.gl=t.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1};Z.prototype.get=function(){return this.current},Z.prototype.set=function(t){},Z.prototype.getDefault=function(){return this.default},Z.prototype.setDefault=function(){this.set(this.default)};var X=function(e){function i(){e.apply(this,arguments)}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.getDefault=function(){return t.Color.transparent},i.prototype.set=function(t){var e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)},i}(Z),W=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return 1},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.clearDepth(t),this.current=t,this.dirty=!1)},e}(Z),K=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return 0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.clearStencil(t),this.current=t,this.dirty=!1)},e}(Z),H=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return[!0,!0,!0,!0]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)},e}(Z),J=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.depthMask(t),this.current=t,this.dirty=!1)},e}(Z),Y=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return 255},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.stencilMask(t),this.current=t,this.dirty=!1)},e}(Z),Q=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return{func:this.gl.ALWAYS,ref:0,mask:255}},e.prototype.set=function(t){var e=this.current;(t.func!==e.func||t.ref!==e.ref||t.mask!==e.mask||this.dirty)&&(this.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t,this.dirty=!1)},e}(Z),$=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){var t=this.gl;return[t.KEEP,t.KEEP,t.KEEP]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||this.dirty)&&(this.gl.stencilOp(t[0],t[1],t[2]),this.current=t,this.dirty=!1)},e}(Z),tt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.STENCIL_TEST):e.disable(e.STENCIL_TEST),this.current=t,this.dirty=!1}},e}(Z),et=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return[0,1]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.depthRange(t[0],t[1]),this.current=t,this.dirty=!1)},e}(Z),it=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),this.current=t,this.dirty=!1}},e}(Z),rt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.LESS},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.depthFunc(t),this.current=t,this.dirty=!1)},e}(Z),nt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.BLEND):e.disable(e.BLEND),this.current=t,this.dirty=!1}},e}(Z),at=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){var t=this.gl;return[t.ONE,t.ZERO]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.blendFunc(t[0],t[1]),this.current=t,this.dirty=!1)},e}(Z),ot=function(e){function i(){e.apply(this,arguments)}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.getDefault=function(){return t.Color.transparent},i.prototype.set=function(t){var e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)},i}(Z),st=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.FUNC_ADD},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.blendEquation(t),this.current=t,this.dirty=!1)},e}(Z),lt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.CULL_FACE):e.disable(e.CULL_FACE),this.current=t,this.dirty=!1}},e}(Z),ut=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.BACK},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.cullFace(t),this.current=t,this.dirty=!1)},e}(Z),ht=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.CCW},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(t),this.current=t,this.dirty=!1)},e}(Z),ct=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.useProgram(t),this.current=t,this.dirty=!1)},e}(Z),pt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.TEXTURE0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.activeTexture(t),this.current=t,this.dirty=!1)},e}(Z),ft=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){var t=this.gl;return[0,0,t.drawingBufferWidth,t.drawingBufferHeight]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)},e}(Z),dt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,t),this.current=t,this.dirty=!1}},e}(Z),yt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindRenderbuffer(e.RENDERBUFFER,t),this.current=t,this.dirty=!1}},e}(Z),mt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindTexture(e.TEXTURE_2D,t),this.current=t,this.dirty=!1}},e}(Z),vt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindBuffer(e.ARRAY_BUFFER,t),this.current=t,this.dirty=!1}},e}(Z),gt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){var e=this.gl;e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1},e}(Z),_t=function(t){function e(e){t.call(this,e),this.vao=e.extVertexArrayObject}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){this.vao&&(t!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(t),this.current=t,this.dirty=!1)},e}(Z),xt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return 4},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1}},e}(Z),bt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1}},e}(Z),wt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1}},e}(Z),St=function(t){function e(e,i){t.call(this,e),this.context=e,this.parent=i}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e}(Z),Mt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.setDirty=function(){this.dirty=!0},e.prototype.set=function(t){if(t!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var e=this.gl;e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}},e}(St),Et=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){if(t!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var e=this.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t),this.current=t,this.dirty=!1}},e}(St),kt=function(t,e,i,r){this.context=t,this.width=e,this.height=i;var n=this.framebuffer=t.gl.createFramebuffer();this.colorAttachment=new Mt(t,n),r&&(this.depthAttachment=new Et(t,n))};kt.prototype.destroy=function(){var t=this.context.gl,e=this.colorAttachment.get();if(e&&t.deleteTexture(e),this.depthAttachment){var i=this.depthAttachment.get();i&&t.deleteRenderbuffer(i)}t.deleteFramebuffer(this.framebuffer)};var Tt=function(t,e,i){this.func=t,this.mask=e,this.range=i};Tt.ReadOnly=!1,Tt.ReadWrite=!0,Tt.disabled=new Tt(519,Tt.ReadOnly,[0,1]);var It=function(t,e,i,r,n,a){this.test=t,this.ref=e,this.mask=i,this.fail=r,this.depthFail=n,this.pass=a};It.disabled=new It({func:519,mask:0},0,0,7680,7680,7680);var Ct=function(t,e,i){this.blendFunction=t,this.blendColor=e,this.mask=i};Ct.disabled=new Ct(Ct.Replace=[1,0],t.Color.transparent,[!1,!1,!1,!1]),Ct.unblended=new Ct(Ct.Replace,t.Color.transparent,[!0,!0,!0,!0]),Ct.alphaBlended=new Ct([1,771],t.Color.transparent,[!0,!0,!0,!0]);var At=function(t,e,i){this.enable=t,this.mode=e,this.frontFace=i};At.disabled=new At(!1,1029,2305),At.backCCW=new At(!0,1029,2305);var Pt=function(t){this.gl=t,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new X(this),this.clearDepth=new W(this),this.clearStencil=new K(this),this.colorMask=new H(this),this.depthMask=new J(this),this.stencilMask=new Y(this),this.stencilFunc=new Q(this),this.stencilOp=new $(this),this.stencilTest=new tt(this),this.depthRange=new et(this),this.depthTest=new it(this),this.depthFunc=new rt(this),this.blend=new nt(this),this.blendFunc=new at(this),this.blendColor=new ot(this),this.blendEquation=new st(this),this.cullFace=new lt(this),this.cullFaceSide=new ut(this),this.frontFace=new ht(this),this.program=new ct(this),this.activeTexture=new pt(this),this.viewport=new ft(this),this.bindFramebuffer=new dt(this),this.bindRenderbuffer=new yt(this),this.bindTexture=new mt(this),this.bindVertexBuffer=new vt(this),this.bindElementBuffer=new gt(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new _t(this),this.pixelStoreUnpack=new xt(this),this.pixelStoreUnpackPremultiplyAlpha=new bt(this),this.pixelStoreUnpackFlipY=new wt(this),this.extTextureFilterAnisotropic=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=t.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=t.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&t.getExtension("OES_texture_half_float_linear"),this.extTimerQuery=t.getExtension("EXT_disjoint_timer_query")};Pt.prototype.setDefault=function(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()},Pt.prototype.setDirty=function(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.extVertexArrayObject&&(this.bindVertexArrayOES.dirty=!0),this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0},Pt.prototype.createIndexBuffer=function(t,e){return new N(this,t,e)},Pt.prototype.createVertexBuffer=function(t,e,i){return new G(this,t,e,i)},Pt.prototype.createRenderbuffer=function(t,e,i){var r=this.gl,n=r.createRenderbuffer();return this.bindRenderbuffer.set(n),r.renderbufferStorage(r.RENDERBUFFER,t,e,i),this.bindRenderbuffer.set(null),n},Pt.prototype.createFramebuffer=function(t,e,i){return new kt(this,t,e,i)},Pt.prototype.clear=function(t){var e=t.color,i=t.depth,r=this.gl,n=0;e&&(n|=r.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),void 0!==i&&(n|=r.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(i),this.depthMask.set(!0)),r.clear(n)},Pt.prototype.setCullFace=function(t){!1===t.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(t.mode),this.frontFace.set(t.frontFace))},Pt.prototype.setDepthMode=function(t){t.func!==this.gl.ALWAYS||t.mask?(this.depthTest.set(!0),this.depthFunc.set(t.func),this.depthMask.set(t.mask),this.depthRange.set(t.range)):this.depthTest.set(!1)},Pt.prototype.setStencilMode=function(t){t.test.func!==this.gl.ALWAYS||t.mask?(this.stencilTest.set(!0),this.stencilMask.set(t.mask),this.stencilOp.set([t.fail,t.depthFail,t.pass]),this.stencilFunc.set({func:t.test.func,ref:t.ref,mask:t.test.mask})):this.stencilTest.set(!1)},Pt.prototype.setColorMode=function(e){t.deepEqual(e.blendFunction,Ct.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask)},Pt.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)};var Lt=function(e){function i(i,r,n){var a=this;e.call(this),this.id=i,this.dispatcher=n,this.crs=r.crs,this.on("data",function(t){"source"===t.dataType&&"metadata"===t.sourceDataType&&(a._sourceLoaded=!0),a._sourceLoaded&&!a._paused&&"source"===t.dataType&&"content"===t.sourceDataType&&(a.reload(),a.transform&&a.update(a.transform))}),this.on("error",function(){a._sourceErrored=!0}),this._source=function(e,i,r,n){var a=new B[i.type](e,i,r,n);if(a.id!==e)throw new Error("Expected Source id to be "+e+" instead of "+a.id);return t.bindAll(["load","abort","unload","serialize","prepare"],a),a}(i,r,n,this),this._tiles={},this._cache=new j(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new t.SourceFeatureState}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.onAdd=function(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(t)},i.prototype.onRemove=function(t){this._source&&this._source.onRemove&&this._source.onRemove(t)},i.prototype.loaded=function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;if(!this._source.loaded())return!1;for(var t in this._tiles){var e=this._tiles[t];if("loaded"!==e.state&&"errored"!==e.state)return!1}return!0},i.prototype.getSource=function(){return this._source},i.prototype.pause=function(){this._paused=!0},i.prototype.resume=function(){if(this._paused){var t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform)}},i.prototype._loadTile=function(t,e){return this._source.loadTile(t,e)},i.prototype._unloadTile=function(t){if(this._source.unloadTile)return this._source.unloadTile(t,function(){})},i.prototype._abortTile=function(t){if(this._source.abortTile)return this._source.abortTile(t,function(){})},i.prototype.serialize=function(){return this._source.serialize()},i.prototype.prepare=function(t){for(var e in this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null),this._tiles){var i=this._tiles[e];i.upload(t),i.prepare(this.map.style.imageManager)}},i.prototype.getIds=function(){return t.values(this._tiles).map(function(t){return t.tileID}).sort(zt).map(function(t){return t.key})},i.prototype.getRenderableIds=function(e){var i=this,r=[];for(var n in this._tiles)this._isIdRenderable(n,e)&&r.push(this._tiles[n]);return e?r.sort(function(e,r){var n=e.tileID,a=r.tileID,o=new t.Point(n.canonical.x,n.canonical.y)._rotate(i.transform.angle),s=new t.Point(a.canonical.x,a.canonical.y)._rotate(i.transform.angle);return n.overscaledZ-a.overscaledZ||s.y-o.y||s.x-o.x}).map(function(t){return t.tileID.key}):r.map(function(t){return t.tileID}).sort(zt).map(function(t){return t.key})},i.prototype.hasRenderableParent=function(t){var e=this.findLoadedParent(t,0);return!!e&&this._isIdRenderable(e.tileID.key)},i.prototype._isIdRenderable=function(t,e){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(e||!this._tiles[t].holdingForFade())},i.prototype.reload=function(){if(this._paused)this._shouldReloadOnResume=!0;else for(var t in this._cache.reset(),this._tiles)"errored"!==this._tiles[t].state&&this._reloadTile(t,"reloading")},i.prototype._reloadTile=function(t,e){var i=this._tiles[t];i&&("loading"!==i.state&&(i.state=e),this._loadTile(i,this._tileLoaded.bind(this,i,t,e)))},i.prototype._tileLoaded=function(e,i,r,n){if(n)return e.state="errored",void(404!==n.status?this._source.fire(new t.ErrorEvent(n,{tile:e})):this.update(this.transform));e.timeAdded=t.browser.now(),"expired"===r&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(i,e),"raster-dem"===this.getSource().type&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),this._source.fire(new t.Event("data",{dataType:"source",tile:e,coord:e.tileID}))},i.prototype._backfillDEM=function(t){for(var e=this.getRenderableIds(),i=0;i<e.length;i++){var r=e[i];if(t.neighboringTiles&&t.neighboringTiles[r]){var n=this.getTileByID(r);a(t,n),a(n,t)}}function a(t,e){t.needsHillshadePrepare=!0;var i=e.tileID.canonical.x-t.tileID.canonical.x,r=e.tileID.canonical.y-t.tileID.canonical.y,n=Math.pow(2,t.tileID.canonical.z),a=e.tileID.key;0===i&&0===r||Math.abs(r)>1||(Math.abs(i)>1&&(1===Math.abs(i+n)?i+=n:1===Math.abs(i-n)&&(i-=n)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,i,r),t.neighboringTiles&&t.neighboringTiles[a]&&(t.neighboringTiles[a].backfilled=!0)))}},i.prototype.getTile=function(t){return this.getTileByID(t.key)},i.prototype.getTileByID=function(t){return this._tiles[t]},i.prototype._retainLoadedChildren=function(t,e,i,r){for(var n in this._tiles){var a=this._tiles[n];if(!(r[n]||!a.hasData()||a.tileID.overscaledZ<=e||a.tileID.overscaledZ>i)){for(var o=a.tileID;a&&a.tileID.overscaledZ>e+1;){var s=a.tileID.scaledTo(a.tileID.overscaledZ-1);(a=this._tiles[s.key])&&a.hasData()&&(o=s)}for(var l=o;l.overscaledZ>e;)if(t[(l=l.scaledTo(l.overscaledZ-1)).key]){r[o.key]=o;break}}}},i.prototype.findLoadedParent=function(t,e){if(t.key in this._loadedParentTiles){var i=this._loadedParentTiles[t.key];return i&&i.tileID.overscaledZ>=e?i:null}for(var r=t.overscaledZ-1;r>=e;r--){var n=t.scaledTo(r),a=this._getLoadedTile(n);if(a)return a}},i.prototype._getLoadedTile=function(t){var e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(t.wrapped().key)},i.prototype.updateCacheSize=function(t){var e=Math.ceil(t.width/this._source.tileSize)+1,i=Math.ceil(t.height/this._source.tileSize)+1,r=Math.floor(e*i*5),n="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,r):r;this._cache.setMaxSize(n)},i.prototype.handleWrapJump=function(t){var e=Math.round((t-(void 0===this._prevLng?t:this._prevLng))/360);if(this._prevLng=t,e){var i={};for(var r in this._tiles){var n=this._tiles[r];n.tileID=n.tileID.unwrapTo(n.tileID.wrap+e),i[n.tileID.key]=n}for(var a in this._tiles=i,this._timers)clearTimeout(this._timers[a]),delete this._timers[a];for(var o in this._tiles)this._setTileReloadTimer(o,this._tiles[o])}},i.prototype.update=function(e){var r=this,n=e;if(this.crs&&e.crs!==this.crs){(n=e.clone()).resetZoomScale=!1;var a=e.crs,o=this.crs||a;n.crs=o;var s=a.getMeterPerMapUnit(a.unit)*a.width,l=o.getMeterPerMapUnit(o.unit)*o.width,u=Math.log(e.worldSize/512*l/s)/Math.LN2;n.pixelsToGLUnits=[2/e.width,-2/e.height],n.minZoom=Math.min(u,n.minZoom),n.maxZoom=Math.max(u,n.maxZoom),n.zoom=u}if(this.transform=n,this._sourceLoaded&&!this._paused){var h;this.updateCacheSize(n),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?h=n.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)}):(h=n.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,source:this._source}),this._source.hasTile&&(h=h.filter(function(t){return r._source.hasTile(t)}))):h=[];var c=n.coveringZoomLevel(this._source),p=Math.max(c-i.maxOverzooming,this._source.minzoom),f=Math.max(c+i.maxUnderzooming,this._source.minzoom),d=this._updateRetainedTiles(h,c);if(Dt(this._source.type)){for(var y={},m={},v=0,g=Object.keys(d);v<g.length;v+=1){var _=g[v],x=d[_],b=this._tiles[_];if(b&&!(b.fadeEndTime&&b.fadeEndTime<=t.browser.now())){var w=this.findLoadedParent(x,p);w&&(this._addTile(w.tileID),y[w.tileID.key]=w.tileID),m[_]=x}}for(var S in this._retainLoadedChildren(m,c,f,d),y)d[S]||(this._coveredTiles[S]=!0,d[S]=y[S])}for(var M in d)this._tiles[M].clearFadeHold();for(var E=0,k=t.keysDifference(this._tiles,d);E<k.length;E+=1){var T=k[E],I=this._tiles[T];I.hasSymbolBuckets&&!I.holdingForFade()?I.setHoldDuration(this.map._fadeDuration):I.hasSymbolBuckets&&!I.symbolFadeFinished()||this._removeTile(T)}this._updateLoadedParentTileCache()}},i.prototype.releaseSymbolFadeTiles=function(){for(var t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t)},i.prototype._updateRetainedTiles=function(t,e){for(var r={},n={},a=Math.max(e-i.maxOverzooming,this._source.minzoom),o=Math.max(e+i.maxUnderzooming,this._source.minzoom),s={},l=0,u=t;l<u.length;l+=1){var h=u[l],c=this._addTile(h);r[h.key]=h,c.hasData()||e<this._source.maxzoom&&(s[h.key]=h)}this._retainLoadedChildren(s,e,o,r);for(var p=0,f=t;p<f.length;p+=1){var d=f[p],y=this._tiles[d.key];if(!y.hasData()){if(e+1>this._source.maxzoom){var m=d.children(this._source.maxzoom)[0],v=this.getTile(m);if(v&&v.hasData()){r[m.key]=m;continue}}else{var g=d.children(this._source.maxzoom);if(r[g[0].key]&&r[g[1].key]&&r[g[2].key]&&r[g[3].key])continue}for(var _=y.wasRequested(),x=d.overscaledZ-1;x>=a;--x){var b=d.scaledTo(x);if(n[b.key])break;if(n[b.key]=!0,!(y=this.getTile(b))&&_&&(y=this._addTile(b)),y&&(r[b.key]=b,_=y.wasRequested(),y.hasData()))break}}}return r},i.prototype._updateLoadedParentTileCache=function(){for(var t in this._loadedParentTiles={},this._tiles){for(var e=[],i=void 0,r=this._tiles[t].tileID;r.overscaledZ>0;){if(r.key in this._loadedParentTiles){i=this._loadedParentTiles[r.key];break}e.push(r.key);var n=r.scaledTo(r.overscaledZ-1);if(i=this._getLoadedTile(n))break;r=n}for(var a=0,o=e;a<o.length;a+=1)this._loadedParentTiles[o[a]]=i}},i.prototype._addTile=function(e){var i=this._tiles[e.key];if(i)return i;(i=this._cache.getAndRemove(e))&&(this._setTileReloadTimer(e.key,i),i.tileID=e,this._state.initializeTileState(i,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,i)));var r=Boolean(i);return r||(i=new t.Tile(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(i,this._tileLoaded.bind(this,i,e.key,i.state))),i?(i.uses++,this._tiles[e.key]=i,r||this._source.fire(new t.Event("dataloading",{tile:i,coord:i.tileID,dataType:"source"})),i):null},i.prototype._setTileReloadTimer=function(t,e){var i=this;t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);var r=e.getExpiryTimeout();r&&(this._timers[t]=setTimeout(function(){i._reloadTile(t,"expired"),delete i._timers[t]},r))},i.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))))},i.prototype.clearTiles=function(){for(var t in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(t);this._cache.reset()},i.prototype.tilesIn=function(e,i,r){var n=this,a=[],o=this.transform;if(!o)return a;for(var s=r?o.getCameraQueryGeometry(e):e,l=e.map(function(t){return o.pointCoordinate(t)}),u=s.map(function(t){return o.pointCoordinate(t)}),h=this.getIds(),c=1/0,p=1/0,f=-1/0,d=-1/0,y=0,m=u;y<m.length;y+=1){var v=m[y];c=Math.min(c,v.x),p=Math.min(p,v.y),f=Math.max(f,v.x),d=Math.max(d,v.y)}for(var g=function(e){var r=n._tiles[h[e]];if(!r.holdingForFade()){var s=r.tileID,y=Math.pow(2,o.zoom-r.tileID.overscaledZ),m=i*r.queryPadding*t.EXTENT/r.tileSize/y,v=[s.getTilePoint(new t.MercatorCoordinate(c,p)),s.getTilePoint(new t.MercatorCoordinate(f,d))];if(v[0].x-m<t.EXTENT&&v[0].y-m<t.EXTENT&&v[1].x+m>=0&&v[1].y+m>=0){var g=l.map(function(t){return s.getTilePoint(t)}),_=u.map(function(t){return s.getTilePoint(t)});a.push({tile:r,tileID:s,queryGeometry:g,cameraQueryGeometry:_,scale:y})}}},_=0;_<h.length;_++)g(_);return a},i.prototype.getVisibleCoordinates=function(t){for(var e=this,i=this.getRenderableIds(t).map(function(t){return e._tiles[t].tileID}),r=0,n=i;r<n.length;r+=1){var a=n[r];a.posMatrix=this.transform.calculatePosMatrix(a.toUnwrapped())}return i},i.prototype.hasTransition=function(){if(this._source.hasTransition())return!0;if(Dt(this._source.type))for(var e in this._tiles){var i=this._tiles[e];if(void 0!==i.fadeEndTime&&i.fadeEndTime>=t.browser.now())return!0}return!1},i.prototype.setFeatureState=function(t,e,i){this._state.updateState(t=t||"_geojsonTileLayer",e,i)},i.prototype.removeFeatureState=function(t,e,i){this._state.removeFeatureState(t=t||"_geojsonTileLayer",e,i)},i.prototype.getFeatureState=function(t,e){return this._state.getState(t=t||"_geojsonTileLayer",e)},i.prototype.setDependencies=function(t,e,i){var r=this._tiles[t];r&&r.setDependencies(e,i)},i.prototype.reloadTilesForDependencies=function(t,e){for(var i in this._tiles)this._tiles[i].hasDependency(t,e)&&this._reloadTile(i,"reloading");this._cache.filter(function(i){return!i.hasDependency(t,e)})},i}(t.Evented);function zt(t,e){var i=Math.abs(2*t.wrap)-+(t.wrap<0),r=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||r-i||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function Dt(t){return"raster"===t||"image"===t||"video"===t}function Rt(){return new t.window.Worker(wa.workerUrl)}Lt.maxOverzooming=10,Lt.maxUnderzooming=3;var Ot=function(){this.active={}};Ot.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length<Ot.workerCount;)this.workers.push(new Rt);return this.active[t]=!0,this.workers.slice()},Ot.prototype.release=function(t){delete this.active[t],0===Object.keys(this.active).length&&(this.workers.forEach(function(t){t.terminate()}),this.workers=null)};var Bt,Ft=Math.floor(t.browser.hardwareConcurrency/2);function Vt(e,i){var r={};for(var n in e)"ref"!==n&&(r[n]=e[n]);return t.refProperties.forEach(function(t){t in i&&(r[t]=i[t])}),r}function Ut(t){t=t.slice();for(var e=Object.create(null),i=0;i<t.length;i++)e[t[i].id]=t[i];for(var r=0;r<t.length;r++)"ref"in t[r]&&(t[r]=Vt(t[r],e[t[r].ref]));return t}Ot.workerCount=Math.max(Math.min(Ft,6),1);var jt={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};function Nt(t,e,i){i.push({command:jt.addSource,args:[t,e[t]]})}function qt(t,e,i){e.push({command:jt.removeSource,args:[t]}),i[t]=!0}function Gt(t,e,i,r){qt(t,i,r),Nt(t,e,i)}function Zt(e,i,r){var n;for(n in e[r])if(e[r].hasOwnProperty(n)&&"data"!==n&&!t.deepEqual(e[r][n],i[r][n]))return!1;for(n in i[r])if(i[r].hasOwnProperty(n)&&"data"!==n&&!t.deepEqual(e[r][n],i[r][n]))return!1;return!0}function Xt(e,i,r,n,a,o){var s;for(s in i=i||{},e=e||{})e.hasOwnProperty(s)&&(t.deepEqual(e[s],i[s])||r.push({command:o,args:[n,s,i[s],a]}));for(s in i)i.hasOwnProperty(s)&&!e.hasOwnProperty(s)&&(t.deepEqual(e[s],i[s])||r.push({command:o,args:[n,s,i[s],a]}))}function Wt(t){return t.id}function Kt(t,e){return t[e.id]=e,t}var Ht=function(t,e,i){var r=this.boxCells=[],n=this.circleCells=[];this.xCellCount=Math.ceil(t/i),this.yCellCount=Math.ceil(e/i);for(var a=0;a<this.xCellCount*this.yCellCount;a++)r.push([]),n.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=t,this.height=e,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/e,this.boxUid=0,this.circleUid=0};function Jt(e,i,r,n,a){var o=t.create();return i?(t.scale(o,o,[1/a,1/a,1]),r||t.rotateZ(o,o,n.angle)):t.multiply(o,n.labelPlaneMatrix,e),o}function Yt(e,i,r,n,a){if(i){var o=t.clone(e);return t.scale(o,o,[a,a,1]),r||t.rotateZ(o,o,-n.angle),o}return n.glCoordMatrix}function Qt(e,i){var r=[e.x,e.y,0,1];le(r,r,i);var n=r[3];return{point:new t.Point(r[0]/n,r[1]/n),signedDistanceFromCamera:n}}function $t(t,e){var i=t[0]/t[3],r=t[1]/t[3];return i>=-e[0]&&i<=e[0]&&r>=-e[1]&&r<=e[1]}function te(e,i,r,n,a,o,s,l){var u=n?e.textSizeData:e.iconSizeData,h=t.evaluateSizeForZoom(u,r.transform.zoom),c=[256/r.width*2+1,256/r.height*2+1],p=n?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;p.clear();for(var f=e.lineVertexArray,d=n?e.text.placedSymbolArray:e.icon.placedSymbolArray,y=r.transform.width/r.transform.height,m=!1,v=0;v<d.length;v++){var g=d.get(v);if(g.hidden||g.writingMode===t.WritingMode.vertical&&!m)se(g.numGlyphs,p);else{m=!1;var _=[g.anchorX,g.anchorY,0,1];if(t.transformMat4(_,_,i),$t(_,c)){var x=.5+_[3]/r.transform.cameraToCenterDistance*.5,b=t.evaluateSizeForFeature(u,h,g),w=s?b*x:b/x,S=new t.Point(g.anchorX,g.anchorY),M=Qt(S,a).point,E={},k=re(g,w,!1,l,i,a,o,e.glyphOffsetArray,f,p,M,S,E,y);m=k.useVertical,(k.notEnoughRoom||m||k.needsFlipping&&re(g,w,!0,l,i,a,o,e.glyphOffsetArray,f,p,M,S,E,y).notEnoughRoom)&&se(g.numGlyphs,p)}else se(g.numGlyphs,p)}}n?e.text.dynamicLayoutVertexBuffer.updateData(p):e.icon.dynamicLayoutVertexBuffer.updateData(p)}function ee(t,e,i,r,n,a,o,s,l,u,h,c){var p=s.glyphStartIndex+s.numGlyphs,f=s.lineStartIndex,d=s.lineStartIndex+s.lineLength,y=e.getoffsetX(s.glyphStartIndex),m=e.getoffsetX(p-1),v=ae(t*y,i,r,n,a,o,s.segment,f,d,l,u,h,c);if(!v)return null;var g=ae(t*m,i,r,n,a,o,s.segment,f,d,l,u,h,c);return g?{first:v,last:g}:null}function ie(e,i,r,n){return e===t.WritingMode.horizontal&&Math.abs(r.y-i.y)>Math.abs(r.x-i.x)*n?{useVertical:!0}:(e===t.WritingMode.vertical?i.y<r.y:i.x>r.x)?{needsFlipping:!0}:null}function re(e,i,r,n,a,o,s,l,u,h,c,p,f,d){var y,m=i/24,v=e.lineOffsetX*m,g=e.lineOffsetY*m;if(e.numGlyphs>1){var _=e.glyphStartIndex+e.numGlyphs,x=e.lineStartIndex,b=e.lineStartIndex+e.lineLength,w=ee(m,l,v,g,r,c,p,e,u,o,f,!1);if(!w)return{notEnoughRoom:!0};var S=Qt(w.first.point,s).point,M=Qt(w.last.point,s).point;if(n&&!r){var E=ie(e.writingMode,S,M,d);if(E)return E}y=[w.first];for(var k=e.glyphStartIndex+1;k<_-1;k++)y.push(ae(m*l.getoffsetX(k),v,g,r,c,p,e.segment,x,b,u,o,f,!1));y.push(w.last)}else{if(n&&!r){var T=Qt(p,a).point,I=e.lineStartIndex+e.segment+1,C=new t.Point(u.getx(I),u.gety(I)),A=Qt(C,a),P=A.signedDistanceFromCamera>0?A.point:ne(p,C,T,1,a),L=ie(e.writingMode,T,P,d);if(L)return L}var z=ae(m*l.getoffsetX(e.glyphStartIndex),v,g,r,c,p,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,u,o,f,!1);if(!z)return{notEnoughRoom:!0};y=[z]}for(var D=0,R=y;D<R.length;D+=1){var O=R[D];t.addDynamicAttributes(h,O.point,O.angle)}return{}}function ne(t,e,i,r,n){var a=Qt(t.add(t.sub(e)._unit()),n).point,o=i.sub(a);return i.add(o._mult(r/o.mag()))}function ae(e,i,r,n,a,o,s,l,u,h,c,p,f){var d=n?e-i:e+i,y=d>0?1:-1,m=0;n&&(y*=-1,m=Math.PI),y<0&&(m+=Math.PI);for(var v=y>0?l+s:l+s+1,g=v,_=a,x=a,b=0,w=0,S=Math.abs(d);b+w<=S;){if((v+=y)<l||v>=u)return null;if(x=_,void 0===(_=p[v])){var M=new t.Point(h.getx(v),h.gety(v)),E=Qt(M,c);if(E.signedDistanceFromCamera>0)_=p[v]=E.point;else{var k=v-y;_=ne(0===b?o:new t.Point(h.getx(k),h.gety(k)),M,x,S-b+1,c)}}b+=w,w=x.dist(_)}var T=(S-b)/w,I=_.sub(x),C=I.mult(T)._add(x);return C._add(I._unit()._perp()._mult(r*y)),{point:C,angle:m+Math.atan2(_.y-x.y,_.x-x.x),tileDistance:f?{prevTileDistance:v-y===g?0:h.gettileUnitDistanceFromAnchor(v-y),lastSegmentViewportDistance:S-b}:null}}Ht.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Ht.prototype.insert=function(t,e,i,r,n){this._forEachCell(e,i,r,n,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(i),this.bboxes.push(r),this.bboxes.push(n)},Ht.prototype.insertCircle=function(t,e,i,r){this._forEachCell(e-r,i-r,e+r,i+r,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(i),this.circles.push(r)},Ht.prototype._insertBoxCell=function(t,e,i,r,n,a){this.boxCells[n].push(a)},Ht.prototype._insertCircleCell=function(t,e,i,r,n,a){this.circleCells[n].push(a)},Ht.prototype._query=function(t,e,i,r,n,a){if(i<0||t>this.width||r<0||e>this.height)return!n&&[];var o=[];if(t<=0&&e<=0&&this.width<=i&&this.height<=r){if(n)return!0;for(var s=0;s<this.boxKeys.length;s++)o.push({key:this.boxKeys[s],x1:this.bboxes[4*s],y1:this.bboxes[4*s+1],x2:this.bboxes[4*s+2],y2:this.bboxes[4*s+3]});for(var l=0;l<this.circleKeys.length;l++){var u=this.circles[3*l],h=this.circles[3*l+1],c=this.circles[3*l+2];o.push({key:this.circleKeys[l],x1:u-c,y1:h-c,x2:u+c,y2:h+c})}return a?o.filter(a):o}return this._forEachCell(t,e,i,r,this._queryCell,o,{hitTest:n,seenUids:{box:{},circle:{}}},a),n?o.length>0:o},Ht.prototype._queryCircle=function(t,e,i,r,n){var a=t-i,o=t+i,s=e-i,l=e+i;if(o<0||a>this.width||l<0||s>this.height)return!r&&[];var u=[];return this._forEachCell(a,s,o,l,this._queryCellCircle,u,{hitTest:r,circle:{x:t,y:e,radius:i},seenUids:{box:{},circle:{}}},n),r?u.length>0:u},Ht.prototype.query=function(t,e,i,r,n){return this._query(t,e,i,r,!1,n)},Ht.prototype.hitTest=function(t,e,i,r,n){return this._query(t,e,i,r,!0,n)},Ht.prototype.hitTestCircle=function(t,e,i,r){return this._queryCircle(t,e,i,!0,r)},Ht.prototype._queryCell=function(t,e,i,r,n,a,o,s){var l=o.seenUids,u=this.boxCells[n];if(null!==u)for(var h=this.bboxes,c=0,p=u;c<p.length;c+=1){var f=p[c];if(!l.box[f]){l.box[f]=!0;var d=4*f;if(t<=h[d+2]&&e<=h[d+3]&&i>=h[d+0]&&r>=h[d+1]&&(!s||s(this.boxKeys[f]))){if(o.hitTest)return a.push(!0),!0;a.push({key:this.boxKeys[f],x1:h[d],y1:h[d+1],x2:h[d+2],y2:h[d+3]})}}}var y=this.circleCells[n];if(null!==y)for(var m=this.circles,v=0,g=y;v<g.length;v+=1){var _=g[v];if(!l.circle[_]){l.circle[_]=!0;var x=3*_;if(this._circleAndRectCollide(m[x],m[x+1],m[x+2],t,e,i,r)&&(!s||s(this.circleKeys[_]))){if(o.hitTest)return a.push(!0),!0;var b=m[x],w=m[x+1],S=m[x+2];a.push({key:this.circleKeys[_],x1:b-S,y1:w-S,x2:b+S,y2:w+S})}}}},Ht.prototype._queryCellCircle=function(t,e,i,r,n,a,o,s){var l=o.circle,u=o.seenUids,h=this.boxCells[n];if(null!==h)for(var c=this.bboxes,p=0,f=h;p<f.length;p+=1){var d=f[p];if(!u.box[d]){u.box[d]=!0;var y=4*d;if(this._circleAndRectCollide(l.x,l.y,l.radius,c[y+0],c[y+1],c[y+2],c[y+3])&&(!s||s(this.boxKeys[d])))return a.push(!0),!0}}var m=this.circleCells[n];if(null!==m)for(var v=this.circles,g=0,_=m;g<_.length;g+=1){var x=_[g];if(!u.circle[x]){u.circle[x]=!0;var b=3*x;if(this._circlesCollide(v[b],v[b+1],v[b+2],l.x,l.y,l.radius)&&(!s||s(this.circleKeys[x])))return a.push(!0),!0}}},Ht.prototype._forEachCell=function(t,e,i,r,n,a,o,s){for(var l=this._convertToXCellCoord(t),u=this._convertToYCellCoord(e),h=this._convertToXCellCoord(i),c=this._convertToYCellCoord(r),p=l;p<=h;p++)for(var f=u;f<=c;f++)if(n.call(this,t,e,i,r,this.xCellCount*f+p,a,o,s))return},Ht.prototype._convertToXCellCoord=function(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))},Ht.prototype._convertToYCellCoord=function(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))},Ht.prototype._circlesCollide=function(t,e,i,r,n,a){var o=r-t,s=n-e,l=i+a;return l*l>o*o+s*s},Ht.prototype._circleAndRectCollide=function(t,e,i,r,n,a,o){var s=(a-r)/2,l=Math.abs(t-(r+s));if(l>s+i)return!1;var u=(o-n)/2,h=Math.abs(e-(n+u));if(h>u+i)return!1;if(l<=s||h<=u)return!0;var c=l-s,p=h-u;return c*c+p*p<=i*i};var oe=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function se(t,e){for(var i=0;i<t;i++){var r=e.length;e.resize(r+4),e.float32.set(oe,3*r)}}function le(t,e,i){var r=e[0],n=e[1];return t[0]=i[0]*r+i[4]*n+i[12],t[1]=i[1]*r+i[5]*n+i[13],t[3]=i[3]*r+i[7]*n+i[15],t}var ue=function(t,e,i){void 0===e&&(e=new Ht(t.width+200,t.height+200,25)),void 0===i&&(i=new Ht(t.width+200,t.height+200,25)),this.transform=t,this.grid=e,this.ignoredGrid=i,this.pitchfactor=Math.cos(t._pitch)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+100,this.screenBottomBoundary=t.height+100,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200};function he(t,e,i){t[e+4]=i?1:0}function ce(e,i,r){return i*(t.EXTENT/(e.tileSize*Math.pow(2,r-e.tileID.overscaledZ)))}ue.prototype.placeCollisionBox=function(t,e,i,r,n){var a=this.projectAndGetPerspectiveRatio(r,t.anchorPointX,t.anchorPointY),o=i*a.perspectiveRatio,s=t.x1*o+a.point.x,l=t.y1*o+a.point.y,u=t.x2*o+a.point.x,h=t.y2*o+a.point.y;return!this.isInsideGrid(s,l,u,h)||!e&&this.grid.hitTest(s,l,u,h,n)?{box:[],offscreen:!1}:{box:[s,l,u,h],offscreen:this.isOffscreen(s,l,u,h)}},ue.prototype.approximateTileDistance=function(t,e,i,r,n){var a=t.lastSegmentViewportDistance*i;return t.prevTileDistance+a+((n?1:r/this.pitchfactor)-1)*a*Math.abs(Math.sin(e))},ue.prototype.placeCollisionCircles=function(e,i,r,n,a,o,s,l,u,h,c,p,f){var d=[],y=this.projectAnchor(u,a.anchorX,a.anchorY),m=l/24,v=a.lineOffsetX*l,g=a.lineOffsetY*l,_=new t.Point(a.anchorX,a.anchorY),x=ee(m,s,v,g,!1,Qt(_,h).point,_,a,o,h,{},!0),b=!1,w=!1,S=!0,M=y.perspectiveRatio*n,E=1/(n*r),k=0,T=0;x&&(k=this.approximateTileDistance(x.first.tileDistance,x.first.angle,E,y.cameraDistance,p),T=this.approximateTileDistance(x.last.tileDistance,x.last.angle,E,y.cameraDistance,p));for(var I=0;I<e.length;I+=5){var C=e[I],A=e[I+1],P=e[I+2],L=e[I+3];if(!x||L<-k||L>T)he(e,I,!1);else{var z=this.projectPoint(u,C,A),D=P*M;if(d.length>0){var R=z.x-d[d.length-4],O=z.y-d[d.length-3];if(D*D*2>R*R+O*O&&I+8<e.length){var B=e[I+8];if(B>-k&&B<T){he(e,I,!1);continue}}}d.push(z.x,z.y,D,I/5),he(e,I,!0);var F=z.x-D,V=z.y-D,U=z.x+D,j=z.y+D;if(S=S&&this.isOffscreen(F,V,U,j),w=w||this.isInsideGrid(F,V,U,j),!i&&this.grid.hitTestCircle(z.x,z.y,D,f)){if(!c)return{circles:[],offscreen:!1};b=!0}}}return{circles:b||!w?[]:d,offscreen:S}},ue.prototype.queryRenderedSymbols=function(e){if(0===e.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};for(var i=[],r=1/0,n=1/0,a=-1/0,o=-1/0,s=0,l=e;s<l.length;s+=1){var u=l[s],h=new t.Point(u.x+100,u.y+100);r=Math.min(r,h.x),n=Math.min(n,h.y),a=Math.max(a,h.x),o=Math.max(o,h.y),i.push(h)}for(var c={},p={},f=0,d=this.grid.query(r,n,a,o).concat(this.ignoredGrid.query(r,n,a,o));f<d.length;f+=1){var y=d[f],m=y.key;if(void 0===c[m.bucketInstanceId]&&(c[m.bucketInstanceId]={}),!c[m.bucketInstanceId][m.featureIndex]){var v=[new t.Point(y.x1,y.y1),new t.Point(y.x2,y.y1),new t.Point(y.x2,y.y2),new t.Point(y.x1,y.y2)];t.polygonIntersectsPolygon(i,v)&&(c[m.bucketInstanceId][m.featureIndex]=!0,void 0===p[m.bucketInstanceId]&&(p[m.bucketInstanceId]=[]),p[m.bucketInstanceId].push(m.featureIndex))}}return p},ue.prototype.insertCollisionBox=function(t,e,i,r,n){(e?this.ignoredGrid:this.grid).insert({bucketInstanceId:i,featureIndex:r,collisionGroupID:n},t[0],t[1],t[2],t[3])},ue.prototype.insertCollisionCircles=function(t,e,i,r,n){for(var a=e?this.ignoredGrid:this.grid,o={bucketInstanceId:i,featureIndex:r,collisionGroupID:n},s=0;s<t.length;s+=4)a.insertCircle(o,t[s],t[s+1],t[s+2])},ue.prototype.projectAnchor=function(t,e,i){var r=[e,i,0,1];return le(r,r,t),{perspectiveRatio:.5+this.transform.cameraToCenterDistance/r[3]*.5,cameraDistance:r[3]}},ue.prototype.projectPoint=function(e,i,r){var n=[i,r,0,1];return le(n,n,e),new t.Point((n[0]/n[3]+1)/2*this.transform.width+100,(-n[1]/n[3]+1)/2*this.transform.height+100)},ue.prototype.projectAndGetPerspectiveRatio=function(e,i,r){var n=[i,r,0,1];return le(n,n,e),{point:new t.Point((n[0]/n[3]+1)/2*this.transform.width+100,(-n[1]/n[3]+1)/2*this.transform.height+100),perspectiveRatio:.5+this.transform.cameraToCenterDistance/n[3]*.5}},ue.prototype.isOffscreen=function(t,e,i,r){return i<100||t>=this.screenRightBoundary||r<100||e>this.screenBottomBoundary},ue.prototype.isInsideGrid=function(t,e,i,r){return i>=0&&t<this.gridRightBoundary&&r>=0&&e<this.gridBottomBoundary};var pe=function(t,e,i,r){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?e:-e))):r&&i?1:0,this.placed=i};pe.prototype.isHidden=function(){return 0===this.opacity&&!this.placed};var fe=function(t,e,i,r,n){this.text=new pe(t?t.text:null,e,i,n),this.icon=new pe(t?t.icon:null,e,r,n)};fe.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var de=function(t,e,i){this.text=t,this.icon=e,this.skipFade=i},ye=function(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}};function me(e,i,r,n,a){var o=t.getAnchorAlignment(e),s=-(o.horizontalAlign-.5)*i,l=-(o.verticalAlign-.5)*r,u=t.evaluateVariableOffset(e,n);return new t.Point(s+u[0]*a,l+u[1]*a)}function ve(e,i,r,n,a,o){var s=e.x1,l=e.x2,u=e.y1,h=e.y2,c=e.anchorPointX,p=e.anchorPointY,f=new t.Point(i,r);return n&&f._rotate(a?o:-o),{x1:s+f.x,y1:u+f.y,x2:l+f.x,y2:h+f.y,anchorPointX:c,anchorPointY:p}}ye.prototype.get=function(t){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[t]){var e=++this.maxGroupID;this.collisionGroups[t]={ID:e,predicate:function(t){return t.collisionGroupID===e}}}return this.collisionGroups[t]};var ge=function(t,e,i,r){this.transform=t.clone(),this.collisionIndex=new ue(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=e,this.retainedQueryData={},this.collisionGroups=new ye(i),this.prevPlacement=r,r&&(r.prevPlacement=void 0),this.placedOrientations={}};function _e(t,e,i,r,n){t.emplaceBack(e?1:0,i?1:0,r||0,n||0),t.emplaceBack(e?1:0,i?1:0,r||0,n||0),t.emplaceBack(e?1:0,i?1:0,r||0,n||0),t.emplaceBack(e?1:0,i?1:0,r||0,n||0)}ge.prototype.getBucketParts=function(e,i,r,n){var a=r.getBucket(i),o=r.latestFeatureIndex;if(a&&o&&i.id===a.layerIds[0]){var s=r.collisionBoxArray,l=a.layers[0].layout,u=Math.pow(2,this.transform.zoom-r.tileID.overscaledZ),h=r.tileSize/t.EXTENT,c=this.transform.calculatePosMatrix(r.tileID.toUnwrapped()),p=Jt(c,"map"===l.get("text-pitch-alignment"),"map"===l.get("text-rotation-alignment"),this.transform,ce(r,1,this.transform.zoom));this.retainedQueryData[a.bucketInstanceId]=new function(t,e,i,r,n){this.bucketInstanceId=t,this.featureIndex=e,this.sourceLayerIndex=i,this.bucketIndex=r,this.tileID=n}(a.bucketInstanceId,o,a.sourceLayerIndex,a.index,r.tileID);var f={bucket:a,layout:l,posMatrix:c,textLabelPlaneMatrix:p,scale:u,textPixelRatio:h,holdingForFade:r.holdingForFade(),collisionBoxArray:s,partiallyEvaluatedTextSize:t.evaluateSizeForZoom(a.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(a.sourceID)};if(n)for(var d=0,y=a.sortKeyRanges;d<y.length;d+=1){var m=y[d];e.push({sortKey:m.sortKey,symbolInstanceStart:m.symbolInstanceStart,symbolInstanceEnd:m.symbolInstanceEnd,parameters:f})}else e.push({symbolInstanceStart:0,symbolInstanceEnd:a.symbolInstances.length,parameters:f})}},ge.prototype.attemptAnchorPlacement=function(t,e,i,r,n,a,o,s,l,u,h,c,p,f,d){var y,m=[c.textOffset0,c.textOffset1],v=me(t,i,r,m,n),g=this.collisionIndex.placeCollisionBox(ve(e,v.x,v.y,a,o,this.transform.angle),h,s,l,u.predicate);if(!d||0!==this.collisionIndex.placeCollisionBox(ve(d,v.x,v.y,a,o,this.transform.angle),h,s,l,u.predicate).box.length)return g.box.length>0?(this.prevPlacement&&this.prevPlacement.variableOffsets[c.crossTileID]&&this.prevPlacement.placements[c.crossTileID]&&this.prevPlacement.placements[c.crossTileID].text&&(y=this.prevPlacement.variableOffsets[c.crossTileID].anchor),this.variableOffsets[c.crossTileID]={textOffset:m,width:i,height:r,anchor:t,textBoxScale:n,prevAnchor:y},this.markUsedJustification(p,t,c,f),p.allowVerticalPlacement&&(this.markUsedOrientation(p,f,c),this.placedOrientations[c.crossTileID]=f),{shift:v,placedGlyphBoxes:g}):void 0},ge.prototype.placeLayerBucketPart=function(e,i,r){var n=this,a=e.parameters,o=a.bucket,s=a.layout,l=a.posMatrix,u=a.textLabelPlaneMatrix,h=a.scale,c=a.textPixelRatio,p=a.holdingForFade,f=a.collisionBoxArray,d=a.partiallyEvaluatedTextSize,y=a.collisionGroup,m=s.get("text-optional"),v=s.get("icon-optional"),g=s.get("text-allow-overlap"),_=s.get("icon-allow-overlap"),x="map"===s.get("text-rotation-alignment"),b="map"===s.get("text-pitch-alignment"),w="none"!==s.get("icon-text-fit"),S="viewport-y"===s.get("symbol-z-order"),M=g&&(_||!o.hasIconData()||v),E=_&&(g||!o.hasTextData()||m);!o.collisionArrays&&f&&o.deserializeCollisionBoxes(f);var k=function(e,a){if(!i[e.crossTileID])if(p)n.placements[e.crossTileID]=new de(!1,!1,!1);else{var f,S=!1,k=!1,T=!0,I=null,C={box:null,offscreen:null},A={box:null,offscreen:null},P=null,L=null,z=0,D=0,R=0;a.textFeatureIndex&&(z=a.textFeatureIndex),a.verticalTextFeatureIndex&&(D=a.verticalTextFeatureIndex);var O=a.textBox;if(O){var B=function(i){var r=t.WritingMode.horizontal;if(o.allowVerticalPlacement&&!i&&n.prevPlacement){var a=n.prevPlacement.placedOrientations[e.crossTileID];a&&(n.placedOrientations[e.crossTileID]=a,n.markUsedOrientation(o,r=a,e))}return r},F=function(i,r){if(o.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&a.verticalTextBox)for(var n=0,s=o.writingModes;n<s.length&&(s[n]===t.WritingMode.vertical?(C=r(),A=C):C=i(),!(C&&C.box&&C.box.length));n+=1);else C=i()};if(s.get("text-variable-anchor")){var V=s.get("text-variable-anchor");if(n.prevPlacement&&n.prevPlacement.variableOffsets[e.crossTileID]){var U=n.prevPlacement.variableOffsets[e.crossTileID];V.indexOf(U.anchor)>0&&(V=V.filter(function(t){return t!==U.anchor})).unshift(U.anchor)}var j=function(t,i,r){for(var a=t.x2-t.x1,s=t.y2-t.y1,u=e.textBoxScale,h=w&&!_?i:null,p={box:[],offscreen:!1},f=g?2*V.length:V.length,d=0;d<f;++d){var m=n.attemptAnchorPlacement(V[d%V.length],t,a,s,u,x,b,c,l,y,d>=V.length,e,o,r,h);if(m&&(p=m.placedGlyphBoxes)&&p.box&&p.box.length){S=!0,I=m.shift;break}}return p};F(function(){return j(O,a.iconBox,t.WritingMode.horizontal)},function(){var i=a.verticalTextBox;return o.allowVerticalPlacement&&!(C&&C.box&&C.box.length)&&e.numVerticalGlyphVertices>0&&i?j(i,a.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null}}),C&&(S=C.box,T=C.offscreen);var N=B(C&&C.box);if(!S&&n.prevPlacement){var q=n.prevPlacement.variableOffsets[e.crossTileID];q&&(n.variableOffsets[e.crossTileID]=q,n.markUsedJustification(o,q.anchor,e,N))}}else{var G=function(t,i){var r=n.collisionIndex.placeCollisionBox(t,g,c,l,y.predicate);return r&&r.box&&r.box.length&&(n.markUsedOrientation(o,i,e),n.placedOrientations[e.crossTileID]=i),r};F(function(){return G(O,t.WritingMode.horizontal)},function(){var i=a.verticalTextBox;return o.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&i?G(i,t.WritingMode.vertical):{box:null,offscreen:null}}),B(C&&C.box&&C.box.length)}}S=(f=C)&&f.box&&f.box.length>0,T=f&&f.offscreen;var Z=a.textCircles;if(Z){var X=o.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex),W=t.evaluateSizeForFeature(o.textSizeData,d,X);P=n.collisionIndex.placeCollisionCircles(Z,g,h,c,X,o.lineVertexArray,o.glyphOffsetArray,W,l,u,r,b,y.predicate),S=g||P.circles.length>0,T=T&&P.offscreen}if(a.iconFeatureIndex&&(R=a.iconFeatureIndex),a.iconBox){var K=function(t){var e=w&&I?ve(t,I.x,I.y,x,b,n.transform.angle):t;return n.collisionIndex.placeCollisionBox(e,_,c,l,y.predicate)};k=A&&A.box&&A.box.length&&a.verticalIconBox?(L=K(a.verticalIconBox)).box.length>0:(L=K(a.iconBox)).box.length>0,T=T&&L.offscreen}var H=m||0===e.numHorizontalGlyphVertices&&0===e.numVerticalGlyphVertices,J=v||0===e.numIconVertices;H||J?J?H||(k=k&&S):S=k&&S:k=S=k&&S,S&&f&&f.box&&n.collisionIndex.insertCollisionBox(f.box,s.get("text-ignore-placement"),o.bucketInstanceId,A&&A.box&&D?D:z,y.ID),k&&L&&n.collisionIndex.insertCollisionBox(L.box,s.get("icon-ignore-placement"),o.bucketInstanceId,R,y.ID),S&&P&&n.collisionIndex.insertCollisionCircles(P.circles,s.get("text-ignore-placement"),o.bucketInstanceId,z,y.ID),n.placements[e.crossTileID]=new de(S||M,k||E,T||o.justReloaded),i[e.crossTileID]=!0}};if(S)for(var T=o.getSortedSymbolIndexes(this.transform.angle),I=T.length-1;I>=0;--I){var C=T[I];k(o.symbolInstances.get(C),o.collisionArrays[C])}else for(var A=e.symbolInstanceStart;A<e.symbolInstanceEnd;A++)k(o.symbolInstances.get(A),o.collisionArrays[A]);o.justReloaded=!1},ge.prototype.markUsedJustification=function(e,i,r,n){var a;a=n===t.WritingMode.vertical?r.verticalPlacedTextSymbolIndex:{left:r.leftJustifiedTextSymbolIndex,center:r.centerJustifiedTextSymbolIndex,right:r.rightJustifiedTextSymbolIndex}[t.getAnchorJustification(i)];for(var o=0,s=[r.leftJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.rightJustifiedTextSymbolIndex,r.verticalPlacedTextSymbolIndex];o<s.length;o+=1){var l=s[o];l>=0&&(e.text.placedSymbolArray.get(l).crossTileID=a>=0&&l!==a?0:r.crossTileID)}},ge.prototype.markUsedOrientation=function(e,i,r){for(var n=i===t.WritingMode.horizontal||i===t.WritingMode.horizontalOnly?i:0,a=i===t.WritingMode.vertical?i:0,o=0,s=[r.leftJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.rightJustifiedTextSymbolIndex];o<s.length;o+=1)e.text.placedSymbolArray.get(s[o]).placedOrientation=n;r.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(r.verticalPlacedTextSymbolIndex).placedOrientation=a)},ge.prototype.commit=function(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;var e=this.prevPlacement,i=!1;this.prevZoomAdjustment=e?e.zoomAdjustment(this.transform.zoom):0;var r=e?e.symbolFadeChange(t):1,n=e?e.opacities:{},a=e?e.variableOffsets:{},o=e?e.placedOrientations:{};for(var s in this.placements){var l=this.placements[s],u=n[s];u?(this.opacities[s]=new fe(u,r,l.text,l.icon),i=i||l.text!==u.text.placed||l.icon!==u.icon.placed):(this.opacities[s]=new fe(null,r,l.text,l.icon,l.skipFade),i=i||l.text||l.icon)}for(var h in n){var c=n[h];if(!this.opacities[h]){var p=new fe(c,r,!1,!1);p.isHidden()||(this.opacities[h]=p,i=i||c.text.placed||c.icon.placed)}}for(var f in a)this.variableOffsets[f]||!this.opacities[f]||this.opacities[f].isHidden()||(this.variableOffsets[f]=a[f]);for(var d in o)this.placedOrientations[d]||!this.opacities[d]||this.opacities[d].isHidden()||(this.placedOrientations[d]=o[d]);i?this.lastPlacementChangeTime=t:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=e?e.lastPlacementChangeTime:t)},ge.prototype.updateLayerOpacities=function(t,e){for(var i={},r=0,n=e;r<n.length;r+=1){var a=n[r],o=a.getBucket(t);o&&a.latestFeatureIndex&&t.id===o.layerIds[0]&&this.updateBucketOpacities(o,i,a.collisionBoxArray)}},ge.prototype.updateBucketOpacities=function(e,i,r){var n=this;e.hasTextData()&&e.text.opacityVertexArray.clear(),e.hasIconData()&&e.icon.opacityVertexArray.clear(),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexArray.clear(),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexArray.clear(),e.hasIconCollisionCircleData()&&e.iconCollisionCircle.collisionVertexArray.clear(),e.hasTextCollisionCircleData()&&e.textCollisionCircle.collisionVertexArray.clear();var a=e.layers[0].layout,o=new fe(null,0,!1,!1,!0),s=a.get("text-allow-overlap"),l=a.get("icon-allow-overlap"),u=a.get("text-variable-anchor"),h="map"===a.get("text-rotation-alignment"),c="map"===a.get("text-pitch-alignment"),p="none"!==a.get("icon-text-fit"),f=new fe(null,0,s&&(l||!e.hasIconData()||a.get("icon-optional")),l&&(s||!e.hasTextData()||a.get("text-optional")),!0);!e.collisionArrays&&r&&(e.hasIconCollisionBoxData()||e.hasIconCollisionCircleData()||e.hasTextCollisionBoxData()||e.hasTextCollisionCircleData())&&e.deserializeCollisionBoxes(r);for(var d=function(t,e,i){for(var r=0;r<e/4;r++)t.opacityVertexArray.emplaceBack(i)},y=function(r){var a=e.symbolInstances.get(r),s=a.numHorizontalGlyphVertices,l=a.numVerticalGlyphVertices,y=a.crossTileID,m=i[y],v=n.opacities[y];m?v=o:v||(n.opacities[y]=v=f),i[y]=!0;var g=a.numIconVertices>0,_=n.placedOrientations[a.crossTileID],x=_===t.WritingMode.vertical,b=_===t.WritingMode.horizontal||_===t.WritingMode.horizontalOnly;if(s>0||l>0){var w=Te(v.text);d(e.text,s,x?Ie:w),d(e.text,l,b?Ie:w);var S=v.text.isHidden();[a.rightJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.leftJustifiedTextSymbolIndex].forEach(function(t){t>=0&&(e.text.placedSymbolArray.get(t).hidden=S||x?1:0)}),a.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(a.verticalPlacedTextSymbolIndex).hidden=S||b?1:0);var M=n.variableOffsets[a.crossTileID];M&&n.markUsedJustification(e,M.anchor,a,_);var E=n.placedOrientations[a.crossTileID];E&&(n.markUsedJustification(e,"left",a,E),n.markUsedOrientation(e,E,a))}if(g){var k=Te(v.icon),T=!(p&&a.verticalPlacedIconSymbolIndex&&x);a.placedIconSymbolIndex>=0&&(d(e.icon,a.numIconVertices,T?k:Ie),e.icon.placedSymbolArray.get(a.placedIconSymbolIndex).hidden=v.icon.isHidden()),a.verticalPlacedIconSymbolIndex>=0&&(d(e.icon,a.numVerticalIconVertices,T?Ie:k),e.icon.placedSymbolArray.get(a.verticalPlacedIconSymbolIndex).hidden=v.icon.isHidden())}if(e.hasIconCollisionBoxData()||e.hasIconCollisionCircleData()||e.hasTextCollisionBoxData()||e.hasTextCollisionCircleData()){var I=e.collisionArrays[r];if(I){var C=new t.Point(0,0);if(I.textBox||I.verticalTextBox){var A=!0;if(u){var P=n.variableOffsets[y];P?(C=me(P.anchor,P.width,P.height,P.textOffset,P.textBoxScale),h&&C._rotate(c?n.transform.angle:-n.transform.angle)):A=!1}I.textBox&&_e(e.textCollisionBox.collisionVertexArray,v.text.placed,!A||x,C.x,C.y),I.verticalTextBox&&_e(e.textCollisionBox.collisionVertexArray,v.text.placed,!A||b,C.x,C.y)}var L=Boolean(!b&&I.verticalIconBox);I.iconBox&&_e(e.iconCollisionBox.collisionVertexArray,v.icon.placed,L,p?C.x:0,p?C.y:0),I.verticalIconBox&&_e(e.iconCollisionBox.collisionVertexArray,v.icon.placed,!L,p?C.x:0,p?C.y:0);var z=I.textCircles;if(z&&e.hasTextCollisionCircleData())for(var D=0;D<z.length;D+=5)_e(e.textCollisionCircle.collisionVertexArray,v.text.placed,m||0===z[D+4])}}},m=0;m<e.symbolInstances.length;m++)y(m);e.sortFeatures(this.transform.angle),this.retainedQueryData[e.bucketInstanceId]&&(this.retainedQueryData[e.bucketInstanceId].featureSortOrder=e.featureSortOrder),e.hasTextData()&&e.text.opacityVertexBuffer&&e.text.opacityVertexBuffer.updateData(e.text.opacityVertexArray),e.hasIconData()&&e.icon.opacityVertexBuffer&&e.icon.opacityVertexBuffer.updateData(e.icon.opacityVertexArray),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexBuffer&&e.iconCollisionBox.collisionVertexBuffer.updateData(e.iconCollisionBox.collisionVertexArray),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexBuffer&&e.textCollisionBox.collisionVertexBuffer.updateData(e.textCollisionBox.collisionVertexArray),e.hasIconCollisionCircleData()&&e.iconCollisionCircle.collisionVertexBuffer&&e.iconCollisionCircle.collisionVertexBuffer.updateData(e.iconCollisionCircle.collisionVertexArray),e.hasTextCollisionCircleData()&&e.textCollisionCircle.collisionVertexBuffer&&e.textCollisionCircle.collisionVertexBuffer.updateData(e.textCollisionCircle.collisionVertexArray)},ge.prototype.symbolFadeChange=function(t){return 0===this.fadeDuration?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment},ge.prototype.zoomAdjustment=function(t){return Math.max(0,(this.transform.zoom-t)/1.5)},ge.prototype.hasTransitions=function(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration},ge.prototype.stillRecent=function(t,e){var i=this.zoomAtLastRecencyCheck===e?1-this.zoomAdjustment(e):1;return this.zoomAtLastRecencyCheck=e,this.commitTime+this.fadeDuration*i>t},ge.prototype.setStale=function(){this.stale=!0};var xe=Math.pow(2,25),be=Math.pow(2,24),we=Math.pow(2,17),Se=Math.pow(2,16),Me=Math.pow(2,9),Ee=Math.pow(2,8),ke=Math.pow(2,1);function Te(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;var e=t.placed?1:0,i=Math.floor(127*t.opacity);return i*xe+e*be+i*we+e*Se+i*Me+e*Ee+i*ke+e}var Ie=0,Ce=function(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&void 0!==t.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};Ce.prototype.continuePlacement=function(t,e,i,r,n){for(var a=this._bucketParts;this._currentTileIndex<t.length;)if(e.getBucketParts(a,r,t[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,n())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,a.sort(function(t,e){return t.sortKey-e.sortKey}));this._currentPartIndex<a.length;)if(e.placeLayerBucketPart(a[this._currentPartIndex],this._seenCrossTileIDs,i),this._currentPartIndex++,n())return!0;return!1};var Ae=function(t,e,i,r,n,a,o){this.placement=new ge(t,n,a,o),this._currentPlacementIndex=e.length-1,this._forceFullPlacement=i,this._showCollisionBoxes=r,this._done=!1};Ae.prototype.isDone=function(){return this._done},Ae.prototype.continuePlacement=function(e,i,r){for(var n=this,a=t.browser.now(),o=function(){var e=t.browser.now()-a;return!n._forceFullPlacement&&e>2};this._currentPlacementIndex>=0;){var s=i[e[this._currentPlacementIndex]],l=this.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=l)&&(!s.maxzoom||s.maxzoom>l)){if(this._inProgressLayer||(this._inProgressLayer=new Ce(s)),this._inProgressLayer.continuePlacement(r[s.source],this.placement,this._showCollisionBoxes,s,o))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},Ae.prototype.commit=function(t){return this.placement.commit(t),this.placement};var Pe=512/t.EXTENT/2,Le=function(t,e,i){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=i;for(var r=0;r<e.length;r++){var n=e.get(r),a=n.key;this.indexedSymbolInstances[a]||(this.indexedSymbolInstances[a]=[]),this.indexedSymbolInstances[a].push({crossTileID:n.crossTileID,coord:this.getScaledCoordinates(n,t)})}};Le.prototype.getScaledCoordinates=function(e,i){var r=Pe/Math.pow(2,i.canonical.z-this.tileID.canonical.z);return{x:Math.floor((i.canonical.x*t.EXTENT+e.anchorX)*r),y:Math.floor((i.canonical.y*t.EXTENT+e.anchorY)*r)}},Le.prototype.findMatches=function(t,e,i){for(var r=this.tileID.canonical.z<e.canonical.z?1:Math.pow(2,this.tileID.canonical.z-e.canonical.z),n=0;n<t.length;n++){var a=t.get(n);if(!a.crossTileID){var o=this.indexedSymbolInstances[a.key];if(o)for(var s=this.getScaledCoordinates(a,e),l=0,u=o;l<u.length;l+=1){var h=u[l];if(Math.abs(h.coord.x-s.x)<=r&&Math.abs(h.coord.y-s.y)<=r&&!i[h.crossTileID]){i[h.crossTileID]=!0,a.crossTileID=h.crossTileID;break}}}}};var ze=function(){this.maxCrossTileID=0};ze.prototype.generate=function(){return++this.maxCrossTileID};var De=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0};De.prototype.handleWrapJump=function(t){var e=Math.round((t-this.lng)/360);if(0!==e)for(var i in this.indexes){var r=this.indexes[i],n={};for(var a in r){var o=r[a];o.tileID=o.tileID.unwrapTo(o.tileID.wrap+e),n[o.tileID.key]=o}this.indexes[i]=n}this.lng=t},De.prototype.addBucket=function(t,e,i){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===e.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(var r=0;r<e.symbolInstances.length;r++)e.symbolInstances.get(r).crossTileID=0;this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]={});var n=this.usedCrossTileIDs[t.overscaledZ];for(var a in this.indexes){var o=this.indexes[a];if(Number(a)>t.overscaledZ)for(var s in o){var l=o[s];l.tileID.isChildOf(t)&&l.findMatches(e.symbolInstances,t,n)}else{var u=o[t.scaledTo(Number(a)).key];u&&u.findMatches(e.symbolInstances,t,n)}}for(var h=0;h<e.symbolInstances.length;h++){var c=e.symbolInstances.get(h);c.crossTileID||(c.crossTileID=i.generate(),n[c.crossTileID]=!0)}return void 0===this.indexes[t.overscaledZ]&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new Le(t,e.symbolInstances,e.bucketInstanceId),!0},De.prototype.removeBucketCrossTileIDs=function(t,e){for(var i in e.indexedSymbolInstances)for(var r=0,n=e.indexedSymbolInstances[i];r<n.length;r+=1)delete this.usedCrossTileIDs[t][n[r].crossTileID]},De.prototype.removeStaleBuckets=function(t){var e=!1;for(var i in this.indexes){var r=this.indexes[i];for(var n in r)t[r[n].bucketInstanceId]||(this.removeBucketCrossTileIDs(i,r[n]),delete r[n],e=!0)}return e};var Re=function(){this.layerIndexes={},this.crossTileIDs=new ze,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};Re.prototype.addLayer=function(t,e,i){var r=this.layerIndexes[t.id];void 0===r&&(r=this.layerIndexes[t.id]=new De);var n=!1,a={};r.handleWrapJump(i);for(var o=0,s=e;o<s.length;o+=1){var l=s[o],u=l.getBucket(t);u&&t.id===u.layerIds[0]&&(u.bucketInstanceId||(u.bucketInstanceId=++this.maxBucketInstanceId),r.addBucket(l.tileID,u,this.crossTileIDs)&&(n=!0),a[u.bucketInstanceId]=!0)}return r.removeStaleBuckets(a)&&(n=!0),n},Re.prototype.pruneUnusedLayers=function(t){var e={};for(var i in t.forEach(function(t){e[t]=!0}),this.layerIndexes)e[i]||delete this.layerIndexes[i]};var Oe=function(e,i){return t.emitValidationErrors(e,i&&i.filter(function(t){return"source.canvas"!==t.identifier}))},Be=t.pick(jt,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),Fe=t.pick(jt,["setCenter","setZoom","setBearing","setPitch"]),Ve=function(){var e={},i=t.styleSpec.$version;for(var r in t.styleSpec.$root){var n,a=t.styleSpec.$root[r];a.required&&null!=(n="version"===r?i:"array"===a.type?[]:{})&&(e[r]=n)}return e}(),Ue=function(e){function i(r,n){var a=this;void 0===n&&(n={}),e.call(this),this.map=r,this.dispatcher=new M((Bt||(Bt=new Ot),Bt),this),this.imageManager=new p,this.imageManager.setEventedParent(this),this.glyphManager=new _(r._requestManager,n.localIdeographFontFamily),this.lineAtlas=new S(256,512),this.crossTileSymbolIndex=new Re,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new t.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",t.getReferrer());var o=this;this._rtlTextPluginCallback=i.registerForPluginStateChange(function(e){o.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:e.pluginStatus,pluginURL:e.pluginURL},function(e,i){if(t.triggerPluginCompletionEvent(e),i&&i.every(function(t){return t}))for(var r in o.sourceCaches)o.sourceCaches[r].reload()})}),this.on("data",function(t){if("source"===t.dataType&&"metadata"===t.sourceDataType){var e=a.sourceCaches[t.sourceId];if(e){var i=e.getSource();if(i&&i.vectorLayerIds)for(var r in a._layers){var n=a._layers[r];n.source===i.id&&a._validateLayer(n)}}}})}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.loadURL=function(e,i){var r=this;void 0===i&&(i={}),this.fire(new t.Event("dataloading",{dataType:"style"}));var n="boolean"==typeof i.validate?i.validate:!t.isMapboxURL(e);e=this.map._requestManager.normalizeStyleURL(e,i.accessToken);var a=this.map._requestManager.transformRequest(e,t.ResourceType.Style);this._request=t.getJSON(a,function(e,i){r._request=null,e?r.fire(new t.ErrorEvent(e)):i&&r._load(i,n)})},i.prototype.loadJSON=function(e,i){var r=this;void 0===i&&(i={}),this.fire(new t.Event("dataloading",{dataType:"style"})),this._request=t.browser.frame(function(){r._request=null,r._load(e,!1!==i.validate)})},i.prototype.loadEmpty=function(){this.fire(new t.Event("dataloading",{dataType:"style"})),this._load(Ve,!1)},i.prototype._load=function(e,i){if(!i||!Oe(this,t.validateStyle(e))){for(var r in this._loaded=!0,this.stylesheet=e,e.sources)this.addSource(r,e.sources[r],{validate:!1});e.sprite?this._loadSprite(e.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(e.glyphs);var n=Ut(this.stylesheet.layers);this._order=n.map(function(t){return t.id}),this._layers={},this._serializedLayers={};for(var a=0,o=n;a<o.length;a+=1){var s=o[a];(s=t.createStyleLayer(s)).setEventedParent(this,{layer:{id:s.id}}),this._layers[s.id]=s,this._serializedLayers[s.id]=s.serialize()}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new w(this.stylesheet.light),this.fire(new t.Event("data",{dataType:"style"})),this.fire(new t.Event("style.load"))}},i.prototype._loadSprite=function(e){var i=this;this._spriteRequest=function(e,i,r){var n,a,o,s=t.browser.devicePixelRatio>1?"@2x":"",l=t.getJSON(i.transformRequest(i.normalizeSpriteURL(e,s,".json"),t.ResourceType.SpriteJSON),function(t,e){l=null,o||(o=t,n=e,h())}),u=t.getImage(i.transformRequest(i.normalizeSpriteURL(e,s,".png"),t.ResourceType.SpriteImage),function(t,e){u=null,o||(o=t,a=e,h())});function h(){if(o)r(o);else if(n&&a){var e=t.browser.getImageData(a),i={};for(var s in n){var l=n[s],u=l.width,h=l.height,c=l.x,p=l.y,f=l.sdf,d=l.pixelRatio,y=l.stretchX,m=l.stretchY,v=l.content,g=new t.RGBAImage({width:u,height:h});t.RGBAImage.copy(e,g,{x:c,y:p},{x:0,y:0},{width:u,height:h}),i[s]={data:g,pixelRatio:d,sdf:f,stretchX:y,stretchY:m,content:v}}r(null,i)}}return{cancel:function(){l&&(l.cancel(),l=null),u&&(u.cancel(),u=null)}}}(e,this.map._requestManager,function(e,r){if(i._spriteRequest=null,e)i.fire(new t.ErrorEvent(e));else if(r)for(var n in r)i.imageManager.addImage(n,r[n]);i.imageManager.setLoaded(!0),i._availableImages=i.imageManager.listImages(),i.dispatcher.broadcast("setImages",i._availableImages),i.fire(new t.Event("data",{dataType:"style"}))})},i.prototype._validateLayer=function(e){var i=this.sourceCaches[e.source];if(i){var r=e.sourceLayer;if(r){var n=i.getSource();("geojson"===n.type||n.vectorLayerIds&&-1===n.vectorLayerIds.indexOf(r))&&this.fire(new t.ErrorEvent(new Error('Source layer "'+r+'" does not exist on source "'+n.id+'" as specified by style layer "'+e.id+'"')))}}},i.prototype.loaded=function(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(var t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()},i.prototype._serializeLayers=function(t){for(var e=[],i=0,r=t;i<r.length;i+=1){var n=this._layers[r[i]];"custom"!==n.type&&e.push(n.serialize())}return e},i.prototype.hasTransitions=function(){if(this.light&&this.light.hasTransition())return!0;for(var t in this.sourceCaches)if(this.sourceCaches[t].hasTransition())return!0;for(var e in this._layers)if(this._layers[e].hasTransition())return!0;return!1},i.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},i.prototype.update=function(e){if(this._loaded){var i=this._changed;if(this._changed){var r=Object.keys(this._updatedLayers),n=Object.keys(this._removedLayers);for(var a in(r.length||n.length)&&this._updateWorkerLayers(r,n),this._updatedSources){var o=this._updatedSources[a];"reload"===o?this._reloadSource(a):"clear"===o&&this._clearSource(a)}for(var s in this._updateTilesForChangedImages(),this._updatedPaintProps)this._layers[s].updateTransitions(e);this.light.updateTransitions(e),this._resetUpdates()}for(var l in this.sourceCaches)this.sourceCaches[l].used=!1;for(var u=0,h=this._order;u<h.length;u+=1){var c=this._layers[h[u]],p=this.sourceCaches[c.source],f=e.zoom;p&&p.transform&&(f=p.transform.zoom),c.recalculate(e,this._availableImages),!c.isHidden(f)&&c.source&&(this.sourceCaches[c.source].used=!0)}this.light.recalculate(e),this.z=e.zoom,i&&this.fire(new t.Event("data",{dataType:"style"}))}},i.prototype._updateTilesForChangedImages=function(){var t=Object.keys(this._changedImages);if(t.length){for(var e in this.sourceCaches)this.sourceCaches[e].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}},i.prototype._updateWorkerLayers=function(t,e){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(t),removedIds:e})},i.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}},i.prototype.setState=function(e){var i=this;if(this._checkLoaded(),Oe(this,t.validateStyle(e)))return!1;(e=t.clone$1(e)).layers=Ut(e.layers);var r=function(e,i){if(!e)return[{command:jt.setStyle,args:[i]}];var r=[];try{if(!t.deepEqual(e.version,i.version))return[{command:jt.setStyle,args:[i]}];t.deepEqual(e.center,i.center)||r.push({command:jt.setCenter,args:[i.center]}),t.deepEqual(e.zoom,i.zoom)||r.push({command:jt.setZoom,args:[i.zoom]}),t.deepEqual(e.bearing,i.bearing)||r.push({command:jt.setBearing,args:[i.bearing]}),t.deepEqual(e.pitch,i.pitch)||r.push({command:jt.setPitch,args:[i.pitch]}),t.deepEqual(e.sprite,i.sprite)||r.push({command:jt.setSprite,args:[i.sprite]}),t.deepEqual(e.glyphs,i.glyphs)||r.push({command:jt.setGlyphs,args:[i.glyphs]}),t.deepEqual(e.transition,i.transition)||r.push({command:jt.setTransition,args:[i.transition]}),t.deepEqual(e.light,i.light)||r.push({command:jt.setLight,args:[i.light]});var n={},a=[];!function(e,i,r,n){var a;for(a in i=i||{},e=e||{})e.hasOwnProperty(a)&&(i.hasOwnProperty(a)||qt(a,r,n));for(a in i)i.hasOwnProperty(a)&&(e.hasOwnProperty(a)?t.deepEqual(e[a],i[a])||("geojson"===e[a].type&&"geojson"===i[a].type&&Zt(e,i,a)?r.push({command:jt.setGeoJSONSourceData,args:[a,i[a].data]}):Gt(a,i,r,n)):Nt(a,i,r))}(e.sources,i.sources,a,n);var o=[];e.layers&&e.layers.forEach(function(t){n[t.source]?r.push({command:jt.removeLayer,args:[t.id]}):o.push(t)}),r=r.concat(a),function(e,i,r){i=i||[];var n,a,o,s,l,u,h,c=(e=e||[]).map(Wt),p=i.map(Wt),f=e.reduce(Kt,{}),d=i.reduce(Kt,{}),y=c.slice(),m=Object.create(null);for(n=0,a=0;n<c.length;n++)d.hasOwnProperty(o=c[n])?a++:(r.push({command:jt.removeLayer,args:[o]}),y.splice(y.indexOf(o,a),1));for(n=0,a=0;n<p.length;n++)y[y.length-1-n]!==(o=p[p.length-1-n])&&(f.hasOwnProperty(o)?(r.push({command:jt.removeLayer,args:[o]}),y.splice(y.lastIndexOf(o,y.length-a),1)):a++,r.push({command:jt.addLayer,args:[d[o],u=y[y.length-n]]}),y.splice(y.length-n,0,o),m[o]=!0);for(n=0;n<p.length;n++)if(s=f[o=p[n]],l=d[o],!m[o]&&!t.deepEqual(s,l))if(t.deepEqual(s.source,l.source)&&t.deepEqual(s["source-layer"],l["source-layer"])&&t.deepEqual(s.type,l.type)){for(h in Xt(s.layout,l.layout,r,o,null,jt.setLayoutProperty),Xt(s.paint,l.paint,r,o,null,jt.setPaintProperty),t.deepEqual(s.filter,l.filter)||r.push({command:jt.setFilter,args:[o,l.filter]}),t.deepEqual(s.minzoom,l.minzoom)&&t.deepEqual(s.maxzoom,l.maxzoom)||r.push({command:jt.setLayerZoomRange,args:[o,l.minzoom,l.maxzoom]}),s)s.hasOwnProperty(h)&&"layout"!==h&&"paint"!==h&&"filter"!==h&&"metadata"!==h&&"minzoom"!==h&&"maxzoom"!==h&&(0===h.indexOf("paint.")?Xt(s[h],l[h],r,o,h.slice(6),jt.setPaintProperty):t.deepEqual(s[h],l[h])||r.push({command:jt.setLayerProperty,args:[o,h,l[h]]}));for(h in l)l.hasOwnProperty(h)&&!s.hasOwnProperty(h)&&"layout"!==h&&"paint"!==h&&"filter"!==h&&"metadata"!==h&&"minzoom"!==h&&"maxzoom"!==h&&(0===h.indexOf("paint.")?Xt(s[h],l[h],r,o,h.slice(6),jt.setPaintProperty):t.deepEqual(s[h],l[h])||r.push({command:jt.setLayerProperty,args:[o,h,l[h]]}))}else r.push({command:jt.removeLayer,args:[o]}),u=y[y.lastIndexOf(o)+1],r.push({command:jt.addLayer,args:[l,u]})}(o,i.layers,r)}catch(t){console.warn("Unable to compute style diff:",t),r=[{command:jt.setStyle,args:[i]}]}return r}(this.serialize(),e).filter(function(t){return!(t.command in Fe)});if(0===r.length)return!1;var n=r.filter(function(t){return!(t.command in Be)});if(n.length>0)throw new Error("Unimplemented: "+n.map(function(t){return t.command}).join(", ")+".");return r.forEach(function(t){"setTransition"!==t.command&&i[t.command].apply(i,t.args)}),this.stylesheet=e,!0},i.prototype.addImage=function(e,i){if(this.getImage(e))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(e,i),this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.fire(new t.Event("data",{dataType:"style"}))},i.prototype.updateImage=function(t,e){this.imageManager.updateImage(t,e)},i.prototype.getImage=function(t){return this.imageManager.getImage(t)},i.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._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.fire(new t.Event("data",{dataType:"style"}))},i.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},i.prototype.addSource=function(e,i,r){var n=this;if(void 0===r&&(r={}),this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error("There is already a source with this ID");if(!i.type)throw new Error("The type property must be defined, but the only the following properties were given: "+Object.keys(i).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(i.type)>=0&&this._validate(t.validateStyle.source,"sources."+e,i,null,r))){this.map&&this.map._collectResourceTiming&&(i.collectResourceTiming=!0);var a=this.map.crs,o=a.getExtent();if(i.crs=t.CRS.createCRS(i.crs)||a,i&&"geojson"===i.type){if(!a.isSquareResolution){var s=new t.CRS(a.getEpsgCode(),{origin:a.origin,bounds:o,unit:a.unit,projection:a.projection});i.crs=s}}else if(i.crs===this.map.crs&&"number"==typeof i.mapgisOffset&&0!==i.mapgisOffset&&!isNaN(i.mapgisOffset)&&isFinite(i.mapgisOffset)){for(var l=i.mapgisOffset,u=Object.entries(a._resolutions).map(function(t){return[parseInt(t[0]),t[1]]});0!==l;)l<0&&(l+=1,u.shift(),u.push([u[u.length-1][0],u[u.length-1][1]]),u.forEach(function(t){t[0]-=1})),l>0&&(l-=1,u.unshift([u[0][0]-1,2*u[0][1]]),u.pop(),u.forEach(function(t){t[0]+=1}));var h={};u.forEach(function(t){h[t[0]]=t[1]}),i.crs=new t.CRS(a.getEpsgCode(),{origin:a.origin,bounds:o,unit:a.unit,projection:a.projection,resolutions:h})}var c=this.sourceCaches[e]=new Lt(e,i,this.dispatcher);c.style=this,c.setEventedParent(this,function(){return{isSourceLoaded:n.loaded(),source:c.serialize(),sourceId:e}}),c.onAdd(this.map),this._changed=!0}},i.prototype.removeSource=function(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(var i in this._layers)if(this._layers[i].source===e)return this.fire(new t.ErrorEvent(new Error('Source "'+e+'" cannot be removed while layer "'+i+'" is using it.')));var r=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],r.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),r.setEventedParent(null),r.clearTiles(),r.onRemove&&r.onRemove(this.map),this._changed=!0},i.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0},i.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},i.prototype.addLayer=function(e,i,r){void 0===r&&(r={}),this._checkLoaded();var n=e.id;if(this.getLayer(n))this.fire(new t.ErrorEvent(new Error('Layer with id "'+n+'" already exists on this map')));else{var a;if("custom"===e.type){if(Oe(this,t.validateCustomStyleLayer(e)))return;a=t.createStyleLayer(e)}else{if("object"==typeof e.source&&(this.addSource(n,e.source),e=t.clone$1(e),e=t.extend(e,{source:n})),this._validate(t.validateStyle.layer,"layers."+n,e,{arrayIndex:-1},r))return;a=t.createStyleLayer(e),this._validateLayer(a),a.setEventedParent(this,{layer:{id:n}}),this._serializedLayers[a.id]=a.serialize()}var o=i?this._order.indexOf(i):this._order.length;if(i&&-1===o)this.fire(new t.ErrorEvent(new Error('Layer with id "'+i+'" does not exist on this map.')));else{if(this._order.splice(o,0,n),this._layerOrderChanged=!0,this._layers[n]=a,this._removedLayers[n]&&a.source&&"custom"!==a.type){var s=this._removedLayers[n];delete this._removedLayers[n],s.type!==a.type?this._updatedSources[a.source]="clear":(this._updatedSources[a.source]="reload",this.sourceCaches[a.source].pause())}this._updateLayer(a),a.onAdd&&a.onAdd(this.map)}}},i.prototype.moveLayer=function(e,i){if(this._checkLoaded(),this._changed=!0,this._layers[e]){if(e!==i){var r=this._order.indexOf(e);this._order.splice(r,1);var n=i?this._order.indexOf(i):this._order.length;i&&-1===n?this.fire(new t.ErrorEvent(new Error('Layer with id "'+i+'" does not exist on this map.'))):(this._order.splice(n,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.")))},i.prototype.removeLayer=function(e){this._checkLoaded();var i=this._layers[e];if(i){i.setEventedParent(null);var r=this._order.indexOf(e);this._order.splice(r,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=i,delete this._layers[e],delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],i.onRemove&&i.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.")))},i.prototype.getLayer=function(t){return this._layers[t]},i.prototype.hasLayer=function(t){return t in this._layers},i.prototype.setLayerZoomRange=function(e,i,r){this._checkLoaded();var n=this.getLayer(e);n?n.minzoom===i&&n.maxzoom===r||(null!=i&&(n.minzoom=i),null!=r&&(n.maxzoom=r),this._updateLayer(n)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot have zoom extent.")))},i.prototype.setFilter=function(e,i,r){void 0===r&&(r={}),this._checkLoaded();var n=this.getLayer(e);if(n){if(!t.deepEqual(n.filter,i))return null==i?(n.filter=void 0,void this._updateLayer(n)):void(this._validate(t.validateStyle.filter,"layers."+n.id+".filter",i,null,r)||(n.filter=t.clone$1(i),this._updateLayer(n)))}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be filtered.")))},i.prototype.getFilter=function(e){return t.clone$1(this.getLayer(e).filter)},i.prototype.setLayoutProperty=function(e,i,r,n){void 0===n&&(n={}),this._checkLoaded();var a=this.getLayer(e);a?t.deepEqual(a.getLayoutProperty(i),r)||(a.setLayoutProperty(i,r,n),this._updateLayer(a)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},i.prototype.getLayoutProperty=function(e,i){var r=this.getLayer(e);if(r)return r.getLayoutProperty(i);this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style.")))},i.prototype.setPaintProperty=function(e,i,r,n){void 0===n&&(n={}),this._checkLoaded();var a=this.getLayer(e);a?t.deepEqual(a.getPaintProperty(i),r)||(a.setPaintProperty(i,r,n)&&this._updateLayer(a),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.")))},i.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},i.prototype.setFeatureState=function(e,i){this._checkLoaded();var r=e.source,n=e.sourceLayer,a=this.sourceCaches[r];if(void 0!==a){var o=a.getSource().type;"geojson"===o&&n?this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==o||n?(void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),a.setFeatureState(n,e.id,i)):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.")))},i.prototype.removeFeatureState=function(e,i){this._checkLoaded();var r=e.source,n=this.sourceCaches[r];if(void 0!==n){var a=n.getSource().type,o="vector"===a?e.sourceLayer:void 0;"vector"!==a||o?i&&"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."))):n.removeFeatureState(o,e.id,i):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.")))},i.prototype.getFeatureState=function(e){this._checkLoaded();var i=e.source,r=e.sourceLayer,n=this.sourceCaches[i];if(void 0!==n){if("vector"!==n.getSource().type||r)return void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),n.getFeatureState(r,e.id);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 '"+i+"' does not exist in the map's style.")))},i.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},i.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})},i.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},i.prototype._flattenAndSortRenderedFeatures=function(t){for(var e=this,i=function(t){return"fill-extrusion"===e._layers[t].type},r={},n=[],a=this._order.length-1;a>=0;a--){var o=this._order[a];if(i(o)){r[o]=a;for(var s=0,l=t;s<l.length;s+=1){var u=l[s][o];if(u)for(var h=0,c=u;h<c.length;h+=1)n.push(c[h])}}}n.sort(function(t,e){return e.intersectionZ-t.intersectionZ});for(var p=[],f=this._order.length-1;f>=0;f--){var d=this._order[f];if(i(d))for(var y=n.length-1;y>=0;y--){var m=n[y].feature;if(r[m.layer.id]<f)break;p.push(m),n.pop()}else for(var v=0,g=t;v<g.length;v+=1){var _=g[v][d];if(_)for(var x=0,b=_;x<b.length;x+=1)p.push(b[x].feature)}}return p},i.prototype.queryRenderedFeatures=function(e,i,r){i&&i.filter&&this._validate(t.validateStyle.filter,"queryRenderedFeatures.filter",i.filter,null,i);var n={};if(i&&i.layers){if(!Array.isArray(i.layers))return this.fire(new t.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(var a=0,o=i.layers;a<o.length;a+=1){var s=o[a],l=this._layers[s];if(!l)return this.fire(new t.ErrorEvent(new Error("The layer '"+s+"' does not exist in the map's style and cannot be queried for features."))),[];n[l.source]=!0}}var u=[];for(var h in i.availableImages=this._availableImages,this.sourceCaches)i.layers&&!n[h]||u.push(V(this.sourceCaches[h],this._layers,this._serializedLayers,e,i,r));return this.placement&&u.push(function(t,e,i,r,n,a,o){for(var s={},l=a.queryRenderedSymbols(r),u=[],h=0,c=Object.keys(l).map(Number);h<c.length;h+=1)u.push(o[c[h]]);u.sort(U);for(var p=function(){var i=d[f],r=i.featureIndex.lookupSymbolFeatures(l[i.bucketInstanceId],e,i.bucketIndex,i.sourceLayerIndex,n.filter,n.layers,n.availableImages,t);for(var a in r){var o=s[a]=s[a]||[],u=r[a];u.sort(function(t,e){var r=i.featureSortOrder;if(r){var n=r.indexOf(t.featureIndex);return r.indexOf(e.featureIndex)-n}return e.featureIndex-t.featureIndex});for(var h=0,c=u;h<c.length;h+=1)o.push(c[h])}},f=0,d=u;f<d.length;f+=1)p();var y=function(e){s[e].forEach(function(r){var n=r.feature,a=i[t[e].source].getFeatureState(n.layer["source-layer"],n.id);n.source=n.layer.source,n.layer["source-layer"]&&(n.sourceLayer=n.layer["source-layer"]),n.state=a})};for(var m in s)y(m);return s}(this._layers,this._serializedLayers,this.sourceCaches,e,i,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(u)},i.prototype.querySourceFeatures=function(e,i){i&&i.filter&&this._validate(t.validateStyle.filter,"querySourceFeatures.filter",i.filter,null,i);var r=this.sourceCaches[e];return r?function(t,e){for(var i=t.getRenderableIds().map(function(e){return t.getTileByID(e)}),r=[],n={},a=0;a<i.length;a++){var o=i[a],s=o.tileID.canonical.key;n[s]||(n[s]=!0,o.querySourceFeatures(r,e))}return r}(r,i):[]},i.prototype.addSourceType=function(t,e,r){return i.getSourceType(t)?r(new Error('A source type called "'+t+'" already exists.')):(i.setSourceType(t,e),e.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:t,url:e.workerSourceURL},r):r(null,null))},i.prototype.getLight=function(){return this.light.getLight()},i.prototype.setLight=function(e,i){void 0===i&&(i={}),this._checkLoaded();var r=this.light.getLight(),n=!1;for(var a in e)if(!t.deepEqual(e[a],r[a])){n=!0;break}if(n){var o={now:t.browser.now(),transition:t.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(e,i),this.light.updateTransitions(o)}},i.prototype._validate=function(e,i,r,n,a){return void 0===a&&(a={}),(!a||!1!==a.validate)&&Oe(this,e.call(t.validateStyle,t.extend({key:i,style:this.serialize(),value:r,styleSpec:t.styleSpec},n)))},i.prototype._remove=function(){for(var e in this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),t.evented.off("pluginStateChange",this._rtlTextPluginCallback),this._layers)this._layers[e].setEventedParent(null);for(var i in this.sourceCaches)this.sourceCaches[i].clearTiles(),this.sourceCaches[i].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()},i.prototype._clearSource=function(t){this.sourceCaches[t].clearTiles()},i.prototype._reloadSource=function(t){this.sourceCaches[t].resume(),this.sourceCaches[t].reload()},i.prototype._updateSources=function(t){for(var e in this.sourceCaches)this.sourceCaches[e].update(t)},i.prototype._generateCollisionBoxes=function(){for(var t in this.sourceCaches)this._reloadSource(t)},i.prototype._updatePlacement=function(e,i,r,n,a){void 0===a&&(a=!1);for(var o=!1,s=!1,l={},u=0,h=this._order;u<h.length;u+=1){var c=this._layers[h[u]];if("symbol"===c.type){if(!l[c.source]){var p=this.sourceCaches[c.source];l[c.source]=p.getRenderableIds(!0).map(function(t){return p.getTileByID(t)}).sort(function(t,e){return e.tileID.overscaledZ-t.tileID.overscaledZ||(t.tileID.isLessThan(e.tileID)?-1:1)})}var f=this.crossTileSymbolIndex.addLayer(c,l[c.source],e.center.lng);o=o||f}}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((a=a||this._layerOrderChanged||0===r)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(t.browser.now(),e.zoom))&&(this.pauseablePlacement=new Ae(e,this._order,a,i,r,n,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,l),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(t.browser.now()),s=!0),o&&this.pauseablePlacement.placement.setStale()),s||o)for(var d=0,y=this._order;d<y.length;d+=1){var m=this._layers[y[d]];"symbol"===m.type&&this.placement.updateLayerOpacities(m,l[m.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(t.browser.now())},i.prototype._releaseSymbolFadeTiles=function(){for(var t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles()},i.prototype.getImages=function(t,e,i){this.imageManager.getImages(e.icons,i),this._updateTilesForChangedImages();var r=this.sourceCaches[e.source];r&&r.setDependencies(e.tileID.key,e.type,e.icons)},i.prototype.getGlyphs=function(t,e,i){this.glyphManager.getGlyphs(e.stacks,i)},i.prototype.getResource=function(e,i,r){return t.makeRequest(i,r)},i}(t.Evented);Ue.getSourceType=function(t){return B[t]},Ue.setSourceType=function(t,e){B[t]=e},Ue.registerForPluginStateChange=t.registerForPluginStateChange;var je=t.createLayout([{name:"a_pos",type:"Int16",components:2}]),Ne=di("#ifdef GL_ES\r\nprecision mediump float;\r\n#else\r\n#if !defined(lowp)\r\n#define lowp\r\n#endif\r\n#if !defined(mediump)\r\n#define mediump\r\n#endif\r\n#if !defined(highp)\r\n#define highp\r\n#endif\r\n#endif","#ifdef GL_ES\r\nprecision highp float;\r\n#else\r\n#if !defined(lowp)\r\n#define lowp\r\n#endif\r\n#if !defined(mediump)\r\n#define mediump\r\n#endif\r\n#if !defined(highp)\r\n#define highp\r\n#endif\r\n#endif\nvec2 unpack_float(const float packedValue) {\r\nint packedIntValue=int(packedValue);\r\nint v0=packedIntValue/256;\r\nreturn vec2(v0,packedIntValue-v0*256);\r\n}\r\nvec2 unpack_opacity(const float packedOpacity) {\r\nint intOpacity=int(packedOpacity)/2;\r\nreturn vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));\r\n}vec4 decode_color(const vec2 encodedColor) {\r\nreturn vec4(\r\nunpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\r\n);\r\n}float unpack_mix_vec2(const vec2 packedValue,const float t) {\r\nreturn mix(packedValue[0],packedValue[1],t);\r\n}vec4 unpack_mix_color(const vec4 packedColors,const float t) {\r\nvec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));\r\nvec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));\r\nreturn mix(minColor,maxColor,t);\r\n}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {\r\nvec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);\r\nreturn (tile_units_to_pixels*pos+offset)/pattern_size;\r\n}"),qe=di("uniform vec4 u_color;\r\nuniform float u_opacity;\r\nvoid main() {\r\ngl_FragColor=u_color*u_opacity;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","attribute vec2 a_pos;\r\nuniform mat4 u_matrix;\r\nvoid main() {\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\n}"),Ge=di("uniform vec2 u_pattern_tl_a;\r\nuniform vec2 u_pattern_br_a;\r\nuniform vec2 u_pattern_tl_b;\r\nuniform vec2 u_pattern_br_b;\r\nuniform vec2 u_texsize;\r\nuniform float u_mix;\r\nuniform float u_opacity;\r\nuniform sampler2D u_image;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\nvoid main() {\r\nvec2 imagecoord=mod(v_pos_a,1.0);\r\nvec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);\r\nvec4 color1=texture2D(u_image,pos);\r\nvec2 imagecoord_b=mod(v_pos_b,1.0);\r\nvec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);\r\nvec4 color2=texture2D(u_image,pos2);\r\ngl_FragColor=mix(color1,color2,u_mix)*u_opacity;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform vec2 u_pattern_size_a;\r\nuniform vec2 u_pattern_size_b;\r\nuniform vec2 u_pixel_coord_upper;\r\nuniform vec2 u_pixel_coord_lower;\r\nuniform float u_scale_a;\r\nuniform float u_scale_b;\r\nuniform float u_tile_units_to_pixels;\r\nattribute vec2 a_pos;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\nvoid main() {\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\nv_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);\r\nv_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);\r\n}"),Ze=di("varying vec3 v_data;\r\n#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define mediump float radius\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define highp vec4 stroke_color\r\n#pragma mapbox: define mediump float stroke_width\r\n#pragma mapbox: define lowp float stroke_opacity\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize mediump float radius\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize highp vec4 stroke_color\r\n#pragma mapbox: initialize mediump float stroke_width\r\n#pragma mapbox: initialize lowp float stroke_opacity\r\nvec2 extrude=v_data.xy;\r\nfloat extrude_length=length(extrude);\r\nlowp float antialiasblur=v_data.z;\r\nfloat antialiased_blur=-max(blur,antialiasblur);\r\nfloat opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);\r\nfloat color_t=stroke_width < 0.01 ? 0.0 : smoothstep(\r\nantialiased_blur,0.0,extrude_length-radius/(radius+stroke_width)\r\n);\r\ngl_FragColor=opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform bool u_scale_with_map;\r\nuniform bool u_pitch_with_map;\r\nuniform vec2 u_extrude_scale;\r\nuniform lowp float u_device_pixel_ratio;\r\nuniform highp float u_camera_to_center_distance;\r\nattribute vec2 a_pos;\r\nvarying vec3 v_data;\r\n#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define mediump float radius\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define highp vec4 stroke_color\r\n#pragma mapbox: define mediump float stroke_width\r\n#pragma mapbox: define lowp float stroke_opacity\r\nvoid main(void) {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize mediump float radius\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize highp vec4 stroke_color\r\n#pragma mapbox: initialize mediump float stroke_width\r\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);\r\nif (u_pitch_with_map) {\r\nvec2 corner_position=circle_center;\r\nif (u_scale_with_map) {\r\ncorner_position+=extrude*(radius+stroke_width)*u_extrude_scale;\r\n} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);\r\ncorner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);\r\n}\r\ngl_Position=u_matrix*vec4(corner_position,0,1);\r\n} else {\r\ngl_Position=u_matrix*vec4(circle_center,0,1);\r\nif (u_scale_with_map) {\r\ngl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;\r\n} else {\r\ngl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;\r\n}\r\n}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);\r\nv_data=vec3(extrude.x,extrude.y,antialiasblur);\r\n}"),Xe=di("void main() {\r\ngl_FragColor=vec4(1.0);\r\n}","attribute vec2 a_pos;\r\nuniform mat4 u_matrix;\r\nvoid main() {\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\n}"),We=di("uniform highp float u_intensity;\r\nvarying vec2 v_extrude;\r\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\r\nvoid main() {\r\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);\r\nfloat val=weight*u_intensity*GAUSS_COEF*exp(d);\r\ngl_FragColor=vec4(val,1.0,1.0,1.0);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform float u_extrude_scale;\r\nuniform float u_opacity;\r\nuniform float u_intensity;\r\nattribute vec2 a_pos;\r\nvarying vec2 v_extrude;\r\n#pragma mapbox: define highp float weight\r\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\r\nvoid main(void) {\r\n#pragma mapbox: initialize highp float weight\r\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);\r\ngl_Position=u_matrix*pos;\r\n}"),Ke=di("uniform sampler2D u_image;\r\nuniform sampler2D u_color_ramp;\r\nuniform float u_opacity;\r\nvarying vec2 v_pos;\r\nvoid main() {\r\nfloat t=texture2D(u_image,v_pos).r;\r\nvec4 color=texture2D(u_color_ramp,vec2(t,0.5));\r\ngl_FragColor=color*u_opacity;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(0.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform vec2 u_world;\r\nattribute vec2 a_pos;\r\nvarying vec2 v_pos;\r\nvoid main() {\r\ngl_Position=u_matrix*vec4(a_pos*u_world,0,1);\r\nv_pos.x=a_pos.x;\r\nv_pos.y=1.0-a_pos.y;\r\n}"),He=di("varying float v_placed;\r\nvarying float v_notUsed;\r\nvoid main() {\r\nfloat alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {\r\ngl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;\r\n}\r\nif (v_notUsed > 0.5) {gl_FragColor*=.1;\r\n}\r\n}","attribute vec2 a_pos;\r\nattribute vec2 a_anchor_pos;\r\nattribute vec2 a_extrude;\r\nattribute vec2 a_placed;\r\nattribute vec2 a_shift;\r\nuniform mat4 u_matrix;\r\nuniform vec2 u_extrude_scale;\r\nuniform float u_camera_to_center_distance;\r\nvarying float v_placed;\r\nvarying float v_notUsed;\r\nvoid main() {\r\nvec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);\r\nhighp float camera_to_anchor_distance=projectedPoint.w;\r\nhighp float collision_perspective_ratio=clamp(\r\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);\r\ngl_Position=u_matrix*vec4(a_pos,0.0,1.0);\r\ngl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;\r\nv_placed=a_placed.x;\r\nv_notUsed=a_placed.y;\r\n}"),Je=di("uniform float u_overscale_factor;\r\nvarying float v_placed;\r\nvarying float v_notUsed;\r\nvarying float v_radius;\r\nvarying vec2 v_extrude;\r\nvarying vec2 v_extrude_scale;\r\nvoid main() {\r\nfloat alpha=0.5;vec4 color=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {\r\ncolor=vec4(0.0,0.0,1.0,0.5)*alpha;\r\n}\r\nif (v_notUsed > 0.5) {color*=.2;\r\n}\r\nfloat extrude_scale_length=length(v_extrude_scale);\r\nfloat extrude_length=length(v_extrude)*extrude_scale_length;\r\nfloat stroke_width=15.0*extrude_scale_length/u_overscale_factor;\r\nfloat radius=v_radius*extrude_scale_length;\r\nfloat distance_to_edge=abs(extrude_length-radius);\r\nfloat opacity_t=smoothstep(-stroke_width,0.0,-distance_to_edge);\r\ngl_FragColor=opacity_t*color;\r\n}","attribute vec2 a_pos;\r\nattribute vec2 a_anchor_pos;\r\nattribute vec2 a_extrude;\r\nattribute vec2 a_placed;\r\nuniform mat4 u_matrix;\r\nuniform vec2 u_extrude_scale;\r\nuniform float u_camera_to_center_distance;\r\nvarying float v_placed;\r\nvarying float v_notUsed;\r\nvarying float v_radius;\r\nvarying vec2 v_extrude;\r\nvarying vec2 v_extrude_scale;\r\nvoid main() {\r\nvec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);\r\nhighp float camera_to_anchor_distance=projectedPoint.w;\r\nhighp float collision_perspective_ratio=clamp(\r\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);\r\ngl_Position=u_matrix*vec4(a_pos,0.0,1.0);\r\nhighp float padding_factor=1.2;gl_Position.xy+=a_extrude*u_extrude_scale*padding_factor*gl_Position.w*collision_perspective_ratio;\r\nv_placed=a_placed.x;\r\nv_notUsed=a_placed.y;\r\nv_radius=abs(a_extrude.y);v_extrude=a_extrude*padding_factor;\r\nv_extrude_scale=u_extrude_scale*u_camera_to_center_distance*collision_perspective_ratio;\r\n}"),Ye=di("uniform highp vec4 u_color;\r\nuniform sampler2D u_overlay;\r\nvarying vec2 v_uv;\r\nvoid main() {\r\nvec4 overlay_color=texture2D(u_overlay,v_uv);\r\ngl_FragColor=mix(u_color,overlay_color,overlay_color.a);\r\n}","attribute vec2 a_pos;\r\nvarying vec2 v_uv;\r\nuniform mat4 u_matrix;\r\nuniform float u_overlay_scale;\r\nvoid main() {v_uv=a_pos/8192.0;\r\ngl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);\r\n}"),Qe=di("#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize lowp float opacity\r\ngl_FragColor=color*opacity;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","attribute vec2 a_pos;\r\nuniform mat4 u_matrix;\r\n#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize lowp float opacity\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\n}"),$e=di("varying vec2 v_pos;\r\n#pragma mapbox: define highp vec4 outline_color\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 outline_color\r\n#pragma mapbox: initialize lowp float opacity\r\nfloat dist=length(v_pos-gl_FragCoord.xy);\r\nfloat alpha=1.0-smoothstep(0.0,1.0,dist);\r\ngl_FragColor=outline_color*(alpha*opacity);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","attribute vec2 a_pos;\r\nuniform mat4 u_matrix;\r\nuniform vec2 u_world;\r\nvarying vec2 v_pos;\r\n#pragma mapbox: define highp vec4 outline_color\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 outline_color\r\n#pragma mapbox: initialize lowp float opacity\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\nv_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\r\n}"),ti=di("uniform vec2 u_texsize;\r\nuniform sampler2D u_image;\r\nuniform float u_fade;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\nvarying vec2 v_pos;\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\nvec2 pattern_tl_a=pattern_from.xy;\r\nvec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nvec2 imagecoord=mod(v_pos_a,1.0);\r\nvec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);\r\nvec4 color1=texture2D(u_image,pos);\r\nvec2 imagecoord_b=mod(v_pos_b,1.0);\r\nvec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);\r\nvec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);\r\nfloat alpha=1.0-smoothstep(0.0,1.0,dist);\r\ngl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform vec2 u_world;\r\nuniform vec2 u_pixel_coord_upper;\r\nuniform vec2 u_pixel_coord_lower;\r\nuniform vec3 u_scale;\r\nattribute vec2 a_pos;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\nvarying vec2 v_pos;\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\n#pragma mapbox: define lowp float pixel_ratio_from\r\n#pragma mapbox: define lowp float pixel_ratio_to\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\n#pragma mapbox: initialize lowp float pixel_ratio_from\r\n#pragma mapbox: initialize lowp float pixel_ratio_to\r\nvec2 pattern_tl_a=pattern_from.xy;\r\nvec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nfloat tileRatio=u_scale.x;\r\nfloat fromScale=u_scale.y;\r\nfloat toScale=u_scale.z;\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\nvec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;\r\nvec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\r\nv_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);\r\nv_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);\r\nv_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\r\n}"),ei=di("uniform vec2 u_texsize;\r\nuniform float u_fade;\r\nuniform sampler2D u_image;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\nvec2 pattern_tl_a=pattern_from.xy;\r\nvec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nvec2 imagecoord=mod(v_pos_a,1.0);\r\nvec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);\r\nvec4 color1=texture2D(u_image,pos);\r\nvec2 imagecoord_b=mod(v_pos_b,1.0);\r\nvec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);\r\nvec4 color2=texture2D(u_image,pos2);\r\ngl_FragColor=mix(color1,color2,u_fade)*opacity;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform vec2 u_pixel_coord_upper;\r\nuniform vec2 u_pixel_coord_lower;\r\nuniform vec3 u_scale;\r\nattribute vec2 a_pos;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\n#pragma mapbox: define lowp float pixel_ratio_from\r\n#pragma mapbox: define lowp float pixel_ratio_to\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\n#pragma mapbox: initialize lowp float pixel_ratio_from\r\n#pragma mapbox: initialize lowp float pixel_ratio_to\r\nvec2 pattern_tl_a=pattern_from.xy;\r\nvec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nfloat tileZoomRatio=u_scale.x;\r\nfloat fromScale=u_scale.y;\r\nfloat toScale=u_scale.z;\r\nvec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;\r\nvec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\nv_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);\r\nv_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);\r\n}"),ii=di("varying vec4 v_color;\r\nvoid main() {\r\ngl_FragColor=v_color;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform vec3 u_lightcolor;\r\nuniform lowp vec3 u_lightpos;\r\nuniform lowp float u_lightintensity;\r\nuniform float u_vertical_gradient;\r\nuniform lowp float u_opacity;\r\nattribute vec2 a_pos;\r\nattribute vec4 a_normal_ed;\r\nvarying vec4 v_color;\r\n#pragma mapbox: define highp float base\r\n#pragma mapbox: define highp float height\r\n#pragma mapbox: define highp vec4 color\r\nvoid main() {\r\n#pragma mapbox: initialize highp float base\r\n#pragma mapbox: initialize highp float height\r\n#pragma mapbox: initialize highp vec4 color\r\nvec3 normal=a_normal_ed.xyz;\r\nbase=max(0.0,base);\r\nheight=max(0.0,height);\r\nfloat t=mod(normal.x,2.0);\r\ngl_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;\r\nv_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);\r\ncolor+=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*=(\r\n(1.0-u_vertical_gradient)+\n(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));\r\n}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);\r\nv_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);\r\nv_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);\r\nv_color*=u_opacity;\r\n}"),ri=di("uniform vec2 u_texsize;\r\nuniform float u_fade;\r\nuniform sampler2D u_image;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\nvarying vec4 v_lighting;\r\n#pragma mapbox: define lowp float base\r\n#pragma mapbox: define lowp float height\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\n#pragma mapbox: define lowp float pixel_ratio_from\r\n#pragma mapbox: define lowp float pixel_ratio_to\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float base\r\n#pragma mapbox: initialize lowp float height\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\n#pragma mapbox: initialize lowp float pixel_ratio_from\r\n#pragma mapbox: initialize lowp float pixel_ratio_to\r\nvec2 pattern_tl_a=pattern_from.xy;\r\nvec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nvec2 imagecoord=mod(v_pos_a,1.0);\r\nvec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);\r\nvec4 color1=texture2D(u_image,pos);\r\nvec2 imagecoord_b=mod(v_pos_b,1.0);\r\nvec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);\r\nvec4 color2=texture2D(u_image,pos2);\r\nvec4 mixedColor=mix(color1,color2,u_fade);\r\ngl_FragColor=mixedColor*v_lighting;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform vec2 u_pixel_coord_upper;\r\nuniform vec2 u_pixel_coord_lower;\r\nuniform float u_height_factor;\r\nuniform vec3 u_scale;\r\nuniform float u_vertical_gradient;\r\nuniform lowp float u_opacity;\r\nuniform vec3 u_lightcolor;\r\nuniform lowp vec3 u_lightpos;\r\nuniform lowp float u_lightintensity;\r\nattribute vec2 a_pos;\r\nattribute vec4 a_normal_ed;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\nvarying vec4 v_lighting;\r\n#pragma mapbox: define lowp float base\r\n#pragma mapbox: define lowp float height\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\n#pragma mapbox: define lowp float pixel_ratio_from\r\n#pragma mapbox: define lowp float pixel_ratio_to\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float base\r\n#pragma mapbox: initialize lowp float height\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\n#pragma mapbox: initialize lowp float pixel_ratio_from\r\n#pragma mapbox: initialize lowp float pixel_ratio_to\r\nvec2 pattern_tl_a=pattern_from.xy;\r\nvec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nfloat tileRatio=u_scale.x;\r\nfloat fromScale=u_scale.y;\r\nfloat toScale=u_scale.z;\r\nvec3 normal=a_normal_ed.xyz;\r\nfloat edgedistance=a_normal_ed.w;\r\nvec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;\r\nvec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\r\nbase=max(0.0,base);\r\nheight=max(0.0,height);\r\nfloat t=mod(normal.x,2.0);\r\nfloat z=t > 0.0 ? height : base;\r\ngl_Position=u_matrix*vec4(a_pos,z,1);\r\nvec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\r\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);\r\nv_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);\r\nv_lighting=vec4(0.0,0.0,0.0,1.0);\r\nfloat directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);\r\ndirectional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);\r\nif (normal.y !=0.0) {directional*=(\r\n(1.0-u_vertical_gradient)+\n(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));\r\n}\r\nv_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));\r\nv_lighting*=u_opacity;\r\n}"),ni=di("#ifdef GL_ES\r\nprecision highp float;\r\n#endif\r\nuniform sampler2D u_image;\r\nvarying vec2 v_pos;\r\nuniform vec2 u_dimension;\r\nuniform float u_zoom;\r\nuniform float u_maxzoom;\r\nuniform vec4 u_unpack;\r\nfloat getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;\r\ndata.a=-1.0;\r\nreturn dot(data,u_unpack)/4.0;\r\n}\r\nvoid main() {\r\nvec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);\r\nfloat b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);\r\nfloat c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);\r\nfloat d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);\r\nfloat e=getElevation(v_pos,0.0);\r\nfloat f=getElevation(v_pos+vec2(epsilon.x,0),0.0);\r\nfloat g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);\r\nfloat h=getElevation(v_pos+vec2(0,epsilon.y),0.0);\r\nfloat 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;\r\nvec2 deriv=vec2(\r\n(c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c)\r\n)/ pow(2.0,(u_zoom-u_maxzoom)*exaggeration+19.2562-u_zoom);\r\ngl_FragColor=clamp(vec4(\r\nderiv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform vec2 u_dimension;\r\nattribute vec2 a_pos;\r\nattribute vec2 a_texture_pos;\r\nvarying vec2 v_pos;\r\nvoid main() {\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\nhighp vec2 epsilon=1.0/u_dimension;\r\nfloat scale=(u_dimension.x-2.0)/u_dimension.x;\r\nv_pos=(a_texture_pos/8192.0)*scale+epsilon;\r\n}"),ai=di("uniform sampler2D u_image;\r\nvarying vec2 v_pos;\r\nuniform vec2 u_latrange;\r\nuniform vec2 u_light;\r\nuniform vec4 u_shadow;\r\nuniform vec4 u_highlight;\r\nuniform vec4 u_accent;\r\n#define PI 3.141592653589793\r\nvoid main() {\r\nvec4 pixel=texture2D(u_image,v_pos);\r\nvec2 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);\r\nfloat aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);\r\nfloat intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;\r\nfloat maxValue=0.5*PI;\r\nfloat 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);\r\nfloat shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);\r\nvec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);\r\ngl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nattribute vec2 a_pos;\r\nattribute vec2 a_texture_pos;\r\nvarying vec2 v_pos;\r\nvoid main() {\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\nv_pos=a_texture_pos/8192.0;\r\n}"),oi=di("uniform lowp float u_device_pixel_ratio;\r\nvarying vec2 v_width2;\r\nvarying vec2 v_normal;\r\nvarying float v_gamma_scale;\r\n#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize lowp float blur\r\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;\r\nfloat alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);\r\ngl_FragColor=color*(alpha*opacity);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","\n#define scale 0.015873016\r\nattribute vec2 a_pos_normal;\r\nattribute vec4 a_data;\r\nuniform mat4 u_matrix;\r\nuniform mediump float u_ratio;\r\nuniform vec2 u_units_to_pixels;\r\nuniform lowp float u_device_pixel_ratio;\r\nvarying vec2 v_normal;\r\nvarying vec2 v_width2;\r\nvarying float v_gamma_scale;\r\nvarying highp float v_linesofar;\r\n#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define mediump float gapwidth\r\n#pragma mapbox: define lowp float offset\r\n#pragma mapbox: define mediump float width\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump float gapwidth\r\n#pragma mapbox: initialize lowp float offset\r\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;\r\nvec2 a_extrude=a_data.xy-128.0;\r\nfloat a_direction=mod(a_data.z,4.0)-1.0;\r\nv_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;\r\nvec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;\r\nnormal.y=normal.y*2.0-1.0;\r\nv_normal=normal;gapwidth=gapwidth/2.0;\r\nfloat halfwidth=width/2.0;\r\noffset=-1.0*offset;\r\nfloat inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);\r\nfloat 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;\r\nmediump float t=1.0-abs(u);\r\nmediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);\r\nvec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);\r\ngl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);\r\nfloat extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);\r\nv_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\r\nv_width2=vec2(outset,inset);\r\n}"),si=di("uniform lowp float u_device_pixel_ratio;\r\nuniform sampler2D u_image;\r\nvarying vec2 v_width2;\r\nvarying vec2 v_normal;\r\nvarying float v_gamma_scale;\r\nvarying highp float v_lineprogress;\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float blur\r\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;\r\nfloat 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));\r\ngl_FragColor=color*(alpha*opacity);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","\n#define MAX_LINE_DISTANCE 32767.0\n#define scale 0.015873016\r\nattribute vec2 a_pos_normal;\r\nattribute vec4 a_data;\r\nuniform mat4 u_matrix;\r\nuniform mediump float u_ratio;\r\nuniform lowp float u_device_pixel_ratio;\r\nuniform vec2 u_units_to_pixels;\r\nvarying vec2 v_normal;\r\nvarying vec2 v_width2;\r\nvarying float v_gamma_scale;\r\nvarying highp float v_lineprogress;\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define mediump float gapwidth\r\n#pragma mapbox: define lowp float offset\r\n#pragma mapbox: define mediump float width\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump float gapwidth\r\n#pragma mapbox: initialize lowp float offset\r\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;\r\nvec2 a_extrude=a_data.xy-128.0;\r\nfloat a_direction=mod(a_data.z,4.0)-1.0;\r\nv_lineprogress=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0/MAX_LINE_DISTANCE;\r\nvec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;\r\nnormal.y=normal.y*2.0-1.0;\r\nv_normal=normal;gapwidth=gapwidth/2.0;\r\nfloat halfwidth=width/2.0;\r\noffset=-1.0*offset;\r\nfloat inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);\r\nfloat 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;\r\nmediump float t=1.0-abs(u);\r\nmediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);\r\nvec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);\r\ngl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);\r\nfloat extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);\r\nv_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\r\nv_width2=vec2(outset,inset);\r\n}"),li=di("uniform lowp float u_device_pixel_ratio;\r\nuniform vec2 u_texsize;\r\nuniform float u_fade;\r\nuniform mediump vec3 u_scale;\r\nuniform sampler2D u_image;\r\nvarying vec2 v_normal;\r\nvarying vec2 v_width2;\r\nvarying float v_linesofar;\r\nvarying float v_gamma_scale;\r\nvarying float v_width;\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\n#pragma mapbox: define lowp float pixel_ratio_from\r\n#pragma mapbox: define lowp float pixel_ratio_to\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\n#pragma mapbox: initialize lowp float pixel_ratio_from\r\n#pragma mapbox: initialize lowp float pixel_ratio_to\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\nvec2 pattern_tl_a=pattern_from.xy;\r\nvec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nfloat tileZoomRatio=u_scale.x;\r\nfloat fromScale=u_scale.y;\r\nfloat toScale=u_scale.z;\r\nvec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;\r\nvec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\r\nvec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);\r\nvec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);\r\nfloat aspect_a=display_size_a.y/v_width;\r\nfloat aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;\r\nfloat alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);\r\nfloat x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);\r\nfloat x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);\r\nfloat y=0.5*v_normal.y+0.5;\r\nvec2 texel_size=1.0/u_texsize;\r\nvec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));\r\nvec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));\r\nvec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);\r\ngl_FragColor=color*alpha*opacity;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\r\nattribute vec2 a_pos_normal;\r\nattribute vec4 a_data;\r\nuniform mat4 u_matrix;\r\nuniform vec2 u_units_to_pixels;\r\nuniform mediump float u_ratio;\r\nuniform lowp float u_device_pixel_ratio;\r\nvarying vec2 v_normal;\r\nvarying vec2 v_width2;\r\nvarying float v_linesofar;\r\nvarying float v_gamma_scale;\r\nvarying float v_width;\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp float offset\r\n#pragma mapbox: define mediump float gapwidth\r\n#pragma mapbox: define mediump float width\r\n#pragma mapbox: define lowp float floorwidth\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\n#pragma mapbox: define lowp float pixel_ratio_from\r\n#pragma mapbox: define lowp float pixel_ratio_to\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize lowp float offset\r\n#pragma mapbox: initialize mediump float gapwidth\r\n#pragma mapbox: initialize mediump float width\r\n#pragma mapbox: initialize lowp float floorwidth\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\n#pragma mapbox: initialize lowp float pixel_ratio_from\r\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;\r\nvec2 a_extrude=a_data.xy-128.0;\r\nfloat a_direction=mod(a_data.z,4.0)-1.0;\r\nfloat 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;\r\nnormal.y=normal.y*2.0-1.0;\r\nv_normal=normal;gapwidth=gapwidth/2.0;\r\nfloat halfwidth=width/2.0;\r\noffset=-1.0*offset;\r\nfloat inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);\r\nfloat 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;\r\nmediump float t=1.0-abs(u);\r\nmediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);\r\nvec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);\r\ngl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);\r\nfloat extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);\r\nv_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\r\nv_linesofar=a_linesofar;\r\nv_width2=vec2(outset,inset);\r\nv_width=floorwidth;\r\n}"),ui=di("uniform lowp float u_device_pixel_ratio;\r\nuniform sampler2D u_image;\r\nuniform float u_sdfgamma;\r\nuniform float u_mix;\r\nvarying vec2 v_normal;\r\nvarying vec2 v_width2;\r\nvarying vec2 v_tex_a;\r\nvarying vec2 v_tex_b;\r\nvarying float v_gamma_scale;\r\n#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define mediump float width\r\n#pragma mapbox: define lowp float floorwidth\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump float width\r\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;\r\nfloat alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);\r\nfloat sdfdist_a=texture2D(u_image,v_tex_a).a;\r\nfloat sdfdist_b=texture2D(u_image,v_tex_b).a;\r\nfloat sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);\r\nalpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);\r\ngl_FragColor=color*(alpha*opacity);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\r\nattribute vec2 a_pos_normal;\r\nattribute vec4 a_data;\r\nuniform mat4 u_matrix;\r\nuniform mediump float u_ratio;\r\nuniform lowp float u_device_pixel_ratio;\r\nuniform vec2 u_patternscale_a;\r\nuniform float u_tex_y_a;\r\nuniform vec2 u_patternscale_b;\r\nuniform float u_tex_y_b;\r\nuniform vec2 u_units_to_pixels;\r\nvarying vec2 v_normal;\r\nvarying vec2 v_width2;\r\nvarying vec2 v_tex_a;\r\nvarying vec2 v_tex_b;\r\nvarying float v_gamma_scale;\r\n#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define mediump float gapwidth\r\n#pragma mapbox: define lowp float offset\r\n#pragma mapbox: define mediump float width\r\n#pragma mapbox: define lowp float floorwidth\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump float gapwidth\r\n#pragma mapbox: initialize lowp float offset\r\n#pragma mapbox: initialize mediump float width\r\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;\r\nvec2 a_extrude=a_data.xy-128.0;\r\nfloat a_direction=mod(a_data.z,4.0)-1.0;\r\nfloat a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;\r\nvec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;\r\nnormal.y=normal.y*2.0-1.0;\r\nv_normal=normal;gapwidth=gapwidth/2.0;\r\nfloat halfwidth=width/2.0;\r\noffset=-1.0*offset;\r\nfloat inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);\r\nfloat 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;\r\nmediump float t=1.0-abs(u);\r\nmediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);\r\nvec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);\r\ngl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);\r\nfloat extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);\r\nv_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\r\nv_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);\r\nv_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);\r\nv_width2=vec2(outset,inset);\r\n}"),hi=di("uniform float u_fade_t;\r\nuniform float u_opacity;\r\nuniform sampler2D u_image0;\r\nuniform sampler2D u_image1;\r\nvarying vec2 v_pos0;\r\nvarying vec2 v_pos1;\r\nuniform float u_brightness_low;\r\nuniform float u_brightness_high;\r\nuniform float u_saturation_factor;\r\nuniform float u_contrast_factor;\r\nuniform vec3 u_spin_weights;\r\nvoid main() {vec4 color0=texture2D(u_image0,v_pos0);\r\nvec4 color1=texture2D(u_image1,v_pos1);\r\nif (color0.a > 0.0) {\r\ncolor0.rgb=color0.rgb/color0.a;\r\n}\r\nif (color1.a > 0.0) {\r\ncolor1.rgb=color1.rgb/color1.a;\r\n}\r\nvec4 color=mix(color0,color1,u_fade_t);\r\ncolor.a*=u_opacity;\r\nvec3 rgb=color.rgb;rgb=vec3(\r\ndot(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;\r\nrgb+=(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);\r\nvec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);\r\ngl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform vec2 u_tl_parent;\r\nuniform float u_scale_parent;\r\nuniform float u_buffer_scale;\r\nattribute vec2 a_pos;\r\nattribute vec2 a_texture_pos;\r\nvarying vec2 v_pos0;\r\nvarying vec2 v_pos1;\r\nvoid main() {\r\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;\r\nv_pos1=(v_pos0*u_scale_parent)+u_tl_parent;\r\n}"),ci=di("uniform sampler2D u_texture;\r\nvarying vec2 v_tex;\r\nvarying float v_fade_opacity;\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float opacity\r\nlowp float alpha=opacity*v_fade_opacity;\r\ngl_FragColor=texture2D(u_texture,v_tex)*alpha;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","const float PI=3.141592653589793;\r\nattribute vec4 a_pos_offset;\r\nattribute vec4 a_data;\r\nattribute vec4 a_pixeloffset;\r\nattribute vec3 a_projected_pos;\r\nattribute float a_fade_opacity;\r\nuniform bool u_is_size_zoom_constant;\r\nuniform bool u_is_size_feature_constant;\r\nuniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;\r\nuniform highp float u_pitch;\r\nuniform bool u_rotate_symbol;\r\nuniform highp float u_aspect_ratio;\r\nuniform float u_fade_change;\r\nuniform mat4 u_matrix;\r\nuniform mat4 u_label_plane_matrix;\r\nuniform mat4 u_coord_matrix;\r\nuniform bool u_is_text;\r\nuniform bool u_pitch_with_map;\r\nuniform vec2 u_texsize;\r\nvarying vec2 v_tex;\r\nvarying float v_fade_opacity;\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float opacity\r\nvec2 a_pos=a_pos_offset.xy;\r\nvec2 a_offset=a_pos_offset.zw;\r\nvec2 a_tex=a_data.xy;\r\nvec2 a_size=a_data.zw;\r\nfloat a_size_min=floor(a_size[0]*0.5);\r\nvec2 a_pxoffset=a_pixeloffset.xy;\r\nvec2 a_minFontScale=a_pixeloffset.zw/256.0;\r\nhighp float segment_angle=-a_projected_pos[2];\r\nfloat size;\r\nif (!u_is_size_zoom_constant && !u_is_size_feature_constant) {\r\nsize=mix(a_size_min,a_size[1],u_size_t)/128.0;\r\n} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {\r\nsize=a_size_min/128.0;\r\n} else {\r\nsize=u_size;\r\n}\r\nvec4 projectedPoint=u_matrix*vec4(a_pos,0,1);\r\nhighp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\r\ncamera_to_anchor_distance/u_camera_to_center_distance :\r\nu_camera_to_center_distance/camera_to_anchor_distance;\r\nhighp float perspective_ratio=clamp(\r\n0.5+0.5*distance_ratio,0.0,4.0);\r\nsize*=perspective_ratio;\r\nfloat fontScale=u_is_text ? size/24.0 : size;\r\nhighp float symbol_rotation=0.0;\r\nif (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);\r\nvec2 a=projectedPoint.xy/projectedPoint.w;\r\nvec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;\r\nsymbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);\r\n}\r\nhighp float angle_sin=sin(segment_angle+symbol_rotation);\r\nhighp float angle_cos=cos(segment_angle+symbol_rotation);\r\nmat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);\r\nvec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);\r\ngl_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);\r\nv_tex=a_tex/u_texsize;\r\nvec2 fade_opacity=unpack_opacity(a_fade_opacity);\r\nfloat fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;\r\nv_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));\r\n}"),pi=di("#define SDF_PX 8.0\r\nuniform bool u_is_halo;\r\nuniform sampler2D u_texture;\r\nuniform highp float u_gamma_scale;\r\nuniform lowp float u_device_pixel_ratio;\r\nuniform bool u_is_text;\r\nvarying vec2 v_data0;\r\nvarying vec3 v_data1;\r\n#pragma mapbox: define highp vec4 fill_color\r\n#pragma mapbox: define highp vec4 halo_color\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp float halo_width\r\n#pragma mapbox: define lowp float halo_blur\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 fill_color\r\n#pragma mapbox: initialize highp vec4 halo_color\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize lowp float halo_width\r\n#pragma mapbox: initialize lowp float halo_blur\r\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;\r\nvec2 tex=v_data0.xy;\r\nfloat gamma_scale=v_data1.x;\r\nfloat size=v_data1.y;\r\nfloat fade_opacity=v_data1[2];\r\nfloat fontScale=u_is_text ? size/24.0 : size;\r\nlowp vec4 color=fill_color;\r\nhighp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);\r\nlowp float buff=(256.0-64.0)/256.0;\r\nif (u_is_halo) {\r\ncolor=halo_color;\r\ngamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);\r\nbuff=(6.0-halo_width/fontScale)/SDF_PX;\r\n}\r\nlowp float dist=texture2D(u_texture,tex).a;\r\nhighp float gamma_scaled=gamma*gamma_scale;\r\nhighp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);\r\ngl_FragColor=color*(alpha*opacity*fade_opacity);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","const float PI=3.141592653589793;\r\nattribute vec4 a_pos_offset;\r\nattribute vec4 a_data;\r\nattribute vec4 a_pixeloffset;\r\nattribute vec3 a_projected_pos;\r\nattribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;\r\nuniform bool u_is_size_feature_constant;\r\nuniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;\r\nuniform mat4 u_label_plane_matrix;\r\nuniform mat4 u_coord_matrix;\r\nuniform bool u_is_text;\r\nuniform bool u_pitch_with_map;\r\nuniform highp float u_pitch;\r\nuniform bool u_rotate_symbol;\r\nuniform highp float u_aspect_ratio;\r\nuniform highp float u_camera_to_center_distance;\r\nuniform float u_fade_change;\r\nuniform vec2 u_texsize;\r\nvarying vec2 v_data0;\r\nvarying vec3 v_data1;\r\n#pragma mapbox: define highp vec4 fill_color\r\n#pragma mapbox: define highp vec4 halo_color\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp float halo_width\r\n#pragma mapbox: define lowp float halo_blur\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 fill_color\r\n#pragma mapbox: initialize highp vec4 halo_color\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize lowp float halo_width\r\n#pragma mapbox: initialize lowp float halo_blur\r\nvec2 a_pos=a_pos_offset.xy;\r\nvec2 a_offset=a_pos_offset.zw;\r\nvec2 a_tex=a_data.xy;\r\nvec2 a_size=a_data.zw;\r\nfloat a_size_min=floor(a_size[0]*0.5);\r\nvec2 a_pxoffset=a_pixeloffset.xy;\r\nhighp float segment_angle=-a_projected_pos[2];\r\nfloat size;\r\nif (!u_is_size_zoom_constant && !u_is_size_feature_constant) {\r\nsize=mix(a_size_min,a_size[1],u_size_t)/128.0;\r\n} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {\r\nsize=a_size_min/128.0;\r\n} else {\r\nsize=u_size;\r\n}\r\nvec4 projectedPoint=u_matrix*vec4(a_pos,0,1);\r\nhighp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\r\ncamera_to_anchor_distance/u_camera_to_center_distance :\r\nu_camera_to_center_distance/camera_to_anchor_distance;\r\nhighp float perspective_ratio=clamp(\r\n0.5+0.5*distance_ratio,0.0,4.0);\r\nsize*=perspective_ratio;\r\nfloat fontScale=u_is_text ? size/24.0 : size;\r\nhighp float symbol_rotation=0.0;\r\nif (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);\r\nvec2 a=projectedPoint.xy/projectedPoint.w;\r\nvec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;\r\nsymbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);\r\n}\r\nhighp float angle_sin=sin(segment_angle+symbol_rotation);\r\nhighp float angle_cos=cos(segment_angle+symbol_rotation);\r\nmat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);\r\nvec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);\r\ngl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);\r\nfloat gamma_scale=gl_Position.w;\r\nvec2 fade_opacity=unpack_opacity(a_fade_opacity);\r\nfloat fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;\r\nfloat interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));\r\nv_data0=a_tex/u_texsize;\r\nv_data1=vec3(gamma_scale,size,interpolated_fade_opacity);\r\n}"),fi=di("#define SDF_PX 8.0\r\n#define SDF 1.0\r\n#define ICON 0.0\r\nuniform bool u_is_halo;\r\nuniform sampler2D u_texture;\r\nuniform sampler2D u_texture_icon;\r\nuniform highp float u_gamma_scale;\r\nuniform lowp float u_device_pixel_ratio;\r\nvarying vec4 v_data0;\r\nvarying vec4 v_data1;\r\n#pragma mapbox: define highp vec4 fill_color\r\n#pragma mapbox: define highp vec4 halo_color\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp float halo_width\r\n#pragma mapbox: define lowp float halo_blur\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 fill_color\r\n#pragma mapbox: initialize highp vec4 halo_color\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize lowp float halo_width\r\n#pragma mapbox: initialize lowp float halo_blur\r\nfloat fade_opacity=v_data1[2];\r\nif (v_data1.w==ICON) {\r\nvec2 tex_icon=v_data0.zw;\r\nlowp float alpha=opacity*fade_opacity;\r\ngl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\nreturn;\r\n}\r\nvec2 tex=v_data0.xy;\r\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;\r\nfloat gamma_scale=v_data1.x;\r\nfloat size=v_data1.y;\r\nfloat fontScale=size/24.0;\r\nlowp vec4 color=fill_color;\r\nhighp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);\r\nlowp float buff=(256.0-64.0)/256.0;\r\nif (u_is_halo) {\r\ncolor=halo_color;\r\ngamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);\r\nbuff=(6.0-halo_width/fontScale)/SDF_PX;\r\n}\r\nlowp float dist=texture2D(u_texture,tex).a;\r\nhighp float gamma_scaled=gamma*gamma_scale;\r\nhighp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);\r\ngl_FragColor=color*(alpha*opacity*fade_opacity);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","const float PI=3.141592653589793;\r\nattribute vec4 a_pos_offset;\r\nattribute vec4 a_data;\r\nattribute vec3 a_projected_pos;\r\nattribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;\r\nuniform bool u_is_size_feature_constant;\r\nuniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;\r\nuniform mat4 u_label_plane_matrix;\r\nuniform mat4 u_coord_matrix;\r\nuniform bool u_is_text;\r\nuniform bool u_pitch_with_map;\r\nuniform highp float u_pitch;\r\nuniform bool u_rotate_symbol;\r\nuniform highp float u_aspect_ratio;\r\nuniform highp float u_camera_to_center_distance;\r\nuniform float u_fade_change;\r\nuniform vec2 u_texsize;\r\nuniform vec2 u_texsize_icon;\r\nvarying vec4 v_data0;\r\nvarying vec4 v_data1;\r\n#pragma mapbox: define highp vec4 fill_color\r\n#pragma mapbox: define highp vec4 halo_color\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp float halo_width\r\n#pragma mapbox: define lowp float halo_blur\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 fill_color\r\n#pragma mapbox: initialize highp vec4 halo_color\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize lowp float halo_width\r\n#pragma mapbox: initialize lowp float halo_blur\r\nvec2 a_pos=a_pos_offset.xy;\r\nvec2 a_offset=a_pos_offset.zw;\r\nvec2 a_tex=a_data.xy;\r\nvec2 a_size=a_data.zw;\r\nfloat a_size_min=floor(a_size[0]*0.5);\r\nfloat is_sdf=a_size[0]-2.0*a_size_min;\r\nhighp float segment_angle=-a_projected_pos[2];\r\nfloat size;\r\nif (!u_is_size_zoom_constant && !u_is_size_feature_constant) {\r\nsize=mix(a_size_min,a_size[1],u_size_t)/128.0;\r\n} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {\r\nsize=a_size_min/128.0;\r\n} else {\r\nsize=u_size;\r\n}\r\nvec4 projectedPoint=u_matrix*vec4(a_pos,0,1);\r\nhighp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\r\ncamera_to_anchor_distance/u_camera_to_center_distance :\r\nu_camera_to_center_distance/camera_to_anchor_distance;\r\nhighp float perspective_ratio=clamp(\r\n0.5+0.5*distance_ratio,0.0,4.0);\r\nsize*=perspective_ratio;\r\nfloat fontScale=size/24.0;\r\nhighp float symbol_rotation=0.0;\r\nif (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);\r\nvec2 a=projectedPoint.xy/projectedPoint.w;\r\nvec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;\r\nsymbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);\r\n}\r\nhighp float angle_sin=sin(segment_angle+symbol_rotation);\r\nhighp float angle_cos=cos(segment_angle+symbol_rotation);\r\nmat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);\r\nvec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);\r\ngl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);\r\nfloat gamma_scale=gl_Position.w;\r\nvec2 fade_opacity=unpack_opacity(a_fade_opacity);\r\nfloat fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;\r\nfloat interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));\r\nv_data0.xy=a_tex/u_texsize;\r\nv_data0.zw=a_tex/u_texsize_icon;\r\nv_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);\r\n}");function di(t,e){var i=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,r={};return{fragmentSource:t=t.replace(i,function(t,e,i,n,a){return r[a]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+a+"\nvarying "+i+" "+n+" "+a+";\n#else\nuniform "+i+" "+n+" u_"+a+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+a+"\n "+i+" "+n+" "+a+" = u_"+a+";\n#endif\n"}),vertexSource:e=e.replace(i,function(t,e,i,n,a){var o="float"===n?"vec2":"vec4",s=a.match(/color/)?"color":o;return r[a]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+a+"\nuniform lowp float u_"+a+"_t;\nattribute "+i+" "+o+" a_"+a+";\nvarying "+i+" "+n+" "+a+";\n#else\nuniform "+i+" "+n+" u_"+a+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+a+"\n "+a+" = a_"+a+";\n#else\n "+i+" "+n+" "+a+" = u_"+a+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+a+"\n "+a+" = unpack_mix_"+s+"(a_"+a+", u_"+a+"_t);\n#else\n "+i+" "+n+" "+a+" = u_"+a+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+a+"\nuniform lowp float u_"+a+"_t;\nattribute "+i+" "+o+" a_"+a+";\n#else\nuniform "+i+" "+n+" u_"+a+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+a+"\n "+i+" "+n+" "+a+" = a_"+a+";\n#else\n "+i+" "+n+" "+a+" = u_"+a+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+a+"\n "+i+" "+n+" "+a+" = unpack_mix_"+s+"(a_"+a+", u_"+a+"_t);\n#else\n "+i+" "+n+" "+a+" = u_"+a+";\n#endif\n"})}}var yi=Object.freeze({__proto__:null,prelude:Ne,background:qe,backgroundPattern:Ge,circle:Ze,clippingMask:Xe,heatmap:We,heatmapTexture:Ke,collisionBox:He,collisionCircle:Je,debug:Ye,fill:Qe,fillOutline:$e,fillOutlinePattern:ti,fillPattern:ei,fillExtrusion:ii,fillExtrusionPattern:ri,hillshadePrepare:ni,hillshade:ai,line:oi,lineGradient:si,linePattern:li,lineSDF:ui,raster:hi,symbolIcon:ci,symbolSDF:pi,symbolTextAndIcon:fi}),mi=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};mi.prototype.bind=function(t,e,i,r,n,a,o,s){this.context=t;for(var l=this.boundPaintVertexBuffers.length!==r.length,u=0;!l&&u<r.length;u++)this.boundPaintVertexBuffers[u]!==r[u]&&(l=!0);t.extVertexArrayObject&&this.vao&&this.boundProgram===e&&this.boundLayoutVertexBuffer===i&&!l&&this.boundIndexBuffer===n&&this.boundVertexOffset===a&&this.boundDynamicVertexBuffer===o&&this.boundDynamicVertexBuffer2===s?(t.bindVertexArrayOES.set(this.vao),o&&o.bind(),n&&n.dynamicDraw&&n.bind(),s&&s.bind()):this.freshBind(e,i,r,n,a,o,s)},mi.prototype.freshBind=function(t,e,i,r,n,a,o){var s,l=t.numAttributes,u=this.context,h=u.gl;if(u.extVertexArrayObject)this.vao&&this.destroy(),this.vao=u.extVertexArrayObject.createVertexArrayOES(),u.bindVertexArrayOES.set(this.vao),s=0,this.boundProgram=t,this.boundLayoutVertexBuffer=e,this.boundPaintVertexBuffers=i,this.boundIndexBuffer=r,this.boundVertexOffset=n,this.boundDynamicVertexBuffer=a,this.boundDynamicVertexBuffer2=o;else{s=u.currentNumAttributes||0;for(var c=l;c<s;c++)h.disableVertexAttribArray(c)}e.enableAttributes(h,t);for(var p=0,f=i;p<f.length;p+=1)f[p].enableAttributes(h,t);a&&a.enableAttributes(h,t),o&&o.enableAttributes(h,t),e.bind(),e.setVertexAttribPointers(h,t,n);for(var d=0,y=i;d<y.length;d+=1){var m=y[d];m.bind(),m.setVertexAttribPointers(h,t,n)}a&&(a.bind(),a.setVertexAttribPointers(h,t,n)),r&&r.bind(),o&&(o.bind(),o.setVertexAttribPointers(h,t,n)),u.currentNumAttributes=l},mi.prototype.destroy=function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)};var vi=function(t,e,i,r,n){var a=t.gl;this.program=a.createProgram();var o=i?i.defines():[];n&&o.push("#define OVERDRAW_INSPECTOR;");var s=o.concat(Ne.fragmentSource,e.fragmentSource).join("\n"),l=o.concat(Ne.vertexSource,e.vertexSource).join("\n"),u=a.createShader(a.FRAGMENT_SHADER);if(a.isContextLost())this.failedToCreate=!0;else{a.shaderSource(u,s),a.compileShader(u),a.attachShader(this.program,u);var h=a.createShader(a.VERTEX_SHADER);if(a.isContextLost())this.failedToCreate=!0;else{a.shaderSource(h,l),a.compileShader(h),a.attachShader(this.program,h);for(var c=i?i.layoutAttributes:[],p=0;p<c.length;p++)a.bindAttribLocation(this.program,p,c[p].name);a.linkProgram(this.program),this.numAttributes=a.getProgramParameter(this.program,a.ACTIVE_ATTRIBUTES),this.attributes={};for(var f={},d=0;d<this.numAttributes;d++){var y=a.getActiveAttrib(this.program,d);y&&(this.attributes[y.name]=a.getAttribLocation(this.program,y.name))}for(var m=a.getProgramParameter(this.program,a.ACTIVE_UNIFORMS),v=0;v<m;v++){var g=a.getActiveUniform(this.program,v);g&&(f[g.name]=a.getUniformLocation(this.program,g.name))}this.fixedUniforms=r(t,f),this.binderUniforms=i?i.getUniforms(t,f):[]}}};function gi(t,e,i,r){var n=1/ce(i,1,r.tileZoom),a=Math.pow(2,i.tileID.overscaledZ),o=i.tileSize*Math.pow(2,r.tileZoom)/a,s=o*(i.tileID.canonical.x+i.tileID.wrap*a),l=o*i.tileID.canonical.y;return{u_image:0,u_texsize:i.imageAtlasTexture.size,u_scale:[n,t.fromScale,t.toScale],u_fade:t.t,u_pixel_coord_upper:[s>>16,l>>16],u_pixel_coord_lower:[65535&s,65535&l]}}vi.prototype.draw=function(t,e,i,r,n,a,o,s,l,u,h,c,p,f,d,y){var m,v=t.gl;if(!this.failedToCreate){for(var g in t.program.set(this.program),t.setDepthMode(i),t.setStencilMode(r),t.setColorMode(n),t.setCullFace(a),this.fixedUniforms)this.fixedUniforms[g].set(o[g]);f&&f.setUniforms(t,this.binderUniforms,c,{zoom:p});for(var _=(m={},m[v.LINES]=2,m[v.TRIANGLES]=3,m[v.LINE_STRIP]=1,m)[e],x=0,b=h.get();x<b.length;x+=1){var w=b[x],S=w.vaos||(w.vaos={});(S[s]||(S[s]=new mi)).bind(t,this,l,f?f.getPaintVertexBuffers():[],u,w.vertexOffset,d,y),v.drawElements(e,w.primitiveLength*_,v.UNSIGNED_SHORT,w.primitiveOffset*_*2)}}};var _i=function(e,i,r,n,a){var o=i.style.light,s=o.properties.get("position"),l=[s.x,s.y,s.z],u=t.create$1();"viewport"===o.properties.get("anchor")&&t.fromRotation(u,-a.angle),t.transformMat3(l,l,u);var h=o.properties.get("color");return{u_matrix:e,u_lightpos:l,u_lightintensity:o.properties.get("intensity"),u_lightcolor:[h.r,h.g,h.b],u_vertical_gradient:+r,u_opacity:n}},xi=function(e,i,r,n,a,o,s,l){return t.extend(_i(e,i,r,n,l),gi(o,0,s,l),{u_height_factor:-Math.pow(2,a.overscaledZ)/s.tileSize/8})},bi=function(t){return{u_matrix:t}},wi=function(e,i,r,n,a){return t.extend(bi(e),gi(r,0,n,a))},Si=function(t,e){return{u_matrix:t,u_world:e}},Mi=function(e,i,r,n,a,o){return t.extend(wi(e,0,r,n,o),{u_world:a})},Ei=function(e,i,r,n){var a,o,s=e.getTransformByStyleLayerId(n.id);if("map"===n.paint.get("circle-pitch-alignment")){var l=ce(r,1,s.zoom);a=!0,o=[l,l]}else a=!1,o=s.pixelsToGLUnits;return{u_camera_to_center_distance:s.cameraToCenterDistance,u_scale_with_map:+("map"===n.paint.get("circle-pitch-scale")),u_matrix:e.translatePosMatrix(i.posMatrix,r,n.paint.get("circle-translate"),n.paint.get("circle-translate-anchor")),u_pitch_with_map:+a,u_device_pixel_ratio:t.browser.devicePixelRatio,u_extrude_scale:o}},ki=function(e,i){return{u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_pixels_to_tile_units:new t.Uniform1f(e,i.u_pixels_to_tile_units),u_extrude_scale:new t.Uniform2f(e,i.u_extrude_scale),u_overscale_factor:new t.Uniform1f(e,i.u_overscale_factor)}},Ti=function(t,e,i){var r=ce(i,1,e.zoom),n=Math.pow(2,e.zoom-i.tileID.overscaledZ),a=i.tileID.overscaleFactor();return{u_matrix:t,u_camera_to_center_distance:e.cameraToCenterDistance,u_pixels_to_tile_units:r,u_extrude_scale:[e.pixelsToGLUnits[0]/(r*n),e.pixelsToGLUnits[1]/(r*n)],u_overscale_factor:a}},Ii=function(t,e,i){return void 0===i&&(i=1),{u_matrix:t,u_color:e,u_overlay:0,u_overlay_scale:i}},Ci=function(t){return{u_matrix:t}},Ai=function(t,e,i,r){return{u_matrix:t,u_extrude_scale:ce(e,1,i),u_intensity:r}},Pi=function(e,i,r){var n=e.getTransformByStyleLayerId(r.id);return{u_matrix:Oi(e,i,r),u_ratio:1/ce(i,1,n.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_units_to_pixels:[1/n.pixelsToGLUnits[0],1/n.pixelsToGLUnits[1]]}},Li=function(e,i,r){return t.extend(Pi(e,i,r),{u_image:0})},zi=function(e,i,r,n){var a=e.getTransformByStyleLayerId(r.id),o=Ri(i,a);return{u_matrix:Oi(e,i,r),u_texsize:i.imageAtlasTexture.size,u_ratio:1/ce(i,1,a.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_image:0,u_scale:[o,n.fromScale,n.toScale],u_fade:n.t,u_units_to_pixels:[1/a.pixelsToGLUnits[0],1/a.pixelsToGLUnits[1]]}},Di=function(e,i,r,n,a){var o=e.getTransformByStyleLayerId(r.id),s=e.lineAtlas,l=Ri(i,o),u="round"===r.layout.get("line-cap"),h=s.getDash(n.from,u),c=s.getDash(n.to,u),p=h.width*a.fromScale,f=c.width*a.toScale;return t.extend(Pi(e,i,r),{u_patternscale_a:[l/p,-h.height/2],u_patternscale_b:[l/f,-c.height/2],u_sdfgamma:s.width/(256*Math.min(p,f)*t.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:h.y,u_tex_y_b:c.y,u_mix:a.t})};function Ri(t,e){return 1/ce(t,1,e.tileZoom)}function Oi(t,e,i){return t.translatePosMatrix(e.tileID.posMatrix,e,i.paint.get("line-translate"),i.paint.get("line-translate-anchor"))}var Bi=function(t,e,i,r,n){return{u_matrix:t,u_tl_parent:e,u_scale_parent:i,u_buffer_scale:1,u_fade_t:r.mix,u_opacity:r.opacity*n.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:n.paint.get("raster-brightness-min"),u_brightness_high:n.paint.get("raster-brightness-max"),u_saturation_factor:(o=n.paint.get("raster-saturation"),o>0?1-1/(1.001-o):-o),u_contrast_factor:(a=n.paint.get("raster-contrast"),a>0?1/(1-a):1+a),u_spin_weights:function(t){t*=Math.PI/180;var e=Math.sin(t),i=Math.cos(t);return[(2*i+1)/3,(-Math.sqrt(3)*e-i+1)/3,(Math.sqrt(3)*e-i+1)/3]}(n.paint.get("raster-hue-rotate"))};var a,o},Fi=function(t,e,i,r,n,a,o,s,l,u,h){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:h.cameraToCenterDistance,u_pitch:h.pitch/360*2*Math.PI,u_rotate_symbol:+i,u_aspect_ratio:h.width/h.height,u_fade_change:n.options.fadeDuration?n.symbolFadeChange:1,u_matrix:a,u_label_plane_matrix:o,u_coord_matrix:s,u_is_text:+l,u_pitch_with_map:+r,u_texsize:u,u_texture:0}},Vi=function(e,i,r,n,a,o,s,l,u,h,c,p){return t.extend(Fi(e,i,r,n,a,o,s,l,u,h,p),{u_gamma_scale:n?Math.cos(p._pitch)*p.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:+c})},Ui=function(e,i,r,n,a,o,s,l,u,h,c){return t.extend(Vi(e,i,r,n,a,o,s,l,!0,u,!0,c),{u_texsize_icon:h,u_texture_icon:1})},ji=function(t,e,i){return{u_matrix:t,u_opacity:e,u_color:i}},Ni=function(e,i,r,n,a,o,s){return t.extend(function(t,e,i,r,n){var a=i.imageManager.getPattern(t.from.toString()),o=i.imageManager.getPattern(t.to.toString()),s=i.imageManager.getPixelSize(),l=s.width,u=s.height,h=Math.pow(2,r.tileID.overscaledZ),c=r.tileSize*Math.pow(2,n.tileZoom)/h,p=c*(r.tileID.canonical.x+r.tileID.wrap*h),f=c*r.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:a.tl,u_pattern_br_a:a.br,u_pattern_tl_b:o.tl,u_pattern_br_b:o.br,u_texsize:[l,u],u_mix:e.t,u_pattern_size_a:a.displaySize,u_pattern_size_b:o.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/ce(r,1,n.tileZoom),u_pixel_coord_upper:[p>>16,f>>16],u_pixel_coord_lower:[65535&p,65535&f]}}(n,o,r,a,s),{u_matrix:e,u_opacity:i})},qi={fillExtrusion:function(e,i){return{u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_lightpos:new t.Uniform3f(e,i.u_lightpos),u_lightintensity:new t.Uniform1f(e,i.u_lightintensity),u_lightcolor:new t.Uniform3f(e,i.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,i.u_vertical_gradient),u_opacity:new t.Uniform1f(e,i.u_opacity)}},fillExtrusionPattern:function(e,i){return{u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_lightpos:new t.Uniform3f(e,i.u_lightpos),u_lightintensity:new t.Uniform1f(e,i.u_lightintensity),u_lightcolor:new t.Uniform3f(e,i.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,i.u_vertical_gradient),u_height_factor:new t.Uniform1f(e,i.u_height_factor),u_image:new t.Uniform1i(e,i.u_image),u_texsize:new t.Uniform2f(e,i.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,i.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,i.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,i.u_scale),u_fade:new t.Uniform1f(e,i.u_fade),u_opacity:new t.Uniform1f(e,i.u_opacity)}},fill:function(e,i){return{u_matrix:new t.UniformMatrix4f(e,i.u_matrix)}},fillPattern:function(e,i){return{u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_image:new t.Uniform1i(e,i.u_image),u_texsize:new t.Uniform2f(e,i.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,i.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,i.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,i.u_scale),u_fade:new t.Uniform1f(e,i.u_fade)}},fillOutline:function(e,i){return{u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_world:new t.Uniform2f(e,i.u_world)}},fillOutlinePattern:function(e,i){return{u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_world:new t.Uniform2f(e,i.u_world),u_image:new t.Uniform1i(e,i.u_image),u_texsize:new t.Uniform2f(e,i.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,i.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,i.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,i.u_scale),u_fade:new t.Uniform1f(e,i.u_fade)}},circle:function(e,i){return{u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(e,i.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(e,i.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(e,i.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(e,i.u_matrix)}},collisionBox:ki,collisionCircle:ki,debug:function(e,i){return{u_color:new t.UniformColor(e,i.u_color),u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_overlay:new t.Uniform1i(e,i.u_overlay),u_overlay_scale:new t.Uniform1f(e,i.u_overlay_scale)}},clippingMask:function(e,i){return{u_matrix:new t.UniformMatrix4f(e,i.u_matrix)}},heatmap:function(e,i){return{u_extrude_scale:new t.Uniform1f(e,i.u_extrude_scale),u_intensity:new t.Uniform1f(e,i.u_intensity),u_matrix:new t.UniformMatrix4f(e,i.u_matrix)}},heatmapTexture:function(e,i){return{u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_world:new t.Uniform2f(e,i.u_world),u_image:new t.Uniform1i(e,i.u_image),u_color_ramp:new t.Uniform1i(e,i.u_color_ramp),u_opacity:new t.Uniform1f(e,i.u_opacity)}},hillshade:function(e,i){return{u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_image:new t.Uniform1i(e,i.u_image),u_latrange:new t.Uniform2f(e,i.u_latrange),u_light:new t.Uniform2f(e,i.u_light),u_shadow:new t.UniformColor(e,i.u_shadow),u_highlight:new t.UniformColor(e,i.u_highlight),u_accent:new t.UniformColor(e,i.u_accent)}},hillshadePrepare:function(e,i){return{u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_image:new t.Uniform1i(e,i.u_image),u_dimension:new t.Uniform2f(e,i.u_dimension),u_zoom:new t.Uniform1f(e,i.u_zoom),u_maxzoom:new t.Uniform1f(e,i.u_maxzoom),u_unpack:new t.Uniform4f(e,i.u_unpack)}},line:function(e,i){return{u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_ratio:new t.Uniform1f(e,i.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,i.u_units_to_pixels)}},lineGradient:function(e,i){return{u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_ratio:new t.Uniform1f(e,i.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,i.u_units_to_pixels),u_image:new t.Uniform1i(e,i.u_image)}},linePattern:function(e,i){return{u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_texsize:new t.Uniform2f(e,i.u_texsize),u_ratio:new t.Uniform1f(e,i.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_image:new t.Uniform1i(e,i.u_image),u_units_to_pixels:new t.Uniform2f(e,i.u_units_to_pixels),u_scale:new t.Uniform3f(e,i.u_scale),u_fade:new t.Uniform1f(e,i.u_fade)}},lineSDF:function(e,i){return{u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_ratio:new t.Uniform1f(e,i.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,i.u_units_to_pixels),u_patternscale_a:new t.Uniform2f(e,i.u_patternscale_a),u_patternscale_b:new t.Uniform2f(e,i.u_patternscale_b),u_sdfgamma:new t.Uniform1f(e,i.u_sdfgamma),u_image:new t.Uniform1i(e,i.u_image),u_tex_y_a:new t.Uniform1f(e,i.u_tex_y_a),u_tex_y_b:new t.Uniform1f(e,i.u_tex_y_b),u_mix:new t.Uniform1f(e,i.u_mix)}},raster:function(e,i){return{u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_tl_parent:new t.Uniform2f(e,i.u_tl_parent),u_scale_parent:new t.Uniform1f(e,i.u_scale_parent),u_buffer_scale:new t.Uniform1f(e,i.u_buffer_scale),u_fade_t:new t.Uniform1f(e,i.u_fade_t),u_opacity:new t.Uniform1f(e,i.u_opacity),u_image0:new t.Uniform1i(e,i.u_image0),u_image1:new t.Uniform1i(e,i.u_image1),u_brightness_low:new t.Uniform1f(e,i.u_brightness_low),u_brightness_high:new t.Uniform1f(e,i.u_brightness_high),u_saturation_factor:new t.Uniform1f(e,i.u_saturation_factor),u_contrast_factor:new t.Uniform1f(e,i.u_contrast_factor),u_spin_weights:new t.Uniform3f(e,i.u_spin_weights)}},symbolIcon:function(e,i){return{u_is_size_zoom_constant:new t.Uniform1i(e,i.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,i.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,i.u_size_t),u_size:new t.Uniform1f(e,i.u_size),u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,i.u_pitch),u_rotate_symbol:new t.Uniform1i(e,i.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,i.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,i.u_fade_change),u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,i.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,i.u_coord_matrix),u_is_text:new t.Uniform1i(e,i.u_is_text),u_pitch_with_map:new t.Uniform1i(e,i.u_pitch_with_map),u_texsize:new t.Uniform2f(e,i.u_texsize),u_texture:new t.Uniform1i(e,i.u_texture)}},symbolSDF:function(e,i){return{u_is_size_zoom_constant:new t.Uniform1i(e,i.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,i.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,i.u_size_t),u_size:new t.Uniform1f(e,i.u_size),u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,i.u_pitch),u_rotate_symbol:new t.Uniform1i(e,i.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,i.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,i.u_fade_change),u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,i.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,i.u_coord_matrix),u_is_text:new t.Uniform1i(e,i.u_is_text),u_pitch_with_map:new t.Uniform1i(e,i.u_pitch_with_map),u_texsize:new t.Uniform2f(e,i.u_texsize),u_texture:new t.Uniform1i(e,i.u_texture),u_gamma_scale:new t.Uniform1f(e,i.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,i.u_is_halo)}},symbolTextAndIcon:function(e,i){return{u_is_size_zoom_constant:new t.Uniform1i(e,i.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,i.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,i.u_size_t),u_size:new t.Uniform1f(e,i.u_size),u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,i.u_pitch),u_rotate_symbol:new t.Uniform1i(e,i.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,i.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,i.u_fade_change),u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,i.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,i.u_coord_matrix),u_is_text:new t.Uniform1i(e,i.u_is_text),u_pitch_with_map:new t.Uniform1i(e,i.u_pitch_with_map),u_texsize:new t.Uniform2f(e,i.u_texsize),u_texsize_icon:new t.Uniform2f(e,i.u_texsize_icon),u_texture:new t.Uniform1i(e,i.u_texture),u_texture_icon:new t.Uniform1i(e,i.u_texture_icon),u_gamma_scale:new t.Uniform1f(e,i.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,i.u_is_halo)}},background:function(e,i){return{u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_opacity:new t.Uniform1f(e,i.u_opacity),u_color:new t.UniformColor(e,i.u_color)}},backgroundPattern:function(e,i){return{u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_opacity:new t.Uniform1f(e,i.u_opacity),u_image:new t.Uniform1i(e,i.u_image),u_pattern_tl_a:new t.Uniform2f(e,i.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(e,i.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(e,i.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(e,i.u_pattern_br_b),u_texsize:new t.Uniform2f(e,i.u_texsize),u_mix:new t.Uniform1f(e,i.u_mix),u_pattern_size_a:new t.Uniform2f(e,i.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(e,i.u_pattern_size_b),u_scale_a:new t.Uniform1f(e,i.u_scale_a),u_scale_b:new t.Uniform1f(e,i.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(e,i.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,i.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(e,i.u_tile_units_to_pixels)}}};function Gi(t,e,i,r,n,a,o,s){for(var l=t.context,u=l.gl,h=t.useProgram(n?"collisionCircle":"collisionBox"),c=t.getTransformBySourceCache(e),p=0;p<r.length;p++){var f=r[p],d=e.getTile(f),y=d.getBucket(i);if(y){var m=n?s?y.textCollisionCircle:y.iconCollisionCircle:s?y.textCollisionBox:y.iconCollisionBox;if(m){var v=f.posMatrix;0===a[0]&&0===a[1]||(v=t.translatePosMatrix(f.posMatrix,d,a,o)),h.draw(l,n?u.TRIANGLES:u.LINES,Tt.disabled,It.disabled,t.colorModeForRenderPass(),At.disabled,Ti(v,c,d),i.id,m.layoutVertexBuffer,m.indexBuffer,m.segments,null,c.zoom,null,null,m.collisionVertexBuffer)}}}}function Zi(t,e,i,r,n,a,o){Gi(t,e,i,r,!1,n,a,o),Gi(t,e,i,r,!0,n,a,o)}var Xi=t.identity(new Float32Array(16));function Wi(e,i,r,n,a,o){var s=t.getAnchorAlignment(e),l=-(s.horizontalAlign-.5)*i,u=-(s.verticalAlign-.5)*r,h=t.evaluateVariableOffset(e,n);return new t.Point((l/a+h[0])*o,(u/a+h[1])*o)}function Ki(e,i,r,n,a,o,s,l,u,h,c){var p=e.text.placedSymbolArray,f=e.text.dynamicLayoutVertexArray,d=e.icon.dynamicLayoutVertexArray,y={};f.clear();for(var m=0;m<p.length;m++){var v=p.get(m),g=v.hidden||!v.crossTileID||e.allowVerticalPlacement&&!v.placedOrientation?null:n[v.crossTileID];if(g){var _=new t.Point(v.anchorX,v.anchorY),x=Qt(_,r?l:s),b=.5+o.cameraToCenterDistance/x.signedDistanceFromCamera*.5,w=a.evaluateSizeForFeature(e.textSizeData,h,v)*b/t.ONE_EM;r&&(w*=e.tilePixelRatio/u);for(var S=Wi(g.anchor,g.width,g.height,g.textOffset,g.textBoxScale,w),M=r?Qt(_.add(S),s).point:x.point.add(i?S.rotate(-o.angle):S),E=e.allowVerticalPlacement&&v.placedOrientation===t.WritingMode.vertical?Math.PI/2:0,k=0;k<v.numGlyphs;k++)t.addDynamicAttributes(f,M,E);c&&v.associatedIconIndex>=0&&(y[v.associatedIconIndex]={shiftedAnchor:M,angle:E})}else se(v.numGlyphs,f)}if(c){d.clear();for(var T=e.icon.placedSymbolArray,I=0;I<T.length;I++){var C=T.get(I);if(C.hidden)se(C.numGlyphs,d);else{var A=y[I];if(A)for(var P=0;P<C.numGlyphs;P++)t.addDynamicAttributes(d,A.shiftedAnchor,A.angle);else se(C.numGlyphs,d)}}e.icon.dynamicLayoutVertexBuffer.updateData(d)}e.text.dynamicLayoutVertexBuffer.updateData(f)}function Hi(t,e,i){return i.iconsInText&&e?"symbolTextAndIcon":t?"symbolSDF":"symbolIcon"}function Ji(e,i,r,n,a,o,s,l,u,h,c,p){for(var f,d,y=e.context,m=y.gl,v=e.getTransformBySourceCache(i),g="map"===l,_="map"===u,x=g&&"point"!==r.layout.get("symbol-placement"),b=g&&!_&&!x,w=void 0!==r.layout.get("symbol-sort-key").constantOr(1),S=e.depthModeForSublayer(0,Tt.ReadOnly),M=r.layout.get("text-variable-anchor"),E=[],k=0,T=n;k<T.length;k+=1){var I=T[k],C=i.getTile(I),A=C.getBucket(r);if(A){var P=a?A.text:A.icon;if(P&&P.segments.get().length){var L=P.programConfigurations.get(r.id),z=a||A.sdfIcons,D=a?A.textSizeData:A.iconSizeData,R=_||0!==v.pitch;f||(f=e.useProgram(Hi(z,a,A),L),d=t.evaluateSizeForZoom(D,v.zoom));var O=void 0,B=[0,0],F=void 0,V=void 0,U=null,j=void 0;if(a)F=C.glyphAtlasTexture,V=m.LINEAR,O=C.glyphAtlasTexture.size,A.iconsInText&&(B=C.imageAtlasTexture.size,U=C.imageAtlasTexture,j=R||e.options.rotating||e.options.zooming||"composite"===D.kind||"camera"===D.kind?m.LINEAR:m.NEAREST);else{var N=1!==r.layout.get("icon-size").constantOr(0)||A.iconsNeedLinear;F=C.imageAtlasTexture,V=z||e.options.rotating||e.options.zooming||N||R?m.LINEAR:m.NEAREST,O=C.imageAtlasTexture.size}var q=ce(C,1,v.zoom),G=Jt(I.posMatrix,_,g,v,q),Z=Yt(I.posMatrix,_,g,v,q),X=M&&A.hasTextData(),W="none"!==r.layout.get("icon-text-fit")&&X&&A.hasIconData();x&&te(A,I.posMatrix,e,a,G,Z,_,h);var K=e.translatePosMatrix(I.posMatrix,C,o,s),H=x||a&&M||W?Xi:G,J=e.translatePosMatrix(Z,C,o,s,!0),Y=z&&0!==r.paint.get(a?"text-halo-width":"icon-halo-width").constantOr(1),Q={program:f,buffers:P,uniformValues:z?A.iconsInText?Ui(D.kind,d,b,_,e,K,H,J,O,B,v):Vi(D.kind,d,b,_,e,K,H,J,a,O,!0,v):Fi(D.kind,d,b,_,e,K,H,J,a,O,v),atlasTexture:F,atlasTextureIcon:U,atlasInterpolation:V,atlasInterpolationIcon:j,isSDF:z,hasHalo:Y};if(w)for(var $=0,tt=P.segments.get();$<tt.length;$+=1){var et=tt[$];E.push({segments:new t.SegmentVector([et]),sortKey:et.sortKey,state:Q})}else E.push({segments:P.segments,sortKey:0,state:Q})}}}w&&E.sort(function(t,e){return t.sortKey-e.sortKey});for(var it=0,rt=E;it<rt.length;it+=1){var nt=rt[it],at=nt.state;if(y.activeTexture.set(m.TEXTURE0),at.atlasTexture.bind(at.atlasInterpolation,m.CLAMP_TO_EDGE),at.atlasTextureIcon&&(y.activeTexture.set(m.TEXTURE1),at.atlasTextureIcon&&at.atlasTextureIcon.bind(at.atlasInterpolationIcon,m.CLAMP_TO_EDGE)),at.isSDF){var ot=at.uniformValues;at.hasHalo&&(ot.u_is_halo=1,Yi(at.buffers,nt.segments,r,e,at.program,S,c,p,ot)),ot.u_is_halo=0}Yi(at.buffers,nt.segments,r,e,at.program,S,c,p,at.uniformValues)}}function Yi(t,e,i,r,n,a,o,s,l){var u=r.context,h=u.gl,c=r.getTransformByStyleLayerId(i.id);n.draw(u,h.TRIANGLES,a,o,s,At.disabled,l,i.id,t.layoutVertexBuffer,t.indexBuffer,e,i.paint,c.zoom,t.programConfigurations.get(i.id),t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer)}function Qi(t,e,i,r,n,a,o){var s,l,u,h,c,p=t.context.gl,f=t.getTransformBySourceCache(e),d=i.paint.get("fill-pattern"),y=d&&d.constantOr(1),m=i.getCrossfadeParameters();o?(l=y&&!i.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",s=p.LINES):(l=y?"fillPattern":"fill",s=p.TRIANGLES);for(var v=0,g=r;v<g.length;v+=1){var _=g[v],x=e.getTile(_);if(!y||x.patternsLoaded()){var b=x.getBucket(i);if(b){var w=b.programConfigurations.get(i.id),S=t.useProgram(l,w);y&&(t.context.activeTexture.set(p.TEXTURE0),x.imageAtlasTexture.bind(p.LINEAR,p.CLAMP_TO_EDGE),w.updatePaintBuffers(m));var M=d.constantOr(null);if(M&&x.imageAtlas){var E=x.imageAtlas,k=E.patternPositions[M.to.toString()],T=E.patternPositions[M.from.toString()];k&&T&&w.setConstantPatternPositions(k,T)}var I=t.translatePosMatrix(_.posMatrix,x,i.paint.get("fill-translate"),i.paint.get("fill-translate-anchor"));if(o){h=b.indexBuffer2,c=b.segments2;var C=[p.drawingBufferWidth,p.drawingBufferHeight];u="fillOutlinePattern"===l&&y?Mi(I,0,m,x,C,f):Si(I,C)}else h=b.indexBuffer,c=b.segments,u=y?wi(I,0,m,x,f):bi(I);S.draw(t.context,s,n,t.stencilModeForClipping(_),a,At.disabled,u,i.id,b.layoutVertexBuffer,h,c,i.paint,f.zoom,w)}}}}function $i(t,e,i,r,n,a,o){for(var s=t.context,l=s.gl,u=i.paint.get("fill-extrusion-pattern"),h=u.constantOr(1),c=i.getCrossfadeParameters(),p=i.paint.get("fill-extrusion-opacity"),f=t.getTransformByStyleLayerId(i.id),d=0,y=r;d<y.length;d+=1){var m=y[d],v=e.getTile(m),g=v.getBucket(i);if(g){var _=g.programConfigurations.get(i.id),x=t.useProgram(h?"fillExtrusionPattern":"fillExtrusion",_);h&&(t.context.activeTexture.set(l.TEXTURE0),v.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),_.updatePaintBuffers(c));var b=u.constantOr(null);if(b&&v.imageAtlas){var w=v.imageAtlas,S=w.patternPositions[b.to.toString()],M=w.patternPositions[b.from.toString()];S&&M&&_.setConstantPatternPositions(S,M)}var E=t.translatePosMatrix(m.posMatrix,v,i.paint.get("fill-extrusion-translate"),i.paint.get("fill-extrusion-translate-anchor")),k=i.paint.get("fill-extrusion-vertical-gradient"),T=h?xi(E,t,k,p,m,c,v,f):_i(E,t,k,p,f);x.draw(s,s.gl.TRIANGLES,n,a,o,At.backCCW,T,i.id,g.layoutVertexBuffer,g.indexBuffer,g.segments,i.paint,f.zoom,_)}}}function tr(e,i,r,n,a,o){var s=e.context,l=s.gl,u=i.fbo;if(u){var h=e.useProgram("hillshade");s.activeTexture.set(l.TEXTURE0),l.bindTexture(l.TEXTURE_2D,u.colorAttachment.get());var c=function(e,i,r){var n=r.paint.get("hillshade-shadow-color"),a=r.paint.get("hillshade-highlight-color"),o=r.paint.get("hillshade-accent-color"),s=e.getTransformByStyleLayerId(r.id),l=r.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===r.paint.get("hillshade-illumination-anchor")&&(l-=s.angle);var u,h,c,p=!e.options.moving;return{u_matrix:s.calculatePosMatrix(i.tileID.toUnwrapped(),p),u_image:0,u_latrange:(u=i.tileID,h=Math.pow(2,u.canonical.z),c=u.canonical.y,[new t.MercatorCoordinate(0,c/h).toLngLat().lat,new t.MercatorCoordinate(0,(c+1)/h).toLngLat().lat]),u_light:[r.paint.get("hillshade-exaggeration"),l],u_shadow:n,u_highlight:a,u_accent:o}}(e,i,r);h.draw(s,l.TRIANGLES,n,a,o,At.disabled,c,r.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments)}}function er(e,i,r,n,a,o,s){var l=e.context,u=l.gl,h=i.dem;if(h&&h.data){var c=h.dim,p=h.stride,f=h.getPixels();if(l.activeTexture.set(u.TEXTURE1),l.pixelStoreUnpackPremultiplyAlpha.set(!1),i.demTexture=i.demTexture||e.getTileTexture(p),i.demTexture){var d=i.demTexture;d.update(f,{premultiply:!1}),d.bind(u.NEAREST,u.CLAMP_TO_EDGE)}else i.demTexture=new t.Texture(l,f,u.RGBA,{premultiply:!1}),i.demTexture.bind(u.NEAREST,u.CLAMP_TO_EDGE);l.activeTexture.set(u.TEXTURE0);var y=i.fbo;if(!y){var m=new t.Texture(l,{width:c,height:c,data:null},u.RGBA);m.bind(u.LINEAR,u.CLAMP_TO_EDGE),(y=i.fbo=l.createFramebuffer(c,c,!0)).colorAttachment.set(m.texture)}l.bindFramebuffer.set(y.framebuffer),l.viewport.set([0,0,c,c]),e.useProgram("hillshadePrepare").draw(l,u.TRIANGLES,a,o,s,At.disabled,function(e,i,r){var n=i.stride,a=t.create();return t.ortho(a,0,t.EXTENT,-t.EXTENT,0,0,1),t.translate(a,a,[0,-t.EXTENT,0]),{u_matrix:a,u_image:1,u_dimension:[n,n],u_zoom:e.overscaledZ,u_maxzoom:r,u_unpack:i.getUnpackVector()}}(i.tileID,h,n),r.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments),i.needsHillshadePrepare=!1}}function ir(e,i,r,n,a){var o=n.paint.get("raster-fade-duration");if(o>0){var s=t.browser.now(),l=(s-e.timeAdded)/o,u=i?(s-i.timeAdded)/o:-1,h=r.getSource(),c=a.coveringZoomLevel({tileSize:h.tileSize,roundZoom:h.roundZoom}),p=!i||Math.abs(i.tileID.overscaledZ-c)>Math.abs(e.tileID.overscaledZ-c),f=p&&e.refreshedUponExpiration?1:t.clamp(p?l:1-u,0,1);return e.refreshedUponExpiration&&l>=1&&(e.refreshedUponExpiration=!1),i?{opacity:1,mix:1-f}:{opacity:f,mix:0}}return{opacity:1,mix:0}}var rr=new t.Color(1,0,0,1),nr=new t.Color(0,1,0,1),ar=new t.Color(0,0,1,1),or=new t.Color(1,0,1,1),sr=new t.Color(0,1,1,1);function lr(t,e,i,r){hr(t,0,e+i/2,t.transform.width,i,r)}function ur(t,e,i,r){hr(t,e-i/2,0,i,t.transform.height,r)}function hr(e,i,r,n,a,o){var s=e.context,l=s.gl;l.enable(l.SCISSOR_TEST),l.scissor(i*t.browser.devicePixelRatio,r*t.browser.devicePixelRatio,n*t.browser.devicePixelRatio,a*t.browser.devicePixelRatio),s.clear({color:o}),l.disable(l.SCISSOR_TEST)}function cr(e,i,r){var n=e.context,a=n.gl,o=r.posMatrix,s=e.useProgram("debug"),l=Tt.disabled,u=It.disabled,h=e.colorModeForRenderPass();n.activeTexture.set(a.TEXTURE0),e.emptyTexture.bind(a.LINEAR,a.CLAMP_TO_EDGE),s.draw(n,a.LINE_STRIP,l,u,h,At.disabled,Ii(o,t.Color.red),"$debug",e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments);var c=i.getTileByID(r.key).latestRawTileData,p=Math.floor((c&&c.byteLength||0)/1024),f=i.getTile(r).tileSize,d=512/Math.min(f,512)*(r.overscaledZ/e.transform.zoom)*.5,y=r.canonical.toString();r.overscaledZ!==r.canonical.z&&(y+=" => "+r.overscaledZ),function(t,e){t.initDebugOverlayCanvas();var i=t.debugOverlayCanvas,r=t.context.gl,n=t.debugOverlayCanvas.getContext("2d");n.clearRect(0,0,i.width,i.height),n.shadowColor="white",n.shadowBlur=2,n.lineWidth=1.5,n.strokeStyle="white",n.textBaseline="top",n.font="bold 36px Open Sans, sans-serif",n.fillText(e,5,5),n.strokeText(e,5,5),t.debugOverlayTexture.update(i),t.debugOverlayTexture.bind(r.LINEAR,r.CLAMP_TO_EDGE)}(e,y+" "+p+"kb"),s.draw(n,a.TRIANGLES,l,u,Ct.alphaBlended,At.disabled,Ii(o,t.Color.transparent,d),"$debug",e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments)}var pr={symbol:function(e,i,r,n,a){if("translucent"===e.renderPass){var o=It.disabled,s=e.colorModeForRenderPass(),l=r.layout.get("text-variable-anchor"),u=e.getClippingFeature(i);if(u){var h=e.context.gl;e.clearStencilByValue(255),e.drawClippingArea(0,u),o=new It({func:h.EQUAL,mask:255},0,255,h.KEEP,h.KEEP,h.KEEP)}l&&function(e,i,r,n,a,o,s){for(var l=i.getTransformBySourceCache(n),u="map"===a,h="map"===o,c=0,p=e;c<p.length;c+=1){var f=p[c],d=n.getTile(f),y=d.getBucket(r);if(y&&y.text&&y.text.segments.get().length){var m=t.evaluateSizeForZoom(y.textSizeData,l.zoom),v=ce(d,1,l.zoom),g=Jt(f.posMatrix,h,u,l,v),_="none"!==r.layout.get("icon-text-fit")&&y.hasIconData();if(m){var x=Math.pow(2,l.zoom-d.tileID.overscaledZ);Ki(y,u,h,s,t.symbolSize,l,g,f.posMatrix,x,m,_)}}}}(n,e,r,i,r.layout.get("text-rotation-alignment"),r.layout.get("text-pitch-alignment"),a),0!==r.paint.get("icon-opacity").constantOr(1)&&Ji(e,i,r,n,!1,r.paint.get("icon-translate"),r.paint.get("icon-translate-anchor"),r.layout.get("icon-rotation-alignment"),r.layout.get("icon-pitch-alignment"),r.layout.get("icon-keep-upright"),o,s),0!==r.paint.get("text-opacity").constantOr(1)&&Ji(e,i,r,n,!0,r.paint.get("text-translate"),r.paint.get("text-translate-anchor"),r.layout.get("text-rotation-alignment"),r.layout.get("text-pitch-alignment"),r.layout.get("text-keep-upright"),o,s),i.map.showCollisionBoxes&&(Zi(e,i,r,n,r.paint.get("text-translate"),r.paint.get("text-translate-anchor"),!0),Zi(e,i,r,n,r.paint.get("icon-translate"),r.paint.get("icon-translate-anchor"),!1))}},circle:function(e,i,r,n){if("translucent"===e.renderPass){var a=r.paint.get("circle-opacity"),o=r.paint.get("circle-stroke-width"),s=r.paint.get("circle-stroke-opacity"),l=void 0!==r.layout.get("circle-sort-key").constantOr(1);if(0!==a.constantOr(1)||0!==o.constantOr(1)&&0!==s.constantOr(1)){for(var u=e.context,h=u.gl,c=e.depthModeForSublayer(0,Tt.ReadOnly),p=It.disabled,f=e.colorModeForRenderPass(),d=[],y=0;y<n.length;y++){var m=n[y],v=i.getTile(m),g=v.getBucket(r);if(g){var _=g.programConfigurations.get(r.id),x={programConfiguration:_,program:e.useProgram("circle",_),layoutVertexBuffer:g.layoutVertexBuffer,indexBuffer:g.indexBuffer,uniformValues:Ei(e,m,v,r)};if(l)for(var b=0,w=g.segments.get();b<w.length;b+=1){var S=w[b];d.push({segments:new t.SegmentVector([S]),sortKey:S.sortKey,state:x})}else d.push({segments:g.segments,sortKey:0,state:x})}}l&&d.sort(function(t,e){return t.sortKey-e.sortKey});for(var M=0,E=d;M<E.length;M+=1){var k=E[M],T=k.state,I=T.programConfiguration;T.program.draw(u,h.TRIANGLES,c,p,f,At.disabled,T.uniformValues,r.id,T.layoutVertexBuffer,T.indexBuffer,k.segments,r.paint,e.getTransformByStyleLayerId(r.id).zoom,I)}}}},heatmap:function(e,i,r,n){if(0!==r.paint.get("heatmap-opacity"))if("offscreen"===e.renderPass){var a=e.context,o=a.gl,s=It.disabled,l=new Ct([o.ONE,o.ONE],t.Color.transparent,[!0,!0,!0,!0]);!function(t,e,i){var r=t.gl;t.activeTexture.set(r.TEXTURE1),t.viewport.set([0,0,e.width/4,e.height/4]);var n=i.heatmapFbo;if(n)r.bindTexture(r.TEXTURE_2D,n.colorAttachment.get()),t.bindFramebuffer.set(n.framebuffer);else{var a=r.createTexture();r.bindTexture(r.TEXTURE_2D,a),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),function t(e,i,r,n){var a=e.gl;a.texImage2D(a.TEXTURE_2D,0,a.RGBA,i.width/4,i.height/4,0,a.RGBA,e.extTextureHalfFloat?e.extTextureHalfFloat.HALF_FLOAT_OES:a.UNSIGNED_BYTE,null),n.colorAttachment.set(r),e.extTextureHalfFloat&&a.checkFramebufferStatus(a.FRAMEBUFFER)!==a.FRAMEBUFFER_COMPLETE&&(e.extTextureHalfFloat=null,n.colorAttachment.setDirty(),t(e,i,r,n))}(t,e,a,n=i.heatmapFbo=t.createFramebuffer(e.width/4,e.height/4,!1))}}(a,e,r),a.clear({color:t.Color.transparent});for(var u=0;u<n.length;u++){var h=n[u];if(!i.hasRenderableParent(h)){var c=i.getTile(h),p=c.getBucket(r);if(p){var f=p.programConfigurations.get(r.id),d=e.useProgram("heatmap",f),y=e.getTransformBySourceCache(i);d.draw(a,o.TRIANGLES,Tt.disabled,s,l,At.disabled,Ai(h.posMatrix,c,y.zoom,r.paint.get("heatmap-intensity")),r.id,p.layoutVertexBuffer,p.indexBuffer,p.segments,r.paint,y.zoom,f)}}}a.viewport.set([0,0,e.width,e.height])}else"translucent"===e.renderPass&&(e.context.setColorMode(e.colorModeForRenderPass()),function(e,i){var r=e.context,n=r.gl,a=i.heatmapFbo;if(a){r.activeTexture.set(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,a.colorAttachment.get()),r.activeTexture.set(n.TEXTURE1);var o=i.colorRampTexture;o||(o=i.colorRampTexture=new t.Texture(r,i.colorRamp,n.RGBA)),o.bind(n.LINEAR,n.CLAMP_TO_EDGE);var s=e.getTransformByStyleLayerId(i.id);e.useProgram("heatmapTexture").draw(r,n.TRIANGLES,Tt.disabled,It.disabled,e.colorModeForRenderPass(),At.disabled,function(e,i,r,n){var a=t.create();t.ortho(a,0,e.width,e.height,0,0,1);var o=e.context.gl;return{u_matrix:a,u_world:[o.drawingBufferWidth,o.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:i.paint.get("heatmap-opacity")}}(e,i),i.id,e.viewportBuffer,e.quadTriangleIndexBuffer,e.viewportSegments,i.paint,s.zoom)}}(e,r))},line:function(e,i,r,n){if("translucent"===e.renderPass){var a=e.getTransformBySourceCache(i),o=r.paint.get("line-opacity"),s=r.paint.get("line-width");if(0!==o.constantOr(1)&&0!==s.constantOr(1)){var l=e.depthModeForSublayer(0,Tt.ReadOnly),u=e.colorModeForRenderPass(),h=r.paint.get("line-dasharray"),c=r.paint.get("line-pattern"),p=c.constantOr(1),f=r.paint.get("line-gradient"),d=r.getCrossfadeParameters(),y=p?"linePattern":h?"lineSDF":f?"lineGradient":"line",m=e.context,v=m.gl,g=!0;if(f){m.activeTexture.set(v.TEXTURE0);var _=r.gradientTexture;if(!r.gradient)return;_||(_=r.gradientTexture=new t.Texture(m,r.gradient,v.RGBA)),_.bind(v.LINEAR,v.CLAMP_TO_EDGE)}for(var x=0,b=n;x<b.length;x+=1){var w=b[x],S=i.getTile(w);if(!p||S.patternsLoaded()){var M=S.getBucket(r);if(M){var E=M.programConfigurations.get(r.id),k=e.context.program.get(),T=e.useProgram(y,E),I=g||T.program!==k,C=c.constantOr(null);if(C&&S.imageAtlas){var A=S.imageAtlas,P=A.patternPositions[C.to.toString()],L=A.patternPositions[C.from.toString()];P&&L&&E.setConstantPatternPositions(P,L)}var z=p?zi(e,S,r,d):h?Di(e,S,r,h,d):f?Li(e,S,r):Pi(e,S,r);p?(m.activeTexture.set(v.TEXTURE0),S.imageAtlasTexture.bind(v.LINEAR,v.CLAMP_TO_EDGE),E.updatePaintBuffers(d)):h&&(I||e.lineAtlas.dirty)&&(m.activeTexture.set(v.TEXTURE0),e.lineAtlas.bind(m)),T.draw(m,v.TRIANGLES,l,e.stencilModeForClipping(w),u,At.disabled,z,r.id,M.layoutVertexBuffer,M.indexBuffer,M.segments,r.paint,a.zoom,E),g=!1}}}}}},fill:function(e,i,r,n){var a=r.paint.get("fill-color"),o=r.paint.get("fill-opacity");if(0!==o.constantOr(1)){var s=e.colorModeForRenderPass(),l=r.paint.get("fill-pattern"),u=e.opaquePassEnabledForLayer()&&!l.constantOr(1)&&1===a.constantOr(t.Color.transparent).a&&1===o.constantOr(0)?"opaque":"translucent";e.renderPass===u&&Qi(e,i,r,n,e.depthModeForSublayer(1,"opaque"===e.renderPass?Tt.ReadWrite:Tt.ReadOnly),s,!1),"translucent"===e.renderPass&&r.paint.get("fill-antialias")&&r.getPaintProperty("fill-outline-color")&&Qi(e,i,r,n,e.depthModeForSublayer(r.getPaintProperty("fill-outline-color")?2:0,Tt.ReadOnly),s,!0)}},"fill-extrusion":function(t,e,i,r){var n=i.paint.get("fill-extrusion-opacity");if(0!==n&&"translucent"===t.renderPass){var a=new Tt(t.context.gl.LEQUAL,Tt.ReadWrite,t.depthRangeFor3D);if(1!==n||i.paint.get("fill-extrusion-pattern").constantOr(1))$i(t,e,i,r,a,It.disabled,Ct.disabled),$i(t,e,i,r,a,t.stencilModeFor3D(),t.colorModeForRenderPass());else{var o=t.colorModeForRenderPass();$i(t,e,i,r,a,It.disabled,o)}}},hillshade:function(t,e,i,r){if("offscreen"===t.renderPass||"translucent"===t.renderPass){for(var n=t.context,a=e.getSource().maxzoom,o=t.depthModeForSublayer(0,Tt.ReadOnly),s=t.colorModeForRenderPass(),l="translucent"===t.renderPass?t.stencilConfigForOverlap(r):[{},r],u=l[0],h=0,c=l[1];h<c.length;h+=1){var p=c[h],f=e.getTile(p);f.needsHillshadePrepare&&"offscreen"===t.renderPass?er(t,f,i,a,o,It.disabled,s):"translucent"===t.renderPass&&tr(t,f,i,o,u[p.overscaledZ],s)}n.viewport.set([0,0,t.width,t.height])}},raster:function(t,e,i,r){if("translucent"===t.renderPass&&0!==i.paint.get("raster-opacity")&&r.length){var n=t.getTransformBySourceCache(e),a=t.context,o=a.gl,s=e.getSource(),l=t.useProgram("raster"),u=t.colorModeForRenderPass(),h=s instanceof I?[{},r]:t.stencilConfigForOverlap(r),c=h[0],p=h[1],f=t.getClippingFeature(e),d=It.disabled;if(f){t.clearStencilByValue(255);var y=0;if(t.drawClippingArea(y,f),s instanceof I)d=new It({func:o.GEQUAL,mask:255},y,255,o.KEEP,o.KEEP,o.REPLACE);else for(var m=Object.keys(c),v=0;v<m.length;v++)c[m[v]]=new It({func:o.GEQUAL,mask:255},y+=1,255,o.KEEP,o.KEEP,o.REPLACE)}else t.clearStencil();for(var g=p[p.length-1].overscaledZ,_=!t.options.moving,x=0,b=p;x<b.length;x+=1){var w=b[x],S=t.depthModeForSublayer(w.overscaledZ-g,1===i.paint.get("raster-opacity")?Tt.ReadWrite:Tt.ReadOnly,o.LESS),M=e.getTile(w),E=n.calculatePosMatrix(w.toUnwrapped(),_);M.registerFadeDuration(i.paint.get("raster-fade-duration"));var k=e.findLoadedParent(w,0),T=ir(M,k,e,i,n),C=void 0,A=void 0,P="nearest"===i.paint.get("raster-resampling")?o.NEAREST:o.LINEAR;a.activeTexture.set(o.TEXTURE0),M.texture.bind(P,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST),a.activeTexture.set(o.TEXTURE1),k?(k.texture.bind(P,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST),C=Math.pow(2,k.tileID.overscaledZ-M.tileID.overscaledZ),A=[Math.abs(M.tileID.canonical.x)*C%1,Math.abs(M.tileID.canonical.y)*C%1]):M.texture.bind(P,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST);var L=Bi(E,A||[0,0],C||1,T,i);s instanceof I?l.draw(a,o.TRIANGLES,S,d,u,At.disabled,L,i.id,s.boundsBuffer,t.quadTriangleIndexBuffer,s.boundsSegments):l.draw(a,o.TRIANGLES,S,c[w.overscaledZ],u,At.disabled,L,i.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}}},background:function(t,e,i){var r=i.paint.get("background-color"),n=i.paint.get("background-opacity");if(0!==n){var a=t.context,o=a.gl,s=t.transform,l=s.tileSize,u=i.paint.get("background-pattern");if(!t.isPatternMissing(u)){var h=!u&&1===r.a&&1===n&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(t.renderPass===h){var c=It.disabled,p=t.depthModeForSublayer(0,"opaque"===h?Tt.ReadWrite:Tt.ReadOnly),f=t.colorModeForRenderPass(),d=t.useProgram(u?"backgroundPattern":"background"),y=s.zoom<0?[]:s.coveringTiles({tileSize:l});u&&(a.activeTexture.set(o.TEXTURE0),t.imageManager.bind(t.context));for(var m=i.getCrossfadeParameters(),v=0,g=y;v<g.length;v+=1){var _=g[v],x=t.transform.calculatePosMatrix(_.toUnwrapped()),b=u?Ni(x,n,t,u,{tileID:_,tileSize:l},m,t.transform):ji(x,n,r);d.draw(a,o.TRIANGLES,p,c,f,At.disabled,b,i.id,t.tileExtentBuffer,t.quadTriangleIndexBuffer,t.tileExtentSegments)}}}}},debug:function(t,e,i){for(var r=0;r<i.length;r++)cr(t,e,i[r])},custom:function(t,e,i){var r=t.context,n=i.implementation;if("offscreen"===t.renderPass){var a=n.prerender;a&&(t.setCustomLayerDefaults(),r.setColorMode(t.colorModeForRenderPass()),a.call(n,r.gl,t.transform.customLayerMatrix()),r.setDirty(),t.setBaseState())}else if("translucent"===t.renderPass){t.setCustomLayerDefaults(),r.setColorMode(t.colorModeForRenderPass()),r.setStencilMode(It.disabled);var o="3d"===n.renderingMode?new Tt(t.context.gl.LEQUAL,Tt.ReadWrite,t.depthRangeFor3D):t.depthModeForSublayer(0,Tt.ReadOnly);r.setDepthMode(o),n.render(r.gl,t.transform.customLayerMatrix()),r.setDirty(),t.setBaseState(),r.bindFramebuffer.set(null)}}},fr=function(t,e){this.context=new Pt(t),this.transform=e,this._tileTextures={},this.setup(),this.numSublayers=Lt.maxUnderzooming+Lt.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Re,this.gpuTimers={}};fr.prototype.resize=function(e,i){if(this.width=e*t.browser.devicePixelRatio,this.height=i*t.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var r=0,n=this.style._order;r<n.length;r+=1)this.style._layers[n[r]].resize()},fr.prototype.setup=function(){var e=this.context,i=new t.StructArrayLayout2i4;i.emplaceBack(0,0),i.emplaceBack(t.EXTENT,0),i.emplaceBack(0,t.EXTENT),i.emplaceBack(t.EXTENT,t.EXTENT),this.tileExtentBuffer=e.createVertexBuffer(i,je.members),this.tileExtentSegments=t.SegmentVector.simpleSegment(0,0,4,2);var r=new t.StructArrayLayout2i4;r.emplaceBack(0,0),r.emplaceBack(t.EXTENT,0),r.emplaceBack(0,t.EXTENT),r.emplaceBack(t.EXTENT,t.EXTENT),this.debugBuffer=e.createVertexBuffer(r,je.members),this.debugSegments=t.SegmentVector.simpleSegment(0,0,4,5);var n=new t.StructArrayLayout4i8;n.emplaceBack(0,0,0,0),n.emplaceBack(t.EXTENT,0,t.EXTENT,0),n.emplaceBack(0,t.EXTENT,0,t.EXTENT),n.emplaceBack(t.EXTENT,t.EXTENT,t.EXTENT,t.EXTENT),this.rasterBoundsBuffer=e.createVertexBuffer(n,T.members),this.rasterBoundsSegments=t.SegmentVector.simpleSegment(0,0,4,2);var a=new t.StructArrayLayout2i4;a.emplaceBack(0,0),a.emplaceBack(1,0),a.emplaceBack(0,1),a.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(a,je.members),this.viewportSegments=t.SegmentVector.simpleSegment(0,0,4,2);var o=new t.StructArrayLayout1ui2;o.emplaceBack(0),o.emplaceBack(1),o.emplaceBack(3),o.emplaceBack(2),o.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(o);var s=new t.StructArrayLayout3ui6;s.emplaceBack(0,1,2),s.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(s),this.emptyTexture=new t.Texture(e,{width:1,height:1,data:new Uint8Array([0,0,0,0])},e.gl.RGBA);var l=this.context.gl;this.stencilClearMode=new It({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO)},fr.prototype.clearStencil=function(){var e=this.context,i=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var r=t.create();t.ortho(r,0,this.width,this.height,0,0,1),t.scale(r,r,[i.drawingBufferWidth,i.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(e,i.TRIANGLES,Tt.disabled,this.stencilClearMode,Ct.disabled,At.disabled,Ci(r),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},fr.prototype._renderTileClippingMasks=function(t,e,i){if(this.currentStencilSource!==t.source&&t.isTileClipped()&&e&&e.length){this.currentStencilSource=t.source;var r=this.context,n=r.gl;this.nextStencilID+e.length>255&&this.clearStencil(),r.setColorMode(Ct.disabled),r.setDepthMode(Tt.disabled);var a=this.useProgram("clippingMask");this._tileClippingMaskIDs={};var o=this.getClippingFeature(i);if(o){this.clearStencilByValue(255),this.drawClippingArea(this.nextStencilID,o);for(var s=0;s<e.length;s++){var l=e[s],u=this._tileClippingMaskIDs[l.key]=this.nextStencilID++;a.draw(r,n.TRIANGLES,Tt.disabled,new It({func:n.GREATER,mask:255},u,255,n.KEEP,n.KEEP,n.REPLACE),Ct.disabled,At.disabled,Ci(l.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}else for(var h=0,c=e;h<c.length;h+=1){var p=c[h],f=this._tileClippingMaskIDs[p.key]=this.nextStencilID++;a.draw(r,n.TRIANGLES,Tt.disabled,new It({func:n.ALWAYS,mask:0},f,255,n.KEEP,n.KEEP,n.REPLACE),Ct.disabled,At.disabled,Ci(p.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}},fr.prototype.stencilModeFor3D=function(){this.currentStencilSource=void 0,this.nextStencilID+1>255&&this.clearStencil();var t=this.nextStencilID++,e=this.context.gl;return new It({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)},fr.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new It({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},fr.prototype.stencilConfigForOverlap=function(t){var e,i=this.context.gl,r=t.sort(function(t,e){return e.overscaledZ-t.overscaledZ}),n=r[r.length-1].overscaledZ,a=r[0].overscaledZ-n+1;if(a>1){this.currentStencilSource=void 0,this.nextStencilID+a>255&&this.clearStencil();for(var o={},s=0;s<a;s++)o[s+n]=new It({func:i.GEQUAL,mask:255},s+this.nextStencilID,255,i.KEEP,i.KEEP,i.REPLACE);return this.nextStencilID+=a,[o,r]}return[(e={},e[n]=It.disabled,e),r]},fr.prototype.colorModeForRenderPass=function(){var e=this.context.gl;return this._showOverdrawInspector?new Ct([e.CONSTANT_COLOR,e.ONE],new t.Color(1/8,1/8,1/8,0),[!0,!0,!0,!0]):"opaque"===this.renderPass?Ct.unblended:Ct.alphaBlended},fr.prototype.depthModeForSublayer=function(t,e,i){if(!this.opaquePassEnabledForLayer())return Tt.disabled;var r=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new Tt(i||this.context.gl.LEQUAL,e,[r,r])},fr.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},fr.prototype.render=function(e,i){var r=this;this.style=e,this.options=i,this.lineAtlas=e.lineAtlas,this.imageManager=e.imageManager,this.glyphManager=e.glyphManager,this.symbolFadeChange=e.placement.symbolFadeChange(t.browser.now()),this.imageManager.beginFrame();var n=this.style._order,a=this.style.sourceCaches;for(var o in a){var s=a[o];s.used&&s.prepare(this.context)}var l,u,h={},c={},p={};for(var f in a){var d=a[f];h[f]=d.getVisibleCoordinates(),c[f]=h[f].slice().reverse(),p[f]=d.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(var y=0;y<n.length;y++)if(this.style._layers[n[y]].is3D()){this.opaquePassCutoff=y;break}this.renderPass="offscreen";for(var m=0,v=n;m<v.length;m+=1){var g=this.style._layers[v[m]];if(g.hasOffscreenPass()&&!g.isHidden(this.transform.zoom)){var _=c[g.source];("custom"===g.type||_.length)&&this.renderLayer(this,a[g.source],g,_)}}for(this.context.bindFramebuffer.set(null),this.context.clear({color:i.showOverdrawInspector?t.Color.black:t.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=i.showOverdrawInspector,this.depthRangeFor3D=[0,1-(e._order.length+2)*this.numSublayers*this.depthEpsilon],this.renderPass="opaque",this.currentLayer=n.length-1;this.currentLayer>=0;this.currentLayer--){var x=this.style._layers[n[this.currentLayer]],b=a[x.source],w=h[x.source];this._renderTileClippingMasks(x,w,b),this.renderLayer(this,b,x,w)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<n.length;this.currentLayer++){var S=this.style._layers[n[this.currentLayer]],M=a[S.source],E=("symbol"===S.type?p:c)[S.source];this._renderTileClippingMasks(S,h[S.source],M),this.renderLayer(this,M,S,E)}this.options.showTileBoundaries&&(t.values(this.style._layers).forEach(function(t){t.source&&!t.isHidden(r.getTransformByStyleLayerId(t.id).zoom)&&(t.source!==(u&&u.id)&&(u=r.style.sourceCaches[t.source]),(!l||l.getSource().maxzoom<u.getSource().maxzoom)&&(l=u))}),l&&pr.debug(this,l,l.getVisibleCoordinates())),this.options.showPadding&&function(t){var e=t.transform.padding;lr(t,t.transform.height-(e.top||0),3,rr),lr(t,e.bottom||0,3,nr),ur(t,e.left||0,3,ar),ur(t,t.transform.width-(e.right||0),3,or);var i=t.transform.centerPoint;!function(t,e,i,r){hr(t,e-1,i-10,2,20,r),hr(t,e-10,i-1,20,2,r)}(t,i.x,t.transform.height-i.y,sr)}(this),this.context.setDefault()},fr.prototype.renderLayer=function(t,e,i,r){i.isHidden(this.getTransformBySourceCache(e).zoom)||("background"===i.type||"custom"===i.type||r.length)&&(this.id=i.id,this.gpuTimingStart(i),pr[i.type](t,e,i,r,this.style.placement.variableOffsets),this.gpuTimingEnd())},fr.prototype.gpuTimingStart=function(t){if(this.options.gpuTiming){var e=this.context.extTimerQuery,i=this.gpuTimers[t.id];i||(i=this.gpuTimers[t.id]={calls:0,cpuTime:0,query:e.createQueryEXT()}),i.calls++,e.beginQueryEXT(e.TIME_ELAPSED_EXT,i.query)}},fr.prototype.gpuTimingEnd=function(){if(this.options.gpuTiming){var t=this.context.extTimerQuery;t.endQueryEXT(t.TIME_ELAPSED_EXT)}},fr.prototype.collectGpuTimers=function(){var t=this.gpuTimers;return this.gpuTimers={},t},fr.prototype.queryGpuTimers=function(t){var e={};for(var i in t){var r=t[i],n=this.context.extTimerQuery,a=n.getQueryObjectEXT(r.query,n.QUERY_RESULT_EXT)/1e6;n.deleteQueryEXT(r.query),e[i]=a}return e},fr.prototype.translatePosMatrix=function(e,i,r,n,a){if(!r[0]&&!r[1])return e;var o=a?"map"===n?this.transform.angle:0:"viewport"===n?-this.transform.angle:0;if(o){var s=Math.sin(o),l=Math.cos(o);r=[r[0]*l-r[1]*s,r[0]*s+r[1]*l]}var u=[a?r[0]:ce(i,r[0],this.transform.zoom),a?r[1]:ce(i,r[1],this.transform.zoom),0],h=new Float32Array(16);return t.translate(h,e,u),h},fr.prototype.saveTileTexture=function(t){var e=this._tileTextures[t.size[0]];e?e.push(t):this._tileTextures[t.size[0]]=[t]},fr.prototype.getTileTexture=function(t){var e=this._tileTextures[t];return e&&e.length>0?e.pop():null},fr.prototype.isPatternMissing=function(t){if(!t)return!1;var e=this.imageManager.getPattern(t.from.toString()),i=this.imageManager.getPattern(t.to.toString());return!e||!i},fr.prototype.useProgram=function(t,e){this.cache=this.cache||{};var i=""+t+(e?e.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[i]||(this.cache[i]=new vi(this.context,yi[t],e,qi[t],this._showOverdrawInspector)),this.cache[i]},fr.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()},fr.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)},fr.prototype.initDebugOverlayCanvas=function(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=t.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new t.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))},fr.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()},fr.prototype.drawClippingArea=function(t,e){if(e){var i=this.useProgram("clippingMask"),r=this.context,n=r.gl;e.upload(r,[{name:"a_pos",type:"Float32",components:2,offset:0}]),i.draw(r,n.TRIANGLES,Tt.disabled,new It({func:n.ALWAYS,mask:255},t,255,n.KEEP,n.KEEP,n.REPLACE),Ct.disabled,At.disabled,Ci(this.transform.customLayerMatrix()),"$clipping",e.layoutVertexBuffer,e.indexBuffer,e.segments)}},fr.prototype.clearStencilByValue=function(e){var i=this.context,r=i.gl,n=t.create();t.ortho(n,0,this.width,this.height,0,0,1),t.scale(n,n,[r.drawingBufferWidth,r.drawingBufferHeight,0]);var a=new It({func:r.ALWAYS,mask:255},e,255,r.KEEP,r.KEEP,r.REPLACE);this.useProgram("clippingMask").draw(i,r.TRIANGLES,Tt.disabled,a,Ct.disabled,At.disabled,Ci(n),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},fr.prototype.getClippingFeature=function(t){var e;if(t){var i=t.getSource();i._clippingFeature&&(e=i._clippingFeature)}return e},fr.prototype.getTransformBySourceCache=function(t){var e=this.transform;return t&&t.transform&&(e=t.transform),e},fr.prototype.getTransformByStyleLayerId=function(t){var e=this.style._layers[t];return e?this.getTransformBySourceCache(this.style.sourceCaches[e.source]):this.transform};var dr=function(t,e){this.points=t,this.planes=e};dr.fromInvProjectionMatrix=function(e,i,r){var n=Math.pow(2,r),a=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(function(i){return t.transformMat4([],i,e)}).map(function(e){return t.scale$1([],e,1/e[3]/i*n)}),o=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(function(e){var i=t.sub([],a[e[0]],a[e[1]]),r=t.sub([],a[e[2]],a[e[1]]),n=t.normalize([],t.cross([],i,r)),o=-t.dot(n,a[e[1]]);return n.concat(o)});return new dr(a,o)};var yr=function(e,i){this.min=e,this.max=i,this.center=t.scale$2([],t.add([],this.min,this.max),.5)};yr.prototype.quadrant=function(e){for(var i=[e%2==0,e<2],r=t.clone$2(this.min),n=t.clone$2(this.max),a=0;a<i.length;a++)r[a]=i[a]?this.min[a]:this.center[a],n[a]=i[a]?this.center[a]:this.max[a];return n[2]=this.max[2],new yr(r,n)},yr.prototype.distanceX=function(t){return Math.max(Math.min(this.max[0],t[0]),this.min[0])-t[0]},yr.prototype.distanceY=function(t){return Math.max(Math.min(this.max[1],t[1]),this.min[1])-t[1]},yr.prototype.intersects=function(e){for(var i=[[this.min[0],this.min[1],0,1],[this.max[0],this.min[1],0,1],[this.max[0],this.max[1],0,1],[this.min[0],this.max[1],0,1]],r=!0,n=0;n<e.planes.length;n++){for(var a=e.planes[n],o=0,s=0;s<i.length;s++)o+=t.dot$1(a,i[s])>=0;if(0===o)return 0;o!==i.length&&(r=!1)}if(r)return 2;for(var l=0;l<3;l++){for(var u=Number.MAX_VALUE,h=-Number.MAX_VALUE,c=0;c<e.points.length;c++){var p=e.points[c][l]-this.min[l];u=Math.min(u,p),h=Math.max(h,p)}if(h<0||u>this.max[l]-this.min[l])return 0}return 1};var mr=function(t,e,i,r){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),isNaN(t)||t<0||isNaN(e)||e<0||isNaN(i)||i<0||isNaN(r)||r<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=e,this.left=i,this.right=r};mr.prototype.interpolate=function(e,i,r){return null!=i.top&&null!=e.top&&(this.top=t.number(e.top,i.top,r)),null!=i.bottom&&null!=e.bottom&&(this.bottom=t.number(e.bottom,i.bottom,r)),null!=i.left&&null!=e.left&&(this.left=t.number(e.left,i.left,r)),null!=i.right&&null!=e.right&&(this.right=t.number(e.right,i.right,r)),this},mr.prototype.getCenter=function(e,i){var r=t.clamp((this.left+e-this.right)/2,0,e),n=t.clamp((this.top+i-this.bottom)/2,0,i);return new t.Point(r,n)},mr.prototype.equals=function(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right},mr.prototype.clone=function(){return new mr(this.top,this.bottom,this.left,this.right)},mr.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var vr=function(e,i,r,n,a,o){this.tileSize=512,this.maxValidLatitude=90,this.maxValidLongitude=180,this._renderWorldCopies=void 0===a||a,this._minZoom=e||0,this._maxZoom=i||22,this._minPitch=null==r?0:r,this._maxPitch=null==n?60:n,this.crs=o,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._edgeInsets=new mr,this._posMatrixCache={},this._alignedPosMatrixCache={},this._resetZoomScale=!0},gr={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},resetZoomScale:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};vr.prototype.clone=function(){var t=new vr(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.crs=this.crs,t.tileSize=this.tileSize,t.latRange=this.latRange,t.lngRange=this.lngRange,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._edgeInsets=this._edgeInsets.clone(),t._calcMatrices(),t},gr.minZoom.get=function(){return this._minZoom},gr.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},gr.maxZoom.get=function(){return this._maxZoom},gr.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},gr.minPitch.get=function(){return this._minPitch},gr.minPitch.set=function(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))},gr.maxPitch.get=function(){return this._maxPitch},gr.maxPitch.set=function(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))},gr.renderWorldCopies.get=function(){return this._renderWorldCopies},gr.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},gr.worldSize.get=function(){return this.tileSize*this.scale},gr.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},gr.size.get=function(){return new t.Point(this.width,this.height)},gr.bearing.get=function(){return-this.angle/Math.PI*180},gr.bearing.set=function(e){var i=-t.wrap(e,-180,180)*Math.PI/180;this.angle!==i&&(this._unmodified=!1,this.angle=i,this._calcMatrices(),this.rotationMatrix=t.create$2(),t.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},gr.pitch.get=function(){return this._pitch/Math.PI*180},gr.pitch.set=function(e){var i=t.clamp(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==i&&(this._unmodified=!1,this._pitch=i,this._calcMatrices())},gr.fov.get=function(){return this._fov/Math.PI*180},gr.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())},gr.zoom.get=function(){return this._zoom},gr.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())},gr.center.get=function(){return this._center},gr.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},gr.padding.get=function(){return this._edgeInsets.toJSON()},gr.padding.set=function(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())},gr.resetZoomScale.set=function(t){this._resetZoomScale=t},gr.resetZoomScale.get=function(){return this._resetZoomScale},gr.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},vr.prototype.isPaddingEqual=function(t){return this._edgeInsets.equals(t)},vr.prototype.interpolatePadding=function(t,e,i){this._unmodified=!1,this._edgeInsets.interpolate(t,e,i),this._constrain(),this._calcMatrices()},vr.prototype.coveringZoomLevel=function(t){return(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize))},vr.prototype.getVisibleUnwrappedCoordinates=function(e){var i=[new t.UnwrappedTileID(0,e)];if(this._renderWorldCopies)for(var r=this.pointCoordinate(new t.Point(0,0)),n=this.pointCoordinate(new t.Point(this.width,0)),a=this.pointCoordinate(new t.Point(this.width,this.height)),o=this.pointCoordinate(new t.Point(0,this.height)),s=Math.floor(Math.min(r.x,n.x,a.x,o.x)),l=Math.floor(Math.max(r.x,n.x,a.x,o.x)),u=s-1;u<=l+1;u++)0!==u&&i.push(new t.UnwrappedTileID(u,e));return i},vr.prototype.coveringTiles=function(e){var i=this.coveringZoomLevel(e),r=i;if(void 0!==e.minzoom&&i<e.minzoom)return[];void 0!==e.maxzoom&&i>e.maxzoom&&(i=e.maxzoom);var n=t.MercatorCoordinate.fromLngLat(this.center,null,this.crs),a=Math.pow(2,i),o=[a*n.x,a*n.y,0],s=dr.fromInvProjectionMatrix(this.invProjMatrix,this.crs.getWorldSizeByTileZoom(this.worldSize,i),i),l=e.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(l=i);var u=function(t,e,i){return{aabb:new yr([t*a,e*a,0],[(t+1)*a,(e+1)*a,0]),zoom:i,x:t,y:e,wrap:0,fullyVisible:!1}},h=[],c=[],p=i,f=e.reparseOverscaled?r:i,d=1/0,y=1/0,m=-1/0,v=-1/0;if(s.points.forEach(function(t){var e=Math.floor(t[0]/a),i=Math.floor(t[1]/a);d=Math.min(e,d),m=Math.max(e,m),y=Math.min(i,y),v=Math.max(i,v)}),!(isFinite(d)&&isFinite(m)&&isFinite(y)&&isFinite(v)))return[];for(var g=d;g<=m;g++)for(var _=y;_<=v;_++)h.push(u(g,_,0));for(;h.length>0;){var x=h.pop(),b=x.x,w=x.y,S=x.fullyVisible;if(!S){var M=x.aabb.intersects(s);if(0===M)continue;S=2===M}var E=x.aabb.distanceX(o),k=x.aabb.distanceY(o),T=Math.max(Math.abs(E),Math.abs(k));if(x.zoom===p||T>3+(1<<p-x.zoom)-2&&x.zoom>=l)c.push({tileID:new t.OverscaledTileID(x.zoom===p?f:x.zoom,x.wrap,x.zoom,b,w),distanceSq:t.sqrLen([o[0]-.5-b,o[1]-.5-w])});else for(var I=0;I<4;I++){var C=(b<<1)+I%2,A=(w<<1)+(I>>1);h.push({aabb:x.aabb.quadrant(I),zoom:x.zoom+1,x:C,y:A,wrap:x.wrap,fullyVisible:S})}}return c.sort(function(t,e){return t.distanceSq-e.distanceSq}).map(function(t){return t.tileID})},vr.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},gr.unmodified.get=function(){return this._unmodified},vr.prototype.zoomScale=function(t){return Math.pow(2,t)},vr.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},vr.prototype.getProjectionParams=function(){var t=this.crs,e=t.projection,i=t.getExtent(),r=t.getCoordsInfo(i);return{code:t.epsgCode,def:e._def,originX:r.originX,originY:r.originY,width:r.width,height:r.height,bounds:Array.from(i)}},vr.prototype.project=function(e){if(this.crs){var i=e.lng,r=e.lat,n=this.getProjectionParams(),a=n.width,o=n.height,s=n.originX,l=n.originY,u=this.crs.projection.project([i,r]);return new t.Point((u[0]-s)*this.worldSize/a,(l-u[1])*this.worldSize/o)}var h=t.clamp(e.lat,-this.maxValidLatitude,this.maxValidLatitude);return new t.Point(this.lngX(e.lng),this.latY(h))},vr.prototype.unproject=function(e){if(this.crs){var i=this.getProjectionParams(),r=this.crs.projection.unproject([i.width*e.x/this.worldSize+i.originX,i.originY-i.height*e.y/this.worldSize]);return new t.LngLat(r[0],r[1])}return new t.LngLat(this.xLng(e.x),this.yLat(e.y))},gr.point.get=function(){return this.project(this.center)},vr.prototype.lngX=function(t){return(180+t)*this.worldSize/360},vr.prototype.latY=function(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))*this.worldSize/360},vr.prototype.xLng=function(t){return 360*t/this.worldSize-180},vr.prototype.yLat=function(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t/this.worldSize)*Math.PI/180))-90},vr.prototype.setLocationAtPoint=function(e,i){var r=this.pointCoordinate(i),n=this.pointCoordinate(this.centerPoint),a=this.locationCoordinate(e),o=new t.MercatorCoordinate(a.x-(r.x-n.x),a.y-(r.y-n.y));this.center=this.coordinateLocation(o),this._renderWorldCopies&&(this.center=this.center.wrap())},vr.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},vr.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},vr.prototype.locationCoordinate=function(e){return t.MercatorCoordinate.fromLngLat(e,null,this.crs)},vr.prototype.coordinateLocation=function(t){return t.toLngLat(this.crs)},vr.prototype.pointCoordinate=function(e){var i=[e.x,e.y,0,1],r=[e.x,e.y,1,1];t.transformMat4(i,i,this.pixelMatrixInverse),t.transformMat4(r,r,this.pixelMatrixInverse);var n=i[3],a=r[3],o=i[1]/n,s=r[1]/a,l=i[2]/n,u=r[2]/a,h=l===u?0:(0-l)/(u-l);return new t.MercatorCoordinate(t.number(i[0]/n,r[0]/a,h)/this.worldSize,t.number(o,s,h)/this.worldSize)},vr.prototype.coordinatePoint=function(e){var i=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(i,i,this.pixelMatrix),new t.Point(i[0]/i[3],i[1]/i[3])},vr.prototype.getBounds=function(){return(new t.LngLatBounds).extend(this.pointLocation(new t.Point(0,0))).extend(this.pointLocation(new t.Point(this.width,0))).extend(this.pointLocation(new t.Point(this.width,this.height))).extend(this.pointLocation(new t.Point(0,this.height)))},vr.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new t.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},vr.prototype.setMaxBounds=function(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=[-this.maxValidLongitude,this.maxValidLongitude],this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},vr.prototype.calculatePosMatrix=function(e,i){void 0===i&&(i=!1);var r=e.key,n=i?this._alignedPosMatrixCache:this._posMatrixCache;if(n[r])return n[r];var a=e.canonical,o=this.crs.getWorldSizeByTileZoom(this.worldSize,a.z)/this.zoomScale(a.z),s=a.x+Math.pow(2,a.z)*e.wrap,l=t.identity(new Float64Array(16));return t.translate(l,l,[s*o,a.y*o,0]),t.scale(l,l,[o/t.EXTENT,o/t.EXTENT,1]),t.multiply(l,i?this.alignedProjMatrix:this.projMatrix,l),n[r]=new Float32Array(l),n[r]},vr.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},vr.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining&&this.lngRange&&this.latRange){this._constraining=!0;var e,i,r,n,a,o,s,l,u=this.size,h=this._unmodified,c=this.lngRange,p=this.latRange,f=this.project({lng:c[0],lat:p[1]}),d=this.project({lng:c[1],lat:p[0]}),y=f.x,m=f.y,v=d.x,g=d.y,_=Math.min(y,v),x=Math.max(y,v),b=Math.min(g,m),w=Math.max(g,m);o=(n=x)-(r=_)<u.x?u.x/(n-r):0,a=(i=w)-(e=b)<u.y?u.y/(i-e):0;var S=this.point,M=Math.max(o||0,a||0);if(M&&this._resetZoomScale)return this.center=this.unproject(new t.Point(o?(n+r)/2:S.x,a?(i+e)/2:S.y)),this.zoom+=this.scaleZoom(M),this._unmodified=h,void(this._constraining=!1);if(this.latRange){var E=S.y,k=u.y/2;E-k<e&&(l=e+k),E+k>i&&(l=i-k)}if(this.lngRange){var T=S.x,I=u.x/2;T-I<r&&(s=r+I),T+I>n&&(s=n-I)}s>Number.MAX_VALUE||s<-Number.MAX_VALUE||l>Number.MAX_VALUE||l<-Number.MAX_VALUE||(void 0===s&&void 0===l||!this._resetZoomScale||(this.center=this.unproject(new t.Point(void 0!==s?s:S.x,void 0!==l?l:S.y))),this._unmodified=h,this._constraining=!1)}},vr.prototype._calcMatrices=function(){if(this.height){var e=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var i=Math.PI/2+this._pitch,r=this._fov*(.5+e.y/this.height),n=Math.sin(r)*this.cameraToCenterDistance/Math.sin(t.clamp(Math.PI-i-r,.01,Math.PI-.01)),a=this.point,o=a.x,s=a.y,l=1.01*(Math.cos(Math.PI/2-this._pitch)*n+this.cameraToCenterDistance),u=this.height/50,h=new Float64Array(16);t.perspective(h,this._fov,this.width/this.height,u,l),h[8]=2*-e.x/this.width,h[9]=2*e.y/this.height,t.scale(h,h,[1,-1,1]),t.translate(h,h,[0,0,-this.cameraToCenterDistance]),t.rotateX(h,h,this._pitch),t.rotateZ(h,h,this.angle),t.translate(h,h,[-o,-s,0]),this.mercatorMatrix=t.scale([],h,[this.worldSize,this.worldSize,this.worldSize]);var c=this.crs.pixelsPerMapUnit(this.center.lat,this.worldSize);t.scale(h,h,[1,1,c,1]),this.projMatrix=h,this.invProjMatrix=t.invert([],this.projMatrix);var p=this.width%2/2,f=this.height%2/2,d=Math.cos(this.angle),y=Math.sin(this.angle),m=o-Math.round(o)+d*p+y*f,v=s-Math.round(s)+d*f+y*p,g=new Float64Array(h);if(t.translate(g,g,[m>.5?m-1:m,v>.5?v-1:v,0]),this.alignedProjMatrix=g,h=t.create(),t.scale(h,h,[this.width/2,-this.height/2,1]),t.translate(h,h,[1,-1,0]),this.labelPlaneMatrix=h,h=t.create(),t.scale(h,h,[1,-1,1]),t.translate(h,h,[-1,-1,0]),t.scale(h,h,[2/this.width,2/this.height,1]),this.glCoordMatrix=h,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(h=t.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=h,this._posMatrixCache={},this._alignedPosMatrixCache={}}},vr.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var e=this.pointCoordinate(new t.Point(0,0)),i=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(i,i,this.pixelMatrix)[3]/this.cameraToCenterDistance},vr.prototype.getCameraPoint=function(){var e=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,e))},vr.prototype.getCameraQueryGeometry=function(e){var i=this.getCameraPoint();if(1===e.length)return[e[0],i];for(var r=i.x,n=i.y,a=i.x,o=i.y,s=0,l=e;s<l.length;s+=1){var u=l[s];r=Math.min(r,u.x),n=Math.min(n,u.y),a=Math.max(a,u.x),o=Math.max(o,u.y)}return[new t.Point(r,n),new t.Point(a,n),new t.Point(a,o),new t.Point(r,o),new t.Point(r,n)]},Object.defineProperties(vr.prototype,gr);var _r=function(e){var i,r,n,a;this._hashName=e&&encodeURIComponent(e),t.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=(i=this._updateHashUnthrottled.bind(this),r=!1,n=null,a=function(){n=null,r&&(i(),n=setTimeout(a,300),r=!1)},function(){return r=!0,n||a(),n})};_r.prototype.addTo=function(e){return this._map=e,t.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},_r.prototype.remove=function(){return t.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},_r.prototype.getHashString=function(e){var i=this._map.getCenter(),r=Math.round(100*this._map.getZoom())/100,n=Math.ceil((r*Math.LN2+Math.log(512/360/.5))/Math.LN10),a=Math.pow(10,n),o=Math.round(i.lng*a)/a,s=Math.round(i.lat*a)/a,l=this._map.getBearing(),u=this._map.getPitch(),h="";if(h+=e?"/"+o+"/"+s+"/"+r:r+"/"+s+"/"+o,(l||u)&&(h+="/"+Math.round(10*l)/10),u&&(h+="/"+Math.round(u)),this._hashName){var c=this._hashName,p=!1,f=t.window.location.hash.slice(1).split("&").map(function(t){var e=t.split("=")[0];return e===c?(p=!0,e+"="+h):t}).filter(function(t){return t});return p||f.push(c+"="+h),"#"+f.join("&")}return"#"+h},_r.prototype._getCurrentHash=function(){var e,i=this,r=t.window.location.hash.replace("#","");return this._hashName?(r.split("&").map(function(t){return t.split("=")}).forEach(function(t){t[0]===i._hashName&&(e=t)}),(e&&e[1]||"").split("/")):r.split("/")},_r.prototype._onHashChange=function(){var t=this._getCurrentHash();if(t.length>=3&&!t.some(function(t){return isNaN(t)})){var e=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:e,pitch:+(t[4]||0)}),!0}return!1},_r.prototype._updateHashUnthrottled=function(){var e=this.getHashString();try{t.window.history.replaceState(t.window.history.state,"",e)}catch(t){}};var xr=function(e){function r(r,n,a,o){void 0===o&&(o={});var s=i.mousePos(n.getCanvasContainer(),a),l=n.unproject(s);e.call(this,r,t.extend({point:s,lngLat:l,originalEvent:a},o)),this._defaultPrevented=!1,this.target=n}e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r;var n={defaultPrevented:{configurable:!0}};return r.prototype.preventDefault=function(){this._defaultPrevented=!0},n.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(r.prototype,n),r}(t.Event),br=function(e){function r(r,n,a){var o=i.touchPos(n.getCanvasContainer(),a),s=o.map(function(t){return n.unproject(t)}),l=o.reduce(function(t,e,i,r){return t.add(e.div(r.length))},new t.Point(0,0)),u=n.unproject(l);e.call(this,r,{points:o,point:l,lngLats:s,lngLat:u,originalEvent:a}),this._defaultPrevented=!1}e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r;var n={defaultPrevented:{configurable:!0}};return r.prototype.preventDefault=function(){this._defaultPrevented=!0},n.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(r.prototype,n),r}(t.Event),wr=function(t){function e(e,i,r){t.call(this,e,{originalEvent:r}),this._defaultPrevented=!1}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var i={defaultPrevented:{configurable:!0}};return e.prototype.preventDefault=function(){this._defaultPrevented=!0},i.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(e.prototype,i),e}(t.Event),Sr=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)};Sr.prototype.setZoomRate=function(t){this._defaultZoomRate=t},Sr.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t},Sr.prototype.isEnabled=function(){return!!this._enabled},Sr.prototype.isActive=function(){return!!this._active},Sr.prototype.isZooming=function(){return!!this._zooming},Sr.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},Sr.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Sr.prototype.onWheel=function(e){if(this.isEnabled()){var i=e.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,r=t.browser.now(),n=r-(this._lastWheelEventTime||0);this._lastWheelEventTime=r,0!==i&&i%4.000244140625==0?this._type="wheel":0!==i&&Math.abs(i)<4?this._type="trackpad":n>400?(this._type=null,this._lastValue=i,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(n*i)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,i+=this._lastValue)),e.shiftKey&&i&&(i/=4),this._type&&(this._lastWheelEvent=e,this._delta-=i,this.isActive()||this._start(e)),e.preventDefault()}},Sr.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this.isActive()||this._start(t)},Sr.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 r=i.mousePos(this._el,e);this._around=t.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(r)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onScrollFrame))}},Sr.prototype._onScrollFrame=function(){var e=this;if(this._frameId=null,this.isActive()){var i=this._map.transform;if(0!==this._delta){var r="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,n=2/(1+Math.exp(-Math.abs(this._delta*r)));this._delta<0&&0!==n&&(n=1/n);var a="number"==typeof this._targetZoom?i.zoomScale(this._targetZoom):i.scale;this._targetZoom=Math.min(i.maxZoom,Math.max(i.minZoom,i.scaleZoom(a*n))),"wheel"===this._type&&(this._startZoom=i.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var o="number"==typeof this._targetZoom?this._targetZoom:i.zoom,s=this._startZoom,l=this._easing,u=!1;if("wheel"===this._type&&s&&l){var h=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),c=l(h);i.zoom=t.number(s,o,c),h<1?this._frameId||(this._frameId=this._map._requestRenderFrame(this._onScrollFrame)):u=!0}else i.zoom=o,u=!0;i.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})),u&&(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))}},Sr.prototype._smoothOutEasing=function(e){var i=t.ease;if(this._prevEase){var r=this._prevEase,n=(t.browser.now()-r.start)/r.duration,a=r.easing(n+.01)-r.easing(n),o=.27/Math.sqrt(a*a+1e-4)*.01,s=Math.sqrt(.0729-o*o);i=t.bezier(o,s,.25,1)}return this._prevEase={start:t.browser.now(),duration:e,easing:i},i};var Mr=function(e,i){this._map=e,this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=i.clickTolerance||1,t.bindAll(["_onMouseMove","_onMouseUp","_onKeyDown"],this)};Mr.prototype.isEnabled=function(){return!!this._enabled},Mr.prototype.isActive=function(){return!!this._active},Mr.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},Mr.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Mr.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),i.disableDrag(),this._startPos=this._lastPos=i.mousePos(this._el,e),this._active=!0)},Mr.prototype._onMouseMove=function(t){var e=i.mousePos(this._el,t);if(!(this._lastPos.equals(e)||!this._box&&e.dist(this._startPos)<this._clickTolerance)){var r=this._startPos;this._lastPos=e,this._box||(this._box=i.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var n=Math.min(r.x,e.x),a=Math.max(r.x,e.x),o=Math.min(r.y,e.y),s=Math.max(r.y,e.y);i.setTransform(this._box,"translate("+n+"px,"+o+"px)"),this._box.style.width=a-n+"px",this._box.style.height=s-o+"px"}},Mr.prototype._onMouseUp=function(e){if(0===e.button){var r=this._startPos,n=i.mousePos(this._el,e);this._finish(),i.suppressClick(),r.x===n.x&&r.y===n.y?this._fireEvent("boxzoomcancel",e):this._map.fitScreenCoordinates(r,n,this._map.getBearing(),{linear:!0}).fire(new t.Event("boxzoomend",{originalEvent:e}))}},Mr.prototype._onKeyDown=function(t){27===t.keyCode&&(this._finish(),this._fireEvent("boxzoomcancel",t))},Mr.prototype._finish=function(){this._active=!1,t.window.document.removeEventListener("mousemove",this._onMouseMove,!1),t.window.document.removeEventListener("keydown",this._onKeyDown,!1),t.window.document.removeEventListener("mouseup",this._onMouseUp,!1),this._container.classList.remove("mapboxgl-crosshair"),this._box&&(i.remove(this._box),this._box=null),i.enableDrag(),delete this._startPos,delete this._lastPos},Mr.prototype._fireEvent=function(e,i){return this._map.fire(new t.Event(e,{originalEvent:i}))};var Er=t.bezier(0,0,.25,1),kr=function(e,i){this._map=e,this._el=i.element||e.getCanvasContainer(),this._state="disabled",this._button=i.button||"right",this._bearingSnap=i.bearingSnap||0,this._pitchWithRotate=!1!==i.pitchWithRotate,this._clickTolerance=i.clickTolerance||1,t.bindAll(["onMouseDown","_onMouseMove","_onMouseUp","_onBlur","_onDragFrame"],this)};kr.prototype.isEnabled=function(){return"disabled"!==this._state},kr.prototype.isActive=function(){return"active"===this._state},kr.prototype.enable=function(){this.isEnabled()||(this._state="enabled")},kr.prototype.disable=function(){if(this.isEnabled())switch(this._state){case"active":this._state="disabled",this._unbind(),this._deactivate(),this._fireEvent("rotateend"),this._pitchWithRotate&&this._fireEvent("pitchend"),this._fireEvent("moveend");break;case"pending":this._state="disabled",this._unbind();break;default:this._state="disabled"}},kr.prototype.onMouseDown=function(e){if("enabled"===this._state){var r="touchstart"===e.type;if(r)this._startTime=Date.now();else if("right"===this._button){if(this._eventButton=i.mouseButton(e),e.altKey||e.metaKey)return;if(this._eventButton!==(e.ctrlKey?0:2))return}else{if(e.ctrlKey||0!==i.mouseButton(e))return;this._eventButton=0}i.disableDrag(),r?(t.window.document.addEventListener("touchmove",this._onMouseMove,{capture:!0}),t.window.document.addEventListener("touchend",this._onMouseUp)):(t.window.document.addEventListener("mousemove",this._onMouseMove,{capture:!0}),t.window.document.addEventListener("mouseup",this._onMouseUp)),t.window.addEventListener("blur",this._onBlur),this._state="pending",this._inertia=[[t.browser.now(),this._map.getBearing()]],this._startPos=this._prevPos=this._lastPos=i.mousePos(this._el,e),this._center=this._map.transform.centerPoint,e.preventDefault()}},kr.prototype._onMouseMove=function(t){var e=i.mousePos(this._el,t);this._lastPos.equals(e)||"pending"===this._state&&e.dist(this._startPos)<this._clickTolerance||(this._lastMoveEvent=t,this._lastPos=e,"pending"===this._state&&(this._state="active",this._fireEvent("rotatestart",t),this._fireEvent("movestart",t),this._pitchWithRotate&&this._fireEvent("pitchstart",t)),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onDragFrame)))},kr.prototype._onDragFrame=function(){this._frameId=null;var e=this._lastMoveEvent;if(e){var i=this._map.transform,r=this._prevPos,n=this._lastPos,a=i.bearing-.8*(r.x-n.x),o=i.pitch- -.5*(r.y-n.y),s=this._inertia,l=s[s.length-1];this._drainInertiaBuffer(),s.push([t.browser.now(),this._map._normalizeBearing(a,l[1])]);var u=i.bearing;if(i.bearing=a,this._pitchWithRotate){var h=i.pitch;i.pitch=o,i.pitch!==h&&this._fireEvent("pitch",e)}i.bearing!==u&&this._fireEvent("rotate",e),this._fireEvent("move",e),delete this._lastMoveEvent,this._prevPos=this._lastPos}},kr.prototype._onMouseUp=function(t){var e="touchend"===t.type;if(e&&this._startPos===this._lastPos&&Date.now()-this._startTime<300&&this._el.click(),e||i.mouseButton(t)===this._eventButton)switch(this._state){case"active":this._state="enabled",i.suppressClick(),this._unbind(),this._deactivate(),this._inertialRotate(t);break;case"pending":this._state="enabled",this._unbind()}},kr.prototype._onBlur=function(t){switch(this._state){case"active":this._state="enabled",this._unbind(),this._deactivate(),this._fireEvent("rotateend",t),this._pitchWithRotate&&this._fireEvent("pitchend",t),this._fireEvent("moveend",t);break;case"pending":this._state="enabled",this._unbind()}},kr.prototype._unbind=function(){t.window.document.removeEventListener("mousemove",this._onMouseMove,{capture:!0}),t.window.document.removeEventListener("mouseup",this._onMouseUp),t.window.document.removeEventListener("touchmove",this._onMouseMove,{capture:!0}),t.window.document.removeEventListener("touchend",this._onMouseUp),t.window.removeEventListener("blur",this._onBlur),i.enableDrag()},kr.prototype._deactivate=function(){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),delete this._lastMoveEvent,delete this._startPos,delete this._prevPos,delete this._lastPos},kr.prototype._inertialRotate=function(t){var e=this;this._fireEvent("rotateend",t),this._drainInertiaBuffer();var i=this._map,r=i.getBearing(),n=this._inertia,a=function(){Math.abs(r)<e._bearingSnap?i.resetNorth({noMoveStart:!0},{originalEvent:t}):e._fireEvent("moveend",t),e._pitchWithRotate&&e._fireEvent("pitchend",t)};if(n.length<2)a();else{var o=n[0],s=n[n.length-1],l=i._normalizeBearing(r,n[n.length-2][1]),u=s[1]-o[1],h=u<0?-1:1,c=(s[0]-o[0])/1e3;if(0!==u&&0!==c){var p=Math.abs(u*(.25/c));p>180&&(p=180);var f=p/180;l+=h*p*(f/2),Math.abs(i._normalizeBearing(l,0))<this._bearingSnap&&(l=i._normalizeBearing(0,l)),i.rotateTo(l,{duration:1e3*f,easing:Er,noMoveStart:!0},{originalEvent:t})}else a()}},kr.prototype._fireEvent=function(e,i){return this._map.fire(new t.Event(e,i?{originalEvent:i}:{}))},kr.prototype._drainInertiaBuffer=function(){for(var e=this._inertia,i=t.browser.now();e.length>0&&i-e[0][0]>160;)e.shift()};var Tr={linearity:.3,easing:t.bezier(0,0,.3,1),maxSpeed:1400,deceleration:2500},Ir=function(e,i){this._map=e,this._el=e.getCanvasContainer(),this._state="disabled",this._clickTolerance=i.clickTolerance||1,this._inertiaOptions=Tr,t.bindAll(["_onMove","_onMouseUp","_onTouchEnd","_onBlur","_onDragFrame"],this)};Ir.prototype.isEnabled=function(){return"disabled"!==this._state},Ir.prototype.isActive=function(){return"active"===this._state},Ir.prototype.enable=function(e){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-drag-pan"),this._state="enabled",this._inertiaOptions=t.extend(Tr,e))},Ir.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"}},Ir.prototype.onMouseDown=function(e){"enabled"===this._state&&(e.ctrlKey||0!==i.mouseButton(e)||(i.addEventListener(t.window.document,"mousemove",this._onMove,{capture:!0}),i.addEventListener(t.window.document,"mouseup",this._onMouseUp),this._start(e)))},Ir.prototype.onTouchStart=function(e){this.isEnabled()&&(e.touches&&e.touches.length>1&&("pending"===this._state||"active"===this._state)||(i.addEventListener(t.window.document,"touchmove",this._onMove,{capture:!0,passive:!1}),i.addEventListener(t.window.document,"touchend",this._onTouchEnd),this._start(e)))},Ir.prototype._start=function(e){t.window.addEventListener("blur",this._onBlur),this._state="pending",this._startPos=this._mouseDownPos=this._prevPos=this._lastPos=i.mousePos(this._el,e),this._startTouch=this._lastTouch=t.window.TouchEvent&&e instanceof t.window.TouchEvent?i.touchPos(this._el,e):null,this._inertia=[[t.browser.now(),this._startPos]]},Ir.prototype._touchesMatch=function(t,e){return!(!t||!e||t.length!==e.length)&&t.every(function(t,i){return e[i]===t})},Ir.prototype._onMove=function(e){e.preventDefault();var r=t.window.TouchEvent&&e instanceof t.window.TouchEvent?i.touchPos(this._el,e):null,n=i.mousePos(this._el,e);(r?this._touchesMatch(this._lastTouch,r):this._lastPos.equals(n))||"pending"===this._state&&n.dist(this._mouseDownPos)<this._clickTolerance||(this._lastMoveEvent=e,this._lastPos=n,this._lastTouch=r,this._drainInertiaBuffer(),this._inertia.push([t.browser.now(),this._lastPos]),"pending"===this._state&&(this._state="active",this._shouldStart=!0),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onDragFrame)))},Ir.prototype._onDragFrame=function(){this._frameId=null;var t=this._lastMoveEvent;if(t)if(this._map.touchZoomRotate.isActive())this._abort(t);else if(this._shouldStart&&(this._fireEvent("dragstart",t),this._fireEvent("movestart",t),this._shouldStart=!1),this.isActive()){var e=this._map.transform;e.setLocationAtPoint(e.pointLocation(this._prevPos),this._lastPos),this._fireEvent("drag",t),this._fireEvent("move",t),this._prevPos=this._lastPos,delete this._lastMoveEvent}},Ir.prototype._onMouseUp=function(t){if(0===i.mouseButton(t))switch(this._state){case"active":this._state="enabled",i.suppressClick(),this._unbind(),this._deactivate(),this._inertialPan(t);break;case"pending":this._state="enabled",this._unbind()}},Ir.prototype._onTouchEnd=function(t){if(t.touches&&0!==t.touches.length)switch(this._state){case"pending":case"active":break;case"enabled":this.onTouchStart(t)}else switch(this._state){case"active":this._state="enabled",this._unbind(),this._deactivate(),this._inertialPan(t);break;case"pending":this._state="enabled",this._unbind();break;case"enabled":this._unbind()}},Ir.prototype._abort=function(e){switch(this._state){case"active":this._state="enabled",this._shouldStart||(this._fireEvent("dragend",e),this._fireEvent("moveend",e)),this._unbind(),this._deactivate(),t.window.TouchEvent&&e instanceof t.window.TouchEvent&&e.touches.length>1&&i.addEventListener(t.window.document,"touchend",this._onTouchEnd);break;case"pending":this._state="enabled",this._unbind();break;case"enabled":this._unbind()}},Ir.prototype._onBlur=function(t){this._abort(t)},Ir.prototype._unbind=function(){i.removeEventListener(t.window.document,"touchmove",this._onMove,{capture:!0,passive:!1}),i.removeEventListener(t.window.document,"touchend",this._onTouchEnd),i.removeEventListener(t.window.document,"mousemove",this._onMove,{capture:!0}),i.removeEventListener(t.window.document,"mouseup",this._onMouseUp),i.removeEventListener(t.window,"blur",this._onBlur)},Ir.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},Ir.prototype._inertialPan=function(t){this._fireEvent("dragend",t),this._drainInertiaBuffer();var e=this._inertia;if(e.length<2)this._fireEvent("moveend",t);else{var i=e[e.length-1],r=e[0],n=i[1].sub(r[1]),a=(i[0]-r[0])/1e3;if(0===a||i[1].equals(r[1]))this._fireEvent("moveend",t);else{var o=this._inertiaOptions,s=o.linearity,l=o.easing,u=o.maxSpeed,h=o.deceleration,c=n.mult(s/a),p=c.mag();p>u&&(p=u,c._unit()._mult(p));var f=p/(h*s),d=c.mult(-f/2);this._map.panBy(d,{duration:1e3*f,easing:l,noMoveStart:!0},{originalEvent:t})}}},Ir.prototype._fireEvent=function(e,i){return this._map.fire(new t.Event(e,i?{originalEvent:i}:{}))},Ir.prototype._drainInertiaBuffer=function(){for(var e=this._inertia,i=t.browser.now();e.length>0&&i-e[0][0]>160;)e.shift()};var Cr=function(e){this._map=e,this._el=e.getCanvasContainer(),t.bindAll(["_onKeyDown"],this)};function Ar(t){return t*(2-t)}Cr.prototype.isEnabled=function(){return!!this._enabled},Cr.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("keydown",this._onKeyDown,!1),this._enabled=!0)},Cr.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("keydown",this._onKeyDown),this._enabled=!1)},Cr.prototype._onKeyDown=function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e=0,i=0,r=0,n=0,a=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?i=-1:(t.preventDefault(),n=-1);break;case 39:t.shiftKey?i=1:(t.preventDefault(),n=1);break;case 38:t.shiftKey?r=1:(t.preventDefault(),a=-1);break;case 40:t.shiftKey?r=-1:(a=1,t.preventDefault());break;default:return}var o=this._map,s=o.getZoom(),l={duration:300,delayEndEvents:500,easing:Ar,zoom:e?Math.round(s)+e*(t.shiftKey?2:1):s,bearing:o.getBearing()+15*i,pitch:o.getPitch()+10*r,offset:[100*-n,100*-a],center:o.getCenter()};o.easeTo(l,{originalEvent:t})}};var Pr=function(e){this._map=e,t.bindAll(["_onDblClick","_onZoomEnd"],this)};Pr.prototype.isEnabled=function(){return!!this._enabled},Pr.prototype.isActive=function(){return!!this._active},Pr.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},Pr.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Pr.prototype.onTouchStart=function(t){var e=this;if(this.isEnabled()&&!(t.points.length>1))if(this._tapped){var i=this._tappedPoint;if(i&&i.dist(t.points[0])<=30){t.originalEvent.preventDefault();var r=function(){e._tapped&&e._zoom(t),e._map.off("touchcancel",n),e._resetTapped()},n=function(){e._map.off("touchend",r),e._resetTapped()};this._map.once("touchend",r),this._map.once("touchcancel",n)}else this._resetTapped()}else this._tappedPoint=t.points[0],this._tapped=setTimeout(function(){e._tapped=null,e._tappedPoint=null},300)},Pr.prototype._resetTapped=function(){clearTimeout(this._tapped),this._tapped=null,this._tappedPoint=null},Pr.prototype.onDblClick=function(t){this.isEnabled()&&(t.originalEvent.preventDefault(),this._zoom(t))},Pr.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)},Pr.prototype._onZoomEnd=function(){this._active=!1,this._map.off("zoomend",this._onZoomEnd)};var Lr=t.bezier(0,0,.15,1),zr=function(e){this._map=e,this._el=e.getCanvasContainer(),t.bindAll(["_onMove","_onEnd","_onTouchFrame"],this)};zr.prototype.isEnabled=function(){return!!this._enabled},zr.prototype.enable=function(t){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-zoom-rotate"),this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around)},zr.prototype.disable=function(){this.isEnabled()&&(this._el.classList.remove("mapboxgl-touch-zoom-rotate"),this._enabled=!1)},zr.prototype.disableRotation=function(){this._rotationDisabled=!0},zr.prototype.enableRotation=function(){this._rotationDisabled=!1},zr.prototype.isActive=function(){return this.isEnabled()&&!!this._gestureIntent},zr.prototype.onStart=function(e){if(this.isEnabled()&&2===e.touches.length){var r=i.mousePos(this._el,e.touches[0]),n=i.mousePos(this._el,e.touches[1]),a=r.add(n).div(2);this._startVec=r.sub(n),this._startAround=this._map.transform.pointLocation(a),this._gestureIntent=void 0,this._inertia=[],i.addEventListener(t.window.document,"touchmove",this._onMove,{passive:!1}),i.addEventListener(t.window.document,"touchend",this._onEnd)}},zr.prototype._getTouchEventData=function(t){var e=i.mousePos(this._el,t.touches[0]),r=i.mousePos(this._el,t.touches[1]),n=e.sub(r);return{vec:n,center:e.add(r).div(2),scale:n.mag()/this._startVec.mag(),bearing:this._rotationDisabled?0:180*n.angleWith(this._startVec)/Math.PI}},zr.prototype._onMove=function(e){if(2===e.touches.length){var i=this._getTouchEventData(e),r=i.vec,n=i.scale,a=i.bearing;if(!this._gestureIntent){var o=this._rotationDisabled&&1!==n||Math.abs(1-n)>.15;Math.abs(a)>10?this._gestureIntent="rotate":o&&(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=r)}this._lastTouchEvent=e,this._frameId||(this._frameId=this._map._requestRenderFrame(this._onTouchFrame)),e.preventDefault()}},zr.prototype._onTouchFrame=function(){this._frameId=null;var e=this._gestureIntent;if(e){var i=this._map.transform;this._startScale||(this._startScale=i.scale,this._startBearing=i.bearing);var r=this._getTouchEventData(this._lastTouchEvent),n=r.center,a=r.bearing,o=r.scale,s=i.pointLocation(n),l=i.locationPoint(s);"rotate"===e&&(i.bearing=this._startBearing+a),i.zoom=i.scaleZoom(this._startScale*o),i.setLocationAtPoint(this._startAround,l),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(),o,n])}},zr.prototype._onEnd=function(e){i.removeEventListener(t.window.document,"touchmove",this._onMove,{passive:!1}),i.removeEventListener(t.window.document,"touchend",this._onEnd);var r=this._gestureIntent,n=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,r){this._map.fire(new t.Event(r+"end",{originalEvent:e})),this._drainInertiaBuffer();var a=this._inertia,o=this._map;if(a.length<2)o.snapToNorth({},{originalEvent:e});else{var s=a[a.length-1],l=a[0],u=o.transform.scaleZoom(n*s[1]),h=o.transform.scaleZoom(n*l[1]),c=(s[0]-l[0])/1e3,p=s[2];if(0!==c&&u!==h){var f=.15*(u-h)/c;Math.abs(f)>2.5&&(f=f>0?2.5:-2.5);var d=1e3*Math.abs(f/(12*.15));o.easeTo({zoom:u+f*d/2e3,duration:d,easing:Lr,around:this._aroundCenter?o.getCenter():o.unproject(p),noMoveStart:!0},{originalEvent:e})}else o.snapToNorth({},{originalEvent:e})}}},zr.prototype._drainInertiaBuffer=function(){for(var e=this._inertia,i=t.browser.now();e.length>2&&i-e[0][0]>160;)e.shift()};var Dr={scrollZoom:Sr,boxZoom:Mr,dragRotate:kr,dragPan:Ir,keyboard:Cr,doubleClickZoom:Pr,touchZoomRotate:zr},Rr=function(e){function i(i,r){e.call(this),this._moving=!1,this._zooming=!1,this.transform=i,this._bearingSnap=r.bearingSnap,t.bindAll(["_renderFrameCallback"],this)}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.getCenter=function(){return new t.LngLat(this.transform.center.lng,this.transform.center.lat)},i.prototype.setCenter=function(t,e){return this.jumpTo({center:t},e)},i.prototype.panBy=function(e,i,r){return e=t.Point.convert(e).mult(-1),this.panTo(this.transform.center,t.extend({offset:e},i),r)},i.prototype.panTo=function(e,i,r){return this.easeTo(t.extend({center:e},i),r)},i.prototype.getZoom=function(){return this.transform.zoom},i.prototype.setZoom=function(t,e){return this.jumpTo({zoom:t},e),this},i.prototype.zoomTo=function(e,i,r){return this.easeTo(t.extend({zoom:e},i),r)},i.prototype.zoomIn=function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},i.prototype.zoomOut=function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},i.prototype.getBearing=function(){return this.transform.bearing},i.prototype.setBearing=function(t,e){return this.jumpTo({bearing:t},e),this},i.prototype.getPadding=function(){return this.transform.padding},i.prototype.setPadding=function(t,e){return this.jumpTo({padding:t},e),this},i.prototype.rotateTo=function(e,i,r){return this.easeTo(t.extend({bearing:e},i),r)},i.prototype.resetNorth=function(e,i){return this.rotateTo(0,t.extend({duration:1e3},e),i),this},i.prototype.resetNorthPitch=function(e,i){return this.easeTo(t.extend({bearing:0,pitch:0,duration:1e3},e),i),this},i.prototype.snapToNorth=function(t,e){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,e):this},i.prototype.getPitch=function(){return this.transform.pitch},i.prototype.setPitch=function(t,e){return this.jumpTo({pitch:t},e),this},i.prototype.cameraForBounds=function(e,i){return e=t.LngLatBounds.convert(e),this._cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),0,i)},i.prototype._cameraForBoxAndBearing=function(e,i,r,n){var a={top:0,bottom:0,right:0,left:0};if("number"==typeof(n=t.extend({padding:a,offset:[0,0],maxZoom:this.transform.maxZoom},n)).padding){var o=n.padding;n.padding={top:o,bottom:o,right:o,left:o}}n.padding=t.extend(a,n.padding);var s=this.transform,l=s.padding,u=s.project(t.LngLat.convert(e)),h=s.project(t.LngLat.convert(i)),c=u.rotate(-r*Math.PI/180),p=h.rotate(-r*Math.PI/180),f=new t.Point(Math.max(c.x,p.x),Math.max(c.y,p.y)),d=new t.Point(Math.min(c.x,p.x),Math.min(c.y,p.y)),y=f.sub(d),m=(s.width-(l.left+l.right+n.padding.left+n.padding.right))/y.x,v=(s.height-(l.top+l.bottom+n.padding.top+n.padding.bottom))/y.y;if(!(v<0||m<0)){var g=Math.min(s.scaleZoom(s.scale*Math.min(m,v)),n.maxZoom),_=t.Point.convert(n.offset),x=new t.Point(_.x+(n.padding.left-n.padding.right)/2,_.y+(n.padding.top-n.padding.bottom)/2).mult(s.scale/s.zoomScale(g));return{center:s.unproject(u.add(h).div(2).sub(x)),zoom:g,bearing:r}}t.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.")},i.prototype.fitBounds=function(t,e,i){return this._fitInternal(this.cameraForBounds(t,e),e,i)},i.prototype.fitScreenCoordinates=function(e,i,r,n,a){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(t.Point.convert(e)),this.transform.pointLocation(t.Point.convert(i)),r,n),n,a)},i.prototype._fitInternal=function(e,i,r){return e?(i=t.extend(e,i)).linear?this.easeTo(i,r):this.flyTo(i,r):this},i.prototype.jumpTo=function(e,i){this.stop();var r=this.transform,n=!1,a=!1,o=!1;return"zoom"in e&&r.zoom!==+e.zoom&&(n=!0,r.zoom=+e.zoom),void 0!==e.center&&(r.center=t.LngLat.convert(e.center)),"bearing"in e&&r.bearing!==+e.bearing&&(a=!0,r.bearing=+e.bearing),"pitch"in e&&r.pitch!==+e.pitch&&(o=!0,r.pitch=+e.pitch),null==e.padding||r.isPaddingEqual(e.padding)||(r.padding=e.padding),this.fire(new t.Event("movestart",i)).fire(new t.Event("move",i)),n&&this.fire(new t.Event("zoomstart",i)).fire(new t.Event("zoom",i)).fire(new t.Event("zoomend",i)),a&&this.fire(new t.Event("rotatestart",i)).fire(new t.Event("rotate",i)).fire(new t.Event("rotateend",i)),o&&this.fire(new t.Event("pitchstart",i)).fire(new t.Event("pitch",i)).fire(new t.Event("pitchend",i)),this.fire(new t.Event("moveend",i))},i.prototype.easeTo=function(e,i){var r=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 n=this.transform,a=this.getZoom(),o=this.getBearing(),s=this.getPitch(),l=this.getPadding(),u="zoom"in e?+e.zoom:a,h="bearing"in e?this._normalizeBearing(e.bearing,o):o,c="pitch"in e?+e.pitch:s,p="padding"in e?e.padding:n.padding,f=t.Point.convert(e.offset),d=n.centerPoint.add(f),y=n.pointLocation(d),m=t.LngLat.convert(e.center||y);this._normalizeCenter(m);var v,g,_=n.project(y),x=n.project(m).sub(_),b=n.zoomScale(u-a);return e.around&&(v=t.LngLat.convert(e.around),g=n.locationPoint(v)),this._zooming=u!==a,this._rotating=o!==h,this._pitching=c!==s,this._padding=!n.isPaddingEqual(p),this._prepareEase(i,e.noMoveStart),clearTimeout(this._easeEndTimeoutID),this._ease(function(e){if(r._zooming&&(n.zoom=t.number(a,u,e)),r._rotating&&(n.bearing=t.number(o,h,e)),r._pitching&&(n.pitch=t.number(s,c,e)),r._padding&&(n.interpolatePadding(l,p,e),d=n.centerPoint.add(f)),v)n.setLocationAtPoint(v,g);else{var y=n.zoomScale(n.zoom-a),m=u>a?Math.min(2,b):Math.max(.5,b),w=Math.pow(m,1-e),S=n.unproject(_.add(x.mult(e*w)).mult(y));n.setLocationAtPoint(n.renderWorldCopies?S.wrap():S,d)}r._fireMoveEvents(i)},function(){e.delayEndEvents?r._easeEndTimeoutID=setTimeout(function(){return r._afterEase(i)},e.delayEndEvents):r._afterEase(i)},e),this},i.prototype._prepareEase=function(e,i){this._moving=!0,i||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))},i.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))},i.prototype._afterEase=function(e){var i=this._zooming,r=this._rotating,n=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,i&&this.fire(new t.Event("zoomend",e)),r&&this.fire(new t.Event("rotateend",e)),n&&this.fire(new t.Event("pitchend",e)),this.fire(new t.Event("moveend",e))},i.prototype.flyTo=function(e,i){var r=this;if(!e.essential&&t.browser.prefersReducedMotion){var n=t.pick(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(n,i)}this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);var a=this.transform,o=this.getZoom(),s=this.getBearing(),l=this.getPitch(),u=this.getPadding(),h="zoom"in e?t.clamp(+e.zoom,a.minZoom,a.maxZoom):o,c="bearing"in e?this._normalizeBearing(e.bearing,s):s,p="pitch"in e?+e.pitch:l,f="padding"in e?e.padding:a.padding,d=a.zoomScale(h-o),y=t.Point.convert(e.offset),m=a.centerPoint.add(y),v=a.pointLocation(m);e.center&&e.center.length>=2&&(0==e.center[0]&&(e.center[0]=1e-6),0==e.center[1]&&(e.center[1]=1e-6));var g=t.LngLat.convert(e.center||v);this._normalizeCenter(g);var _=a.project(v),x=a.project(g).sub(_),b=e.curve,w=Math.max(a.width,a.height),S=w/d,M=x.mag();if("minZoom"in e){var E=t.clamp(Math.min(e.minZoom,o,h),a.minZoom,a.maxZoom),k=w/a.zoomScale(E-o);b=Math.sqrt(k/M*2)}var T=b*b;function I(t){var e=(S*S-w*w+(t?-1:1)*T*T*M*M)/(2*(t?S:w)*T*M);return Math.log(Math.sqrt(e*e+1)-e)}function C(t){return(Math.exp(t)-Math.exp(-t))/2}function A(t){return(Math.exp(t)+Math.exp(-t))/2}var P=I(0),L=function(t){return A(P)/A(P+b*t)},z=function(t){return w*((A(P)*(C(e=P+b*t)/A(e))-C(P))/T)/M;var e},D=(I(1)-P)/b;if(Math.abs(M)<1e-6||!isFinite(D)){if(Math.abs(w-S)<1e-6)return this.easeTo(e,i);var R=S<w?-1:1;D=Math.abs(Math.log(S/w))/b,z=function(){return 0},L=function(t){return Math.exp(R*b*t)}}return e.duration="duration"in e?+e.duration:1e3*D/("screenSpeed"in e?+e.screenSpeed/b:+e.speed),e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=s!==c,this._pitching=p!==l,this._padding=!a.isPaddingEqual(f),this._prepareEase(i,!1),this._ease(function(e){var n=e*D,d=1/L(n);a.zoom=1===e?h:o+a.scaleZoom(d),r._rotating&&(a.bearing=t.number(s,c,e)),r._pitching&&(a.pitch=t.number(l,p,e)),r._padding&&(a.interpolatePadding(u,f,e),m=a.centerPoint.add(y));var v=1===e?g:a.unproject(_.add(x.mult(z(n))).mult(d));a.setLocationAtPoint(a.renderWorldCopies?v.wrap():v,m),r._fireMoveEvents(i)},function(){return r._afterEase(i)},e),this},i.prototype.isEasing=function(){return!!this._easeFrameId},i.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},i.prototype._ease=function(e,i,r){!1===r.animate||0===r.duration?(e(1),i()):(this._easeStart=t.browser.now(),this._easeOptions=r,this._onEaseFrame=e,this._onEaseEnd=i,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},i.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()},i.prototype._normalizeBearing=function(e,i){e=t.wrap(e,-180,180);var r=Math.abs(e-i);return Math.abs(e-360-i)<r&&(e-=360),Math.abs(e+360-i)<r&&(e+=360),e},i.prototype._normalizeCenter=function(t){var e=this.transform;if(e.renderWorldCopies&&!e.lngRange){var i=t.lng-e.center.lng;t.lng+=i>180?-360:i<-180?360:0}},i}(t.Evented),Or=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_updateEditLink","_updateData","_updateCompact"],this)};Or.prototype.getDefaultPosition=function(){return"bottom-right"},Or.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=i.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._innerContainer=i.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},Or.prototype.onRemove=function(){i.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},Or.prototype._updateEditLink=function(){var e=this._editLink;e||(e=this._editLink=this._container.querySelector(".mapbox-improve-map"));var i=[{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 r=i.reduce(function(t,e,r){return e.value&&(t+=e.key+"="+e.value+(r<i.length-1?"&":"")),t},"?");e.href=t.config.FEEDBACK_URL+"/"+r+(this._map._hash?this._map._hash.getHashString(!0):""),e.rel="noopener nofollow"}},Or.prototype._updateData=function(t){!t||"metadata"!==t.sourceDataType&&"style"!==t.dataType||(this._updateAttributions(),this._updateEditLink())},Or.prototype._updateAttributions=function(){if(this._map.style){var t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map(function(t){return"string"!=typeof t?"":t})):"string"==typeof this.options.customAttribution&&t.push(this.options.customAttribution)),this._map.style.stylesheet){var e=this._map.style.stylesheet;this.styleOwner=e.owner,this.styleId=e.id}var i=this._map.style.sourceCaches;for(var r in i){var n=i[r];if(n.used){var a=n.getSource();a.attribution&&t.indexOf(a.attribution)<0&&t.push(a.attribution)}}t.sort(function(t,e){return t.length-e.length});var o=(t=t.filter(function(e,i){for(var r=i+1;r<t.length;r++)if(t[r].indexOf(e)>=0)return!1;return!0})).join(" | ");o!==this._attribHTML&&(this._attribHTML=o,t.length?(this._innerContainer.innerHTML=o,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},Or.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact")};var Br=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this)};Br.prototype.onAdd=function(t){this._map=t,this._container=i.create("div","mapboxgl-ctrl");var e=i.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},Br.prototype.onRemove=function(){i.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},Br.prototype.getDefaultPosition=function(){return"bottom-left"},Br.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},Br.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}},Br.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 Fr=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};Fr.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},Fr.prototype.remove=function(t){for(var e=this._currentlyRunning,i=0,r=e?this._queue.concat(e):this._queue;i<r.length;i+=1){var n=r[i];if(n.id===t)return void(n.cancelled=!0)}},Fr.prototype.run=function(){var t=this._currentlyRunning=this._queue;this._queue=[];for(var e=0,i=t;e<i.length;e+=1){var r=i[e];if(!r.cancelled&&(r.callback(),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1},Fr.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]};var Vr={"FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm"},Ur=t.window.HTMLImageElement,jr=t.window.HTMLElement,Nr=t.window.ImageBitmap,qr={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,bearingSnap:7,clickTolerance:3,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",transformRequest:null,accessToken:null,fadeDuration:300,crossSourceCollisions:!0},Gr=function(r){function n(e){var n=this;if(null!=(e=t.extend({},qr,e)).minZoom&&null!=e.maxZoom&&e.minZoom>e.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=e.minPitch&&null!=e.maxPitch&&e.minPitch>e.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=e.minPitch&&e.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=e.maxPitch&&e.maxPitch>60)throw new Error("maxPitch must be less than or equal to 60");var a=t.CRS.createCRS(e.crs);a||(a=t.CRS.EPSG3857);var o=new vr(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies,a);r.call(this,o,e),this.crs=a,this.setCRS(a),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 Fr,this._controls=[],this._mapId=t.uniqueId(),this._locale=t.extend({},Vr,e.locale);var s=this;if(this._requestManager=new t.RequestManager(e.transformRequest?e.transformRequest:function(t,e,i){var r={},n=i||s._requestManager._requestParams;if(n&&"POST"===n.method){if(r.url=t,r.method="POST",n.headers?n.headers["Content-Type"]||(n.headers["Content-Type"]="application/x-www-form-urlencoded"):n.headers={"Content-Type":"application/x-www-form-urlencoded"},n.headers&&n.headers["Content-Type"])if("application/form-data"===n.headers["Content-Type"]){var a=new FormData;for(var o in n.data)a.append(o,n.data[o]);r.body=a}else{var l="";for(var u in n.data)l+=u+"="+n.data[u]+"&";r.body=l.substring(0,l.length-1)}}else{r.url=t;var h=r.url.indexOf("?")>-1;if(n&&n.data)for(var c in n.data)r.url+=h?"&":"?",r.url+=c+"="+n.data[c];r.method="GET"}return n&&n.headers&&(r.headers=n.headers),r},e.accessToken),this._requestManager._requestParams=e.requestParams,"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 jr))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 n._update(!1)}),this.on("moveend",function(){return n._update(!1)}),this.on("zoom",function(){return n._update(!0)}),void 0!==t.window&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1)),function(t,e){var r=t.getCanvasContainer(),n=null,a=!1,o=null;for(var s in Dr)t[s]=new Dr[s](t,e),e.interactive&&e[s]&&t[s].enable(e[s]);i.addEventListener(r,"mouseout",function(e){t.fire(new xr("mouseout",t,e))}),i.addEventListener(r,"mousedown",function(n){a=!0,o=i.mousePos(r,n);var s=new xr("mousedown",t,n);t.fire(s),s.defaultPrevented||(e.interactive&&!t.doubleClickZoom.isActive()&&t.stop(),t.boxZoom.onMouseDown(n),t.boxZoom.isActive()||t.dragPan.isActive()||t.dragRotate.onMouseDown(n),t.boxZoom.isActive()||t.dragRotate.isActive()||t.dragPan.onMouseDown(n))}),i.addEventListener(r,"mouseup",function(e){var i=t.dragRotate.isActive();n&&!i&&t.fire(new xr("contextmenu",t,n)),n=null,a=!1,t.fire(new xr("mouseup",t,e))}),i.addEventListener(r,"mousemove",function(e){if(!t.dragPan.isActive()&&!t.dragRotate.isActive()){for(var i=e.target;i&&i!==r;)i=i.parentNode;i===r&&t.fire(new xr("mousemove",t,e))}}),i.addEventListener(r,"mouseover",function(e){for(var i=e.target;i&&i!==r;)i=i.parentNode;i===r&&t.fire(new xr("mouseover",t,e))}),i.addEventListener(r,"touchstart",function(i){var r=new br("touchstart",t,i);t.fire(r),r.defaultPrevented||(e.interactive&&t.stop(),t.boxZoom.isActive()||t.dragRotate.isActive()||t.dragPan.onTouchStart(i),t.touchZoomRotate.onStart(i),t.doubleClickZoom.onTouchStart(r))},{passive:!1}),i.addEventListener(r,"touchmove",function(e){t.fire(new br("touchmove",t,e))},{passive:!1}),i.addEventListener(r,"touchend",function(e){t.fire(new br("touchend",t,e))}),i.addEventListener(r,"touchcancel",function(e){t.fire(new br("touchcancel",t,e))}),i.addEventListener(r,"click",function(n){var a=i.mousePos(r,n);(!o||a.equals(o)||a.dist(o)<e.clickTolerance)&&t.fire(new xr("click",t,n))}),i.addEventListener(r,"dblclick",function(e){var i=new xr("dblclick",t,e);t.fire(i),i.defaultPrevented||t.doubleClickZoom.onDblClick(i)}),i.addEventListener(r,"contextmenu",function(e){var i=t.dragRotate.isActive();a||i?a&&(n=e):t.fire(new xr("contextmenu",t,e)),(t.dragRotate.isEnabled()||t.listens("contextmenu"))&&e.preventDefault()}),i.addEventListener(r,"wheel",function(i){e.interactive&&t.stop();var r=new wr("wheel",t,i);t.fire(r),r.defaultPrevented||t.scrollZoom.onWheel(i)},{passive:!1})}(this,e),this._hash=e.hash&&new _r("string"==typeof e.hash&&e.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),e.bounds&&(this.resize(),this.fitBounds(e.bounds,t.extend({},e.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=e.localIdeographFontFamily,e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new Or({customAttribution:e.customAttribution})),this.addControl(new Br,e.logoPosition),this.on("style.load",function(){n.transform.unmodified&&n.jumpTo(n.style.stylesheet)}),this.on("data",function(e){n._update("style"===e.dataType),n.fire(new t.Event(e.dataType+"data",e))}),this.on("dataloading",function(e){n.fire(new t.Event(e.dataType+"dataloading",e))}),this.overlayLayersManager={}}r&&(n.__proto__=r),(n.prototype=Object.create(r&&r.prototype)).constructor=n;var a={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return n.prototype._getMapId=function(){return this._mapId},n.prototype.addControl=function(e,i){if(void 0===i&&e.getDefaultPosition&&(i=e.getDefaultPosition()),void 0===i&&(i="top-right"),!e||!e.onAdd)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var r=e.onAdd(this);this._controls.push(e);var n=this._controlPositions[i];return-1!==i.indexOf("bottom")?n.insertBefore(r,n.firstChild):n.appendChild(r),this},n.prototype.removeControl=function(e){if(!e||!e.onRemove)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var i=this._controls.indexOf(e);return i>-1&&this._controls.splice(i,1),e.onRemove(this),this},n.prototype.resize=function(e){var i=this._containerDimensions(),r=i[0],n=i[1];return this._resizeCanvas(r,n),this.transform.resize(r,n,this.crs),this.painter.resize(r,n),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},n.prototype.getBounds=function(){return this.transform.getBounds()},n.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},n.prototype.setMaxBounds=function(e){return this.transform.setMaxBounds(t.LngLatBounds.convert(e)),this._update()},n.prototype.setMinZoom=function(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()<t&&this.setZoom(t),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")},n.prototype.getMinZoom=function(){return this.transform.minZoom},n.prototype.setMaxZoom=function(t){if((t=null==t?22:t)>=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")},n.prototype.getMaxZoom=function(){return this.transform.maxZoom},n.prototype.setMinPitch=function(t){if((t=null==t?0:t)<0)throw new Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()<t&&this.setPitch(t),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")},n.prototype.getMinPitch=function(){return this.transform.minPitch},n.prototype.setMaxPitch=function(t){if((t=null==t?60:t)>60)throw new Error("maxPitch must be less than or equal to 60");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t&&this.setPitch(t),this;throw new Error("maxPitch must be greater than the current minPitch")},n.prototype.getMaxPitch=function(){return this.transform.maxPitch},n.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},n.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update()},n.prototype.project=function(e){return this.transform.locationPoint(t.LngLat.convert(e))},n.prototype.unproject=function(e){return this.transform.pointLocation(t.Point.convert(e))},n.prototype.isMoving=function(){return this._moving||this.dragPan.isActive()||this.dragRotate.isActive()||this.scrollZoom.isActive()},n.prototype.isZooming=function(){return this._zooming||this.scrollZoom.isZooming()},n.prototype.isRotating=function(){return this._rotating||this.dragRotate.isActive()},n.prototype._createDelegatedListener=function(t,e,i){var r,n=this;if("mouseenter"===t||"mouseover"===t){var a=!1;return{layer:e,listener:i,delegates:{mousemove:function(r){var o=n.getLayer(e)?n.queryRenderedFeatures(r.point,{layers:[e]}):[];o.length?a||(a=!0,i.call(n,new xr(t,n,r.originalEvent,{features:o}))):a=!1},mouseout:function(){a=!1}}}}if("mouseleave"===t||"mouseout"===t){var o=!1;return{layer:e,listener:i,delegates:{mousemove:function(r){(n.getLayer(e)?n.queryRenderedFeatures(r.point,{layers:[e]}):[]).length?o=!0:o&&(o=!1,i.call(n,new xr(t,n,r.originalEvent)))},mouseout:function(e){o&&(o=!1,i.call(n,new xr(t,n,e.originalEvent)))}}}}return{layer:e,listener:i,delegates:(r={},r[t]=function(t){var r=n.getLayer(e)?n.queryRenderedFeatures(t.point,{layers:[e]}):[];r.length&&(t.features=r,i.call(n,t),delete t.features)},r)}},n.prototype.on=function(t,e,i){if(void 0===i)return r.prototype.on.call(this,t,e);var n=this._createDelegatedListener(t,e,i);for(var a in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(n),n.delegates)this.on(a,n.delegates[a]);return this},n.prototype.once=function(t,e,i){if(void 0===i)return r.prototype.once.call(this,t,e);var n=this._createDelegatedListener(t,e,i);for(var a in n.delegates)this.once(a,n.delegates[a]);return this},n.prototype.off=function(t,e,i){var n=this;return void 0===i?r.prototype.off.call(this,t,e):(this._delegatedListeners&&this._delegatedListeners[t]&&function(r){for(var a=r[t],o=0;o<a.length;o++){var s=a[o];if(s.layer===e&&s.listener===i){for(var l in s.delegates)n.off(l,s.delegates[l]);return a.splice(o,1),n}}}(this._delegatedListeners),this)},n.prototype.queryRenderedFeatures=function(e,i){if(!this.style)return[];var r;if(void 0!==i||void 0===e||e instanceof t.Point||Array.isArray(e)||(i=e,e=void 0),i=i||{},(e=e||[[0,0],[this.transform.width,this.transform.height]])instanceof t.Point||"number"==typeof e[0])r=[t.Point.convert(e)];else{var n=t.Point.convert(e[0]),a=t.Point.convert(e[1]);r=[n,new t.Point(a.x,n.y),a,new t.Point(n.x,a.y),n]}return this.style.queryRenderedFeatures(r,i,this.transform)},n.prototype.querySourceFeatures=function(t,e){return this.style.querySourceFeatures(t,e)},n.prototype.setStyle=function(e,i){return!1!==(i=t.extend({},{localIdeographFontFamily:this._localIdeographFontFamily},i)).diff&&i.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&e?(this._diffStyle(e,i),this):(this._localIdeographFontFamily=i.localIdeographFontFamily,this._updateStyle(e,i))},n.prototype._getUIString=function(t){var e=this._locale[t];if(null==e)throw new Error("Missing UI string '"+t+"'");return e},n.prototype._updateStyle=function(t,e){return this.style&&(this.style.setEventedParent(null),this.style._remove()),t?(this.style=new Ue(this,e||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof t?this.style.loadURL(t):this.style.loadJSON(t),this):(delete this.style,this)},n.prototype._lazyInitEmptyStyle=function(){this.style||(this.style=new Ue(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())},n.prototype._diffStyle=function(e,i){var r=this;if("string"==typeof e){var n=this._requestManager.normalizeStyleURL(e),a=this._requestManager.transformRequest(n,t.ResourceType.Style);t.getJSON(a,function(e,n){e?r.fire(new t.ErrorEvent(e)):n&&r._updateDiff(n,i)})}else"object"==typeof e&&this._updateDiff(e,i)},n.prototype._updateDiff=function(e,i){try{this.style.setState(e)&&this._update(!0)}catch(r){t.warnOnce("Unable to perform style diff: "+(r.message||r.error||r)+". Rebuilding the style from scratch."),this._updateStyle(e,i)}},n.prototype.getStyle=function(){if(this.style)return this.style.serialize()},n.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():t.warnOnce("There is no style added to the map.")},n.prototype.addSource=function(t,e){return this._lazyInitEmptyStyle(),this.style.addSource(t,e),this._update(!0)},n.prototype.isSourceLoaded=function(e){var i=this.style&&this.style.sourceCaches[e];if(void 0!==i)return i.loaded();this.fire(new t.ErrorEvent(new Error("There is no source with ID '"+e+"'")))},n.prototype.areTilesLoaded=function(){var t=this.style&&this.style.sourceCaches;for(var e in t){var i=t[e]._tiles;for(var r in i){var n=i[r];if("loaded"!==n.state&&"errored"!==n.state)return!1}}return!0},n.prototype.addSourceType=function(t,e,i){return this._lazyInitEmptyStyle(),this.style.addSourceType(t,e,i)},n.prototype.removeSource=function(t){return this.style.removeSource(t),this._update(!0)},n.prototype.getSource=function(t){return this.style.getSource(t)},n.prototype.addImage=function(e,i,r){void 0===r&&(r={});var n=r.pixelRatio;void 0===n&&(n=1);var a=r.sdf;void 0===a&&(a=!1);var o=r.stretchX,s=r.stretchY,l=r.content;if(this._lazyInitEmptyStyle(),i instanceof Ur||Nr&&i instanceof Nr){var u=t.browser.getImageData(i);this.style.addImage(e,{data:new t.RGBAImage({width:u.width,height:u.height},u.data),pixelRatio:n,stretchX:o,stretchY:s,content:l,sdf:a,version:0})}else{if(void 0===i.width||void 0===i.height)return this.fire(new t.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));var h=i;this.style.addImage(e,{data:new t.RGBAImage({width:i.width,height:i.height},new Uint8Array(i.data)),pixelRatio:n,stretchX:o,stretchY:s,content:l,sdf:a,version:0,userImage:h}),h.onAdd&&h.onAdd(this,e)}},n.prototype.updateImage=function(e,i){var r=this.style.getImage(e);if(!r)return this.fire(new t.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));var n=i instanceof Ur||Nr&&i instanceof Nr?t.browser.getImageData(i):i,a=n.width,o=n.height,s=n.data;return void 0===a||void 0===o?this.fire(new t.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`"))):a!==r.data.width||o!==r.data.height?this.fire(new t.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image"))):(r.data.replace(s,!(i instanceof Ur||Nr&&i instanceof Nr)),void this.style.updateImage(e,r))},n.prototype.hasImage=function(e){return e?!!this.style.getImage(e):(this.fire(new t.ErrorEvent(new Error("Missing required image id"))),!1)},n.prototype.removeImage=function(t){this.style.removeImage(t)},n.prototype.loadImage=function(e,i){t.getImage(this._requestManager.transformRequest(e,t.ResourceType.Image),i)},n.prototype.listImages=function(){return this.style.listImages()},n.prototype.addLayerBak=function(t,e){return this._lazyInitEmptyStyle(),this.style.addLayer(t,e),this._update(!0)},n.prototype._addLayer=function(t,e){t.onAdd&&t.onAdd(e)},n.prototype._removeLayer=function(t){t.removeFromMap&&t.removeFromMap()},n.prototype._setVisibility=function(t,e){t.setVisibility&&t.setVisibility(e)},n.prototype._moveLayer=function(e,i){var r=document.getElementById(e);if(i){var n=document.getElementById(i);n||t.window.mapboxgl.Evented.prototype.fire("error",{error:new Error('Layer with id "'+i+'" does not exist on this document.')})}r&&n?n.parentNode.insertBefore(r,n):r.parentNode.appendChild(r)},n.prototype.addLayer=function(t,e){return t.source||"custom"===t.type||"background"===t.type?(this.addLayerBak(t,e),this):this.overlayLayersManager[t.id]||this.style._layers[t.id]?void this.fire("error",{error:new Error("A layer with this id already exists.")}):(this._addLayer(t,this),this.overlayLayersManager[t.id]=t,this)},n.prototype.moveLayer=function(t,e){return this.overlayLayersManager[t]?(this._moveLayer(t,e),this):this.style._layers[t]?(this.style.moveLayer(t,e),this._update(!0),this):void 0},n.prototype.removeLayer=function(t){return this.overlayLayersManager[t]?(this._removeLayer(this.overlayLayersManager[t]),delete this.overlayLayersManager[t],this):(this.style.removeLayer(t),this._update(!0),this)},n.prototype.getLayer=function(t){return this.overlayLayersManager[t]?this.overlayLayersManager[t]:this.style.getLayer(t)},n.prototype.setLayerZoomRange=function(t,e,i){return this.style.setLayerZoomRange(t,e,i),this._update(!0)},n.prototype.setFilter=function(t,e,i){return void 0===i&&(i={}),this.style.setFilter(t,e,i),this._update(!0)},n.prototype.getFilter=function(t){return this.style.getFilter(t)},n.prototype.setPaintProperty=function(t,e,i,r){return void 0===r&&(r={}),this.style.setPaintProperty(t,e,i,r),this._update(!0)},n.prototype.getPaintProperty=function(t,e){return this.style.getPaintProperty(t,e)},n.prototype.setLayoutProperty=function(t,e,i,r){return void 0===r&&(r={}),this.overlayLayersManager[t]?("visibility"===e&&(this._setVisibility(this.overlayLayersManager[t],i="visible"===i),this.style.fire("data",{dataType:"style"})),this):(this.style.setLayoutProperty(t,e,i,r),this._update(!0),this)},n.prototype.getLayoutProperty=function(t,e){return this.style.getLayoutProperty(t,e)},n.prototype.setLight=function(t,e){return void 0===e&&(e={}),this._lazyInitEmptyStyle(),this.style.setLight(t,e),this._update(!0)},n.prototype.getLight=function(){return this.style.getLight()},n.prototype.setFeatureState=function(t,e){return this.style.setFeatureState(t,e),this._update()},n.prototype.removeFeatureState=function(t,e){return this.style.removeFeatureState(t,e),this._update()},n.prototype.getFeatureState=function(t){return this.style.getFeatureState(t)},n.prototype.getContainer=function(){return this._container},n.prototype.getCanvasContainer=function(){return this._canvasContainer},n.prototype.getCanvas=function(){return this._canvas},n.prototype._containerDimensions=function(){var t=0,e=0;return this._container&&(t=this._container.clientWidth||400,e=this._container.clientHeight||300),[t,e]},n.prototype._detectMissingCSS=function(){"rgb(250, 128, 114)"!==t.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")&&t.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")},n.prototype._setupContainer=function(){var t=this._container;t.classList.add("mapboxgl-map"),(this._missingCSSCanary=i.create("div","mapboxgl-canary",t)).style.visibility="hidden",this._detectMissingCSS();var e=this._canvasContainer=i.create("div","mapboxgl-canvas-container",t);this._interactive&&e.classList.add("mapboxgl-interactive"),this._canvas=i.create("canvas","mapboxgl-canvas",e),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map");var r=this._containerDimensions();this._resizeCanvas(r[0],r[1]);var n=this._controlContainer=i.create("div","mapboxgl-control-container",t),a=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(function(t){a[t]=i.create("div","mapboxgl-ctrl-"+t,n)})},n.prototype._resizeCanvas=function(e,i){var r=t.browser.devicePixelRatio||1;this._canvas.width=r*e,this._canvas.height=r*i,this._canvas.style.width=e+"px",this._canvas.style.height=i+"px"},n.prototype._setupPainter=function(){var i=t.extend({},e.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),r=this._canvas.getContext("webgl",i)||this._canvas.getContext("experimental-webgl",i);r?(this.painter=new fr(r,this.transform),t.webpSupported.testSupport(r)):this.fire(new t.ErrorEvent(new Error("Failed to initialize WebGL")))},n.prototype._contextLost=function(e){e.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new t.Event("webglcontextlost",{originalEvent:e}))},n.prototype._contextRestored=function(e){this._setupPainter(),this.resize(),this._update(),this.fire(new t.Event("webglcontextrestored",{originalEvent:e}))},n.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()},n.prototype._update=function(t){return this.style?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this.triggerRepaint(),this):this},n.prototype._requestRenderFrame=function(t){return this._update(),this._renderTaskQueue.add(t)},n.prototype._cancelRenderFrame=function(t){this._renderTaskQueue.remove(t)},n.prototype._render=function(){var e,i=this,r=0,n=this.painter.context.extTimerQuery;this.listens("gpu-timing-frame")&&(e=n.createQueryEXT(),n.beginQueryEXT(n.TIME_ELAPSED_EXT,e),r=t.browser.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run();var a=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var o=this.transform.zoom,s=t.browser.now();this.style.zoomHistory.update(o,s);var l=new t.EvaluationParameters(o,{now:s,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),u=l.crossFadingFactor();1===u&&u===this._crossFadingFactor||(a=!0,this._crossFadingFactor=u),this.style.update(l)}if(this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:this._fadeDuration,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer")}),this.fire(new t.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new t.Event("load"))),this.style&&(this.style.hasTransitions()||a)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){var h=t.browser.now()-r;n.endQueryEXT(n.TIME_ELAPSED_EXT,e),setTimeout(function(){var r=n.getQueryObjectEXT(e,n.QUERY_RESULT_EXT)/1e6;n.deleteQueryEXT(e),i.fire(new t.Event("gpu-timing-frame",{cpuTime:h,gpuTime:r}))},50)}if(this.listens("gpu-timing-layer")){var c=this.painter.collectGpuTimers();setTimeout(function(){var e=i.painter.queryGpuTimers(c);i.fire(new t.Event("gpu-timing-layer",{layerTimes:e}))},50)}return this._sourcesDirty||this._styleDirty||this._placementDirty||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&(this._fullyLoaded||(this._fullyLoaded=!0),this.fire(new t.Event("idle"))),this},n.prototype.remove=function(){this._hash&&this._hash.remove();for(var e=0,i=this._controls;e<i.length;e+=1)i[e].onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.setStyle(null),void 0!==t.window&&(t.window.removeEventListener("resize",this._onWindowResize,!1),t.window.removeEventListener("online",this._onWindowOnline,!1));var r=this.painter.context.gl.getExtension("WEBGL_lose_context");r&&r.loseContext(),Zr(this._canvasContainer),Zr(this._controlContainer),Zr(this._missingCSSCanary),this._container.classList.remove("mapboxgl-map"),this.fire(new t.Event("remove"))},n.prototype.triggerRepaint=function(){var e=this;this.style&&!this._frame&&(this._frame=t.browser.frame(function(t){e._frame=null,e._render()}))},n.prototype._onWindowOnline=function(){this._update()},n.prototype._onWindowResize=function(t){this._trackResize&&this.resize({originalEvent:t})._update()},a.showTileBoundaries.get=function(){return!!this._showTileBoundaries},a.showTileBoundaries.set=function(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())},a.showPadding.get=function(){return!!this._showPadding},a.showPadding.set=function(t){this._showPadding!==t&&(this._showPadding=t,this._update())},a.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},a.showCollisionBoxes.set=function(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,t?this.style._generateCollisionBoxes():this._update())},a.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},a.showOverdrawInspector.set=function(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())},a.repaint.get=function(){return!!this._repaint},a.repaint.set=function(t){this._repaint!==t&&(this._repaint=t,this.triggerRepaint())},a.vertices.get=function(){return!!this._vertices},a.vertices.set=function(t){this._vertices=t,this._update()},n.prototype._setCacheLimits=function(e,i){t.setCacheLimits(e,i)},n.prototype.getCRS=function(){return this.crs},n.prototype.setCRS=function(e){this._tileExtent=[-20037508.3427892,-20037508.3427892,20037508.3427892,20037508.3427892];var i=e.getExtent(),r=e.projection,n=e.getCoordsInfo(i);if(i&&Array.isArray(i)&&4===i.length){this._tileExtent=i;var a=n.height,o=n.originY;t.GeoJSONFeature.prototype.yLat=function(t,e){return r.unproject([0,o-t*a/e])[1]},t.GeoJSONFeature.prototype.latY=function(t){var e=r.project([0,t])[1];return(o-e)*this.worldSize/a},this.updateTransform&&(this.mercatorZfromAltitude=t.mercatorZfromAltitude,this.updateTransform(e.getUnit(),n,r))}},n.prototype.updateTransform=function(e,i,r){var n=i.width,a=i.height,o=i.centerX,s=i.centerY,l=i.latlngBounds;this.transform.units=e,this.transform.latRange=[l[1],l[3]],this.transform.lngRange=[l[0],l[2]],this.customConvertPoint=t.window.URL.createObjectURL(new Blob(["customConvertPoint = {projectX:function(x){return (x - "+o+") / "+n+" + 0.5},projectY:function(y){y = 0.5 - ((y - "+s+") / "+a+");return y < 0 ? 0 : y > 1 ? 1 : y;},toY:function(y){return (0.5-y)*"+a+"+"+s+";}}"],{type:"text/javascript"}))},a.version.get=function(){return t.version},Object.defineProperties(n.prototype,a),n}(Rr);function Zr(t){t.parentNode&&t.parentNode.removeChild(t)}var Xr,Wr,Kr=function(t,e,i,r){for(var n=65535&t|0,a=t>>>16&65535|0,o=0;0!==i;){i-=o=i>2e3?2e3:i;do{a=a+(n=n+e[r++]|0)|0}while(--o);n%=65521,a%=65521}return n|a<<16|0},Hr=new Uint32Array(function(){for(var t,e=[],i=0;i<256;i++){t=i;for(var r=0;r<8;r++)t=1&t?3988292384^t>>>1:t>>>1;e[i]=t}return e}()),Jr=function(t,e,i,r){var n=Hr,a=r+i;t^=-1;for(var o=r;o<a;o++)t=t>>>8^n[255&(t^e[o])];return-1^t},Yr=function(t,e){var i,r,n,a,o,s,l,u,h,c,p,f,d,y,m,v,g,_,x,b,w,S,M,E,k=t.state;M=t.input,r=(i=t.next_in)+(t.avail_in-5),E=t.output,a=(n=t.next_out)-(e-t.avail_out),o=n+(t.avail_out-257),s=k.dmax,l=k.wsize,u=k.whave,h=k.wnext,c=k.window,p=k.hold,f=k.bits,d=k.lencode,y=k.distcode,m=(1<<k.lenbits)-1,v=(1<<k.distbits)-1;t:do{f<15&&(p+=M[i++]<<f,p+=M[i++]<<(f+=8),f+=8),g=d[p&m];e:for(;;){if(p>>>=_=g>>>24,f-=_,0==(_=g>>>16&255))E[n++]=65535&g;else{if(!(16&_)){if(0==(64&_)){g=d[(65535&g)+(p&(1<<_)-1)];continue e}if(32&_){k.mode=16191;break t}t.msg="invalid literal/length code",k.mode=16209;break t}x=65535&g,(_&=15)&&(f<_&&(p+=M[i++]<<f,f+=8),x+=p&(1<<_)-1,p>>>=_,f-=_),f<15&&(p+=M[i++]<<f,p+=M[i++]<<(f+=8),f+=8),g=y[p&v];i:for(;;){if(p>>>=_=g>>>24,f-=_,!(16&(_=g>>>16&255))){if(0==(64&_)){g=y[(65535&g)+(p&(1<<_)-1)];continue i}t.msg="invalid distance code",k.mode=16209;break t}if(b=65535&g,f<(_&=15)&&(p+=M[i++]<<f,(f+=8)<_&&(p+=M[i++]<<f,f+=8)),(b+=p&(1<<_)-1)>s){t.msg="invalid distance too far back",k.mode=16209;break t}if(p>>>=_,f-=_,b>(_=n-a)){if((_=b-_)>u&&k.sane){t.msg="invalid distance too far back",k.mode=16209;break t}if(w=0,S=c,0===h){if(w+=l-_,_<x){x-=_;do{E[n++]=c[w++]}while(--_);w=n-b,S=E}}else if(h<_){if(w+=l+h-_,(_-=h)<x){x-=_;do{E[n++]=c[w++]}while(--_);if(w=0,h<x){x-=_=h;do{E[n++]=c[w++]}while(--_);w=n-b,S=E}}}else if(w+=h-_,_<x){x-=_;do{E[n++]=c[w++]}while(--_);w=n-b,S=E}for(;x>2;)E[n++]=S[w++],E[n++]=S[w++],E[n++]=S[w++],x-=3;x&&(E[n++]=S[w++],x>1&&(E[n++]=S[w++]))}else{w=n-b;do{E[n++]=E[w++],E[n++]=E[w++],E[n++]=E[w++],x-=3}while(x>2);x&&(E[n++]=E[w++],x>1&&(E[n++]=E[w++]))}break}}break}}while(i<r&&n<o);p&=(1<<(f-=(x=f>>3)<<3))-1,t.next_in=i-=x,t.next_out=n,t.avail_in=i<r?r-i+5:5-(i-r),t.avail_out=n<o?o-n+257:257-(n-o),k.hold=p,k.bits=f},Qr=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),$r=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),tn=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),en=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),rn=function(t,e,i,r,n,a,o,s){var l,u,h,c,p,f,d,y,m,v=s.bits,g=0,_=0,x=0,b=0,w=0,S=0,M=0,E=0,k=0,T=0,I=null,C=new Uint16Array(16),A=new Uint16Array(16),P=null;for(g=0;g<=15;g++)C[g]=0;for(_=0;_<r;_++)C[e[i+_]]++;for(w=v,b=15;b>=1&&0===C[b];b--);if(w>b&&(w=b),0===b)return n[a++]=20971520,n[a++]=20971520,s.bits=1,0;for(x=1;x<b&&0===C[x];x++);for(w<x&&(w=x),E=1,g=1;g<=15;g++)if(E<<=1,(E-=C[g])<0)return-1;if(E>0&&(0===t||1!==b))return-1;for(A[1]=0,g=1;g<15;g++)A[g+1]=A[g]+C[g];for(_=0;_<r;_++)0!==e[i+_]&&(o[A[e[i+_]]++]=_);if(0===t?(I=P=o,f=20):1===t?(I=Qr,P=$r,f=257):(I=tn,P=en,f=0),T=0,_=0,g=x,p=a,S=w,M=0,h=-1,c=(k=1<<w)-1,1===t&&k>852||2===t&&k>592)return 1;for(;;){d=g-M,o[_]+1<f?(y=0,m=o[_]):o[_]>=f?(y=P[o[_]-f],m=I[o[_]-f]):(y=96,m=0),l=1<<g-M,x=u=1<<S;do{n[p+(T>>M)+(u-=l)]=d<<24|y<<16|m|0}while(0!==u);for(l=1<<g-1;T&l;)l>>=1;if(0!==l?(T&=l-1,T+=l):T=0,_++,0==--C[g]){if(g===b)break;g=e[i+o[_]]}if(g>w&&(T&c)!==h){for(0===M&&(M=w),p+=x,E=1<<(S=g-M);S+M<b&&!((E-=C[S+M])<=0);)S++,E<<=1;if(k+=1<<S,1===t&&k>852||2===t&&k>592)return 1;n[h=T&c]=w<<24|S<<16|p-a|0}}return 0!==T&&(n[p+T]=g-M<<24|64<<16|0),s.bits=w,0},nn={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},an=nn.Z_FINISH,on=nn.Z_BLOCK,sn=nn.Z_TREES,ln=nn.Z_OK,un=nn.Z_STREAM_END,hn=nn.Z_NEED_DICT,cn=nn.Z_STREAM_ERROR,pn=nn.Z_DATA_ERROR,fn=nn.Z_MEM_ERROR,dn=nn.Z_BUF_ERROR,yn=nn.Z_DEFLATED,mn=function(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)},vn=function(t){if(!t)return 1;var e=t.state;return!e||e.strm!==t||e.mode<16180||e.mode>16211?1:0},gn=function(t){if(vn(t))return cn;var e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,function(t){if(vn(t))return cn;var e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=16180,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,ln}(t)},_n=!0,xn=function(t){if(_n){Xr=new Int32Array(512),Wr=new Int32Array(32);for(var e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(rn(1,t.lens,0,288,Xr,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;rn(2,t.lens,0,32,Wr,0,t.work,{bits:5}),_n=!1}t.lencode=Xr,t.lenbits=9,t.distcode=Wr,t.distbits=5},bn=function(t,e,i,r){var n,a=t.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),r>=a.wsize?(a.window.set(e.subarray(i-a.wsize,i),0),a.wnext=0,a.whave=a.wsize):((n=a.wsize-a.wnext)>r&&(n=r),a.window.set(e.subarray(i-r,i-r+n),a.wnext),(r-=n)?(a.window.set(e.subarray(i-r,i),0),a.wnext=r,a.whave=a.wsize):(a.wnext+=n,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=n))),0},wn=gn,Sn=function(t,e){if(!t)return cn;var i=new function(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0};t.state=i,i.strm=t,i.window=null,i.mode=16180;var r=function(t,e){var i;if(vn(t))return cn;var r=t.state;return e<0?(i=0,e=-e):(i=5+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?cn:(null!==r.window&&r.wbits!==e&&(r.window=null),r.wrap=i,r.wbits=e,gn(t))}(t,e);return r!==ln&&(t.state=null),r},Mn=function(t,e){var i,r,n,a,o,s,l,u,h,c,p,f,d,y,m,v,g,_,x,b,w,S,M,E,k=0,T=new Uint8Array(4),I=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(vn(t)||!t.output||!t.input&&0!==t.avail_in)return cn;16191===(i=t.state).mode&&(i.mode=16192),o=t.next_out,n=t.output,a=t.next_in,r=t.input,u=i.hold,h=i.bits,c=s=t.avail_in,p=l=t.avail_out,S=ln;t:for(;;)switch(i.mode){case 16180:if(0===i.wrap){i.mode=16192;break}for(;h<16;){if(0===s)break t;s--,u+=r[a++]<<h,h+=8}if(2&i.wrap&&35615===u){0===i.wbits&&(i.wbits=15),i.check=0,T[0]=255&u,T[1]=u>>>8&255,i.check=Jr(i.check,T,2,0),u=0,h=0,i.mode=16181;break}if(i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&u)<<8)+(u>>8))%31){t.msg="incorrect header check",i.mode=16209;break}if((15&u)!==yn){t.msg="unknown compression method",i.mode=16209;break}if(h-=4,w=8+(15&(u>>>=4)),0===i.wbits&&(i.wbits=w),w>15||w>i.wbits){t.msg="invalid window size",i.mode=16209;break}i.dmax=1<<i.wbits,i.flags=0,t.adler=i.check=1,i.mode=512&u?16189:16191,u=0,h=0;break;case 16181:for(;h<16;){if(0===s)break t;s--,u+=r[a++]<<h,h+=8}if(i.flags=u,(255&i.flags)!==yn){t.msg="unknown compression method",i.mode=16209;break}if(57344&i.flags){t.msg="unknown header flags set",i.mode=16209;break}i.head&&(i.head.text=u>>8&1),512&i.flags&&4&i.wrap&&(T[0]=255&u,T[1]=u>>>8&255,i.check=Jr(i.check,T,2,0)),u=0,h=0,i.mode=16182;case 16182:for(;h<32;){if(0===s)break t;s--,u+=r[a++]<<h,h+=8}i.head&&(i.head.time=u),512&i.flags&&4&i.wrap&&(T[0]=255&u,T[1]=u>>>8&255,T[2]=u>>>16&255,T[3]=u>>>24&255,i.check=Jr(i.check,T,4,0)),u=0,h=0,i.mode=16183;case 16183:for(;h<16;){if(0===s)break t;s--,u+=r[a++]<<h,h+=8}i.head&&(i.head.xflags=255&u,i.head.os=u>>8),512&i.flags&&4&i.wrap&&(T[0]=255&u,T[1]=u>>>8&255,i.check=Jr(i.check,T,2,0)),u=0,h=0,i.mode=16184;case 16184:if(1024&i.flags){for(;h<16;){if(0===s)break t;s--,u+=r[a++]<<h,h+=8}i.length=u,i.head&&(i.head.extra_len=u),512&i.flags&&4&i.wrap&&(T[0]=255&u,T[1]=u>>>8&255,i.check=Jr(i.check,T,2,0)),u=0,h=0}else i.head&&(i.head.extra=null);i.mode=16185;case 16185:if(1024&i.flags&&((f=i.length)>s&&(f=s),f&&(i.head&&(w=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Uint8Array(i.head.extra_len)),i.head.extra.set(r.subarray(a,a+f),w)),512&i.flags&&4&i.wrap&&(i.check=Jr(i.check,r,f,a)),s-=f,a+=f,i.length-=f),i.length))break t;i.length=0,i.mode=16186;case 16186:if(2048&i.flags){if(0===s)break t;f=0;do{w=r[a+f++],i.head&&w&&i.length<65536&&(i.head.name+=String.fromCharCode(w))}while(w&&f<s);if(512&i.flags&&4&i.wrap&&(i.check=Jr(i.check,r,f,a)),s-=f,a+=f,w)break t}else i.head&&(i.head.name=null);i.length=0,i.mode=16187;case 16187:if(4096&i.flags){if(0===s)break t;f=0;do{w=r[a+f++],i.head&&w&&i.length<65536&&(i.head.comment+=String.fromCharCode(w))}while(w&&f<s);if(512&i.flags&&4&i.wrap&&(i.check=Jr(i.check,r,f,a)),s-=f,a+=f,w)break t}else i.head&&(i.head.comment=null);i.mode=16188;case 16188:if(512&i.flags){for(;h<16;){if(0===s)break t;s--,u+=r[a++]<<h,h+=8}if(4&i.wrap&&u!==(65535&i.check)){t.msg="header crc mismatch",i.mode=16209;break}u=0,h=0}i.head&&(i.head.hcrc=i.flags>>9&1,i.head.done=!0),t.adler=i.check=0,i.mode=16191;break;case 16189:for(;h<32;){if(0===s)break t;s--,u+=r[a++]<<h,h+=8}t.adler=i.check=mn(u),u=0,h=0,i.mode=16190;case 16190:if(0===i.havedict)return t.next_out=o,t.avail_out=l,t.next_in=a,t.avail_in=s,i.hold=u,i.bits=h,hn;t.adler=i.check=1,i.mode=16191;case 16191:if(e===on||e===sn)break t;case 16192:if(i.last){u>>>=7&h,h-=7&h,i.mode=16206;break}for(;h<3;){if(0===s)break t;s--,u+=r[a++]<<h,h+=8}switch(i.last=1&u,h-=1,3&(u>>>=1)){case 0:i.mode=16193;break;case 1:if(xn(i),i.mode=16199,e===sn){u>>>=2,h-=2;break t}break;case 2:i.mode=16196;break;case 3:t.msg="invalid block type",i.mode=16209}u>>>=2,h-=2;break;case 16193:for(u>>>=7&h,h-=7&h;h<32;){if(0===s)break t;s--,u+=r[a++]<<h,h+=8}if((65535&u)!=(u>>>16^65535)){t.msg="invalid stored block lengths",i.mode=16209;break}if(i.length=65535&u,u=0,h=0,i.mode=16194,e===sn)break t;case 16194:i.mode=16195;case 16195:if(f=i.length){if(f>s&&(f=s),f>l&&(f=l),0===f)break t;n.set(r.subarray(a,a+f),o),s-=f,a+=f,l-=f,o+=f,i.length-=f;break}i.mode=16191;break;case 16196:for(;h<14;){if(0===s)break t;s--,u+=r[a++]<<h,h+=8}if(i.nlen=257+(31&u),h-=5,i.ndist=1+(31&(u>>>=5)),h-=5,i.ncode=4+(15&(u>>>=5)),u>>>=4,h-=4,i.nlen>286||i.ndist>30){t.msg="too many length or distance symbols",i.mode=16209;break}i.have=0,i.mode=16197;case 16197:for(;i.have<i.ncode;){for(;h<3;){if(0===s)break t;s--,u+=r[a++]<<h,h+=8}i.lens[I[i.have++]]=7&u,u>>>=3,h-=3}for(;i.have<19;)i.lens[I[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,S=rn(0,i.lens,0,19,i.lencode,0,i.work,M={bits:i.lenbits}),i.lenbits=M.bits,S){t.msg="invalid code lengths set",i.mode=16209;break}i.have=0,i.mode=16198;case 16198:for(;i.have<i.nlen+i.ndist;){for(;v=(k=i.lencode[u&(1<<i.lenbits)-1])>>>16&255,g=65535&k,!((m=k>>>24)<=h);){if(0===s)break t;s--,u+=r[a++]<<h,h+=8}if(g<16)u>>>=m,h-=m,i.lens[i.have++]=g;else{if(16===g){for(E=m+2;h<E;){if(0===s)break t;s--,u+=r[a++]<<h,h+=8}if(u>>>=m,h-=m,0===i.have){t.msg="invalid bit length repeat",i.mode=16209;break}w=i.lens[i.have-1],f=3+(3&u),u>>>=2,h-=2}else if(17===g){for(E=m+3;h<E;){if(0===s)break t;s--,u+=r[a++]<<h,h+=8}h-=m,w=0,f=3+(7&(u>>>=m)),u>>>=3,h-=3}else{for(E=m+7;h<E;){if(0===s)break t;s--,u+=r[a++]<<h,h+=8}h-=m,w=0,f=11+(127&(u>>>=m)),u>>>=7,h-=7}if(i.have+f>i.nlen+i.ndist){t.msg="invalid bit length repeat",i.mode=16209;break}for(;f--;)i.lens[i.have++]=w}}if(16209===i.mode)break;if(0===i.lens[256]){t.msg="invalid code -- missing end-of-block",i.mode=16209;break}if(i.lenbits=9,S=rn(1,i.lens,0,i.nlen,i.lencode,0,i.work,M={bits:i.lenbits}),i.lenbits=M.bits,S){t.msg="invalid literal/lengths set",i.mode=16209;break}if(i.distbits=6,i.distcode=i.distdyn,S=rn(2,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,M={bits:i.distbits}),i.distbits=M.bits,S){t.msg="invalid distances set",i.mode=16209;break}if(i.mode=16199,e===sn)break t;case 16199:i.mode=16200;case 16200:if(s>=6&&l>=258){t.next_out=o,t.avail_out=l,t.next_in=a,t.avail_in=s,i.hold=u,i.bits=h,Yr(t,p),o=t.next_out,n=t.output,l=t.avail_out,a=t.next_in,r=t.input,s=t.avail_in,u=i.hold,h=i.bits,16191===i.mode&&(i.back=-1);break}for(i.back=0;v=(k=i.lencode[u&(1<<i.lenbits)-1])>>>16&255,g=65535&k,!((m=k>>>24)<=h);){if(0===s)break t;s--,u+=r[a++]<<h,h+=8}if(v&&0==(240&v)){for(_=m,x=v,b=g;v=(k=i.lencode[b+((u&(1<<_+x)-1)>>_)])>>>16&255,g=65535&k,!(_+(m=k>>>24)<=h);){if(0===s)break t;s--,u+=r[a++]<<h,h+=8}u>>>=_,h-=_,i.back+=_}if(u>>>=m,h-=m,i.back+=m,i.length=g,0===v){i.mode=16205;break}if(32&v){i.back=-1,i.mode=16191;break}if(64&v){t.msg="invalid literal/length code",i.mode=16209;break}i.extra=15&v,i.mode=16201;case 16201:if(i.extra){for(E=i.extra;h<E;){if(0===s)break t;s--,u+=r[a++]<<h,h+=8}i.length+=u&(1<<i.extra)-1,u>>>=i.extra,h-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=16202;case 16202:for(;v=(k=i.distcode[u&(1<<i.distbits)-1])>>>16&255,g=65535&k,!((m=k>>>24)<=h);){if(0===s)break t;s--,u+=r[a++]<<h,h+=8}if(0==(240&v)){for(_=m,x=v,b=g;v=(k=i.distcode[b+((u&(1<<_+x)-1)>>_)])>>>16&255,g=65535&k,!(_+(m=k>>>24)<=h);){if(0===s)break t;s--,u+=r[a++]<<h,h+=8}u>>>=_,h-=_,i.back+=_}if(u>>>=m,h-=m,i.back+=m,64&v){t.msg="invalid distance code",i.mode=16209;break}i.offset=g,i.extra=15&v,i.mode=16203;case 16203:if(i.extra){for(E=i.extra;h<E;){if(0===s)break t;s--,u+=r[a++]<<h,h+=8}i.offset+=u&(1<<i.extra)-1,u>>>=i.extra,h-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){t.msg="invalid distance too far back",i.mode=16209;break}i.mode=16204;case 16204:if(0===l)break t;if(i.offset>(f=p-l)){if((f=i.offset-f)>i.whave&&i.sane){t.msg="invalid distance too far back",i.mode=16209;break}d=f>i.wnext?i.wsize-(f-=i.wnext):i.wnext-f,f>i.length&&(f=i.length),y=i.window}else y=n,d=o-i.offset,f=i.length;f>l&&(f=l),l-=f,i.length-=f;do{n[o++]=y[d++]}while(--f);0===i.length&&(i.mode=16200);break;case 16205:if(0===l)break t;n[o++]=i.length,l--,i.mode=16200;break;case 16206:if(i.wrap){for(;h<32;){if(0===s)break t;s--,u|=r[a++]<<h,h+=8}if(t.total_out+=p-=l,i.total+=p,4&i.wrap&&p&&(t.adler=i.check=i.flags?Jr(i.check,n,p,o-p):Kr(i.check,n,p,o-p)),p=l,4&i.wrap&&(i.flags?u:mn(u))!==i.check){t.msg="incorrect data check",i.mode=16209;break}u=0,h=0}i.mode=16207;case 16207:if(i.wrap&&i.flags){for(;h<32;){if(0===s)break t;s--,u+=r[a++]<<h,h+=8}if(4&i.wrap&&u!==(4294967295&i.total)){t.msg="incorrect length check",i.mode=16209;break}u=0,h=0}i.mode=16208;case 16208:S=un;break t;case 16209:S=pn;break t;case 16210:return fn;case 16211:default:return cn}return t.next_out=o,t.avail_out=l,t.next_in=a,t.avail_in=s,i.hold=u,i.bits=h,(i.wsize||p!==t.avail_out&&i.mode<16209&&(i.mode<16206||e!==an))&&bn(t,t.output,t.next_out,p-t.avail_out),p-=t.avail_out,t.total_in+=c-=t.avail_in,t.total_out+=p,i.total+=p,4&i.wrap&&p&&(t.adler=i.check=i.flags?Jr(i.check,n,p,t.next_out-p):Kr(i.check,n,p,t.next_out-p)),t.data_type=i.bits+(i.last?64:0)+(16191===i.mode?128:0)+(16199===i.mode||16194===i.mode?256:0),(0===c&&0===p||e===an)&&S===ln&&(S=dn),S},En=function(t){if(vn(t))return cn;var e=t.state;return e.window&&(e.window=null),t.state=null,ln},kn=function(t,e){var i,r=e.length;return vn(t)||0!==(i=t.state).wrap&&16190!==i.mode?cn:16190===i.mode&&Kr(1,e,r,0)!==i.check?pn:bn(t,e,r,r)?(i.mode=16210,fn):(i.havedict=1,ln)},Tn=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},In=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){In=!1}for(var Cn=new Uint8Array(256),An=0;An<256;An++)Cn[An]=An>=252?6:An>=248?5:An>=240?4:An>=224?3:An>=192?2:1;Cn[254]=Cn[254]=1;var Pn=function(t,e){var i,r,n=e||t.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(t.subarray(0,e));var a=new Array(2*n);for(r=0,i=0;i<n;){var o=t[i++];if(o<128)a[r++]=o;else{var s=Cn[o];if(s>4)a[r++]=65533,i+=s-1;else{for(o&=2===s?31:3===s?15:7;s>1&&i<n;)o=o<<6|63&t[i++],s--;s>1?a[r++]=65533:o<65536?a[r++]=o:(a[r++]=55296|(o-=65536)>>10&1023,a[r++]=56320|1023&o)}}}return function(t,e){if(e<65534&&t.subarray&&In)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));for(var i="",r=0;r<e;r++)i+=String.fromCharCode(t[r]);return i}(a,r)},Ln=function(t,e){(e=e||t.length)>t.length&&(e=t.length);for(var i=e-1;i>=0&&128==(192&t[i]);)i--;return i<0||0===i?e:i+Cn[t[i]]>e?i:e},zn={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Dn=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},Rn=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1},On=Object.prototype.toString,Bn=nn.Z_NO_FLUSH,Fn=nn.Z_FINISH,Vn=nn.Z_OK,Un=nn.Z_STREAM_END,jn=nn.Z_NEED_DICT,Nn=nn.Z_STREAM_ERROR,qn=nn.Z_DATA_ERROR,Gn=nn.Z_MEM_ERROR;function Zn(t){this.options=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var i=e.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(var r in i)Tn(i,r)&&(t[r]=i[r])}}return t}({chunkSize:65536,windowBits:15,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Dn,this.strm.avail_out=0;var i=Sn(this.strm,e.windowBits);if(i!==Vn)throw new Error(zn[i]);if(this.header=new Rn,function(t,e){if(vn(t))return cn;var i=t.state;0==(2&i.wrap)||(i.head=e,e.done=!1)}(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=function(t){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);var e,i,r,n,a,o=t.length,s=0;for(n=0;n<o;n++)55296==(64512&(i=t.charCodeAt(n)))&&n+1<o&&56320==(64512&(r=t.charCodeAt(n+1)))&&(i=65536+(i-55296<<10)+(r-56320),n++),s+=i<128?1:i<2048?2:i<65536?3:4;for(e=new Uint8Array(s),a=0,n=0;a<s;n++)55296==(64512&(i=t.charCodeAt(n)))&&n+1<o&&56320==(64512&(r=t.charCodeAt(n+1)))&&(i=65536+(i-55296<<10)+(r-56320),n++),i<128?e[a++]=i:i<2048?(e[a++]=192|i>>>6,e[a++]=128|63&i):i<65536?(e[a++]=224|i>>>12,e[a++]=128|i>>>6&63,e[a++]=128|63&i):(e[a++]=240|i>>>18,e[a++]=128|i>>>12&63,e[a++]=128|i>>>6&63,e[a++]=128|63&i);return e}(e.dictionary):"[object ArrayBuffer]"===On.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(i=kn(this.strm,e.dictionary))!==Vn))throw new Error(zn[i])}function Xn(t,e){var i=new Zn(e);if(i.push(t),i.err)throw i.msg||zn[i.err];return i.result}Zn.prototype.push=function(t,e){var i,r,n,a=this.strm,o=this.options.chunkSize,s=this.options.dictionary;if(this.ended)return!1;for(r=e===~~e?e:!0===e?Fn:Bn,a.input="[object ArrayBuffer]"===On.call(t)?new Uint8Array(t):t,a.next_in=0,a.avail_in=a.input.length;;){for(0===a.avail_out&&(a.output=new Uint8Array(o),a.next_out=0,a.avail_out=o),(i=Mn(a,r))===jn&&s&&((i=kn(a,s))===Vn?i=Mn(a,r):i===qn&&(i=jn));a.avail_in>0&&i===Un&&a.state.wrap>0&&0!==t[a.next_in];)wn(a),i=Mn(a,r);switch(i){case Nn:case qn:case jn:case Gn:return this.onEnd(i),this.ended=!0,!1}if(n=a.avail_out,a.next_out&&(0===a.avail_out||i===Un))if("string"===this.options.to){var l=Ln(a.output,a.next_out),u=a.next_out-l,h=Pn(a.output,l);a.next_out=u,a.avail_out=o-u,u&&a.output.set(a.output.subarray(l,l+u),0),this.onData(h)}else this.onData(a.output.length===a.next_out?a.output:a.output.subarray(0,a.next_out));if(i!==Vn||0!==n){if(i===Un)return i=En(this.strm),this.onEnd(i),this.ended=!0,!0;if(0===a.avail_in)break}}return!0},Zn.prototype.onData=function(t){this.chunks.push(t)},Zn.prototype.onEnd=function(t){t===Vn&&(this.result="string"===this.options.to?this.chunks.join(""):function(t){for(var e=0,i=0,r=t.length;i<r;i++)e+=t[i].length;for(var n=new Uint8Array(e),a=0,o=0,s=t.length;a<s;a++){var l=t[a];n.set(l,o),o+=l.length}return n}(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};for(var Wn={Inflate:Zn,inflate:Xn,inflateRaw:function(t,e){return(e=e||{}).raw=!0,Xn(t,e)},ungzip:Xn,constants:nn},Kn=[],Hn=[],Jn="undefined"!=typeof Uint8Array?Uint8Array:Array,Yn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Qn=0,$n=Yn.length;Qn<$n;++Qn)Kn[Qn]=Yn[Qn],Hn[Yn.charCodeAt(Qn)]=Qn;function ta(t,e,i){for(var r,n=[],a=e;a<i;a+=3)n.push(Kn[(r=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]))>>18&63]+Kn[r>>12&63]+Kn[r>>6&63]+Kn[63&r]);return n.join("")}Hn["-".charCodeAt(0)]=62,Hn["_".charCodeAt(0)]=63;var ea=function(e){function i(t,i,r,n){e.call(this,t,i,r,n),this.dispatcher=r,this.setEventedParent(n),this.type="mbtiles",this.db=this.openDatabase(i.path)}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.openDatabase=function(e){return t.Database.openDatabase(e)},i.prototype.copyDatabaseFile=function(e,i,r){return t.Database.copyDatabaseFile(e,i,r)},i.prototype.readTile=function(t,e,i,r){var n=[t,e,i];this.db.then(function(t){t.transaction(function(t){t.executeSql("SELECT BASE64(tile_data) AS base64_tile_data FROM tiles WHERE zoom_level=? AND tile_column=? AND tile_row=?",n,function(t,e){if(e.rows.length){var i=e.rows.item(0).base64_tile_data,a=Wn.inflate(function(t){var e,i,r=function(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=t.indexOf("=");return-1===i&&(i=e),[i,i===e?0:4-i%4]}(t),n=r[0],a=r[1],o=new Jn(3*(n+a)/4-a),s=0,l=a>0?n-4:n;for(i=0;i<l;i+=4)e=Hn[t.charCodeAt(i)]<<18|Hn[t.charCodeAt(i+1)]<<12|Hn[t.charCodeAt(i+2)]<<6|Hn[t.charCodeAt(i+3)],o[s++]=e>>16&255,o[s++]=e>>8&255,o[s++]=255&e;return 2===a&&(e=Hn[t.charCodeAt(i)]<<2|Hn[t.charCodeAt(i+1)]>>4,o[s++]=255&e),1===a&&(e=Hn[t.charCodeAt(i)]<<10|Hn[t.charCodeAt(i+1)]<<4|Hn[t.charCodeAt(i+2)]>>2,o[s++]=e>>8&255,o[s++]=255&e),o}(i));r(void 0,function(t){for(var e,i=t.length,r=i%3,n=[],a=0,o=i-r;a<o;a+=16383)n.push(ta(t,a,a+16383>o?o:a+16383));return 1===r?n.push(Kn[(e=t[i-1])>>2]+Kn[e<<4&63]+"=="):2===r&&n.push(Kn[(e=(t[i-2]<<8)+t[i-1])>>10]+Kn[e>>4&63]+Kn[e<<2&63]+"="),n.join("")}(a))}else r(new Error("tile "+n.join(",")+" not found"))})},function(t){r(t)})}).catch(function(t){r(t)})},i.prototype.loadTile=function(t,e){var i=t.tileID.canonical,r=i.z>this.maxzoom?Math.pow(2,i.z-this.maxzoom):1,n=Math.min(i.z,this.maxzoom||i.z),a=i.x,o=Math.pow(2,n)-i.y-1;this.readTile(n,a,o,function(n,a){if(n)return e(n);if(void 0===a)return e(new Error("empty data"));var o={request:{url:"data:application/x-protobuf;base64,"+a},uid:t.uid,tileID:t.tileID,zoom:i.z,tileSize:this.tileSize*r,type:this.type,source:this.id,pixelRatio:window.devicePixelRatio||1,overscaling:r,showCollisionBoxes:this.map.showCollisionBoxes};function s(i,r){if(!t.aborted){if(i)return e(i);this.map._refreshExpiredTiles&&t.setExpiryData(r),t.loadVectorData(r,this.map.painter),e(null),t.reloadCallback&&(this.loadTile(t,t.reloadCallback),t.reloadCallback=null)}}t.actor&&"expired"!==t.state?"loading"===t.state?t.reloadCallback=e:t.request=t.actor.send("reloadTile",o,s.bind(this)):(t.actor=this.dispatcher.getActor(),t.request=t.actor.send("loadTile",o,s.bind(this)))}.bind(this))},i}(E),ia=function(e){var i=e.style,r=/^.+:\/\//,n=t.window.location.origin+t.window.location.pathname.split("/").slice(0,-1).join("/");return"sprite"in i&&!i.sprite.match(r)&&"glyphs"in i&&!i.glyphs.match(r)&&(i.sprite=n+"/"+i.sprite,i.glyphs=n+"/"+i.glyphs),console.log("获取离线显示配置",e),e},ra={showCompass:!0,showZoom:!0,visualizePitch:!1},na=function(e){var r=this;this.options=t.extend({},ra,e),this._container=i.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",function(t){return t.preventDefault()}),this.options.showZoom&&(t.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",function(t){return r._map.zoomIn({},{originalEvent:t})}),i.create("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden",!0),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",function(t){return r._map.zoomOut({},{originalEvent:t})}),i.create("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden",!0)),this.options.showCompass&&(t.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",function(t){r.options.visualizePitch?r._map.resetNorthPitch({},{originalEvent:t}):r._map.resetNorth({},{originalEvent:t})}),this._compassIcon=i.create("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden",!0))};function aa(e,i,r){if(e=new t.LngLat(e.lng,e.lat),i){var n=new t.LngLat(e.lng-360,e.lat),a=new t.LngLat(e.lng+360,e.lat),o=r.locationPoint(e).distSqr(i);r.locationPoint(n).distSqr(i)<o?e=n:r.locationPoint(a).distSqr(i)<o&&(e=a)}for(;Math.abs(e.lng-r.center.lng)>180;){var s=r.locationPoint(e);if(s.x>=0&&s.y>=0&&s.x<=r.width&&s.y<=r.height)break;e.lng>r.center.lng?e.lng-=360:e.lng+=360}return e}na.prototype._updateZoomButtons=function(){var t=this._map.getZoom();this._zoomInButton.disabled=t===this._map.getMaxZoom(),this._zoomOutButton.disabled=t===this._map.getMinZoom()},na.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},na.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 kr(t,{button:"left",element:this._compass,clickTolerance:t.dragRotate._clickTolerance}),i.addEventListener(this._compass,"mousedown",this._handler.onMouseDown),i.addEventListener(this._compass,"touchstart",this._handler.onMouseDown,{passive:!1}),this._handler.enable()),this._container},na.prototype.onRemove=function(){i.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),i.removeEventListener(this._compass,"mousedown",this._handler.onMouseDown),i.removeEventListener(this._compass,"touchstart",this._handler.onMouseDown,{passive:!1}),this._handler.disable(),delete this._handler),delete this._map},na.prototype._createButton=function(t,e){var r=i.create("button",t,this._container);return r.type="button",r.addEventListener("click",e),r},na.prototype._setButtonTitle=function(t,e){var i=this._map._getUIString("NavigationControl."+e);t.title=i,t.setAttribute("aria-label",i)};var oa={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 sa(t,e,i){var r=t.classList;for(var n in oa)r.remove("mapboxgl-"+i+"-anchor-"+n);r.add("mapboxgl-"+i+"-anchor-"+e)}var la,ua=function(e){function r(r,n){var a=this;if(e.call(this),(r instanceof t.window.HTMLElement||n)&&(r=t.extend({element:r},n)),t.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=r&&r.anchor||"center",this._color=r&&r.color||"#3FB1CE",this._draggable=r&&r.draggable||!1,this._state="inactive",this._rotation=r&&r.rotation||0,this._rotationAlignment=r&&r.rotationAlignment||"auto",this._pitchAlignment=r&&r.pitchAlignment&&"auto"!==r.pitchAlignment?r.pitchAlignment:this._rotationAlignment,r&&r.element)this._element=r.element,this._offset=t.Point.convert(r&&r.offset||[0,0]);else{this._defaultMarker=!0,this._element=i.create("div"),this._element.setAttribute("aria-label","Map marker");var o=i.createNS("http://www.w3.org/2000/svg","svg");o.setAttributeNS(null,"display","block"),o.setAttributeNS(null,"height","41px"),o.setAttributeNS(null,"width","27px"),o.setAttributeNS(null,"viewBox","0 0 27 41");var s=i.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 l=i.createNS("http://www.w3.org/2000/svg","g");l.setAttributeNS(null,"fill-rule","nonzero");var u=i.createNS("http://www.w3.org/2000/svg","g");u.setAttributeNS(null,"transform","translate(3.0, 29.0)"),u.setAttributeNS(null,"fill","#000000");for(var h=0,c=[{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"}];h<c.length;h+=1){var p=c[h],f=i.createNS("http://www.w3.org/2000/svg","ellipse");f.setAttributeNS(null,"opacity","0.04"),f.setAttributeNS(null,"cx","10.5"),f.setAttributeNS(null,"cy","5.80029008"),f.setAttributeNS(null,"rx",p.rx),f.setAttributeNS(null,"ry",p.ry),u.appendChild(f)}var d=i.createNS("http://www.w3.org/2000/svg","g");d.setAttributeNS(null,"fill",this._color);var y=i.createNS("http://www.w3.org/2000/svg","path");y.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),d.appendChild(y);var m=i.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"opacity","0.25"),m.setAttributeNS(null,"fill","#000000");var v=i.createNS("http://www.w3.org/2000/svg","path");v.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),m.appendChild(v);var g=i.createNS("http://www.w3.org/2000/svg","g");g.setAttributeNS(null,"transform","translate(6.0, 7.0)"),g.setAttributeNS(null,"fill","#FFFFFF");var _=i.createNS("http://www.w3.org/2000/svg","g");_.setAttributeNS(null,"transform","translate(8.0, 8.0)");var x=i.createNS("http://www.w3.org/2000/svg","circle");x.setAttributeNS(null,"fill","#000000"),x.setAttributeNS(null,"opacity","0.25"),x.setAttributeNS(null,"cx","5.5"),x.setAttributeNS(null,"cy","5.5"),x.setAttributeNS(null,"r","5.4999962");var b=i.createNS("http://www.w3.org/2000/svg","circle");b.setAttributeNS(null,"fill","#FFFFFF"),b.setAttributeNS(null,"cx","5.5"),b.setAttributeNS(null,"cy","5.5"),b.setAttributeNS(null,"r","5.4999962"),_.appendChild(x),_.appendChild(b),l.appendChild(u),l.appendChild(d),l.appendChild(m),l.appendChild(g),l.appendChild(_),o.appendChild(l),this._element.appendChild(o),this._offset=t.Point.convert(r&&r.offset||[0,-14])}this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",function(t){t.preventDefault()}),this._element.addEventListener("mousedown",function(t){t.preventDefault()}),this._element.addEventListener("focus",function(){var t=a._map.getContainer();t.scrollTop=0,t.scrollLeft=0}),sa(this._element,this._anchor,"marker"),this._popup=null}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.addTo=function(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this},r.prototype.remove=function(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),i.remove(this._element),this._popup&&this._popup.remove(),this},r.prototype.getLngLat=function(){return this._lngLat},r.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},r.prototype.getElement=function(){return this._element},r.prototype.setPopup=function(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){var e=Math.sqrt(Math.pow(13.5,2)/2);t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[e,-1*(24.6+e)],"bottom-right":[-e,-1*(24.6+e)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=t,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this},r.prototype._onKeyPress=function(t){var e=t.code,i=t.charCode||t.keyCode;"Space"!==e&&"Enter"!==e&&32!==i&&13!==i||this.togglePopup()},r.prototype._onMapClick=function(t){var e=t.originalEvent.target,i=this._element;this._popup&&(e===i||i.contains(e))&&this.togglePopup()},r.prototype.getPopup=function(){return this._popup},r.prototype.togglePopup=function(){var t=this._popup;return t?(t.isOpen()?t.remove():t.addTo(this._map),this):this},r.prototype._update=function(t){if(this._map){this._map.transform.renderWorldCopies&&(this._lngLat=aa(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);var e="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?e="rotateZ("+this._rotation+"deg)":"map"===this._rotationAlignment&&(e="rotateZ("+(this._rotation-this._map.getBearing())+"deg)");var r="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?r="rotateX(0deg)":"map"===this._pitchAlignment&&(r="rotateX("+this._map.getPitch()+"deg)"),t&&"moveend"!==t.type||(this._pos=this._pos.round()),i.setTransform(this._element,oa[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px) "+r+" "+e)}},r.prototype.getOffset=function(){return this._offset},r.prototype.setOffset=function(e){return this._offset=t.Point.convert(e),this._update(),this},r.prototype._onMove=function(e){this._pos=e.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new t.Event("dragstart"))),this.fire(new t.Event("drag"))},r.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new t.Event("dragend")),this._state="inactive"},r.prototype._addDragHandler=function(t){this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},r.prototype.setDraggable=function(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},r.prototype.isDraggable=function(){return this._draggable},r.prototype.setRotation=function(t){return this._rotation=t||0,this._update(),this},r.prototype.getRotation=function(){return this._rotation},r.prototype.setRotationAlignment=function(t){return this._rotationAlignment=t||"auto",this._update(),this},r.prototype.getRotationAlignment=function(){return this._rotationAlignment},r.prototype.setPitchAlignment=function(t){return this._pitchAlignment=t&&"auto"!==t?t:this._rotationAlignment,this._update(),this},r.prototype.getPitchAlignment=function(){return this._pitchAlignment},r}(t.Evented),ha={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},ca=0,pa=!1,fa=function(e){function r(i){e.call(this),this.options=t.extend({},ha,i),t.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.onAdd=function(e){var r;return this._map=e,this._container=i.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),r=this._setupUI,void 0!==la?r(la):void 0!==t.window.navigator.permissions?t.window.navigator.permissions.query({name:"geolocation"}).then(function(t){r(la="denied"!==t.state)}):r(la=!!t.window.navigator.geolocation),this._container},r.prototype.onRemove=function(){void 0!==this._geolocationWatchID&&(t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),i.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,ca=0,pa=!1},r.prototype._isOutOfMapMaxBounds=function(t){var e=this._map.getMaxBounds(),i=t.coords;return e&&(i.longitude<e.getWest()||i.longitude>e.getEast()||i.latitude<e.getSouth()||i.latitude>e.getNorth())},r.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")}},r.prototype._onSuccess=function(e){if(this._map){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()}},r.prototype._updateCamera=function(e){var i=new t.LngLat(e.coords.longitude,e.coords.latitude),r=e.coords.accuracy,n=this._map.getBearing(),a=t.extend({bearing:n},this.options.fitBoundsOptions);this._map.fitBounds(i.toBounds(r),a,{geolocateSource:!0})},r.prototype._updateMarker=function(e){if(e){var i=new t.LngLat(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(i).addTo(this._map),this._userLocationDotMarker.setLngLat(i).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},r.prototype._updateCircleRadius=function(){var t=this._map._container.clientHeight/2,e=this._map.unproject([0,t]),i=this._map.unproject([1,t]),r=e.distanceTo(i),n=Math.ceil(2*this._accuracy/r);this._circleElement.style.width=n+"px",this._circleElement.style.height=n+"px"},r.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},r.prototype._onError=function(e){if(this._map){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 i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===e.code&&pa)return;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()}},r.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},r.prototype._setupUI=function(e){var r=this;if(this._container.addEventListener("contextmenu",function(t){return t.preventDefault()}),this._geolocateButton=i.create("button","mapboxgl-ctrl-geolocate",this._container),i.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 n=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n)}else{var a=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=i.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new ua(this._dotElement),this._circleElement=i.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new ua({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",function(e){e.geolocateSource||"ACTIVE_LOCK"!==r._watchState||e.originalEvent&&"resize"===e.originalEvent.type||(r._watchState="BACKGROUND",r._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),r._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),r.fire(new t.Event("trackuserlocationend")))})},r.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":ca--,pa=!1,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")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){var e;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++ca>1?(e={maximumAge:6e5,timeout:0},pa=!0):(e=this.options.positionOptions,pa=!1),this._geolocationWatchID=t.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,e)}}else t.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},r.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)},r}(t.Evented),da={maxWidth:100,unit:"metric"},ya=function(e){this.options=t.extend({},da,e),t.bindAll(["_onMove","setUnit"],this)};function ma(t,e,i){var r=i&&i.maxWidth||100,n=t._container.clientHeight/2,a=t.unproject([0,n]),o=t.unproject([r,n]),s=a.distanceTo(o);if(i&&"imperial"===i.unit){var l=3.2808*s;l>5280?va(e,r,l/5280,t._getUIString("ScaleControl.Miles")):va(e,r,l,t._getUIString("ScaleControl.Feet"))}else i&&"nautical"===i.unit?va(e,r,s/1852,t._getUIString("ScaleControl.NauticalMiles")):s>=1e3?va(e,r,s/1e3,t._getUIString("ScaleControl.Kilometers")):va(e,r,s,t._getUIString("ScaleControl.Meters"))}function va(t,e,i,r){var n,a,o,s=(n=i,(a=Math.pow(10,(""+Math.floor(n)).length-1))*(o=(o=n/a)>=10?10:o>=5?5:o>=3?3:o>=2?2:o>=1?1:function(t){var e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(o)));t.style.width=e*(s/i)+"px",t.innerHTML=s+" "+r}ya.prototype.getDefaultPosition=function(){return"bottom-left"},ya.prototype._onMove=function(){ma(this._map,this._container,this.options)},ya.prototype.onAdd=function(t){return this._map=t,this._container=i.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},ya.prototype.onRemove=function(){i.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},ya.prototype.setUnit=function(t){this.options.unit=t,ma(this._map,this._container,this.options)};var ga=function(e){t.bindAll(["onMoveStart","onMoveEnd","onRender","getFPS","updateGraph"],this);var i=window.devicePixelRatio,r={background:"rgba(0,0,0,0.9)",barWidth:4*i,color:"#7cf859",font:"Monaco, Consolas, Courier, monospace",graphHeight:60*i,graphWidth:120*i,graphTop:0,graphRight:5*i,width:130*i};this.frames=0,this.totalTime=0,this.totalFrames=0,this.options=Object.assign({},r,e)};ga.prototype.onAdd=function(t){this.map=t,console.log("onAdd",this.map);var e=window.devicePixelRatio,i=this.options,r=i.width,n=i.graphHeight,a=i.color,o=i.background,s=i.font,l=this.container=document.createElement("div");return l.className="mapboxgl-ctrl mapboxgl-ctrl-fps",l.style.backgroundColor=o,l.style.borderRadius="6px",this.readOutput=document.createElement("div"),this.readOutput.style.color=a,this.readOutput.style.fontFamily=s,this.readOutput.style.padding="0 5px 5px",this.readOutput.style.fontSize="9px",this.readOutput.style.fontWeight="bold",this.readOutput.textContent="Waiting…",this.canvas=document.createElement("canvas"),this.canvas.className="mapboxgl-ctrl-canvas",this.canvas.width=r,this.canvas.height=n,this.canvas.style.cssText="width: "+r/e+"px; height: "+n/e+"px;",l.appendChild(this.readOutput),l.appendChild(this.canvas),this.map.on("movestart",this.onMoveStart),this.map.on("moveend",this.onMoveEnd),this.container},ga.prototype.onMoveStart=function(){this.frames=0,this.time=performance.now(),this.map.on("render",this.onRender)},ga.prototype.onMoveEnd=function(){var t=performance.now();this.updateGraph(this.getFPS(t)),this.frames=0,this.time=null,this.map.off("render",this.onRender)},ga.prototype.onRender=function(){this.frames++;var t=performance.now();t>=this.time+1e3&&(this.updateGraph(this.getFPS(t)),this.frames=0,this.time=t)},ga.prototype.getFPS=function(t){return this.totalTime+=t-this.time,this.totalFrames+=this.frames,Math.round(1e3*this.frames/(t-this.time))||0},ga.prototype.updateGraph=function(t){var e=this.options,i=e.barWidth,r=e.graphRight,n=e.graphTop,a=e.graphWidth,o=e.graphHeight,s=e.background,l=e.color,u=this.canvas.getContext("2d"),h=Math.round(1e3*this.totalFrames/this.totalTime)||0,c=i;u.fillStyle=s,u.globalAlpha=1,u.fillRect(0,0,a,n),u.fillStyle=l,this.readOutput.textContent="当前:"+t+" (平均:"+h+" )",u.drawImage(this.canvas,r+c,n,a-c,o,r,n,a-c,o),u.fillRect(r+a-c,n,c,o),u.fillStyle=s,u.globalAlpha=.75,u.fillRect(r+a-c,n,c,(1-t/100)*o)},ga.prototype.onRemove=function(){return this.map.off("render",this.onRender),this.map.off("movestart",this.onMoveStart),this.map.off("moveend",this.onMoveEnd),this.container.parentNode.removeChild(this.container),this.map=null,this};var _a=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")};_a.prototype.onAdd=function(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=i.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},_a.prototype.onRemove=function(){i.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},_a.prototype._checkFullscreenSupport=function(){return!!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},_a.prototype._setupUI=function(){var e=this._fullscreenButton=i.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);i.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)},_a.prototype._updateTitle=function(){var t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t},_a.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},_a.prototype._isFullscreen=function(){return this._fullscreen},_a.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())},_a.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 xa={closeButton:!0,closeOnClick:!0,className:"",maxWidth:"240px"},ba=function(e){function r(i){e.call(this),this.options=t.extend(Object.create(xa),i),t.bindAll(["_update","_onClose","remove"],this)}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.addTo=function(e){var i=this;return this._map=e,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._trackPointer?(this._map.on("mousemove",function(t){i._update(t.point)}),this._map.on("mouseup",function(t){i._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},r.prototype.isOpen=function(){return!!this._map},r.prototype.remove=function(){return this._content&&i.remove(this._content),this._container&&(i.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove"),delete this._map),this.fire(new t.Event("close")),this},r.prototype.getLngLat=function(){return this._lngLat},r.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},r.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},r.prototype.getElement=function(){return this._container},r.prototype.setText=function(e){return this.setDOMContent(t.window.document.createTextNode(e))},r.prototype.setHTML=function(e){var i,r=t.window.document.createDocumentFragment(),n=t.window.document.createElement("body");for(n.innerHTML=e;i=n.firstChild;)r.appendChild(i);return this.setDOMContent(r)},r.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},r.prototype.setMaxWidth=function(t){return this.options.maxWidth=t,this._update(),this},r.prototype.setDOMContent=function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},r.prototype.addClassName=function(t){this._container&&this._container.classList.add(t)},r.prototype.removeClassName=function(t){this._container&&this._container.classList.remove(t)},r.prototype.toggleClassName=function(t){if(this._container)return this._container.classList.toggle(t)},r.prototype._createContent=function(){this._content&&i.remove(this._content),this._content=i.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=i.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._onClose))},r.prototype._update=function(e){var r=this;if(this._map&&(this._lngLat||this._trackPointer)&&this._content&&(this._container||(this._container=i.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=i.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(function(t){return r._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=aa(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||e)){var n=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat),a=this.options.anchor,o=function e(i){if(i){if("number"==typeof i){var r=Math.round(Math.sqrt(.5*Math.pow(i,2)));return{center:new t.Point(0,0),top:new t.Point(0,i),"top-left":new t.Point(r,r),"top-right":new t.Point(-r,r),bottom:new t.Point(0,-i),"bottom-left":new t.Point(r,-r),"bottom-right":new t.Point(-r,-r),left:new t.Point(i,0),right:new t.Point(-i,0)}}if(i instanceof t.Point||Array.isArray(i)){var n=t.Point.convert(i);return{center:n,top:n,"top-left":n,"top-right":n,bottom:n,"bottom-left":n,"bottom-right":n,left:n,right:n}}return{center:t.Point.convert(i.center||[0,0]),top:t.Point.convert(i.top||[0,0]),"top-left":t.Point.convert(i["top-left"]||[0,0]),"top-right":t.Point.convert(i["top-right"]||[0,0]),bottom:t.Point.convert(i.bottom||[0,0]),"bottom-left":t.Point.convert(i["bottom-left"]||[0,0]),"bottom-right":t.Point.convert(i["bottom-right"]||[0,0]),left:t.Point.convert(i.left||[0,0]),right:t.Point.convert(i.right||[0,0])}}return e(new t.Point(0,0))}(this.options.offset);if(!a){var s,l=this._container.offsetWidth,u=this._container.offsetHeight;s=n.y+o.bottom.y<u?["top"]:n.y>this._map.transform.height-u?["bottom"]:[],n.x<l/2?s.push("left"):n.x>this._map.transform.width-l/2&&s.push("right"),a=0===s.length?"bottom":s.join("-")}var h=n.add(o[a]).round();i.setTransform(this._container,oa[a]+" translate("+h.x+"px,"+h.y+"px)"),sa(this._container,a,"popup")}},r.prototype._onClose=function(){this.remove()},r}(t.Evented),wa={version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:Gr,OfflineMap:function(e){return function(e){return"string"==typeof e.style||e.style instanceof String?(i=e.style,new Promise(function(e,r){var n=new t.window.XMLHttpRequest;return n.open("GET",i,!0),n.setRequestHeader("Accept","application/json"),n.onerror=function(t){return r(t)},n.onload=function(){var t=0===n.responseURL.indexOf("file://");if((n.status>=200&&n.status<300||t)&&n.response)try{e(JSON.parse(n.response))}catch(t){r(t)}else r(new Error(n.statusText,n.status))},n.send(),n})).then(function(i){return t.extend({},e,{style:i})}):Promise.resolve(e);var i}(e).then(ia).then(function(e){return function(e){return new Promise(function(i){var r=t.extend({},e.style,{sources:{},layers:[]}),n=t.extend({},e,{style:r}),a=new Gr(n);console.log("创建空离线地图",n,a),a.once("load",function(){var e=new Promise(function(t){a.addSourceType("mbtiles",ea,function(){return t()})}),r=new Promise(function(e){a.addSourceType("rasteroffline",t.RasterTileSourceOffline,function(){return e()})});Promise.all([e,r]).then(function(){return i(a)})})})}(e).then((i=e.style,function(t){return Object.keys(i.sources).map(function(e){return t.addSource(e,i.sources[e])}),console.log("离线地图-加载数据源",i,t),t})).then(function(t){return function(e){return t.layers.map(function(t){return e.addLayer(t)}),console.log("离线地图-加载图层",t,e),e}}(e.style));var i})},NavigationControl:na,GeolocateControl:fa,AttributionControl:Or,ScaleControl:ya,FullscreenControl:_a,FpsControl:ga,Popup:ba,Marker:ua,Style:Ue,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,CRS:t.CRS,Projection:t.Projection,CanonicalTileID:t.CanonicalTileID,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 Ot.workerCount},set workerCount(t){Ot.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 wa}),i}()},function(t,e,i){t.exports={default:i(155),__esModule:!0}},function(t,e,i){t.exports={default:i(168),__esModule:!0}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e){var i=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++i+r).toString(36))}},function(t,e,i){var r=i(15).f,n=i(22),a=i(11)("toStringTag");t.exports=function(t,e,i){t&&!n(t=i?t:t.prototype,a)&&r(t,a,{configurable:!0,value:e})}},function(t,e,i){i(108);for(var r=i(10),n=i(21),a=i(27),o=i(11)("toStringTag"),s="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),l=0;l<s.length;l++){var u=s[l],h=r[u],c=h&&h.prototype;c&&!c[o]&&n(c,o,u),a[u]=a.Array}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=m(i(35)),n=m(i(37)),a=m(i(7)),o=m(i(4)),s=m(i(0)),l=m(i(2)),u=m(i(5)),h=m(i(29)),c=m(i(6)),p=i(1),f=m(i(8)),d=i(90),y=m(i(63));function m(t){return t&&t.__esModule?t:{default:t}}var v=function(t){function e(){return(0,s.default)(this,e),(0,u.default)(this,(e.__proto__||(0,o.default)(e)).apply(this,arguments))}return(0,c.default)(e,t),(0,l.default)(e,[{key:"onAdd",value:function(t){var e=this,i=this.layer.renderer;this.styleLayers=[],this.renderType=i.type,this.sourceIds=[],this._imageSourceManager=this._imageSourceManager?this._imageSourceManager:new y.default(this.innerView);var r=this._addInnerLayer();return r.then(function(){e._updateState()}),r}},{key:"onRemove",value:function(t){return(0,h.default)(e.prototype.__proto__||(0,o.default)(e.prototype),"onRemove",this).call(this,t),this._removeStyleLayers(),this._removeSources(),a.default.resolve(this)}},{key:"onUpdate",value:function(t){var e=this,i=this;return t.updateContent&&t.updateContent.forEach(function(t){if(t&&"property"===t.operationType)switch(t.name){case"opacity":case"visible":i._updateState()}if(t&&"method"===t.operationType)switch(t.name){case"refresh":e._updateState()}}),a.default.resolve(this)}},{key:"_requestMapboxglFrameUpdate",value:function(t){this.innerView&&this.innerView._update(t)}},{key:"_processData",value:function(){return new a.default(function(t){})}},{key:"_addInnerLayer",value:function(){var t=this;return this._processData().then(function(e){var i=t.layer,r=t,n=t.innerView;t.featureSet=e;var a=i.renderer;return r._initInnerLayer(i,n,e,a)})}},{key:"_initInnerLayer",value:function(t,e,i,r){var n=this;return new a.default(function(t){var i=void 0,r=function(){n._addSources(),t(n),i&&clearInterval(i)};e.loaded()?r():(e.once("load",r),i=setInterval(function(){e.loaded()&&r()},16))})}},{key:"_rendererChangeAction",value:function(t){t&&this._updateState()}},{key:"_updateState",value:function(t){var e=this.innerView,i=this.layer;if(e&&this.styleLayers){t||(t=i.renderer);var r=i._opacity,n=this._getLayerViewVisible(),a=e.style,o=this.styleLayers,s={featureSet:this.featureSet,imageSourceManager:this._imageSourceManager,updateState:this._updateState.bind(this)},l=(0,d.createStyleLayerObjectArray)(i.id,t,i.geometryType,n,r,s);if(0===l.length)throw new Error("创建样式图层列表失败,请检查Renderer的类型是否支持!");var u=!1;if(t.type===this.renderType&&0!==this.styleLayers.length||(u=!0,"cluster"!==t.type&&"cluster"!==this.renderType||this._triggerSourceClusterChange("cluster"===t.type)),o.length>0&&!u){var h=o.length===l.length,c=o.every(function(t){return l.findIndex(function(e){return e&&t&&e.id===t.id&&e.type===t.type})>-1});h&&c||(u=!0)}if(u){var p=null;if(o.length>0){var f=a._order.indexOf(o[o.length-1].id);f>-1&&f+1<a._order.length&&(p=a._order[f+1])}return this._removeStyleLayers(),this._addStyleLayers(l,p),void(this.renderType=t.type)}this._updateStyleLayers(e,o,l)}}},{key:"_updateStyleLayers",value:function(t,e,i){for(var a=t.style,o=!1,s=0;s<e.length;s++)for(var l=function(t){var l=e[s],u=i[t];return l.id===u.id&&a.hasLayer(u.id)?(0,n.default)(l)===(0,n.default)(u)?"continue":(u.paint&&(0,r.default)(u.paint).forEach(function(t){a.setPaintProperty(u.id,t,u.paint[t])}),u.layout&&(0,r.default)(u.layout).forEach(function(t){a.setLayoutProperty(u.id,t,u.layout[t])}),u.filter&&a.setFilter(u.id,u.filter),void(o=!0)):"continue"},u=0;u<i.length;u++)l(u);o&&(this._requestMapboxglFrameUpdate(!0),this.styleLayers=i)}},{key:"_convertSourceData",value:function(t){var e=t.features,i={type:"FeatureCollection",features:[]};return i.features=e.map(function(t){return f.default.convertToGeoJSON(t)}),i}},{key:"_addStyleLayers",value:function(t,e){var i=this.innerView;i._lazyInitEmptyStyle(),t.forEach(function(t){i.style.addLayer(t,e)}),this.styleLayers=t,this._requestMapboxglFrameUpdate(!0)}},{key:"_removeStyleLayers",value:function(){for(var t=this.innerView,e=0;e<this.styleLayers.length;e++){var i=this.styleLayers[e].id;if(t.style.hasLayer(i)){if(t.overlayLayersManager[i])return t._removeLayer(t.overlayLayersManager[i]),delete t.overlayLayersManager[i],this;t.style.removeLayer(i)}}this._requestMapboxglFrameUpdate(!0),this.styleLayers=[]}},{key:"_addSources",value:function(){var t=this.layer,e=t.renderer,i={type:"geojson",data:this._convertSourceData(this.featureSet)};e instanceof p.ClusterRenderer&&(i.cluster=!0,i.clusterRadius=e.radius),this.innerView.addSource(t.id,i),this.sourceIds.push(t.id)}},{key:"_removeSources",value:function(){for(var t=0;t<this.sourceIds.length;t++)this.innerView.removeSource(this.sourceIds[t]);this.sourceIds=[]}},{key:"_triggerSourceClusterChange",value:function(t){var e=this.innerView,i=this.layer,r=e.getSource(i.id);if(r){var n=r.workerOptions||{};n.cluster=t;var a=n.superclusterOptions||{};t&&(a.radius=16*i.renderer.radius),r.setData(this._convertSourceData(this.featureSet))}}},{key:"getStyleLayerIds",value:function(){return this.styleLayers.map(function(t){return t.id})}}]),e}(p.BaseRendererLayerView);e.default=v},function(t,e,i){var r=i(18),n=i(10).document,a=r(n)&&r(n.createElement);t.exports=function(t){return a?n.createElement(t):{}}},function(t,e,i){var r=i(18);t.exports=function(t,e){if(!r(t))return t;var i,n;if(e&&"function"==typeof(i=t.toString)&&!r(n=i.call(t)))return n;if("function"==typeof(i=t.valueOf)&&!r(n=i.call(t)))return n;if(!e&&"function"==typeof(i=t.toString)&&!r(n=i.call(t)))return n;throw TypeError("Can't convert object to primitive value")}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,i){var r=i(48),n=Math.min;t.exports=function(t){return t>0?n(r(t),9007199254740991):0}},function(t,e){var i=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:i)(t)}},function(t,e,i){var r=i(50)("keys"),n=i(40);t.exports=function(t){return r[t]||(r[t]=n(t))}},function(t,e,i){var r=i(3),n=i(10),a=n["__core-js_shared__"]||(n["__core-js_shared__"]={});(t.exports=function(t,e){return a[t]||(a[t]=void 0!==e?e:{})})("versions",[]).push({version:r.version,mode:i(32)?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,i){var r=i(14),n=i(66),a=i(51),o=i(49)("IE_PROTO"),s=function(){},l=function(){var t,e=i(44)("iframe"),r=a.length;for(e.style.display="none",i(72).appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),l=t.F;r--;)delete l.prototype[a[r]];return l()};t.exports=Object.create||function(t,e){var i;return null!==t?(s.prototype=r(t),i=new s,s.prototype=null,i[o]=t):i=l(),void 0===e?i:n(i,e)}},function(t,e,i){var r=i(31),n=i(11)("toStringTag"),a="Arguments"==r(function(){return arguments}());t.exports=function(t){var e,i,o;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(i=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),n))?i:a?r(e):"Object"==(o=r(e))&&"function"==typeof e.callee?"Arguments":o}},function(t,e,i){var r=i(53),n=i(11)("iterator"),a=i(27);t.exports=i(3).getIteratorMethod=function(t){if(void 0!=t)return t[n]||t["@@iterator"]||a[r(t)]}},function(t,e,i){"use strict";var r=i(39);t.exports.f=function(t){return new function(t){var e,i;this.promise=new t(function(t,r){if(void 0!==e||void 0!==i)throw TypeError("Bad Promise constructor");e=t,i=r}),this.resolve=r(e),this.reject=r(i)}(t)}},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,i){var r=i(9),n=i(3),a=i(25);t.exports=function(t,e){var i=(n.Object||{})[t]||Object[t],o={};o[t]=e(i),r(r.S+r.F*a(function(){i(1)}),"Object",o)}},function(t,e,i){"use strict";e.__esModule=!0;var r=o(i(131)),n=o(i(133)),a="function"==typeof n.default&&"symbol"==typeof r.default?function(t){return typeof t}:function(t){return t&&"function"==typeof n.default&&t.constructor===n.default&&t!==n.default.prototype?"symbol":typeof t};function o(t){return t&&t.__esModule?t:{default:t}}e.default="function"==typeof n.default&&"symbol"===a(r.default)?function(t){return void 0===t?"undefined":a(t)}:function(t){return t&&"function"==typeof n.default&&t.constructor===n.default&&t!==n.default.prototype?"symbol":void 0===t?"undefined":a(t)}},function(t,e,i){e.f=i(11)},function(t,e,i){var r=i(10),n=i(3),a=i(32),o=i(59),s=i(15).f;t.exports=function(t){var e=n.Symbol||(n.Symbol=a?{}:r.Symbol||{});"_"==t.charAt(0)||t in e||s(e,t,{value:o.f(t)})}},function(t,e,i){var r=i(34),n=i(30),a=i(19),o=i(45),s=i(22),l=i(65),u=Object.getOwnPropertyDescriptor;e.f=i(12)?u:function(t,e){if(t=a(t),e=o(e,!0),l)try{return u(t,e)}catch(t){}if(s(t,e))return n(!r.f.call(t,e),t[e])}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=l(i(13)),n=l(i(0)),a=i(1),o=i(20),s=i(17);function l(t){return t&&t.__esModule?t:{default:t}}var u=function t(){(0,n.default)(this,t)};u.addWMSLayer=function(t,e){var i=t.layer,r=t.innerView;(e=e||{}).layerView=t;var n=u.getSourcesAndStyleLayers(i,e);(0,s.addStyleToMapboxglMap)(n,r);var a=r.getLayer(n.layers[0].id);return a.sourceID=a.source,a},u.getSourcesAndStyleLayers=function(t,e){var i=(e=e||{}).layerView,n={service:"WMS",version:t.version,request:"GetMap",layers:t.layers,styles:t.styles,width:t.imageWidth,height:t.imageHeight,format:t.imageFormat,transparent:t.imageTransparency,crs:"EPSG:"+t.spatialReference.wkid,tokenKey:t.tokenKey,tokenValue:t.tokenValue},a=t.extensionOptions,s=void 0===a?{}:a;n=(0,r.default)(n,s);var l="source_"+t.id,h="layer_"+t.id,c=u.initLayerUrl(t.url,n),p=(0,o.getRasterSource)(c,t.imageWidth,null,null,null,e.clippingArea),f=(0,o.getRasterLayer)(h,l,t,i),d={};return d[l]=p,{sources:d,layers:[f]}},u.initAllRequestParams=function(t){t=(0,a.defaultValue)(t,{});var e=[];return e.push("service="+t.service),e.push("version="+t.version),e.push("request="+t.request),e.push("layers="+t.layers),e.push("width="+t.width),e.push("height="+t.height),e.push("format="+t.format),e.push("transparent="+t.transparent),t.styles?e.push("styles="+t.styles):e.push("styles="),"1.1.1"===t.version?e.push("srs="+t.crs):"1.3.0"===t.version&&e.push("crs="+t.crs),t.hasOwnProperty("tokenKey")&&t.hasOwnProperty("tokenValue")&&t.tokenValue&&e.push(t.tokenKey+"="+t.tokenValue),e},u.initLayerUrl=function(t,e){var i=t+"?";return i+=encodeURI(u.initAllRequestParams(e).join("&")),i+="&bbox={bbox}"},u.setVisible=function(t){(0,o.setVisible)(t)},u.setOpacity=function(t){(0,o.setOpacity)(t)},u.refresh=function(t){t.innerView.removeLayer(t.innerLayer.id),t.innerView.removeSource(t.innerLayer.sourceID),t.innerLayer=u.addWMSLayer(t,{})},u.removeLayer=function(t){(0,o.removeLayer)(t)},e.default=u},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=u(i(37)),n=u(i(23)),a=u(i(38)),o=u(i(7)),s=u(i(0)),l=u(i(2));function u(t){return t&&t.__esModule?t:{default:t}}var h=function(){function t(e){(0,s.default)(this,t),this.innerView=e,this.cacheImageDetla={},this.imageCount=0}return(0,l.default)(t,[{key:"getIconScale",value:function(t,e,i){if(this.cacheImageDetla[t]){var r=this.cacheImageDetla[t],n=r.width,a=r.height;return n&&a?Math.max(e/(n||1),i/(a||1)):.001}return.001}},{key:"hasImageCacheDetla",value:function(t){return!!this.cacheImageDetla[t]}},{key:"loadImage",value:function(t,e,i){var r=this;i=i||{};var n=this.innerView;return new o.default(function(a){n.loadImage(e,function(e,o){n.hasImage(t)?n.removeImage(t):r.imageCount++,e&&(i.notLoaded=!0,console.error("mapboxgl引擎loadImage方法加载图片资源加载失败"));var s=o||new Image(1,1),l={};i.pfsScale&&i.pfsSize&&(l.pixelRatio=Math.max(s.width,s.height)/i.pfsSize*i.pfsScale),n.addImage(t,s,l),a({id:t,width:s.width,height:s.height,keyObjects:i})})})}},{key:"updateImage",value:function(t,e,i){var r=this;i=i||{};var s=this.innerView;if(!t||!e)return o.default.resolve(null);if(this._shouldUpdateImage(t,e,i))return this.cacheImageDetla[t]={imageSource:e,totalUpdateCount:1},this.loadImage(t,e,i).then(function(e){if(r.cacheImageDetla[t])return r.cacheImageDetla[t].width=e.width,r.cacheImageDetla[t].height=e.height,r.cacheImageDetla[t].keyObjects=i,r.cacheImageDetla[t]});if(this.cacheImageDetla[t]&&this.cacheImageDetla[t].totalUpdateCount++,this.imageCount>2e3)for(var l=(0,a.default)(this.cacheImageDetla).sort(function(t,e){return t[1].totalUpdateCount-e[1].totalUpdateCount}),u=0;u<l.length;u++){var h=(0,n.default)(l[u],2),c=h[0],p=h[1];u<Math.floor(l.length/2)?(s.hasImage(c)&&(s.removeImage(c),this.imageCount--),delete this.cacheImageDetla[c]):p.totalUpdateCount=1}return o.default.resolve(null)}},{key:"_shouldUpdateImage",value:function(t,e,i){var n=this.cacheImageDetla[t];return!n||n&&(n.imageSource!==e||(0,r.default)(n.keyObjects)!==(0,r.default)(i))}}]),t}();e.default=h},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Screenshot=e.Popup=e.initializeCRS=e.EchartsLayer=e.MapVLayer=e.addStyleToMapboxglMap=e.initializeOptions=e.mapboxCustomCRS=e.SketchEditor=e.SketchEditorMapboxgl=e.MapView=e.MapViewMapboxgl=void 0;var r=i(1),n=i(98),a=i(195),o=i(85),s=i(17);r.Zondy.mapboxCustomCRS=o.mapboxCustomCRS,r.zondy.mapboxgl={},r.zondy.mapboxgl.VERSION="17.4.1",r.zondy.mapboxgl.MapView=n.MapView,r.zondy.mapboxgl.layer={},r.zondy.mapboxgl.layer.MapVLayer=s.MapVLayer,r.zondy.mapboxgl.layer.EchartsLayer=s.EchartsLayer,r.zondy.mapboxgl.tool={},r.zondy.mapboxgl.tool.sketch={},r.zondy.mapboxgl.tool.sketch.SketchEditor=a.SketchEditor,r.zondy.mapboxgl.tool.Screenshot=n.Screenshot,r.zondy.mapboxgl.widget={},r.zondy.mapboxgl.widget.Popup=n.Popup,r.zondy.mapboxgl.util={},r.zondy.mapboxgl.util.initializeOptions=s.initializeOptions,r.zondy.mapboxgl.util.addStyleToMapboxglMap=s.addStyleToMapboxglMap,r.zondy.mapboxgl.util.initializeCRS=s.initializeCRS,r.zondy.mapboxgl.util.mapboxCustomCRS=o.mapboxCustomCRS,r.Zondy.PluginVersion=r.zondy.mapboxgl.VERSION,r.Zondy.mapboxCustomCRS=o.mapboxCustomCRS,e.MapViewMapboxgl=n.MapView,e.MapView=n.MapView,e.SketchEditorMapboxgl=a.SketchEditor,e.SketchEditor=a.SketchEditor,e.mapboxCustomCRS=o.mapboxCustomCRS,e.initializeOptions=s.initializeOptions,e.addStyleToMapboxglMap=s.addStyleToMapboxglMap,e.MapVLayer=s.MapVLayer,e.EchartsLayer=s.EchartsLayer,e.initializeCRS=s.initializeCRS,e.Popup=n.Popup,e.Screenshot=n.Screenshot},function(t,e,i){t.exports=!i(12)&&!i(25)(function(){return 7!=Object.defineProperty(i(44)("div"),"a",{get:function(){return 7}}).a})},function(t,e,i){var r=i(15),n=i(14),a=i(26);t.exports=i(12)?Object.defineProperties:function(t,e){n(t);for(var i,o=a(e),s=o.length,l=0;s>l;)r.f(t,i=o[l++],e[i]);return t}},function(t,e,i){var r=i(22),n=i(19),a=i(103)(!1),o=i(49)("IE_PROTO");t.exports=function(t,e){var i,s=n(t),l=0,u=[];for(i in s)i!=o&&r(s,i)&&u.push(i);for(;e.length>l;)r(s,i=e[l++])&&(~a(u,i)||u.push(i));return u}},function(t,e,i){var r=i(31);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,e){},function(t,e,i){"use strict";var r=i(32),n=i(9),a=i(71),o=i(21),s=i(27),l=i(107),u=i(41),h=i(73),c=i(11)("iterator"),p=!([].keys&&"next"in[].keys()),f=function(){return this};t.exports=function(t,e,i,d,y,m,v){l(i,e,d);var g,_,x,b=function(t){if(!p&&t in E)return E[t];switch(t){case"keys":case"values":return function(){return new i(this,t)}}return function(){return new i(this,t)}},w=e+" Iterator",S="values"==y,M=!1,E=t.prototype,k=E[c]||E["@@iterator"]||y&&E[y],T=k||b(y),I=y?S?b("entries"):T:void 0,C="Array"==e&&E.entries||k;if(C&&(x=h(C.call(new t)))!==Object.prototype&&x.next&&(u(x,w,!0),r||"function"==typeof x[c]||o(x,c,f)),S&&k&&"values"!==k.name&&(M=!0,T=function(){return k.call(this)}),r&&!v||!p&&!M&&E[c]||o(E,c,T),s[e]=T,s[w]=f,y)if(g={values:S?T:b("values"),keys:m?T:b("keys"),entries:I},v)for(_ in g)_ in E||a(E,_,g[_]);else n(n.P+n.F*(p||M),e,g);return g}},function(t,e,i){t.exports=i(21)},function(t,e,i){var r=i(10).document;t.exports=r&&r.documentElement},function(t,e,i){var r=i(22),n=i(28),a=i(49)("IE_PROTO"),o=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=n(t),r(t,a)?t[a]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?o:null}},function(t,e,i){var r=i(14);t.exports=function(t,e,i,n){try{return n?e(r(i)[0],i[1]):e(i)}catch(e){var a=t.return;throw void 0!==a&&r(a.call(t)),e}}},function(t,e,i){var r=i(27),n=i(11)("iterator"),a=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||a[n]===t)}},function(t,e,i){var r=i(14),n=i(39),a=i(11)("species");t.exports=function(t,e){var i,o=r(t).constructor;return void 0===o||void 0==(i=r(o)[a])?e:n(i)}},function(t,e,i){var r,n,a,o=i(24),s=i(114),l=i(72),u=i(44),h=i(10),c=h.process,p=h.setImmediate,f=h.clearImmediate,d=h.MessageChannel,y=h.Dispatch,m=0,v={},g=function(){var t=+this;if(v.hasOwnProperty(t)){var e=v[t];delete v[t],e()}},_=function(t){g.call(t.data)};p&&f||(p=function(t){for(var e=[],i=1;arguments.length>i;)e.push(arguments[i++]);return v[++m]=function(){s("function"==typeof t?t:Function(t),e)},r(m),m},f=function(t){delete v[t]},"process"==i(31)(c)?r=function(t){c.nextTick(o(g,t,1))}:y&&y.now?r=function(t){y.now(o(g,t,1))}:d?(a=(n=new d).port2,n.port1.onmessage=_,r=o(a.postMessage,a,1)):h.addEventListener&&"function"==typeof postMessage&&!h.importScripts?(r=function(t){h.postMessage(t+"","*")},h.addEventListener("message",_,!1)):r="onreadystatechange"in u("script")?function(t){l.appendChild(u("script")).onreadystatechange=function(){l.removeChild(this),g.call(t)}}:function(t){setTimeout(o(g,t,1),0)}),t.exports={set:p,clear:f}},function(t,e){t.exports=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}}},function(t,e,i){var r=i(14),n=i(18),a=i(55);t.exports=function(t,e){if(r(t),n(e)&&e.constructor===t)return e;var i=a.f(t);return(0,i.resolve)(e),i.promise}},function(t,e,i){var r=i(11)("iterator"),n=!1;try{var a=[7][r]();a.return=function(){n=!0},Array.from(a,function(){throw 2})}catch(t){}t.exports=function(t,e){if(!e&&!n)return!1;var i=!1;try{var a=[7],o=a[r]();o.next=function(){return{done:i=!0}},a[r]=function(){return o},t(a)}catch(t){}return i}},function(t,e,i){var r=i(67),n=i(51).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,n)}},function(t,e,i){var r=i(12),n=i(26),a=i(19),o=i(34).f;t.exports=function(t){return function(e){for(var i,s=a(e),l=n(s),u=l.length,h=0,c=[];u>h;)i=l[h++],r&&!o.call(s,i)||c.push(t?[i,s[i]]:s[i]);return c}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=h(i(23)),n=h(i(13)),a=h(i(0)),o=i(1),s=i(20),l=h(i(8)),u=i(17);function h(t){return t&&t.__esModule?t:{default:t}}var c=function t(){(0,a.default)(this,t)};c.addIGSTileLayer=function(t,e){e=e||{};var i=t.layer,r=t.innerView;e.layerView=t;var n=c.getSourcesAndStyleLayers(i,e);(0,u.addStyleToMapboxglMap)(n,r);var a=r.getLayer(n.layers[0].id);return a.sourceID=a.source,a},c.getSourcesAndStyleLayers=function(t,e){var i=(e=e||{}).layerView,a={igsVersion:t._igsVersion,tokenKey:t.tokenKey,tokenValue:t.tokenValue},u=t.extensionOptions,h=void 0===u?{}:u;a=(0,n.default)(a,h);var p="source_"+t.id,f="layer_"+t.id,d=c.initLayerUrl(t.url,a),y=(0,s.getRasterSource)(d,t.tileSize,null,null,null,e.clippingArea),m=(0,s.getRasterLayer)(f,p,t,i),v=o.TileInfoUtil.getLevelRangeByTileInfo(t.tileInfo),g=(0,r.default)(v,2),_=g[0],x=g[1];y.minzoom=_,y.maxzoom=x,y.crs=l.default.createCRSByLayer(t);var b={};return b[p]=y,{sources:b,layers:[m]}},c.initLayerUrl=function(t,e){return"1.0"===e.igsVersion?(t+="/{z}/{y}/{x}",e.tokenKey&&e.tokenValue&&(t+="?"+e.tokenKey+"="+e.tokenValue)):(t+="/tileImage/{z}/{y}/{x}?f=image",e.tokenKey&&e.tokenValue&&(t+="&"+e.tokenKey+"="+e.tokenValue)),t},c.setVisible=function(t){(0,s.setVisible)(t)},c.setOpacity=function(t){(0,s.setOpacity)(t)},c.refresh=function(t){t.innerView.removeLayer(t.innerLayer.id),t.innerView.removeSource(t.innerLayer.sourceID),t.innerLayer=c.addIGSTileLayer(t,{})},c.removeLayer=function(t){(0,s.removeLayer)(t)},e.default=c},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){return t&&t.__esModule?t:{default:t}}(i(36)),n=i(1);var a=(0,i(85).mapboxCustomCRS)(r.default,n.Projection);e.default=a},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.mapboxCustomCRS=void 0;var r=u(i(29)),n=u(i(4)),a=u(i(0)),o=u(i(2)),s=u(i(5)),l=u(i(6));function u(t){return t&&t.__esModule?t:{default:t}}e.mapboxCustomCRS=function(t,e){var i=void 0,u=void 0;if(e.getProj||e.projectGeometry){var h=function(){for(var t="",e=1;e<=32;e++)t+=Math.floor(16*Math.random()).toString(16),8!==e&&12!==e&&16!==e&&20!==e||(t+="-");return t},c=e;i=function(t){function e(t,i){(0,a.default)(this,e);var r=(0,s.default)(this,(e.__proto__||(0,n.default)(e)).call(this)),o=i||{};if(i.def)r._wkt=o.def;else if(t){var l=t.match(/\d+$/);if(/^(EPSG|epsg)(:)?\d+$/.test(t)&&l){r._wkid=parseInt(l[0]);var u=c.getEPSGByWKID(r._wkid);u&&(r._wkt=u.strProject)}}else r._wkt=c.getEPSGByWKID(3857).strProject;return r._wkt&&(r._proj=c.getProj(t||h(),r._wkt)),r}return(0,l.default)(e,t),(0,o.default)(e,[{key:"project",value:function(t){var e=void 0,i=void 0;Array.isArray(t)?(e=t[0],i=t[1]):(e=t.lng,i=t.lat);var r=[e,i],n=void 0;return[(n=c.isCustomWKID(this._wkid)?c.projectPoints({points:[r],originWKID:4326,targetWKID:this._wkid})[0]:this._proj.forward(r))[0],n[1]]}},{key:"unproject",value:function(t){var e=void 0,i=void 0;Array.isArray(t)?(e=t[0],i=t[1]):(e=t.x,i=t.y);var r=[e,i],n=void 0;return[(n=c.isCustomWKID(this._wkid)?c.projectPoints({points:[r],originWKID:this._wkid,targetWKID:4326})[0]:this._proj.inverse([e,i]))[0],n[1]]}}]),e}(t.Projection),u=function(t){function e(){return(0,a.default)(this,e),(0,s.default)(this,(e.__proto__||(0,n.default)(e)).apply(this,arguments))}return(0,l.default)(e,t),(0,o.default)(e,[{key:"_parseParams",value:function(t){this._crsType="proj4",this.epsgCode=t[0],this.code=this.epsgCode,this.def=t[1];var e=t[2]||{};this._parseOptions(e)}},{key:"_parseOptions",value:function(t){if((0,r.default)(e.prototype.__proto__||(0,n.default)(e.prototype),"_parseOptions",this).call(this,t),this._resolutions=t.resolutions,Array.isArray(this._resolutions)){var i={};this._resolutions.forEach(function(t,e){i[e]=t}),this._resolutions=i}if(!this._resolutions)throw new Error("自定义坐标系时,未设置分辨率数组");if(!this.origin)throw new Error("自定义坐标系时,未设置原点");this.tileSize=t.tileSize||256}},{key:"_setProjection",value:function(){this.projection=new i(this.getEpsgCode(),{origin:this.origin,def:this.def})}}]),e}(t.CRS)}else{var p=e;i=function(t){function e(t,i){(0,a.default)(this,e);var r=(0,s.default)(this,(e.__proto__||(0,n.default)(e)).call(this)),o=(i||{}).def;if(!o)throw new Error("自定义参考系必须指定参数系信息def");if(r._def=o,!p)throw new Error("proj4对象不存在,自定义投影必须引入proj4对象");var l=r._isProj4Obj(t);return r._proj=l?t:r._projFromCodeDef(t,o),r}return(0,l.default)(e,t),(0,o.default)(e,[{key:"project",value:function(t){var e=void 0,i=void 0;return Array.isArray(t)?(e=t[0],i=t[1]):(e=t.lng,i=t.lat),this._proj.forward([e,i])}},{key:"unproject",value:function(t){var e=void 0,i=void 0;return Array.isArray(t)?(e=t[0],i=t[1]):(e=t.x,i=t.y),this._proj.inverse([e,i])}},{key:"_projFromCodeDef",value:function(t,e){if(e)p.defs(t,e);else if(void 0===p.defs[t]){var i=t.split(":");if(i.length>3&&(t=i[i.length-3]+":"+i[i.length-1]),void 0===p.defs[t])throw"No projection definition for code "+t}return p(t)}},{key:"_isProj4Obj",value:function(t){return void 0!==t.inverse&&void 0!==t.forward}}]),e}(t.Projection),u=function(t){function e(){return(0,a.default)(this,e),(0,s.default)(this,(e.__proto__||(0,n.default)(e)).apply(this,arguments))}return(0,l.default)(e,t),(0,o.default)(e,[{key:"_parseParams",value:function(t){this._crsType="proj4",this.epsgCode=t[0],this.code=this.epsgCode,this.def=t[1];var e=t[2]||{};this._parseOptions(e)}},{key:"_parseOptions",value:function(t){if((0,r.default)(e.prototype.__proto__||(0,n.default)(e.prototype),"_parseOptions",this).call(this,t),this._resolutions=t.resolutions,Array.isArray(this._resolutions)){var i={};this._resolutions.forEach(function(t,e){i[e]=t}),this._resolutions=i}if(!this._resolutions)throw new Error("自定义坐标系时,未设置分辨率数组");if(!this.origin)throw new Error("自定义坐标系时,未设置原点");this.tileSize=t.tileSize||256}},{key:"_setProjection",value:function(){this.projection=new i(this.getEpsgCode(),{origin:this.origin,def:this.def})}}]),e}(t.CRS)}return t.Proj||(t.Proj={}),t.Proj.CRS=u,t.Proj.Projection=i,u}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=l(i(13)),n=l(i(0)),a=l(i(8)),o=i(20),s=i(17);function l(t){return t&&t.__esModule?t:{default:t}}var u=function t(){(0,n.default)(this,t)};u.addArcGISTileLayer=function(t,e){e=e||{};var i=t.layer,r=t.innerView;e.layerView=t;var n=u.getSourcesAndStyleLayers(i,e);(0,s.addStyleToMapboxglMap)(n,r);var a=r.getLayer(n.layers[0].id);return a.sourceID=a.source,a},u.getSourcesAndStyleLayers=function(t,e){var i=(e=e||{}).layerView,n={tokenKey:t.tokenKey,tokenValue:t.tokenValue},s=t.extensionOptions,l=void 0===s?{}:s;n=(0,r.default)(n,l);var h="source_"+t.id,c="layer_"+t.id,p=u.initLayerUrl(t.url,n),f=(0,o.getRasterSource)(p,t.tileSize,null,null,null,e.clippingArea);f.crs=a.default.createCRSByLayer(t);var d=(0,o.getRasterLayer)(c,h,t,i),y={};return y[h]=f,{sources:y,layers:[d]}},u.initLayerUrl=function(t,e){return t+="/tile/{z}/{y}/{x}",e.tokenKey&&e.tokenValue&&(t+="?"+e.tokenKey+"="+e.tokenValue),t},u.setVisible=function(t){(0,o.setVisible)(t)},u.setOpacity=function(t){(0,o.setOpacity)(t)},u.refresh=function(t){t.innerView.removeLayer(t.innerLayer.id),t.innerView.removeSource(t.innerLayer.sourceID),t.innerLayer=u.addArcGISTileLayer(t,{})},u.removeLayer=function(t){(0,o.removeLayer)(t)},e.default=u},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=u(i(13)),n=u(i(37)),a=u(i(0)),o=i(1),s=i(20),l=i(17);function u(t){return t&&t.__esModule?t:{default:t}}var h=function t(){(0,a.default)(this,t)};h.addArcGISMapImageLayer=function(t){var e=t.layer,i=t.innerView,r={};r.layerView=t;var n=h.getSourcesAndStyleLayers(e,r);(0,l.addStyleToMapboxglMap)(n,i);var a=i.getLayer(n.layers[0].id);return a.sourceID=a.source,a},h.getSourcesAndStyleLayers=function(t,e){var i=(e=e||{}).layerView,a=t.extensionOptions,l=void 0===a?{}:a,u={layers:t.layers,width:t.imageWidth,height:t.imageHeight,tokenKey:t.tokenKey,tokenValue:t.tokenValue,format:t.imageFormat,imageSR:(0,o.getProjectionSrs)(t.spatialReference),transparent:t.imageTransparency,httpMethod:"GET",header:{}};t.httpMethod&&(u.httpMethod=t.httpMethod),t.headers&&(u.headers=JSON.parse((0,n.default)(t.headers))),u=(0,r.default)(u,l);var c="source_"+t.id,p="layer_"+t.id,f=h.initLayerUrl(t.url,u),d=(0,s.getRasterSource)(f.url,t.imageWidth,t.renderMode,void 0,f),y=(0,s.getRasterLayer)(p,c,t,i),m={};return m[c]=d,{sources:m,layers:[y]}},h.initAllRequestParams=function(t){var e=[];return(t=(0,o.defaultValue)(t,{})).hasOwnProperty("layers")&&e.push("layers="+t.layers),t.hasOwnProperty("transparent")&&e.push("transparent="+t.transparent),t.hasOwnProperty("imageSR")&&e.push("imageSR="+t.imageSR),t.hasOwnProperty("tokenKey")&&t.hasOwnProperty("tokenValue")&&t.tokenValue&&e.push(t.tokenKey+"="+t.tokenValue),e.push("size="+t.width+","+t.height),e.push("format="+t.format),e.push("f=image"),t.extensions&&t.extensions instanceof Array&&t.extensions.forEach(function(t){t.key&&t.value&&e.push(t.key+"="+t.value)}),e},h.initLayerUrl=function(t,e){var i=t+"/export",r=h.initAllRequestParams(e),n={};if("POST"===e.httpMethod){var a={};r.forEach(function(t){if(t&&t.includes("=")){var e=t.split("=");2===e.length&&(a[e[0]]=e[1])}}),a.bbox="0,0,0,0",n={url:i,data:a,method:e.httpMethod}}else i+="?bbox={bbox}",n={url:i+=encodeURI(r.join("&")),method:e.httpMethod};return e.headers&&(n.headers=e.headers),n},h.setVisible=function(t){(0,s.setVisible)(t)},h.setOpacity=function(t){(0,s.setOpacity)(t)},h.refresh=function(t){t.innerView.removeLayer(t.innerLayer.id),t.innerView.removeSource(t.innerLayer.sourceID),t.innerLayer=h.addArcGISMapImageLayer(t,{})},h.removeLayer=function(t){(0,s.removeLayer)(t)},e.default=h},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=h(i(23)),n=h(i(13)),a=h(i(0)),o=i(1),s=i(20),l=h(i(8)),u=i(17);function h(t){return t&&t.__esModule?t:{default:t}}var c=function t(){(0,a.default)(this,t)};c.addWMTSLayer=function(t,e){var i=t.layer,r=t.innerView;(e=e||{}).layerView=t;var n=c.getSourcesAndStyleLayers(i,e);(0,u.addStyleToMapboxglMap)(n,r);var a=r.getLayer(n.layers[0].id);return a.sourceID=a.source,a},c.getSourcesAndStyleLayers=function(t,e){var i=(e=e||{}).layerView,a=t.activeLayer,u={service:"WMTS",version:t.version,request:"GetTile",layer:a.identifier,style:a.styleId,format:a.imageFormat,tileMatrixSet:a.tileMatrixSetId,tileMatrix:"{z}",tileRow:"{y}",tileCol:"{x}",tokenKey:t.tokenKey,tokenValue:t.tokenValue};u.version||(u.version="1.0.0");var h=t.extensionOptions,p=void 0===h?{}:h;u=(0,n.default)(u,p);var f=t.getCurrentTileInfo(),d=f.size[0],y="source_"+t.id,m="layer_"+t.id,v=c.initLayerUrl(t.url,u),g=(0,s.getRasterSource)(v,d,null,null,null,e.clippingArea),_=(0,s.getRasterLayer)(m,y,t,i),x=o.TileInfoUtil.getLevelRangeByTileInfo(f),b=(0,r.default)(x,2),w=b[0],S=b[1];g.minzoom=w,g.maxzoom=S,g.crs=l.default.createCRSByLayer(t);var M={};return M[y]=g,{sources:M,layers:[_]}},c.initAllRequestParams=function(t){t=(0,o.defaultValue)(t,{});var e=[];return e.push("service="+t.service),e.push("version="+t.version),e.push("request="+t.request),e.push("layer="+encodeURIComponent(t.layer)),e.push("style="+encodeURIComponent(t.style)),e.push("format="+encodeURIComponent(t.format)),e.push("tileMatrixSet="+encodeURIComponent(t.tileMatrixSet)),e.push("tileMatrix="+t.tileMatrix),e.push("tileRow="+t.tileRow),e.push("tileCol="+t.tileCol),t.hasOwnProperty("tokenKey")&&t.hasOwnProperty("tokenValue")&&t.tokenValue&&e.push(t.tokenKey+"="+t.tokenValue),e},c.initLayerUrl=function(t,e){var i=t+"?";return i+=c.initAllRequestParams(e).join("&")},c.setVisible=function(t){(0,s.setVisible)(t)},c.setOpacity=function(t){(0,s.setOpacity)(t)},c.refresh=function(t){t.innerView.removeLayer(t.innerLayer.id),t.innerView.removeSource(t.innerLayer.sourceID),t.innerLayer=c.addWMTSLayer(t,{})},c.removeLayer=function(t){(0,s.removeLayer)(t)},e.default=c},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=c(i(35)),n=c(i(23)),a=c(i(13)),o=c(i(0)),s=i(1),l=i(20),u=c(i(8)),h=i(17);function c(t){return t&&t.__esModule?t:{default:t}}var p=function t(){(0,o.default)(this,t)};p.addWebTileLayer=function(t,e){var i=t.layer,r=t.innerView;(e=e||{}).layerView=t;var n=p.getSourcesAndStyleLayers(i,e);(0,h.addStyleToMapboxglMap)(n,r);var a=r.getLayer(n.layers[0].id);return a.sourceID=a.source,a},p.getSourcesAndStyleLayers=function(t,e){var i=(e=e||{}).layerView,r={};r[t.tokenKey]=t.tokenValue;var o=t.extensionOptions,h=void 0===o?{}:o;r=(0,a.default)(r,h);var c=p.initLayerUrl(t.url,r),f="source_"+t.id,d="layer_"+t.id,y=(0,l.getRasterSource)(c,t.tileSize,"",t.subDomains,null,e.clippingArea),m=s.TileInfoUtil.getLevelRangeByTileInfo(t.tileInfo),v=(0,n.default)(m,2),g=v[0],_=v[1];y.minzoom=g,y.maxzoom=_,y.crs=u.default.createCRSByLayer(t),"tms"===t.tileSliceType&&(y.scheme="tms");var x=(0,l.getRasterLayer)(d,f,t,i),b={};return b[f]=y,{sources:b,layers:[x]}},p.initLayerUrl=function(t,e){return(t=(t=(t=t.replace("col","x")).replace("row","y")).replace("level","z")).indexOf("?")<0&&(t+="?"),(0,r.default)(e).forEach(function(i){e[i]&&(t+="&"+i+"="+e[i])}),t},p.setVisible=function(t){(0,l.setVisible)(t)},p.setOpacity=function(t){(0,l.setOpacity)(t)},p.refresh=function(t){t.innerView.removeLayer(t.innerLayer.id),t.innerView.removeSource(t.innerLayer.sourceID),t.innerLayer=p.addWebTileLayer(t,{})},p.removeLayer=function(t){(0,l.removeLayer)(t)},e.default=p},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createStyleLayerObjectArray=void 0;var r=i(1),n=function(t){return t&&t.__esModule?t:{default:t}}(i(8));function a(t,e,i,r){for(;e.findIndex(function(t){return i.some(function(e){return e===t})})>-1;){r.index+=1;var n="calc_"+r.index,a=e.findIndex(function(t){return i.some(function(e){return e===t})}),o=t[e[a-1]]||(r.isNum?parseFloat(e[a-1]):e[a-1]),s=t[e[a+1]]||(r.isNum?parseFloat(e[a+1]):e[a+1]);t[n]=[e[a],o,s],r.key=n,r.expression=e.splice(a-1,3,n)}}function o(t,e,i){if(t)return i?["to-number",["get",t]]:["get",t];var r=function(t,e){try{var i=t,r=i.replace(/\s/g,"").match(/\$feature\.[^+-/*%>=<]+/g);if(!r||0===r.length)return null;var n={},o={index:0,key:null,isNum:e};r.forEach(function(t){o.index+=1;var r="calc_"+o.index;o.key=r,n[r]=e?["to-number",["get",t.split(".")[1]]]:["get",t.split(".")[1]],i=i.replace(t,""+r)});var s=i.match(/>=|<=|==|\+|-|\*|\/|>|<|=/);s&&s.length>0&&s.forEach(function(t){i=i.replace(t," "+t+" ")});var l=i.split(" ").filter(function(t){return""!==t});if(a(n,l,["*","/","%"],o),a(n,l,["+","-"],o),a(n,l,["<","<=",">",">="],o),a(n,l,["=="],o),o.key)return n[o.key]}catch(t){}}(e,i);return r||["get","undefined"]}function s(t,e,i,a,o,s){var l="";switch(s=s||{},t.type){case r.SymbolType.simpleLine:t instanceof r.SimpleLineSymbol||(t=new r.SimpleLineSymbol),function(t,e,i,a,o,s){var l=r.Color.fromColor(i.color);t["line-color"]=l.toCssRGBAString(),t["line-opacity"]=o,t["line-width"]=i.width,e["line-cap"]=i.cap,e["line-miter-limit"]=i.miterLimit,e["line-join"]=i.join;var u=n.default.convertLineStyle(i.style,"butt"===i.cap);u&&(t["line-dasharray"]=u),e.visibility=a?"visible":"none"}(e,i,t,a,o),l="line";break;case r.SymbolType.simpleFill:t instanceof r.SimpleFillSymbol||(t=new r.SimpleFillSymbol),function(t,e,i,n,a,o){var s=r.Color.fromColor(i.color),l=r.Color.fromColor(i.outline.color);if("solid"!==i.style&&i.style){var u=o.imageSourceManager;if(!u)throw new Error("mapboxgl转换图标符号时,未传入图片资源管理类");t["fill-pattern"]=i.id;var h=(0,r.createSimpleFillSymbolCanvas)(i,{lineWidth:1}).toDataURL();u.updateImage(i.id,h,{pattern:i.style,color:s.toCssRGBAString()})}else t["fill-color"]=s.toCssRGBAString();t["fill-opacity"]=a,t["fill-outline-color"]=l.toCssRGBAString(),e.visibility=n?"visible":"none"}(e,i,t,a,o,s),l="fill";break;case r.SymbolType.simpleMarker:t instanceof r.SimpleMarkerSymbol||(t=new r.SimpleMarkerSymbol),function(t,e,i,n,a,o){var s=i.xoffset,l=i.yoffset;t["circle-translate"]=[parseFloat(s),parseFloat(l)];var u=r.Color.fromColor(i.color);t["circle-opacity"]=a,t["circle-color"]=u.toCssRGBAString();var h=r.Color.fromColor(i.outline.color);t["circle-stroke-color"]=h.toCssRGBAString(),t["circle-stroke-opacity"]=a,t["circle-stroke-width"]=i.outline.width,t["circle-radius"]=i.size/2,e.visibility=n?"visible":"none"}(e,i,t,a,o),l="circle";break;case r.SymbolType.text:t instanceof r.TextSymbol||(t=new r.TextSymbol),function(t,e,i,n,a,o){var s=r.Color.fromColor(i.color),l=r.Color.fromColor(i.haloColor);switch(t["text-color"]=s.toCssRGBAString(),t["text-opacity"]=a,t["text-halo-color"]=l.toCssRGBAString(),t["text-halo-width"]=i.haloSize,e["text-field"]=i.text||"",e.visibility=n?"visible":"none",e["text-allow-overlap"]=!1,e["text-font"]=[i.font.family],e["text-size"]=i.font.size,e["text-justify"]=i.horizontalAlignment,e["text-letter-spacing"]=i.kerning?.1:0,e["text-rotate"]=i.rotated&&0!==i.angle?i.angle:0,e["text-offset"]=[i.xoffset,i.yoffset],e["text-line-height"]=i.lineHeight?1.2:0,e["text-max-width"]=(0,r.defaultValue)(i.lineWidth,192),e["text-anchor"]="center",i.verticalAlignment){case"top":switch(i.horizontalAlignment){case"left":e["text-anchor"]="top-left";break;case"right":e["text-anchor"]="top-right";break;default:e["text-anchor"]="top"}break;case"bottom":switch(i.horizontalAlignment){case"left":e["text-anchor"]="bottom-left";break;case"right":e["text-anchor"]="bottom-right";break;default:e["text-anchor"]="bottom"}break;default:switch(i.horizontalAlignment){case"left":e["text-anchor"]="left";break;case"right":e["text-anchor"]="right";break;default:e["text-anchor"]="center"}}}(e,i,t,a,o),l="symbol";break;case r.SymbolType.pictureMarker:t instanceof r.PictureMarkerSymbol||(t=new r.PictureMarkerSymbol),function(t,e,i,n,a,o){var s=(o=o||{}).imageSourceManager;if(!s)throw new Error("mapboxgl转换图标符号时,未传入图片资源管理类");var l=r.Color.fromColor(i.color);t["icon-color"]=l.toCssRGBAString(),t["icon-opacity"]=a,e["icon-allow-overlap"]=!1,e["icon-rotate"]=i.angle,e["icon-image"]=i.id,e["icon-offset"]=[i.xoffset,i.yoffset],e["icon-size"]=s.getIconScale(i.id,i.width,i.height),e.visibility=n?"visible":"none",s.updateImage(i.id,i.url).then(function(t){t&&o.updateState&&o.updateState()})}(e,i,t,a,o,s),l="symbol";break;case r.SymbolType.pictureFill:t instanceof r.PictureFillSymbol||(t=new r.PictureFillSymbol),function(t,e,i,n,a,o){var s=(o=o||{}).imageSourceManager;if(!s)throw new Error("mapboxgl转换图片填充符号时,未传入图片资源管理类");var l=r.Color.fromColor(i.outline.color);t["fill-pattern"]=i.id,t["fill-opacity"]=a,t["fill-translate"]=[i.xoffset,i.yoffset],t["fill-outline-color"]=l.toCssRGBAString(),e.visibility=n?"visible":"none";var u=Math.max(i.xscale,i.yscale),h=Math.max(i.width,i.height);s.updateImage(i.id,i.url,{pfsSize:h,pfsScale:u})}(e,i,t,a,o,s),l="fill"}return l}function l(t,e,i,n,a,o){var s=[],l=function(t,e){(e=(0,r.defaultValue)(e,{})).opacity=(0,r.defaultValue)(e.opacity,1);for(var i=t.clusterInfos,n=t.defaultSymbol,a={"circle-color":["step",["get","point_count"]],"circle-opacity":["step",["get","point_count"]],"circle-radius":["step",["get","point_count"]],"circle-stroke-color":["step",["get","point_count"]],"circle-stroke-opacity":["step",["get","point_count"]],"circle-stroke-width":["step",["get","point_count"]]},o=0;o<i.length;o++){var s=r.Color.fromColor(i[o].symbol.color);a["circle-color"].push(s.toCssRGBAString()),a["circle-color"].push(i[o].maxValue),a["circle-opacity"].push(s.alpha*e.opacity),a["circle-opacity"].push(i[o].maxValue),a["circle-radius"].push(i[o].symbol.size),a["circle-radius"].push(i[o].maxValue);var l=r.Symbol.fromJSON(i[o].symbol.outline);a["circle-stroke-color"].push(l.color.toCssRGBAString()),a["circle-stroke-color"].push(i[o].maxValue),a["circle-stroke-opacity"].push(l.color.alpha*e.opacity),a["circle-stroke-opacity"].push(i[o].maxValue),a["circle-stroke-width"].push(l.width),a["circle-stroke-width"].push(i[o].maxValue)}var u=r.Color.fromColor(n.color);a["circle-color"].push(u.toCssRGBAString()),a["circle-opacity"].push(1),a["circle-radius"].push(n.size);var h=r.Symbol.fromJSON(n.outline);return a["circle-stroke-color"].push(h.color.toCssRGBAString()),a["circle-stroke-opacity"].push(1),a["circle-stroke-width"].push(h.width),a}(e,{opacity:a});s.push({id:t+"_cluster",type:"circle",source:t,filter:["has","point_count"],paint:l,layout:{visibility:n?"visible":"none"}});var u=function(t){for(var e=t.clusterInfos,i=t.defaultLabelSymbol,n="宋体",a=0;a<e.length;a++){var o=r.Symbol.fromJSON(e[a].labelSymbol);o&&o.font&&o.font.family&&(n=o.font.family)}!n&&i&&i.font&&i.font.family&&(n=i.font.family);for(var s={"text-field":"{point_count}","text-font":[n,n],"text-size":["step",["get","point_count"]]},l=0;l<e.length;l++){var u=r.Symbol.fromJSON(e[l].labelSymbol);s["text-size"].push(u.font.size),s["text-size"].push(e[l].maxValue)}var h=30;return i&&i.font&&i.font.size&&(h=i.font.size),s["text-size"].push(h),s}(e);u.visibility=n?"visible":"none";var h=function(t,e){(e=(0,r.defaultValue)(e,{})).opacity=(0,r.defaultValue)(e.opacity,1);for(var i=t.clusterInfos,n={"text-opacity":1},a=0;a<i.length;a++){var o=r.Symbol.fromJSON(i[a].labelSymbol);n["text-opacity"]=o.color.alpha*e.opacity}return n}(e,{opacity:a,visible:n});return s.push({id:t+"_cluster_count",type:"symbol",source:t,filter:["has","point_count"],layout:u,paint:h}),e.defaultSymbol&&s.push({id:t+"_unclustered_point",type:"circle",source:t,filter:["!",["has","point_count"]],paint:function(t,e){(e=(0,r.defaultValue)(e,{})).opacity=(0,r.defaultValue)(e.opacity,1);var i=t.defaultSymbol,n=r.Color.fromColor(i.color),a=r.Symbol.fromJSON(i.outline),o=r.Color.fromColor(a.color);return{"circle-opacity":n.alpha*e.opacity,"circle-color":n.toCssRGBAString(),"circle-radius":i.size,"circle-stroke-width":a.width,"circle-stroke-color":o.toCssRGBAString(),"circle-stroke-opacity":o.alpha*e.opacity}}(e,{visible:n,opacity:a}),layout:{visibility:n?"visible":"none"}}),s}function u(t,e,i,r,n,a){var l=[];if(e){var u=o(e.field,e.valueExpression);return[{visible:e.defaultVisible,symbol:e.defaultSymbol,value:null}].concat(e.uniqueValueInfos).forEach(function(i){var o=i.visible,h=i.value,c=i.symbol;if(c){var p={},f={},d=s(c,p,f,r&&o,n,a),y=["==",u,h];if(e.defaultSymbol&&c.id===e.defaultSymbol.id){var m=e.uniqueValueInfos.map(function(t){return t.value});0===m.length?y=null:(y=["match",u],m.forEach(function(t){y.push(t,!1)}),y.push(!0))}if(d){var v={id:c.id,type:d,paint:p,layout:f,source:t};y&&(v.filter=y),l.push(v)}}}),l}}function h(t,e,i,n,a,l){var u=[];if(e){var h=o(e.field,e.valueExpression,!0);h=function(t,e){var i=t,n=e=e||{},a=n.normalizationField,o=n.normalizationTotal;switch(n.normalizationType){case r.NormalizationType.field:i=["/",i,["to-number",["get",a]]];break;case r.NormalizationType.log:i=["log10",t];break;case r.NormalizationType.percentOfTotal:i=["*",i,1/o,100]}return i}(h,{normalizationField:e.normalizationField,normalizationTotal:e.normalizationTotal,normalizationType:e.normalizationType});var c=e.classBreakInfos.map(function(t){return t});c.sort(function(t,e){return t.maxValue-e.maxValue});var p=void 0,f=[];return c.forEach(function(t){var e=t.minValue,i=t.maxValue;if(e>i)throw new Error("分段专题图分段信息错误,最大值小于最小值");if(void 0===p)p=i;else{if(e<p)throw new Error("分段专题图分段信息错误,相邻分段值重叠");e!==p&&f.push(["all",[">=",h,p],["<",h,e]])}}),0!==c.length&&(f.unshift(["<",h,c[0].minValue]),f.push([">=",h,c[c.length-1].maxValue])),[{visible:e.defaultVisible,symbol:e.defaultSymbol,maxValue:NaN,minValue:NaN}].concat(c).forEach(function(i){var r=i.visible,o=i.maxValue,c=i.minValue,p=i.symbol;if(p){var d={},y={},m=s(p,d,y,n&&r,a,l),v=["all",[">=",h,c],["<",h,o]];if(e.defaultSymbol&&p.id===e.defaultSymbol.id&&(v=0===f.length?null:["any"].concat(f)),m){var g={id:p.id,type:m,paint:d,layout:y,source:t};v&&(g.filter=v),u.push(g)}}}),u}}function c(t,e,i,n,a,o){if(!(o=o||{}).featureSet)throw new Error("随机专题图要素数据集参数未传入");return u(t,function(t,e){for(var i=e.features,n=[],a=0;a<i.length;a++){var o=void 0;switch(i[a].geometry.type){case r.GeometryType.polygon:case r.GeometryType.multiPolygon:case r.GeometryType.extent:case r.GeometryType.circle:default:o={value:i[a].id,symbol:new r.SimpleFillSymbol({id:i[a].id,color:new r.Color(parseInt(255*Math.random()),parseInt(255*Math.random()),parseInt(255*Math.random()),1)})};break;case r.GeometryType.lineString:case r.GeometryType.multiLineString:o={value:i[a].id,symbol:new r.SimpleLineSymbol({id:i[a].id,color:new r.Color(parseInt(255*Math.random()),parseInt(255*Math.random()),parseInt(255*Math.random()),1),width:3})};break;case r.GeometryType.point:case r.GeometryType.multiPoint:o={value:i[a].id,symbol:new r.SimpleMarkerSymbol({id:i[a].id,color:new r.Color(parseInt(255*Math.random()),parseInt(255*Math.random()),parseInt(255*Math.random()),1)})}}n.push(o)}return new r.UniqueValueRenderer({field:"id",uniqueValueInfos:n})}(0,o.featureSet),0,n,a,o)}e.createStyleLayerObjectArray=function(t,e,i,n,a,p){var f=[];if(p=p||{},!e||!i)return f;switch(e.type){case r.RendererType.simple:f=function(t,e,i,r,n,a){var o=[];if(e&&e.symbol){var l={},u={},h=s(e.symbol,l,u,r,n,a);return h&&o.push({id:e.symbol.id,type:h,paint:l,layout:u,source:t}),o}}(t,e,0,n,a,p);break;case r.RendererType.classBreak:f=h(t,e,0,n,a,p);break;case r.RendererType.uniqueValue:f=u(t,e,0,n,a,p);break;case r.RendererType.rank:f=function(t,e,i,n,a,l){var u=[];if(e&&e.symbol){var h=l.imageSourceManager;if(!h)throw new Error("mapboxgl转换图片填充符号时,未传入图片资源管理类");var c={},p={},f=e.symbol,d=s(f,c,p,n,a,l);if(d){var y={id:f.id,type:d,paint:c,layout:p,source:t},m=e.minSize,v=e.maxSize,g=e.maxDataValue,_=e.minDataValue,x=e.field,b=e.valueExpression;if(void 0===g||void 0===_)throw new Error("mapboxgl上等级符号渲染器必须设置maxDataValue,minDataValue最大最小数据值");var w=o(x,b,!0);switch(f.type){case r.SymbolType.pictureMarker:y.layout["icon-size"]=["interpolate",["linear"],w,_,h.getIconScale(f.id,m,m),g,h.getIconScale(f.id,v,v)];break;case r.SymbolType.text:y.layout["text-size"]=["interpolate",["linear"],w,_,m,g,v];break;case r.SymbolType.simpleMarker:y.paint["circle-radius"]=["interpolate",["linear"],w,_,m/2,g,v/2]}u.push(y)}return u}}(t,e,0,n,a,p);break;case r.RendererType.random:f=c(t,0,0,n,a,p);break;case r.RendererType.cluster:f=l(t,e,0,n,a);break;default:r.Log.error("未定义的Renderer类型")}return f}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=d(i(38)),n=d(i(35)),a=d(i(171)),o=d(i(7)),s=d(i(0)),l=d(i(2)),u=i(1),h=d(i(8)),c=d(i(174)),p=d(i(63)),f=i(64);function d(t){return t&&t.__esModule?t:{default:t}}var y=function(){function t(e){var i=this;(0,s.default)(this,t),e=(0,u.defaultValue)(e,{}),this.id=e.id||(0,u.getGUID)(),this._opacity=e.opacity||1,this._visible=e.visible||!0,this._isLoaded=!1,this.renderTypes=["fill","line","circle","text","icon","fill-picture"],this._sourceMetaDatas={},this.renderTypes.forEach(function(t){var e={};e.sourceId=i.id+"_"+t,e.featureCollection=[],e.layerId=i.id+"_"+t+"_layer",e.renderType=t;var r=t;"text"!==r&&"icon"!==r||(r="symbol"),"fill-picture"===r&&(r="fill"),e.mapboxglStyleType=r,i._sourceMetaDatas[t]=new c.default(e)})}return(0,l.default)(t,[{key:"onAdd",value:function(t){var e=this;if(t){this._map=t;var i=this;return this._imageSourceManager=new p.default(t),new o.default(function(r){var n=void 0,a=function(){!function(){if(!i._isLoaded){var e=i._getSourcesAndLayers();(0,f.addStyleToMapboxglMap)(e,t),i._isLoaded=!0,i._refreshSourceAndLayers()}}(),r(e),n&&clearInterval(n)};t.loaded()?a():(t.once("load",a),n=setInterval(function(){t.loaded()&&a()},16))})}}},{key:"_getSourcesAndLayers",value:function(){var t=this,e={},i=[];return this.renderTypes.forEach(function(r){var n=t._sourceMetaDatas[r];"text"!==r&&"icon"!==r||(r="symbol"),"fill-picture"===r&&(r="fill"),e[n.sourceId]={type:"geojson",data:{type:"FeatureCollection",features:[]}},i.push({id:n.layerId,source:n.sourceId,type:r})}),{sources:e,layers:i}}},{key:"onRemove",value:function(t){var e=this;t&&this._isLoaded&&this.renderTypes.forEach(function(i){var r=e._sourceMetaDatas[i];t.removeLayer(r.layerId),t.removeSource(r.sourceId)})}},{key:"getStyleLayerIds",value:function(){var t=this,e=[];return this.renderTypes.forEach(function(i){var r=t._sourceMetaDatas[i];e.push(r.layerId)}),e}},{key:"add",value:function(t){var e=this;this._map&&this._isLoaded&&(Array.isArray(t)?t.forEach(function(t){e._updateGraphicToCollection(t)}):this._updateGraphicToCollection(t),this._refreshSourceAndLayers())}},{key:"_removeGraphicsToCollection",value:function(t){for(var e=(0,a.default)(this._sourceMetaDatas),i=function(i){for(var r=e[i],n=r.featureCollection,a=[],o=0;o<n.length;o++){var s=n[o];t.indexOf(s)>-1&&a.push(o)}a.length>0&&(r.featureCollection=n.filter(function(t,e){return-1===a.indexOf(e)}),r.setSourceDirty(!0))},r=0;r<e.length;r++)i(r)}},{key:"update",value:function(t,e){if(this._map&&this._isLoaded&&t){for(var i=Array.isArray(t)?t:[t],r=0;r<i.length;r++){var n=i[r],a=e[r]||{},o=this._updateGraphicToCollection(n);o&&(a.geometryUpdated&&o.setSourceDirty(!0),a.symbolUpdated&&o.setStyleLayerDirty(!0))}this._refreshSourceAndLayers()}}},{key:"_updateGraphicToCollection",value:function(t){var e=void 0;if(t&&t instanceof u.Feature){if(t.geometry){switch(t.geometry.type){case u.GeometryType.multiPoint:case u.GeometryType.point:e=this._dividePointGraphic(t);break;case u.GeometryType.multiLineString:case u.GeometryType.lineString:e=this._dividePolylineGraphic(t);break;case u.GeometryType.extent:case u.GeometryType.circle:case u.GeometryType.multiPolygon:case u.GeometryType.polygon:e=this._dividePolygonGraphic(t)}return e}u.Log.error("几何不存在")}}},{key:"remove",value:function(t){this._map&&this._isLoaded&&t&&(Array.isArray(t)?this._removeGraphicsToCollection(t):this._removeGraphicsToCollection([t]),this._refreshSourceAndLayers())}},{key:"removeAll",value:function(){if(this._map&&this._isLoaded){for(var t=(0,a.default)(this._sourceMetaDatas),e=0;e<t.length;e++){var i=t[e];i.featureCollection=[],i.setDirty(!0)}this._refreshSourceAndLayers()}}},{key:"_refreshSourceAndLayers",value:function(){var t=this,e=(0,n.default)(this._sourceMetaDatas);if(!e.some(function(e){return t._sourceMetaDatas[e].getDirty()}))return!1;if(!this._map)return!1;var i=this._map;return e.forEach(function(e){var r=t._sourceMetaDatas[e];if(r.getStyleLayerDirty()&&(t.setSourceMetaDataStyle(r,!0),r.setStyleLayerDirty(!1)),r.getSourceDirty()){var n=r.sourceId,a=r.featureCollection;i.getSource(n).setData({type:"FeatureCollection",features:a.map(function(t){return h.default.convertToGeoJSON(t)})}),r.setSourceDirty(!1)}}),i._update(!0),!0}},{key:"setSourceMetaDataStyle",value:function(t,e){var i={},n={},a={};switch(t.renderType){case"circle":this._setCircleStyle(t,n,a);break;case"line":this._setLineStyle(t,n,a);break;case"fill":this._setFillStyle(t,n,a);break;case"text":this._setTextStyle(t,n,a);break;case"icon":this._setIconStyle(t,n,a);break;case"fill-picture":this._setFillPictureStyle(t,n,a)}if(i.type=t.mapboxglStyleType,i.id=t.layerId,i.paint=n,i.layout=a,i.source=t.sourceId,e&&this._map&&this._map.style){for(var o=this._map.style,s=t.layerId,l=(0,r.default)(n),u=(0,r.default)(a),h=0;h<l.length;h++)o.setPaintProperty(s,l[h][0],l[h][1]);for(var c=0;c<u.length;c++)o.setLayoutProperty(s,u[c][0],u[c][1])}return i}},{key:"_setCircleStyle",value:function(t,e,i){var r=t.layerId,n=t.featureCollection,a=this._opacity,o=this._visible,s={"circle-color":{values:[],def:"#000000"},"circle-opacity":{values:[],def:1},"circle-stroke-color":{values:[],def:"#000000"},"circle-stroke-opacity":{values:[],def:1},"circle-stroke-width":{values:[],def:0},"circle-radius":{values:[],def:5}};n.forEach(function(t){var e=t.id,i=t.symbol;i instanceof u.SimpleMarkerSymbol||(u.Log.info("不支持类型为"+i.type+"的符号!"),i=new u.SimpleMarkerSymbol({id:i.id}));var r=h.default.applyVisibleAndOpacityToColor(i.color,o,a);s["circle-color"].values.push(e,r.toCssRGBString()),s["circle-opacity"].values.push(e,r.alpha);var n=h.default.applyVisibleAndOpacityToColor(i.outline.color,o,a);s["circle-stroke-color"].values.push(e,n.toCssRGBString()),s["circle-stroke-opacity"].values.push(e,n.alpha),s["circle-stroke-width"].values.push(e,i.outline.width),s["circle-radius"].values.push(e,i.size/2)}),this._setLayoutAndPaintCaches(r,s,{},e,i)}},{key:"_setLineStyle",value:function(t,e,i){var r=t.layerId,n=t.featureCollection,a=this._opacity,o=this._visible,s={"line-color":{values:[],def:"#000000"},"line-width":{values:[],def:1},"line-opacity":{values:[],def:1}},l={"line-join":{values:[],def:"round"}};n.forEach(function(t){var e=t.id,i=t.symbol;i instanceof u.SimpleLineSymbol||(u.Log.info("不支持类型为"+i.type+"的符号!"),i=new u.SimpleLineSymbol({id:i.id}));var r=h.default.applyVisibleAndOpacityToColor(i.color,o,a);s["line-color"].values.push(e,r.toCssRGBString()),s["line-opacity"].values.push(e,r.alpha),s["line-width"].values.push(e,i.width),l["line-join"].values.push(e,i.join)}),this._setLayoutAndPaintCaches(r,s,l,e,i)}},{key:"_setFillStyle",value:function(t,e,i){var r=t.layerId,n=t.featureCollection,a=this._opacity,o=this._visible,s={"fill-color":{values:[],def:"#ffffff"},"fill-opacity":{values:[],def:.25},"fill-outline-color":{values:[],def:"#000000"}};n.forEach(function(t){var e=t.id,i=t.symbol;i instanceof u.SimpleFillSymbol||(u.Log.info("不支持类型为"+i.type+"的符号!"),i=new u.SimpleFillSymbol({id:i.id}));var r=h.default.applyVisibleAndOpacityToColor(i.color,o,a),n=h.default.applyVisibleAndOpacityToColor(i.outline.color,o,a);s["fill-color"].values.push(e,r.toCssRGBString()),s["fill-opacity"].values.push(e,r.alpha),s["fill-outline-color"].values.push(e,n.toCssRGBAString())}),this._setLayoutAndPaintCaches(r,s,{},e,i)}},{key:"_setTextStyle",value:function(t,e,i){var r=t.layerId,n=t.featureCollection,a=this._opacity,o=this._visible,s={"text-color":{values:[],def:"#000000"},"text-opacity":{values:[],def:1},"text-halo-color":{values:[],def:"#000000"},"text-halo-width":{values:[],def:0}},l={"text-field":{values:[],def:""},"text-size":{values:[],def:12},"text-justify":{values:[],def:"center"},"text-letter-spacing":{values:[],def:0},"text-rotate":{values:[],def:0}};n.forEach(function(t){var e=t.id,i=t.symbol;i instanceof u.TextSymbol||(u.Log.info("不支持类型为"+i.type+"的符号!"),i=new u.TextSymbol({id:i.id}));var r=h.default.applyVisibleAndOpacityToColor(i.color,o,a),n=h.default.applyVisibleAndOpacityToColor(i.haloColor,o,a);s["text-color"].values.push(e,r.toCssRGBString()),s["text-opacity"].values.push(e,r.alpha),s["text-halo-color"].values.push(e,n.toCssRGBAString()),s["text-halo-width"].values.push(e,i.haloSize),l["text-field"].values.push(e,i.text),l["text-allow-overlap"]=!1,l["text-font"]=[i.font.family,"微软雅黑"],l["text-size"].values.push(e,i.font.size),l["text-justify"].values.push(e,i.horizontalAlignment),l["text-letter-spacing"].values.push(e,i.kerning?.1:0),l["text-rotate"].values.push(e,i.rotated&&0!==i.angle?i.angle:0)}),this._setLayoutAndPaintCaches(r,s,l,e,i,["text-allow-overlap","text-font"])}},{key:"_setIconStyle",value:function(t,e,i){var r=this._imageSourceManager,n=t.layerId,a=t.featureCollection,o=this._opacity,s=this._visible,l={"icon-color":{values:[],def:"#000000"},"icon-opacity":{values:[],def:1}},c={"icon-size":{values:[],def:.001},"icon-rotate":{values:[],def:0},"icon-image":{values:[],def:"marker-15"}},p=[];a.forEach(function(t){var e=t.id,i=t.symbol;i instanceof u.PictureMarkerSymbol||(u.Log.info("不支持类型为"+i.type+"的符号!"),i=new u.PictureMarkerSymbol({id:i.id}));var n=h.default.applyVisibleAndOpacityToColor(i.color,s,o);l["icon-color"].values.push(e,n.toCssRGBString()),l["icon-opacity"].values.push(e,n.alpha),c["icon-allow-overlap"]=!1;var a=i.id;c["icon-size"].values.push(e,r.getIconScale(a,i.width,i.height)),c["icon-image"].values.push(e,a),p.push({url:i.url,id:i.id,featureId:e,width:i.width,height:i.height})}),this._setLayoutAndPaintCaches(n,l,c,e,i,["icon-allow-overlap"]),p.forEach(function(e){r.updateImage(e.id,e.url).then(function(i){if(i){var n=r.innerView,a=n.getLayer(t.layerId);if(a){var o=a.getLayoutProperty("icon-size"),s=o.indexOf(e.featureId);s<=-1||s+1>=o.length||(o[s+1]=r.getIconScale(e.id,e.width,e.height),n.setLayoutProperty(t.layerId,"icon-size",o))}}})})}},{key:"_setFillPictureStyle",value:function(t,e,i){var r=t.layerId,n=t.featureCollection,a=this._imageSourceManager,o=this._opacity,s=this._visible,l={"fill-opacity":{values:[],def:.25},"fill-pattern":{values:[],def:""},"fill-outline-color":{values:[],def:"#000000"}};n.forEach(function(t){var e=t.id,i=t.symbol;i instanceof u.PictureFillSymbol||i instanceof u.SimpleFillSymbol||(u.Log.info("不支持类型为"+i.type+"的符号!"),i=new u.PictureFillSymbol({id:i.id}));var r=i.type===u.SymbolType.pictureFill,n=h.default.applyVisibleAndOpacityToColor(i.color,s,o),c=h.default.applyVisibleAndOpacityToColor(i.outline.color,s,o);if(l["fill-opacity"].values.push(e,n.alpha),l["fill-outline-color"].values.push(e,c.toCssRGBAString()),l["fill-pattern"].values.push(e,i.id),r){var p=Math.max(i.xscale,i.yscale),f=Math.max(i.width,i.height);a.updateImage(i.id,i.url,{pfsSize:f,pfsScale:p})}else{var d=(0,u.createSimpleFillSymbolCanvas)(i,{lineWidth:1}).toDataURL();a.updateImage(i.id,d,{pattern:i.style,color:n.toCssRGBAString()})}}),this._setLayoutAndPaintCaches(r,l,{},e,i)}},{key:"_setLayoutAndPaintCaches",value:function(t,e,i,r,n,a){a||(a=[]);var o=function(t){if(a.findIndex(function(e){return e===t})>-1)r[t]=e[t];else if(e[t].values.length>0){var i=[];i.push("match"),i.push(["get","id"]),(i=i.concat(e[t].values)).push(e[t].def),r[t]=i}else r[t]=e[t].def};for(var s in e)o(s);var l=function(t){if(a.findIndex(function(e){return e===t})>-1)n[t]=i[t];else if(i[t].values.length>0){var e=[];e.push("match"),e.push(["get","id"]),(e=e.concat(i[t].values)).push(i[t].def),n[t]=e}else n[t]=i[t].def};for(var s in i)l(s)}},{key:"_dividePointGraphic",value:function(t){var e=t.symbol,i=!1,r=this._sourceMetaDatas.circle;switch(e.type){case u.SymbolType.simpleMarker:i=this._replaceSourceLayer(t,"circle"),r=this._sourceMetaDatas.circle;break;case u.SymbolType.text:i=this._replaceSourceLayer(t,"text"),r=this._sourceMetaDatas.text;break;case u.SymbolType.pictureMarker:i=this._replaceSourceLayer(t,"icon"),r=this._sourceMetaDatas.icon}i||(r.featureCollection.push(t),r.setDirty(!0));return r}},{key:"_replaceSourceLayer",value:function(t,e){var i=this.renderTypes,r=this._hasGraphicInCollection(i,t);if(r){if(r.renderType===e)return!0;this._removeGraphicsToCollection([t])}return!1}},{key:"_dividePolylineGraphic",value:function(t){var e=this._hasGraphicInCollection(["line"],t),i=this._sourceMetaDatas.line;e||(i.featureCollection.push(t),i.setDirty(!0));return i}},{key:"_dividePolygonGraphic",value:function(t){var e=!1,i=t.symbol,r=this._sourceMetaDatas.fill,n=i.type;switch(n===u.SymbolType.simpleFill&&"solid"!==i.style&&(n=u.SymbolType.pictureFill),n){case u.SymbolType.simpleMarker:e=this._replaceSourceLayer(t,"circle"),r=this._sourceMetaDatas.circle;break;case u.SymbolType.text:e=this._replaceSourceLayer(t,"text"),r=this._sourceMetaDatas.text;break;case u.SymbolType.pictureMarker:e=this._replaceSourceLayer(t,"icon"),r=this._sourceMetaDatas.icon;break;case u.SymbolType.pictureFill:e=this._replaceSourceLayer(t,"fill-picture"),r=this._sourceMetaDatas["fill-picture"];break;case u.SymbolType.simpleFill:e=this._replaceSourceLayer(t,"fill"),r=this._sourceMetaDatas.fill}e||(r.featureCollection.push(t),r.setDirty(!0));return r}},{key:"_hasGraphicInCollection",value:function(t,e){for(var i=Array.isArray(t)?t:[t],r=void 0,n=0;n<i.length;n++){var a=this._sourceMetaDatas[i[n]];if(!a)break;if(a.featureCollection.indexOf(e)>-1){r=a;break}}return r}},{key:"_updatePaintAndLayoutStyles",value:function(){for(var t=(0,a.default)(this._sourceMetaDatas),e=0;e<t.length;e++){t[e].setStyleLayerDirty(!0)}this._refreshSourceAndLayers()}},{key:"_getBottomLayer",value:function(){return this._sourceMetaDatas[this.renderTypes[0]]}},{key:"opacity",set:function(t){this._opacity=t,this._updatePaintAndLayoutStyles()},get:function(){return this._opacity}},{key:"visible",set:function(t){this._visible=t,this._updatePaintAndLayoutStyles()},get:function(){return this._visible}}]),t}();e.default=y},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=s(i(0)),n=s(i(2)),a=s(i(36)),o=s(i(175));function s(t){return t&&t.__esModule?t:{default:t}}var l=function(){function t(e,i,n){(0,r.default)(this,t),n=n||{},this.map=e,this.layerID=n.layerID,delete n.layerID,this.mapvBaseLayer=new o.default(e,i,n,this),this.mapVOptions=n,this.initDevicePixelRatio(),this.canvas=this._createCanvas(),this.render=this.render.bind(this),this.bindEvent(),this.mapContainer=e.getCanvasContainer(),this.mapContainer.appendChild(this.canvas),this._reset()}return(0,n.default)(t,[{key:"initDevicePixelRatio",value:function(){this.devicePixelRatio=window.devicePixelRatio||1}},{key:"bindEvent",value:function(){var t=this.map;this.innerMoveStart=this.moveStartEvent.bind(this),this.innerMoveEnd=this.moveEndEvent.bind(this),this.innnerZoomStart=this.zoomStartEvent.bind(this),this.innnerZoomEnd=this.zoomEndEvent.bind(this),this.innnerRotateStart=this.rotateStartEvent.bind(this),this.innnerRotateEnd=this.rotateEndEvent.bind(this),this.innerResize=this.resizeEvent.bind(this),this.innerRemove=this.removeEvent.bind(this),t.on("resize",this.innerResize),t.on("zoomstart",this.innnerZoomStart),t.on("zoomend",this.innnerZoomEnd),t.on("rotatestart",this.innnerRotateStart),t.on("rotateend",this.innnerRotateEnd),t.on("movestart",this.innerMoveStart),t.on("moveend",this.innerMoveEnd),this.map.on("remove",this.innerRemove)}},{key:"unbindEvent",value:function(){var t=this.map;t.off("resize",this.innerResize),t.off("zoomstart",this.innnerZoomStart),t.off("zoomend",this.innnerZoomEnd),t.off("rotatestart",this.innnerRotateStart),t.off("rotateend",this.innnerRotateEnd),t.off("movestart",this.innerMoveStart),t.off("moveend",this.innerMoveEnd)}},{key:"moveStartEvent",value:function(){this.mapvBaseLayer.animatorMovestartEvent(),this._unvisiable()}},{key:"moveEndEvent",value:function(){this.mapvBaseLayer.animatorMoveendEvent(),this._reset(),this._visiable()}},{key:"zoomStartEvent",value:function(){this._unvisiable()}},{key:"zoomEndEvent",value:function(){this._unvisiable()}},{key:"rotateStartEvent",value:function(){this.mapvBaseLayer.animatorMovestartEvent(),this._unvisiable()}},{key:"rotateEndEvent",value:function(){this.mapvBaseLayer.animatorMoveendEvent(),this._reset(),this._visiable()}},{key:"resizeEvent",value:function(){this._reset(),this._visiable()}},{key:"removeEvent",value:function(){this.mapContainer.removeChild(this.canvas)}},{key:"addData",value:function(t,e){this.mapvBaseLayer.addData(t,e)}},{key:"updateData",value:function(t,e){this.mapvBaseLayer.updateData(t,e)}},{key:"getData",value:function(){return this.mapvBaseLayer&&(this.dataSet=this.mapvBaseLayer.getData()),this.dataSet}},{key:"removeData",value:function(t){this.mapvBaseLayer&&this.mapvBaseLayer.removeData(t)}},{key:"removeAllData",value:function(){this.mapvBaseLayer.clearData()}},{key:"_visiable",value:function(){return this.canvas.style.display="block",this}},{key:"_unvisiable",value:function(){return this.canvas.style.display="none",this}},{key:"_createCanvas",value:function(){var t=document.createElement("canvas"),e=this.devicePixelRatio;return t.id=this.layerID,t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.width=parseInt(this.map.getCanvas().style.width)*e,t.height=parseInt(this.map.getCanvas().style.height)*e,this.mapVOptions.context&&"2d"!=this.mapVOptions.context||t.getContext("2d").scale(e,e),t.style.width=this.map.getCanvas().style.width,t.style.height=this.map.getCanvas().style.height,t}},{key:"_reset",value:function(){null!=this.canvas&&(this.resizeCanvas(),this.fixPosition(),this.onResize(),this.render())}},{key:"draw",value:function(){return this._reset()}},{key:"show",value:function(){this._visiable()}},{key:"hide",value:function(){this._unvisiable()}},{key:"update",value:function(t){void 0!=t&&this.updateData(t.data,t.options)}},{key:"resizeCanvas",value:function(){if(this.mapContainer.style.perspective=this.map.transform.cameraToCenterDistance+"px",void 0!=this.canvas&&null!=this.canvas){var t=this.canvas,e=this.devicePixelRatio;t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.width=parseInt(this.map.getCanvas().style.width)*e,t.height=parseInt(this.map.getCanvas().style.height)*e,this.mapVOptions.context&&"2d"!=this.mapVOptions.context||t.getContext("2d").scale(e,e)}}},{key:"fixPosition",value:function(){}},{key:"onResize",value:function(){}},{key:"originPosition",value:function(){this.originPitch=this.map.getPitch(),this.originBearing=this.map.getBearing();var t=this.map.project(new a.default.LngLat(0,0));this.originX=t.x,this.originY=t.y}},{key:"render",value:function(){void 0!=this.mapvBaseLayer&&this.mapvBaseLayer._canvasUpdate()}},{key:"moveTo",value:function(t,e){var i=document.getElementById(this.layerID);if(e=void 0===e||e){var r=document.getElementById(t);i&&r&&r.parentNode.insertBefore(i,r)}else{var n=document.getElementById(t);if(i){if(n.nextSibling)return void n.parentNode.insertBefore(i,n.nextSibling);n.parentNode.appendChild(i)}}}},{key:"remove",value:function(){this.removeAllData(),this.unbindEvent(),this.mapContainer.removeChild(this.canvas),this.disposeFlag=!0}},{key:"destroy",value:function(){this.removeAllData(),this.unbindEvent(),this.mapContainer.removeChild(this.canvas),this.disposeFlag=!0}}]),t}();e.default=l},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=o(i(0)),n=o(i(2)),a=o(i(176));function o(t){return t&&t.__esModule?t:{default:t}}var s=window.echarts,l=function(){function t(e,i){return(0,r.default)(this,t),i=i||{},this.map=e,this.options=i,this.layerId=i.layerId||"echartlayerdefaultid",this.layerClass=i.classId||"echartlayerdefaultclass",this.initDevicePixelRatio(),this.mapContainer=e.getCanvasContainer(),this.canvas=this._createCanvas(),this.mapContainer.appendChild(this.canvas),this.mapContainer.style.perspective=this.map.transform.cameraToCenterDistance+"px",this.chart=s.init(this.canvas),this.visible=!0,this.initEcharts(),this._resizeCanvas(),this}return(0,n.default)(t,[{key:"initDevicePixelRatio",value:function(){this.devicePixelRatio=window.devicePixelRatio||1}},{key:"initEcharts",value:function(){return s.mapboxglMap=this.map,s.registerCoordinateSystem("mapboxgl",a.default),s.extendComponentModel({type:"mapboxgl",getBMap:function(){return this.__mapboxgl},defaultOption:{roam:!1}}),s.registerAction({type:"MapboxGLRoma",event:"MapboxGLRoma",update:"updateLayout"},function(t,e){}),this}},{key:"_createCanvas",value:function(){var t=document.createElement("div");return t.id=this.layerId,t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.width=parseInt(this.map.getCanvas().style.width),t.height=parseInt(this.map.getCanvas().style.height),t.style.width=this.map.getCanvas().style.width,t.style.height=this.map.getCanvas().style.height,t.setAttribute("id",this.layerId),t.setAttribute("class",this.layerClass),t}},{key:"_resizeCanvas",value:function(){var t=this;window.onresize=function(){var e=t.canvas,i=t.map;e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.width=i.getCanvas().style.width,e.style.height=i.getCanvas().style.height,e.width=parseInt(i.getCanvas().style.width),e.height=parseInt(i.getCanvas().style.height),t.chart.resize()}}},{key:"addTo",value:function(t){var e=this;return s.extendComponentView({type:"mapboxgl",render:function(t,i,r){var n=!0,a=s.mapboxglMap,o=r.getZr().painter.getViewportRoot(),l=t.coordinateSystem,u=function(i,a){if(!n&&e.visible){var s=document.getElementsByClassName("mapboxgl-map")[0],u=[-parseInt(s.style.left,10)||0,-parseInt(s.style.top,10)||0];o.style.left=u[0]+"px",o.style.top=u[1]+"px",l.setMapOffset(u),t.__mapOffset=u,r.dispatchAction({type:"MapboxGLRoma"})}};function h(){!n&&e.visible&&r.dispatchAction({type:"MapboxGLRoma"})}a.off("move",this._oldMoveHandler),a.off("zoomend",this._oldZoomEndHandler),a.on("move",u),a.on("zoomend",h),this._oldMoveHandler=u,this._oldZoomEndHandler=h;t.get("roam");n=!1}}),this.chart.setOption(this.options),this}},{key:"_visible",value:function(){this.visible=!0,this.canvas.style.visibility="visible"}},{key:"_unvisible",value:function(){this.visible=!1,this.canvas.style.visibility="hidden"}},{key:"show",value:function(){this._visible()}},{key:"hide",value:function(){this._unvisible()}},{key:"remove",value:function(){var t=this;return this.map._listeners.move.forEach(function(e){"moveHandler"===e.name&&t.map.off("move",e)}),this.map._listeners.move.forEach(function(e){"zoomEndHandler"===e.name&&t.map.off("zoomend",e)}),this.chart.clear(),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas),this.map=void 0,this}},{key:"update",value:function(t){this.chart.setOption(t)}}]),t}();e.default=l},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=c(i(58)),n=c(i(4)),a=c(i(0)),o=c(i(2)),s=c(i(5)),l=c(i(6)),u=i(1),h=c(i(36));function c(t){return t&&t.__esModule?t:{default:t}}var p=function(t){function e(t){(0,a.default)(this,e);var i=(0,s.default)(this,(e.__proto__||(0,n.default)(e)).call(this,t));return i.view=(0,u.defaultValue)(t.view,null),i.location=(0,u.defaultValue)(t.location,""),i.title=(0,u.defaultValue)(t.title,""),i.content=(0,u.defaultValue)(t.content,""),i.alignment=(0,u.defaultValue)(t.alignment,"bottom-center"),i.defaultButtons=(0,u.defaultValue)(t.defaultButtons,["toggle","close","zoom"]),i._popup=void 0,i._initPopup(),i._initDefaultClass(),i}return(0,l.default)(e,t),(0,o.default)(e,[{key:"_initPopup",value:function(){this._customPopup(),this.view._innerView.closePopupOnClick=!1}},{key:"_initDefaultClass",value:function(){var t=!1,e=document.head.getElementsByTagName("style");if(e)for(var i=0;i<e.length;i++)if(e[i].innerHTML.indexOf("styleDomString")>-1){t=!0;break}if(!t){var r=document.createElement("style");r.innerHTML="\n .zondy-popup__container{background-color: #fff;padding:0;border-radius: 10px;}\n .zondy-popup__tip{\n background-color: #fff;\n }\n .zondy-popup__header{\n padding: 8px;\n font-size: 18px;\n font-weight: 600;\n line-height: 20px;\n border-top-left-radius: 10px;\n border-top-right-radius: 10px;\n white-space: nowrap;\n }\n .zondy-popup__content{\n padding: 8px;\n }\n .zondy-popup__footer{\n }\n .zondy-popup__footer-division{\n border-top: 1px solid;\n }\n .zondy-popup__toggle,.zondy-popup__close{\n display: inline-block;width: 30px;text-align: center;\n }\n ",document.querySelector("head").append(r)}}},{key:"_customPopup",value:function(){}},{key:"open",value:function(t){this._popup?(this.close(),this._popup=void 0,this.openPopup(t)):this.openPopup(t)}},{key:"openPopup",value:function(t){if(this.view=t.view?t.view:this.view,this.location=t.location?t.location:this.location,this.location.spatialReference.isGeographic?this._location=this.location:this._location=u.Projection.project(this.location,new u.SpatialReference({wkid:4326})),this.title=t.title?t.title:this.title,this.content=t.content?t.content:this.content,this.alignment=t.alignment?t.alignment:this.alignment,this.view._innerView){var e=this._contentUI(this.title,this.content);this._popup=new h.default.Popup({closeOnClick:!1,closeButton:!1,maxWidth:"1900px"}).setLngLat(this._location.coordinates).setDOMContent(e).addTo(this.view._innerView),this._popup.toggleClassName("highlighted");for(var i=this._popup._container.getElementsByClassName("mapboxgl-popup-content"),r=0;r<i.length;r++)i[r].style.padding="0",i[r].style.borderRadius="10px"}else u.Log.info("没有视图引擎!")}},{key:"_contentUI",value:function(t,e){var i=this,n=this,a=void 0,o=function(t){var e=document.createElement("div");return e.innerHTML=t,e.childNodes};(a=document.createElement("div")).setAttribute("id",this.id+"-popup-default");var s=document.createElement("div");s.setAttribute("class","zondy-popup__header"),s.setAttribute("style","display: flex;");var l=o('<div class="zondy-popup__toggle">\n <svg aria-hidden="true" class="svg" fill="currentColor" height="16px" width="16px" viewBox="0 0 24 24" width="100%" xmlns="http://www.w3.org/2000/svg"><path d="M5 13.793l7-7 7 7v1.414l-7-7-7 7z"></path></svg>\n </div>')[0],u=o('<div class="zondy-popup__close">\n <svg aria-hidden="true" class="svg" fill="currentColor" height="16px" width="16px" viewBox="0 0 16 16" width="100%" xmlns="http://www.w3.org/2000/svg"><path d="M3.98 11.303L7.281 8 3.98 4.697l.707-.707L7.99 7.293l.01-.01.01.01 3.304-3.303.707.707L8.718 8l3.303 3.303-.707.707L8.01 8.707l-.01.01-.01-.01-3.304 3.303z"></path></svg>\n </div>')[0];if(t){var h=o('<div style="flex: 1;"></div>')[0];if(s.appendChild(h),"object"===(void 0===t?"undefined":(0,r.default)(t))?t instanceof Node?h.appendChild(t):t instanceof NodeList&&t.forEach(function(t){h.appendChild(t)}):h.innerHTML=t,this.defaultButtons.indexOf("toggle")>-1){s.appendChild(l);var c=!0;l.onclick=function(){c=!c,document.getElementById(n.id+"-popup-default").querySelector(".zondy-popup__content").style.display=c?"block":"none"}}this.defaultButtons.indexOf("close")>-1&&(s.appendChild(u),u.onclick=function(){i.close()})}var p=document.createElement("div");if(p.setAttribute("class","zondy-popup__content"),e)if("object"===(void 0===e?"undefined":(0,r.default)(e))){if(e instanceof Node)p.appendChild(e);else if(e instanceof NodeList)for(var f=0;f<e.length;f++)p.appendChild(e[f]),f--}else p.innerHTML=e;var d=document.createElement("div");d.setAttribute("class","zondy-popup__footer");var y=o('<div class="zondy-popup__zoom" style="display: inline-block;width: 36px;height: 36px;line-height: 36px;text-align: center;">\n <svg class="svg" fill="currentColor" height="16px" width="16px" viewBox="0 0 16 16" width="100%" xmlns="http://www.w3.org/2000/svg"><path d="M9 7H7v2H6V7H4V6h2V4h1v2h2zm6.805 7.861l-.943.942a.665.665 0 0 1-.943 0l-3.067-3.067a.667.667 0 0 1 0-.943l.129-.13-1.108-1.107A5.279 5.279 0 1 1 11.8 6.5a5.251 5.251 0 0 1-1.237 3.366l1.108 1.108.124-.124a.668.668 0 0 1 .943 0l3.067 3.068a.666.666 0 0 1 0 .943zM10.8 6.5a4.3 4.3 0 1 0-4.3 4.3 4.304 4.304 0 0 0 4.3-4.3zm4.062 7.89l-2.595-2.598-.473.473 2.597 2.595z"></path></svg>\n </div>')[0];return this.defaultButtons.indexOf("zoom")>-1&&(d.appendChild(y),y.onclick=function(){n.view.flyTo({zoom:n.view._zoom+1,center:n.location})}),d.childNodes.length>0&&d.setAttribute("class","zondy-popup__footer zondy-popup__footer-division"),a.appendChild(s),a.appendChild(p),a.appendChild(d),a}},{key:"_getOffset",value:function(){}},{key:"_getOffsetByAlignment",value:function(t,e,i){var r=0,n=0;switch(t){case"top-left":r=e/2,n=i;break;case"top-center":n=i;break;case"top-right":r=-e/2,n=i;break;case"bottom-left":r=e/2;break;case"auto":case"bottom-center":break;case"bottom-right":r=-e/2}return{x:r,y:n}}},{key:"close",value:function(){this.view._innerView&&this._popup.remove()}},{key:"destroy",value:function(){}}]),e}(u.Evented);e.default=p},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=s(i(7)),n=s(i(0)),a=s(i(2)),o=i(1);function s(t){return t&&t.__esModule?t:{default:t}}var l=function(){function t(e){(0,n.default)(this,t),e=(0,o.defaultValue)(e,{}),this.view=(0,o.defaultValue)(e.view,null),this.format=(0,o.defaultValue)(e.format,o.PictureFormat.png),this.filename=(0,o.defaultValue)(e.filename,"screenshotFile"),this.width=(0,o.defaultValue)(e.width,void 0),this.height=(0,o.defaultValue)(e.height,void 0),this.x=(0,o.defaultValue)(e.x,0),this.y=(0,o.defaultValue)(e.y,0),this.isDownload=(0,o.defaultValue)(e.isDownload,!0)}return(0,a.default)(t,[{key:"_addView",value:function(){var t=this,e=this,i=this.view._innerView.getCanvas(),n=null;this.format===o.PictureFormat.png?n=i.toDataURL():this.format===o.PictureFormat.jpeg?n=i.toDataURL("image/jpeg"):"svg"===this.format&&(n=i.toDataURL());var a=document.createElement("canvas");a.width=this.width,a.height=this.height;var s=a.getContext("2d"),l=function(t,e){var i=document.createElement("a");i.href=t,i.download=e,document.body.appendChild(i),i.click()};return new r.default(function(i){if(t.width&&t.height){var r=new Image;r.src=n,r.onload=function(){s.drawImage(r,e.x,e.y,e.width,e.height,0,0,e.width,e.height);var t=null;e.format===o.PictureFormat.png?t=a.toDataURL():e.format===o.PictureFormat.jpeg?t=a.toDataURL("image/jpeg"):"svg"===e.format&&(t=a.toDataURL()),e.isDownload&&l(t,e.filename),i({dataUrl:t})}}else e.isDownload&&l(n,t.filename),i({dataUrl:n})})}},{key:"_removeView",value:function(){}}]),t}();e.default=l},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=c(i(7)),n=c(i(4)),a=c(i(0)),o=c(i(2)),s=c(i(5)),l=c(i(6)),u=i(1),h=c(i(91));function c(t){return t&&t.__esModule?t:{default:t}}var p=function(t){function e(){return(0,a.default)(this,e),(0,s.default)(this,(e.__proto__||(0,n.default)(e)).apply(this,arguments))}return(0,l.default)(e,t),(0,o.default)(e,[{key:"onAdd",value:function(t){var e=this,i=this.layer,n=this.innerView,a=this;return a.innerLayer=new h.default({id:i.id,opacity:i._opacity,visible:this._getLayerViewVisible()}),a.innerLayer.onAdd(n).then(function(){var t=i.graphics.items||[];return a.innerLayer.commonLayerId=i.id,a._addFeature(a.innerLayer,t),r.default.resolve(e)})}},{key:"onRemove",value:function(t){return this.innerLayer.onRemove(this.innerView),this.innerLayer=null,r.default.resolve(this)}},{key:"onUpdate",value:function(t){var e=this,i=this.layer,n=this.innerLayer;return t.updateContent&&n&&t.updateContent.forEach(function(t){if(t&&"property"===t.operationType)switch(t.name){case"opacity":n.opacity=i._opacity;break;case"visible":var r=t.params&&t.params.length>0?t.params[0]:i.visible,a=e._getLayerViewVisible(r);n.visible=a}if(t&&"method"===t.operationType)switch(t.name){case"add":var o=t.params;e._addFeature(n,o[0]);break;case"remove":var s=t.params;e._removeFeature(n,s[0]);break;case"addMany":var l=t.params[0];l instanceof u.FeatureSet&&(l=l.features),e._addFeature(n,l);break;case"removeMany":var h=t.params[0];e._removeFeature(n,h);break;case"removeAll":n.removeAll()}}),r.default.resolve(this)}},{key:"_addFeature",value:function(t,e){var i=this,r=Array.isArray(e)?e:[e];r.forEach(function(){e.geometry&&!e.geometry.spatialReference&&(e.geometry.spatialReference=i.layer.spatialReference)}),this.render.drawFeature(t,r)}},{key:"_removeFeature",value:function(t,e){var i=Array.isArray(e)?e:[e];this.render.clearFeature(t,i)}}]),e}(u.BaseGraphicsLayerView);e.default=p},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=f(i(38)),n=f(i(7)),a=f(i(4)),o=f(i(0)),s=f(i(2)),l=f(i(5)),u=f(i(6)),h=i(1),c=i(16),p=f(i(8));function f(t){return t&&t.__esModule?t:{default:t}}var d=function(t){function e(){return(0,o.default)(this,e),(0,l.default)(this,(e.__proto__||(0,a.default)(e)).apply(this,arguments))}return(0,u.default)(e,t),(0,s.default)(e,[{key:"onAdd",value:function(){var t=this;return this._layerViewVisible=this._getLayerViewVisible(this.layer.visble),c.VectorTileLayerUtil.addIGSVectorTileLayer(this,{callback:function(e){for(var i=0;i<e.length;i++)e[i].commonLayerId=t.layer.id;t.innerLayer=e}}),n.default.resolve(this)}},{key:"onRemove",value:function(){return c.VectorTileLayerUtil.removeLayer(this),n.default.resolve(this)}},{key:"onUpdate",value:function(t){var e=this;if(t.updateContent)for(var i=0;i<t.updateContent.length;i++){var a=t.updateContent[i],o=a.params;if(a)switch(a.name){case"setPaintProperties":c.VectorTileLayerUtil.setPaintProperties(this,o[0],o[1]);break;case"setLayoutProperties":c.VectorTileLayerUtil.setLayoutProperties(this,o[0],o[1]);break;case"setStyleLayer":case"deleteStyleLayer":c.VectorTileLayerUtil.updateStyleLayer(this);break;case"opacity":c.VectorTileLayerUtil.setOpacity(this,o[0]);break;case"visible":var s=this._getLayerViewVisible(o[0]);this._layerViewVisible!==s&&(c.VectorTileLayerUtil.setVisible(this,s),this._layerViewVisible=s);break;case"clippingArea":if("break"===function(){var t=a.params[0],i=e.innerView,n=e.layer.style.sources;return n&&(0,r.default)(n).forEach(function(e){var r=e[0],n=i.getSource(r);n&&"vector"===n.type&&n.setClippingArea&&n.setClippingArea(p.default.convertClippingArea(t))}),"break"}())break}}return n.default.resolve(this)}}]),e}(h.LayerView);e.default=d},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Screenshot=e.Popup=e.MapView=void 0;var r=function(t){return t&&t.__esModule?t:{default:t}}(i(99)),n=i(16);e.MapView=r.default,e.Popup=n.Popup,e.Screenshot=n.Screenshot},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=S(i(100)),n=S(i(7)),a=S(i(13)),o=S(i(35)),s=S(i(4)),l=S(i(0)),u=S(i(2)),h=S(i(5)),c=S(i(29)),p=S(i(6)),f=i(1),d=S(i(36)),y=i(152),m=S(i(194)),v=S(i(94)),g=S(i(95)),_=S(i(96)),x=S(i(84)),b=S(i(43)),w=S(i(97));function S(t){return t&&t.__esModule?t:{default:t}}var M=function(t){function e(t){(0,l.default)(this,e);var i=(0,h.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t));if(t=(0,f.defaultValue)(t,{}),i._options=t,i._center=(0,f.defaultValue)(t.center,void 0),i._center&&Array.isArray(i._center)&&i._center.length>1&&(i._center=new f.Point({coordinates:[i._center[0],i._center[1]]})),i._extent=(0,f.defaultValue)(t.extent,void 0),i.width=void 0,i.height=void 0,i._zoom=(0,f.defaultValue)(t.zoom,0),i._scale=(0,f.defaultValue)(t.scale,void 0),i.maxScale=(0,f.defaultValue)(t.maxScale,void 0),i.minScale=(0,f.defaultValue)(t.minScale,void 0),i.popup=(0,f.defaultValue)(t.popup,void 0),i._spatialReference=void 0,i._referenceLayer=void 0,i.crs=void 0,i.spatialReferenceLocked=(0,f.defaultValue)(t.spatialReferenceLocked,!1),i.stationary=!0,t.fullExtent){var r=f.Extent.fromJSON(t.fullExtent.toJSON());r.spatialReference.isGeographic||(r=f.Projection.project(r,new f.SpatialReference({wkid:4326}))),i._initFullExtent=r}return i._fullExtent=i._initFullExtent,i._mapExtent=null,i}return(0,p.default)(e,t),(0,u.default)(e,[{key:"_initView",value:function(t,e){var i=this,r=this;d.default.accessToken="pk.eyJ1IjoiemtidWQiLCJhIjoiY2w5OGF2NXIyMzQ5bjNub2luem85Y2Z4OCJ9.uX09XQPOX5E7sOohws2l_Q",t&&!this._center&&this.fullExtent&&(this._center=this._fullExtent.center),!this._zoom&&this._scale&&this._initScale(this._scale);var s=void 0;this._center||this._zoom||this._extent&&(s=[[this._extent.xmin,this._extent.ymin],[this._extent.xmax,this._extent.ymax]]);var l={crs:this.crs,container:this._viewId,style:{version:8,sources:{},layers:[{id:(0,f.getGUID)(),type:"background",paint:{"background-color":"rgba(255, 255, 255,1)"}}]},zoom:this._zoom,center:this._center.coordinates,fitBoundsOptions:s,preserveDrawingBuffer:!0,maxBounds:this._getMaxBounds()};return(0,o.default)(this.extensionOptions).forEach(function(t){"crs"!==t&&"container"!==t&&(l[t]=(0,a.default)(l[t],i.extensionOptions[t]))}),this._innerView=new d.default.Map(l),this.engineType="mapboxgl",this._initViewEvent(),this._center||this._zoom||!this._extent||this.flyTo({extent:this._this._extent},{animate:!1}),this._initSize(),this._initScaleLimit(),this._initPopup(),this._initCursor(),this._updateMaxBounds(),this._innerView.on("load",function(){i.getZoom(),i.getCenter(),i.getExtent(),i.getScale()}),new n.default(function(t){r._innerView.loaded()?t(r):r._innerView.once("load",function(){t(r)})})}},{key:"_initScaleLimit",value:function(){if(void 0!==this._options.minScale)if(this.minScale>0){var t=this._getZoomByScale(this.minScale);void 0!==t&&this._innerView.setMinZoom(t)}else this.minScale=0,this._innerView.setMinZoom(void 0);else{var e=this._innerView.getMinZoom();isFinite(e)?this.minScale=this._getScaleByZoom(this.minZoom):this.minScale=void 0}if(void 0!==this._options.maxScale)if(this.maxScale>0){var i=this._getZoomByScale(this.maxScale);void 0!==i&&this._innerView.setMaxZoom(i)}else this.maxScale<=0&&(this.maxScale=0,this._innerView.setMaxZoom(void 0));else{var r=this._innerView.getMaxZoom(),n=((this.crs||{}).options||{}).lods;n&&Array.isArray(n)&&r>=n.length-1&&(r=n.length-1,this._innerView.setMaxZoom(r)),isFinite(r)?this.maxScale=this._getScaleByZoom(r):this.maxScale=void 0}!this._scale||this._scale<=0?this._scale=this.minScale:this._scale>this.minScale?this._scale=this.minScale:this._scale<this.maxScale&&(this._scale=this.maxScale)}},{key:"_createCrsObject",value:function(t){if(t.spatialReference&&t.origin&&t.lods&&t.extent){var e=void 0;if(t.spatialReference.wkid){var i=f.Projection.getEPSGByWKID(t.spatialReference.wkid);i&&(e=i.strProject)}else t.spatialReference.wkt&&(e=t.spatialReference.wkt);var r=[t.extent.xmin,t.extent.ymin,t.extent.xmax,t.extent.ymax],n="EPSG:"+t.spatialReference.wkid,a=e,o={};t.lods.forEach(function(t){o[t.level]=t.resolution});var s=new x.default(n,a,{resolutions:o,origin:t.origin,tileSize:t.tileSize,bounds:r,unit:t.spatialReference.isGeographic?"degree":void 0});return s.options=t,s}}},{key:"_reCreateView",value:function(){return this._innerView&&(this._innerView._animatingZoom=!1,this._innerView.remove()),this._initView(!0,this._options)}},{key:"_isEqualBounds",value:function(t,e){var i=!0;if(t&&e&&Array.isArray(t)&&Array.isArray(e)&&t.length===e.length){for(var r in t)if(t[r]!==e[r]){i=!1;break}}else i=!!(!t&&!e||Array.isArray(t)&&0===t.length&&Array.isArray(e)&&0===e.length);return i}},{key:"_initViewEvent",value:function(){var t=this,e=this;this._clickStore=null,this._dragParams={isDrag:!1,origin:null,action:"",button:null},e.fire(f.ViewEventType.loaded,{}),this._innerView.on("click",function(t){e._clickStore=setTimeout(function(){e._clickStore&&e.fire(f.ViewEventType.click,m.default.getMouseEvent(t,e))},300),e.fire(f.ViewEventType.immediateClick,m.default.getMouseEvent(t,e))}),this._innerView.on("contextmenu",function(t){e._clickStore=setTimeout(function(){e._clickStore&&e.fire(f.ViewEventType.click,m.default.getMouseEvent(t,e))},300),e.fire(f.ViewEventType.immediateClick,m.default.getMouseEvent(t,e))}),this._innerView.on("dblclick",function(i){e._clickStore&&(clearTimeout(t._clickStore),e._clickStore=null),e.fire(f.ViewEventType.doubleClick,m.default.getMouseEvent(i,e))}),this._innerView.on("mousedown",function(i){e.fire(f.ViewEventType.pointerDown,m.default.getMouseEvent(i,e)),t._dragParams.isDrag||(t._dragParams.origin={x:i.originalEvent.layerX,y:i.originalEvent.layerY},t._dragParams.button=i.originalEvent.button,t._dragParams.action="mouse-down",t._dragParams.isDrag=!1)}),this._innerView.on("mouseup",function(i){e.fire(f.ViewEventType.pointerUp,m.default.getMouseEvent(i,e)),e._dragParams.isDrag&&"update"===t._dragParams.action&&(t._dragParams.action="end",e.fire(f.ViewEventType.drag,m.default.getDragEvent(i,e,e._dragParams.origin,t._dragParams.action))),e._dragParams={isDrag:!1,origin:null,action:"",button:null}}),this._innerView.on("mousemove",function(i){e.fire(f.ViewEventType.pointerMove,m.default.getMouseEvent(i,e)),e._dragParams.isDrag?(e.fire(f.ViewEventType.drag,m.default.getDragEvent(i,e,e._dragParams.origin,e._dragParams.action,e._dragParams.button)),e._dragParams.action="update"):"mouse-down"===t._dragParams.action&&(t._dragParams.action="start",e._dragParams.isDrag=!0)}),this._innerView.on("dragstart",function(i){""===t._dragParams.action&&i.originalEvent&&(t._dragParams.origin={x:i.originalEvent.layerX,y:i.originalEvent.layerY},t._dragParams.action="start",e.fire(f.ViewEventType.drag,m.default.getDragEvent(i,e,t._dragParams.origin,t._dragParams.action)))}),this._innerView.on("drag",function(i){"start"!==e._dragParams.action&&"update"!==e._dragParams.action||(t._dragParams.action="update",e.fire(f.ViewEventType.drag,m.default.getDragEvent(i,e,t._dragParams.origin,t._dragParams.action)))}),this._innerView.on("dragend",function(i){"start"!==e._dragParams.action&&"update"!==e._dragParams.action||(t._dragParams.action="end",e.fire(f.ViewEventType.drag,m.default.getDragEvent(i,e,t._dragParams.origin,t._dragParams.action)),e._dragParams={origin:null,action:"",button:null})}),this._innerView.on("rotatestart",function(i){""===t._dragParams.action&&i.originalEvent&&(t._dragParams.origin={x:i.originalEvent.layerX,y:i.originalEvent.layerY},t._dragParams.action="start",e.fire(f.ViewEventType.drag,m.default.getDragEvent(i,e,t._dragParams.origin,t._dragParams.action)))}),this._innerView.on("rotate",function(i){"start"!==e._dragParams.action&&"update"!==e._dragParams.action||(t._dragParams.action="update",e.fire(f.ViewEventType.drag,m.default.getDragEvent(i,e,t._dragParams.origin,t._dragParams.action)))}),this._innerView.on("rotateend",function(i){"start"!==e._dragParams.action&&"update"!==e._dragParams.action||(t._dragParams.action="end",e.fire(f.ViewEventType.drag,m.default.getDragEvent(i,e,t._dragParams.origin,t._dragParams.action)),e._dragParams={origin:null,action:"",button:null})}),this._innerView.on("movestart",function(){e.stationary=!1}),this._innerView.on("zoom",function(t){e.fire(f.ViewEventType.zoom,{zoom:t.target._zoom,event:t})}),this._innerView.on("zoomend",function(t){e._zoomEndHandler(),e.fire(f.ViewEventType.viewChange,m.default.getViewChangeEvent(t,e))}),this._innerView.on("moveend",function(t){e._moveEndHandler(),e.fire(f.ViewEventType.viewChange,m.default.getViewChangeEvent(t,e)),e.stationary=!0}),this._innerView.on("resize",function(i){var r=Number(e.width),n=Number(e.height);e._initSize(),t._updateMaxBounds(),e.fire(f.ViewEventType.resize,{oldWidth:r,oldHeight:n,width:e.width,height:e.height})}),this._listenKey()}},{key:"_mapActionControl",value:function(t,e){this._innerView&&("drag-pan"===t?e?this._innerView.dragPan.enable():this._innerView.dragPan.disable():"double-click-zoom"===t?e?this._innerView.doubleClickZoom.enable():this._innerView.doubleClickZoom.disable():"drag-rotate"===t&&(e?this._innerView.dragRotate.enable():this._innerView.dragRotate.disable()))}},{key:"_listenKey",value:function(){var t=this,e=this._innerView._canvas;e.setAttribute("tabIndex","-1"),e.onclick=function(){e.focus()},e.addEventListener("keydown",function(e){t.fire(f.ViewEventType.keyDown,m.default.getKeyEvent(e,t))}),e.addEventListener("keyup",function(e){t.fire(f.ViewEventType.keyUp,m.default.getKeyEvent(e,t))})}},{key:"_initSize",value:function(){var t=this._innerView.getCanvas(),e=t.style?t.style.width:t.width,i=t.style?t.style.height:t.height;this.width=Number(e.toString().replace("px","")),this.height=Number(i.toString().replace("px",""))}},{key:"_updateMaxBounds",value:function(){var t=this._getMaxBounds();this._innerView.setMaxBounds(t)}},{key:"_setCursor",value:function(t){this._innerView&&(t&&null!==t?(this._innerView._container.style.cursor=t,this._innerView.getCanvasContainer().style.cursor=t):(this._innerView._container.style.removeProperty("cursor"),this._innerView.getCanvasContainer().style.removeProperty("cursor")),this._cursor=t)}},{key:"_zoomEndHandler",value:function(){this.getExtent(),this.getZoom(),this.getScale(),this._showLayerByScale()}},{key:"getSize",value:function(){return{width:this.width,height:this.height}}},{key:"_moveEndHandler",value:function(){this.getCenter(),this.getExtent()}},{key:"_createLayerViewObj",value:function(t){var e=null;return t&&t.autoAddTo2D&&(e=(0,y.getLayerView)(this,t)),e}},{key:"_initPopup",value:function(){this.popup=new v.default({view:this})}},{key:"hitTest",value:function(t){var e=this;if(this._innerView){var i=[],r=this._getInnerStyleLayerIds();return this._innerView.queryRenderedFeatures([t.x,t.y],{layers:r}).forEach(function(r){if(r.properties&&void 0!==r.properties.id&&r.layer&&r.layer.id){var n=r.source.split("_")[0],a=r.properties.id,o=e.getLayer(n);if(!o&&e._graphicsLayers&&e._graphicsLayers.allLayers&&e._graphicsLayers.allLayers.items&&(o=e._graphicsLayers.allLayers.items.find(function(t){return t.id===n})),o){var s=null;if(o.type===f.LayerType.igsFeature||o.type===f.LayerType.geojson||o.type===f.LayerType.wfs){var l=e._getLayerView(o);l.featureSet&&l.featureSet.features&&(s=l.featureSet.features.filter(function(t){if(t.id===a)return t}))}else if(o.type===f.LayerType.graphics){if(o.graphics)s=o.graphics.filter(function(t){if(t.id===a)return t}).items}var u={graphic:s&&s.length>0?s[0]:null,layer:o,mapPoint:e.toMap(t),type:"graphic"};i.push(u)}}}),i}}},{key:"_getInnerStyleLayerIds",value:function(){var t=this,e=[];return this._map.allLayers.items.concat(this._graphicsLayers.layers.items).forEach(function(i){if(i.type===f.LayerType.igsFeature||i.type===f.LayerType.geojson){var r=t._getLayerView(i);r&&(e=e.concat(r.getStyleLayerIds()))}else if(i.type===f.LayerType.graphics){var n=t.getInnerLayer(i);n&&n.getStyleLayerIds&&(e=e.concat(n.getStyleLayerIds()))}}),e}},{key:"toMap",value:function(t){if(t){var e=this._innerView.unproject([t.x,t.y]),i=new f.Point({coordinates:[e.lng,e.lat]});return this._spatialReference&&!this._spatialReference.isGeographic?i=f.Projection.project(i,this._spatialReference):i.spatialReference=this._spatialReference,i}}},{key:"toScreen",value:function(t){var e=f.Geometry.fromJSON(t);return e.spatialReference.isGeographic||(e=f.Projection.project(e,new f.SpatialReference({wkid:4326}))),this._innerView.project([e.coordinates[0],e.coordinates[1]])}},{key:"takeScreenshot",value:function(t){t.view=this;var e=null;return this._screenshot?e=this._screenshot._addView():(this._screenshot=new g.default(t),e=this._screenshot._addView()),e}},{key:"flyTo",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{animate:!0};t=(0,f.defaultValue)(t,{});var i=(0,f.defaultValue)(t.zoom,1),r=this._getFlyToCenter(t),n=this._getFlyToExtent(t);if(this._innerView){var a=this._innerView.transform;a.resetZoomScale=!1,r?this._innerView.flyTo({center:[r.coordinates[0],r.coordinates[1]],zoom:i}):n&&this._innerView.fitBounds([[n.xmin,n.ymin],[n.xmax,n.ymax]],e),a.resetZoomScale=!0}}},{key:"goTo",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=void 0,o=void 0,s=new n.default(function(t){t()});if(this._innerView){(0,f.isNull)(e.center)&&(0,f.isNull)(e.zoom)&&(0,f.isNull)(e.scale)||(r=(0,f.isNull)(e.center)?this._center:this._getFlyToCenter({center:e.center}),o=!(0,f.isNull)(e.scale)&&e.scale>0?this._getZoomByScale(e.scale):!(0,f.isNull)(e.zoom)&&e.zoom>0?e.zoom:this._zoom);var l=void 0;if(!(0,f.isNull)(e.target)){var u=this._getTargetExtent(e.target);u.xmin!==u.xmax&&u.ymin!==u.ymax?l=u:r=this._getFlyToCenter({center:new f.Point({coordinates:[u.xmin,u.ymin]})})}var h={animate:!0,duration:200};(0,f.isNull)(i)||((0,f.isNull)(i.animate)||(h.animate=i.animate),(0,f.isNull)(i.duration)||(h.duration=i.duration));var c=this._innerView.transform;if(c.resetZoomScale=!1,r){var p=r.coordinates[1],d=r.coordinates[0];if(this._fullExtent&&((p>this._fullExtent.ymax||p<this._fullExtent.ymin)&&(p=(this._fullExtent.ymax+this._fullExtent.ymin)/2),(d>this._fullExtent.xmax||d<this._fullExtent.xmin)&&(d=(this._fullExtent.xmax+this._fullExtent.xmin)/2)),isFinite(p)&&isFinite(d)){var y=!1,m=this._innerView.getCenter();if(o===this._zoom&&p===m.lat&&d===m.lng&&(y=!0),!y){var v={center:[r.coordinates[0],r.coordinates[1]],zoom:o};(0,a.default)(v,h),s=new n.default(function(e){t._innerView.flyTo(v),t._innerView.once("moveend",function(){e()})})}}}else if(l){var g=l.xmin,_=l.xmax,x=l.ymin,b=l.ymax;this._fullExtent&&(g<this._fullExtent.xmin&&(g=this._fullExtent.xmin),_>this._fullExtent.xmax&&(_=this._fullExtent.xmax),x<this._fullExtent.ymin&&(x=this._fullExtent.ymin),b>this._fullExtent.ymax&&(b=this._fullExtent.ymax)),isFinite(g)&&isFinite(_)&&isFinite(x)&&isFinite(b)&&(s=new n.default(function(e){t._innerView.fitBounds([[l.xmin,l.ymin],[l.xmax,l.ymax]],h),t._innerView.once("moveend",function(){e()})}))}c.resetZoomScale=!0}return s}},{key:"getCenter",value:function(){var t=this._innerView.getCenter(),e=new f.Point({coordinates:[t.lng,t.lat]});this._center=e;var i=this._spatialReference;return i.isGeographic||(e=f.Projection.project(e,i)),e}},{key:"setCenter",value:function(t){this._innerView&&(Array.isArray(t)&&t.length>1?(this._center=new f.Point({coordinates:[t[0],t[1]],spatialReference:this._spatialReference}),this.flyTo({zoom:this._zoom,center:this._center})):t instanceof f.Point&&(this._center=t,this.flyTo({zoom:this._zoom,center:this._center})))}},{key:"getZoom",value:function(){return this._zoom=this._innerView.getZoom(),this._zoom}},{key:"setZoom",value:function(t){this._innerView&&(this._zoom=t,this.flyTo({zoom:t,center:this._center}))}},{key:"getExtent",value:function(){if(this._innerView){var t=this._innerView.getBounds();if(t&&t._sw&&t._ne){var e=new f.Extent({xmin:t._sw.lng,ymin:t._sw.lat,xmax:t._ne.lng,ymax:t._ne.lat}),i=this._spatialReference;return i.isGeographic||(e=f.Projection.project(e,i)),this._extent=e,e}}}},{key:"setExtent",value:function(t){this._innerView&&(this._extent=t,this.flyTo({extent:t}))}},{key:"getScale",value:function(){var t=this._getScaleByZoom(this._zoom);return this._scale=t,t}},{key:"_getScaleByZoom",value:function(t){var e=void 0;if(this.crs&&this.crs.options&&this.crs.options.lods&&!(0,f.isNull)(t))if(t%1==0){e=this.crs.options.lods[t].scale}else{var i=Math.floor(t),r=Math.ceil(t),n=this.crs.options.lods[i],a=this.crs.options.lods[r];e=void 0===n&&void 0===a?0:void 0===n?a.scale:void 0===a?n.scale:n.scale-(n.scale-a.scale)*(t-i)}return e}},{key:"_initScale",value:function(t){this._scale&&this._scale>0&&(this._zoom=this._getZoomByScale(t))}},{key:"_getZoomByScale",value:function(t){var e=void 0;if(this.crs&&this.crs.options&&this.crs.options.lods)for(var i=-1,r=0;r<this.crs.options.lods.length;r++){var n=this.crs.options.lods[r],a=this.crs.options.lods[r-1];if(n.scale<=0)break;if(i<0&&(i=r),r===i){if(n.scale>0&&t>=n.scale){e=n.level;break}}else{if(t>=n.scale&&t<=a.scale&&a.scale!==n.scale){e=n.level-(t-n.scale)/(a.scale-n.scale);break}if(r===this.crs.options.lods.length-1&&n.scale>0&&t<=n.scale){e=n.level;break}}}return e}},{key:"setScale",value:function(t){if(this._innerView){var e=this._getZoomByScale(t);e&&this.flyTo({center:this._center,zoom:e})}}},{key:"_getMaxBounds",value:function(){if(this._fullExtent){var t=[[this._fullExtent.xmin,this._fullExtent.ymin],[this._fullExtent.xmax,this._fullExtent.ymax]];if(this._innerView)try{var e=Math.max(this._innerView.transform.width,200),i=Math.max(this._innerView.transform.height,200)/e,r=this._innerView.transform,n=r.project({lng:t[0][0],lat:t[1][1]}),a=r.project({lng:t[1][0],lat:t[0][1]}),o=r.project({lng:(t[0][0]+t[1][0])/2,lat:(t[0][1]+t[1][1])/2}),s=a.x-n.x,l=a.y-n.y,u=Math.max(s,l)/2,h=o.x-u,c=o.y-u*i,p=o.x+u,f=o.y+u*i,d=r.unproject({x:h,y:c}),y=r.unproject({x:p,y:f});t[0][0]=Math.min(d.lng,t[0][0]),t[0][1]=Math.min(y.lat,t[0][1]),t[1][0]=Math.max(y.lng,t[1][0]),t[1][1]=Math.max(d.lat,t[1][1])}catch(t){}return t}return[]}},{key:"_isEqualCrs",value:function(t,e){var i=!1;if(!t||!e)return i;var r=void 0;t.code.split(":").length>1&&(r=t.code.split(":")[1]);var n=new f.SpatialReference({wkid:r,wkt:t.def}),a=void 0;e.code.split(":").length>1&&(a=e.code.split(":")[1]);var o=new f.SpatialReference({wkid:a,wkt:e.def});return n.equals(o)&&e.options&&t.options&&(0,f.compareObject)(e.options._resolutions,t.options_resolutions)&&(0,f.compareObject)(e.origin,t.origin)&&(0,f.compareObject)(e.extent,t.extent)&&(i=!0),i}},{key:"_moveLayerView",value:function(t,e){var i=void 0;if(t instanceof _.default){i=[];var r=t.innerLayer._sourceMetaDatas;(0,o.default)(r).forEach(function(t){i.push(r[t].layerId)})}else if(t instanceof b.default)i=t.styleLayers.map(function(t){return t.id});else if(t instanceof w.default){var n=t.innerLayer||[];i=n.map(function(t){return t.id})}else i=t.innerLayer.id;var a=void 0;if(e instanceof _.default){var s=e.innerLayer._getBottomLayer();a=s.layerId}else if(e instanceof b.default)e.styleLayers.length>0&&(a=e.styleLayers[0].id);else if(e instanceof w.default){var l=e.innerLayer||[];l.length>0&&(a=l[0].id)}else a=e.innerLayer.id;t instanceof _.default||t instanceof b.default||t instanceof w.default?i.forEach(function(e){t.innerView.moveLayer(e,a)}):t.innerView.moveLayer(i,a)}},{key:"toJSON",value:function(){var t=(0,c.default)(e.prototype.__proto__||(0,s.default)(e.prototype),"toJSON",this).call(this);return t=(0,a.default)(t,{extent:(0,f.toJSON)(this._extent,f.Extent),width:this.width,height:this.height,spatialReferenceLocked:this.spatialReferenceLocked})}}]),e}(f.MapView);(0,r.default)(M.prototype,{scale:{get:function(){return this._scale},set:function(t){this.setScale(t)}},zoom:{get:function(){return this._zoom},set:function(t){this.setZoom(t)}},extent:{get:function(){return this._extent},set:function(t){this.setExtent(t)}},center:{get:function(){var t=this._center;return this._spatialReference&&(this.spatialReference.isGeographic||(t=f.Projection.project(this._center,this._spatialReference))),t},set:function(t){this.setCenter(t)}},spatialReference:{get:function(){return this._spatialReference},set:function(t){}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=t,this._innerView&&this._innerView.setBearing(t)}}}),M.fromJSON=function(t){return t=(0,f.defaultValue)(t,{}),new M(t)},e.default=M},function(t,e,i){t.exports={default:i(101),__esModule:!0}},function(t,e,i){i(102);var r=i(3).Object;t.exports=function(t,e){return r.defineProperties(t,e)}},function(t,e,i){var r=i(9);r(r.S+r.F*!i(12),"Object",{defineProperties:i(66)})},function(t,e,i){var r=i(19),n=i(47),a=i(104);t.exports=function(t){return function(e,i,o){var s,l=r(e),u=n(l.length),h=a(o,u);if(t&&i!=i){for(;u>h;)if((s=l[h++])!=s)return!0}else for(;u>h;h++)if((t||h in l)&&l[h]===i)return t||h||0;return!t&&-1}}},function(t,e,i){var r=i(48),n=Math.max,a=Math.min;t.exports=function(t,e){return(t=r(t))<0?n(t+e,0):a(t,e)}},function(t,e,i){i(69),i(33),i(42),i(111),i(119),i(120),t.exports=i(3).Promise},function(t,e,i){var r=i(48),n=i(46);t.exports=function(t){return function(e,i){var a,o,s=String(n(e)),l=r(i),u=s.length;return l<0||l>=u?t?"":void 0:(a=s.charCodeAt(l))<55296||a>56319||l+1===u||(o=s.charCodeAt(l+1))<56320||o>57343?t?s.charAt(l):a:t?s.slice(l,l+2):o-56320+(a-55296<<10)+65536}}},function(t,e,i){"use strict";var r=i(52),n=i(30),a=i(41),o={};i(21)(o,i(11)("iterator"),function(){return this}),t.exports=function(t,e,i){t.prototype=r(o,{next:n(1,i)}),a(t,e+" Iterator")}},function(t,e,i){"use strict";var r=i(109),n=i(110),a=i(27),o=i(19);t.exports=i(70)(Array,"Array",function(t,e){this._t=o(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,i=this._i++;return!t||i>=t.length?(this._t=void 0,n(1)):n(0,"keys"==e?i:"values"==e?t[i]:[i,t[i]])},"values"),a.Arguments=a.Array,r("keys"),r("values"),r("entries")},function(t,e){t.exports=function(){}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,i){"use strict";var r,n,a,o,s=i(32),l=i(10),u=i(24),h=i(53),c=i(9),p=i(18),f=i(39),d=i(112),y=i(113),m=i(76),v=i(77).set,g=i(115)(),_=i(55),x=i(78),b=i(116),w=i(79),S=l.TypeError,M=l.process,E=M&&M.versions,k=E&&E.v8||"",T=l.Promise,I="process"==h(M),C=function(){},A=n=_.f,P=!!function(){try{var t=T.resolve(1),e=(t.constructor={})[i(11)("species")]=function(t){t(C,C)};return(I||"function"==typeof PromiseRejectionEvent)&&t.then(C)instanceof e&&0!==k.indexOf("6.6")&&-1===b.indexOf("Chrome/66")}catch(t){}}(),L=function(t){var e;return!(!p(t)||"function"!=typeof(e=t.then))&&e},z=function(t,e){if(!t._n){t._n=!0;var i=t._c;g(function(){for(var r=t._v,n=1==t._s,a=0,o=function(e){var i,a,o,s=n?e.ok:e.fail,l=e.resolve,u=e.reject,h=e.domain;try{s?(n||(2==t._h&&O(t),t._h=1),!0===s?i=r:(h&&h.enter(),i=s(r),h&&(h.exit(),o=!0)),i===e.promise?u(S("Promise-chain cycle")):(a=L(i))?a.call(i,l,u):l(i)):u(r)}catch(t){h&&!o&&h.exit(),u(t)}};i.length>a;)o(i[a++]);t._c=[],t._n=!1,e&&!t._h&&D(t)})}},D=function(t){v.call(l,function(){var e,i,r,n=t._v,a=R(t);if(a&&(e=x(function(){I?M.emit("unhandledRejection",n,t):(i=l.onunhandledrejection)?i({promise:t,reason:n}):(r=l.console)&&r.error&&r.error("Unhandled promise rejection",n)}),t._h=I||R(t)?2:1),t._a=void 0,a&&e.e)throw e.v})},R=function(t){return 1!==t._h&&0===(t._a||t._c).length},O=function(t){v.call(l,function(){var e;I?M.emit("rejectionHandled",t):(e=l.onrejectionhandled)&&e({promise:t,reason:t._v})})},B=function(t){var e=this;e._d||(e._d=!0,(e=e._w||e)._v=t,e._s=2,e._a||(e._a=e._c.slice()),z(e,!0))},F=function(t){var e,i=this;if(!i._d){i._d=!0,i=i._w||i;try{if(i===t)throw S("Promise can't be resolved itself");(e=L(t))?g(function(){var r={_w:i,_d:!1};try{e.call(t,u(F,r,1),u(B,r,1))}catch(t){B.call(r,t)}}):(i._v=t,i._s=1,z(i,!1))}catch(t){B.call({_w:i,_d:!1},t)}}};P||(T=function(t){d(this,T,"Promise","_h"),f(t),r.call(this);try{t(u(F,this,1),u(B,this,1))}catch(t){B.call(this,t)}},(r=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=i(117)(T.prototype,{then:function(t,e){var i=A(m(this,T));return i.ok="function"!=typeof t||t,i.fail="function"==typeof e&&e,i.domain=I?M.domain:void 0,this._c.push(i),this._a&&this._a.push(i),this._s&&z(this,!1),i.promise},catch:function(t){return this.then(void 0,t)}}),a=function(){var t=new r;this.promise=t,this.resolve=u(F,t,1),this.reject=u(B,t,1)},_.f=A=function(t){return t===T||t===o?new a(t):n(t)}),c(c.G+c.W+c.F*!P,{Promise:T}),i(41)(T,"Promise"),i(118)("Promise"),o=i(3).Promise,c(c.S+c.F*!P,"Promise",{reject:function(t){var e=A(this);return(0,e.reject)(t),e.promise}}),c(c.S+c.F*(s||!P),"Promise",{resolve:function(t){return w(s&&this===o?T:this,t)}}),c(c.S+c.F*!(P&&i(80)(function(t){T.all(t).catch(C)})),"Promise",{all:function(t){var e=this,i=A(e),r=i.resolve,n=i.reject,a=x(function(){var i=[],a=0,o=1;y(t,!1,function(t){var s=a++,l=!1;i.push(void 0),o++,e.resolve(t).then(function(t){l||(l=!0,i[s]=t,--o||r(i))},n)}),--o||r(i)});return a.e&&n(a.v),i.promise},race:function(t){var e=this,i=A(e),r=i.reject,n=x(function(){y(t,!1,function(t){e.resolve(t).then(i.resolve,r)})});return n.e&&r(n.v),i.promise}})},function(t,e){t.exports=function(t,e,i,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(i+": incorrect invocation!");return t}},function(t,e,i){var r=i(24),n=i(74),a=i(75),o=i(14),s=i(47),l=i(54),u={},h={};(e=t.exports=function(t,e,i,c,p){var f,d,y,m,v=p?function(){return t}:l(t),g=r(i,c,e?2:1),_=0;if("function"!=typeof v)throw TypeError(t+" is not iterable!");if(a(v)){for(f=s(t.length);f>_;_++)if((m=e?g(o(d=t[_])[0],d[1]):g(t[_]))===u||m===h)return m}else for(y=v.call(t);!(d=y.next()).done;)if((m=n(y,g,d.value,e))===u||m===h)return m}).BREAK=u,e.RETURN=h},function(t,e){t.exports=function(t,e,i){var r=void 0===i;switch(e.length){case 0:return r?t():t.call(i);case 1:return r?t(e[0]):t.call(i,e[0]);case 2:return r?t(e[0],e[1]):t.call(i,e[0],e[1]);case 3:return r?t(e[0],e[1],e[2]):t.call(i,e[0],e[1],e[2]);case 4:return r?t(e[0],e[1],e[2],e[3]):t.call(i,e[0],e[1],e[2],e[3])}return t.apply(i,e)}},function(t,e,i){var r=i(10),n=i(77).set,a=r.MutationObserver||r.WebKitMutationObserver,o=r.process,s=r.Promise,l="process"==i(31)(o);t.exports=function(){var t,e,i,u=function(){var r,n;for(l&&(r=o.domain)&&r.exit();t;){n=t.fn,t=t.next;try{n()}catch(r){throw t?i():e=void 0,r}}e=void 0,r&&r.enter()};if(l)i=function(){o.nextTick(u)};else if(!a||r.navigator&&r.navigator.standalone)if(s&&s.resolve){var h=s.resolve(void 0);i=function(){h.then(u)}}else i=function(){n.call(r,u)};else{var c=!0,p=document.createTextNode("");new a(u).observe(p,{characterData:!0}),i=function(){p.data=c=!c}}return function(r){var n={fn:r,next:void 0};e&&(e.next=n),t||(t=n,i()),e=n}}},function(t,e,i){var r=i(10).navigator;t.exports=r&&r.userAgent||""},function(t,e,i){var r=i(21);t.exports=function(t,e,i){for(var n in e)i&&t[n]?t[n]=e[n]:r(t,n,e[n]);return t}},function(t,e,i){"use strict";var r=i(10),n=i(3),a=i(15),o=i(12),s=i(11)("species");t.exports=function(t){var e="function"==typeof n[t]?n[t]:r[t];o&&e&&!e[s]&&a.f(e,s,{configurable:!0,get:function(){return this}})}},function(t,e,i){"use strict";var r=i(9),n=i(3),a=i(10),o=i(76),s=i(79);r(r.P+r.R,"Promise",{finally:function(t){var e=o(this,n.Promise||a.Promise),i="function"==typeof t;return this.then(i?function(i){return s(e,t()).then(function(){return i})}:t,i?function(i){return s(e,t()).then(function(){throw i})}:t)}})},function(t,e,i){"use strict";var r=i(9),n=i(55),a=i(78);r(r.S,"Promise",{try:function(t){var e=n.f(this),i=a(t);return(i.e?e.reject:e.resolve)(i.v),e.promise}})},function(t,e,i){i(122),t.exports=i(3).Object.assign},function(t,e,i){var r=i(9);r(r.S+r.F,"Object",{assign:i(123)})},function(t,e,i){"use strict";var r=i(12),n=i(26),a=i(56),o=i(34),s=i(28),l=i(68),u=Object.assign;t.exports=!u||i(25)(function(){var t={},e={},i=Symbol(),r="abcdefghijklmnopqrst";return t[i]=7,r.split("").forEach(function(t){e[t]=t}),7!=u({},t)[i]||Object.keys(u({},e)).join("")!=r})?function(t,e){for(var i=s(t),u=arguments.length,h=1,c=a.f,p=o.f;u>h;)for(var f,d=l(arguments[h++]),y=c?n(d).concat(c(d)):n(d),m=y.length,v=0;m>v;)f=y[v++],r&&!p.call(d,f)||(i[f]=d[f]);return i}:u},function(t,e,i){i(125),t.exports=i(3).Object.keys},function(t,e,i){var r=i(28),n=i(26);i(57)("keys",function(){return function(t){return n(r(t))}})},function(t,e,i){i(127),t.exports=i(3).Object.getPrototypeOf},function(t,e,i){var r=i(28),n=i(73);i(57)("getPrototypeOf",function(){return function(t){return n(r(t))}})},function(t,e,i){t.exports={default:i(129),__esModule:!0}},function(t,e,i){i(130);var r=i(3).Object;t.exports=function(t,e,i){return r.defineProperty(t,e,i)}},function(t,e,i){var r=i(9);r(r.S+r.F*!i(12),"Object",{defineProperty:i(15).f})},function(t,e,i){t.exports={default:i(132),__esModule:!0}},function(t,e,i){i(33),i(42),t.exports=i(59).f("iterator")},function(t,e,i){t.exports={default:i(134),__esModule:!0}},function(t,e,i){i(135),i(69),i(140),i(141),t.exports=i(3).Symbol},function(t,e,i){"use strict";var r=i(10),n=i(22),a=i(12),o=i(9),s=i(71),l=i(136).KEY,u=i(25),h=i(50),c=i(41),p=i(40),f=i(11),d=i(59),y=i(60),m=i(137),v=i(138),g=i(14),_=i(18),x=i(28),b=i(19),w=i(45),S=i(30),M=i(52),E=i(139),k=i(61),T=i(56),I=i(15),C=i(26),A=k.f,P=I.f,L=E.f,z=r.Symbol,D=r.JSON,R=D&&D.stringify,O=f("_hidden"),B=f("toPrimitive"),F={}.propertyIsEnumerable,V=h("symbol-registry"),U=h("symbols"),j=h("op-symbols"),N=Object.prototype,q="function"==typeof z&&!!T.f,G=r.QObject,Z=!G||!G.prototype||!G.prototype.findChild,X=a&&u(function(){return 7!=M(P({},"a",{get:function(){return P(this,"a",{value:7}).a}})).a})?function(t,e,i){var r=A(N,e);r&&delete N[e],P(t,e,i),r&&t!==N&&P(N,e,r)}:P,W=function(t){var e=U[t]=M(z.prototype);return e._k=t,e},K=q&&"symbol"==typeof z.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof z},H=function(t,e,i){return t===N&&H(j,e,i),g(t),e=w(e,!0),g(i),n(U,e)?(i.enumerable?(n(t,O)&&t[O][e]&&(t[O][e]=!1),i=M(i,{enumerable:S(0,!1)})):(n(t,O)||P(t,O,S(1,{})),t[O][e]=!0),X(t,e,i)):P(t,e,i)},J=function(t,e){g(t);for(var i,r=m(e=b(e)),n=0,a=r.length;a>n;)H(t,i=r[n++],e[i]);return t},Y=function(t){var e=F.call(this,t=w(t,!0));return!(this===N&&n(U,t)&&!n(j,t))&&(!(e||!n(this,t)||!n(U,t)||n(this,O)&&this[O][t])||e)},Q=function(t,e){if(t=b(t),e=w(e,!0),t!==N||!n(U,e)||n(j,e)){var i=A(t,e);return!i||!n(U,e)||n(t,O)&&t[O][e]||(i.enumerable=!0),i}},$=function(t){for(var e,i=L(b(t)),r=[],a=0;i.length>a;)n(U,e=i[a++])||e==O||e==l||r.push(e);return r},tt=function(t){for(var e,i=t===N,r=L(i?j:b(t)),a=[],o=0;r.length>o;)!n(U,e=r[o++])||i&&!n(N,e)||a.push(U[e]);return a};q||(s((z=function(){if(this instanceof z)throw TypeError("Symbol is not a constructor!");var t=p(arguments.length>0?arguments[0]:void 0),e=function(i){this===N&&e.call(j,i),n(this,O)&&n(this[O],t)&&(this[O][t]=!1),X(this,t,S(1,i))};return a&&Z&&X(N,t,{configurable:!0,set:e}),W(t)}).prototype,"toString",function(){return this._k}),k.f=Q,I.f=H,i(81).f=E.f=$,i(34).f=Y,T.f=tt,a&&!i(32)&&s(N,"propertyIsEnumerable",Y,!0),d.f=function(t){return W(f(t))}),o(o.G+o.W+o.F*!q,{Symbol:z});for(var et="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),it=0;et.length>it;)f(et[it++]);for(var rt=C(f.store),nt=0;rt.length>nt;)y(rt[nt++]);o(o.S+o.F*!q,"Symbol",{for:function(t){return n(V,t+="")?V[t]:V[t]=z(t)},keyFor:function(t){if(!K(t))throw TypeError(t+" is not a symbol!");for(var e in V)if(V[e]===t)return e},useSetter:function(){Z=!0},useSimple:function(){Z=!1}}),o(o.S+o.F*!q,"Object",{create:function(t,e){return void 0===e?M(t):J(M(t),e)},defineProperty:H,defineProperties:J,getOwnPropertyDescriptor:Q,getOwnPropertyNames:$,getOwnPropertySymbols:tt});var at=u(function(){T.f(1)});o(o.S+o.F*at,"Object",{getOwnPropertySymbols:function(t){return T.f(x(t))}}),D&&o(o.S+o.F*(!q||u(function(){var t=z();return"[null]"!=R([t])||"{}"!=R({a:t})||"{}"!=R(Object(t))})),"JSON",{stringify:function(t){for(var e,i,r=[t],n=1;arguments.length>n;)r.push(arguments[n++]);if(i=e=r[1],(_(e)||void 0!==t)&&!K(t))return v(e)||(e=function(t,e){if("function"==typeof i&&(e=i.call(this,t,e)),!K(e))return e}),r[1]=e,R.apply(D,r)}}),z.prototype[B]||i(21)(z.prototype,B,z.prototype.valueOf),c(z,"Symbol"),c(Math,"Math",!0),c(r.JSON,"JSON",!0)},function(t,e,i){var r=i(40)("meta"),n=i(18),a=i(22),o=i(15).f,s=0,l=Object.isExtensible||function(){return!0},u=!i(25)(function(){return l(Object.preventExtensions({}))}),h=function(t){o(t,r,{value:{i:"O"+ ++s,w:{}}})},c=t.exports={KEY:r,NEED:!1,fastKey:function(t,e){if(!n(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!a(t,r)){if(!l(t))return"F";if(!e)return"E";h(t)}return t[r].i},getWeak:function(t,e){if(!a(t,r)){if(!l(t))return!0;if(!e)return!1;h(t)}return t[r].w},onFreeze:function(t){return u&&c.NEED&&l(t)&&!a(t,r)&&h(t),t}}},function(t,e,i){var r=i(26),n=i(56),a=i(34);t.exports=function(t){var e=r(t),i=n.f;if(i)for(var o,s=i(t),l=a.f,u=0;s.length>u;)l.call(t,o=s[u++])&&e.push(o);return e}},function(t,e,i){var r=i(31);t.exports=Array.isArray||function(t){return"Array"==r(t)}},function(t,e,i){var r=i(19),n=i(81).f,a={}.toString,o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return o&&"[object Window]"==a.call(t)?function(t){try{return n(t)}catch(t){return o.slice()}}(t):n(r(t))}},function(t,e,i){i(60)("asyncIterator")},function(t,e,i){i(60)("observable")},function(t,e,i){t.exports={default:i(143),__esModule:!0}},function(t,e,i){i(144);var r=i(3).Object;t.exports=function(t,e){return r.getOwnPropertyDescriptor(t,e)}},function(t,e,i){var r=i(19),n=i(61).f;i(57)("getOwnPropertyDescriptor",function(){return function(t,e){return n(r(t),e)}})},function(t,e,i){t.exports={default:i(146),__esModule:!0}},function(t,e,i){i(147),t.exports=i(3).Object.setPrototypeOf},function(t,e,i){var r=i(9);r(r.S,"Object",{setPrototypeOf:i(148).set})},function(t,e,i){var r=i(18),n=i(14),a=function(t,e){if(n(t),!r(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,r){try{(r=i(24)(Function.call,i(61).f(Object.prototype,"__proto__").set,2))(t,[]),e=!(t instanceof Array)}catch(t){e=!0}return function(t,i){return a(t,i),e?t.__proto__=i:r(t,i),t}}({},!1):void 0),check:a}},function(t,e,i){t.exports={default:i(150),__esModule:!0}},function(t,e,i){i(151);var r=i(3).Object;t.exports=function(t,e){return r.create(t,e)}},function(t,e,i){var r=i(9);r(r.S,"Object",{create:i(52)})},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getLayerView=void 0;var r=i(1),n=x(i(153)),a=x(i(178)),o=x(i(179)),s=x(i(180)),l=x(i(96)),u=x(i(181)),h=x(i(97)),c=x(i(182)),p=x(i(184)),f=x(i(185)),d=x(i(186)),y=x(i(187)),m=x(i(188)),v=x(i(190)),g=x(i(192)),_=x(i(193));function x(t){return t&&t.__esModule?t:{default:t}}e.getLayerView=function(t,e){var i=null;switch(e.type){case r.LayerType.igsMapImage:i=new n.default({view:t,layer:e});break;case r.LayerType.igsTile:i=new a.default({view:t,layer:e});break;case r.LayerType.wms:i=new o.default({view:t,layer:e});break;case r.LayerType.wmts:i=new s.default({view:t,layer:e});break;case r.LayerType.graphics:i=new l.default({view:t,layer:e,render:new u.default});break;case r.LayerType.igsVectorTile:case r.LayerType.arcgisVectorTile:i=new h.default({view:t,layer:e});break;case r.LayerType.igsFeature:i=new c.default({view:t,layer:e});break;case r.LayerType.geojson:i=new p.default({view:t,layer:e});break;case r.LayerType.wfs:i=new f.default({view:t,layer:e});break;case r.LayerType.webTileLayer:i=new d.default({view:t,layer:e});break;case r.LayerType.group:i=new y.default({view:t,layer:e});break;case r.LayerType.echarts:i=new m.default({view:t,layer:e});break;case r.LayerType.mapv:i=new v.default({view:t,layer:e});break;case r.LayerType.arcgisMapImage:i=new g.default({view:t,layer:e});break;case r.LayerType.arcgisTile:i=new _.default({view:t,layer:e})}return i}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=p(i(7)),n=p(i(4)),a=p(i(0)),o=p(i(2)),s=p(i(5)),l=p(i(6)),u=i(1),h=i(16),c=p(i(8));function p(t){return t&&t.__esModule?t:{default:t}}var f=function(t){function e(){return(0,a.default)(this,e),(0,s.default)(this,(e.__proto__||(0,n.default)(e)).apply(this,arguments))}return(0,l.default)(e,t),(0,o.default)(e,[{key:"onAdd",value:function(){var t=this.layer;return this.innerLayer=h.IGSMapImageUtil.addIGSMapImageLayer(this,{clippingArea:c.default.convertClippingArea(t.clippingArea)}),this.innerLayer.commonLayerId=t.id,r.default.resolve(this)}},{key:"onRemove",value:function(){return h.IGSMapImageUtil.removeLayer(this),r.default.resolve(this)}},{key:"onUpdate",value:function(t){if(t.updateContent)for(var e=0;e<t.updateContent.length;e++){var i=t.updateContent[e];if(i)switch(i.name){case"visible":h.IGSMapImageUtil.setVisible(this,i);break;case"opacity":h.IGSMapImageUtil.setOpacity(this);break;case"sublayerVisible":case"refresh":h.IGSMapImageUtil.refresh(this);break;case"clippingArea":var n=i.params[0],a=this.innerLayer.source,o=this.innerView.getSource(a);o&&o.setClippingArea(c.default.convertClippingArea(n))}}return r.default.resolve(this)}}]),e}(u.LayerView);e.default=f},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=u(i(37)),n=u(i(13)),a=u(i(0)),o=i(1),s=i(20),l=i(17);function u(t){return t&&t.__esModule?t:{default:t}}var h=function t(){(0,a.default)(this,t)};h.addIGSMapImageLayer=function(t,e){e=e||{};var i=t.layer,r=t.innerView;e.layerView=t;var n=h.getSourcesAndStyleLayers(i,e);(0,l.addStyleToMapboxglMap)(n,r);var a=r.getLayer(n.layers[0].id);return a.sourceID=a.source,a},h.getSourcesAndStyleLayers=function(t,e){var i=(e=e||{}).layerView,r={layers:t.layers,f:t.imageFormat,width:t.imageWidth,height:t.imageHeight,clientId:t.clientId,igsVersion:t._igsVersion,tokenKey:t.tokenKey,tokenValue:t.tokenValue,isAntialiasing:t.isAntialiasing,filters:t.getFilters(),format:"png",projectionSrs:(0,o.getProjectionSrs)(t.spatialReference),httpMethod:"GET",header:void 0},a=(0,o.getIGSDynamicLayer)(t);a.length>0&&(r.dynamicLayers=a);var l=t.getFilters();l&&(r.filters=l);var u="source_"+t.id,c="layer_"+t.id;t.httpMethod&&(r.httpMethod=t.httpMethod),t.headers&&(r.headers=t.headers);var p=t.extensionOptions,f=void 0===p?{}:p;r=(0,n.default)(r,f);var d=h.initLayerUrl(t._url,r),y=(0,s.getRasterSource)(d.url,t.imageWidth,t.renderMode,void 0,d,e.clippingArea),m=(0,s.getRasterLayer)(c,u,t,i),v={};return v[u]=y,{sources:v,layers:[m]}},h.initAllRequestParams=function(t){var e={};return(t=(0,o.defaultValue)(t,{})).hasOwnProperty("layers")&&(e.layers=t.layers),t.hasOwnProperty("imageTransparent")&&(e.imageTransparent=t.imageTransparent),t.hasOwnProperty("isAntialiasing")&&null!==t.isAntialiasing&&void 0!==t.isAntialiasing&&(e.isAntialiasing=t.isAntialiasing),t.hasOwnProperty("tokenKey")&&t.hasOwnProperty("tokenValue")&&t.tokenValue&&(e[t.tokenKey]=t.tokenValue),"2.0"===t.igsVersion?(e.size=t.width+","+t.height,e.format=t.format,e.f="image",t.hasOwnProperty("styles")&&(e.layerStyles=t.styles),t.hasOwnProperty("filters")&&t.filters&&(e.layerFilters=t.filters),t.hasOwnProperty("dynamicLayers")&&(e.dynamicLayers=(0,r.default)(t.dynamicLayers)),t.hasOwnProperty("projectionSrs")&&(e.projectionSrs=t.projectionSrs),t.hasOwnProperty("clientId")&&(e.clientId=t.clientId)):(e.w=t.width,e.h=t.height,e.f="png",t.hasOwnProperty("styles")&&e.push("style="+t.styles),t.hasOwnProperty("filters")&&t.filters&&(e.filters=t.filters),t.hasOwnProperty("clientId")&&(e.guid=t.clientId)),e},h.initLayerUrl=function(t,e){var i=void 0;i="2.0"===e.igsVersion?t+"/image":""+t;var r=h.initAllRequestParams(e),n=void 0;if("POST"===e.httpMethod)r.bbox="0,0,0,0",n={url:i,data:r,method:e.httpMethod};else{for(var a in i+="?bbox={bbox}",r){i+="&"+a+"="+r[a]}n={url:i,method:e.httpMethod}}return e.headers&&(n.headers=e.headers),n},h.setVisible=function(t){(0,s.setVisible)(t)},h.setOpacity=function(t){(0,s.setOpacity)(t)},h.refresh=function(t){t.innerView.removeLayer(t.innerLayer.id),t.innerView.removeSource(t.innerLayer.sourceID),t.innerLayer=h.addIGSMapImageLayer(t,{})},h.removeLayer=function(t){(0,s.removeLayer)(t)},e.default=h},function(t,e,i){var r=i(3),n=r.JSON||(r.JSON={stringify:JSON.stringify});t.exports=function(t){return n.stringify.apply(n,arguments)}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getRasterLayer=e.getRasterSource=e.setOpacity=e.removeLayer=e.setVisible=void 0;var r=o(i(23)),n=o(i(163)),a=i(1);function o(t){return t&&t.__esModule?t:{default:t}}e.setVisible=function(t){t.innerView.setLayoutProperty(t.innerLayer.id,"visibility",t.layer.visible?"visible":"none")},e.removeLayer=function(t){t.innerView.removeLayer(t.innerLayer.id)},e.setOpacity=function(t){t.innerView.setPaintProperty(t.innerLayer.id,"raster-opacity",t.layer.opacity)},e.getRasterSource=function(t,e,i,a,o,s){var l=[t];return t&&t.includes("{s}")&&Array.isArray(a)&&(l=a.map(function(e){return t.replace("{s}",e)})),"image"===i?{url:t,rebaseRequestUrl:function(t,e){var i=this.map.getCRS().projection.project(this.map.getBounds()._sw),a=this.map.getCRS().projection.project(this.map.getBounds()._ne),o=[].concat((0,n.default)(i),(0,n.default)(a)).toString(),s=(0,r.default)(e.imageSize,2),l=s[0],u=s[1];return(t.split("?").length>1?t.split("?")[1].split("&"):t.split("&")).forEach(function(e){e.includes("size=")&&(t=t.replace(e,"size="+l+","+u)),e.includes("w=")&&(t=t.replace(e,"w="+l)),e.includes("h=")&&(t=t.replace(e,"h="+u)),e.includes("bbox=")&&(t=t.replace(e,"bbox="+o))}),t},requestParams:o,type:"image-map",clippingArea:s}:{type:"raster",tiles:l,requestParams:o,tileSize:e,clippingArea:s}},e.getRasterLayer=function(t,e,i,r){return{id:t,type:"raster",source:e,paint:{"raster-opacity":i.opacity},layout:{visibility:((0,a.isNull)(r)?i.visible:r._getLayerViewVisible(i.visible))?"visible":"none"}}}},function(t,e,i){t.exports={default:i(158),__esModule:!0}},function(t,e,i){i(42),i(33),t.exports=i(159)},function(t,e,i){var r=i(53),n=i(11)("iterator"),a=i(27);t.exports=i(3).isIterable=function(t){var e=Object(t);return void 0!==e[n]||"@@iterator"in e||a.hasOwnProperty(r(e))}},function(t,e,i){t.exports={default:i(161),__esModule:!0}},function(t,e,i){i(42),i(33),t.exports=i(162)},function(t,e,i){var r=i(14),n=i(54);t.exports=i(3).getIterator=function(t){var e=n(t);if("function"!=typeof e)throw TypeError(t+" is not iterable!");return r(e.call(t))}},function(t,e,i){"use strict";e.__esModule=!0;var r=function(t){return t&&t.__esModule?t:{default:t}}(i(164));e.default=function(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e<t.length;e++)i[e]=t[e];return i}return(0,r.default)(t)}},function(t,e,i){t.exports={default:i(165),__esModule:!0}},function(t,e,i){i(33),i(166),t.exports=i(3).Array.from},function(t,e,i){"use strict";var r=i(24),n=i(9),a=i(28),o=i(74),s=i(75),l=i(47),u=i(167),h=i(54);n(n.S+n.F*!i(80)(function(t){Array.from(t)}),"Array",{from:function(t){var e,i,n,c,p=a(t),f="function"==typeof this?this:Array,d=arguments.length,y=d>1?arguments[1]:void 0,m=void 0!==y,v=0,g=h(p);if(m&&(y=r(y,d>2?arguments[2]:void 0,2)),void 0==g||f==Array&&s(g))for(i=new f(e=l(p.length));e>v;v++)u(i,v,m?y(p[v],v):p[v]);else for(c=g.call(p),i=new f;!(n=c.next()).done;v++)u(i,v,m?o(c,y,[n.value,v],!0):n.value);return i.length=v,i}})},function(t,e,i){"use strict";var r=i(15),n=i(30);t.exports=function(t,e,i){e in t?r.f(t,e,n(0,i)):t[e]=i}},function(t,e,i){i(169),t.exports=i(3).Object.entries},function(t,e,i){var r=i(9),n=i(82)(!0);r(r.S,"Object",{entries:function(t){return n(t)}})},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getGraphicsSourcesAndStyleLayers=e.getGeoJSONSourcesAndStyleLayers=void 0;var r=u(i(38)),n=i(1),a=u(i(63)),o=i(90),s=u(i(91)),l=u(i(8));function u(t){return t&&t.__esModule?t:{default:t}}e.getGeoJSONSourcesAndStyleLayers=function t(e,i){var r=(i=i||{}).featureSet,s=i.mapboxglMap;if(!r||!s)throw new Error("featureSet或mapboxglMap对象缺失");var l=e.renderer,u={type:"geojson",data:r.toGeoJSON()};l instanceof n.ClusterRenderer&&(u.cluster=!0,u.clusterRadius=l.radius),t.imageSourceManager||(t.imageSourceManager=new a.default(s));var h={};h[e.id]=u;var c={featureSet:r,imageSourceManager:t.imageSourceManager,updateState:null},p=e._opacity,f=e.visible;return{sources:h,layers:(0,o.createStyleLayerObjectArray)(e.id,l,e.geometryType,f,p,c)}},e.getGraphicsSourcesAndStyleLayers=function t(e,i){var n=(i=i||{}).mapboxglMap;if(!n)throw new Error("featureSet或mapboxglMap对象缺失");t.imageSourceManager||(t.imageSourceManager=new a.default(n));var o=new s.default({id:e.id,opacity:e._opacity,visible:e.visible});o._imageSourceManager=t.imageSourceManager,e.graphics.forEach(function(t){o._updateGraphicToCollection(t)});var u={},h=[];return(0,r.default)(o._sourceMetaDatas).forEach(function(t){var e=t[1],i=e.featureCollection,r=e.sourceId;if(!(i.length<=0)){u[r]={type:"geojson",data:{type:"FeatureCollection",features:i.map(function(t){return l.default.convertToGeoJSON(t)})}};var n=o.setSourceMetaDataStyle(e,!1);h.push(n)}}),{layers:h,sources:u}}},function(t,e,i){t.exports={default:i(172),__esModule:!0}},function(t,e,i){i(173),t.exports=i(3).Object.values},function(t,e,i){var r=i(9),n=i(82)(!1);r(r.S,"Object",{values:function(t){return n(t)}})},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=o(i(0)),n=o(i(2)),a=i(1);function o(t){return t&&t.__esModule?t:{default:t}}var s=function(){function t(e){(0,r.default)(this,t),e=(0,a.defaultValue)(e,{}),this.sourceId=e.sourceId,this.featureCollection=e.featureCollection,this.layerId=e.layerId,this.renderType=e.renderType,this.mapboxglStyleType=e.mapboxglStyleType,this._sourceDirty=!0,this._styleLayerDirty=!0}return(0,n.default)(t,[{key:"setDirty",value:function(t){this._sourceDirty=t,this._styleLayerDirty=t}},{key:"getDirty",value:function(){return this._sourceDirty||this._styleLayerDirty}},{key:"setSourceDirty",value:function(t){this._sourceDirty=t}},{key:"getSourceDirty",value:function(){return this._sourceDirty}},{key:"setStyleLayerDirty",value:function(t){this._styleLayerDirty=t}},{key:"getStyleLayerDirty",value:function(){return this._styleLayerDirty}}]),t}();e.default=s},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=h(i(4)),n=h(i(0)),a=h(i(2)),o=h(i(5)),s=h(i(29)),l=h(i(6)),u=h(i(36));function h(t){return t&&t.__esModule?t:{default:t}}var c=window.mapv||{},p=c.baiduMapLayer,f=c.DataSet,d=p?p.__proto__:Function,y=function(t){function e(t,i,a,s){(0,n.default)(this,e);var l=(0,o.default)(this,(e.__proto__||(0,r.default)(e)).call(this,t,i,a));if(!d)return(0,o.default)(l);l.map=t,l.dataSet=i;var u=l;return a=a||{},u.init(a),u.argCheck(a),l.initDevicePixelRatio(),l.canvasLayer=s,l.stopAniamation=!1,l.animation=a.animation,l.mousemoveEvent=l.mousemoveEvent.bind(l),l.bindEvent(),l}return(0,l.default)(e,t),(0,a.default)(e,[{key:"initDevicePixelRatio",value:function(){this.devicePixelRatio=window.devicePixelRatio||1}},{key:"clickEvent",value:function(t){var i=t.point;(0,s.default)(e.prototype.__proto__||(0,r.default)(e.prototype),"clickEvent",this).call(this,i,t)}},{key:"mousemoveEvent",value:function(t){var i=t.point;(0,s.default)(e.prototype.__proto__||(0,r.default)(e.prototype),"mousemoveEvent",this).call(this,i,t)}},{key:"addAnimatorEvent",value:function(){}},{key:"animatorMovestartEvent",value:function(){var t=this.options.animation;this.isEnabledTime()&&this.animator&&(this.steps.step=t.stepsRange.start)}},{key:"animatorMoveendEvent",value:function(){this.isEnabledTime()&&this.animator}},{key:"bindEvent",value:function(){var t=this.map;this.options.methods&&(this.options.methods.click&&t.on("click",this.clickEvent),this.options.methods.mousemove&&t.on("mousemove",this.mousemoveEvent))}},{key:"unbindEvent",value:function(){var t=this.map;this.options.methods&&(this.options.methods.click&&t.off("click",this.clickEvent),this.options.methods.mousemove&&t.off("mousemove",this.mousemoveEvent))}},{key:"getContext",value:function(){return this.canvasLayer.canvas.getContext(this.context)}},{key:"init",value:function(t){this.options=t,this.initDataRange(t),this.context=this.options.context||"2d",this.options.zIndex&&this.canvasLayer&&this.canvasLayer.setZIndex(this.options.zIndex),this.initAnimator()}},{key:"_canvasUpdate",value:function(t){var e=this.map;if(this.canvasLayer&&!this.stopAniamation&&!this.canvasLayer.disposeFlag){var i=this.options.animation,r=this.getContext();if(this.isEnabledTime()){if(void 0===t)return void this.clear(r);"2d"===this.context&&(r.save(),r.globalCompositeOperation="destination-out",r.fillStyle="rgba(0, 0, 0, .1)",r.fillRect(0,0,r.canvas.width,r.canvas.height),r.restore())}else this.clear(r);if("2d"===this.context)for(var n in this.options)r[n]=this.options[n];else r.clear(r.COLOR_BUFFER_BIT);if(!(this.options.minZoom&&e.getZoom()<this.options.minZoom||this.options.maxZoom&&e.getZoom()>this.options.maxZoom)){var a={transferCoordinate:function(t){var i=e.project(new u.default.LngLat(t[0],t[1]));return[i.x,i.y]}};void 0!==t&&(a.filter=function(e){var r=i.trails||10;return!!(t&&e.time>t-r&&e.time<t)});var o=this.dataSet.get(a);this.processData(o),"m"==this.options.unit&&this.options.size,this.options._size=this.options.size;var s=e.project(new u.default.LngLat(0,0));this.drawContext(r,new f(o),this.options,s),this.options.updateCallback&&this.options.updateCallback(t)}}}},{key:"updateData",value:function(t,i){var n=t;n&&n.get&&(n=n.get()),void 0!=n&&this.dataSet.set(n),(0,s.default)(e.prototype.__proto__||(0,r.default)(e.prototype),"update",this).call(this,{options:i})}},{key:"addData",value:function(t,e){var i=t;t&&t.get&&(i=t.get()),this.dataSet.add(i),this.update({options:e})}},{key:"getData",value:function(){return this.dataSet}},{key:"removeData",value:function(t){if(this.dataSet){var e=this.dataSet.get({filter:function(e){return null==t||"function"!=typeof t||!t(e)}});this.dataSet.set(e),this.update({options:null})}}},{key:"clearData",value:function(){this.dataSet&&this.dataSet.clear(),this.update({options:null})}},{key:"draw",value:function(){this.canvasLayer.draw()}},{key:"clear",value:function(t){t&&t.clearRect&&t.clearRect(0,0,t.canvas.width,t.canvas.height)}}]),e}(d);e.default=y},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=window.echarts;function n(t,e){this._MapboxGLMap=t,this.dimensions=["lng","lat"],this._mapOffset=[0,0],this._api=e}n.prototype.dimensions=["lng","lat"],n.prototype.setMapOffset=function(t){this._mapOffset=t},n.prototype.getBMap=function(){return this._MapboxGLMap},n.prototype.dataToPoint=function(t){var e=this._MapboxGLMap.project(t),i=this._mapOffset;return[e.x-i[0],e.y-i[1]]},n.prototype.pointToData=function(t){var e=this._mapOffset;return[(t=this._MapboxGLMap.project([t[0]+e[0],t[1]+e[1]])).lng,t.lat]},n.prototype.getViewRect=function(){var t=this._api;return new r.graphic.BoundingRect(0,0,t.getWidth(),t.getHeight())},n.prototype.getRoamTransform=function(){return r.matrix.create()},n.prototype.prepareCustoms=function(t){var e=r.util,i=this.getViewRect();return{coordSys:{type:"mapboxgl",x:i.x,y:i.y,width:i.width,height:i.height},api:{coord:e.bind(this.dataToPoint,this),size:e.bind(function(t,i){return i=i||[0,0],e.map([0,1],function(e){var r=i[e],n=t[e]/2,a=[],o=[];return a[e]=r-n,o[e]=r+n,a[1-e]=o[1-e]=i[1-e],Math.abs(this.dataToPoint(a)[e]-this.dataToPoint(o)[e])},this)},this)}}},n.dimensions=n.prototype.dimensions,n.create=function(t,e){var i=void 0;t.eachComponent("mapboxgl",function(t){e.getZr().painter.getViewportRoot();var a=r.mapboxglMap;(i=new n(a,e)).setMapOffset(t.__mapOffset||[0,0]),t.coordinateSystem=i}),t.eachSeries(function(t){"mapboxgl"===t.get("coordinateSystem")&&(t.coordinateSystem=i)})},e.default=n},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=l(i(23)),n=l(i(35)),a=l(i(0)),o=i(1),s=l(i(8));function l(t){return t&&t.__esModule?t:{default:t}}var u=function t(){(0,a.default)(this,t)};u.addIGSVectorTileLayer=function(t,e){e=(0,o.defaultValue)(e,{});var i=t.innerView,r=t.layer,n=i.getStyle();n.glyphs||(i.style.glyphManager.setURL(r.style.glyphs),i.style.stylesheet.glyphs=r.style.glyphs),n.sprite||(i.style._loadSprite(r.style.sprite),i.style.stylesheet.sprite=r.style.sprite),u.addSourcesAndLayers(t,e.callback)},u.getStyle=function(t,e){var i=t.innerView,r=setInterval(function(){i.isStyleLoaded()&&(clearInterval(r),e&&e instanceof Function&&e(i.getStyle()))},30)},u.initLayerUrl=function(t,e){return"1.0"===e.igsVersion?(t+="/{z}/{y}/{x}",e.tokenKey&&e.tokenValue&&(t+="?"+e.tokenKey+"="+e.tokenValue)):(t+="/tileImage/{z}/{y}/{x}?f=image",e.tokenKey&&e.tokenValue&&(t+="&"+e.tokenKey+"="+e.tokenValue)),t},u.setVisible=function(t,e){var i=t.layer,r=t.innerView;i.style.layers.forEach(function(t){r.setLayoutProperty(t.id,"visibility",e?i._getBackupProperties(t.id,"visibility"):"none")})},u.setOpacity=function(t,e){var i=t.layer,r=t.innerView;i.style.layers.forEach(function(t){var a=i._getBackupProperties(t.id,"opacities");a&&(0,n.default)(a).forEach(function(i){r.setPaintProperty(t.id,i,a[i]*e)})})},u.removeLayer=function(t){for(var e=t.layer.style.layers,i=t.layer.style.sources,r=t.innerView,a=0;a<e.length;a++)r.getLayer(e[a].id)&&r.removeLayer(e[a].id);(0,n.default)(i).forEach(function(t){r.getSource(t)&&r.removeSource(t)})},u.setPaintProperties=function(t,e,i){var r=t.innerView;r.getLayer(e)&&i instanceof Object&&(0,n.default)(i).forEach(function(t){r.setPaintProperty(e,t,i[t])})},u.setLayoutProperties=function(t,e,i){var r=t.innerView;r.getLayer(e)&&i instanceof Object&&(0,n.default)(i).forEach(function(t){r.setLayoutProperty(e,t,i[t])})},u.updateStyleLayer=function(t){var e=t.innerView,i=t.layer,r=e.style;i.style.layers.forEach(function(t){if(r.getLayer(t.id)){if(t.paint)(0,n.default)(t.paint).forEach(function(e){r.setPaintProperty(t.id,e,t.paint[e])});if(t.layout)(0,n.default)(t.layout).forEach(function(e){r.setLayoutProperty(t.id,e,t.layout[e])})}}),e._update&&e._update(!0)},u.addSourcesAndLayers=function(t,e){var i=t.layer,r=u.getSourcesAndStyleLayers(i,{layerView:t}),a=r.sources,o=r.layers;(0,n.default)(a).forEach(function(e){u._addSource(t,e,a[e])});for(var s=0;s<o.length;s++)u._addLayer(t,o[s].id,o[s]);e&&e instanceof Function&&e(this._getInnerLayers(t))},u._createStyleLayers=function(t,e){var i=(e=e||{}).layerView,r=t.style.layers;if(!(t instanceof o.IGSVectorTileLayer))for(var n=0;n<r.length;n++){var a=i?i._getLayerViewVisible(t.visible):t.visible;if(r[n]&&r[n].layout&&r[n].layout instanceof Object&&(r[n].layout.visibility=a?"visible":"none"),r[n]&&r[n].paint&&r[n].paint instanceof Object){var s=[];switch(r[n].type){case"background":s.push("background-opacity");break;case"fill":default:s.push("fill-opacity");break;case"line":s.push("line-opacity");break;case"symbol":s.push("icon-opacity"),s.push("text-opacity");break;case"circle":s.push("circle-opacity");break;case"sky":s.push("sky-opacity")}for(var l=0;l<s.length;l++)r[n].paint[s[l]]=t.opacity}}return r},u._createSources=function(t){var e=t.style.sources,i=s.default.createCRSByLayer(t),a=s.default.convertClippingArea(t.clippingArea),l={};return(0,n.default)(e).forEach(function(n){var s=e[n];s.clippingArea=a,s.crs=i;var u=o.TileInfoUtil.getLevelRangeByTileInfo(t.tileInfo),h=(0,r.default)(u,2),c=h[0],p=h[1];s.minzoom=c,s.maxzoom=p,l[n]=s}),l},u.getSourcesAndStyleLayers=function(t,e){return{sources:this._createSources(t,e),layers:this._createStyleLayers(t,e)}},u._addLayer=function(t,e,i){t.innerView.getLayer(e)||t.innerView.addLayer(i)},u._addSource=function(t,e,i){t.innerView.getSource(e)||t.innerView.addSource(e,i)},u._getInnerLayers=function(t){for(var e=t.layer.style.layers,i=[],r=0;r<e.length;r++)i.push(t.innerView.getLayer(e[r].id));return i},e.default=u},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=p(i(7)),n=p(i(4)),a=p(i(0)),o=p(i(2)),s=p(i(5)),l=p(i(6)),u=i(1),h=i(16),c=p(i(8));function p(t){return t&&t.__esModule?t:{default:t}}var f=function(t){function e(){return(0,a.default)(this,e),(0,s.default)(this,(e.__proto__||(0,n.default)(e)).apply(this,arguments))}return(0,l.default)(e,t),(0,o.default)(e,[{key:"onAdd",value:function(){var t=this.layer;return this.innerLayer=h.IGSTileLayerUtil.addIGSTileLayer(this,{clippingArea:c.default.convertClippingArea(t.clippingArea)}),this.innerLayer.commonLayerId=t.id,r.default.resolve(this)}},{key:"onRemove",value:function(){return h.IGSTileLayerUtil.removeLayer(this),r.default.resolve(this)}},{key:"onUpdate",value:function(t){if(t.updateContent)for(var e=0;e<t.updateContent.length;e++){var i=t.updateContent[e];if(i)switch(i.name){case"visible":h.IGSTileLayerUtil.setVisible(this);break;case"opacity":h.IGSTileLayerUtil.setOpacity(this);break;case"refresh":h.IGSTileLayerUtil.refresh(this);break;case"clippingArea":var n=i.params[0],a=this.innerLayer.source,o=this.innerView.getSource(a);o&&o.setClippingArea(c.default.convertClippingArea(n))}}return r.default.resolve(this)}}]),e}(u.LayerView);e.default=f},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=p(i(7)),n=p(i(4)),a=p(i(0)),o=p(i(2)),s=p(i(5)),l=p(i(6)),u=i(1),h=p(i(62)),c=p(i(8));function p(t){return t&&t.__esModule?t:{default:t}}var f=function(t){function e(){return(0,a.default)(this,e),(0,s.default)(this,(e.__proto__||(0,n.default)(e)).apply(this,arguments))}return(0,l.default)(e,t),(0,o.default)(e,[{key:"onAdd",value:function(){var t=this.layer,e=this._getLayerViewVisible();return this.innerLayer=h.default.addWMSLayer(this,{visible:e,clippingArea:c.default.convertClippingArea(t.clippingArea)}),this.innerLayer.commonLayerId=t.id,r.default.resolve(this)}},{key:"onRemove",value:function(){return h.default.removeLayer(this),r.default.resolve(this)}},{key:"onUpdate",value:function(t){if(t.updateContent)for(var e=0;e<t.updateContent.length;e++){var i=t.updateContent[e];if(i)switch(i.name){case"visible":h.default.setVisible(this,i);break;case"opacity":h.default.setOpacity(this);break;case"refresh":case"sublayerVisible":h.default.refresh(this);break;case"clippingArea":var n=i.params[0],a=this.innerLayer.source,o=this.innerView.getSource(a);o&&o.setClippingArea(c.default.convertClippingArea(n))}}return r.default.resolve(this)}}]),e}(u.LayerView);e.default=f},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=p(i(7)),n=p(i(4)),a=p(i(0)),o=p(i(2)),s=p(i(5)),l=p(i(6)),u=i(1),h=i(16),c=p(i(8));function p(t){return t&&t.__esModule?t:{default:t}}var f=function(t){function e(){return(0,a.default)(this,e),(0,s.default)(this,(e.__proto__||(0,n.default)(e)).apply(this,arguments))}return(0,l.default)(e,t),(0,o.default)(e,[{key:"onAdd",value:function(){var t=this.layer;return this.innerLayer=h.WMTSLayerUtil.addWMTSLayer(this,{clippingArea:c.default.convertClippingArea(t.clippingArea)}),this.innerLayer.commonLayerId=t.id,r.default.resolve(this)}},{key:"onRemove",value:function(){return h.WMTSLayerUtil.removeLayer(this),r.default.resolve(this)}},{key:"onUpdate",value:function(t){if(t.updateContent)for(var e=0;e<t.updateContent.length;e++){var i=t.updateContent[e];if(i)switch(i.name){case"visible":h.WMTSLayerUtil.setVisible(this);break;case"opacity":h.WMTSLayerUtil.setOpacity(this);break;case"refresh":h.WMTSLayerUtil.refresh(this);break;case"clippingArea":var n=i.params[0],a=this.innerLayer.source,o=this.innerView.getSource(a);o&&o.setClippingArea(c.default.convertClippingArea(n))}}return r.default.resolve(this)}}]),e}(u.LayerView);e.default=f},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=l(i(4)),n=l(i(0)),a=l(i(2)),o=l(i(5)),s=l(i(6));function l(t){return t&&t.__esModule?t:{default:t}}var u=function(t){function e(){return(0,n.default)(this,e),(0,o.default)(this,(e.__proto__||(0,r.default)(e)).apply(this,arguments))}return(0,s.default)(e,t),(0,a.default)(e,[{key:"drawFeature",value:function(t,e){t&&t.add(e)}},{key:"updateFeature",value:function(t,e,i){t&&t.update(e,i)}},{key:"clearFeature",value:function(t,e){t&&t.remove(e)}},{key:"clear",value:function(t){t&&t.removeAll()}}]),e}(i(1).FeatureRender);e.default=u},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=p(i(7)),n=p(i(4)),a=p(i(0)),o=p(i(2)),s=p(i(5)),l=p(i(29)),u=p(i(6)),h=p(i(43)),c=p(i(183));function p(t){return t&&t.__esModule?t:{default:t}}var f=function(t){function e(){return(0,a.default)(this,e),(0,s.default)(this,(e.__proto__||(0,n.default)(e)).apply(this,arguments))}return(0,u.default)(e,t),(0,o.default)(e,[{key:"_processData",value:function(){return this.layer._reloadFeatures()}},{key:"onAdd",value:function(t){var i=this.layer;return"server"===i.renderMode?(this.innerLayer=c.default.addIGSVectorLayer(this,{}),this.innerLayer.commonLayerId=i.id,r.default.resolve(this)):(0,l.default)(e.prototype.__proto__||(0,n.default)(e.prototype),"onAdd",this).call(this,t)}},{key:"onUpdate",value:function(t){if("server"===this.layer.renderMode){if(t.updateContent)for(var i=0;i<t.updateContent.length;i++){var a=t.updateContent[i];if(a)switch(a.name){case"visible":c.default.setVisible(this,a);break;case"opacity":c.default.setOpacity(this);break;case"refresh":c.default.refresh(this)}}return r.default.resolve(this)}return(0,l.default)(e.prototype.__proto__||(0,n.default)(e.prototype),"onUpdate",this).call(this,t)}},{key:"onRemove",value:function(t){return"server"===this.layer.renderMode?(this.innerView.removeLayer(this.innerLayer.id),r.default.resolve(this)):(0,l.default)(e.prototype.__proto__||(0,n.default)(e.prototype),"onRemove",this).call(this,t)}}]),e}(h.default);e.default=f},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=h(i(37)),n=h(i(23)),a=h(i(13)),o=h(i(0)),s=i(1),l=i(20),u=i(17);function h(t){return t&&t.__esModule?t:{default:t}}var c=function t(){(0,o.default)(this,t)};c.addIGSVectorLayer=function(t,e){e=e||{};var i=t.layer,r=t.innerView;e.layerView=t;var n=c.getSourcesAndStyleLayers(i,e);(0,u.addStyleToMapboxglMap)(n,r);var a=r.getLayer(n.layers[0].id);return a.sourceID=a.source,a},c.getSourcesAndStyleLayers=function(t,e){var i=(e=e||{}).layerView,r=s.EPSG.find(function(t){return t.id===i.view.spatialReference.wkid}),o={igsVersion:t._igsVersion,tokenKey:t.tokenKey,tokenValue:t.tokenValue,gdbps:[t.gdbp],filters:t.definitionExpression?"0:"+t.definitionExpression:"",headers:t.headers,projectionSrs:(0,s.getProjectionSrs)(i.view.spatialReference),proj:r?r.name:""},u=t.extensionOptions,h=void 0===u?{}:u;o=(0,a.default)(o,h);var p="source_"+t.id,f="layer_"+t.id,d=c.initLayerUrl(t.url,o),y=(0,l.getRasterSource)(d.url,256,null,null,d,e.clippingArea),m=(0,l.getRasterLayer)(f,p,t,i),v=s.TileInfoUtil.getLevelRangeByTileInfo(t.tileInfo),g=(0,n.default)(v,2),_=g[0],x=g[1];y.minzoom=_,y.maxzoom=x;var b={};return b[p]=y,{sources:b,layers:[m]}},c.initLayerUrl=function(t,e){var i=e.igsVersion,r=(0,s.getBaseUrl)(t),n=r+"/igs/rest/mrms/layers";"2.0"===i&&(n=r+"/igs/rest/services/system/ResourceServer/tempData/image");var a=c.initAllRequestParams(e),o=void 0;if("POST"===e.httpMethod)a.bbox="0,0,0,0",o={url:n,data:a,method:e.httpMethod};else{for(var l in n+="?bbox={bbox}",a){n+="&"+l+"="+a[l]}o={url:n,method:e.httpMethod}}return e.headers&&(o.headers=e.headers),o},c.initAllRequestParams=function(t){var e={};if("1.0"===t.igsVersion){var i=t.f||"png";e.f=i,t.gdbps&&(e.gdbps=t.gdbps),e.w=256,e.h=256,t.filters&&(e.filters=t.filters),t.style&&(e.style=(0,r.default)(t.style)),t.proj&&(e.proj=t.proj);var n=t.guid||(0,s.getGUID)();e.guid=n,void 0!==t.isAntialiasing&&null!==t.isAntialiasing&&(e.isAntialiasing=t.isAntialiasing),t.tokenKey&&t.tokenValue&&(e[t.tokenKey]=t.tokenValue)}else{var a=t.f||"image";e.f=a,t.gdbps&&(e.urls=t.gdbps),e.size="256,256",t.projectionSrs&&(e.projectionSrs=""+t.projectionSrs);var o=t.clientId||(0,s.getGUID)();e.clientId=o,void 0!==t.isAntialiasing&&null!==t.isAntialiasing&&(e.isAntialiasing=t.isAntialiasing),t.tokenKey&&t.tokenValue&&(e[t.tokenKey]=t.tokenValue)}return e},c.setVisible=function(t){(0,l.setVisible)(t)},c.setOpacity=function(t){(0,l.setOpacity)(t)},c.refresh=function(t){t.innerView.removeLayer(t.innerLayer.id),t.innerView.removeSource(t.innerLayer.sourceID),t.innerLayer=c.addIGSVectorLayer(t,{})},c.removeLayer=function(t){(0,l.removeLayer)(t)},e.default=c},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=u(i(7)),n=u(i(4)),a=u(i(0)),o=u(i(2)),s=u(i(5)),l=u(i(6));function u(t){return t&&t.__esModule?t:{default:t}}var h=function(t){function e(){return(0,a.default)(this,e),(0,s.default)(this,(e.__proto__||(0,n.default)(e)).apply(this,arguments))}return(0,l.default)(e,t),(0,o.default)(e,[{key:"_processData",value:function(){var t=this.layer;return r.default.resolve(t._source)}}]),e}(u(i(43)).default);e.default=h},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=l(i(4)),n=l(i(0)),a=l(i(2)),o=l(i(5)),s=l(i(6));function l(t){return t&&t.__esModule?t:{default:t}}var u=function(t){function e(){return(0,n.default)(this,e),(0,o.default)(this,(e.__proto__||(0,r.default)(e)).apply(this,arguments))}return(0,s.default)(e,t),(0,a.default)(e,[{key:"_processData",value:function(){return this.layer.queryFeatures().then(function(t){return t})}}]),e}(l(i(43)).default);e.default=u},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=p(i(7)),n=p(i(4)),a=p(i(0)),o=p(i(2)),s=p(i(5)),l=p(i(6)),u=i(1),h=i(16),c=p(i(8));function p(t){return t&&t.__esModule?t:{default:t}}var f=function(t){function e(){return(0,a.default)(this,e),(0,s.default)(this,(e.__proto__||(0,n.default)(e)).apply(this,arguments))}return(0,l.default)(e,t),(0,o.default)(e,[{key:"onAdd",value:function(){var t=this.layer,e=this._getLayerViewVisible();return this.innerLayer=h.WebTileLayerUtil.addWebTileLayer(this,{visible:e,clippingArea:c.default.convertClippingArea(t.clippingArea)}),this.innerLayer.commonLayerId=t.id,r.default.resolve(this)}},{key:"onRemove",value:function(){return h.WebTileLayerUtil.removeLayer(this),r.default.resolve(this)}},{key:"onUpdate",value:function(t){if(t.updateContent)for(var e=0;e<t.updateContent.length;e++){var i=t.updateContent[e];if(i)switch(i.name){case"visible":h.WebTileLayerUtil.setVisible(this,i);break;case"opacity":h.WebTileLayerUtil.setOpacity(this);break;case"sublayerVisible":case"refresh":h.WebTileLayerUtil.refresh(this);break;case"clippingArea":var n=i.params[0],a=this.innerLayer.source,o=this.innerView.getSource(a);o&&o.setClippingArea(c.default.convertClippingArea(n))}}return r.default.resolve(this)}}]),e}(u.LayerView);e.default=f},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=s(i(4)),n=s(i(0)),a=s(i(5)),o=s(i(6));function s(t){return t&&t.__esModule?t:{default:t}}var l=function(t){function e(){return(0,n.default)(this,e),(0,a.default)(this,(e.__proto__||(0,r.default)(e)).apply(this,arguments))}return(0,o.default)(e,t),e}(i(1).GroupLayerView);e.default=l},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=c(i(7)),n=c(i(4)),a=c(i(0)),o=c(i(2)),s=c(i(5)),l=c(i(6)),u=i(1),h=c(i(189));function c(t){return t&&t.__esModule?t:{default:t}}var p=function(t){function e(){return(0,a.default)(this,e),(0,s.default)(this,(e.__proto__||(0,n.default)(e)).apply(this,arguments))}return(0,l.default)(e,t),(0,o.default)(e,[{key:"onAdd",value:function(t){var e=this.layer,i=this.innerView;return this.innerLayer=h.default.addEchartsLayer(e,i),this.innerLayer.commonLayerId=e.commonLayerId,this._getLayerViewVisible()?this.innerLayer.show():this.innerLayer.hide(),r.default.resolve(this)}},{key:"onRemove",value:function(t){return h.default.removeLayer(this.innerLayer),r.default.resolve(this)}},{key:"onUpdate",value:function(t){if(t.updateContent)for(var e=0;e<t.updateContent.length;e++){var i=t.updateContent[e];if(i)switch(i.name){case"visible":var n=i.params&&i.params.length>0?i.params[0]:void 0;this._getLayerViewVisible(n)?this.innerLayer.show():this.innerLayer.hide();break;case"opacity":this.innerLayer.setOpacity(this.layer.opacity)}}return r.default.resolve(this)}}]),e}(u.LayerView);e.default=p},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=o(i(13)),n=o(i(0)),a=o(i(93));function o(t){return t&&t.__esModule?t:{default:t}}var s=function t(){(0,n.default)(this,t)};s.addEchartsLayer=function(t,e){var i=t.extensionOptions,n=void 0===i?{}:i,o=(0,r.default)(t.echartsOptions,n),s=new a.default(e,o).addTo(e);return s.id=t.id,s},s.removeLayer=function(t){t.remove()},e.default=s},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=c(i(7)),n=c(i(4)),a=c(i(0)),o=c(i(2)),s=c(i(5)),l=c(i(6)),u=i(1),h=c(i(191));function c(t){return t&&t.__esModule?t:{default:t}}var p=function(t){function e(){return(0,a.default)(this,e),(0,s.default)(this,(e.__proto__||(0,n.default)(e)).apply(this,arguments))}return(0,l.default)(e,t),(0,o.default)(e,[{key:"onAdd",value:function(t){var e=this.layer,i=this.innerView;return this.innerLayer=h.default.addMapVLayer(e,i),this.innerLayer.commonLayerId=e.id,this._getLayerViewVisible()?this.innerLayer.show():this.innerLayer.hide(),r.default.resolve(this)}},{key:"onRemove",value:function(t){return h.default.removeLayer(this.innerLayer),r.default.resolve(this)}},{key:"onUpdate",value:function(t){if(t.updateContent)for(var e=0;e<t.updateContent.length;e++){var i=t.updateContent[e];if(i)switch(i.name){case"visible":var n=i.params&&i.params.length>0?i.params[0]:void 0;this._getLayerViewVisible(n)?this.innerLayer.show():this.innerLayer.hide();break;case"opacity":this.innerLayer.setOpacity(this.layer.opacity)}}return r.default.resolve(this)}}]),e}(u.LayerView);e.default=p},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=o(i(13)),n=o(i(0)),a=o(i(92));function o(t){return t&&t.__esModule?t:{default:t}}var s=function t(){(0,n.default)(this,t)};s.addMapVLayer=function(t,e){var i=t.extensionOptions,n=void 0===i?{}:i,o=(0,r.default)(t.mapVOptions,n),s=new a.default(e,t.data,o);return s.id=t.id,s},s.removeLayer=function(t){t.remove()},e.default=s},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=c(i(7)),n=c(i(4)),a=c(i(0)),o=c(i(2)),s=c(i(5)),l=c(i(6)),u=i(1),h=i(16);function c(t){return t&&t.__esModule?t:{default:t}}var p=function(t){function e(){return(0,a.default)(this,e),(0,s.default)(this,(e.__proto__||(0,n.default)(e)).apply(this,arguments))}return(0,l.default)(e,t),(0,o.default)(e,[{key:"onAdd",value:function(){var t=this.layer;return this.innerLayer=h.ArcGISMapImageUtil.addArcGISMapImageLayer(this),this.innerLayer.commonLayerId=t.id,r.default.resolve(this)}},{key:"onRemove",value:function(){return h.ArcGISMapImageUtil.removeLayer(this),r.default.resolve(this)}},{key:"onUpdate",value:function(t){if(t.updateContent)for(var e=0;e<t.updateContent.length;e++){var i=t.updateContent[e];if(i)switch(i.name){case"visible":h.ArcGISMapImageUtil.setVisible(this,i);break;case"opacity":h.ArcGISMapImageUtil.setOpacity(this);break;case"sublayerVisible":case"refresh":h.ArcGISMapImageUtil.refresh(this)}}return r.default.resolve(this)}}]),e}(u.LayerView);e.default=p},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=p(i(7)),n=p(i(4)),a=p(i(0)),o=p(i(2)),s=p(i(5)),l=p(i(6)),u=i(1),h=i(16),c=p(i(8));function p(t){return t&&t.__esModule?t:{default:t}}var f=function(t){function e(){return(0,a.default)(this,e),(0,s.default)(this,(e.__proto__||(0,n.default)(e)).apply(this,arguments))}return(0,l.default)(e,t),(0,o.default)(e,[{key:"onAdd",value:function(){var t=this.layer;return this.innerLayer=h.ArcGISTileLayerUtil.addArcGISTileLayer(this,{clippingArea:c.default.convertClippingArea(t.clippingArea)}),this.innerLayer.commonLayerId=t.id,r.default.resolve(this)}},{key:"onRemove",value:function(){return h.ArcGISTileLayerUtil.removeLayer(this),r.default.resolve(this)}},{key:"onUpdate",value:function(t){if(t.updateContent)for(var e=0;e<t.updateContent.length;e++){var i=t.updateContent[e];if(i)switch(i.name){case"visible":h.ArcGISTileLayerUtil.setVisible(this);break;case"opacity":h.ArcGISTileLayerUtil.setOpacity(this);break;case"refresh":h.ArcGISTileLayerUtil.refresh(this);break;case"clippingArea":var n=i.params[0],a=this.innerLayer.source,o=this.innerView.getSource(a);o&&o.setClippingArea(c.default.convertClippingArea(n))}}return r.default.resolve(this)}}]),e}(u.LayerView);e.default=f},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){return t&&t.__esModule?t:{default:t}}(i(0)),n=i(1);var a=function t(){(0,r.default)(this,t)};a.getMouseEvent=function(t,e,i){return{mapPoint:e._spatialReference.isGeographic?new n.Point({coordinates:[t.lngLat.lng,t.lngLat.lat]}):n.Projection.project(new n.Point({coordinates:[t.lngLat.lng,t.lngLat.lat]}),new n.SpatialReference(e.crs.code)),x:t.point.x,y:t.point.y,button:t.originalEvent.button,buttons:t.originalEvent.buttons,stopPropagation:t.originalEvent.stopPropagation,timeStamp:t.originalEvent.timeStamp,native:t.originalEvent,type:i}},a.getKeyEvent=function(t,e,i){var r={key:t.originalEvent.key,stopPropagation:t.originalEvent.stopPropagation,timeStamp:t.originalEvent.timeStamp,native:t.originalEvent,type:i};return"key-down"===i&&(r.repeat=t.originalEvent.repeat),r},a.getViewChangeEvent=function(t,e,i){var r={event:t,target:e,type:i};return r.mapView=e,r.scale=e._scale,r.zoom=e._zoom,r.center=e.center,r.extent=e._extent,r},a.getDragEvent=function(t,e,i,r,n){return{x:t.originalEvent.layerX,y:t.originalEvent.layerY,button:void 0!==n?n:t.originalEvent.button,buttons:t.originalEvent.buttons,cancelable:t.originalEvent.cancelable,origin:i,stopPropagation:t.originalEvent.stopPropagation,timeStamp:t.originalEvent.timeStamp,native:t.originalEvent,action:r,type:"drag"}},a.getKeyEvent=function(t,e,i){var r={key:t.key,stopPropagation:t.stopPropagation,timeStamp:t.timeStamp,native:t,type:i};return"key-down"===i&&(r.repeat=t.repeat),r},e.default=a},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SketchEditor=void 0;var r=function(t){return t&&t.__esModule?t:{default:t}}(i(196));e.SketchEditor=r.default},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=h(i(4)),n=h(i(0)),a=h(i(2)),o=h(i(5)),s=h(i(29)),l=h(i(6)),u=i(1);function h(t){return t&&t.__esModule?t:{default:t}}var c=function(t){function e(t){return(0,n.default)(this,e),(0,o.default)(this,(e.__proto__||(0,r.default)(e)).call(this,t))}return(0,l.default)(e,t),(0,a.default)(e,[{key:"start",value:function(t,i){(0,s.default)(e.prototype.__proto__||(0,r.default)(e.prototype),"start",this).call(this,t,i)}},{key:"startCustomDrawTool",value:function(t){(0,s.default)(e.prototype.__proto__||(0,r.default)(e.prototype),"startCustomDrawTool",this).call(this,t)}},{key:"stop",value:function(){(0,s.default)(e.prototype.__proto__||(0,r.default)(e.prototype),"stop",this).call(this)}},{key:"remove",value:function(){(0,s.default)(e.prototype.__proto__||(0,r.default)(e.prototype),"remove",this).call(this)}},{key:"update",value:function(t,i){(0,s.default)(e.prototype.__proto__||(0,r.default)(e.prototype),"updateFeature",this).call(this,t,i)}},{key:"addVertex",value:function(t,i){(0,s.default)(e.prototype.__proto__||(0,r.default)(e.prototype),"addVertex",this).call(this,t,i)}},{key:"updateVertex",value:function(t,i){(0,s.default)(e.prototype.__proto__||(0,r.default)(e.prototype),"updateVertex",this).call(this,t,i)}},{key:"removeVertex",value:function(t){(0,s.default)(e.prototype.__proto__||(0,r.default)(e.prototype),"removeVertex",this).call(this,t)}},{key:"getSketchDataType",value:function(){(0,s.default)(e.prototype.__proto__||(0,r.default)(e.prototype),"getSketchDataType",this).call(this)}},{key:"setSketchStyle",value:function(t){(0,s.default)(e.prototype.__proto__||(0,r.default)(e.prototype),"setSketchStyle",this).call(this,t)}},{key:"getSketchStyle",value:function(){return(0,s.default)(e.prototype.__proto__||(0,r.default)(e.prototype),"getSketchStyle",this).call(this)}},{key:"getGeometry",value:function(){return(0,s.default)(e.prototype.__proto__||(0,r.default)(e.prototype),"getGeometry",this).call(this)}},{key:"union",value:function(t){return(0,s.default)(e.prototype.__proto__||(0,r.default)(e.prototype),"union",this).call(this,t)}},{key:"split",value:function(t,i){return(0,s.default)(e.prototype.__proto__||(0,r.default)(e.prototype),"split",this).call(this,t,i)}},{key:"drawPolylineToPolygon",value:function(t){(0,s.default)(e.prototype.__proto__||(0,r.default)(e.prototype),"drawPolylineToPolygon",this).call(this,t)}},{key:"undo",value:function(){return(0,s.default)(e.prototype.__proto__||(0,r.default)(e.prototype),"undo",this).call(this)}},{key:"redo",value:function(){return(0,s.default)(e.prototype.__proto__||(0,r.default)(e.prototype),"redo",this).call(this)}},{key:"canUndo",value:function(){return(0,s.default)(e.prototype.__proto__||(0,r.default)(e.prototype),"canUndo",this).call(this)}},{key:"canRedo",value:function(){return(0,s.default)(e.prototype.__proto__||(0,r.default)(e.prototype),"canRedo",this).call(this)}},{key:"_hitTestSketchEvent",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._sketchInnerLayer,i=this;this.view.on(u.ViewEventType.mouseDown,function(r){if(r&&r.x&&r.y&&(!i._drawTool||i._drawTool._editMode!==u.SketchEditMode.DRAWING)){var n=void 0,a=i.view.hitTest({x:r.x,y:r.y});if(a&&Array.isArray(a)&&(n=a[0]),n&&e.id===n.layer.id){var o=i._drawTool?i._drawTool._getDrawToolByFeatureId(n.graphic.id):void 0;if(!o&&(!i._drawTool||i._drawTool.sketchStage.entityGraphic&&"drawn"===i._drawTool.state)){var s=i.view.getLayer(n.layer.id).graphics.filter(function(t){if(t.id===n.graphic.id)return t});if(!(s&&s.items.length>0))return;var l=s.items[0];i._drawTool&&i._drawTool._clearEditGraphics(i._drawTool._editMode),t._addFeatureToSketchEditor(l),i._undoRedoManager.reset(),i._drawTools=[i._drawTool],o=i._drawTool}if(!o||o===i._drawTool&&"drawn"!==o.state)return;if(0===o.editOption._hitTestMode)i.view.on(u.ViewEventType.mouseUp,function t(){if(i._editable&&(void 0===i._drawTool||null===i._drawTool||3!==i._drawTool._editMode)){if(void 0!==i._drawTool&&null!==i._drawTool&&i.fire("selected",{isSelected:!0,selectedDrawTool:i._drawTool,selectedGeometry:i._drawTool.sketchStage.entityGraphic.geometry},i),!o._parent&&0===o._editMode){var e=new u.SketchEditorEvent({type:u.SketchEditorEventType.update,target:i,toolEventInfo:null,state:u.SketchEditorState.start,feature:i._drawTool.sketchStage.entityGraphic,geometry:i._drawTool.sketchStage.entityGraphic.geometry});i.fire(u.SketchEditorEventType.update,e)}o.hitTestFeature(o.sketchStage.entityGraphic,r),i.view.off(u.ViewEventType.mouseUp,t)}});else{if(!i._editable)return;if(void 0!==i._drawTool&&null!==i._drawTool&&3===i._drawTool._editMode)return;o.hitTestFeature(o.sketchStage.entityGraphic,r)}}}})}},{key:"_getCenterCoordinate",value:function(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]}}]),e}(u.SketchEditor);e.default=c}])});
|
|
1
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@mapgis/webclient-common"),require("@mapgis/mapbox-gl"));else if("function"==typeof define&&define.amd)define(["@mapgis/webclient-common","@mapgis/mapbox-gl"],t);else{var i="object"==typeof exports?t(require("@mapgis/webclient-common"),require("@mapgis/mapbox-gl")):t(e["@mapgis/webclient-common"],e["@mapgis/mapbox-gl"]);for(var r in i)("object"==typeof exports?exports:e)[r]=i[r]}}(window,function(e,t){return function(e){var t={};function i(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,i),a.l=!0,a.exports}return i.m=e,i.c=t,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)i.d(r,a,function(t){return e[t]}.bind(null,a));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=3)}([function(t,i){t.exports=e},function(e,i){e.exports=t},function(e,t,i){e.exports=function(){"use strict";Object.freeze=function(e){return e};var e=Object.create||function(){function e(){}return function(t){return e.prototype=t,new e}}(),t=/\{ *([\w_-]+) *\}/g,i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},r=3.141592653589793,a=6378245,n=.006693421622965943,s=3e3*r/180;function o(e,t,i){var a=r/180*t,n=Math.pow(2,i);return[parseInt((e+180)/360*n),parseInt((1-Math.asinh(Math.tan(a))/r)/2*n)]}function l(e,t){if(i(e)){var r=e[0];t=e[1],e=r}e instanceof Object&&(r=e.lng,t=e.lat,e=r);var a,n,o,l,c,h,p=(a=e-.0065,n=t-.006,o=Math.sqrt(a*a+n*n)-2e-5*Math.sin(n*s),l=Math.atan2(n,a)-3e-6*Math.cos(a*s),c=o*Math.cos(l),h=o*Math.sin(l),{lng:c,lat:h});return u(p.lng,p.lat)}function c(e,t){if(i(e)){var r=e[0];t=e[1],e=r}e instanceof Object&&(r=e.lng,t=e.lat,e=r);var a,n,o,l,c,u,p=h(e,t);return a=p.lng,n=p.lat,o=Math.sqrt(a*a+n*n)+2e-5*Math.sin(n*s),l=Math.atan2(n,a)+3e-6*Math.cos(a*s),c=o*Math.cos(l)+.0065,u=o*Math.sin(l)+.006,{lng:c,lat:u}}function h(e,t){if(i(e)){var s=e[0];t=e[1],e=s}e instanceof Object&&(s=e.lng,t=e.lat,e=s);var o=p(e-105,t-35),l=d(e-105,t-35),c=t/180*r,h=Math.sin(c);h=1-n*h*h;var u=Math.sqrt(h);return o=180*o/(a*(1-n)/(h*u)*r),{lng:e+(l=180*l/(a/u*Math.cos(c)*r)),lat:t+o}}function u(e,t){if(i(e)){var s=e[0];t=e[1],e=s}e instanceof Object&&(s=e.lng,t=e.lat,e=s);var o=function(e,t){var i=p(e-105,t-35),s=d(e-105,t-35),o=t/180*r,l=Math.sin(o);l=1-n*l*l;var c=Math.sqrt(l);return i=180*i/(a*(1-n)/(l*c)*r),s=180*s/(a/c*Math.cos(o)*r),{lng:e+s,lat:t+i}}(e,t);return{lng:2*e-o.lng,lat:2*t-o.lat}}function p(e,t){var i=2*e-100+3*t+.2*t*t+.1*e*t+.2*Math.sqrt(Math.abs(e));return i+=2*(20*Math.sin(6*e*r)+20*Math.sin(2*e*r))/3,i+=2*(20*Math.sin(t*r)+40*Math.sin(t/3*r))/3,i+=2*(160*Math.sin(t/12*r)+320*Math.sin(t*r/30))/3}function d(e,t){var i=300+e+2*t+.1*e*e+.1*e*t+.1*Math.sqrt(Math.abs(e));return i+=2*(20*Math.sin(6*e*r)+20*Math.sin(2*e*r))/3,i+=2*(20*Math.sin(e*r)+40*Math.sin(e/3*r))/3,i+=2*(150*Math.sin(e/12*r)+300*Math.sin(e/30*r))/3}function y(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e}function m(e){return"string"==typeof e}var f=void 0,g=null;function v(e,t){isNaN(e)&&(e=Ib(e),e=isNaN(e)?0:e),m(e)&&(e=parseFloat(e)),isNaN(t)&&(t=Ib(t),t=isNaN(t)?0:t),m(t)&&(t=parseFloat(t)),this.lng=e,this.lat=t}function b(e,t){this.x=e||0,this.y=t||0,this.x=this.x,this.y=this.y}function _(){}function S(){}v.TL=function(e){return e&&180>=e.lng&&-180<=e.lng&&74>=e.lat&&-74<=e.lat},v.prototype.lb=function(e){return e&&this.lat==e.lat&&this.lng==e.lng},b.prototype.lb=function(e){return e&&e.x==this.x&&e.y==this.y},_.prototype.nh=function(){aa("lngLatToPoint方法未实现")},_.prototype.wi=function(){aa("pointToLngLat方法未实现")},S.prototype=new _,y(S,{$O:6370996.81,lG:[12890594.86,8362377.87,5591021,3481989.83,1678043.12,0],Au:[75,60,45,30,15,0],fP:[[1.410526172116255e-8,898305509648872e-20,-1.9939833816331,200.9824383106796,-187.2403703815547,91.6087516669843,-23.38765649603339,2.57121317296198,-.03801003308653,17337981.2],[-7.435856389565537e-9,8983055097726239e-21,-.78625201886289,96.32687599759846,-1.85204757529826,-59.36935905485877,47.40033549296737,-16.50741931063887,2.28786674699375,10260144.86],[-3.030883460898826e-8,898305509983578e-20,.30071316287616,59.74293618442277,7.357984074871,-25.38371002664745,13.45380521110908,-3.29883767235584,.32710905363475,6856817.37],[-1.981981304930552e-8,8983055099779535e-21,.03278182852591,40.31678527705744,.65659298677277,-4.44255534477492,.85341911805263,.12923347998204,-.04625736007561,4482777.06],[3.09191371068437e-9,8983055096812155e-21,6995724062e-14,23.10934304144901,-.00023663490511,-.6321817810242,-.00663494467273,.03430082397953,-.00466043876332,2555164.4],[2.890871144776878e-9,8983055095805407e-21,-3.068298e-8,7.47137025468032,-353937994e-14,-.02145144861037,-1234426596e-14,.00010322952773,-323890364e-14,826088.5]],iG:[[-.0015702102444,111320.7020616939,0x60e374c3105a3,-0x24bb4115e2e164,0x5cc55543bb0ae8,-0x7ce070193f3784,0x5e7ca61ddf8150,-0x261a578d8b24d0,0x665d60f3742ca,82.5],[.0008277824516172526,111320.7020463578,647795574.6671607,-4082003173.641316,10774905663.51142,-15171875531.51559,12053065338.62167,-5124939663.577472,913311935.9512032,67.5],[.00337398766765,111320.7020202162,4481351.045890365,-23393751.19931662,79682215.47186455,-115964993.2797253,97236711.15602145,-43661946.33752821,8477230.501135234,52.5],[.00220636496208,111320.7020209128,51751.86112841131,3796837.749470245,992013.7397791013,-1221952.21711287,1340652.697009075,-620943.6990984312,144416.9293806241,37.5],[-.0003441963504368392,111320.7020576856,278.2353980772752,2485758.690035394,6070.750963243378,54821.18345352118,9540.606633304236,-2710.55326746645,1405.483844121726,22.5],[-.0003218135878613132,111320.7020701615,.00369383431289,823725.6402795718,.46104986909093,2351.343141331292,1.58060784298199,8.77738589078284,.37238884252424,7.45]],Z1:function(e,t){return e&&t&&(e=this.Fb(e))?(i=this.Tk(e.lng),r=this.Tk(e.lat),(t=this.Fb(t))?this.Pe(i,this.Tk(t.lng),r,this.Tk(t.lat)):0):0;var i,r},Vo:function(e,t){return e&&t?(e.lng=this.JD(e.lng,-180,180),e.lat=this.ND(e.lat,-74,74),t.lng=this.JD(t.lng,-180,180),t.lat=this.ND(t.lat,-74,74),this.Pe(this.Tk(e.lng),this.Tk(t.lng),this.Tk(e.lat),this.Tk(t.lat))):0},Fb:function(e){if(e===g||e===f)return new v(0,0);var t,i;t=new v(Math.abs(e.lng),Math.abs(e.lat));for(var r=0;r<this.lG.length;r++)if(t.lat>=this.lG[r]){i=this.fP[r];break}return new v((e=this.gK(e,i)).lng.toFixed(6),e.lat.toFixed(6))},Eb:function(e){if(e===g||e===f||180<e.lng||-180>e.lng||90<e.lat||-90>e.lat)return new v(0,0);var t,i;e.lng=this.JD(e.lng,-180,180),e.lat=this.ND(e.lat,-74,74),t=new v(e.lng,e.lat);for(var r=0;r<this.Au.length;r++)if(t.lat>=this.Au[r]){i=this.iG[r];break}if(!i)for(r=0;r<this.Au.length;r++)if(t.lat<=-this.Au[r]){i=this.iG[r];break}return new v((e=this.gK(e,i)).lng.toFixed(2),e.lat.toFixed(2))},gK:function(e,t){if(e&&t){var i=t[0]+t[1]*Math.abs(e.lng),r=Math.abs(e.lat)/t[9];return r=t[2]+t[3]*r+t[4]*r*r+t[5]*r*r*r+t[6]*r*r*r*r+t[7]*r*r*r*r*r+t[8]*r*r*r*r*r*r,new v(i*=0>e.lng?-1:1,r*=0>e.lat?-1:1)}},Pe:function(e,t,i,r){return this.$O*Math.acos(Math.sin(i)*Math.sin(r)+Math.cos(i)*Math.cos(r)*Math.cos(t-e))},Tk:function(e){return Math.PI*e/180},Z3:function(e){return 180*e/Math.PI},ND:function(e,t,i){return t!=g&&(e=Math.max(e,t)),i!=g&&(e=Math.min(e,i)),e},JD:function(e,t,i){for(;e>i;)e-=i-t;for(;e<t;)e+=i-t;return e}}),y(S.prototype,{Jm:function(e){return S.Eb(e)},nh:function(e){return new b((e=S.Eb(e)).lng,e.lat)},qh:function(e){return S.Fb(e)},wi:function(e){return e=new v(e.x,e.y),S.Fb(e)},fc:function(e,t,i,r,a){if(e)return e=this.Jm(e,a),t=this.Lc(t),new b(Math.round((e.lng-i.lng)/t+r.width/2),Math.round((i.lat-e.lat)/t+r.height/2))},zb:function(e,t,i,r,a){if(e)return t=this.Lc(t),this.qh(new v(i.lng+t*(e.x-r.width/2),i.lat-t*(e.y-r.height/2)),a)},Lc:function(e){return Math.pow(2,18-e)}});var x=S.prototype;!function(e,t){for(var i in t)e[i]=t[i]}(x,{lngLatToPoint:x.nh,pointToLngLat:x.wi});let w={Point:v,Pixel:b,MercatorProjection:S};class L{constructor(e,t){this.levelMax=e,this.levelMin=t,this.projection=new w.MercatorProjection}_getRetain(e){return Math.pow(2,e-18)}getResolution(e,t){return Math.pow(2,18-t)*Math.cos(e)}lnglatToPoint(e,t){let i=new w.Point(e,t),r=this.projection.lngLatToPoint(i);return{pointX:r.x,pointY:r.y}}pointToLnglat(e,t){let i=new w.Pixel(e,t),r=this.projection.pointToLngLat(i);return{lng:r.lng,lat:r.lat}}_lngToTileX(e,t){let i=this.lnglatToPoint(e,0);return Math.floor(i.pointX*this._getRetain(t)/256)}_latToTileY(e,t){let i=this.lnglatToPoint(0,e);return Math.floor(i.pointY*this._getRetain(t)/256)}lnglatToTile(e,t,i){return[this._lngToTileX(e,i),this._latToTileY(t,i)]}_lngToPixelX(e,t){let i=this._lngToTileX(e,t),r=this.lnglatToPoint(e,0);return Math.floor(r.pointX*this._getRetain(t)-256*i)}_latToPixelY(e,t){let i=this._latToTileY(e,t),r=this.lnglatToPoint(0,e);return Math.floor(r.pointY*this._getRetain(t)-256*i)}lnglatToPixel(e,t,i){return{pixelX:this._lngToPixelX(e,i),pixelY:this._latToPixelY(t,i)}}_pixelXToLng(e,t,i){let r=(256*t+e)/this._getRetain(i);return this.pointToLnglat(r,0).lng}_pixelYToLat(e,t,i){let r=(256*t+e)/this._getRetain(i);return this.pointToLnglat(0,r).lat}pixelToLnglat(e,t,i,r,a){let n=(256*i+e)/this._getRetain(a),s=(256*r+t)/this._getRetain(a),o=this.pointToLnglat(n,s);return[o.lng,o.lat]}}function M(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function T(e){"@babel/helpers - typeof";return(T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function V(e){var t=function(e,t){if("object"!=T(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,t);if("object"!=T(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==T(t)?t:t+""}function P(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,V(r.key),r)}}function k(e,t,i){return t&&P(e.prototype,t),i&&P(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function O(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function E(e){return(E=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function C(e,t){return(C=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function j(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,r=Array(t);i<t;i++)r[i]=e[i];return r}function I(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var r,a,n,s,o=[],l=!0,c=!1;try{if(n=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(r=n.call(i)).done)&&(o.push(r.value),o.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=i.return&&(s=i.return(),Object(s)!==s))return}finally{if(c)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return j(e,t);var i={}.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?j(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var A,z=1e-6,R="undefined"!=typeof Float32Array?Float32Array:Array;function D(e,t){var i,r,a,n,s,o,l,c=(i=[],a=e,n=(r=t)[0],s=r[1],o=r[2],l=r[3],i[0]=a[0]*n+a[4]*s+a[8]*o+a[12]*l,i[1]=a[1]*n+a[5]*s+a[9]*o+a[13]*l,i[2]=a[2]*n+a[6]*s+a[10]*o+a[14]*l,i[3]=a[3]*n+a[7]*s+a[11]*o+a[15]*l,i);return function(e,t,i){e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i}(c,c,1/c[3]),c}function G(e,t,i){var r=t[0],a=t[1],n=t[2],s=t[3],o=t[4],l=t[5],c=t[6],h=t[7],u=t[8],p=t[9],d=t[10],y=t[11],m=t[12],f=t[13],g=t[14],v=t[15],b=i[0],_=i[1],S=i[2],x=i[3];return e[0]=b*r+_*o+S*u+x*m,e[1]=b*a+_*l+S*p+x*f,e[2]=b*n+_*c+S*d+x*g,e[3]=b*s+_*h+S*y+x*v,b=i[4],_=i[5],S=i[6],x=i[7],e[4]=b*r+_*o+S*u+x*m,e[5]=b*a+_*l+S*p+x*f,e[6]=b*n+_*c+S*d+x*g,e[7]=b*s+_*h+S*y+x*v,b=i[8],_=i[9],S=i[10],x=i[11],e[8]=b*r+_*o+S*u+x*m,e[9]=b*a+_*l+S*p+x*f,e[10]=b*n+_*c+S*d+x*g,e[11]=b*s+_*h+S*y+x*v,b=i[12],_=i[13],S=i[14],x=i[15],e[12]=b*r+_*o+S*u+x*m,e[13]=b*a+_*l+S*p+x*f,e[14]=b*n+_*c+S*d+x*g,e[15]=b*s+_*h+S*y+x*v,e}function N(e,t,i){var r,a,n,s,o,l,c,h,u,p,d,y,m=i[0],f=i[1],g=i[2];return t===e?(e[12]=t[0]*m+t[4]*f+t[8]*g+t[12],e[13]=t[1]*m+t[5]*f+t[9]*g+t[13],e[14]=t[2]*m+t[6]*f+t[10]*g+t[14],e[15]=t[3]*m+t[7]*f+t[11]*g+t[15]):(r=t[0],a=t[1],n=t[2],s=t[3],o=t[4],l=t[5],c=t[6],h=t[7],u=t[8],p=t[9],d=t[10],y=t[11],e[0]=r,e[1]=a,e[2]=n,e[3]=s,e[4]=o,e[5]=l,e[6]=c,e[7]=h,e[8]=u,e[9]=p,e[10]=d,e[11]=y,e[12]=r*m+o*f+u*g+t[12],e[13]=a*m+l*f+p*g+t[13],e[14]=n*m+c*f+d*g+t[14],e[15]=s*m+h*f+y*g+t[15]),e}function F(e,t,i){var r=i[0],a=i[1],n=i[2];return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*a,e[5]=t[5]*a,e[6]=t[6]*a,e[7]=t[7]*a,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)}),A=new R(4),R!=Float32Array&&(A[0]=0,A[1]=0,A[2]=0,A[3]=0);var B=function(e,t,i,r,a){var n,s=1/Math.tan(t/2);return e[0]=s/i,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=a&&a!==1/0?(n=1/(r-a),e[10]=(a+r)*n,e[14]=2*a*r*n):(e[10]=-1,e[14]=-2*r),e};function U(e,t){var i=e[0],r=e[1],a=e[2],n=e[3],s=e[4],o=e[5],l=e[6],c=e[7],h=e[8],u=e[9],p=e[10],d=e[11],y=e[12],m=e[13],f=e[14],g=e[15],v=t[0],b=t[1],_=t[2],S=t[3],x=t[4],w=t[5],L=t[6],M=t[7],T=t[8],V=t[9],P=t[10],k=t[11],O=t[12],E=t[13],C=t[14],j=t[15];return Math.abs(i-v)<=z*Math.max(1,Math.abs(i),Math.abs(v))&&Math.abs(r-b)<=z*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(a-_)<=z*Math.max(1,Math.abs(a),Math.abs(_))&&Math.abs(n-S)<=z*Math.max(1,Math.abs(n),Math.abs(S))&&Math.abs(s-x)<=z*Math.max(1,Math.abs(s),Math.abs(x))&&Math.abs(o-w)<=z*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(l-L)<=z*Math.max(1,Math.abs(l),Math.abs(L))&&Math.abs(c-M)<=z*Math.max(1,Math.abs(c),Math.abs(M))&&Math.abs(h-T)<=z*Math.max(1,Math.abs(h),Math.abs(T))&&Math.abs(u-V)<=z*Math.max(1,Math.abs(u),Math.abs(V))&&Math.abs(p-P)<=z*Math.max(1,Math.abs(p),Math.abs(P))&&Math.abs(d-k)<=z*Math.max(1,Math.abs(d),Math.abs(k))&&Math.abs(y-O)<=z*Math.max(1,Math.abs(y),Math.abs(O))&&Math.abs(m-E)<=z*Math.max(1,Math.abs(m),Math.abs(E))&&Math.abs(f-C)<=z*Math.max(1,Math.abs(f),Math.abs(C))&&Math.abs(g-j)<=z*Math.max(1,Math.abs(g),Math.abs(j))}function Z(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e}function $(e,t){if(!e)throw new Error(t||"viewport-mercator-project: assertion failed.")}!function(){var e;e=new R(2),R!=Float32Array&&(e[0]=0,e[1]=0)}(),function(){var e;e=new R(3),R!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0)}();var q=Math.PI,K=q/4,W=q/180,J=180/q,X=512,Y=4003e4,H=1.5;function Q(e){return Math.pow(2,e)}function ee(e,t){var i=I(e,2),r=i[0],a=i[1];$(Number.isFinite(r)&&Number.isFinite(t)),$(Number.isFinite(a)&&a>=-90&&a<=90,"invalid latitude");var n=a*W;return[(t*=X)*(r*W+q)/(2*q),t*(q-Math.log(Math.tan(K+.5*n)))/(2*q)]}function te(e,t){var i=I(e,2),r=i[0],a=i[1],n=r/(t*=X)*(2*q)-q,s=2*(Math.atan(Math.exp(q-a/t*(2*q)))-K);return[n*J,s*J]}function ie(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=I(e,3),a=r[0],n=r[1],s=r[2];if($(Number.isFinite(a)&&Number.isFinite(n),"invalid pixel coordinate"),Number.isFinite(s))return D(t,[a,n,s,1]);var o=D(t,[a,n,0,1]),l=D(t,[a,n,1,1]),c=o[2],h=l[2];return function(e,t,i,r){var a=t[0],n=t[1];return e[0]=a+r*(i[0]-a),e[1]=n+r*(i[1]-n),e}([],o,l,c===h?0:((i||0)-c)/(h-c))}var re=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],ae=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.width,r=t.height,a=t.viewMatrix,n=void 0===a?re:a,s=t.projectionMatrix,o=void 0===s?re:s;M(this,e),this.width=i||1,this.height=r||1,this.scale=1,this.pixelsPerMeter=1,this.viewMatrix=n,this.projectionMatrix=o;var l=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];G(l,l,this.projectionMatrix),G(l,l,this.viewMatrix),this.viewProjectionMatrix=l;var c=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];F(c,c,[this.width/2,-this.height/2,1]),N(c,c,[1,-1,0]),G(c,c,this.viewProjectionMatrix);var h,u,p,d,y,m,f,g,v,b,_,S,x,w,L,T,V,P,k,O,E,C,j,I,A,z,R,D,B,U,Z,$=(h=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],p=(u=c)[0],(Z=(k=p*(g=u[5])-(d=u[1])*(f=u[4]))*(U=(x=u[10])*(P=u[15])-(w=u[11])*(V=u[14]))-(O=p*(v=u[6])-(y=u[2])*f)*(B=(S=u[9])*P-w*(T=u[13]))+(E=p*(b=u[7])-(m=u[3])*f)*(D=S*V-x*T)+(C=d*v-y*g)*(R=(_=u[8])*P-w*(L=u[12]))-(j=d*b-m*g)*(z=_*V-x*L)+(I=y*b-m*v)*(A=_*T-S*L))?(Z=1/Z,h[0]=(g*U-v*B+b*D)*Z,h[1]=(y*B-d*U-m*D)*Z,h[2]=(T*I-V*j+P*C)*Z,h[3]=(x*j-S*I-w*C)*Z,h[4]=(v*R-f*U-b*z)*Z,h[5]=(p*U-y*R+m*z)*Z,h[6]=(V*E-L*I-P*O)*Z,h[7]=(_*I-x*E+w*O)*Z,h[8]=(f*B-g*R+b*A)*Z,h[9]=(d*R-p*B-m*A)*Z,h[10]=(L*j-T*E+P*k)*Z,h[11]=(S*E-_*j-w*k)*Z,h[12]=(g*z-f*D-v*A)*Z,h[13]=(p*D-d*z+y*A)*Z,h[14]=(T*O-L*C-V*k)*Z,h[15]=(_*C-S*O+x*k)*Z,h):null);if(!$)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=c,this.pixelUnprojectionMatrix=$,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 k(e,[{key:"equals",value:function(t){return t instanceof e&&t.width===this.width&&t.height===this.height&&U(t.projectionMatrix,this.projectionMatrix)&&U(t.viewMatrix,this.viewMatrix)}},{key:"project",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).topLeft,i=void 0===t||t,r=function(e,t){var i=I(e,3),r=i[0],a=i[1],n=i[2],s=void 0===n?0:n;return $(Number.isFinite(r)&&Number.isFinite(a)&&Number.isFinite(s)),D(t,[r,a,s,1])}(this.projectPosition(e),this.pixelProjectionMatrix),a=I(r,2),n=a[0],s=a[1],o=i?s:this.height-s;return 2===e.length?[n,o]:[n,o,r[2]]}},{key:"unproject",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.topLeft,r=void 0===i||i,a=t.targetZ,n=I(e,3),s=n[0],o=n[1],l=n[2],c=r?o:this.height-o,h=a&&a*this.pixelsPerMeter,u=ie([s,c,l],this.pixelUnprojectionMatrix,h),p=I(this.unprojectPosition(u),3),d=p[0],y=p[1],m=p[2];return Number.isFinite(l)?[d,y,m]:Number.isFinite(a)?[d,y,a]:[d,y]}},{key:"projectPosition",value:function(e){var t=I(this.projectFlat(e),2);return[t[0],t[1],(e[2]||0)*this.pixelsPerMeter]}},{key:"unprojectPosition",value:function(e){var t=I(this.unprojectFlat(e),2);return[t[0],t[1],(e[2]||0)/this.pixelsPerMeter]}},{key:"projectFlat",value:function(e){return arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale,e}},{key:"unprojectFlat",value:function(e){return arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale,e}}]),e}(),ne=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=i.width,a=i.height,n=i.latitude,s=void 0===n?0:n,o=i.longitude,l=void 0===o?0:o,c=i.zoom,h=void 0===c?0:c,u=i.pitch,p=void 0===u?0:u,d=i.bearing,y=void 0===d?0:d,m=i.altitude,f=void 0===m?1.5:m,g=i.nearZMultiplier,v=i.farZMultiplier;M(this,t),r=r||1,a=a||1;var b=Q(h);f=Math.max(.75,f);var _=ee([l,s],b);_[2]=0;var S=function(e){var t=e.width,i=e.height,r=e.pitch,a=function(e){var t=e.width,i=e.height,r=e.altitude,a=void 0===r?H:r,n=e.pitch,s=void 0===n?0:n,o=e.nearZMultiplier,l=void 0===o?1:o,c=e.farZMultiplier,h=void 0===c?1:c,u=s*W,p=Math.atan(.5/a),d=Math.sin(p)*a/Math.sin(Math.PI/2-u-p),y=Math.cos(Math.PI/2-u)*d+a;return{fov:2*Math.atan(i/2/a),aspect:t/i,focalDistance:a,near:l,far:y*h}}({width:t,height:i,altitude:e.altitude,pitch:r,nearZMultiplier:e.nearZMultiplier,farZMultiplier:e.farZMultiplier}),n=a.fov,s=a.aspect,o=a.near,l=a.far;return B([],n,s,o,l)}({width:r,height:a,pitch:p,bearing:y,altitude:f,nearZMultiplier:g||1/a,farZMultiplier:v||1.01}),x=function(e){var t,i,r,a,n,s,o,l,c,h,u,p,d,y=e.height,m=e.pitch,f=e.bearing,g=e.altitude,v=e.center,b=void 0===v?null:v,_=e.flipY,S=void 0!==_&&_,x=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return N(x,x,[0,0,-g]),F(x,x,[1,1,1/y]),t=x,i=x,r=-m*W,a=Math.sin(r),n=Math.cos(r),s=i[4],o=i[5],l=i[6],c=i[7],h=i[8],u=i[9],p=i[10],d=i[11],i!==t&&(t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15]),t[4]=s*n+h*a,t[5]=o*n+u*a,t[6]=l*n+p*a,t[7]=c*n+d*a,t[8]=h*n-s*a,t[9]=u*n-o*a,t[10]=p*n-l*a,t[11]=d*n-c*a,function(e,t,i){var r=Math.sin(i),a=Math.cos(i),n=t[0],s=t[1],o=t[2],l=t[3],c=t[4],h=t[5],u=t[6],p=t[7];t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=n*a+c*r,e[1]=s*a+h*r,e[2]=o*a+u*r,e[3]=l*a+p*r,e[4]=c*a-n*r,e[5]=h*a-s*r,e[6]=u*a-o*r,e[7]=p*a-l*r}(x,x,f*W),S&&F(x,x,[1,-1,1]),b&&N(x,x,function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}([],b)),x}({height:a,center:_,pitch:p,bearing:y,altitude:f,flipY:!0});return(e=function(e,t){if(t&&("object"==T(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return O(e)}(this,E(t).call(this,{width:r,height:a,viewMatrix:x,projectionMatrix:S}))).latitude=s,e.longitude=l,e.zoom=h,e.pitch=p,e.bearing=y,e.altitude=f,e.scale=b,e.center=_,e.pixelsPerMeter=function(e){var t=e.latitude,i=e.longitude,r=e.zoom,a=e.scale,n=e.highPrecision,s=void 0!==n&&n;a=void 0!==a?a:Q(r),$(Number.isFinite(t)&&Number.isFinite(i)&&Number.isFinite(a));var o={},l=X*a,c=Math.cos(t*W),h=l/360,u=h/c,p=l/Y/c;if(o.pixelsPerMeter=[p,-p,p],o.metersPerPixel=[1/p,-1/p,1/p],o.pixelsPerDegree=[h,-u,p],o.degreesPerPixel=[1/h,-1/u,1/p],s){var d=W*Math.tan(t*W)/c,y=h*d/2,m=l/Y*d,f=m/u*p;o.pixelsPerDegree2=[0,-y,m],o.pixelsPerMeter2=[f,0,f]}return o}(O(O(e))).pixelsPerMeter[2],Object.freeze(O(O(e))),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&C(e,t)}(t,ae),k(t,[{key:"projectFlat",value:function(e){return ee(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale)}},{key:"unprojectFlat",value:function(e){return te(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale)}},{key:"getMapCenterByLngLatPosition",value:function(e){var t,i,r=e.lngLat,a=ie(e.pos,this.pixelUnprojectionMatrix),n=Z([],ee(r,this.scale),((t=[])[0]=-(i=a)[0],t[1]=-i[1],t));return te(Z([],this.center,n),this.scale)}},{key:"getLocationAtPoint",value:function(e){var t=e.lngLat,i=e.pos;return this.getMapCenterByLngLatPosition({lngLat:t,pos:i})}},{key:"fitBounds",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.width,a=this.height,n=function(e){var t=e.width,i=e.height,r=e.bounds,a=e.minExtent,n=void 0===a?0:a,s=e.maxZoom,o=void 0===s?24:s,l=e.padding,c=void 0===l?0:l,h=e.offset,u=void 0===h?[0,0]:h,p=I(r,2),d=I(p[0],2),y=d[0],m=d[1],f=I(p[1],2),g=f[0],v=f[1];Number.isFinite(c)?c={top:c,bottom:c,left:c,right:c}:$(Number.isFinite(c.top)&&Number.isFinite(c.bottom)&&Number.isFinite(c.left)&&Number.isFinite(c.right));var b=new ne({width:t,height:i,longitude:0,latitude:0,zoom:0}),_=b.project([y,v]),S=b.project([g,m]),x=[Math.max(Math.abs(S[0]-_[0]),n),Math.max(Math.abs(S[1]-_[1]),n)],w=[t-c.left-c.right-2*Math.abs(u[0]),i-c.top-c.bottom-2*Math.abs(u[1])];$(w[0]>0&&w[1]>0);var L=w[0]/x[0],M=w[1]/x[1],T=(c.right-c.left)/2/L,V=(c.bottom-c.top)/2/M,P=[(S[0]+_[0])/2+T,(S[1]+_[1])/2+V],k=b.unproject(P),O=b.zoom+Math.log2(Math.abs(Math.min(L,M)));return{longitude:k[0],latitude:k[1],zoom:Math.min(O,o)}}(Object.assign({width:r,height:a,bounds:e},i));return new t({width:r,height:a,longitude:n.longitude,latitude:n.latitude,zoom:n.zoom})}}]),t}();class se{constructor(t,i,r){r=r||{},this.id=t,this.type="custom",this.renderingMode="2d",this.url=i,this.options={subdomains:null,visible:void 0===r.visible||r.visible,opacity:void 0!==r.opacity?r.opacity:1,minZoom:3,maxZoom:18,tileType:"xyz"},function(t,i){for(var r in t.hasOwnProperty("options")||(t.options=t.options?e(t.options):{}),i)t.options[r]=i[r]||t.options[r];t.options}(this,r),this.program,this.showTiles=[],this.tileCache={},this.gridCache={},this.matrix,this.map,this.isLayerShow,this.transformBaidu=new L}onAdd(e,t){this.map=e,this.isEPSG4326="EPSG:4326"===e.crs.getEpsgCode();var i=t.createShader(t.VERTEX_SHADER);t.shaderSource(i,"uniform mat4 u_custom_matrix;uniform vec4 u_center_pos;attribute vec4 a_Pos_Piexl;attribute vec2 a_TextCoord_Piexl;varying vec2 v_TextCoord;vec2 translateRelativeToEye(vec2 high, vec2 low) { vec2 highDiff = high - vec2(u_center_pos.x, u_center_pos.z); vec2 lowDiff = low - vec2(u_center_pos.y, u_center_pos.w); return highDiff + lowDiff;}void main() { vec2 eye_offset = translateRelativeToEye(vec2(a_Pos_Piexl.x, a_Pos_Piexl.z), vec2(a_Pos_Piexl.y, a_Pos_Piexl.w)); gl_Position = u_custom_matrix * vec4(eye_offset, 0.0, 1.0); v_TextCoord = a_TextCoord_Piexl;}"),t.compileShader(i);var r=t.createShader(t.FRAGMENT_SHADER);t.shaderSource(r,"precision mediump float;uniform sampler2D u_Sampler; varying vec2 v_TextCoord; uniform vec2 u_viewport_size;uniform float u_opacity;void main() { vec4 color = texture2D(u_Sampler, v_TextCoord); color *= u_opacity; gl_FragColor = color;}"),t.compileShader(r),this.program=t.createProgram(),t.attachShader(this.program,i),t.attachShader(this.program,r),t.linkProgram(this.program),this.a_Pos_Piexl=t.getAttribLocation(this.program,"a_Pos_Piexl"),this.a_TileZoomScale=t.getAttribLocation(this.program,"a_TileZoomScale"),this.a_TextCoord_Piexl=t.getAttribLocation(this.program,"a_TextCoord_Piexl"),this.isLayerShow=!0,e.on("move",()=>{this.isLayerShow&&this.update(t,e)}),this.update(t,e),this.map=e}update(e,t){if(this.options.visible){var i,r,a,n=t.getCenter(),s=t.getBounds();if("xyz"===this.options.tileType){i=parseInt(t.getZoom()+1.4);var l=h(s.getNorthWest()),u=h(s.getSouthEast());r=o(l.lng,l.lat,i),a=o(u.lng,u.lat,i)}else if("bd09"===this.options.tileType){i=parseInt(t.getZoom()+1.8);var p=c(s.getSouthWest()),d=c(s.getNorthEast());r=this.transformBaidu.lnglatToTile(p.lng,p.lat,i),a=this.transformBaidu.lnglatToTile(d.lng,d.lat,i)}for(var y=[],m=r[0];m<=a[0];m++)for(var f=r[1];f<=a[1];f++){var g={x:m,y:f,z:i};i<this.options.minZoom||i>this.options.maxZoom||(y.push(g),this.addGridCache(g,0,0),m===a[0]&&this.addGridCache(g,1,0),f===a[1]&&this.addGridCache(g,0,1),m===a[0]&&f===a[1]&&this.addGridCache(g,1,1))}if("xyz"===this.options.tileType)var v=o(n.lng,n.lat,i);else"bd09"===this.options.tileType&&(v=this.transformBaidu.lnglatToTile(n.lng,n.lat,i));for(var g of(y.sort((e,t)=>this.tileDistance(e,v)-this.tileDistance(t,v)),this.showTiles=[],y))if(this.tileCache[this.createTileKey(g)])this.showTiles.push(this.tileCache[this.createTileKey(g)]);else{var b=this.createTile(e,g);this.showTiles.push(b),this.tileCache[this.createTileKey(g)]=b}}}addGridCache(e,t,i){var a=this.createTileKey(e.x+t,e.y+i,e.z);this.gridCache[a]||("xyz"===this.options.tileType?this.gridCache[a]=u(function(e,t,i){let a=Math.pow(2,i);return[e/a*360-180,180*Math.atan(Math.sinh(r*(1-2*t/a)))/r]}(e.x+t,e.y+i,e.z)):"bd09"===this.options.tileType&&(this.gridCache[a]=l(this.transformBaidu.pixelToLnglat(0,0,e.x+t,e.y+i,e.z))))}tileDistance(e,t){return Math.sqrt(Math.pow(e.x-t[0],2)+Math.pow(e.y-t[1],2))}createTileKey(e,t,i){return e instanceof Object?e.z+"/"+e.x+"/"+e.y:i+"/"+e+"/"+t}createTile(e,i){var r,a,n,s,o,l,c=(r=this.url,a={s:this.options.subdomains[Math.abs(i.x+i.y)%this.options.subdomains.length],x:i.x,y:i.y,z:i.z},r.replace(t,function(e,t){var i=a[t];if(void 0===i)throw new Error("No value provided for variable "+e);return"function"==typeof i&&(i=i(a)),i})),h={xyz:i};"xyz"===this.options.tileType?(n=this.gridCache[this.createTileKey(i)],s=this.gridCache[this.createTileKey(i.x+1,i.y,i.z)],o=this.gridCache[this.createTileKey(i.x,i.y+1,i.z)],l=this.gridCache[this.createTileKey(i.x+1,i.y+1,i.z)]):"bd09"===this.options.tileType&&(n=this.gridCache[this.createTileKey(i.x,i.y+1,i.z)],s=this.gridCache[this.createTileKey(i.x+1,i.y+1,i.z)],o=this.gridCache[this.createTileKey(i)],l=this.gridCache[this.createTileKey(i.x+1,i.y,i.z)]);var u=new Float32Array([n.lng,n.lat,0,1,o.lng,o.lat,0,0,s.lng,s.lat,1,1,l.lng,l.lat,1,0]),p=u.BYTES_PER_ELEMENT,d=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,d),e.bufferData(e.ARRAY_BUFFER,u,e.STATIC_DRAW),h.buffer=d,h.PosParam={size:2,stride:4*p,offset:0},h.TextCoordParam={size:2,stride:4*p,offset:2*p};const y=this._convertMectorPoints(n),m=this._convertMectorPoints(s),f=this._convertMectorPoints(o),g=this._convertMectorPoints(l),v=new Float32Array([Math.fround(y[0]),y[0]-Math.fround(y[0]),Math.fround(y[1]),y[1]-Math.fround(y[1]),0,1,Math.fround(f[0]),f[0]-Math.fround(f[0]),Math.fround(f[1]),f[1]-Math.fround(f[1]),0,0,Math.fround(m[0]),m[0]-Math.fround(m[0]),Math.fround(m[1]),m[1]-Math.fround(m[1]),1,1,Math.fround(g[0]),g[0]-Math.fround(g[0]),Math.fround(g[1]),g[1]-Math.fround(g[1]),1,0]);p=v.BYTES_PER_ELEMENT;var b=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,b),e.bufferData(e.ARRAY_BUFFER,v,e.STATIC_DRAW),h.bufferPixel=b,h.PosPiexelsParam={size:4,stride:6*p,offset:0},h.TextPiexelsCoordParam={size:2,stride:6*p,offset:4*p};var _=new Image;return _.onload=(()=>{h.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,h.texture),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,1),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,_),h.isLoad=!0,this.map.triggerRepaint()}),_.crossOrigin=!0,_.src=c,h}_convertMectorPoints(e){const t=this.map.transform.locationCoordinate(e);return[t.x,t.y,0,1]}render(e,t){if(!(this.map.getZoom()<this.options.minZoom||this.map.getZoom()>this.options.maxZoom)&&this.options.visible)for(var i of(this.matrix=t,e.useProgram(this.program),this.showTiles))if(i.isLoad){e.bindTexture(e.TEXTURE_2D,i.texture),e.activeTexture(e.TEXTURE0),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.MIRRORED_REPEAT);var r=e.getUniformLocation(this.program,"u_Sampler");e.uniform1i(r,0),e.bindBuffer(e.ARRAY_BUFFER,i.bufferPixel),e.vertexAttribPointer(this.a_Pos_Piexl,i.PosPiexelsParam.size,e.FLOAT,!1,i.PosPiexelsParam.stride,i.PosPiexelsParam.offset),e.enableVertexAttribArray(this.a_Pos_Piexl),e.vertexAttribPointer(this.a_TextCoord_Piexl,i.TextPiexelsCoordParam.size,e.FLOAT,!1,i.TextPiexelsCoordParam.stride,i.TextPiexelsCoordParam.offset),e.enableVertexAttribArray(this.a_TextCoord_Piexl),this.setVertex(e,t),e.enable(e.BLEND),e.blendFunc(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA),e.drawArrays(e.TRIANGLE_STRIP,0,4)}}setVertex(e,t){this.map.getZoom(),this.map.getBearing(),this.map.getPitch();const i=this.map.getCenter();this.map.painter,this.map.transform;const r=this._convertMectorPoints(i),a=t.slice();a[12]+=a[0]*r[0]+a[4]*r[1],a[13]+=a[1]*r[0]+a[5]*r[1],a[14]+=a[2]*r[0]+a[6]*r[1],a[15]+=a[3]*r[0]+a[7]*r[1];let n={u_custom_matrix:a,u_center_pos:new Float32Array([Math.fround(r[0]),r[0]-Math.fround(r[0]),Math.fround(r[1]),r[1]-Math.fround(r[1])]),u_opacity:this.options.opacity};e.uniformMatrix4fv(e.getUniformLocation(this.program,"u_custom_matrix"),!1,n.u_custom_matrix),e.uniform4fv(e.getUniformLocation(this.program,"u_center_pos"),n.u_center_pos),e.uniform1f(e.getUniformLocation(this.program,"u_opacity"),n.u_opacity)}setOpacity(e){this.options.opacity=e,this._requestRender()}setVisible(e){e&&!this.options.visible&&this.map?(this.options.visible=e,this.update(this.map.painter.context.gl,this.map)):this.options.visible=e,this._requestRender()}_requestRender(){var e=this.map;e&&e._update()}onRemove(e,t){this.isLayerShow=!1}}function oe(e,t,i){var r,a=i||{},n=oe.providers,s=t.split("."),o=s[0],l=s[1],c=s[2],h=n[o][l][c],u=n[o].Subdomains,p=n[o][l].minzoom,d=n[o][l].maxzoom,y=n[o].tileType;if("Custom"===o&&(h=a.url?a.url:h,p=a.minzoom?a.minzoom:0,d=a.maxzoom?a.maxzoom:20),"TianDiTu"===o||"OSM"===o){var m=a.key||n[o].key,f=[];for(var g of u)f.push(h.replace("{s}",g).replace("{key}",m));r={id:e,type:"raster",source:{type:"raster",tiles:f,tileSize:256,minzoom:p,maxzoom:d}}}else r=new se(e,h,{subdomains:u,minZoom:p,maxZoom:d,tileType:y});return r}return oe.providers={TianDiTu:{Normal:{Map:"http://t{s}.tianditu.com/DataServer?T=vec_w&X={x}&Y={y}&L={z}&tk={key}",Annotion:"http://t{s}.tianditu.com/DataServer?T=cva_w&X={x}&Y={y}&L={z}&tk={key}",minzoom:0,maxzoom:18},Normal4326:{Map:"http://t{s}.tianditu.com/DataServer?T=vec_c&X={x}&Y={y}&L={z}&tk={key}",Annotion:"http://t{s}.tianditu.com/DataServer?T=cva_c&X={x}&Y={y}&L={z}&tk={key}",minzoom:0,maxzoom:18},Satellite:{Map:"http://t{s}.tianditu.com/DataServer?T=img_w&X={x}&Y={y}&L={z}&tk={key}",Annotion:"http://t{s}.tianditu.com/DataServer?T=cia_w&X={x}&Y={y}&L={z}&tk={key}",minzoom:0,maxzoom:18},Satellite4326:{Map:"http://t{s}.tianditu.com/DataServer?T=img_c&X={x}&Y={y}&L={z}&tk={key}",Annotion:"http://t{s}.tianditu.com/DataServer?T=cia_c&X={x}&Y={y}&L={z}&tk={key}",minzoom:0,maxzoom:18},Terrain:{Map:"http://t{s}.tianditu.com/DataServer?T=ter_w&X={x}&Y={y}&L={z}&tk={key}",Annotion:"http://t{s}.tianditu.com/DataServer?T=cta_w&X={x}&Y={y}&L={z}&tk={key}",minzoom:0,maxzoom:14},Subdomains:["0","1","2","3","4","5","6","7"],key:""},GaoDe:{Normal:{Map:"http://webrd0{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}",minzoom:3,maxzoom:18},Normal_NoTag:{Map:"https://wprd0{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&style=7&scl=1<ype=11&x={x}&y={y}&z={z}",minzoom:3,maxzoom:18},Satellite:{Map:"http://webst0{s}.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}",Annotion:"http://webst0{s}.is.autonavi.com/appmaptile?style=8&x={x}&y={y}&z={z}",minzoom:3,maxzoom:18},Subdomains:["1","2","3","4"]},Baidu:{Normal:{Map:"//online{s}.map.bdimg.com/onlinelabel/?qt=tile&x={x}&y={y}&z={z}&styles=pl&scaler=1&p=1"},Satellite:{Map:"//shangetu{s}.map.bdimg.com/it/u=x={x};y={y};z={z};v=009;type=sate&fm=46",Annotion:"//online{s}.map.bdimg.com/tile/?qt=tile&x={x}&y={y}&z={z}&styles=sl&v=020"},Subdomains:"0123456789",tileType:"bd09"},Geoq:{Normal:{Map:"http://map.geoq.cn/ArcGIS/rest/services/ChinaOnlineCommunity/MapServer/tile/{z}/{y}/{x}",PurplishBlue:"http://map.geoq.cn/ArcGIS/rest/services/ChinaOnlineStreetPurplishBlue/MapServer/tile/{z}/{y}/{x}",Gray:"http://map.geoq.cn/ArcGIS/rest/services/ChinaOnlineStreetGray/MapServer/tile/{z}/{y}/{x}",Warm:"http://map.geoq.cn/ArcGIS/rest/services/ChinaOnlineStreetWarm/MapServer/tile/{z}/{y}/{x}",minzoom:3,maxzoom:16},Subdomains:[]},OSM:{Normal:{Map:"//{s}.tile.osm.org/{z}/{x}/{y}.png",minzoom:0,maxzoom:18},Subdomains:["a","b","c"]},Custom:{WMTS:{URL:"custom/{z}/{x}/{y}.png",minzoom:0,maxzoom:20},TMS:{URL:"custom/{z}/{x}/{y}.png",minzoom:0,maxzoom:20},Subdomains:["0","1","2","3"]}},oe}()},function(e,t,i){"use strict";i.r(t);var r=i(0),a=i(1),n=i.n(a),s=i(2),o=i.n(s);function l(e){const t=e._getLayerViewVisible();e.innerLayer&&e.innerLayer.implementation&&e.innerLayer.implementation.type&&"custom"===e.innerLayer.implementation.type&&e.innerLayer.implementation.setVisible?e.innerLayer.implementation.setVisible(t):e.innerView.setLayoutProperty(e.innerLayer.id,"visibility",t?"visible":"none")}function c(e){e.innerLayer.id&&e.innerView.removeLayer(e.innerLayer.id),e.innerLayer.source&&e.innerView.removeSource(e.innerLayer.source)}function h(e){const t=e._getOpacity();e.innerLayer&&e.innerLayer.implementation&&e.innerLayer.implementation.type&&"custom"===e.innerLayer.implementation.type&&e.innerLayer.implementation.setOpacity?e.innerLayer.implementation.setOpacity(t):e.innerView.setPaintProperty(e.innerLayer.id,"raster-opacity",t)}function u(e,t,i,a,n,s,o,l){let c,h,u=[e];if(e&&e.includes("{s}")&&Array.isArray(a)&&(u=a.map(t=>e.replace("{s}",t))),l){const e=t||256,i=Math.max(l.xmax-l.xmin,l.ymax-l.ymin)/e,a=Object(r.getExtendExtentByPixel)(l,{extendPixel:100,resolution:i,outSpatialReference:new r.SpatialReference({wkid:4326})});h=[a.xmin,a.ymin,a.xmax,a.ymax]}return c="image"===i?{url:e,rebaseRequestUrl(e,t){const i=this.map.getCRS().projection.project(this.map.getBounds()._sw),r=this.map.getCRS().projection.project(this.map.getBounds()._ne),a=[...i,...r].toString(),[n,s]=t.imageSize;return(e.split("?").length>1?e.split("?")[1].split("&"):e.split("&")).forEach(t=>{t.includes("size=")&&(e=e.replace(t,`size=${n},${s}`)),t.includes("w=")?e=e.replace(t,`w=${n}`):t.includes("width=")&&(e=e.replace(t,`width=${n}`)),t.includes("h=")&&!t.includes("width=")?e=e.replace(t,`h=${s}`):t.includes("height=")&&(e=e.replace(t,`height=${s}`)),t.includes("bbox=")&&(e=e.replace(t,`bbox=${a}`))}),e},requestParams:n,type:"image-map",clippingArea:s}:{type:"raster",tiles:u,requestParams:n,tileSize:t,clippingArea:s,decryptOptions:o},h&&(c.bounds=h),c}function p(e,t,i,a){return{id:e,type:"raster",source:t,paint:{"raster-opacity":Object(r.isNull)(a)?i.opacity:a._getOpacity()},layout:{visibility:(Object(r.isNull)(a)?i.visible:a._getLayerViewVisible())?"visible":"none"}}}function d(e,t){let i,r;if(t.getProj||t.projectGeometry){const a=t;i=class extends e.Projection{constructor(e,t){super();const i=t||{};if(t.def)this._wkt=i.def;else if(e){const t=/^(EPSG|epsg)(:)?\d+$/,i=/\d+$/,r=e.match(i);if(t.test(e)&&r){this._wkid=parseInt(r[0]);const e=a.getEPSGByWKID(this._wkid);e&&(this._wkt=e.strProject)}}else this._wkt=a.getEPSGByWKID(3857).strProject;this._wkt&&(this._proj=a.getProj(e||function(){let e="";for(let t=1;t<=32;t++)e+=Math.floor(16*Math.random()).toString(16),8!==t&&12!==t&&16!==t&&20!==t||(e+="-");return e}(),this._wkt))}project(e){let t,i;Array.isArray(e)?(t=e[0],i=e[1]):(t=e.lng,i=e.lat);const r=[t,i];let n;return[(n=a.isCustomWKID(this._wkid)?a.projectPoints({points:[r],originWKID:4326,targetWKID:this._wkid})[0]:this._proj.forward(r))[0],n[1]]}unproject(e){let t,i;Array.isArray(e)?(t=e[0],i=e[1]):(t=e.x,i=e.y);const r=[t,i];let n;return[(n=a.isCustomWKID(this._wkid)?a.projectPoints({points:[r],originWKID:this._wkid,targetWKID:4326})[0]:this._proj.inverse([t,i]))[0],n[1]]}},r=class extends e.CRS{_parseParams(e){this._crsType="proj4",this.epsgCode=e[0],this.code=this.epsgCode,this.def=e[1];const t=e[2]||{};this._parseOptions(t)}_parseOptions(e){if(super._parseOptions(e),this._resolutions=e.resolutions,Array.isArray(this._resolutions)){const e={};this._resolutions.forEach((t,i)=>{e[i]=t}),this._resolutions=e}if(!this._resolutions)throw new Error("自定义坐标系时,未设置分辨率数组");if(!this.origin)throw new Error("自定义坐标系时,未设置原点");this.tileSize=e.tileSize||256}_setProjection(){this.projection=new i(this.getEpsgCode(),{origin:this.origin,def:this.def})}}}else{const a=t;i=class extends e.Projection{constructor(e,t){super();const i=(t||{}).def;if(!i)throw new Error("自定义参考系必须指定参数系信息def");if(this._def=i,!a)throw new Error("proj4对象不存在,自定义投影必须引入proj4对象");const r=this._isProj4Obj(e);this._proj=r?e:this._projFromCodeDef(e,i)}project(e){let t,i;return Array.isArray(e)?(t=e[0],i=e[1]):(t=e.lng,i=e.lat),this._proj.forward([t,i])}unproject(e){let t,i;return Array.isArray(e)?(t=e[0],i=e[1]):(t=e.x,i=e.y),this._proj.inverse([t,i])}_projFromCodeDef(e,t){if(t)a.defs(e,t);else if(void 0===a.defs[e]){const t=e.split(":");if(t.length>3&&(e=`${t[t.length-3]}:${t[t.length-1]}`),void 0===a.defs[e])throw`No projection definition for code ${e}`}return a(e)}_isProj4Obj(e){return void 0!==e.inverse&&void 0!==e.forward}},r=class extends e.CRS{_parseParams(e){this._crsType="proj4",this.epsgCode=e[0],this.code=this.epsgCode,this.def=e[1];const t=e[2]||{};this._parseOptions(t)}_parseOptions(e){if(super._parseOptions(e),this._resolutions=e.resolutions,Array.isArray(this._resolutions)){const e={};this._resolutions.forEach((t,i)=>{e[i]=t}),this._resolutions=e}if(!this._resolutions)throw new Error("自定义坐标系时,未设置分辨率数组");if(!this.origin)throw new Error("自定义坐标系时,未设置原点");this.tileSize=e.tileSize||256}_setProjection(){this.projection=new i(this.getEpsgCode(),{origin:this.origin,def:this.def})}}}return e.Proj||(e.Proj={}),e.Proj.CRS=r,e.Proj.Projection=i,r}var y=d(n.a,r.Projection);const m="== != > < >= <= array at boolean case coalesce collator format image in interpolate interpolate-hcl interpolate-lab\nlength let literal match number number-format object step string to-boolean to-color to-number to-string var within";class f{static isMapboxExpression(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]&&m.indexOf(e[0])>-1}static convertLineStyle(e,t){switch(e){case"dash":case"esriSLSDash":return t?[4,3]:[3,4];case"dash-dot":case"esriSLSDashDot":return t?[4,3,1,3]:[3,4,0,4];case"dot":case"esriSLSDot":return t?[1,3]:[0,4];case"long-dash":case"esriSLSLongDash":return t?[8,3]:[7,4];case"long-dash-dot":case"esriSLSLongDashDot":return t?[8,3,1,3]:[7,4,0,4];case"long-dash-dot-dot":case"esriSLSDashDotDot":return t?[8,3,1,3,1,3]:[7,4,0,4,0,4];case"short-dash":case"esriSLSShortDash":return t?[4,1]:[3,2];case"short-dash-dot":case"esriSLSShortDashDot":return t?[4,1,1,1]:[3,2,0,2];case"short-dash-dot-dot":case"esriSLSShortDashDotDot":return t?[4,1,1,1,1,1]:[3,2,0,2,0,2];case"short-dot":case"esriSLSShortDot":return t?[1,1]:[0,2];case"solid":case"esriSLSSolid":case"none":default:return}}static convertToGeoJSON(e){let t=e;const i=t.geometry,a=i.spatialReference;return"4326"!==String(a.wkid)&&((t=e.clone()).geometry=r.Projection.project(i,new r.SpatialReference("EPSG:4326"))),e.additional&&e.additional.arc3&&(e.geometry=Object(r.editGeometryByArc3)(e.geometry,e.additional)),t.toGeoJSON()}static convertLngLatGeometry(e){return e&&e.spatialReference?e.spatialReference.isGeographic?e:r.Projection.project(e,new r.SpatialReference("EPSG:4326")):e}static convertClippingArea(e){if(!e)return e;let t=null;switch(e.type){case r.GeometryType.polygon:case r.GeometryType.multiPolygon:t=f.convertLngLatGeometry(e).toGeoJSON();break;case r.GeometryType.circle:t=f.convertLngLatGeometry(e).toPolygon().toGeoJSON();break;case r.GeometryType.extent:t=f.convertLngLatGeometry(e).toPolygon().toGeoJSON();break}return t}static applyVisibleAndOpacityToColor(e,t,i){const a=r.Color.fromColor(e).clone(),n=i*(t?1:0);return a.alpha*=n,a}static createCRSByLayer(e){e&&e.spatialReference||r.Log.error("计算crsOptions错误");const t=r.TileInfoUtil.getTileInfoByLayer(e),i=e.spatialReference,a=t.origin.coordinates,n=e.extent,s={},o={};t.lods.map(e=>e.clone()).forEach(e=>{s[e.level]=e.resolution,o[e.level]=e.levelValue});const l=`EPSG:${i.wkid}`,c=i.wkt;return new y(l,c,{levelValues:o,resolutions:s,origin:[a[0],a[1]],tileSize:t.getTileSize(),bounds:[n.xmin,n.ymin,n.xmax,n.ymax],unit:i.isGeographic?"degree":void 0})}}var g=f;class v{}v.addIGSTileLayer=function(e,t){t=t||{};const i=e.layer,r=e.innerView;t.layerView=e;const a=v.getSourcesAndStyleLayers(i,t);ne(a,r);const n=r.getLayer(a.layers[0].id);return n.sourceID=n.source,n},v.getSourcesAndStyleLayers=function(e,t){const i=(t=t||{}).layerView,a=`source_${e.id}`,n=`layer_${e.id}`;let s={tokenKey:e.tokenKey,tokenValue:e.tokenValue};const o=r.LayerBaseUrlRegExp.matchStringByRegExpNames(e.url,["IGSTileLayerV1","IGSTileLayerV2"]),l=r.ServerUtil.getTile(o,s);let c=l.url;const h=r.UrlUtil.getStringFromObject(l.queryParameters);h&&(c+=`?${h}`);const d={method:e.httpMethod,headers:e.headers};"GET"!==e.httpMethod&&(d.data=l.queryParameters);const y=u(c,e.tileSize,null,null,d,g.convertClippingArea(e.clippingArea),e.decryptOptions),m=p(n,a,e,i),[f,v]=r.TileInfoUtil.getLevelRangeByTileInfo(e.tileInfo);y.minzoom=f,y.maxzoom=v,y.crs=g.createCRSByLayer(e);const b={};return b[a]=y,{sources:b,layers:[m]}},v.setVisible=function(e){l(e)},v.setOpacity=function(e){h(e)},v.refresh=function(e){e.innerView.removeLayer(e.innerLayer.id),e.innerView.removeSource(e.innerLayer.sourceID),e.innerLayer=v.addIGSTileLayer(e,{})},v.removeLayer=function(e){c(e)};var b=v;class _{}_.addArcGISTileLayer=function(e,t){t=t||{};const i=e.layer,r=e.innerView;t.layerView=e;const a=_.getSourcesAndStyleLayers(i,t);ne(a,r);const n=r.getLayer(a.layers[0].id);return n.sourceID=n.source,n},_.getSourcesAndStyleLayers=function(e,t){const i=(t=t||{}).layerView,{extensionOptions:a={}}=e,n=`source_${e.id}`,s=`layer_${e.id}`;let o={tokenKey:e.tokenKey,tokenValue:e.tokenValue};o=Object.assign(o,a);const l=r.LayerBaseUrlRegExp.matchStringByRegExpNames(e.url,["ArcGISVectorTileLayer","IGS-ArcGISVectorTileLayer"]),c=r.ServerUtil.getTile(l,o);let h=c.url;const d=r.UrlUtil.getStringFromObject(c.queryParameters);d&&(h+=`?${d}`);const y={method:e.httpMethod,headers:e.headers};"GET"!==e.httpMethod&&(y.data=c.queryParameters);const m=u(h,e.tileSize,null,null,y,t.clippingArea);m.crs=g.createCRSByLayer(e);const f=p(s,n,e,i),v={};return v[n]=m,{sources:v,layers:[f]}},_.setVisible=function(e){l(e)},_.setOpacity=function(e){h(e)},_.refresh=function(e){e.innerView.removeLayer(e.innerLayer.id),e.innerView.removeSource(e.innerLayer.sourceID),e.innerLayer=_.addArcGISTileLayer(e,{})},_.removeLayer=function(e){c(e)};var S=_;class x{}x.addArcGISMapImageLayer=function(e){const t=e.layer,i=e.innerView,r={};r.layerView=e;const a=x.getSourcesAndStyleLayers(t,r);ne(a,i);const n=i.getLayer(a.layers[0].id);return n.sourceID=n.source,n},x.getSourcesAndStyleLayers=function(e,t){t=t||{};const{layerView:i={}}=t,{extensionOptions:a={}}=e,{view:n}=i,s=`source_${e.id}`,o=`layer_${e.id}`;let l={layers:e.layers,format:e.imageFormat,transparent:e.imageTransparency,size:`${e.imageWidth},${e.imageHeight}`,tokenKey:e.tokenKey,tokenValue:e.tokenValue};if(n){!e.spatialReference.equals(n.spatialReference)&&(l.imageSR=n.spatialReference)}l=Object.assign(l,a);const c=r.LayerBaseUrlRegExp.matchStringByRegExpNames(e.url,["IGS-ArcGISMapImageLayer","ArcGISMapImageLayer"]),h=r.ServerUtil.getImage(c,l);let d=h.url;const y=r.UrlUtil.getStringFromObject(h.queryParameters);y&&(d+=`?${y}`);const m={method:e.httpMethod,headers:e.headers};"GET"!==e.httpMethod&&(m.data=h.queryParameters);const f=u(d,e.imageWidth,e.renderMode,void 0,m),g=p(o,s,e,i),v={};return v[s]=f,{sources:v,layers:[g]}},x.setVisible=function(e){l(e)},x.setOpacity=function(e){h(e)},x.refresh=function(e){e.innerView.removeLayer(e.innerLayer.id),e.innerView.removeSource(e.innerLayer.sourceID),e.innerLayer=x.addArcGISMapImageLayer(e,{})},x.removeLayer=function(e){c(e)};var w=x;class L{}L.addWMTSLayer=function(e,t){const i=e.layer,r=e.innerView;(t=t||{}).layerView=e;const a=L.getSourcesAndStyleLayers(i,t);ne(a,r);const n=r.getLayer(a.layers[0].id);return n.sourceID=n.source,n},L.getSourcesAndStyleLayers=function(e,t){const i=(t=t||{}).layerView,{extensionOptions:a={},activeLayer:n}=e,s=`source_${e.id}`,o=`layer_${e.id}`;let l={version:e.version,layer:n.identifier,style:n.styleId,tileMatrixSet:n.tileMatrixSetId,format:n.format,tokenKey:e.tokenKey,tokenValue:e.tokenValue};l=Object.assign(l,a);const c=r.LayerBaseUrlRegExp.matchStringByRegExpNames(e.url,["WMTSLayerV1","WMTSLayerV2"]),h=r.ServerUtil.getTile(c,l);let d=h.url;const y=r.UrlUtil.getStringFromObject(h.queryParameters);y&&(d+=`?${y}`);const m={method:e.httpMethod,headers:e.headers};"GET"!==e.httpMethod&&(m.data=h.queryParameters);const f=e.getCurrentTileInfo(),v=u(d,f.size[0],null,null,m,t.clippingArea),b=p(o,s,e,i),[_,S]=r.TileInfoUtil.getLevelRangeByTileInfo(f);v.minzoom=_,v.maxzoom=S,v.crs=g.createCRSByLayer(e);const x={};return x[s]=v,{sources:x,layers:[b]}},L.setVisible=function(e){l(e)},L.setOpacity=function(e){h(e)},L.refresh=function(e){e.innerView.removeLayer(e.innerLayer.id),e.innerView.removeSource(e.innerLayer.sourceID),e.innerLayer=L.addWMTSLayer(e,{})},L.removeLayer=function(e){c(e)};var M=L;class T{}T.addWMSLayer=function(e,t){const i=e.layer,r=e.innerView;(t=t||{}).layerView=e;const a=T.getSourcesAndStyleLayers(i,t);ne(a,r);const n=r.getLayer(a.layers[0].id);return n.sourceID=n.source,n},T.getSourcesAndStyleLayers=function(e,t){t=t||{};const{layerView:i={}}=t,{extensionOptions:a={}}=e,{view:n}=i,s=`source_${e.id}`,o=`layer_${e.id}`;let l={version:e.version,layers:e.layers,styles:e.styles,width:e.imageWidth,height:e.imageHeight,format:e.imageFormat,transparent:e.imageTransparency,srs:e.spatialReference,crs:e.spatialReference,queryParameters:{}};if(l.queryParameters[e.tokenKey]=e.tokenValue,n){!e.spatialReference.equals(n.spatialReference)&&(l.srs=n.spatialReference,l.crs=n.spatialReference)}l=Object.assign(l,a);const c=r.ServerUtil.getImage(e.url,l);let h=c.url;const d=r.UrlUtil.getStringFromObject(c.queryParameters);d&&(h+=`?${d}`);const y={method:e.httpMethod,headers:e.headers};"GET"!==e.httpMethod&&(y.data=c.queryParameters);const m=u(h,e.imageWidth,e.renderMode,null,y,t.clippingArea),f=p(o,s,e,i),g={};return g[s]=m,{sources:g,layers:[f]}},T.setVisible=function(e){l(e)},T.setOpacity=function(e){h(e)},T.refresh=function(e){e.innerView.removeLayer(e.innerLayer.id),e.innerView.removeSource(e.innerLayer.sourceID),e.innerLayer=T.addWMSLayer(e,{})},T.removeLayer=function(e){c(e)};var V=T;class P{}P.addWebTileLayer=function(e,t){const i=e.layer,r=e.innerView;(t=t||{}).layerView=e;const a=P.getSourcesAndStyleLayers(i,t);ne(a,r);const n=r.getLayer(a.layers[0].id);return n.sourceID=n.source,n},P.getSourcesAndStyleLayers=function(e,t){const i=(t=t||{}).layerView,{extensionOptions:a={}}=e,[n,s]=r.TileInfoUtil.getLevelRangeByTileInfo(e.tileInfo),l=e.spatialReference&&e.spatialReference.wkid?Number(e.spatialReference.wkid):void 0;let c=Object(r.formatWebTileUrl)(e.url),h={};Object(r.defined)(e.tokenKey)&&Object(r.defined)(e.tokenValue)&&(h[e.tokenKey]=e.tokenValue),h=Object.assign(h,a);const d={method:e.httpMethod,headers:e.headers,data:h};if("GET"!==e.httpMethod){const e=r.UrlUtil.getBaseUrlAndParams(c);c=e.baseUrl,d.data=Object.assign(e.params,h)}if(l===r.CustomWKID.bd09mc||l===r.CustomWKID.gcj02mc)return function(e,t){const i=e.spatialReference&&e.spatialReference.wkid?Number(e.spatialReference.wkid):void 0;let a;const n=`source_${e.id}`,s=t.layerView,l={opacity:Object(r.isNull)(s)?e.opacity:s._getOpacity(),visible:Object(r.isNull)(s)?e.visible:s._getLayerViewVisible(),minZoom:t.minZoom,maxZoom:t.maxZoom};return i===r.CustomWKID.bd09mc?(o.a.providers.Baidu[n]={Map:e.url,Subdomains:e.subDomains.toString()},a=o()(n,`Baidu.${n}.Map`,l)):i===r.CustomWKID.gcj02mc&&(o.a.providers.GaoDe[n]={Map:e.url,Subdomains:e.subDomains.toString()},a=o()(n,`GaoDe.${n}.Map`,l)),{sources:{},layers:[a]}}(e,Object.assign({minzoom:n,maxzoom:s},t));const y=`source_${e.id}`,m=`layer_${e.id}`,f=u(c,e.tileSize,null,e.subDomains,d,t.clippingArea);f.minzoom=n,f.maxzoom=s,f.crs=g.createCRSByLayer(e),"tms"===e.tileSliceType&&(f.scheme="tms");const v=p(m,y,e,i),b={};return b[y]=f,{sources:b,layers:[v]}},P.setVisible=function(e){l(e)},P.setOpacity=function(e){h(e)},P.refresh=function(e){e.innerView.removeLayer(e.innerLayer.id),e.innerView.removeSource(e.innerLayer.sourceID),e.innerLayer=P.addWebTileLayer(e,{})},P.removeLayer=function(e){c(e)};var k=P;const O=2e3;var E=class{constructor(e){this.innerView=e,this.cacheImageDetla={},this.imageCount=0}getIconScale(e,t,i){if(this.cacheImageDetla[e]){const{width:r,height:a}=this.cacheImageDetla[e];return r&&a?Math.max(t/(r||1),i/(a||1)):.001}return.001}hasImageCacheDetla(e){return!!this.cacheImageDetla[e]&&this.cacheImageDetla[e].keyObjects}loadImage(e,t,i){i=i||{};const r=this.innerView;return new Promise(a=>{r.loadImage(t,(t,n)=>{r.hasImage(e)?r.removeImage(e):this.imageCount++,t&&(i.notLoaded=!0,console.error("mapboxgl引擎loadImage方法加载图片资源加载失败"));const s=n||new Image(1,1),o={};i.pfsScale&&i.pfsSize&&(o.pixelRatio=Math.max(s.width,s.height)/i.pfsSize/i.pfsScale),r.addImage(e,s,o),a({id:e,width:s.width,height:s.height,keyObjects:i})})})}updateImage(e,t,i){i=i||{};const r=this.innerView;if(!e||!t)return Promise.resolve(null);if(this._shouldUpdateImage(e,t,i))return this.cacheImageDetla[e]={imageSource:t,totalUpdateCount:1},this.loadImage(e,t,i).then(t=>{if(this.cacheImageDetla[e])return this.cacheImageDetla[e].width=t.width,this.cacheImageDetla[e].height=t.height,this.cacheImageDetla[e].keyObjects=i,this.cacheImageDetla[e]});if(this.cacheImageDetla[e]&&this.cacheImageDetla[e].totalUpdateCount++,this.imageCount>O){const e=Object.entries(this.cacheImageDetla).sort((e,t)=>e[1].totalUpdateCount-t[1].totalUpdateCount);for(let t=0;t<e.length;t++){const[i,a]=e[t];t<Math.floor(e.length/2)?(r.hasImage(i)&&(r.removeImage(i),this.imageCount--),delete this.cacheImageDetla[i]):a.totalUpdateCount=1}}return Promise.resolve(null)}_shouldUpdateImage(e,t,i){const r=this.cacheImageDetla[e];return!r||r&&(r.imageSource!==t||JSON.stringify(r.keyObjects)!==JSON.stringify(i))}};function C(e,t,i,r){for(;t.findIndex(e=>i.some(t=>t===e))>-1;){r.index+=1;const a=`calc_${r.index}`,n=t.findIndex(e=>i.some(t=>t===e)),s=e[t[n-1]]||(r.isNum?parseFloat(t[n-1]):t[n-1]),o=e[t[n+1]]||(r.isNum?parseFloat(t[n+1]):t[n+1]);e[a]=[t[n],s,o],r.key=a,r.expression=t.splice(n-1,3,a)}}function j(e,t,i){if(e)return i?["to-number",["get",e]]:["get",e];const r=function(e,t){try{let i=e;const r=i.replace(/\s/g,"").match(/\$feature\.[^+-/*%>=<]+/g);if(!r||0===r.length)return null;const a={},n={index:0,key:null,isNum:t};r.forEach(e=>{n.index+=1;const r=`calc_${n.index}`;n.key=r,a[r]=t?["to-number",["get",e.split(".")[1]]]:["get",e.split(".")[1]],i=i.replace(e,`${r}`)});const s=i.match(/>=|<=|==|\+|-|\*|\/|>|<|=/);s&&s.length>0&&s.forEach(e=>{i=i.replace(e,` ${e} `)});const o=i.split(" ").filter(e=>""!==e);if(C(a,o,["*","/","%"],n),C(a,o,["+","-"],n),C(a,o,["<","<=",">",">="],n),C(a,o,["=="],n),n.key)return a[n.key]}catch(e){}}(t,i);return r||["get","undefined"]}function I(e,t,i,a,n,s){let o="";switch(s=s||{},e.type){case r.SymbolType.simpleLine:e instanceof r.SimpleLineSymbol||(e=new r.SimpleLineSymbol),function(e,t,i,a,n,s){const o=r.Color.fromColor(i.color);e["line-color"]=o.toCssRGBAString(),e["line-opacity"]=n,e["line-width"]=i.width,t["line-cap"]=i.cap,t["line-miter-limit"]=i.miterLimit,t["line-join"]=i.join;const l=g.convertLineStyle(i.style,"butt"===i.cap);l&&(e["line-dasharray"]=l),t.visibility=a?"visible":"none"}(t,i,e,a,n),o="line";break;case r.SymbolType.simpleFill:e instanceof r.SimpleFillSymbol||(e=new r.SimpleFillSymbol),function(e,t,i,a,n,s){const o=r.Color.fromColor(i.color),l=r.Color.fromColor(i.outline.color);if("solid"!==i.style&&i.style){if(!s.imageSourceManager)throw new Error("mapboxgl转换图标符号时,未传入图片资源管理类");e["fill-pattern"]=i.id}else e["fill-color"]=o.toCssRGBAString();e["fill-opacity"]=n,e["fill-outline-color"]=l.toCssRGBAString(),t.visibility=a?"visible":"none"}(t,i,e,a,n,s),o="fill";break;case r.SymbolType.simpleMarker:e instanceof r.SimpleMarkerSymbol||(e=new r.SimpleMarkerSymbol),function(e,t,i,a,n,s){const o=i.xoffset,l=i.yoffset;e["circle-translate"]=[parseFloat(o),parseFloat(l)];const c=r.Color.fromColor(i.color);e["circle-opacity"]=n,e["circle-color"]=c.toCssRGBAString();const h=r.Color.fromColor(i.outline.color);e["circle-stroke-color"]=h.toCssRGBAString(),e["circle-stroke-opacity"]=n,e["circle-stroke-width"]=i.outline.width,e["circle-radius"]=i.size/2,t.visibility=a?"visible":"none"}(t,i,e,a,n),o="circle";break;case r.SymbolType.text:e instanceof r.TextSymbol||(e=new r.TextSymbol),function(e,t,i,a,n,s){const o=r.Color.fromColor(i.color),l=r.Color.fromColor(i.haloColor);switch(e["text-color"]=o.toCssRGBAString(),e["text-opacity"]=n,e["text-halo-color"]=l.toCssRGBAString(),e["text-halo-width"]=i.haloSize,t["text-field"]=i.text||"",t.visibility=a?"visible":"none",t["text-allow-overlap"]=!0,t["text-font"]=[i.font.family],t["text-size"]=i.font.size,t["text-justify"]=i.horizontalAlignment,t["text-letter-spacing"]=i.kerning?.1:0,t["text-rotate"]=i.rotated&&0!==i.angle?i.angle:0,t["text-offset"]=[i.xoffset/i.font.size,-i.yoffset/i.font.size],t["text-line-height"]=i.lineHeight?1.2:0,t["text-max-width"]=Object(r.defaultValue)(i.lineWidth,192)/i.font.size,t["text-anchor"]="center",i.verticalAlignment){case"top":switch(i.horizontalAlignment){case"left":t["text-anchor"]="top-left";break;case"right":t["text-anchor"]="top-right";break;default:t["text-anchor"]="top"}break;case"bottom":switch(i.horizontalAlignment){case"left":t["text-anchor"]="bottom-left";break;case"right":t["text-anchor"]="bottom-right";break;default:t["text-anchor"]="bottom"}break;default:switch(i.horizontalAlignment){case"left":t["text-anchor"]="left";break;case"right":t["text-anchor"]="right";break;default:t["text-anchor"]="center"}}}(t,i,e,a,n),o="symbol";break;case r.SymbolType.pictureMarker:e instanceof r.PictureMarkerSymbol||(e=new r.PictureMarkerSymbol),function(e,t,i,a,n,s){const o=(s=s||{}).imageSourceManager;if(!o)throw new Error("mapboxgl转换图标符号时,未传入图片资源管理类");const l=r.Color.fromColor(i.color);e["icon-color"]=l.toCssRGBAString(),e["icon-opacity"]=n,t["icon-allow-overlap"]=!0,t["icon-rotate"]=i.angle,t["icon-image"]=i.id,t["icon-offset"]=[i.xoffset,i.yoffset],t["icon-size"]=o.getIconScale(i.id,i.width,i.height),t.visibility=a?"visible":"none"}(t,i,e,a,n,s),o="symbol";break;case r.SymbolType.pictureFill:e instanceof r.PictureFillSymbol||(e=new r.PictureFillSymbol),function(e,t,i,a,n,s){if(!(s=s||{}).imageSourceManager)throw new Error("mapboxgl转换图片填充符号时,未传入图片资源管理类");const o=r.Color.fromColor(i.outline.color);e["fill-pattern"]=i.id,e["fill-opacity"]=n,e["fill-translate"]=[i.xoffset,i.yoffset],e["fill-outline-color"]=o.toCssRGBAString(),t.visibility=a?"visible":"none"}(t,i,e,a,n,s),o="fill"}return o}function A(e,t,i,a,n,s){const o=[],l=function(e,t){(t=Object(r.defaultValue)(t,{})).opacity=Object(r.defaultValue)(t.opacity,1);const i=e.clusterInfos,a=e.defaultSymbol,n={"circle-color":["step",["get","point_count"]],"circle-opacity":["step",["get","point_count"]],"circle-radius":["step",["get","point_count"]],"circle-stroke-color":["step",["get","point_count"]],"circle-stroke-opacity":["step",["get","point_count"]],"circle-stroke-width":["step",["get","point_count"]]};for(let e=0;e<i.length;e++){const a=r.Color.fromColor(i[e].symbol.color);n["circle-color"].push(a.toCssRGBAString()),n["circle-color"].push(i[e].maxValue),n["circle-opacity"].push(a.alpha*t.opacity),n["circle-opacity"].push(i[e].maxValue),n["circle-radius"].push(i[e].symbol.size),n["circle-radius"].push(i[e].maxValue);const s=r.Symbol.fromJSON(i[e].symbol.outline);n["circle-stroke-color"].push(s.color.toCssRGBAString()),n["circle-stroke-color"].push(i[e].maxValue),n["circle-stroke-opacity"].push(s.color.alpha*t.opacity),n["circle-stroke-opacity"].push(i[e].maxValue),n["circle-stroke-width"].push(s.width),n["circle-stroke-width"].push(i[e].maxValue)}const s=r.Color.fromColor(a.color);n["circle-color"].push(s.toCssRGBAString()),n["circle-opacity"].push(1),n["circle-radius"].push(a.size);const o=r.Symbol.fromJSON(a.outline);return n["circle-stroke-color"].push(o.color.toCssRGBAString()),n["circle-stroke-opacity"].push(1),n["circle-stroke-width"].push(o.width),n}(t,{opacity:n});o.push({id:`${e}_cluster`,type:"circle",source:e,filter:["has","point_count"],paint:l,layout:{visibility:a?"visible":"none"}});const c=function(e){const t=e.clusterInfos,i=e.defaultLabelSymbol;let a="宋体";for(let e=0;e<t.length;e++){const i=r.Symbol.fromJSON(t[e].labelSymbol);i&&i.font&&i.font.family&&(a=i.font.family)}!a&&i&&i.font&&i.font.family&&(a=i.font.family);const n={"text-field":"{point_count}","text-font":[a,a],"text-size":["step",["get","point_count"]]};for(let e=0;e<t.length;e++){const i=r.Symbol.fromJSON(t[e].labelSymbol);n["text-size"].push(i.font.size),n["text-size"].push(t[e].maxValue)}let s=30;return i&&i.font&&i.font.size&&(s=i.font.size),n["text-size"].push(s),n}(t);c.visibility=a?"visible":"none";const h=function(e,t){(t=Object(r.defaultValue)(t,{})).opacity=Object(r.defaultValue)(t.opacity,1);const i=e.clusterInfos,a={"text-opacity":1};for(let e=0;e<i.length;e++){const n=r.Symbol.fromJSON(i[e].labelSymbol);a["text-opacity"]=n.color.alpha*t.opacity}return a}(t,{opacity:n,visible:a});return o.push({id:`${e}_cluster_count`,type:"symbol",source:e,filter:["has","point_count"],layout:c,paint:h}),t.defaultSymbol&&o.push({id:`${e}_unclustered_point`,type:"circle",source:e,filter:["!",["has","point_count"]],paint:function(e,t){(t=Object(r.defaultValue)(t,{})).opacity=Object(r.defaultValue)(t.opacity,1);const i=e.defaultSymbol,a=r.Color.fromColor(i.color),n=r.Symbol.fromJSON(i.outline),s=r.Color.fromColor(n.color);return{"circle-opacity":a.alpha*t.opacity,"circle-color":a.toCssRGBAString(),"circle-radius":i.size,"circle-stroke-width":n.width,"circle-stroke-color":s.toCssRGBAString(),"circle-stroke-opacity":s.alpha*t.opacity}}(t,{visible:a,opacity:n}),layout:{visibility:a?"visible":"none"}}),o}function z(e,t,i,r,a,n){const s=[];if(!t)return;const o=j(t.field,t.valueExpression);return[{visible:t.defaultVisible,symbol:t.defaultSymbol,value:null}].concat(t.uniqueValueInfos).forEach(i=>{const l=i.visible,c=i.value,h=i.symbol;if(!h)return;const u={},p={},d=I(h,u,p,r&&l,a,n);let y=["==",o,c];if(t.defaultSymbol&&h.id===t.defaultSymbol.id){const e=t.uniqueValueInfos.map(e=>e.value);0===e.length?y=null:(y=["match",o],e.forEach(e=>{y.push(e,!1)}),y.push(!0))}if(d){const t={id:h.id,type:d,paint:u,layout:p,source:e};y&&(t.filter=y),s.push(t)}}),s}function R(e){let t;const{info:i,visible:r,opacity:a,convertSymbolOptions:n,isLast:s,expression:o,renderer:l,classBreakSpace:c,sourceId:h}=e,u=i.visible,p=i.maxValue,d=i.minValue,y=i.symbol;if(!y)return;const m={},f={},g=I(y,m,f,r&&u,a,n);let v;if(v=s?["all",[">=",o,d],["<=",o,p]]:["all",[">=",o,d],["<",o,p]],l.defaultSymbol&&y.id===l.defaultSymbol.id&&(v=0===c.length?null:["any"].concat(c)),g){const e={id:y.id,type:g,paint:m,layout:f,source:h};v&&(e.filter=v),t=e}return t}function D(e,t,i,a,n,s){const o=[];if(!t)return;let l=j(t.field,t.valueExpression,!0);l=function(e,t){let i=e;t=t||{};const{normalizationField:a,normalizationTotal:n,normalizationType:s}=t;switch(s){case r.NormalizationType.field:i=["/",i,["to-number",["get",a]]];break;case r.NormalizationType.log:i=["log10",e];break;case r.NormalizationType.percentOfTotal:i=["*",i,1/n,100]}return i}(l,{normalizationField:t.normalizationField,normalizationTotal:t.normalizationTotal,normalizationType:t.normalizationType});const c=t.classBreakInfos.map(e=>e);let h;c.sort((e,t)=>e.maxValue-t.maxValue);const u=[];c.forEach(e=>{const{minValue:t,maxValue:i}=e;if(t>i)throw new Error("分段专题图分段信息错误,最大值小于最小值");if(void 0===h)h=i;else{if(t<h)throw new Error("分段专题图分段信息错误,相邻分段值重叠");t!==h&&u.push(["all",[">=",l,h],["<",l,t]])}}),0!==c.length&&(u.unshift(["<",l,c[0].minValue]),u.push([">=",l,c[c.length-1].maxValue]));const p=[{visible:t.defaultVisible,symbol:t.defaultSymbol,maxValue:NaN,minValue:NaN}].concat(c);for(let i=0;i<p.length-1;i++){const r=R({info:p[i],visible:a,opacity:n,expression:l,renderer:t,classBreakSpace:u,sourceId:e,convertSymbolOptions:s});r&&o.push(r)}if(p.length>=1){const i=R({info:p[p.length-1],visible:a,opacity:n,expression:l,renderer:t,classBreakSpace:u,sourceId:e,convertSymbolOptions:s,isLast:!0});i&&o.push(i)}return o}function G(e,t,i,a,n,s){if(!(s=s||{}).featureSet)throw new Error("随机专题图要素数据集参数未传入");return z(e,function(e,t){const i=t.features,a=[];for(let e=0;e<i.length;e++){let t;switch(i[e].geometry.type){case r.GeometryType.polygon:case r.GeometryType.multiPolygon:case r.GeometryType.extent:case r.GeometryType.circle:default:t={value:i[e].id,symbol:new r.SimpleFillSymbol({id:i[e].id,color:new r.Color(parseInt(255*Math.random()),parseInt(255*Math.random()),parseInt(255*Math.random()),1)})};break;case r.GeometryType.lineString:case r.GeometryType.multiLineString:t={value:i[e].id,symbol:new r.SimpleLineSymbol({id:i[e].id,color:new r.Color(parseInt(255*Math.random()),parseInt(255*Math.random()),parseInt(255*Math.random()),1),width:3})};break;case r.GeometryType.point:case r.GeometryType.multiPoint:t={value:i[e].id,symbol:new r.SimpleMarkerSymbol({id:i[e].id,color:new r.Color(parseInt(255*Math.random()),parseInt(255*Math.random()),parseInt(255*Math.random()),1)})}}a.push(t)}return new r.UniqueValueRenderer({field:"id",uniqueValueInfos:a})}(0,s.featureSet),0,a,n,s)}function N(e,t,i,a,n,s){let o=[];if(s=s||{},!t||!i)return o;switch(t.type){case r.RendererType.simple:o=function(e,t,i,r,a,n){const s=[];if(!t||!t.symbol)return;const o={},l={},c=I(t.symbol,o,l,r,a,n);return c&&s.push({id:t.symbol.id,type:c,paint:o,layout:l,source:e}),s}(e,t,0,a,n,s);break;case r.RendererType.classBreak:o=D(e,t,0,a,n,s);break;case r.RendererType.uniqueValue:o=z(e,t,0,a,n,s);break;case r.RendererType.rank:o=function(e,t,i,a,n,s){const o=[];if(!t||!t.symbol)return;const l=s.imageSourceManager;if(!l)throw new Error("mapboxgl转换图片填充符号时,未传入图片资源管理类");const c={},h={},u=t.symbol,p=I(u,c,h,a,n,s);if(p){const i={id:u.id,type:p,paint:c,layout:h,source:e},{minSize:a,maxSize:n,maxDataValue:s,minDataValue:d,field:y,valueExpression:m}=t;if(void 0===s||void 0===d)throw new Error("mapboxgl上等级符号渲染器必须设置maxDataValue,minDataValue最大最小数据值");const f=j(y,m,!0);switch(u.type){case r.SymbolType.pictureMarker:i.layout["icon-size"]=["interpolate",["linear"],f,d,l.getIconScale(u.id,a,a),s,l.getIconScale(u.id,n,n)];break;case r.SymbolType.text:i.layout["text-size"]=["interpolate",["linear"],f,d,a,s,n];break;case r.SymbolType.simpleMarker:i.paint["circle-radius"]=["interpolate",["linear"],f,d,a/2,s,n/2]}o.push(i)}return o}(e,t,0,a,n,s);break;case r.RendererType.random:o=G(e,0,0,a,n,s);break;case r.RendererType.cluster:o=A(e,t,0,a,n);break;default:r.Log.error("未定义的Renderer类型")}return o}function F(e,t){const i=e.map(e=>{if(e){if(e.type===r.SymbolType.pictureFill){const i=Math.max(e.xscale,e.yscale),r=Math.max(e.width,e.height);return t.updateImage(e.id,e.url,{pfsSize:r,pfsScale:i})}if(e.type===r.SymbolType.pictureMarker)return t.updateImage(e.id,e.url);if(e.type===r.SymbolType.simpleFill&&"solid"!==e.style){const i=Object(r.createSimpleFillSymbolCanvas)(e,{lineWidth:1}).toDataURL(),a=e.color;return t.updateImage(e.id,i,{pattern:e.style,color:a.toCssRGBAString()})}return null}}).filter(e=>e);return Object(r.allSettled)(i)}var B=class{constructor(e){e=Object(r.defaultValue)(e,{}),this.id=e.id,this.sourceId=e.sourceId,this.featureCollection=e.featureCollection,this.layerId=e.layerId,this.renderType=e.renderType,this.mapboxglStyleType=e.mapboxglStyleType,this.highPerformanceLayer=e.highPerformanceLayer,this._sourceDirty=!0,this._styleLayerDirty=!0}setDirty(e){this._sourceDirty=e,this._styleLayerDirty=e}getDirty(){return this._sourceDirty||this._styleLayerDirty}setSourceDirty(e){this._sourceDirty=e}getSourceDirty(){return this._sourceDirty}setStyleLayerDirty(e){this._styleLayerDirty=e}getStyleLayerDirty(){return this._styleLayerDirty}};function U(e,t,i,r){r=r||{},t[e.sourceId]={type:"geojson",data:{type:"FeatureCollection",features:[]}},i.push({id:e.layerId,source:e.sourceId,type:e.mapboxglStyleType})}var Z=class{constructor(e){e=Object(r.defaultValue)(e,{}),this.id=e.id||Object(r.getGUID)(),this._opacity=Object(r.defaultValue)(e.opacity,1),this._visible=Object(r.defaultValue)(e.visible,!0),this.highPerformance=Object(r.defaultValue)(e.highPerformance,!1),this._isLoaded=!1,this.metaIds=["fill","line","circle","text","icon","fill-picture"],this._sourceMetaDatas={},this.metaIds.forEach(e=>{this._sourceMetaDatas[e]=this._createSourceMetaData(this.id,e,e,!0)})}_createSourceMetaData(e,t,i,r){const a={};a.sourceId=`${e}_${t}`,a.featureCollection=[],a.layerId=`${e}_${t}_layer`,a.renderType=i,a.id=t,a.highPerformanceLayer=r;let n=i;return"text"!==n&&"icon"!==n||(n="symbol"),"fill-picture"===n&&(n="fill"),a.mapboxglStyleType=n,new B(a)}onAdd(e){if(!e)return;this._map=e;const t=this;return this._imageSourceManager=new E(e),new Promise(i=>{let r;const a=()=>{t._isLoaded||(ne(t._getSourcesAndLayers(),e),t._isLoaded=!0,t._refreshSourceAndLayers()),i(this),r&&clearInterval(r)};e.loaded()?a():(e.once("load",a),r=setInterval(()=>{e.loaded()&&a()},16))})}_getSourcesAndLayers(){const e={},t=[];return this.metaIds.forEach(i=>{U(this._sourceMetaDatas[i],e,t)}),{sources:e,layers:t}}onRemove(e){e&&this._isLoaded&&this.metaIds.forEach(t=>{const i=this._sourceMetaDatas[t];e.style.getLayer(i.layerId)&&e.removeLayer(i.layerId),e.getSource(i.sourceId)&&e.removeSource(i.sourceId)})}getStyleLayerIds(){const e=[];return this.metaIds.forEach(t=>{const i=this._sourceMetaDatas[t];e.push(i.layerId)}),e}add(e){this._map&&this._isLoaded&&F((Array.isArray(e)?e:[e]).map(e=>e.symbol),this._imageSourceManager).then(()=>{Array.isArray(e)?e.forEach(e=>{this._updateGraphicToCollection(e)}):this._updateGraphicToCollection(e),this._refreshSourceAndLayers()})}update(e,t){if(!this._map||!this._isLoaded)return;if(!e)return;const i=Array.isArray(e)?e:[e];F(i.map(e=>e.symbol),this._imageSourceManager).then(()=>{for(let e=0;e<i.length;e++){const r=i[e],a=t[e]||{},n=this._updateGraphicToCollection(r);n&&(a.geometryUpdated&&n.setSourceDirty(!0),(a.symbolUpdated||a.visibleUpdated)&&n.setStyleLayerDirty(!0))}this._refreshSourceAndLayers()})}_removeGraphicsToCollection(e){const t=Object.values(this._sourceMetaDatas);for(let i=0;i<t.length;i++){const r=t[i],{featureCollection:a}=r,n=[];for(let t=0;t<a.length;t++){const i=a[t];e.indexOf(i)>-1&&n.push(t)}n.length>0&&(r.featureCollection=a.filter((e,t)=>-1===n.indexOf(t)),r.setSourceDirty(!0))}}_updateGraphicToCollection(e){let t;if(e&&e instanceof r.Feature){if(e.geometry&&e.symbol){if(!this.highPerformance){const i=this._getRenderTypeBySymbol(e.symbol);if(this._sourceMetaDatas[e.id]){(t=this._sourceMetaDatas[e.id]).isRefreshStyleLayer=t.renderType!==i,"fill-picture"===t.renderType&&"fill-picture"===i&&this._map.getLayer(t.layerId).getPaintProperty("fill-pattern")!==e.symbol.id&&(t.isRefreshStyleLayer=!0);const r=this._createSourceMetaData(this.id,e.id,i,!1);t.renderType=r.renderType,t.mapboxglStyleType=r.mapboxglStyleType}else{(t=this._createSourceMetaData(this.id,e.id,i,!1)).featureCollection.push(e),this._sourceMetaDatas[e.id]=t;const r={};U(t,r,[]);const a=Object.entries(r);for(let e=0;e<a.length;e++){const t=a[e];this._map.addSource(t[0],t[1])}this.metaIds.unshift(e.id)}return t}switch(e.geometry.type){case r.GeometryType.multiPoint:case r.GeometryType.point:t=this._dividePointGraphic(e);break;case r.GeometryType.multiLineString:case r.GeometryType.lineString:t=this._dividePolylineGraphic(e);break;case r.GeometryType.extent:case r.GeometryType.circle:case r.GeometryType.multiPolygon:case r.GeometryType.polygon:t=this._dividePolygonGraphic(e)}return t}r.Log.warning("要素几何信息缺失,无法绘制要素:",e)}}remove(e){this._map&&this._isLoaded&&e&&(Array.isArray(e)?this._removeGraphicsToCollection(e):this._removeGraphicsToCollection([e]),this._removeSourceMetaData(this._map,this._sourceMetaDatas[e.id]),this._refreshSourceAndLayers())}removeAll(){if(!this._map||!this._isLoaded)return;const e=Object.values(this._sourceMetaDatas);for(let t=0;t<e.length;t++){const i=e[t];i.featureCollection=[],i.setDirty(!0),this._removeSourceMetaData(this._map,i)}this._refreshSourceAndLayers()}_removeSourceMetaData(e,t){if(!this.highPerformance&&t&&!t.highPerformanceLayer){e.style.getLayer(t.layerId)&&e.removeLayer(t.layerId),delete this._sourceMetaDatas[t.id],e.getSource(t.sourceId)&&e.removeSource(t.sourceId);const i=this.metaIds.indexOf(t.id);i>-1&&this.metaIds.splice(i,1)}}_refreshSourceAndLayers(){const e=Object.keys(this._sourceMetaDatas);if(!e.some(e=>this._sourceMetaDatas[e].getDirty()))return!1;if(!this._map)return!1;const t=this._map;return e.forEach(e=>{const i=this._sourceMetaDatas[e];if(i.getStyleLayerDirty()&&(this.setSourceMetaDataStyle(i,!0),i.setStyleLayerDirty(!1)),i.getSourceDirty()){const{sourceId:e,featureCollection:r}=i;t.getSource(e).setData({type:"FeatureCollection",features:r.map(function(e){return g.convertToGeoJSON(e)})}),i.setSourceDirty(!1)}}),t._update(!0),!0}setSourceMetaDataStyle(e,t){const i={},r={},a={},{renderType:n}=e,s=this._map,o=this;i.type=e.mapboxglStyleType,i.id=e.layerId,i.paint=r,i.layout=a,i.source=e.sourceId;const l=function(){const t=s.style,i=e.layerId;o._updateStyleLayers(t,i,r,a)};if(this.highPerformance){switch(n){case"circle":this._setCircleStyle(e,r,a);break;case"line":this._setLineStyle(e,r,a);break;case"fill":this._setFillStyle(e,r,a);break;case"text":this._setTextStyle(e,r,a);break;case"icon":this._setIconStyle(e,r,a);break;case"fill-picture":this._setFillPictureStyle(e,r,a)}l()}else if(Array.isArray(e.featureCollection)&&e.featureCollection.length>0){const t=e.featureCollection[0];I(t.symbol,r,a,this._visible&&t.visible,this._opacity,{imageSourceManager:this._imageSourceManager});let n=!1,o=`${this.id}_fill_layer`;if(s.style.hasLayer(e.layerId)){if(e.isRefreshStyleLayer){const t=this._map.style._order,i=t.indexOf(e.layerId);i>-1&&t.length>i+1&&(o=t[i+1]),s.removeLayer(e.layerId),e.isRefreshStyleLayer=!1,n=!0}}else n=!0;n?s.addLayer(i,o):l()}return i}_updateStyleLayers(e,t,i,r){const a=Object.entries(i),n=Object.entries(r);for(let i=0;i<a.length;i++)e.setPaintProperty(t,a[i][0],a[i][1]);for(let i=0;i<n.length;i++)e.setLayoutProperty(t,n[i][0],n[i][1])}_setCircleStyle(e,t,i){const{layerId:a,featureCollection:n}=e,s=this._opacity,o=this._visible,l={"circle-color":{values:[],def:"#000000"},"circle-opacity":{values:[],def:1},"circle-stroke-color":{values:[],def:"#000000"},"circle-stroke-opacity":{values:[],def:1},"circle-stroke-width":{values:[],def:0},"circle-radius":{values:[],def:5}};n.forEach(e=>{const{id:t}=e;let i=e.symbol;i instanceof r.SimpleMarkerSymbol||(r.Log.info(`不支持类型为${i.type}的符号!`),i=new r.SimpleMarkerSymbol({id:i.id}));const a=g.applyVisibleAndOpacityToColor(i.color,o&&e.visible,s);l["circle-color"].values.push(t,a.toCssRGBString()),l["circle-opacity"].values.push(t,a.alpha);const n=g.applyVisibleAndOpacityToColor(i.outline.color,o&&e.visible,s);l["circle-stroke-color"].values.push(t,n.toCssRGBString()),l["circle-stroke-opacity"].values.push(t,n.alpha),l["circle-stroke-width"].values.push(t,i.outline.width),l["circle-radius"].values.push(t,i.size/2)}),this._setLayoutAndPaintCaches(a,l,{},t,i)}_setLineStyle(e,t,i){const{layerId:a,featureCollection:n}=e,s=this._opacity,o=this._visible,l={"line-color":{values:[],def:"#000000"},"line-width":{values:[],def:1},"line-opacity":{values:[],def:1}},c={"line-join":{values:[],def:"round"}};n.forEach(e=>{const{id:t}=e;let i=e.symbol;i instanceof r.SimpleLineSymbol||(r.Log.info(`不支持类型为${i.type}的符号!`),i=new r.SimpleLineSymbol({id:i.id}));const a=g.applyVisibleAndOpacityToColor(i.color,o&&e.visible,s);l["line-color"].values.push(t,a.toCssRGBString()),l["line-opacity"].values.push(t,a.alpha),l["line-width"].values.push(t,i.width),c["line-join"].values.push(t,i.join)}),this._setLayoutAndPaintCaches(a,l,c,t,i)}_setFillStyle(e,t,i){const{layerId:a,featureCollection:n}=e,s=this._opacity,o=this._visible,l={"fill-color":{values:[],def:"#ffffff"},"fill-opacity":{values:[],def:.25},"fill-outline-color":{values:[],def:"#000000"}};n.forEach(e=>{const{id:t}=e;let i=e.symbol;i instanceof r.SimpleFillSymbol||(r.Log.info(`不支持类型为${i.type}的符号!`),i=new r.SimpleFillSymbol({id:i.id}));const a=g.applyVisibleAndOpacityToColor(i.color,o&&e.visible,s),n=g.applyVisibleAndOpacityToColor(i.outline.color,o&&e.visible,s);l["fill-color"].values.push(t,a.toCssRGBString()),l["fill-opacity"].values.push(t,a.alpha),l["fill-outline-color"].values.push(t,n.toCssRGBAString())}),this._setLayoutAndPaintCaches(a,l,{},t,i)}_setTextStyle(e,t,i){const{layerId:a,featureCollection:n}=e,s=this._opacity,o=this._visible,l={"text-color":{values:[],def:"#000000"},"text-opacity":{values:[],def:1},"text-halo-color":{values:[],def:"#000000"},"text-halo-width":{values:[],def:0}},c={"text-field":{values:[],def:""},"text-size":{values:[],def:12},"text-justify":{values:[],def:"center"},"text-letter-spacing":{values:[],def:0},"text-rotate":{values:[],def:0}};n.forEach(e=>{const{id:t}=e;let i=e.symbol;i instanceof r.TextSymbol||(r.Log.info(`不支持类型为${i.type}的符号!`),i=new r.TextSymbol({id:i.id}));const a=g.applyVisibleAndOpacityToColor(i.color,o&&e.visible,s),n=g.applyVisibleAndOpacityToColor(i.haloColor,o&&e.visible,s);l["text-color"].values.push(t,a.toCssRGBString()),l["text-opacity"].values.push(t,a.alpha),l["text-halo-color"].values.push(t,n.toCssRGBAString()),l["text-halo-width"].values.push(t,i.haloSize),c["text-field"].values.push(t,i.text),c["text-allow-overlap"]=!1,c["text-font"]=[i.font.family,"微软雅黑"],c["text-size"].values.push(t,i.font.size),c["text-justify"].values.push(t,i.horizontalAlignment),c["text-letter-spacing"].values.push(t,i.kerning?.1:0),c["text-rotate"].values.push(t,i.rotated&&0!==i.angle?i.angle:0)}),this._setLayoutAndPaintCaches(a,l,c,t,i,["text-allow-overlap","text-font"])}_setIconStyle(e,t,i){const a=this._imageSourceManager,{layerId:n,featureCollection:s}=e,o=this._opacity,l=this._visible,c={"icon-color":{values:[],def:"#000000"},"icon-opacity":{values:[],def:1}},h={"icon-size":{values:[],def:.001},"icon-rotate":{values:[],def:0},"icon-image":{values:[],def:"marker-15"}},u=[];s.forEach(e=>{const{id:t}=e;let i=e.symbol;i instanceof r.PictureMarkerSymbol||(r.Log.info(`不支持类型为${i.type}的符号!`),i=new r.PictureMarkerSymbol({id:i.id}));const n=g.applyVisibleAndOpacityToColor(i.color,l&&e.visible,o);c["icon-color"].values.push(t,n.toCssRGBString()),c["icon-opacity"].values.push(t,n.alpha),h["icon-allow-overlap"]=!1;const s=i.id;h["icon-size"].values.push(t,a.getIconScale(s,i.width,i.height)),h["icon-image"].values.push(t,s),h["icon-rotate"].values.push(t,i.angle),u.push({url:i.url,id:i.id,featureId:t,width:i.width,height:i.height})}),this._setLayoutAndPaintCaches(n,c,h,t,i,["icon-allow-overlap"]),u.forEach(t=>{a.updateImage(t.id,t.url).then(i=>{if(!i)return;const r=a.innerView,n=r.getLayer(e.layerId);if(!n)return;const s=n.getLayoutProperty("icon-size"),o=s.indexOf(t.featureId);o<=-1||o+1>=s.length||(s[o+1]=a.getIconScale(t.id,t.width,t.height),r.setLayoutProperty(e.layerId,"icon-size",s))})})}_setFillPictureStyle(e,t,i){const{layerId:a,featureCollection:n}=e,s=this._imageSourceManager,o=this._opacity,l=this._visible,c={"fill-opacity":{values:[],def:.25},"fill-pattern":{values:[],def:""},"fill-outline-color":{values:[],def:"#000000"}};n.forEach(e=>{const{id:t}=e;let i=e.symbol;i instanceof r.PictureFillSymbol||i instanceof r.SimpleFillSymbol||(r.Log.info(`不支持类型为${i.type}的符号!`),i=new r.PictureFillSymbol({id:i.id}));const a=i.type===r.SymbolType.pictureFill,n=g.applyVisibleAndOpacityToColor(i.color,l&&e.visible,o),h=g.applyVisibleAndOpacityToColor(i.outline.color,l&&e.visible,o);if(c["fill-opacity"].values.push(t,n.alpha),c["fill-outline-color"].values.push(t,h.toCssRGBAString()),c["fill-pattern"].values.push(t,i.id),a){const e=Math.max(i.xscale,i.yscale),t=Math.max(i.width,i.height);s.updateImage(i.id,i.url,{pfsSize:t,pfsScale:e})}else{const e=Object(r.createSimpleFillSymbolCanvas)(i,{lineWidth:1}).toDataURL();s.updateImage(i.id,e,{pattern:i.style,color:n.toCssRGBAString()})}}),this._setLayoutAndPaintCaches(a,c,{},t,i)}_setLayoutAndPaintCaches(e,t,i,r,a,n){n||(n=[]);for(const e in t)if(n.findIndex(t=>t===e)>-1)r[e]=t[e];else if(t[e].values.length>0){let i=[];i.push("match"),i.push(["get","id"]),(i=i.concat(t[e].values)).push(t[e].def),r[e]=i}else r[e]=t[e].def;for(const e in i)if(n.findIndex(t=>t===e)>-1)a[e]=i[e];else if(i[e].values.length>0){let t=[];t.push("match"),t.push(["get","id"]),(t=t.concat(i[e].values)).push(i[e].def),a[e]=t}else a[e]=i[e].def}_dividePointGraphic(e){const{symbol:t}=e;let i=!1,a=this._sourceMetaDatas.circle;switch(t.type){case r.SymbolType.simpleMarker:i=this._replaceSourceLayer(e,"circle"),a=this._sourceMetaDatas.circle;break;case r.SymbolType.text:i=this._replaceSourceLayer(e,"text"),a=this._sourceMetaDatas.text;break;case r.SymbolType.pictureMarker:i=this._replaceSourceLayer(e,"icon"),a=this._sourceMetaDatas.icon}if(!i){const{featureCollection:t}=a;t.push(e),a.setDirty(!0)}return a}_replaceSourceLayer(e,t){const i=this.metaIds,r=this._hasGraphicInCollection(i,e);if(r){if(r.renderType===t)return!0;this._removeGraphicsToCollection([e])}return!1}_dividePolylineGraphic(e){const t=this._hasGraphicInCollection(["line"],e),i=this._sourceMetaDatas.line;if(!t){const{featureCollection:t}=i;t.push(e),i.setDirty(!0)}return i}_dividePolygonGraphic(e){let t=!1;const{symbol:i}=e;let a=this._sourceMetaDatas.fill,n=i.type;switch(n===r.SymbolType.simpleFill&&"solid"!==i.style&&(n=r.SymbolType.pictureFill),n){case r.SymbolType.simpleMarker:t=this._replaceSourceLayer(e,"circle"),a=this._sourceMetaDatas.circle;break;case r.SymbolType.text:t=this._replaceSourceLayer(e,"text"),a=this._sourceMetaDatas.text;break;case r.SymbolType.pictureMarker:t=this._replaceSourceLayer(e,"icon"),a=this._sourceMetaDatas.icon;break;case r.SymbolType.pictureFill:t=this._replaceSourceLayer(e,"fill-picture"),a=this._sourceMetaDatas["fill-picture"];break;case r.SymbolType.simpleFill:t=this._replaceSourceLayer(e,"fill"),a=this._sourceMetaDatas.fill}if(!t){const{featureCollection:t}=a;t.push(e),a.setDirty(!0)}return a}_hasGraphicInCollection(e,t){const i=Array.isArray(e)?e:[e];let r;for(let e=0;e<i.length;e++){const a=this._sourceMetaDatas[i[e]];if(!a)break;const{featureCollection:n}=a;if(n.indexOf(t)>-1){r=a;break}}return r}set opacity(e){this._opacity!==e&&(this._opacity=e,this._updatePaintAndLayoutStyles())}get opacity(){return this._opacity}set visible(e){this._visible!==e&&(this._visible=e,this._updatePaintAndLayoutStyles())}get visible(){return this._visible}_updatePaintAndLayoutStyles(){const e=Object.values(this._sourceMetaDatas);for(let t=0;t<e.length;t++)e[t].setStyleLayerDirty(!0);this._refreshSourceAndLayers()}_getBottomLayer(){return this._sourceMetaDatas[this.metaIds[0]]}_getRenderTypeBySymbol(e){let t="circle";switch(e.type){case r.SymbolType.simpleMarker:t="circle";break;case r.SymbolType.simpleLine:t="line";break;case r.SymbolType.simpleFill:t="fill","solid"!==e.style&&(t="fill-picture");break;case r.SymbolType.text:t="text";break;case r.SymbolType.pictureMarker:t="icon";break;case r.SymbolType.pictureFill:t="fill-picture"}return t}};function $(e,t){const i=(t=t||{}).featureSet,a=t.mapboxglMap;if(!i||!a)throw new Error("featureSet或mapboxglMap对象缺失");const n=e.renderer,s={type:"geojson",data:i.toGeoJSON()};n instanceof r.ClusterRenderer&&(s.cluster=!0,s.clusterRadius=n.radius),$.imageSourceManager||($.imageSourceManager=new E(a));const o={};o[e.id]=s;const l={featureSet:i,imageSourceManager:$.imageSourceManager,updateState:null},c=e.opacity,h=e.visible;return{sources:o,layers:N(e.id,n,e.geometryType,h,c,l)}}function q(e,t){const i=(t=t||{}).mapboxglMap;if(!i)throw new Error("featureSet或mapboxglMap对象缺失");q.imageSourceManager||(q.imageSourceManager=new E(i));const r=new Z({id:e.id,opacity:e.opacity,visible:e.visible});r._imageSourceManager=q.imageSourceManager,e.graphics.forEach(e=>{r._updateGraphicToCollection(e)});const a={},n=[];return Object.entries(r._sourceMetaDatas).forEach(e=>{const t=e[1],{featureCollection:i,sourceId:s}=t;if(i.length<=0)return;a[s]={type:"geojson",data:{type:"FeatureCollection",features:i.map(function(e){return g.convertToGeoJSON(e)})}};const o=r.setSourceMetaDataStyle(t,!1);n.push(o)}),{layers:n,sources:a}}const K=window.mapv||{},{baiduMapLayer:W,DataSet:J}=K,X=W?W.__proto__:Function;var Y=class extends X{constructor(e,t,i,r){super(e,t,i),X&&(this.map=e,this.dataSet=t,i=i||{},this.init(i),this.argCheck(i),this.initDevicePixelRatio(),this.canvasLayer=r,this.stopAniamation=!1,this.animation=i.animation,this.mousemoveEvent=this.mousemoveEvent.bind(this),this.bindEvent())}initDevicePixelRatio(){this.devicePixelRatio=window.devicePixelRatio||1}clickEvent(e){const t=e.point;super.clickEvent(t,e)}mousemoveEvent(e){const t=e.point;super.mousemoveEvent(t,e)}addAnimatorEvent(){}animatorMovestartEvent(){const e=this.options.animation;this.isEnabledTime()&&this.animator&&(this.steps.step=e.stepsRange.start)}animatorMoveendEvent(){this.isEnabledTime()&&this.animator}bindEvent(){const e=this.map;this.options.methods&&(this.options.methods.click&&e.on("click",this.clickEvent),this.options.methods.mousemove&&e.on("mousemove",this.mousemoveEvent))}unbindEvent(){const e=this.map;this.options.methods&&(this.options.methods.click&&e.off("click",this.clickEvent),this.options.methods.mousemove&&e.off("mousemove",this.mousemoveEvent))}getContext(){return this.canvasLayer.canvas.getContext(this.context)}init(e){const t=this;t.options=e,this.initDataRange(e),this.context=t.options.context||"2d",t.options.zIndex&&this.canvasLayer&&this.canvasLayer.setZIndex(t.options.zIndex),this.initAnimator()}_canvasUpdate(e){const t=this.map;if(!this.canvasLayer||this.stopAniamation||this.canvasLayer.disposeFlag)return;const i=this,r=i.options.animation,a=this.getContext();if(i.isEnabledTime()){if(void 0===e)return void this.clear(a);"2d"===this.context&&(a.save(),a.globalCompositeOperation="destination-out",a.fillStyle="rgba(0, 0, 0, .1)",a.fillRect(0,0,a.canvas.width,a.canvas.height),a.restore())}else this.clear(a);if("2d"===this.context)for(const e in i.options)a[e]=i.options[e];else a.clear(a.COLOR_BUFFER_BIT);if(i.options.minZoom&&t.getZoom()<i.options.minZoom||i.options.maxZoom&&t.getZoom()>i.options.maxZoom)return;const s={transferCoordinate(e){const i=t.project(new n.a.LngLat(e[0],e[1]));return[i.x,i.y]}};void 0!==e&&(s.filter=function(t){const i=r.trails||10;return!!(e&&t.time>e-i&&t.time<e)});const o=i.dataSet.get(s);this.processData(o),"m"==i.options.unit&&i.options.size,i.options._size=i.options.size;const l=t.project(new n.a.LngLat(0,0));this.drawContext(a,new J(o),i.options,l),i.options.updateCallback&&i.options.updateCallback(e)}updateData(e,t){let i=e;i&&i.get&&(i=i.get()),void 0!=i&&this.dataSet.set(i),super.update({options:t})}addData(e,t){let i=e;e&&e.get&&(i=e.get()),this.dataSet.add(i),this.update({options:t})}getData(){return this.dataSet}removeData(e){if(!this.dataSet)return;const t=this.dataSet.get({filter:t=>null==e||"function"!=typeof e||!e(t)});this.dataSet.set(t),this.update({options:null})}clearData(){this.dataSet&&this.dataSet.clear(),this.update({options:null})}draw(){this.canvasLayer.draw()}clear(e){e&&e.clearRect&&e.clearRect(0,0,e.canvas.width,e.canvas.height)}};var H=class{constructor(e,t,i){i=i||{},this.map=e,this.layerID=i.layerID,delete i.layerID,this.mapvBaseLayer=new Y(e,t,i,this),this.mapVOptions=i,this.initDevicePixelRatio(),this.canvas=this._createCanvas(),this.render=this.render.bind(this),this.bindEvent(),this.mapContainer=e.getCanvasContainer(),this.mapContainer.appendChild(this.canvas),this._reset()}initDevicePixelRatio(){this.devicePixelRatio=window.devicePixelRatio||1}bindEvent(){const e=this.map;this.innerMoveStart=this.moveStartEvent.bind(this),this.innerMoveEnd=this.moveEndEvent.bind(this),this.innnerZoomStart=this.zoomStartEvent.bind(this),this.innnerZoomEnd=this.zoomEndEvent.bind(this),this.innnerRotateStart=this.rotateStartEvent.bind(this),this.innnerRotateEnd=this.rotateEndEvent.bind(this),this.innerResize=this.resizeEvent.bind(this),this.innerRemove=this.removeEvent.bind(this),e.on("resize",this.innerResize),e.on("zoomstart",this.innnerZoomStart),e.on("zoomend",this.innnerZoomEnd),e.on("rotatestart",this.innnerRotateStart),e.on("rotateend",this.innnerRotateEnd),e.on("movestart",this.innerMoveStart),e.on("moveend",this.innerMoveEnd),this.map.on("remove",this.innerRemove)}unbindEvent(){const e=this.map;e.off("resize",this.innerResize),e.off("zoomstart",this.innnerZoomStart),e.off("zoomend",this.innnerZoomEnd),e.off("rotatestart",this.innnerRotateStart),e.off("rotateend",this.innnerRotateEnd),e.off("movestart",this.innerMoveStart),e.off("moveend",this.innerMoveEnd)}moveStartEvent(){this.mapvBaseLayer.animatorMovestartEvent(),this._unvisiable()}moveEndEvent(){this.mapvBaseLayer.animatorMoveendEvent(),this._reset(),this._visiable()}zoomStartEvent(){this._unvisiable()}zoomEndEvent(){this._unvisiable()}rotateStartEvent(){this.mapvBaseLayer.animatorMovestartEvent(),this._unvisiable()}rotateEndEvent(){this.mapvBaseLayer.animatorMoveendEvent(),this._reset(),this._visiable()}resizeEvent(){this._reset(),this._visiable()}removeEvent(){this.mapContainer.removeChild(this.canvas)}addData(e,t){this.mapvBaseLayer.addData(e,t)}updateData(e,t){this.mapvBaseLayer.updateData(e,t)}getData(){return this.mapvBaseLayer&&(this.dataSet=this.mapvBaseLayer.getData()),this.dataSet}removeData(e){this.mapvBaseLayer&&this.mapvBaseLayer.removeData(e)}removeAllData(){this.mapvBaseLayer.clearData()}_visiable(){return this.canvas.style.display="block",this}_unvisiable(){return this.canvas.style.display="none",this}_createCanvas(){const e=document.createElement("canvas"),t=this.devicePixelRatio;return e.id=this.layerID,e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.width=parseInt(this.map.getCanvas().style.width)*t,e.height=parseInt(this.map.getCanvas().style.height)*t,this.mapVOptions.context&&"2d"!=this.mapVOptions.context||e.getContext("2d").scale(t,t),e.style.width=this.map.getCanvas().style.width,e.style.height=this.map.getCanvas().style.height,e}_reset(){null!=this.canvas&&(this.resizeCanvas(),this.fixPosition(),this.onResize(),this.render())}draw(){return this._reset()}show(){this._visiable()}hide(){this._unvisiable()}update(e){void 0!=e&&this.updateData(e.data,e.options)}resizeCanvas(){if(this.mapContainer.style.perspective=`${this.map.transform.cameraToCenterDistance}px`,void 0==this.canvas||null==this.canvas)return;const e=this.canvas,t=this.devicePixelRatio;e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.width=parseInt(this.map.getCanvas().style.width)*t,e.height=parseInt(this.map.getCanvas().style.height)*t,this.mapVOptions.context&&"2d"!=this.mapVOptions.context||e.getContext("2d").scale(t,t)}fixPosition(){}onResize(){}originPosition(){this.originPitch=this.map.getPitch(),this.originBearing=this.map.getBearing();const e=this.map.project(new n.a.LngLat(0,0));this.originX=e.x,this.originY=e.y}render(){void 0!=this.mapvBaseLayer&&this.mapvBaseLayer._canvasUpdate()}moveTo(e,t){const i=document.getElementById(this.layerID);if(t=void 0===t||t){const t=document.getElementById(e);return void(i&&t&&t.parentNode.insertBefore(i,t))}const r=document.getElementById(e);if(i){if(r.nextSibling)return void r.parentNode.insertBefore(i,r.nextSibling);r.parentNode.appendChild(i)}}remove(){this.removeAllData(),this.unbindEvent(),this.mapContainer.removeChild(this.canvas),this.disposeFlag=!0}destroy(){this.removeAllData(),this.unbindEvent(),this.mapContainer.removeChild(this.canvas),this.disposeFlag=!0}};const Q=window.echarts;function ee(e,t){this._MapboxGLMap=e,this.dimensions=["lng","lat"],this._mapOffset=[0,0],this._api=t}ee.prototype.dimensions=["lng","lat"],ee.prototype.setMapOffset=function(e){this._mapOffset=e},ee.prototype.getBMap=function(){return this._MapboxGLMap},ee.prototype.dataToPoint=function(e){const t=this._MapboxGLMap.project(e),i=this._mapOffset;return[t.x-i[0],t.y-i[1]]},ee.prototype.pointToData=function(e){const t=this._mapOffset;return[(e=this._MapboxGLMap.project([e[0]+t[0],e[1]+t[1]])).lng,e.lat]},ee.prototype.getViewRect=function(){const e=this._api;return new Q.graphic.BoundingRect(0,0,e.getWidth(),e.getHeight())},ee.prototype.getRoamTransform=function(){return Q.matrix.create()},ee.prototype.prepareCustoms=function(e){const t=Q.util,i=this.getViewRect();return{coordSys:{type:"mapboxgl",x:i.x,y:i.y,width:i.width,height:i.height},api:{coord:t.bind(this.dataToPoint,this),size:t.bind(function(e,i){return i=i||[0,0],t.map([0,1],function(t){const r=i[t],a=e[t]/2,n=[],s=[];return n[t]=r-a,s[t]=r+a,n[1-t]=s[1-t]=i[1-t],Math.abs(this.dataToPoint(n)[t]-this.dataToPoint(s)[t])},this)},this)}}},ee.dimensions=ee.prototype.dimensions,ee.create=function(e,t){let i;e.eachComponent("mapboxgl",function(e){t.getZr().painter.getViewportRoot();const r=Q.mapboxglMap;(i=new ee(r,t)).setMapOffset(e.__mapOffset||[0,0]),e.coordinateSystem=i}),e.eachSeries(function(e){"mapboxgl"===e.get("coordinateSystem")&&(e.coordinateSystem=i)})};var te=ee;const ie=window.echarts;var re=class{constructor(e,t){return t=t||{},this.map=e,this.options=t,this.layerId=t.layerId||"echartlayerdefaultid",this.layerClass=t.classId||"echartlayerdefaultclass",this.initDevicePixelRatio(),this.mapContainer=e.getCanvasContainer(),this.canvas=this._createCanvas(),this.mapContainer.appendChild(this.canvas),this.mapContainer.style.perspective=`${this.map.transform.cameraToCenterDistance}px`,this.chart=ie.init(this.canvas),this.visible=!0,this.initEcharts(),this._resizeCanvas(),this}initDevicePixelRatio(){this.devicePixelRatio=window.devicePixelRatio||1}initEcharts(){return ie.mapboxglMap=this.map,ie.registerCoordinateSystem("mapboxgl",te),ie.extendComponentModel({type:"mapboxgl",getBMap(){return this.__mapboxgl},defaultOption:{roam:!1}}),ie.registerAction({type:"MapboxGLRoma",event:"MapboxGLRoma",update:"updateLayout"},function(e,t){}),this}_createCanvas(){const e=document.createElement("div");return e.id=this.layerId,e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.width=parseInt(this.map.getCanvas().style.width),e.height=parseInt(this.map.getCanvas().style.height),e.style.width=this.map.getCanvas().style.width,e.style.height=this.map.getCanvas().style.height,e.setAttribute("id",this.layerId),e.setAttribute("class",this.layerClass),e}_resizeCanvas(){const e=this;window.onresize=function(){const t=e.canvas,i=e.map;t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.width=i.getCanvas().style.width,t.style.height=i.getCanvas().style.height,t.width=parseInt(i.getCanvas().style.width),t.height=parseInt(i.getCanvas().style.height),e.chart.resize()}}addTo(e){const t=this;return ie.extendComponentView({type:"mapboxgl",render(e,i,r){let a=!0;const n=ie.mapboxglMap,s=r.getZr().painter.getViewportRoot(),o=e.coordinateSystem,l=function(i,n){if(a||!t.visible)return;const l=document.getElementsByClassName("mapboxgl-map")[0],c=[-parseInt(l.style.left,10)||0,-parseInt(l.style.top,10)||0];s.style.left=`${c[0]}px`,s.style.top=`${c[1]}px`,o.setMapOffset(c),e.__mapOffset=c,r.dispatchAction({type:"MapboxGLRoma"})};function c(){!a&&t.visible&&r.dispatchAction({type:"MapboxGLRoma"})}n.off("move",this._oldMoveHandler),n.off("zoomend",this._oldZoomEndHandler),n.on("move",l),n.on("zoomend",c),this._oldMoveHandler=l,this._oldZoomEndHandler=c,e.get("roam"),a=!1}}),this.chart.setOption(this.options),this}_visible(){this.visible=!0,this.canvas.style.visibility="visible"}_unvisible(){this.visible=!1,this.canvas.style.visibility="hidden"}show(){this._visible()}hide(){this._unvisible()}remove(){const e=this;return this.map._listeners.move.forEach(function(t){"moveHandler"===t.name&&e.map.off("move",t)}),this.map._listeners.move.forEach(function(t){"zoomEndHandler"===t.name&&e.map.off("zoomend",t)}),this.chart.clear(),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas),this.map=void 0,this}update(e){this.chart.setOption(e)}};function ae(e,t){t=t||{};let i={sources:{},layers:[]};switch(e.type){case r.LayerType.IGSMapImage:i=le.getSourcesAndStyleLayers(e);break;case r.LayerType.IGSTile:i=b.getSourcesAndStyleLayers(e);break;case r.LayerType.ArcGISVectorTile:case r.LayerType.IGSVectorTile:i=he.getSourcesAndStyleLayers(e);break;case r.LayerType.ArcGISTile:i=S.getSourcesAndStyleLayers(e);break;case r.LayerType.ArcGISMapImage:i=w.getSourcesAndStyleLayers(e);break;case r.LayerType.WMTS:i=M.getSourcesAndStyleLayers(e);break;case r.LayerType.WMS:i=V.getSourcesAndStyleLayers(e);break;case r.LayerType.webTile:i=k.getSourcesAndStyleLayers(e);break;case r.LayerType.IGSFeature:case r.LayerType.GeoJSON:case r.LayerType.WFS:i=$(e,t);break;case r.LayerType.graphics:i=q(e,t);break;case r.LayerType.IGSImage:i=ye.getSourcesAndStyleLayers(e);break;case r.LayerType.IGSImageTile:i=pe.getSourcesAndStyleLayers(e);break;default:r.Log.error("未支持的图层类型")}return i}function ne(e,t){const{sources:i,layers:r}=e,a=Object.entries(i);for(let e=0;e<a.length;e++){const i=a[e];t.addSource(i[0],i[1])}for(let e=0;e<r.length;e++)t.addLayer(r[e]);return!0}function se(e){return g.createCRSByLayer(e)}class oe{}oe.addIGSMapImageLayer=function(e,t){t=t||{};const i=e.layer,r=e.innerView;t.layerView=e;const a=oe.getSourcesAndStyleLayers(i,t);ne(a,r);const n=r.getLayer(a.layers[0].id);return n.sourceID=n.source,n},oe.getSourcesAndStyleLayers=function(e,t){t=t||{};const{layerView:i={}}=t,{extensionOptions:a={}}=e,{view:n}=i,s=`source_${e.id}`,o=`layer_${e.id}`;let l={layers:e.layers,format:e.imageFormat,size:`${e.imageWidth},${e.imageHeight}`,clientId:e.clientId,isAntialiasing:e.isAntialiasing,layerFilters:e.getFilters(),transparent:e.imageTransparent,tokenKey:e.tokenKey,tokenValue:e.tokenValue};if(n){!e.spatialReference.equals(n.spatialReference)&&(l.projectionSrs=n.spatialReference)}const c=Object(r.getIGSDynamicLayer)(e);c.length>0&&(l.dynamicLayers=c),l=Object.assign(l,a);const h=r.LayerBaseUrlRegExp.matchStringByRegExpNames(e.url,["IGSMapImageLayerV1","IGSMapImageLayerV1Wrong","IGSMapImageLayerV2"]),d=r.ServerUtil.getImage(h,l);let y=d.url;const m=r.UrlUtil.getStringFromObject(d.queryParameters);m&&(y+=`?${m}`);const f={method:e.httpMethod,headers:e.headers};"GET"!==e.httpMethod&&(f.data=d.queryParameters);const g=u(y,e.imageWidth,e.renderMode,null,f,t.clippingArea,void 0,e.extent),v=p(o,s,e,i),b={};return b[s]=g,{sources:b,layers:[v]}},oe.initAllRequestParams=function(e){const t={};return(e=Object(r.defaultValue)(e,{})).hasOwnProperty("layers")&&(t.layers=e.layers),e.hasOwnProperty("imageTransparent")&&(t.imageTransparent=e.imageTransparent),e.hasOwnProperty("isAntialiasing")&&null!==e.isAntialiasing&&void 0!==e.isAntialiasing&&(t.isAntialiasing=e.isAntialiasing),e.hasOwnProperty("tokenKey")&&e.hasOwnProperty("tokenValue")&&e.tokenValue&&(t[e.tokenKey]=e.tokenValue),"2.0"===e.igsVersion?(t.size=`${e.width},${e.height}`,t.format=e.format,t.f="image",e.hasOwnProperty("styles")&&(t.layerStyles=e.styles),e.hasOwnProperty("filters")&&e.filters&&(t.layerFilters=e.filters),e.hasOwnProperty("dynamicLayers")&&(t.dynamicLayers=JSON.stringify(e.dynamicLayers)),e.hasOwnProperty("projectionSrs")&&(t.projectionSrs=e.projectionSrs),e.hasOwnProperty("clientId")&&(t.clientId=e.clientId)):(t.w=e.width,t.h=e.height,t.f="png",e.hasOwnProperty("styles")&&t.push(`style=${e.styles}`),e.hasOwnProperty("filters")&&e.filters&&(t.filters=e.filters),e.hasOwnProperty("clientId")&&(t.guid=e.clientId)),t},oe.initLayerUrl=function(e,t,i){let a;a="2.0"===t.igsVersion?`${e}/image`:`${e}`;let n,s=oe.initAllRequestParams(t);if("POST"===t.httpMethod)s.bbox="0,0,0,0",n={url:a,data:s=Object.assign(s,i),method:t.httpMethod};else{a+="?bbox={bbox}";for(const e in s){a+=`&${e}=${s[e]}`}const e=r.UrlUtil.getStringFromObject(i);e&&(a+=`&${e}`),n={url:a,method:t.httpMethod}}return t.headers&&(n.headers=t.headers),n},oe.setVisible=function(e){l(e)},oe.setOpacity=function(e){h(e)},oe.refresh=function(e){e.innerView.removeLayer(e.innerLayer.id),e.innerView.removeSource(e.innerLayer.sourceID),e.innerLayer=oe.addIGSMapImageLayer(e,{})},oe.removeLayer=function(e){c(e)};var le=oe;class ce{}ce.addIGSVectorTileLayer=function(e,t){t=Object(r.defaultValue)(t,{});const{innerView:i,layer:a}=e,s=i.getStyle();let o=r.UrlUtil.getBaseUrlAndParams(a.url).params;Object(r.defined)(a.tokenKey)&&Object(r.defined)(a.tokenValue)&&(o[a.tokenKey]=a.tokenValue),e.queryParameters=o;const l=new n.a.RequestManager(function(e){const t=r.UrlUtil.getBaseUrlAndParams(e);t.params=Object.assign(t.params,o);let i=r.UrlUtil.getStringFromObject(t.params);return i&&(e+=`?${i}`),{url:e,method:"GET",headers:a.headers}});s.glyphs&&s.glyphs!==n.a.Style.DEFAULT_GLYPH_URL||(i.style.glyphManager.requestManager=l,i.style.glyphManager.setURL(a.style.glyphs),i.style.stylesheet.glyphs=a.style.glyphs),s.sprite||(i.style._loadSprite(a.style.sprite,l),i.style.stylesheet.sprite=a.style.sprite),ce.addSourcesAndLayers(e,t.callback)},ce.getStyle=function(e,t){const{innerView:i}=e,r=setInterval(()=>{i.isStyleLoaded()&&(clearInterval(r),t&&t instanceof Function&&t(i.getStyle()))},30)},ce.setVisible=function(e,t){const{layer:i,innerView:r}=e,{layers:a}=i.style;a.forEach(e=>{r.setLayoutProperty(e.id,"visibility",t?"visible":"none")})},ce.setOpacity=function(e,t){const{layer:i,innerView:r}=e,{layers:a}=i.style;a.forEach(e=>{const a=i._getBackupProperties(e.id,"opacities");a&&Object.keys(a).forEach(i=>{r.setPaintProperty(e.id,i,a[i]*t)})})},ce.initLayerUrl=function(e,t){return"1.0"===t.igsVersion?(e+="/{z}/{y}/{x}",t.tokenKey&&t.tokenValue&&(e+=`?${t.tokenKey}=${t.tokenValue}`)):(e=`${e}/tileImage/{z}/{y}/{x}?f=image`,t.tokenKey&&t.tokenValue&&(e+=`&${t.tokenKey}=${t.tokenValue}`)),e},ce.removeLayer=function(e){const t=e.layer.style.layers,i=e.layer.style.sources,r=e.innerView;for(let e=0;e<t.length;e++)r.getLayer(t[e].id)&&r.removeLayer(t[e].id);Object.keys(i).forEach(e=>{r.getSource(e)&&r.removeSource(e)})},ce.setPaintProperties=function(e,t,i){const{innerView:r}=e;r.getLayer(t)&&i instanceof Object&&Object.keys(i).forEach(e=>{r.setPaintProperty(t,e,i[e])})},ce.setLayoutProperties=function(e,t,i){const{innerView:r}=e;r.getLayer(t)&&i instanceof Object&&Object.keys(i).forEach(e=>{r.setLayoutProperty(t,e,i[e])})},ce.updateStyleLayer=function(e,t,i){const{opacity:r=1,visible:a=!0}=i;t.forEach(t=>{if(t.paint){Object.keys(t.paint).forEach(i=>{if(/opacity$/.test(i)&&(t.paint[i]*=r),e){e.style.getLayer(t.id)&&e.style.setPaintProperty(t.id,i,t.paint[i])}})}if(t.layout){Object.keys(t.layout).forEach(i=>{if(/visibility$/.test(i)&&(t.layout[i]=a&&"visible"===t.layout[i]?"visible":"none"),e){e.style.getLayer(t.id)&&e.style.setLayoutProperty(t.id,i,t.layout[i])}})}}),e&&e._update&&e._update(!0)},ce.addSourcesAndLayers=function(e,t){const{layer:i}=e,r=ce.getSourcesAndStyleLayers(i,{layerView:e}),{sources:a,layers:n}=r;Object.keys(a).forEach(t=>{a[t].decryptOptions=i.decryptOptions,ce._addSource(e,t,a[t])});for(let t=0;t<n.length;t++)ce._addLayer(e,n[t].id,n[t]);t&&t instanceof Function&&t(this._getInnerLayers(e))},ce._createStyleLayers=function(e,t){const i=(t=t||{}).layerView,r=JSON.parse(JSON.stringify(e.style.layers)),a=i?i._getLayerViewVisible():e.visible,n=i?i._getOpacity():e.opacity;return this.updateStyleLayer(null,r,{opacity:n,visible:a}),r},ce._createSources=function(e,t){let i=r.UrlUtil.getBaseUrlAndParams(e.url).params;Object(r.defined)(e.tokenKey)&&Object(r.defined)(e.tokenValue)&&(i[e.tokenKey]=e.tokenValue);const a=e.style.sources,n=g.createCRSByLayer(e),s=g.convertClippingArea(e.clippingArea),o={};return Object.keys(a).forEach(t=>{const l=a[t];l.clippingArea=s,l.crs=n;const[c,h]=r.TileInfoUtil.getLevelRangeByTileInfo(e.tileInfo);if(l.minzoom=c,l.maxzoom=h,l.requestParams={headers:e.headers,data:i},o[t]=l,l.bound){const t=new r.Extent({xmin:l.bound[0],ymin:l.bound[1],xmax:l.bound[2],ymax:l.bound[3]}),i=e.tileWidth||256,a=Math.max(t.xmax-t.xmin,t.ymax-t.ymin)/i,n=Object(r.getExtendExtentByPixel)(t,{extendPixel:100,resolution:a,outSpatialReference:new r.SpatialReference({wkid:4326})}),s=[n.xmin,n.ymin,n.xmax,n.ymax];s&&(l.bounds=s)}}),o},ce.getSourcesAndStyleLayers=function(e,t){return{sources:this._createSources(e,t),layers:this._createStyleLayers(e,t)}},ce._addLayer=function(e,t,i){e.innerView.getLayer(t)||e.innerView.addLayer(i)},ce._addSource=function(e,t,i){e.innerView.getSource(t)||e.innerView.addSource(t,i)},ce._getInnerLayers=function(e){const t=e.layer.style.layers,i=[];for(let r=0;r<t.length;r++)i.push(e.innerView.getLayer(t[r].id));return i};var he=ce;class ue{}ue.addIGSImageryTileLayer=function(e,t){t=t||{};const i=e.layer,r=e.innerView;t.layerView=e;const a=ue.getSourcesAndStyleLayers(i,t);ne(a,r);const n=r.getLayer(a.layers[0].id);return n.sourceID=n.source,n},ue.getSourcesAndStyleLayers=function(e,t){const i=(t=t||{}).layerView,a=`source_${e.id}`,n=`layer_${e.id}`;let s={tokenKey:e.tokenKey,tokenValue:e.tokenValue};const o=r.LayerBaseUrlRegExp.matchStringByRegExpNames(e.url,["IGSImageryTileLayerV2"]),l=r.ServerUtil.getTile(o,s);let c=l.url;const h=r.UrlUtil.getStringFromObject(l.queryParameters);h&&(c+=`?${h}`);const d={method:e.httpMethod,headers:e.headers};"GET"!==e.httpMethod&&(d.data=l.queryParameters);const y=u(c,e.tileInfo.getTileSize(),null,null,d,t.clippingArea),m=p(n,a,e,i),[f,v]=r.TileInfoUtil.getLevelRangeByTileInfo(e.tileInfo);y.minzoom=f,y.maxzoom=v,y.crs=g.createCRSByLayer(e);const b={};return b[a]=y,{sources:b,layers:[m]}},ue.initLayerUrl=function(e,t){return e=`${e}/tileImage/{z}/{y}/{x}?f=image`,t.tokenKey&&t.tokenValue&&(e+=`&${t.tokenKey}=${t.tokenValue}`),e},ue.setVisible=function(e){l(e)},ue.setOpacity=function(e){h(e)},ue.refresh=function(e){e.innerView.removeLayer(e.innerLayer.id),e.innerView.removeSource(e.innerLayer.sourceID),e.innerLayer=ue.addIGSTileLayer(e,{})},ue.removeLayer=function(e){c(e)};var pe=ue;class de{}de.addIGSImageryLayer=function(e,t){t=t||{};const i=e.layer,r=e.innerView;t.layerView=e;const a=de.getSourcesAndStyleLayers(i,t);ne(a,r);const n=r.getLayer(a.layers[0].id);return n.sourceID=n.source,n},de.getSourcesAndStyleLayers=function(e,t){t=t||{};const{extensionOptions:i={}}=e,a=`source_${e.id}`,n=`layer_${e.id}`,s=t.layerView;let o=Object.assign({imageWidth:e.imageWidth,imageHeight:e.imageHeight,imageFormat:e.format,tokenKey:e.tokenKey,tokenValue:e.tokenValue,tokenAttachType:e.tokenAttachType,httpMethod:e.httpMethod,renderMode:e.renderMode,interpolation:e.interpolation,renderingRule:e.rasterFunction,bandIds:e.bandIds},t);if(s&&s.view){!e.spatialReference.equals(s.view.spatialReference)&&(o.imageSR=s.view.spatialReference)}o=Object.assign(o,i);const l=r.LayerBaseUrlRegExp.matchStringByRegExpNames(e.url,["IGSImageryLayerV2"]),c=r.ServerUtil.getImage(l,o);let h=c.url;const d=r.UrlUtil.getStringFromObject(c.queryParameters);d&&(h+=`?${d}`);const y={method:e.httpMethod,headers:e.headers};"GET"!==e.httpMethod&&(y.data=c.queryParameters);const m=u(h,e.imageWidth,e.renderMode,null,y,t.clippingArea),f=p(n,a,e,s),g={};return g[a]=m,{sources:g,layers:[f]}},de.setVisible=function(e){l(e)},de.setOpacity=function(e){h(e)},de.refresh=function(e){e.innerView.removeLayer(e.innerLayer.id),e.innerView.removeSource(e.innerLayer.sourceID),e.innerLayer=de.addIGSImageryLayer(e,{})},de.removeLayer=function(e){c(e)};var ye=de;var me=class extends r.Evented{constructor(e){super(e),this.view=Object(r.defaultValue)(e.view,null),this.location=Object(r.defaultValue)(e.location,""),this.title=Object(r.defaultValue)(e.title,""),this.content=Object(r.defaultValue)(e.content,""),this.alignment=Object(r.defaultValue)(e.alignment,"bottom-center"),this.defaultButtons=Object(r.defaultValue)(e.defaultButtons,["toggle","close","zoom"]),this._popup=void 0,this._initPopup(),this._initDefaultClass()}_initPopup(){this._customPopup(),this.view._innerView.closePopupOnClick=!1}_initDefaultClass(){let e=!1;const t=document.head.getElementsByTagName("style");if(t)for(let i=0;i<t.length;i++)if(t[i].innerHTML.indexOf("styleDomString")>-1){e=!0;break}if(!e){const e=document.createElement("style");e.innerHTML="\n .zondy-popup__container{\n background-color: #fff;\n padding:0;\n border-radius: 10px;\n }\n .zondy-popup__tip-default{\n background-color: #fff;\n }\n .zondy-popup__header-default{\n padding: 8px;\n font-size: 18px;\n font-weight: 600;\n line-height: 20px;\n border-top-left-radius: 10px;\n border-top-right-radius: 10px;\n white-space: nowrap;\n }\n .zondy-popup__content-default{\n padding: 8px;\n }\n .zondy-popup__footer-default{\n }\n .zondy-popup__footer-division{\n border-top: 1px solid;\n }\n .zondy-popup__toggle-default,.zondy-popup__close-default{\n display: inline-block;width: 30px;text-align: center;\n }\n ",document.querySelector("head").append(e)}}_customPopup(){}open(e){this._popup?(this.close(),this._popup=void 0,this.openPopup(e)):this.openPopup(e)}openPopup(e){if(this.view=Object(r.defaultValue)(e.view,this.view),this.location=Object(r.defaultValue)(e.location,this.location),this.location.spatialReference.isGeographic?this._location=this.location:this._location=r.Projection.project(this.location,new r.SpatialReference({wkid:4326})),this.title=Object(r.defaultValue)(e.title,this.title),this.content=Object(r.defaultValue)(e.content,this.content),this.alignment=Object(r.defaultValue)(e.alignment,this.alignment),this.defaultButtons=Object(r.defaultValue)(e.defaultButtons,this.defaultButtons),!this.view._innerView)return void r.Log.info("没有视图引擎!");const t=this._contentUI(this.title,this.content);this._popup=new n.a.Popup({closeOnClick:!1,closeButton:!1,maxWidth:"1900px"}).setLngLat(this._location.coordinates).setDOMContent(t).addTo(this.view._innerView),this._popup.toggleClassName("highlighted");const i=this._popup._container.getElementsByClassName("mapboxgl-popup-content");for(let e=0;e<i.length;e++)i[e].style.padding="0",i[e].style.borderRadius="10px"}_contentUI(e,t){const i=this;let r=void 0;const a=function(e){const t=document.createElement("div");return t.innerHTML=e,t.childNodes};(r=document.createElement("div")).setAttribute("id",`${this.id}-popup-default`);const n=document.createElement("div");n.setAttribute("class","zondy-popup__header-default zondy-popup__header"),n.setAttribute("style","display: flex;");const s=a('<div class="zondy-popup__toggle-default zondy-popup__toggle">\n <svg aria-hidden="true" class="svg" fill="currentColor" height="16px" width="16px" viewBox="0 0 24 24" width="100%" xmlns="http://www.w3.org/2000/svg"><path d="M5 13.793l7-7 7 7v1.414l-7-7-7 7z"></path></svg>\n </div>')[0],o=a('<div class="zondy-popup__close-default zondy-popup__close">\n <svg aria-hidden="true" class="svg" fill="currentColor" height="16px" width="16px" viewBox="0 0 16 16" width="100%" xmlns="http://www.w3.org/2000/svg"><path d="M3.98 11.303L7.281 8 3.98 4.697l.707-.707L7.99 7.293l.01-.01.01.01 3.304-3.303.707.707L8.718 8l3.303 3.303-.707.707L8.01 8.707l-.01.01-.01-.01-3.304 3.303z"></path></svg>\n </div>')[0];if(e||""===e){const t=a('<div style="flex: 1;"></div>')[0];if(n.appendChild(t),"object"==typeof e?e instanceof Node?t.appendChild(e):e instanceof NodeList&&e.forEach(e=>{t.appendChild(e)}):t.innerHTML=e,this.defaultButtons.indexOf("toggle")>-1){n.appendChild(s);let e=!0;s.onclick=function(){e=!e,document.getElementById(`${i.id}-popup-default`).querySelector(".zondy-popup__content-default").style.display=e?"block":"none"}}this.defaultButtons.indexOf("close")>-1&&(n.appendChild(o),o.onclick=(()=>{this.close()}))}const l=document.createElement("div");if(l.setAttribute("class","zondy-popup__content-default zondy-popup__content"),t)if("object"==typeof t){if(t instanceof Node)l.appendChild(t);else if(t instanceof NodeList)for(let e=0;e<t.length;e++)l.appendChild(t[e]),e--}else l.innerHTML=t;const c=document.createElement("div");c.setAttribute("class","zondy-popup__footer-default zondy-popup__footer");const h=a('<div class="zondy-popup__zoom" style="display: inline-block;width: 36px;height: 36px;line-height: 36px;text-align: center;">\n <svg class="svg" fill="currentColor" height="16px" width="16px" viewBox="0 0 16 16" width="100%" xmlns="http://www.w3.org/2000/svg"><path d="M9 7H7v2H6V7H4V6h2V4h1v2h2zm6.805 7.861l-.943.942a.665.665 0 0 1-.943 0l-3.067-3.067a.667.667 0 0 1 0-.943l.129-.13-1.108-1.107A5.279 5.279 0 1 1 11.8 6.5a5.251 5.251 0 0 1-1.237 3.366l1.108 1.108.124-.124a.668.668 0 0 1 .943 0l3.067 3.068a.666.666 0 0 1 0 .943zM10.8 6.5a4.3 4.3 0 1 0-4.3 4.3 4.304 4.304 0 0 0 4.3-4.3zm4.062 7.89l-2.595-2.598-.473.473 2.597 2.595z"></path></svg>\n </div>')[0];return this.defaultButtons.indexOf("zoom")>-1&&(c.appendChild(h),h.onclick=function(){i.view.flyTo({zoom:i.view._zoom+1,center:i.location})}),c.childNodes.length>0&&c.setAttribute("class","zondy-popup__footer-division zondy-popup__footer-default zondy-popup__footer"),r.appendChild(n),r.appendChild(l),r.appendChild(c),r}_getOffset(){}_getOffsetByAlignment(e,t,i){let r=0,a=0;switch(e){case"top-left":r=t/2,a=i;break;case"top-center":a=i;break;case"top-right":r=-t/2,a=i;break;case"bottom-left":r=t/2;break;case"auto":case"bottom-center":break;case"bottom-right":r=-t/2}return{x:r,y:a}}close(){this.view._innerView&&this._popup.remove()}destroy(){}};var fe=class{constructor(e){e=Object(r.defaultValue)(e,{}),this.view=Object(r.defaultValue)(e.view,null),this.format=Object(r.defaultValue)(e.format,r.PictureFormat.PNG),this.filename=Object(r.defaultValue)(e.filename,"screenshotFile"),this.width=Object(r.defaultValue)(e.width,void 0),this.height=Object(r.defaultValue)(e.height,void 0),this.x=Object(r.defaultValue)(e.x,0),this.y=Object(r.defaultValue)(e.y,0),this.isDownload=Object(r.defaultValue)(e.isDownload,!0)}_addView(){const e=this,t=this.view._innerView.getCanvas();let i=null;this.format===r.PictureFormat.PNG?i=t.toDataURL():this.format===r.PictureFormat.JPEG?i=t.toDataURL("image/jpeg"):"svg"===this.format&&(i=t.toDataURL());const a=document.createElement("canvas");a.width=this.width,a.height=this.height;const n=a.getContext("2d"),s=function(e,t){const i=document.createElement("a");i.href=e,i.download=t,document.body.appendChild(i),i.click()};return new Promise(t=>{if(this.width&&this.height){const o=new Image;o.src=i,o.onload=function(){n.drawImage(o,e.x,e.y,e.width,e.height,0,0,e.width,e.height);let i=null;e.format===r.PictureFormat.PNG?i=a.toDataURL():e.format===r.PictureFormat.JPEG?i=a.toDataURL("image/jpeg"):"svg"===e.format&&(i=a.toDataURL()),e.isDownload&&s(i,e.filename),t({dataUrl:i})}}else e.isDownload&&s(i,this.filename),t({dataUrl:i})})}_removeView(){}};var ge=class extends r.LayerView{onAdd(){const e=this.layer;return this.innerLayer=le.addIGSMapImageLayer(this,{clippingArea:g.convertClippingArea(e.clippingArea)}),this.innerLayer.commonLayerId=e.id,Promise.resolve(this)}onRemove(){return le.removeLayer(this),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"scaleVisible":case"minScale":case"maxScale":case"visible":le.setVisible(this);break;case"opacity":le.setOpacity(this);break;case"sublayerVisible":case"refresh":le.refresh(this);break;case"clippingArea":{const e=i.params[0],t=this.innerLayer.source,r=this.innerView.getSource(t);r&&r.setClippingArea(g.convertClippingArea(e));break}case"extensionOptions":if(this.innerLayer){const e=this.layer.extensionOptions||{};Object.entries(e).forEach(([e,t])=>{this.innerLayer[e]=t})}}}return Promise.resolve(this)}};var ve=class extends r.LayerView{onAdd(){const{layer:e}=this;return this.innerLayer=b.addIGSTileLayer(this),this.innerLayer.commonLayerId=e.id,Promise.resolve(this)}onRemove(){return b.removeLayer(this),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"scaleVisible":case"minScale":case"maxScale":case"visible":b.setVisible(this);break;case"opacity":b.setOpacity(this);break;case"refresh":b.refresh(this);break;case"clippingArea":{const e=i.params[0],t=this.innerLayer.source,r=this.innerView.getSource(t);r&&r.setClippingArea(g.convertClippingArea(e));break}case"extensionOptions":if(this.innerLayer){const e=this.layer.extensionOptions||{};Object.entries(e).forEach(([e,t])=>{this.innerLayer[e]=t})}}}return Promise.resolve(this)}};var be=class extends r.LayerView{onAdd(){const e=this.layer,t=this._getLayerViewVisible();return this.innerLayer=V.addWMSLayer(this,{visible:t,clippingArea:g.convertClippingArea(e.clippingArea)}),this.innerLayer.commonLayerId=e.id,Promise.resolve(this)}onRemove(){return V.removeLayer(this),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"scaleVisible":case"minScale":case"maxScale":case"visible":V.setVisible(this,i);break;case"opacity":V.setOpacity(this);break;case"refresh":case"sublayerVisible":V.refresh(this);break;case"clippingArea":{const e=i.params[0],t=this.innerLayer.source,r=this.innerView.getSource(t);r&&r.setClippingArea(g.convertClippingArea(e));break}case"extensionOptions":if(this.innerLayer){const e=this.layer.extensionOptions||{};Object.entries(e).forEach(([e,t])=>{this.innerLayer[e]=t})}}}return Promise.resolve(this)}};var _e=class extends r.LayerView{onAdd(){const e=this.layer;return this.innerLayer=M.addWMTSLayer(this,{clippingArea:g.convertClippingArea(e.clippingArea)}),this.innerLayer.commonLayerId=e.id,Promise.resolve(this)}onRemove(){return M.removeLayer(this),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"scaleVisible":case"minScale":case"maxScale":case"visible":M.setVisible(this);break;case"opacity":M.setOpacity(this);break;case"refresh":M.refresh(this);break;case"clippingArea":{const e=i.params[0],t=this.innerLayer.source,r=this.innerView.getSource(t);r&&r.setClippingArea(g.convertClippingArea(e));break}case"extensionOptions":if(this.innerLayer){const e=this.layer.extensionOptions||{};Object.entries(e).forEach(([e,t])=>{this.innerLayer[e]=t})}}}return Promise.resolve(this)}};var Se=class extends r.BaseGraphicsLayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this,a=t.extensionOptions||{},n=Object.assign({id:t.id,opacity:this._getOpacity(),visible:this._getLayerViewVisible()},a);return r.innerLayer=new Z(n),r.innerLayer.onAdd(i).then(()=>{const e=t.graphics.items||[];return r.innerLayer.commonLayerId=t.id,r._addFeature(r.innerLayer,e),Promise.resolve(this)})}onRemove(e){return this.innerLayer.onRemove(this.innerView),this.innerLayer=null,Promise.resolve(this)}onUpdate(e){this.layer;const t=this.innerLayer;return e.updateContent&&t&&e.updateContent.forEach(e=>{if(e&&"property"===e.operationType)switch(e.name){case"opacity":t.opacity=this._getOpacity();break;case"scaleVisible":case"minScale":case"maxScale":case"visible":{const i=this._getLayerViewVisible("scaleVisible"===e.name);t.visible=i;break}}if(e&&"method"===e.operationType)switch(e.name){case"add":{const i=e.params;this._addFeature(t,i[0]);break}case"remove":{const i=e.params;this._removeFeature(t,i[0]);break}case"addMany":{let i=e.params[0];i instanceof r.FeatureSet&&(i=i.features),this._addFeature(t,i);break}case"removeMany":{const i=e.params[0];this._removeFeature(t,i);break}case"removeAll":t.removeAll();break;case"extensionOptions":if(this.innerLayer){const e=this.layer.extensionOptions||{};Object.entries(e).forEach(([e,t])=>{this.innerLayer[e]=t})}}}),Promise.resolve(this)}_addFeature(e,t){const i=Array.isArray(t)?t:[t];i.forEach(()=>{t.geometry&&!t.geometry.spatialReference&&(t.geometry.spatialReference=this.layer.spatialReference)}),this.render.drawFeature(e,i)}_removeFeature(e,t){const i=Array.isArray(t)?t:[t];this.render.clearFeature(e,i)}};var xe=class extends r.FeatureRender{drawFeature(e,t){e&&e.add(t)}updateFeature(e,t,i){e&&e.update(t,i)}clearFeature(e,t){e&&e.remove(t)}clear(e){e&&e.removeAll()}};var we=class extends r.LayerView{onAdd(){return this._layerViewVisible=this._getLayerViewVisible(),he.addIGSVectorTileLayer(this,{callback:e=>{for(let t=0;t<e.length;t++)e[t].commonLayerId=this.layer.id;this.innerLayer=e}}),Promise.resolve(this)}onRemove(){return he.removeLayer(this),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t],{params:r}=i;if(i)switch(i.name){case"setPaintProperties":he.setPaintProperties(this,r[0],r[1]);break;case"setLayoutProperties":he.setLayoutProperties(this,r[0],r[1]);break;case"sublayerUpdate":this._updateStyle(this.innerView,JSON.parse(JSON.stringify(r[0])));break;case"opacity":case"setStyleLayer":case"deleteStyleLayer":case"refresh":this._updateStyle(this.innerView,JSON.parse(JSON.stringify(this.layer.style.layers)));break;case"scaleVisible":case"minScale":case"maxScale":case"visible":const e=this._getLayerViewVisible("scaleVisible"===i.name);this._layerViewVisible!==e&&(this._updateStyle(this.innerView,JSON.parse(JSON.stringify(this.layer.style.layers))),this._layerViewVisible=e);break;case"clippingArea":{const e=i.params[0],t=this.innerView,r=this.layer.style.sources;r&&Object.entries(r).forEach(i=>{const r=i[0],a=t.getSource(r);a&&"vector"===a.type&&a.setClippingArea&&a.setClippingArea(g.convertClippingArea(e))});break}case"extensionOptions":if(this.innerLayer){const e=this.layer.extensionOptions||{};Object.entries(e).forEach(([e,t])=>{this.innerLayer[e]=t})}}}return Promise.resolve(this)}_updateStyle(e,t){const i=this._getOpacity(),r=this._getLayerViewVisible();he.updateStyleLayer(e,t,{opacity:i,visible:r})}};var Le=class extends r.BaseRendererLayerView{constructor(e){super(e),this.styleLayers=[]}onAdd(e){const t=this.layer.renderer;this.renderType=t.type,this.sourceIds=[],this.initialized=!1,this._imageSourceManager=this._imageSourceManager?this._imageSourceManager:new E(this.innerView);const i=this._addInnerLayer();return i.then(()=>{this.initialized=!0,this._updateState()}),i}onRemove(e){return super.onRemove(e),this._removeStyleLayers(),this._removeSources(),Promise.resolve(this)}onUpdate(e){const t=this;return e.updateContent&&e.updateContent.forEach(e=>{if(e&&"property"===e.operationType)switch(e.name){case"opacity":t._updateState();break;case"scaleVisible":case"minScale":case"maxScale":case"visible":t._updateState();break;case"extensionOptions":if(this.innerLayer){const e=this.layer.extensionOptions||{};Object.entries(e).forEach(([e,t])=>{this.innerLayer[e]=t})}}if(e&&"method"===e.operationType)switch(e.name){case"refresh":this._updateState()}}),Promise.resolve(this)}_requestMapboxglFrameUpdate(e){this.innerView&&this.innerView._update(e)}_processData(){return new Promise(e=>{})}_addInnerLayer(){return this._processData().then(e=>{const t=this.layer,i=this.innerView;this.featureSet=e;const r=t.renderer;return this._initInnerLayer(t,i,e,r)})}_initInnerLayer(e,t,i,r){const a=this;return new Promise(e=>{let i;const r=()=>{a._addSources(),e(a),i&&clearInterval(i)};t.loaded()?r():(t.once("load",r),i=setInterval(()=>{t.loaded()&&r()},16))})}_rendererChangeAction(e){e&&this._updateState()}_updateState(e){const{innerView:t,layer:i}=this;if(!t||!this.styleLayers||!this.initialized)return;e||(e=i.renderer);const a=this._getOpacity(),n=this._getLayerViewVisible(),s=t.style;F(function(e){const t=[];if(!e)return t;switch(e.type){case r.RendererType.simple:t.push(e.symbol);break;case r.RendererType.classBreak:t.push(e.defaultSymbol),e.classBreakInfos.forEach(e=>{t.push(e.symbol)});break;case r.RendererType.uniqueValue:t.push(e.defaultSymbol),e.uniqueValueInfos.forEach(e=>{t.push(e.symbol)});break;case r.RendererType.rank:t.push(e.symbol);break;case r.RendererType.random:break;case r.RendererType.cluster:t.push(e.defaultSymbol),e.clusterInfos.forEach(e=>{t.push(e.symbol)});break;default:r.Log.error("未定义的Renderer类型")}return t}(e),this._imageSourceManager).then(()=>{const r=this.styleLayers,o={featureSet:this.featureSet,imageSourceManager:this._imageSourceManager},l=N(i.id,e,i.geometryType,n,a,o);if(0===l.length)throw new Error("创建样式图层列表失败,请检查Renderer的类型是否支持!");let c=!1;if(e.type===this.renderType&&0!==this.styleLayers.length||(c=!0,"cluster"!==e.type&&"cluster"!==this.renderType||this._triggerSourceClusterChange("cluster"===e.type)),r.length>0&&!c){const e=r.length===l.length,t=r.every(e=>l.findIndex(t=>t&&e&&t.id===e.id&&t.type===e.type)>-1);e&&t||(c=!0)}if(c){let t=null;if(r.length>0){const e=s._order.indexOf(r[r.length-1].id);e>-1&&e+1<s._order.length&&(t=s._order[e+1])}return this._removeStyleLayers(),this._addStyleLayers(l,t),void(this.renderType=e.type)}this._updateStyleLayers(t,r,l)})}_updateStyleLayers(e,t,i){const r=e.style;let a=!1;for(let e=0;e<t.length;e++)for(let n=0;n<i.length;n++){const s=t[e],o=i[n];s.id===o.id&&r.hasLayer(o.id)&&JSON.stringify(s)!==JSON.stringify(o)&&(o.paint&&Object.keys(o.paint).forEach(e=>{r.setPaintProperty(o.id,e,o.paint[e])}),o.layout&&Object.keys(o.layout).forEach(e=>{r.setLayoutProperty(o.id,e,o.layout[e])}),o.filter&&r.setFilter(o.id,o.filter),a=!0)}a&&(this._requestMapboxglFrameUpdate(!0),this.styleLayers=i)}_convertSourceData(e){const t={type:"FeatureCollection",features:[]};return e.features.forEach(e=>{Object(r.defined)(e.geometry)?t.features.push(g.convertToGeoJSON(e)):r.Log.warning("要素几何信息缺失,无法绘制要素:",e)}),t}_addStyleLayers(e,t){const{innerView:i}=this;i._lazyInitEmptyStyle(),e.forEach(e=>{i.style.addLayer(e,t)}),this.styleLayers=e,this._requestMapboxglFrameUpdate(!0)}_removeStyleLayers(){const e=this.innerView;for(let t=0;t<this.styleLayers.length;t++){const i=this.styleLayers[t].id;if(e.style.hasLayer(i)){if(e.overlayLayersManager[i])return e._removeLayer(e.overlayLayersManager[i]),delete e.overlayLayersManager[i],this;e.style.removeLayer(i)}}this._requestMapboxglFrameUpdate(!0),this.styleLayers=[]}_addSources(){const e=this.layer,t=e.renderer,i={type:"geojson",data:this._convertSourceData(this.featureSet)};t instanceof r.ClusterRenderer&&(i.cluster=!0,i.clusterRadius=t.radius),this.innerView.addSource(e.id,i),this.sourceIds.push(e.id)}_removeSources(){for(let e=0;e<this.sourceIds.length;e++)this.innerView.removeSource(this.sourceIds[e]);this.sourceIds=[]}_triggerSourceClusterChange(e){const t=this.innerView,i=this.layer,r=t.getSource(i.id);if(!r)return;const a=r.workerOptions||{};a.cluster=e;const n=a.superclusterOptions||{};e&&(n.radius=16*i.renderer.radius),r.setData(this._convertSourceData(this.featureSet))}getStyleLayerIds(){return this.styleLayers.map(e=>e.id)}};class Me{}Me.addIGSVectorLayer=function(e,t){t=t||{};const i=e.layer,r=e.innerView;t.layerView=e;const a=Me.getSourcesAndStyleLayers(i,t);ne(a,r);const n=r.getLayer(a.layers[0].id);return n.sourceID=n.source,n},Me.getSourcesAndStyleLayers=function(e,t){const i=(t=t||{}).layerView,a=r.EPSG.find(e=>e.id===i.view.spatialReference.wkid);let n={igsVersion:e._igsVersion,tokenKey:e.tokenKey,tokenValue:e.tokenValue,gdbps:[e.gdbp],filters:e.definitionExpression?`0:${e.definitionExpression}`:"",headers:e.headers,projectionSrs:Object(r.getProjectionSrs)(i.view.spatialReference),proj:a?a.name:""};const{extensionOptions:s={}}=e;n=Object.assign(n,s);const o=`source_${e.id}`,l=`layer_${e.id}`,c=Me.initLayerUrl(e.url,n),h=u(c.url,256,null,null,c,t.clippingArea),d=p(l,o,e,i),[y,m]=r.TileInfoUtil.getLevelRangeByTileInfo(e.tileInfo);h.minzoom=y,h.maxzoom=m;const f={};return f[o]=h,{sources:f,layers:[d]}},Me.initLayerUrl=function(e,t,i){i=Object(r.defaultValue)(i,[]);const a=t.igsVersion,n=Object(r.getBaseUrl)(e);let s=`${n}/igs/rest/mrms/layers`;"2.0"===a&&(s=`${n}/igs/rest/services/system/ResourceServer/tempData/image`);const o=Me.initAllRequestParams(t);let l;if("POST"===t.httpMethod)o.bbox="0,0,0,0",i instanceof Array&&i.forEach(e=>{Object(r.defined)(e.key)&&Object(r.defined)(e.value)&&(o[e.key]=e.value)}),l={url:s,data:o,method:t.httpMethod};else{s+="?bbox={bbox}";for(const e in o){s+=`&${e}=${o[e]}`}l={url:s,method:t.httpMethod}}return t.headers&&(l.headers=t.headers),l},Me.initAllRequestParams=function(e){const t={};if("1.0"===e.igsVersion){const i=e.f||"png";t.f=i,e.gdbps&&(t.gdbps=e.gdbps),t.w=256,t.h=256,e.filters&&(t.filters=e.filters),e.style&&(t.style=JSON.stringify(e.style)),e.proj&&(t.proj=e.proj);const a=e.guid||Object(r.getGUID)();t.guid=a,void 0!==e.isAntialiasing&&null!==e.isAntialiasing&&(t.isAntialiasing=e.isAntialiasing),e.tokenKey&&e.tokenValue&&(t[e.tokenKey]=e.tokenValue)}else{const i=e.f||"image";t.f=i,e.gdbps&&(t.urls=e.gdbps),t.size="256,256",e.projectionSrs&&(t.projectionSrs=`${e.projectionSrs}`);const a=e.clientId||Object(r.getGUID)();t.clientId=a,void 0!==e.isAntialiasing&&null!==e.isAntialiasing&&(t.isAntialiasing=e.isAntialiasing),e.tokenKey&&e.tokenValue&&(t[e.tokenKey]=e.tokenValue)}return t},Me.setVisible=function(e){l(e)},Me.setOpacity=function(e){h(e)},Me.refresh=function(e){e.innerView.removeLayer(e.innerLayer.id),e.innerView.removeSource(e.innerLayer.sourceID),e.innerLayer=Me.addIGSVectorLayer(e,{})},Me.removeLayer=function(e){c(e)};var Te=Me;var Ve=class extends Le{_processData(){return this.layer._reloadFeatures()}onAdd(e){const t=this,i=this.layer;return"server"===i.renderMode?(this.innerLayer=Te.addIGSVectorLayer(this,{}),this.innerLayer.commonLayerId=i.id,Promise.resolve(t)):super.onAdd(e)}onUpdate(e){if("server"===this.layer.renderMode){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"scaleVisible":case"minScale":case"maxScale":case"visible":Te.setVisible(this,i);break;case"opacity":Te.setOpacity(this);break;case"refresh":Te.refresh(this);break;case"extensionOptions":if(this.innerLayer){const e=this.layer.extensionOptions||{};Object.entries(e).forEach(([e,t])=>{this.innerLayer[e]=t})}}}return Promise.resolve(this)}return super.onUpdate(e)}onRemove(e){const t=this;return"server"===this.layer.renderMode?(this.innerView.removeLayer(this.innerLayer.id),Promise.resolve(t)):super.onRemove(e)}};var Pe=class extends Le{_processData(){const e=this.layer;return Promise.resolve(e._source)}};var ke=class extends Le{_processData(){return this.layer.queryFeatures().then(e=>e)}};var Oe=class extends r.LayerView{onAdd(){const e=this.layer,t=this._getLayerViewVisible();return this.innerLayer=k.addWebTileLayer(this,{visible:t,clippingArea:g.convertClippingArea(e.clippingArea)}),this.innerLayer.commonLayerId=e.id,Promise.resolve(this)}onRemove(){return k.removeLayer(this),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"scaleVisible":case"minScale":case"maxScale":case"visible":k.setVisible(this,i);break;case"opacity":k.setOpacity(this);break;case"sublayerVisible":case"refresh":k.refresh(this);break;case"clippingArea":{const e=i.params[0],t=this.innerLayer.source,r=this.innerView.getSource(t);r?r.setClippingArea(g.convertClippingArea(e)):this.innerLayer.implementation&&this.innerLayer.implementation.type&&"custom"===this.innerLayer.implementation.type&&this.innerLayer.setClippingArea(g.convertClippingArea(e));break}case"extensionOptions":if(this.innerLayer){const e=this.layer.extensionOptions||{};Object.entries(e).forEach(([e,t])=>{this.innerLayer[e]=t})}}}return Promise.resolve(this)}};var Ee=class extends r.GroupLayerView{};class Ce{}Ce.addEchartsLayer=function(e,t){const{extensionOptions:i={}}=e;let a=Object.assign(e.echartsOptions,i);a=Object(r.deleteNullValue)(a);const n=new re(t,a).addTo(t);return n.id=e.id,n},Ce.removeLayer=function(e){e.remove()};var je=Ce;var Ie=class extends r.LayerView{onAdd(e){const t=this.layer,i=this.innerView;return this.innerLayer=je.addEchartsLayer(t,i),this.innerLayer.commonLayerId=t.commonLayerId,this._getLayerViewVisible()?this.innerLayer.show():this.innerLayer.hide(),Promise.resolve(this)}onRemove(e){return je.removeLayer(this.innerLayer),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"scaleVisible":case"minScale":case"maxScale":case"visible":this._getLayerViewVisible("scaleVisible"===i.name)?this.innerLayer.show():this.innerLayer.hide();break;case"opacity":this.innerLayer.setOpacity(this._getOpacity());break;case"extensionOptions":if(this.innerLayer){const e=this.layer.extensionOptions||{};Object.entries(e).forEach(([e,t])=>{this.innerLayer[e]=t})}}}return Promise.resolve(this)}};class Ae{}Ae.addMapVLayer=function(e,t){const{extensionOptions:i={}}=e;let a=Object.assign(e.mapVOptions,i);a=Object(r.deleteNullValue)(a);const n=new H(t,e.data,a);return n.id=e.id,n},Ae.removeLayer=function(e){e.remove()};var ze=Ae;var Re=class extends r.LayerView{onAdd(e){const t=this.layer,i=this.innerView;return this.innerLayer=ze.addMapVLayer(t,i),this.innerLayer.commonLayerId=t.id,this._getLayerViewVisible()?this.innerLayer.show():this.innerLayer.hide(),Promise.resolve(this)}onRemove(e){return ze.removeLayer(this.innerLayer),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"scaleVisible":case"minScale":case"maxScale":case"visible":this._getLayerViewVisible("scaleVisible"===i.name)?this.innerLayer.show():this.innerLayer.hide();break;case"opacity":this.innerLayer.setOpacity(this._getOpacity());break;case"extensionOptions":if(this.innerLayer){const e=this.layer.extensionOptions||{};Object.entries(e).forEach(([e,t])=>{this.innerLayer[e]=t})}}}return Promise.resolve(this)}};var De=class extends r.LayerView{onAdd(){const e=this.layer;return this.innerLayer=w.addArcGISMapImageLayer(this),this.innerLayer.commonLayerId=e.id,Promise.resolve(this)}onRemove(){return w.removeLayer(this),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"scaleVisible":case"minScale":case"maxScale":case"visible":w.setVisible(this,i);break;case"opacity":w.setOpacity(this);break;case"sublayerVisible":case"refresh":w.refresh(this);break;case"extensionOptions":if(this.innerLayer){const e=this.layer.extensionOptions||{};Object.entries(e).forEach(([e,t])=>{this.innerLayer[e]=t})}}}return Promise.resolve(this)}};var Ge=class extends r.LayerView{onAdd(){const{layer:e}=this;return this.innerLayer=S.addArcGISTileLayer(this,{clippingArea:g.convertClippingArea(e.clippingArea)}),this.innerLayer.commonLayerId=e.id,Promise.resolve(this)}onRemove(){return S.removeLayer(this),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"scaleVisible":case"minScale":case"maxScale":case"visible":S.setVisible(this);break;case"opacity":S.setOpacity(this);break;case"refresh":S.refresh(this);break;case"clippingArea":{const e=i.params[0],t=this.innerLayer.source,r=this.innerView.getSource(t);r&&r.setClippingArea(g.convertClippingArea(e));break}case"extensionOptions":if(this.innerLayer){const e=this.layer.extensionOptions||{};Object.entries(e).forEach(([e,t])=>{this.innerLayer[e]=t})}}}return Promise.resolve(this)}};var Ne=class extends r.LayerView{onAdd(){const{layer:e}=this;return this.innerLayer=ye.addIGSImageryLayer(this,{clippingArea:g.convertClippingArea(e.clippingArea)}),this.innerLayer.commonLayerId=e.id,Promise.resolve(this)}onRemove(){return ye.removeLayer(this),Promise.resolve(this)}onUpdate(e){if(!this.innerLayer)return Promise.resolve(this);if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"scaleVisible":case"minScale":case"maxScale":case"visible":ye.setVisible(this,i);break;case"opacity":ye.setOpacity(this);break;case"clippingArea":{const e=i.params[0],t=this.innerLayer.source,r=this.innerView.getSource(t);r&&r.setClippingArea(g.convertClippingArea(e));break}case"refresh":case"bandIds":case"interpolation":case"rasterFunction":ye.refresh(this);break;case"extensionOptions":if(this.innerLayer){const e=this.layer.extensionOptions||{};Object.entries(e).forEach(([e,t])=>{this.innerLayer[e]=t})}}}return Promise.resolve(this)}};var Fe=class extends r.LayerView{onAdd(){const{layer:e}=this;return this.innerLayer=pe.addIGSImageryTileLayer(this,{clippingArea:g.convertClippingArea(e.clippingArea)}),this.innerLayer.commonLayerId=e.id,Promise.resolve(this)}onRemove(){return pe.removeLayer(this),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"scaleVisible":case"minScale":case"maxScale":case"visible":pe.setVisible(this);break;case"opacity":pe.setOpacity(this);break;case"refresh":pe.refresh(this);break;case"clippingArea":{const e=i.params[0],t=this.innerLayer.source,r=this.innerView.getSource(t);r&&r.setClippingArea(g.convertClippingArea(e));break}case"extensionOptions":if(this.innerLayer){const e=this.layer.extensionOptions||{};Object.entries(e).forEach(([e,t])=>{this.innerLayer[e]=t})}}}return Promise.resolve(this)}};class Be{}Be.getMouseEvent=function(e,t,i){let a=void 0;return{mapPoint:a=t._spatialReference.isGeographic?new r.Point({coordinates:[e.lngLat.lng,e.lngLat.lat]}):r.Projection.project(new r.Point({coordinates:[e.lngLat.lng,e.lngLat.lat]}),new r.SpatialReference(t.crs.code)),x:e.point.x,y:e.point.y,button:e.originalEvent.button,buttons:e.originalEvent.buttons,stopPropagation:e.originalEvent.stopPropagation,timeStamp:e.originalEvent.timeStamp,native:e.originalEvent,innerViewerEvent:e,type:i}},Be.getKeyEvent=function(e,t,i){const r={key:e.originalEvent.key,stopPropagation:e.originalEvent.stopPropagation,timeStamp:e.originalEvent.timeStamp,native:e.originalEvent,innerViewerEvent:e,type:i};return"key-down"===i&&(r.repeat=e.originalEvent.repeat),r},Be.getViewChangeEvent=function(e,t,i){const r={event:e,innerViewerEvent:e,target:t,type:i};return r.mapView=t,r.scale=t._scale,r.zoom=t._zoom,r.center=t.center,r.extent=t._extent,r},Be.getDragEvent=function(e,t,i,r,a){return{x:e.originalEvent.layerX,y:e.originalEvent.layerY,button:void 0!==a?a:e.originalEvent.button,buttons:e.originalEvent.buttons,cancelable:e.originalEvent.cancelable,origin:i,stopPropagation:e.originalEvent.stopPropagation,timeStamp:e.originalEvent.timeStamp,native:e.originalEvent,action:r,innerViewerEvent:e,type:"drag"}},Be.getKeyEvent=function(e,t,i){const r={key:e.key,stopPropagation:e.stopPropagation,timeStamp:e.timeStamp,native:e,type:i};return"key-down"===i&&(r.repeat=e.repeat),r};var Ue=Be;class Ze extends r.MapView{constructor(e){if(super(e),e=Object(r.defaultValue)(e,{}),this._options=e,this._center=Object(r.isNull)(e.center)?void 0:r.Point.fromJSON(e.center),this._center&&Array.isArray(this._center)&&this._center.length>1&&(this._center=new r.Point({coordinates:[this._center[0],this._center[1]]})),this._extent=Object(r.isNull)(e.extent)?void 0:r.Extent.fromJSON(e.extent),this.width=void 0,this.height=void 0,this._zoom=Object(r.defaultValue)(e.zoom,void 0),this._scale=Object(r.defaultValue)(e.scale,void 0),this.maxScale=Object(r.defaultValue)(e.maxScale,void 0),this.minScale=Object(r.defaultValue)(e.minScale,void 0),this.minZoom=Object(r.defaultValue)(e.minZoom,void 0),this.maxZoom=Object(r.defaultValue)(e.maxZoom,void 0),this.popup=Object(r.defaultValue)(e.popup,void 0),this._referenceLayer=void 0,this.spatialReferenceLocked=Object(r.defaultValue)(e.spatialReferenceLocked,!1),this.stationary=!0,e.fullExtent){let t=r.Extent.fromJSON(e.fullExtent.toJSON());t.spatialReference.isGeographic||(t=r.Projection.project(t,new r.SpatialReference({wkid:4326}))),this._initFullExtent=t}this._fullExtent=this._initFullExtent,this._mapExtent=null,this._fireLoaded=!1,this._initView(!0,this._options)}_initView(e,t){const i=this;let a;if(n.a.accessToken="pk.eyJ1IjoiemtidWQiLCJhIjoiY2w5OGF2NXIyMzQ5bjNub2luem85Y2Z4OCJ9.uX09XQPOX5E7sOohws2l_Q",e&&t){let e;a={center:e=Object(r.isNull)(t.center)&&Object(r.isNull)(t.extent)?new r.Point({coordinates:[0,0]}):Object(r.isNull)(t.center)?void 0:r.Point.fromJSON(t.center),scale:t.scale,zoom:Object(r.isNull)(t.scale)&&Object(r.isNull)(t.zoom)?0:t.zoom,target:Object(r.isNull)(t.extent)?void 0:r.Extent.fromJSON(t.extent)},this.minScale=Object(r.defaultValue)(t.minScale,void 0),this.maxScale=Object(r.defaultValue)(t.maxScale,void 0),this.minZoom=Object(r.defaultValue)(t.minZoom,void 0),this.maxZoom=Object(r.defaultValue)(t.maxZoom,void 0)}else this._zoom=void 0,this._extent=void 0,a={center:this._center,scale:this._scale};let{center:s,zoom:o,extent:l}=this._getValidGoToParams(a);Object(r.isNull)(s)||Object(r.isNull)(o)?Object(r.isNull)(l)||(this._extent=l):(this._center=s,this._zoom=o);let c=void 0;if(e&&!Object(r.isNull)(this._extent)){const e=r.Projection.project(this._extent,new r.SpatialReference({wkid:4326}));c=[[e.xmin,e.ymin],[e.xmax,e.ymax]]}const h={crs:this.crs,container:this._viewId,style:{version:8,sources:{},layers:[{id:Object(r.getGUID)(),type:"background",paint:{"background-color":"rgba(255, 255, 255,1)"}}]},bounds:c,preserveDrawingBuffer:!0};return Object(r.isNull)(this._zoom)||(h.zoom=this._zoom),Object(r.isNull)(this._center)||Object(r.isNull)(this._center.coordinates)||(h.center=this._center.coordinates),Object.keys(this.extensionOptions).forEach(e=>{"crs"!==e&&"container"!==e&&("object"==typeof this.extensionOptions[e]&&"object"==typeof h[e]?h[e]=Object.assign(h[e],this.extensionOptions[e]):h[e]=this.extensionOptions[e])}),this._innerView=new n.a.Map(h),this.engineType=r.EngineType.mapboxgl,this._initViewEvent(),this._initSize(),this._initScaleLimit(),this._initPopup(),this._initCursor(),this._updateMaxBounds(),new Promise(t=>{function a(e,a){e._zoomEndHandler(),e._fireLoaded||(e.fire(r.ViewEventType.loaded,{}),e._fireLoaded=!0),t(i)}i._innerView.loaded()?Promise.resolve().then(()=>{a(this,e)}):i._innerView.once("load",()=>{a(this,e)})})}_initScaleLimit(){if(Object(r.isNull)(this._options.minScale))if(Object(r.isNull)(this._options.minZoom)){const e=this._innerView.getMinZoom();isFinite(e)?(this.minScale=this._getScaleByZoom(e),this.minZoom=e):(this.minScale=void 0,this.minZoom=void 0)}else this.minZoom=this._options.minZoom,this.minScale=this._getScaleByZoom(this.minZoom),this._innerView.setMinZoom(this.minZoom);else if(this.minScale>0){const e=this._getZoomByScale(this.minScale);void 0!==e&&this._innerView.setMinZoom(e),this.minZoom=e}else this.minZoom=void 0,this.minScale=0,this._innerView.setMinZoom(void 0);if(void 0!==this._options.maxScale)if(this.maxScale>0){const e=this._getZoomByScale(this.maxScale);void 0!==e&&this._innerView.setMaxZoom(e),this.maxZoom=e}else this.maxScale<=0&&(this.maxZoom=void 0,this.maxScale=0,this._innerView.setMaxZoom(void 0));else if(Object(r.isNull)(this._options.maxZoom)){let e=this._innerView.getMaxZoom();const t=((this.crs||{}).options||{}).lods;t&&Array.isArray(t)&&e>=t.length-1&&(e=t.length-1,this._innerView.setMaxZoom(e)),isFinite(e)?(this.maxScale=this._getScaleByZoom(e),this.maxZoom=e):(this.maxScale=void 0,this.maxZoom=void 0)}else this.maxZoom=this._options.maxZoom,this.maxScale=this._getScaleByZoom(this.maxZoom),this._innerView.setMaxZoom(this.maxZoom);!this._scale||this._scale<=0?this._scale=this.minScale:this._scale>this.minScale?this._scale=this.minScale:this._scale<this.maxScale&&(this._scale=this.maxScale)}_createCrsObject(e){if(!(e.spatialReference&&e.origin&&e.lods&&e.extent))return;let t;if(e.spatialReference.wkid){const i=r.Projection.getEPSGByWKID(e.spatialReference.wkid);i&&(t=i.strProject)}else e.spatialReference.wkt&&(t=e.spatialReference.wkt);const i=[e.extent.xmin,e.extent.ymin,e.extent.xmax,e.extent.ymax],a=`EPSG:${e.spatialReference.wkid}`,n=t,s={},o={};e.lods.forEach(e=>{s[e.level]=e.resolution,o[e.level]=e.levelValue});const l=new y(a,n,{levelValues:o,resolutions:s,origin:e.origin,tileSize:e.tileSize,bounds:i,unit:e.spatialReference.isGeographic?"degree":void 0});return l.options=e,l}_reCreateView(e){return this._innerView&&(this._innerView._animatingZoom=!1,this._innerView.remove()),e?this._initView(!0,this._options):this._initView(!1)}_isEqualBounds(e,t){let i=!0;if(e&&t&&Array.isArray(e)&&Array.isArray(t)&&e.length===t.length){for(const r in e)if(e[r]!==t[r]){i=!1;break}}else i=!!(!e&&!t||Array.isArray(e)&&0===e.length&&Array.isArray(t)&&0===t.length);return i}_initViewEvent(){const e=this;this._clickStore=null,this._dragParams={isDrag:!1,origin:null,action:"",button:null},this._innerView.on("click",t=>{e._clickStore=setTimeout(function(){e._clickStore&&e.fire(r.ViewEventType.click,Ue.getMouseEvent(t,e))},300),e.fire(r.ViewEventType.immediateClick,Ue.getMouseEvent(t,e))}),this._innerView.on("contextmenu",t=>{e._clickStore=setTimeout(function(){e._clickStore&&e.fire(r.ViewEventType.click,Ue.getMouseEvent(t,e))},300),e.fire(r.ViewEventType.immediateClick,Ue.getMouseEvent(t,e))}),this._innerView.on("dblclick",t=>{e._clickStore&&(clearTimeout(this._clickStore),e._clickStore=null),e.fire(r.ViewEventType.doubleClick,Ue.getMouseEvent(t,e))}),this._innerView.on("mousedown",t=>{e.fire(r.ViewEventType.pointerDown,Ue.getMouseEvent(t,e)),this._dragParams.isDrag||(this._dragParams.origin={x:t.originalEvent.layerX,y:t.originalEvent.layerY},this._dragParams.button=t.originalEvent.button,this._dragParams.action="mouse-down",this._dragParams.isDrag=!1)}),this._innerView.on("mouseup",t=>{e.fire(r.ViewEventType.pointerUp,Ue.getMouseEvent(t,e)),e._dragParams.isDrag&&"update"===this._dragParams.action&&(this._dragParams.action="end",e.fire(r.ViewEventType.drag,Ue.getDragEvent(t,e,e._dragParams.origin,this._dragParams.action))),e._dragParams={isDrag:!1,origin:null,action:"",button:null}}),this._innerView.on("mousemove",t=>{e.fire(r.ViewEventType.pointerMove,Ue.getMouseEvent(t,e)),e._dragParams.isDrag?(e.fire(r.ViewEventType.drag,Ue.getDragEvent(t,e,e._dragParams.origin,e._dragParams.action,e._dragParams.button)),e._dragParams.action="update"):"mouse-down"===this._dragParams.action&&(this._dragParams.action="start",e._dragParams.isDrag=!0)}),this._innerView.on("dragstart",t=>{""===this._dragParams.action&&t.originalEvent&&(this._dragParams.origin={x:t.originalEvent.layerX,y:t.originalEvent.layerY},this._dragParams.action="start",e.fire(r.ViewEventType.drag,Ue.getDragEvent(t,e,this._dragParams.origin,this._dragParams.action)))}),this._innerView.on("drag",t=>{"start"!==e._dragParams.action&&"update"!==e._dragParams.action||(this._dragParams.action="update",e.fire(r.ViewEventType.drag,Ue.getDragEvent(t,e,this._dragParams.origin,this._dragParams.action)))}),this._innerView.on("dragend",t=>{"start"!==e._dragParams.action&&"update"!==e._dragParams.action||(this._dragParams.action="end",e.fire(r.ViewEventType.drag,Ue.getDragEvent(t,e,this._dragParams.origin,this._dragParams.action)),e._dragParams={origin:null,action:"",button:null})}),this._innerView.on("rotatestart",t=>{""===this._dragParams.action&&t.originalEvent&&(this._dragParams.origin={x:t.originalEvent.layerX,y:t.originalEvent.layerY},this._dragParams.action="start",e.fire(r.ViewEventType.drag,Ue.getDragEvent(t,e,this._dragParams.origin,this._dragParams.action)))}),this._innerView.on("rotate",t=>{"start"!==e._dragParams.action&&"update"!==e._dragParams.action||(this._dragParams.action="update",e.fire(r.ViewEventType.drag,Ue.getDragEvent(t,e,this._dragParams.origin,this._dragParams.action)))}),this._innerView.on("rotateend",t=>{"start"!==e._dragParams.action&&"update"!==e._dragParams.action||(this._dragParams.action="end",e.fire(r.ViewEventType.drag,Ue.getDragEvent(t,e,this._dragParams.origin,this._dragParams.action)),e._dragParams={origin:null,action:"",button:null})}),this._innerView.on("movestart",()=>{e.stationary=!1}),this._innerView.on("zoom",t=>{e.fire(r.ViewEventType.zoom,{zoom:t.target._zoom,event:t})}),this._innerView.on("zoomend",t=>{e._zoomEndHandler(),e.fire(r.ViewEventType.viewChange,Ue.getViewChangeEvent(t,e))}),this._innerView.on("moveend",t=>{e._moveEndHandler(),e.fire(r.ViewEventType.viewChange,Ue.getViewChangeEvent(t,e)),e.stationary=!0}),this._innerView.on("resize",t=>{const i=Number(e.width),a=Number(e.height);e._initSize(),this._updateMaxBounds(),e.fire(r.ViewEventType.resize,{oldWidth:i,oldHeight:a,width:e.width,height:e.height})}),this._listenKey()}_mapActionControl(e,t){this._innerView&&("drag-pan"===e?t?this._innerView.dragPan.enable():this._innerView.dragPan.disable():"double-click-zoom"===e?t?this._innerView.doubleClickZoom.enable():this._innerView.doubleClickZoom.disable():"drag-rotate"===e&&(t?this._innerView.dragRotate.enable():this._innerView.dragRotate.disable()))}_listenKey(){const e=this,t=this._innerView._canvas;t.setAttribute("tabIndex","-1"),t.onclick=(()=>{t.focus()}),t.addEventListener("keydown",t=>{e.fire(r.ViewEventType.keyDown,Ue.getKeyEvent(t,e))}),t.addEventListener("keyup",t=>{e.fire(r.ViewEventType.keyUp,Ue.getKeyEvent(t,e))})}_initSize(){const e=this._innerView.getCanvas(),t=e.style?e.style.width:e.width,i=e.style?e.style.height:e.height;this.width=Number(t.toString().replace("px","")),this.height=Number(i.toString().replace("px",""))}_updateMaxBounds(){const e=this._getMaxBounds();this._innerView.setMaxBounds(e)}_setCursor(e){this._innerView&&(e&&null!==e?(this._innerView._container.style.cursor=e,this._innerView.getCanvasContainer().style.cursor=e):(this._innerView._container.style.removeProperty("cursor"),this._innerView.getCanvasContainer().style.removeProperty("cursor")),this._cursor=e)}_zoomEndHandler(){this.getExtent(),this.getZoom(),this.getScale(),this.getCenter(),this._updateLayerViewScaleVisible()}getSize(){return{width:this.width,height:this.height}}_moveEndHandler(){this.getCenter(),this.getExtent()}_createLayerViewObj(e){let t=null;return e&&e.autoAddTo2D&&(t=function(e,t){let i=null;switch(t.type){case r.LayerType.IGSMapImage:i=new ge({view:e,layer:t});break;case r.LayerType.IGSTile:i=new ve({view:e,layer:t});break;case r.LayerType.WMS:i=new be({view:e,layer:t});break;case r.LayerType.WMTS:i=new _e({view:e,layer:t});break;case r.LayerType.graphics:i=new Se({view:e,layer:t,render:new xe});break;case r.LayerType.IGSVectorTile:case r.LayerType.ArcGISVectorTile:i=new we({view:e,layer:t});break;case r.LayerType.IGSFeature:i=new Ve({view:e,layer:t});break;case r.LayerType.GeoJSON:i=new Pe({view:e,layer:t});break;case r.LayerType.WFS:i=new ke({view:e,layer:t});break;case r.LayerType.webTile:i=new Oe({view:e,layer:t});break;case r.LayerType.group:i=new Ee({view:e,layer:t});break;case r.LayerType.ECharts:i=new Ie({view:e,layer:t});break;case r.LayerType.MapV:i=new Re({view:e,layer:t});break;case r.LayerType.ArcGISMapImage:i=new De({view:e,layer:t});break;case r.LayerType.ArcGISTile:i=new Ge({view:e,layer:t});break;case r.LayerType.IGSImage:i=new Ne({view:e,layer:t});break;case r.LayerType.IGSImageTile:i=new Fe({view:e,layer:t})}return i}(this,e)),t}_initPopup(){this.popup=new me({view:this})}hitTest(e){if(!this._innerView)return;const t=[],i=this._getInnerStyleLayerIds();return this._innerView.queryRenderedFeatures([e.x,e.y],{layers:i}).forEach(i=>{if(!i.properties||void 0===i.properties.id||!i.layer||!i.layer.id)return;const a=i.source.split("_")[0],n=i.properties.id;let s=this.getLayer(a);if(!s&&this._graphicsLayers&&this._graphicsLayers.allLayers&&this._graphicsLayers.allLayers.items&&(s=this._graphicsLayers.allLayers.items.find(e=>e.id===a)),!s)return;let o=null;if(s.type===r.LayerType.IGSFeature||s.type===r.LayerType.GeoJSON||s.type===r.LayerType.WFS){const e=this._getLayerView(s);e.featureSet&&e.featureSet.features&&(o=e.featureSet.features.filter(e=>{if(e.id===n)return e}))}else if(s.type===r.LayerType.graphics&&s.graphics){o=s.graphics.filter(e=>{if(e.id===n)return e}).items}const l={graphic:o&&o.length>0?o[0]:null,layer:s,mapPoint:this.toMap(e),type:"graphic"};t.push(l)}),t}_getInnerStyleLayerIds(){let e=[];return this._map.allLayers.items.concat(this._graphicsLayers.allLayers.items).forEach(t=>{if(t.type===r.LayerType.IGSFeature||t.type===r.LayerType.GeoJSON){const i=this._getLayerView(t);i&&(e=e.concat(i.getStyleLayerIds()))}else if(t.type===r.LayerType.graphics){const i=this.getInnerLayer(t);i&&i.getStyleLayerIds&&(e=e.concat(i.getStyleLayerIds()))}}),e}toMap(e){if(!e)return;const t=this._innerView.unproject([e.x,e.y]);let i=new r.Point({coordinates:[t.lng,t.lat]});return this._spatialReference&&!this._spatialReference.isGeographic?i=r.Projection.project(i,this._spatialReference):i.spatialReference=this._spatialReference,i}toScreen(e){let t=r.Geometry.fromJSON(e);return t.spatialReference.isGeographic||(t=r.Projection.project(t,new r.SpatialReference({wkid:4326}))),this._innerView.project([t.coordinates[0],t.coordinates[1]])}takeScreenshot(e){e.view=this;let t=null;return this._screenshot?t=this._screenshot._addView():(this._screenshot=new fe(e),t=this._screenshot._addView()),t}flyTo(e,t={animate:!0}){e=Object(r.defaultValue)(e,{});const i=Object(r.defaultValue)(e.zoom,1),a=this._getFlyToCenter(e),n=this._getFlyToExtent(e);if(this._innerView){const e=this._innerView.transform;e.resetZoomScale=!1,a?(this._center=a,this._scale=this._getScaleByZoom(i),this._zoom=void 0,this._innerView.flyTo({center:[a.coordinates[0],a.coordinates[1]],zoom:i})):n&&(this._center=void 0,this._scale=void 0,this._zoom=void 0,this._extent=n,this._innerView.fitBounds([[n.xmin,n.ymin],[n.xmax,n.ymax]],t)),e.resetZoomScale=!0}}goTo(e={},t={}){let i=new Promise(e=>{e(!1)});if(this._innerView){let{center:a,zoom:n,extent:s}=this._getValidGoToParams(e,t);Object(r.isNull)(a)||(this._center=a),Object(r.isNull)(n)||(this._scale=this._getScaleByZoom(n),this._zoom=void 0),Object(r.isNull)(e.scale)||(this._scale=e.scale),Object(r.isNull)(s)||(this._center=void 0,this._scale=void 0,this._zoom=void 0,this._extent=s);const o={animate:!0,duration:200};Object(r.isNull)(t)||(Object(r.isNull)(t.animate)||(o.animate=t.animate),Object(r.isNull)(t.duration)||(o.duration=t.duration));const l=this._innerView.transform;if(l.resetZoomScale=!1,Object(r.isNull)(a)||Object(r.isNull)(n)){if(!Object(r.isNull)(s)){let e=s.xmin,t=s.xmax,r=s.ymin,a=s.ymax;this._fullExtent&&(e<this._fullExtent.xmin&&(e=this._fullExtent.xmin),t>this._fullExtent.xmax&&(t=this._fullExtent.xmax),r<this._fullExtent.ymin&&(r=this._fullExtent.ymin),a>this._fullExtent.ymax&&(a=this._fullExtent.ymax)),isFinite(e)&&isFinite(t)&&isFinite(r)&&isFinite(a)&&(i=new Promise(e=>{this._innerView.fitBounds([[s.xmin,s.ymin],[s.xmax,s.ymax]],o),this._innerView.once("moveend",()=>{e(!0)})}))}}else{let e=a.coordinates[1],t=a.coordinates[0];if(this._fullExtent&&((e>this._fullExtent.ymax||e<this._fullExtent.ymin)&&(e=(this._fullExtent.ymax+this._fullExtent.ymin)/2),(t>this._fullExtent.xmax||t<this._fullExtent.xmin)&&(t=(this._fullExtent.xmax+this._fullExtent.xmin)/2)),isFinite(e)&&isFinite(t)){let r=!1;const s=this._innerView.getCenter();if(n===this._zoom&&e===s.lat&&t===s.lng&&(r=!0),!r){const e={center:[a.coordinates[0],a.coordinates[1]],zoom:n};Object.assign(e,o),i=new Promise(t=>{this._innerView.flyTo(e),this._innerView.once("moveend",()=>{t(!0)})})}}}l.resetZoomScale=!0}return i}getCenter(){if(Object(r.isNull)(this._innerView))return;const e=this._innerView.getCenter();let t=new r.Point({coordinates:[e.lng,e.lat]});this._center=t;const i=this._spatialReference;return i.isGeographic||(t=r.Projection.project(t,i)),t}setCenter(e){this._innerView&&(Array.isArray(e)&&e.length>1?(this._center=new r.Point({coordinates:[e[0],e[1]],spatialReference:this._spatialReference}),this.flyTo({zoom:this._zoom,center:this._center})):e instanceof r.Point&&(this._center=e,this.flyTo({zoom:this._zoom,center:this._center})))}getZoom(){if(!Object(r.isNull)(this._innerView))return this._zoom=this._innerView.getZoom(),this._zoom}setZoom(e){this._innerView&&(this._zoom=e,this.flyTo({zoom:e,center:this._center}))}getExtent(){if(!this._innerView)return;const e=this._innerView.getBounds();if(!e||!e._sw||!e._ne)return;let t=new r.Extent({xmin:e._sw.lng,ymin:e._sw.lat,xmax:e._ne.lng,ymax:e._ne.lat});const i=this._spatialReference;return i.isGeographic||(t=r.Projection.project(t,i)),this._extent=t,t}setExtent(e){this._innerView&&(this._extent=e,this.flyTo({extent:e}))}getScale(){const e=this._getScaleByZoom(this._zoom);return this._scale=e,e}_getScaleByZoom(e){let t;if(this.crs&&this.crs.options&&this.crs.options.lods&&!Object(r.isNull)(e))if(e<0)t=0;else if(e%1==0){t=this.crs.options.lods[e].scale}else{const i=Math.floor(e),r=Math.ceil(e),a=this.crs.options.lods[i],n=this.crs.options.lods[r];t=void 0===a&&void 0===n?0:void 0===a?n.scale:void 0===n?a.scale:Math.pow(2,i)*a.scale/Math.pow(2,e)}return t}_initScale(e){this._scale&&this._scale>0&&(this._zoom=this._getZoomByScale(e))}_getZoomByScale(e){let t=void 0;if(this.crs&&this.crs.options&&this.crs.options.lods){let i=-1;for(let r=0;r<this.crs.options.lods.length;r++){const a=this.crs.options.lods[r],n=this.crs.options.lods[r-1];if(a.scale<=0)break;if(i<0&&(i=r),r===i){if(a.scale>0&&e>=a.scale){t=a.level;break}}else{if(e>=a.scale&&e<=n.scale&&n.scale!==a.scale){t=Math.log2(a.scale*Math.pow(2,a.level)/e);break}if(r===this.crs.options.lods.length-1&&a.scale>0&&e<=a.scale){t=a.level;break}}}}return t}setScale(e){if(!this._innerView)return;const t=this._getZoomByScale(e);t&&this.flyTo({center:this._center,zoom:t})}_getMaxBounds(){if(this._fullExtent){const e=[[this._fullExtent.xmin,this._fullExtent.ymin],[this._fullExtent.xmax,this._fullExtent.ymax]];if(this._innerView)try{const t=Math.max(this._innerView.transform.width,200),i=Math.max(this._innerView.transform.height,200)/t,r=this._innerView.transform,a=r.project({lng:e[0][0],lat:e[1][1]}),n=r.project({lng:e[1][0],lat:e[0][1]}),s=r.project({lng:(e[0][0]+e[1][0])/2,lat:(e[0][1]+e[1][1])/2}),o=n.x-a.x,l=n.y-a.y,c=Math.max(o,l)/2,h=s.x-c,u=s.y-c*i,p=s.x+c,d=s.y+c*i,y=r.unproject({x:h,y:u}),m=r.unproject({x:p,y:d});isFinite(y.lng)&&!isNaN(y.lng)&&(e[0][0]=Math.min(y.lng,e[0][0])),isFinite(m.lat)&&!isNaN(m.lat)&&(e[0][1]=Math.min(m.lat,e[0][1])),isFinite(m.lng)&&!isNaN(m.lng)&&(e[1][0]=Math.max(m.lng,e[1][0])),isFinite(y.lat)&&!isNaN(y.lat)&&(e[1][1]=Math.max(y.lat,e[1][1]))}catch(e){}return e}return null}_isEqualCrs(e,t){let i=!1;if(!e||!t)return i;let a=void 0;e.code.split(":").length>1&&(a=e.code.split(":")[1]);const n=new r.SpatialReference({wkid:a,wkt:e.def});let s=void 0;t.code.split(":").length>1&&(s=t.code.split(":")[1]);const o=new r.SpatialReference({wkid:s,wkt:t.def});return n.equals(o)&&t.options&&e.options&&Object(r.compareObject)(t.options._resolutions,e.options_resolutions)&&Object(r.compareObject)(t.origin,e.origin)&&Object(r.compareObject)(t.extent,e.extent)&&(i=!0),i}_moveLayerView(e,t){let i,r;if(e instanceof Se){i=[];const{_sourceMetaDatas:t}=e.innerLayer;Object.keys(t).forEach(e=>{i.push(t[e].layerId)})}else if(e instanceof Le)i=e.styleLayers.map(e=>e.id);else if(e instanceof we){const t=e.innerLayer||[];i=t.map(e=>e.id)}else i=e.innerLayer.id;if(t instanceof Se){const e=t.innerLayer._getBottomLayer();r=e.layerId}else if(t instanceof Le)t.styleLayers.length>0&&(r=t.styleLayers[0].id);else if(t instanceof we){const e=t.innerLayer||[];e.length>0&&(r=e[0].id)}else r=t.innerLayer.id;e instanceof Se||e instanceof Le||e instanceof we?i.forEach(t=>{e.innerView.moveLayer(t,r)}):e.innerView.moveLayer(i,r)}toJSON(){let e=super.toJSON();return e=Object.assign(e,{extent:Object(r.toJSON)(this._extent,r.Extent),width:this.width,height:this.height,spatialReferenceLocked:this.spatialReferenceLocked})}_getValidGoToParams(e,t){let i,a,n;if(Object(r.isNull)(e.center)&&Object(r.isNull)(e.zoom)&&Object(r.isNull)(e.scale)||(i=Object(r.isNull)(e.center)?this._center:this._getFlyToCenter({center:e.center}),Object(r.isNull)(i)||(a=!Object(r.isNull)(e.scale)&&e.scale>0?this._getZoomByScale(e.scale):Object(r.isNull)(e.zoom)?this._zoom:e.zoom)),!Object(r.isNull)(e.target)||!Object(r.isNull)(e.layer)&&!Object(r.isNull)(e.layer.extent)){const t=this._getTargetExtent(e.target||e.layer.extent);t.xmin!==t.xmax&&t.ymin!==t.ymax?n=t:i=this._getFlyToCenter({center:new r.Point({coordinates:[t.xmin,t.ymin]})})}return{center:i,zoom:a,extent:n}}}Object.defineProperties(Ze.prototype,{scale:{get(){return this.getScale()},set(e){this.setScale(e)}},zoom:{get(){return this.getZoom()},set(e){this.setZoom(e)}},extent:{get(){return this.getExtent()},set(e){this.setExtent(e)}},center:{get(){return this.getCenter()},set(e){this.setCenter(e)}},spatialReference:{get(){return this._spatialReference},set(e){}},rotation:{get(){return this._rotation},set(e){this._rotation=e,this._innerView&&this._innerView.setBearing(e)}}}),Ze.fromJSON=function(e){return e=Object(r.defaultValue)(e,{}),new Ze(e)};var $e=Ze;var qe=class extends r.SketchEditor{constructor(e){super(e)}start(e,t){super.start(e,t)}startCustomDrawTool(e){super.startCustomDrawTool(e)}stop(){super.stop()}remove(){super.remove()}update(e,t){super.updateFeature(e,t)}addVertex(e,t){super.addVertex(e,t)}updateVertex(e,t){super.updateVertex(e,t)}removeVertex(e){super.removeVertex(e)}getSketchDataType(){super.getSketchDataType()}setSketchStyle(e){super.setSketchStyle(e)}getSketchStyle(){return super.getSketchStyle()}getGeometry(){return super.getGeometry()}union(e){return super.union(e)}split(e,t){return super.split(e,t)}drawPolylineToPolygon(e){super.drawPolylineToPolygon(e)}undo(){return super.undo()}redo(){return super.redo()}canUndo(){return super.canUndo()}canRedo(){return super.canRedo()}_hitTestSketchEvent(){const e=this,t=t=>{if(!t||!t.x||!t.y)return;if(e._drawTool&&e._drawTool._editMode===r.SketchEditMode.drawing)return;const i=e._getGraphicsLayer(e._layer),a=e._getGraphicsLayer(e._sketchInnerLayer);if(!i&&!a)return;let n=void 0;const s=e.view.hitTest({x:t.x,y:t.y});if(s&&Array.isArray(s)&&(n=s[0]),n&&(i&&i.id===n.layer.id||a&&a.id===n.layer.id)){const i=this._getCurDrawTool(n.layer.id,n.graphic.id);if(!i||i===e._drawTool&&"drawn"!==i.state)return;this._bindEditMouseEvent(i,t)}};this._hitTestSketchHandler||(this.view.on(r.ViewEventType.mouseDown,t),this._hitTestSketchHandler=t)}_getCurDrawTool(e,t){const i=this;let a=i._drawTool?i._drawTool._getDrawToolByFeatureId(t):void 0;if(!a&&(!i._drawTool||i._drawTool.sketchStage.entityGraphic&&"drawn"===i._drawTool.state)){const n=i.view.getLayer(e).graphics.filter(e=>e.id===t);if(n&&n.items.length>0?n.items[0]:void 0){const e=n.items[0];i._drawTool&&(i._drawTool._clearEditGraphics(i._drawTool._editMode),i._drawTool.fire("selected",{isSelected:!1},i),i._drawTool.view.off(r.ViewEventType.immediateClick,i._drawTool._mapClickEvent),i._drawTool._fireRemoveSelectEvent(i._drawTool.sketchStage.entityGraphic)),this._addFeatureToSketchEditor(e),i._undoRedoManager.reset(),i._drawTools=[i._drawTool],a=i._drawTool}}return a}_bindEditMouseEvent(e,t){const i=this;if(0===e.editOption._hitTestMode){const a=()=>{if(i._editable&&(Object(r.isNull)(i._drawTool)||i._drawTool._editMode!==r.SketchEditMode.drawing)){if(!Object(r.isNull)(e)&&Object(r.isNull)(e._parent)&&e._editMode===r.SketchEditMode.none){i.fire("selected",{isSelected:!0,selectedDrawTool:i._drawTool,selectedGeometry:i._drawTool.sketchStage.entityGraphic.geometry},i);const e=new r.SketchEditorEvent({type:r.SketchEditorEventType.update,target:i,toolEventInfo:null,state:r.SketchEditorState.start,feature:i._drawTool.sketchStage.entityGraphic,geometry:i._drawTool.sketchStage.entityGraphic.geometry});i.fire(r.SketchEditorEventType.update,e)}e._isAddTip&&e._updateTipText(e._tipText.editGraphic,e._sketchInnerLayer,t),e.hitTestFeature(e.sketchStage.entityGraphic,t),i.view.off(r.ViewEventType.mouseUp,a)}};i.view.on(r.ViewEventType.mouseUp,a)}else{if(!i._editable)return;if(void 0!==i._drawTool&&null!==i._drawTool&&i._drawTool._editMode===r.SketchEditMode.drawing)return;e._parent&&e._parent._isAddTip&&e._parent._updateTipText(e._parent._tipText.editVertex,e._parent._sketchInnerLayer),e.hitTestFeature(e.sketchStage.entityGraphic,t)}}_removeHitTestSketchEvent(){this.view.off(r.ViewEventType.mouseDown,this._hitTestSketchHandler)}_getCenterCoordinate(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]}};i.d(t,"MapViewMapboxgl",function(){return $e}),i.d(t,"MapView",function(){return $e}),i.d(t,"SketchEditorMapboxgl",function(){return qe}),i.d(t,"SketchEditor",function(){return qe}),i.d(t,"mapboxCustomCRS",function(){return d}),i.d(t,"initializeOptions",function(){return ae}),i.d(t,"addStyleToMapboxglMap",function(){return ne}),i.d(t,"MapVLayer",function(){return H}),i.d(t,"EchartsLayer",function(){return re}),i.d(t,"initializeCRS",function(){return se}),i.d(t,"Popup",function(){return me}),i.d(t,"Screenshot",function(){return fe}),r.Zondy.mapboxCustomCRS=d,r.zondy.mapboxgl={},r.zondy.mapboxgl.VERSION="17.6.1",r.zondy.mapboxgl.MapView=$e,r.zondy.mapboxgl.layer={},r.zondy.mapboxgl.layer.MapVLayer=H,r.zondy.mapboxgl.layer.EchartsLayer=re,r.zondy.mapboxgl.tool={},r.zondy.mapboxgl.tool.sketch={},r.zondy.mapboxgl.tool.sketch.SketchEditor=qe,r.zondy.mapboxgl.tool.Screenshot=fe,r.zondy.mapboxgl.widget={},r.zondy.mapboxgl.widget.Popup=me,r.zondy.mapboxgl.util={},r.zondy.mapboxgl.util.initializeOptions=ae,r.zondy.mapboxgl.util.addStyleToMapboxglMap=ne,r.zondy.mapboxgl.util.initializeCRS=se,r.zondy.mapboxgl.util.mapboxCustomCRS=d,r.Zondy.PluginVersion=r.zondy.mapboxgl.VERSION,r.Zondy.mapboxCustomCRS=d}])});
|