@mapgis/webclient-mapboxgl-plugin 10.3.4 → 17.0.0

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.
Files changed (91) hide show
  1. package/README.md +51 -124
  2. package/dist/es5/webclient-common.min.js +90 -0
  3. package/dist/es5/webclient-mapboxgl-plugin.min.js +1 -0
  4. package/dist/webclient-mapboxgl-plugin-es6.min.js +1 -0
  5. package/documention/EchartsLayer.html +379 -0
  6. package/documention/MapViewMapboxgl.html +3587 -0
  7. package/documention/Popup.html +1523 -0
  8. package/documention/Screenshot.html +1089 -0
  9. package/documention/SketchEditorMapboxgl.html +3383 -0
  10. package/documention/document_ArcGISVectorTileLayerView.js.html +265 -0
  11. package/documention/document_EchartsLayerView.js.html +246 -0
  12. package/documention/document_GraphicsLayerView.js.html +314 -0
  13. package/documention/document_IGSFeatureLayerView.js.html +218 -0
  14. package/documention/document_IGSMapImageLayerView.js.html +240 -0
  15. package/documention/document_IGSTileLayerView.js.html +236 -0
  16. package/documention/document_IGSVectorTileLayerView.js.html +264 -0
  17. package/documention/document_MapVLayerView.js.html +247 -0
  18. package/documention/document_WMSLayerView.js.html +240 -0
  19. package/documention/document_WMTSLayerView.js.html +234 -0
  20. package/documention/document_WebTileLayerView.js.html +240 -0
  21. package/documention/document_support_FeatureRenderView.js.html +682 -0
  22. package/documention/document_support_MapboxglGraphicsLayer.js.html +1184 -0
  23. package/documention/document_support_SourceMetaData.js.html +223 -0
  24. package/documention/document_support_Utils.js.html +624 -0
  25. package/documention/document_support_mapbox_mapboxCustomUtil.js.html +322 -0
  26. package/documention/global.html +252 -0
  27. package/documention/index.html +251 -0
  28. package/documention/module-%E5%AE%A2%E6%88%B7%E7%AB%AF%E5%8F%AF%E8%A7%86%E5%8C%96.MapvLayer.html +445 -0
  29. package/documention/scripts/app.min.js +1 -0
  30. package/documention/scripts/linenumber.js +26 -0
  31. package/documention/scripts/search.js +45 -0
  32. package/documention/scripts/sideBar.js +11 -0
  33. package/documention/sketchEditor_SketchEditorMapboxgl.js.html +875 -0
  34. package/documention/styles/anchor.png +0 -0
  35. package/documention/styles/app.min.css +1 -0
  36. package/documention/styles/c.png +0 -0
  37. package/documention/styles/iframe.css +29 -0
  38. package/documention/styles/m.png +0 -0
  39. package/documention/styles/prettify-jsdoc.css +111 -0
  40. package/documention/styles/prettify-tomorrow.css +132 -0
  41. package/documention/styles/reset.css +44 -0
  42. package/documention/styles/up-arrow.png +0 -0
  43. package/documention/tutorial-1./345/277/253/351/200/237/345/205/245/351/227/250.html +165 -0
  44. package/documention/util_ConvertRendererToStyleLayerUtil.js.html +844 -0
  45. package/documention/util_MapboxglFeatureRender.js.html +225 -0
  46. package/documention/util_MapboxglPlugin.js.html +284 -0
  47. package/documention/view_MapViewMapboxgl.js.html +1882 -0
  48. package/documention/view_utils_ArcGISVectorTileLayerUtil.js.html +382 -0
  49. package/documention/view_utils_EchartsLayerUtil.js.html +194 -0
  50. package/documention/view_utils_IGSMapImageUtil.js.html +373 -0
  51. package/documention/view_utils_IGSTileLayerUtil.js.html +285 -0
  52. package/documention/view_utils_IGSVectorTileLayerUtil.js.html +379 -0
  53. package/documention/view_utils_MapVLayerUtil.js.html +197 -0
  54. package/documention/view_utils_Popup.js.html +525 -0
  55. package/documention/view_utils_Screenshot.js.html +320 -0
  56. package/documention/view_utils_WMSLayerUtil.js.html +337 -0
  57. package/documention/view_utils_WMTSLayerUtil.js.html +331 -0
  58. package/documention/view_utils_WebTileLayerUtil.js.html +284 -0
  59. package/documention/view_utils_echarts_EchartsLayerPlugin.js.html +419 -0
  60. package/documention/view_utils_mapV_MapVLayerPlugin.js.html +527 -0
  61. package/documention/view_utils_mapV_MapvBaseLayer.js.html +477 -0
  62. package/documention/view_utils_support_rasterLayerUtil.js.html +244 -0
  63. package/documention/view_utils_support_vectorLayerUtil.js.html +503 -0
  64. package/package.json +20 -20
  65. package/core/Base.js +0 -15
  66. package/core/index.js +0 -5
  67. package/index.js +0 -6
  68. package/overlay/D3Layer.js +0 -108
  69. package/overlay/EchartsLayer.js +0 -242
  70. package/overlay/ElsCubeLayer.js +0 -125
  71. package/overlay/MapvLayer.js +0 -296
  72. package/overlay/StreamLayer.js +0 -83
  73. package/overlay/TimeSpaceCubeLayer.js +0 -135
  74. package/overlay/dthree/mapbox-d3.css +0 -9
  75. package/overlay/echarts/MapCoordSys.js +0 -105
  76. package/overlay/echarts/MapModel.js +0 -0
  77. package/overlay/echarts/MapView.js +0 -0
  78. package/overlay/echarts/index.js +0 -4
  79. package/overlay/index.js +0 -31
  80. package/overlay/mapv/MapvBaseLayer.js +0 -299
  81. package/overlay/mapv/index.js +0 -5
  82. package/overlay/stream/GeojsonStreamLayer.js +0 -135
  83. package/overlay/stream/MapvStreamLayer.js +0 -79
  84. package/overlay/stream/index.js +0 -3
  85. package/overlay/stream/popup.css +0 -31
  86. package/service/index.js +0 -1
  87. package/service/socket/ISocketService.js +0 -121
  88. package/service/socket/SocketEvent.js +0 -50
  89. package/service/socket/SocketService.js +0 -90
  90. package/util/Evented.js +0 -295
  91. package/util/Util.js +0 -348
@@ -0,0 +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=81)}([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(114));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(112),__esModule:!0}},function(t,e,i){"use strict";e.__esModule=!0;var r=function(t){return t&&t.__esModule?t:{default:t}}(i(51));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(128)),n=o(i(132)),a=o(i(51));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(90),__esModule:!0}},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(43)("wks"),n=i(34),a=i(8).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){var r=i(8),n=i(3),a=i(19),o=i(16),s=i(17),l=function(t,e,i){var u,h,c,p=t&l.F,f=t&l.G,d=t&l.S,m=t&l.P,y=t&l.B,v=t&l.W,_=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(_,u)||(c=h?x[u]:i[u],_[u]=f&&"function"!=typeof x[u]?i[u]:y&&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):m&&"function"==typeof c?a(Function.call,c):c,m&&((_.virtual||(_.virtual={}))[u]=c,t&l.R&&g&&!g[u]&&o(g,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,i){t.exports=!i(20)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e,i){var r=i(14);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e,i){var r=i(12),n=i(57),a=i(38),o=Object.defineProperty;e.f=i(11)?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){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,i){var r=i(60),n=i(39);t.exports=function(t){return r(n(t))}},function(t,e,i){var r=i(13),n=i(24);t.exports=i(11)?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){t.exports={default:i(110),__esModule:!0}},function(t,e,i){var r=i(33);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(59),n=i(44);t.exports=Object.keys||function(t){return r(t,n)}},function(t,e){t.exports={}},function(t,e,i){var r=i(39);t.exports=function(t){return Object(r(t))}},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(91)(!0);i(63)(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){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WebTileLayerUtil=e.VectorTileLayerUtil=e.WMTSLayerUtil=e.IGSTileLayerUtil=e.WMSLayerUtil=e.IGSMapImageUtil=void 0;var r=u(i(137)),n=u(i(75)),a=u(i(151)),o=u(i(152)),s=u(i(153)),l=u(i(154));function u(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},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(138);e.setVisible=r.setVisible,e.removeLayer=r.removeLayer,e.setOpacity=r.setOpacity,e.getRasterSource=r.getRasterSource,e.getRasterLayer=r.getRasterLayer},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(){(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:"applyVisibleAndOpacityToColor",value:function(t,e,i){var r=a.Color.fromColor(t).clone(),n=i*(e?1:0);return r.alpha*=n,r}}]),t}();e.default=s},function(t,e,i){"use strict";e.__esModule=!0;var r=a(i(4)),n=a(i(166));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){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(13).f,n=i(17),a=i(9)("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(93);for(var r=i(8),n=i(16),a=i(22),o=i(9)("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){var r=i(14),n=i(8).document,a=r(n)&&r(n.createElement);t.exports=function(t){return a?n.createElement(t):{}}},function(t,e,i){var r=i(14);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(41),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(43)("keys"),n=i(34);t.exports=function(t){return r[t]||(r[t]=n(t))}},function(t,e,i){var r=i(3),n=i(8),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(26)?"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(12),n=i(58),a=i(44),o=i(42)("IE_PROTO"),s=function(){},l=function(){var t,e=i(37)("iframe"),r=a.length;for(e.style.display="none",i(65).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(25),n=i(9)("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(46),n=i(9)("iterator"),a=i(22);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(33);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(10),n=i(3),a=i(20);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(117)),n=o(i(119)),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(9)},function(t,e,i){var r=i(8),n=i(3),a=i(26),o=i(52),s=i(13).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(28),n=i(24),a=i(15),o=i(38),s=i(17),l=i(57),u=Object.getOwnPropertyDescriptor;e.f=i(11)?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){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 m(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 y(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 _(t,e,i){var r={};for(var n in t)r[n]=e.call(i||this,t[n],n,t);return r}function g(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?_(t,x):t}var b={};function w(t){b[t]||("undefined"!=typeof console&&console.warn(t),b[t]=!0)}function M(t,e,i){return(i.y-t.y)*(e.x-t.x)>(e.y-t.y)*(i.x-t.x)}function S(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 P,A,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 P||(P=self.document.createElement("a")),P.href=t,P.href},hardwareConcurrency:self.navigator.hardwareConcurrency||4,get devicePixelRatio(){return self.devicePixelRatio},get prefersReducedMotion(){return!!self.matchMedia&&(null==A&&(A=self.matchMedia("(prefers-reduced-motion: reduce)")),A.matches)}},F={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},V={supported:!1,testSupport:function(t){!U&&z&&(N?j(t):L=t)}},U=!1,N=!1;function j(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&&j(L),L=null,N=!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){return this._transformRequestFn&&this._transformRequestFn(t,e)||{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.0.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(),m(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;m(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 mt,yt,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),_t=E()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===self.location.protocol?self.parent:self).location.href},gt=function(t,e){if(!(/^file:/.test(i=t.url)||/^file:/.test(_t())&&!/^\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:_t(),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 gt(h(t,{type:"json"}),e)},bt=function(t,e){return gt(h(t,{type:"arrayBuffer"}),e)},wt=function(t,e){return gt(h(t,{method:"POST"}),e)};mt=[],yt=0;var Mt=function(t,e){if(V.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),yt>=F.MAX_PARALLEL_IMAGE_REQUESTS){var i={requestParameters:t,callback:e,cancelled:!1,cancel:function(){this.cancelled=!0}};return mt.push(i),i}yt++;var r=!1,n=function(){if(!r)for(r=!0,yt--;mt.length&&yt<F.MAX_PARALLEL_IMAGE_REQUESTS;){var t=mt.shift();t.cancelled||(t.cancel=Mt(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 St(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||{},St(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||{},St(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_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:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"},isWrapData:{type:"boolean",default:!1}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["宋体","宋体"],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"}}},Pt=function(t,e,i,r){this.message=(t?t+": ":"")+i,r&&(this.identifier=r),null!=e&&e.__line__&&(this.line=e.__line__)};function At(t){var e=t.value;return e?[new Pt(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"},Nt={kind:"color"},jt={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,Nt,Zt,jt,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]),m=a(c[2]),y=m<=.5?m*(d+1):m+d-m*d,v=2*m-y;return[r(255*o(v,y,f+1/3)),r(255*o(v,y,f)),r(255*o(v,y,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 Nt;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 jt}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:jt},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,Nt)))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":Nt,"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 me=["Unknown","Point","LineString","Polygon"],ye=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};ye.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},ye.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?me[this.feature.type]:this.feature.type:null},ye.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},ye.prototype.canonicalID=function(){return this.canonical},ye.prototype.properties=function(){return this.feature&&this.feature.properties||{}},ye.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 Ke(e.registry,e.path,null,e.scope);for(var d=[],m=!1,y=1;y<t.length;y++){var v=t[y],_=Array.isArray(p)?p[y-1]:p.type,g=l.parse(v,1+d.length,_);if(!g){m=!0;break}d.push(g)}if(!m)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 M=(s.length?s:o).map(function(t){var e;return e=t[0],Array.isArray(e)?"("+e.map(Kt).join(", ")+")":"("+Kt(e.type)+"...)"}).join(" | "),S=[],E=1;E<t.length;E++){var k=e.parse(t[E],1+S.length);if(!k)return null;S.push(Kt(k.type))}e.error("Expected arguments of type "+M+", but found ("+S.join(", ")+") instead.")}return null},ve.register=function(t,e){for(var i in ve.definitions=e,e)t[i]=ve};var _e=function(t,e,i){this.type=Gt,this.locale=i,this.caseSensitive=t,this.diacriticSensitive=e};_e.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 _e(r,n,a)},_e.prototype.evaluate=function(t){return new $t(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},_e.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)},_e.prototype.outputDefined=function(){return!1},_e.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 ge=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]))};ge.prototype.setNorthEast=function(t){return this._ne=t instanceof xe?new xe(t.lng,t.lat):xe.convert(t),this},ge.prototype.setSouthWest=function(t){return this._sw=t instanceof xe?new xe(t.lng,t.lat):xe.convert(t),this},ge.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 ge))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(ge.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},ge.prototype.getCenter=function(){return new xe((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},ge.prototype.getSouthWest=function(){return this._sw},ge.prototype.getNorthEast=function(){return this._ne},ge.prototype.getNorthWest=function(){return new xe(this.getWest(),this.getNorth())},ge.prototype.getSouthEast=function(){return new xe(this.getEast(),this.getSouth())},ge.prototype.getWest=function(){return this._sw.lng},ge.prototype.getSouth=function(){return this._sw.lat},ge.prototype.getEast=function(){return this._ne.lng},ge.prototype.getNorth=function(){return this._ne.lat},ge.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},ge.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},ge.prototype.isEmpty=function(){return!(this._sw&&this._ne)},ge.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},ge.convert=function(t){return!t||t instanceof ge?t:new ge(t)};var xe=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};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 ge(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=2*Math.PI*6371008.8;function we(t){return be*Math.cos(t*Math.PI/180)}function Me(t){return(180+t)/360}function Se(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Ee(t,e){return t/we(e)}function ke(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}var Te=function(t,e,i){void 0===i&&(i=0),this.x=+t,this.y=+e,this.z=+i};function Ie(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 Ce(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function Pe(t,e){var i=Te.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 Ae(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 Le(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;Ae(t,p[f],p[f+1])&&(u=!u)}return u}function ze(t,e){for(var i=0;i<e.length;i++)if(Le(t,e[i]))return!0;return!1}function De(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 Re(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]&&De(s,l,u,h)&&De(u,h,s,l))return!0;var s,l,u,h,c,p;return!1}function Oe(t,e){for(var i=0;i<t.length;++i)if(!Le(t[i],e))return!1;for(var r=0;r<t.length-1;++r)if(Re(t[r],t[r+1],e))return!1;return!0}function Be(t,e){for(var i=0;i<e.length;i++)if(Oe(t,e[i]))return!0;return!1}function Fe(t,e,i){for(var r=[],n=0;n<t.length;n++){for(var a=[],o=0;o<t[n].length;o++){var s=Pe(t[n][o],i);Ie(e,s),a.push(s)}r.push(a)}return r}function Ve(t,e,i){for(var r=[],n=0;n<t.length;n++){var a=Fe(t[n],e,i);r.push(a)}return r}function Ue(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}Ie(e,t)}function Ne(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]];Ue(p,e,i,n),o.push(p)}return o}function je(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]];Ie(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 m=0,y=s;m<y.length;m+=1)for(var v=0,_=y[m];v<_.length;v+=1)Ue(_[v],e,i,a)}return s}Te.fromLngLat=function(t,e){void 0===e&&(e=0);var i=xe.convert(t);return new Te(Me(i.lng),Se(i.lat),Ee(e,i.lat))},Te.prototype.toLngLat=function(){return new xe(360*this.x-180,ke(this.y))},Te.prototype.toAltitude=function(){return this.z*we(ke(this.y))},Te.prototype.meterInMercatorCoordinateUnits=function(){return 1/be*(t=ke(this.y),1/Math.cos(t*Math.PI/180));var t};var qe=function(t,e){this.type=Ut,this.geojson=t,this.geometries=e};function Ge(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 qe)return!1;var e=!0;return t.eachChild(function(t){e&&!Ge(t)&&(e=!1)}),e}function Ze(t){if(t instanceof ve&&"feature-state"===t.name)return!1;var e=!0;return t.eachChild(function(t){e&&!Ze(t)&&(e=!1)}),e}function Xe(t,e){if(t instanceof ve&&e.indexOf(t.name)>=0)return!1;var i=!0;return t.eachChild(function(t){i&&!Xe(t,e)&&(i=!1)}),i}qe.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 qe(i,i.features[r].geometry)}else if("Feature"===i.type){var a=i.geometry.type;if("Polygon"===a||"MultiPolygon"===a)return new qe(i,i.geometry)}else if("Polygon"===i.type||"MultiPolygon"===i.type)return new qe(i,i)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")},qe.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=Fe(e.coordinates,r,n),o=Ne(t.geometry(),i,r,n);if(!Ce(i,r))return!1;for(var s=0,l=o;s<l.length;s+=1)if(!Le(l[s],a))return!1}if("MultiPolygon"===e.type){var u=Ve(e.coordinates,r,n),h=Ne(t.geometry(),i,r,n);if(!Ce(i,r))return!1;for(var c=0,p=h;c<p.length;c+=1)if(!ze(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=Fe(e.coordinates,r,n),o=je(t.geometry(),i,r,n);if(!Ce(i,r))return!1;for(var s=0,l=o;s<l.length;s+=1)if(!Oe(l[s],a))return!1}if("MultiPolygon"===e.type){var u=Ve(e.coordinates,r,n),h=je(t.geometry(),i,r,n);if(!Ce(i,r))return!1;for(var c=0,p=h;c<p.length;c+=1)if(!Be(p[c],u))return!1}return!0}(t,this.geometries)}return!1},qe.prototype.eachChild=function(){},qe.prototype.outputDefined=function(){return!0},qe.prototype.serialize=function(){return["within",this.geojson]};var We=function(t,e){this.type=e.type,this.name=t,this.boundExpression=e};We.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 We(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)},We.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},We.prototype.eachChild=function(){},We.prototype.outputDefined=function(){return!1},We.prototype.serialize=function(){return["var",this.name]};var Ke=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 He(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}Ke.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)},Ke.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 We)return t(e.boundExpression);if(e instanceof ve&&"error"===e.name)return!1;if(e instanceof _e)return!1;if(e instanceof qe)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&&Ge(e)&&Xe(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(a)){var l=new ye;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.")},Ke.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 Ke(this.registry,r,e||null,n,this.errors)},Ke.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))},Ke.prototype.checkSubtype=function(t,e){var i=Jt(t,e);return i&&this.error(i),i};var Je=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 Ye(t,e,i){return t*(1-i)+e*i}Je.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 Je(n,i,r)},Je.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[He(e,r)].evaluate(t)},Je.prototype.eachChild=function(t){t(this.input);for(var e=0,i=this.outputs;e<i.length;e+=1)t(i[e])},Je.prototype.outputDefined=function(){return this.outputs.every(function(t){return t.outputDefined()})},Je.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 Qe=Object.freeze({__proto__:null,number:Ye,color:function(t,e,i){return new Qt(Ye(t.r,e.r,i),Ye(t.g,e.g,i),Ye(t.b,e.b,i),Ye(t.a,e.a,i))},array:function(t,e,i){return t.map(function(t,r){return Ye(t,e[r],i)})}}),$e=6/29*3*(6/29),ti=Math.PI/180,ei=180/Math.PI;function ii(t){return t>.008856451679035631?Math.pow(t,1/3):t/$e+4/29}function ri(t){return t>6/29?t*t*t:$e*(t-4/29)}function ni(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function ai(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function oi(t){var e=ai(t.r),i=ai(t.g),r=ai(t.b),n=ii((.4124564*e+.3575761*i+.1804375*r)/.95047),a=ii((.2126729*e+.7151522*i+.072175*r)/1);return{l:116*a-16,a:500*(n-a),b:200*(a-ii((.0193339*e+.119192*i+.9503041*r)/1.08883)),alpha:t.a}}function si(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*ri(e),i=.95047*ri(i),r=1.08883*ri(r),new Qt(ni(3.2404542*i-1.5371385*e-.4985314*r),ni(-.969266*i+1.8760108*e+.041556*r),ni(.0556434*i-.2040259*e+1.0572252*r),t.alpha)}var li={forward:oi,reverse:si,interpolate:function(t,e,i){return{l:Ye(t.l,e.l,i),a:Ye(t.a,e.a,i),b:Ye(t.b,e.b,i),alpha:Ye(t.alpha,e.alpha,i)}}},ui={forward:function(t){var e=oi(t),i=e.l,r=e.a,n=e.b,a=Math.atan2(n,r)*ei;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*ti,i=t.c;return si({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:Ye(t.c,e.c,i),l:Ye(t.l,e.l,i),alpha:Ye(t.alpha,e.alpha,i)}}},hi=Object.freeze({__proto__:null,lab:li,hcl:ui}),ci=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 pi(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)}ci.interpolationFactor=function(t,e,r,n){var a=0;if("exponential"===t.name)a=pi(e,t.base,r,n);else if("linear"===t.name)a=pi(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(pi(e,1,r,n))}return a},ci.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=Nt: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 m=e.parse(p,d,u);if(!m)return null;u=u||m.type,l.push([c,m])}return"number"===u.kind||"color"===u.kind||"array"===u.kind&&"number"===u.itemType.kind&&"number"==typeof u.N?new ci(u,i,r,n,l):e.error("Type "+Kt(u)+" is not interpolatable.")},ci.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=He(e,r),o=ci.interpolationFactor(this.interpolation,r,e[a],e[a+1]),s=i[a].evaluate(t),l=i[a+1].evaluate(t);return"interpolate"===this.operator?Qe[this.type.kind.toLowerCase()](s,l,o):"interpolate-hcl"===this.operator?ui.reverse(ui.interpolate(ui.forward(s),ui.forward(l),o)):li.reverse(li.interpolate(li.forward(s),li.forward(l),o))},ci.prototype.eachChild=function(t){t(this.input);for(var e=0,i=this.outputs;e<i.length;e+=1)t(i[e])},ci.prototype.outputDefined=function(){return this.outputs.every(function(t){return t.outputDefined()})},ci.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 fi=function(t,e){this.type=t,this.args=e};fi.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 fi(l?qt:i,n)},fi.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},fi.prototype.eachChild=function(t){this.args.forEach(t)},fi.prototype.outputDefined=function(){return this.args.every(function(t){return t.outputDefined()})},fi.prototype.serialize=function(){var t=["coalesce"];return this.eachChild(function(e){t.push(e.serialize())}),t};var di=function(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e};di.prototype.evaluate=function(t){return this.result.evaluate(t)},di.prototype.eachChild=function(t){for(var e=0,i=this.bindings;e<i.length;e+=1)t(i[e][1]);t(this.result)},di.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 di(i,o):null},di.prototype.outputDefined=function(){return this.result.outputDefined()},di.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 mi=function(t,e,i){this.type=t,this.index=e,this.input=i};mi.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 mi(r.type.itemType,i,r):null},mi.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]},mi.prototype.eachChild=function(t){t(this.index),t(this.input)},mi.prototype.outputDefined=function(){return!1},mi.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var yi=function(t,e){this.type=Ut,this.needle=t,this.haystack=e};yi.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 yi(r,n):null},yi.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},yi.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},yi.prototype.outputDefined=function(){return!0},yi.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var vi=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};vi.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 m=e.parse(t[t.length-1],t.length-1,r);return m?"value"!==d.type.kind&&e.concat(1).checkSubtype(i,d.type)?null:new vi(i,r,d,n,a,m):null},vi.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(ae(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},vi.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},vi.prototype.outputDefined=function(){return this.outputs.every(function(t){return t.outputDefined()})&&this.otherwise.outputDefined()},vi.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 _i=function(t,e,i){this.type=t,this.branches=e,this.otherwise=i};function gi(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 xi(t,e,i,r){return 0===r.compare(e,i)}function bi(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(!gi(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(!gi(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}()}_i.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 _i(i,r,s):null},_i.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)},_i.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)},_i.prototype.outputDefined=function(){return this.branches.every(function(t){return t[1].outputDefined()})&&this.otherwise.outputDefined()},_i.prototype.serialize=function(){var t=["case"];return this.eachChild(function(e){t.push(e.serialize())}),t};var wi=bi("==",function(t,e,i){return e===i},xi),Mi=bi("!=",function(t,e,i){return e!==i},function(t,e,i,r){return!xi(0,e,i,r)}),Si=bi("<",function(t,e,i){return e<i},function(t,e,i,r){return r.compare(e,i)<0}),Ei=bi(">",function(t,e,i){return e>i},function(t,e,i,r){return r.compare(e,i)>0}),ki=bi("<=",function(t,e,i){return e<=i},function(t,e,i,r){return r.compare(e,i)<=0}),Ti=bi(">=",function(t,e,i){return e>=i},function(t,e,i,r){return r.compare(e,i)>=0}),Ii=function(t,e,i,r,n){this.type=Vt,this.number=t,this.locale=e,this.currency=i,this.minFractionDigits=r,this.maxFractionDigits=n};Ii.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 Ii(i,n,a,o,s)},Ii.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))},Ii.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)},Ii.prototype.outputDefined=function(){return!1},Ii.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 Ci=function(t){this.type=Ft,this.input=t};Ci.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 Ci(i):null},Ci.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.")},Ci.prototype.eachChild=function(t){t(this.input)},Ci.prototype.outputDefined=function(){return!1},Ci.prototype.serialize=function(){var t=["length"];return this.eachChild(function(e){t.push(e.serialize())}),t};var Pi={"==":wi,"!=":Mi,">":Ei,"<":Si,">=":Ti,"<=":ki,array:he,at:mi,boolean:he,case:_i,coalesce:fi,collator:_e,format:ce,image:pe,in:yi,interpolate:ci,"interpolate-hcl":ci,"interpolate-lab":ci,length:Ci,let:di,literal:se,match:vi,number:he,"number-format":Ii,object:he,step:Je,string:he,"to-boolean":de,"to-color":de,"to-number":de,"to-string":de,var:We,within:qe};function Ai(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 Li(t,e){return t in e}function zi(t,e){var i=e[t];return void 0===i?null:i}function Di(t){return{type:t}}function Ri(t){return{result:"success",value:t}}function Oi(t){return{result:"error",value:t}}function Bi(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Fi(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function Vi(t){return!!t.expression&&t.expression.interpolated}function Ui(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function Ni(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function ji(t){return t}function qi(t,e,i){return void 0!==t?t:void 0!==e?e:void 0!==i?i:void 0}function Gi(t,e,i,r,n){return qi(typeof i===n?r[i]:void 0,t.default,e.default)}function Zi(t,e,i){if("number"!==Ui(i))return qi(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=He(t.stops.map(function(t){return t[0]}),i);return t.stops[n][1]}function Xi(t,e,i){var r=void 0!==t.base?t.base:1;if("number"!==Ui(i))return qi(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=He(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=Qe[e.type]||ji;if(t.colorSpace&&"rgb"!==t.colorSpace){var h=hi[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 Wi(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()):Ui(i)===e.type||"enum"===e.type&&e.values[i]||(i=void 0),qi(i,t.default,e.default)}ve.register(Pi,{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),[Nt],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[Nt,[Ft,Ft,Ft],Ai],rgba:[Nt,[Ft,Ft,Ft,Ft],Ai],has:{type:Ut,overloads:[[[Vt],function(t,e){return Li(e[0].evaluate(t),t.properties())}],[[Vt,jt],function(t,e){var i=e[1];return Li(e[0].evaluate(t),i.evaluate(t))}]]},get:{type:qt,overloads:[[[Vt],function(t,e){return zi(e[0].evaluate(t),t.properties())}],[[Vt,jt],function(t,e){var i=e[1];return zi(e[0].evaluate(t),i.evaluate(t))}]]},"feature-state":[qt,[Vt],function(t,e){return zi(e[0].evaluate(t),t.featureState||{})}],properties:[jt,[],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,Di(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,Di(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,Di(Ft),function(t,e){return Math.min.apply(Math,e.map(function(e){return e.evaluate(t)}))}],max:[Ft,Di(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)}],[Di(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)}],[Di(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,Di(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 Ki=function(t,e){this.expression=t,this._warningHistory={},this._evaluator=new ye,this._defaultValue=e?function(t){return"color"===t.type&&Ni(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 Hi(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in Pi}function Ji(t,e){var i=new Ke(Pi,[],e?function(t){var e={color:Nt,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?Ri(new Ki(r,e)):Oi(i.errors)}Ki.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)},Ki.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 Yi=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Ze(e.expression)};Yi.prototype.evaluateWithoutErrorHandling=function(t,e,i,r,n,a){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,r,n,a)},Yi.prototype.evaluate=function(t,e,i,r,n,a){return this._styleExpression.evaluate(t,e,i,r,n,a)};var Qi=function(t,e,i,r){this.kind=t,this.zoomStops=i,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Ze(e.expression),this.interpolationType=r};function $i(t,e){if("error"===(t=Ji(t,e)).result)return t;var i=t.value.expression,r=Ge(i);if(!r&&!Bi(e))return Oi([new Rt("","data expressions not supported")]);var n=Xe(i,["zoom"]);if(!n&&!Fi(e))return Oi([new Rt("","zoom expressions not supported")]);var a=function t(e){var i=null;if(e instanceof di)i=t(e.result);else if(e instanceof fi)for(var r=0,n=e.args;r<n.length&&!(i=t(n[r]));r+=1);else(e instanceof Je||e instanceof ci)&&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?Oi([a]):a instanceof ci&&!Vi(e)?Oi([new Rt("",'"interpolate" expressions cannot be used with this property')]):Ri(a?new Qi(r?"camera":"composite",t.value,a.labels,a instanceof ci?a.interpolation:void 0):new Yi(r?"constant":"source",t.value)):Oi([new Rt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}Qi.prototype.evaluateWithoutErrorHandling=function(t,e,i,r,n,a){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,r,n,a)},Qi.prototype.evaluate=function(t,e,i,r,n,a){return this._styleExpression.evaluate(t,e,i,r,n,a)},Qi.prototype.interpolationFactor=function(t,e,i){return this.interpolationType?ci.interpolationFactor(this.interpolationType,t,e,i):0};var tr=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||(Vi(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&&!hi[e.colorSpace])throw new Error("Unknown color space: "+e.colorSpace);if("exponential"===u)r=Xi;else if("interval"===u)r=Zi;else if("categorical"===u){r=Gi,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=Wi}if(s){for(var f={},d=[],m=0;m<e.stops.length;m++){var y=e.stops[m],v=y[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([y[0].value,y[1]])}for(var _=[],g=0,x=d;g<x.length;g+=1){var b=x[g];_.push([f[b].zoom,t(f[b],i)])}var w={name:"linear"};return{kind:"composite",interpolationType:w,interpolationFactor:ci.interpolationFactor.bind(void 0,w),zoomStops:_.map(function(t){return t[0]}),evaluate:function(t,r){var n=t.zoom;return Xi({stops:_,base:e.base},i,n).evaluate(n,r)}}}if(l){var M="exponential"===u?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:M,interpolationFactor:ci.interpolationFactor.bind(void 0,M),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?qi(e.default,i.default):r(e,i,s,n,a)}}}(this._parameters,this._specification))};function er(t){var e=t.key,i=t.value,r=t.valueSpec||{},n=t.objectElementValidators||{},a=t.style,o=t.styleSpec,s=[],l=Ui(i);if("object"!==l)return[new Pt(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=kr;else if(n["*"])p=n["*"];else{if(!r["*"]){s.push(new Pt(e,i[u],'unknown property "'+u+'"'));continue}p=kr}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 Pt(e,i,'missing required property "'+f+'"'));return s}function ir(t){var e=t.value,i=t.valueSpec,r=t.style,n=t.styleSpec,a=t.key,o=t.arrayElementValidator||kr;if("array"!==Ui(e))return[new Pt(a,e,"array expected, "+Ui(e)+" found")];if(i.length&&e.length!==i.length)return[new Pt(a,e,"array length "+i.length+" expected, length "+e.length+" found")];if(i["min-length"]&&e.length<i["min-length"])return[new Pt(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"===Ui(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 rr(t){var e=t.key,i=t.value,r=t.valueSpec,n=Ui(i);return"number"===n&&i!=i&&(n="NaN"),"number"!==n?[new Pt(e,i,"number expected, "+n+" found")]:"minimum"in r&&i<r.minimum?[new Pt(e,i,i+" is less than the minimum value "+r.minimum)]:"maximum"in r&&i>r.maximum?[new Pt(e,i,i+" is greater than the maximum value "+r.maximum)]:[]}function nr(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"===Ui(t.value.stops)&&"array"===Ui(t.value.stops[0])&&"object"===Ui(t.value.stops[0][0]),h=er({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 Pt(t.key,t.value,'identity function may not have a "stops" property')];var e=[],i=t.value;return e=e.concat(ir({key:t.key,value:i,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:c})),"array"===Ui(i)&&0===i.length&&e.push(new Pt(t.key,i,"array must have at least one stop")),e},default:function(t){return kr({key:t.key,value:t.value,valueSpec:n,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===a&&s&&h.push(new Pt(t.key,t.value,'missing required property "property"')),"identity"===a||t.value.stops||h.push(new Pt(t.key,t.value,'missing required property "stops"')),"exponential"===a&&t.valueSpec.expression&&!Vi(t.valueSpec)&&h.push(new Pt(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!Bi(t.valueSpec)?h.push(new Pt(t.key,t.value,"property functions not supported")):s&&!Fi(t.valueSpec)&&h.push(new Pt(t.key,t.value,"zoom functions not supported"))),"categorical"!==a&&!u||void 0!==t.value.property||h.push(new Pt(t.key,t.value,'"property" property is required')),h;function c(t){var e=[],a=t.value,s=t.key;if("array"!==Ui(a))return[new Pt(s,a,"array expected, "+Ui(a)+" found")];if(2!==a.length)return[new Pt(s,a,"array length 2 expected, length "+a.length+" found")];if(u){if("object"!==Ui(a[0]))return[new Pt(s,a,"object expected, "+Ui(a[0])+" found")];if(void 0===a[0].zoom)return[new Pt(s,a,"object stop key must have zoom")];if(void 0===a[0].value)return[new Pt(s,a,"object stop key must have value")];if(r&&r>zt(a[0].zoom))return[new Pt(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(er({key:s+"[0]",value:a[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:rr,value:p}}))}else e=e.concat(p({key:s+"[0]",value:a[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},a));return Hi(Dt(a[1]))?e.concat([new Pt(s+"[1]",a[1],"expressions are not allowed in function stops.")]):e.concat(kr({key:s+"[1]",value:a[1],valueSpec:n,style:t.style,styleSpec:t.styleSpec}))}function p(t,r){var s=Ui(t.value),l=zt(t.value),u=null!==t.value?t.value:r;if(e){if(s!==e)return[new Pt(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 Pt(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 Bi(n)&&void 0===a&&(h+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Pt(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 Pt(t.key,u,"stop domain values must appear in ascending order")]:(i=l,"categorical"===a&&l in o?[new Pt(t.key,u,"stop domain values must be unique")]:(o[l]=!0,[])):[new Pt(t.key,u,"integer expected, found "+l)]}}function ar(t){var e=("property"===t.expressionContext?$i:Ji)(Dt(t.value),t.valueSpec);if("error"===e.result)return e.value.map(function(e){return new Pt(""+t.key+e.key,t.value,e.message)});var i=e.value.expression||e.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&!i.outputDefined())return[new Pt(t.key,t.value,'Invalid data expression for "'+t.propertyKey+'". Output values must be contained as literals within the expression.')];if("property"===t.expressionContext&&"layout"===t.propertyType&&!Ze(i))return[new Pt(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext&&!Ze(i))return[new Pt(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!Xe(i,["zoom","feature-state"]))return[new Pt(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!Ge(i))return[new Pt(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function or(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 Pt(e,i,"expected one of ["+r.values.join(", ")+"], "+JSON.stringify(i)+" found")):-1===Object.keys(r.values).indexOf(zt(i))&&n.push(new Pt(e,i,"expected one of ["+Object.keys(r.values).join(", ")+"], "+JSON.stringify(i)+" found")),n}function sr(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(!sr(r)&&"boolean"!=typeof r)return!1}return!0;default:return!0}}tr.deserialize=function(t){return new tr(t._parameters,t._specification)},tr.serialize=function(t){return{_parameters:t._parameters,_specification:t._specification}};var lr={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function ur(t){if(null==t)return{filter:function(){return!0},needGeometry:!1};sr(t)||(t=cr(t));var e=Ji(t,lr);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 hr(t,e){return t<e?-1:t>e?1:0}function cr(t){if(!t)return!0;var e,i=t[0];return t.length<=1?"any"!==i:"=="===i?pr(t[1],t[2],"=="):"!="===i?mr(pr(t[1],t[2],"==")):"<"===i||">"===i||"<="===i||">="===i?pr(t[1],t[2],i):"any"===i?(e=t.slice(1),["any"].concat(e.map(cr))):"all"===i?["all"].concat(t.slice(1).map(cr)):"none"===i?["all"].concat(t.slice(1).map(cr).map(mr)):"in"===i?fr(t[1],t.slice(2)):"!in"===i?mr(fr(t[1],t.slice(2))):"has"===i?dr(t[1]):"!has"!==i||mr(dr(t[1]))}function pr(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 fr(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(hr)]]:["filter-in-small",t,["literal",e]]}}function dr(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function mr(t){return["!",t]}function yr(t){return sr(Dt(t.value))?ar(Lt({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var i=e.value,r=e.key;if("array"!==Ui(i))return[new Pt(r,i,"array expected, "+Ui(i)+" found")];var n,a=e.styleSpec,o=[];if(i.length<1)return[new Pt(r,i,"filter array must have at least 1 element")];switch(o=o.concat(or({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 Pt(r,i,'"$type" cannot be use with operator "'+i[0]+'"'));case"==":case"!=":3!==i.length&&o.push(new Pt(r,i,'filter array for operator "'+i[0]+'" must have 3 elements'));case"in":case"!in":i.length>=2&&"string"!==(n=Ui(i[1]))&&o.push(new Pt(r+"[1]",i[1],"string expected, "+n+" found"));for(var s=2;s<i.length;s++)n=Ui(i[s]),"$type"===zt(i[1])?o=o.concat(or({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 Pt(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=Ui(i[1]),2!==i.length?o.push(new Pt(r,i,'filter array for "'+i[0]+'" operator must have 2 elements')):"string"!==n&&o.push(new Pt(r+"[1]",i[1],"string expected, "+n+" found"))}return o}(t)}function vr(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 kr({key:i,value:a,valueSpec:n.transition,style:r,styleSpec:n});var u,h=t.valueSpec||s[o];if(!h)return[new Pt(i,a,'unknown property "'+o+'"')];if("string"===Ui(a)&&Bi(h)&&!h.tokens&&(u=/^{([^}]+)}$/.exec(a)))return[new Pt(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 Pt(i,a,'use of "text-field" requires a style "glyphs" property')),"text-font"===o&&Ni(Dt(a))&&"identity"===zt(a.type)&&c.push(new Pt(i,a,'"text-font" does not support identity functions'))),c.concat(kr({key:t.key,value:a,valueSpec:h,style:r,styleSpec:n,expressionContext:"property",propertyType:e,propertyKey:o}))}function _r(t){return vr(t,"paint")}function gr(t){return vr(t,"layout")}function xr(t){var e=[],i=t.value,r=t.key,n=t.style,a=t.styleSpec;i.type||i.ref||e.push(new Pt(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 Pt(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 Pt(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 Pt(r,i.ref,"ref cannot reference another ref layer")):s=zt(o.type):e.push(new Pt(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 Pt(r,i.source,'layer "'+i.id+'" requires a raster source')):"raster"===f&&"raster"!==s?e.push(new Pt(r,i.source,'layer "'+i.id+'" requires a vector source')):"vector"!==f||i["source-layer"]?"raster-dem"===f&&"hillshade"!==s?e.push(new Pt(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 Pt(r,i,'layer "'+i.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):e.push(new Pt(r,i,'layer "'+i.id+'" must specify a "source-layer"')):e.push(new Pt(r,i.source,'source "'+i.source+'" not found'))}else e.push(new Pt(r,i,'missing required property "source"'));return e=e.concat(er({key:r,value:i,valueSpec:a.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return kr({key:r+".type",value:i.type,valueSpec:a.layer.type,style:t.style,styleSpec:t.styleSpec,object:i,objectKey:"type"})},filter:yr,layout:function(t){return er({layer:i,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return gr(Lt({layerType:s},t))}}})},paint:function(t){return er({layer:i,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return _r(Lt({layerType:s},t))}}})}}}))}function br(t){var e=t.value,i=t.key,r=Ui(e);return"string"!==r?[new Pt(i,e,"string expected, "+r+" found")]:[]}var wr={promoteId:function(t){var e=t.key,i=t.value;if("string"===Ui(i))return br({key:e,value:i});var r=[];for(var n in i)r.push.apply(r,br({key:e+"."+n,value:i[n]}));return r}};function Mr(t){var e=t.value,i=t.key,r=t.styleSpec,n=t.style;if(!e.type)return[new Pt(i,e,'"type" is required')];var a,o=zt(e.type);switch(o){case"vector":case"raster":case"raster-dem":return er({key:i,value:e,valueSpec:r["source_"+o.replace("-","_")],style:t.style,styleSpec:r,objectElementValidators:wr});case"geojson":if(a=er({key:i,value:e,valueSpec:r.source_geojson,style:n,styleSpec:r,objectElementValidators:wr}),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,ar({key:i+"."+s+".map",value:l[1],expressionContext:"cluster-map"})),a.push.apply(a,ar({key:i+"."+s+".reduce",value:h,expressionContext:"cluster-reduce"}))}return a;case"video":return er({key:i,value:e,valueSpec:r.source_video,style:n,styleSpec:r});case"image":return er({key:i,value:e,valueSpec:r.source_image,style:n,styleSpec:r});case"canvas":return[new Pt(i,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return or({key:i+".type",value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:n,styleSpec:r})}}function Sr(t){var e=t.value,i=t.styleSpec,r=i.light,n=t.style,a=[],o=Ui(e);if(void 0===e)return a;if("object"!==o)return a.concat([new Pt("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?kr({key:s,value:e[s],valueSpec:i.transition,style:n,styleSpec:i}):r[s]?kr({key:s,value:e[s],valueSpec:r[s],style:n,styleSpec:i}):[new Pt(s,e[s],'unknown property "'+s+'"')])}return a}var Er={"*":function(){return[]},array:ir,boolean:function(t){var e=t.value,i=t.key,r=Ui(e);return"boolean"!==r?[new Pt(i,e,"boolean expected, "+r+" found")]:[]},number:rr,color:function(t){var e=t.key,i=t.value,r=Ui(i);return"string"!==r?[new Pt(e,i,"color expected, "+r+" found")]:null===Yt(i)?[new Pt(e,i,'color expected, "'+i+'" found')]:[]},constants:At,enum:or,filter:yr,function:nr,layer:xr,object:er,source:Mr,light:Sr,string:br,formatted:function(t){return 0===br(t).length?[]:ar(t)},resolvedImage:function(t){return 0===br(t).length?[]:ar(t)}};function kr(t){var e=t.value,i=t.valueSpec,r=t.styleSpec;return i.expression&&Ni(zt(e))?nr(t):i.expression&&Hi(Dt(e))?ar(t):i.type&&Er[i.type]?Er[i.type](t):er(Lt({},t,{valueSpec:i.type?r[i.type]:i}))}function Tr(t){var e=t.value,i=t.key,r=br(t);return r.length||(-1===e.indexOf("{fontstack}")&&r.push(new Pt(i,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&r.push(new Pt(i,e,'"glyphs" url must include a "{range}" token'))),r}function Ir(t,e){void 0===e&&(e=Ct);var i=[];return i=i.concat(kr({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:Tr,"*":function(){return[]}}})),t.constants&&(i=i.concat(At({key:"constants",value:t.constants,style:t,styleSpec:e}))),Cr(i)}function Cr(t){return[].concat(t).sort(function(t,e){return t.line-e.line})}function Pr(t){return function(){for(var e=[],i=arguments.length;i--;)e[i]=arguments[i];return Cr(t.apply(this,e))}}Ir.source=Pr(Mr),Ir.light=Pr(Sr),Ir.layer=Pr(xr),Ir.filter=Pr(yr),Ir.paintProperty=Pr(_r),Ir.layoutProperty=Pr(gr);var Ar=Ir,Lr=Ar.light,zr=Ar.paintProperty,Dr=Ar.layoutProperty;function Rr(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 Or=Br;function Br(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}Br.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)},Br.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},Br.prototype._insertCell=function(t,e,i,r,n,a){this.cells[n].push(a)},Br.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},Br.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}}},Br.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}},Br.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},Br.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},Br.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 Fr=self.ImageData,Vr=self.ImageBitmap,Ur={};function Nr(t,e,i){void 0===i&&(i={}),Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),Ur[t]={klass:e,omit:i.omit||[],shallow:i.shallow||[]}}for(var jr in Nr("Object",Object),Or.serialize=function(t,e){var i=t.toArrayBuffer();return e&&e.push(i),{buffer:i}},Or.deserialize=function(t){return new Or(t.buffer)},Nr("Grid",Or),Nr("Color",Qt),Nr("Error",Error),Nr("ResolvedImage",ie),Nr("StylePropertyFunction",tr),Nr("StyleExpression",Ki,{omit:["_evaluator"]}),Nr("ZoomDependentExpression",Qi),Nr("ZoomConstantExpression",Yi),Nr("CompoundExpression",ve,{omit:["_evaluate"]}),Pi)Pi[jr]._classRegistryKey||Nr("Expression_"+jr,Pi[jr]);function qr(t){return t&&"undefined"!=typeof ArrayBuffer&&(t instanceof ArrayBuffer||t.constructor&&"ArrayBuffer"===t.constructor.name)}function Gr(t){return Vr&&t instanceof Vr}function Zr(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(qr(t)||Gr(t))return e&&e.push(t),t;if(ArrayBuffer.isView(t)){var i=t;return e&&e.push(i.buffer),i}if(t instanceof Fr)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(Zr(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)&&!(Ur[s].omit.indexOf(u)>=0)){var h=t[u];l[u]=Ur[s].shallow.indexOf(u)>=0?h:Zr(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 Xr(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||qr(t)||Gr(t)||ArrayBuffer.isView(t)||t instanceof Fr)return t;if(Array.isArray(t))return t.map(Xr);if("object"==typeof t){var e=t.$name||"Object",i=Ur[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]=Ur[e].shallow.indexOf(o)>=0?s:Xr(s)}}return r}throw new Error("can't deserialize object of type "+typeof t)}var Wr=function(){this.first=!0};Wr.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 Kr={"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 Hr(t){for(var e=0,i=t;e<i.length;e+=1)if(Jr(i[e].charCodeAt(0)))return!0;return!1}function Jr(t){return!(746!==t&&747!==t&&(t<4352||!(Kr["Bopomofo Extended"](t)||Kr.Bopomofo(t)||Kr["CJK Compatibility Forms"](t)&&!(t>=65097&&t<=65103)||Kr["CJK Compatibility Ideographs"](t)||Kr["CJK Compatibility"](t)||Kr["CJK Radicals Supplement"](t)||Kr["CJK Strokes"](t)||!(!Kr["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||Kr["CJK Unified Ideographs Extension A"](t)||Kr["CJK Unified Ideographs"](t)||Kr["Enclosed CJK Letters and Months"](t)||Kr["Hangul Compatibility Jamo"](t)||Kr["Hangul Jamo Extended-A"](t)||Kr["Hangul Jamo Extended-B"](t)||Kr["Hangul Jamo"](t)||Kr["Hangul Syllables"](t)||Kr.Hiragana(t)||Kr["Ideographic Description Characters"](t)||Kr.Kanbun(t)||Kr["Kangxi Radicals"](t)||Kr["Katakana Phonetic Extensions"](t)||Kr.Katakana(t)&&12540!==t||!(!Kr["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)||!(!Kr["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||Kr["Unified Canadian Aboriginal Syllabics"](t)||Kr["Unified Canadian Aboriginal Syllabics Extended"](t)||Kr["Vertical Forms"](t)||Kr["Yijing Hexagram Symbols"](t)||Kr["Yi Syllables"](t)||Kr["Yi Radicals"](t))))}function Yr(t){return!(Jr(t)||function(t){return!!(Kr["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||Kr["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)||Kr["Letterlike Symbols"](t)||Kr["Number Forms"](t)||Kr["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)||Kr["Control Pictures"](t)&&9251!==t||Kr["Optical Character Recognition"](t)||Kr["Enclosed Alphanumerics"](t)||Kr["Geometric Shapes"](t)||Kr["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||Kr["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Kr["CJK Symbols and Punctuation"](t)||Kr.Katakana(t)||Kr["Private Use Area"](t)||Kr["CJK Compatibility Forms"](t)||Kr["Small Form Variants"](t)||Kr["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 Qr(t){return t>=1424&&t<=2303||Kr["Arabic Presentation Forms-A"](t)||Kr["Arabic Presentation Forms-B"](t)}function $r(t,e){return!(!e&&Qr(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||Kr.Khmer(t))}function tn(t){for(var e=0,i=t;e<i.length;e+=1)if(Qr(i[e].charCodeAt(0)))return!0;return!1}var en=null,rn="unavailable",nn=null,an=function(t){en&&en(t)};function on(){sn.fire(new kt("pluginStateChange",{pluginStatus:rn,pluginURL:nn}))}var sn=new It,ln=function(){return rn},un=function(){if("deferred"!==rn||!nn)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");rn="loading",on(),nn&&bt({url:nn},function(t){t?an(t):(rn="loaded",on())})},hn={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return"loaded"===rn||null!=hn.applyArabicShaping},isLoading:function(){return"loading"===rn},setState:function(t){rn=t.pluginStatus,nn=t.pluginURL},isParsed:function(){return null!=hn.applyArabicShaping&&null!=hn.processBidirectionalText&&null!=hn.processStyledBidirectionalText},getPluginURL:function(){return nn}},cn=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 Wr,this.transition={})};cn.prototype.isSupportedScript=function(t){return function(t,e){for(var i=0,r=t;i<r.length;i+=1)if(!$r(r[i].charCodeAt(0),e))return!1;return!0}(t,hn.isLoaded())},cn.prototype.crossFadingFactor=function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},cn.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 pn=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(Ni(t))return new tr(t,e);if(Hi(t)){var i=$i(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)};pn.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},pn.prototype.possiblyEvaluate=function(t,e,i){return this.property.possiblyEvaluate(this,t,e,i)};var fn=function(t){this.property=t,this.value=new pn(t,void 0)};fn.prototype.transitioned=function(t,e){return new mn(this.property,this.value,e,h({},t.transition,this.transition),t.now)},fn.prototype.untransitioned=function(){return new mn(this.property,this.value,null,{},0)};var dn=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};dn.prototype.getValue=function(t){return x(this._values[t].value.value)},dn.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new fn(this._values[t].property)),this._values[t].value=new pn(this._values[t].property,null===e?void 0:x(e))},dn.prototype.getTransition=function(t){return x(this._values[t].transition)},dn.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new fn(this._values[t].property)),this._values[t].transition=x(e)||void 0},dn.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},dn.prototype.transitioned=function(t,e){for(var i=new yn(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},dn.prototype.untransitioned=function(){for(var t=new yn(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 mn=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)};mn.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 yn=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};yn.prototype.possiblyEvaluate=function(t,e){for(var i=new gn(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},yn.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 vn=function(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)};vn.prototype.getValue=function(t){return x(this._values[t].value)},vn.prototype.setValue=function(t,e){this._values[t]=new pn(this._values[t].property,null===e?void 0:x(e))},vn.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},vn.prototype.possiblyEvaluate=function(t,e){for(var i=new gn(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 _n=function(t,e,i){this.property=t,this.value=e,this.parameters=i};_n.prototype.isConstant=function(){return"constant"===this.value.kind},_n.prototype.constantOr=function(t){return"constant"===this.value.kind?this.value.value:t},_n.prototype.evaluate=function(t,e,i,r){return this.property.evaluate(this.value,this.parameters,t,e,i,r)};var gn=function(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)};gn.prototype.get=function(t){return this._values[t]};var xn=function(t){this.specification=t};xn.prototype.possiblyEvaluate=function(t,e){return t.expression.evaluate(e)},xn.prototype.interpolate=function(t,e,i){var r=Qe[this.specification.type];return r?r(t,e,i):t};var bn=function(t,e){this.specification=t,this.overrides=e};bn.prototype.possiblyEvaluate=function(t,e,i,r){return new _n(this,"constant"===t.expression.kind||"camera"===t.expression.kind?{kind:"constant",value:t.expression.evaluate(e,null,{},i,r)}:t.expression,e)},bn.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 _n(this,{kind:"constant",value:void 0},t.parameters);var r=Qe[this.specification.type];return r?new _n(this,{kind:"constant",value:r(t.value.value,e.value.value,i)},t.parameters):t},bn.prototype.evaluate=function(t,e,i,r,n,a){return"constant"===t.kind?t.value:t.evaluate(e,i,r,n,a)};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.possiblyEvaluate=function(t,e,i,r){if(void 0===t.value)return new _n(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 _n(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 _n(this,{kind:"constant",value:s},e)}return new _n(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}(bn),Mn=function(t){this.specification=t};Mn.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 cn(Math.floor(e.zoom-1),e)),t.expression.evaluate(new cn(Math.floor(e.zoom),e)),t.expression.evaluate(new cn(Math.floor(e.zoom+1),e)),e)}},Mn.prototype._calculate=function(t,e,i,r){return r.zoom>r.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:i,to:e}},Mn.prototype.interpolate=function(t){return t};var Sn=function(t){this.specification=t};Sn.prototype.possiblyEvaluate=function(t,e,i,r){return!!t.expression.evaluate(e,null,{},i,r)},Sn.prototype.interpolate=function(){return!1};var En=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 pn(i,void 0),n=this.defaultTransitionablePropertyValues[e]=new fn(i);this.defaultTransitioningPropertyValues[e]=n.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=r.possiblyEvaluate({})}};Nr("DataDrivenProperty",bn),Nr("DataConstantProperty",xn),Nr("CrossFadedDataDrivenProperty",wn),Nr("CrossFadedProperty",Mn),Nr("ColorRampProperty",Sn);var kn=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 vn(i.layout)),i.paint)){for(var r in this._transitionablePaint=new dn(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(Dr,"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(zr,"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),g(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)&&Rr(this,t.call(Ar,{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 _n&&Bi(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1},e}(It),Tn={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},In=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},Cn=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function Pn(t,e){void 0===e&&(e=1);var i=0,r=0;return{members:t.map(function(t){var n=Tn[t.type].BYTES_PER_ELEMENT,a=i=An(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:An(i,Math.max(r,e)),alignment:e}}function An(t,e){return Math.ceil(t/e)*e}Cn.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},Cn.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},Cn.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Cn.prototype.clear=function(){this.length=0},Cn.prototype.resize=function(t){this.reserve(t),this.length=t},Cn.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)}},Cn.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var Ln=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}(Cn);Ln.prototype.bytesPerElement=4,Nr("StructArrayLayout2i4",Ln);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.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}(Cn);zn.prototype.bytesPerElement=8,Nr("StructArrayLayout4i8",zn);var Dn=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}(Cn);Dn.prototype.bytesPerElement=12,Nr("StructArrayLayout2i4i12",Dn);var Rn=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}(Cn);Rn.prototype.bytesPerElement=8,Nr("StructArrayLayout2i4ub8",Rn);var On=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}(Cn);On.prototype.bytesPerElement=18,Nr("StructArrayLayout8ui2ub18",On);var Bn=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}(Cn);Bn.prototype.bytesPerElement=24,Nr("StructArrayLayout4i4ui4i24",Bn);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.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}(Cn);Fn.prototype.bytesPerElement=12,Nr("StructArrayLayout3f12",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.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}(Cn);Vn.prototype.bytesPerElement=4,Nr("StructArrayLayout1ul4",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),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}(Cn);Un.prototype.bytesPerElement=24,Nr("StructArrayLayout6i1ul2ui2i24",Un);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.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}(Cn);Nn.prototype.bytesPerElement=12,Nr("StructArrayLayout2i2i2i12",Nn);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.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}(Cn);jn.prototype.bytesPerElement=12,Nr("StructArrayLayout2ub2f12",jn);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),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,m,y){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,m,y)},e.prototype.emplace=function(t,e,i,r,n,a,o,s,l,u,h,c,p,f,d,m,y,v){var _=24*t,g=12*t,x=48*t;return this.int16[_+0]=e,this.int16[_+1]=i,this.uint16[_+2]=r,this.uint16[_+3]=n,this.uint32[g+2]=a,this.uint32[g+3]=o,this.uint32[g+4]=s,this.uint16[_+10]=l,this.uint16[_+11]=u,this.uint16[_+12]=h,this.float32[g+7]=c,this.float32[g+8]=p,this.uint8[x+36]=f,this.uint8[x+37]=d,this.uint8[x+38]=m,this.uint32[g+10]=y,this.int16[_+22]=v,t},e}(Cn);qn.prototype.bytesPerElement=48,Nr("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",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.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,m,y,v,_,g,x,b,w,M,S,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,m,y,v,_,g,x,b,w,M,S,E)},e.prototype.emplace=function(t,e,i,r,n,a,o,s,l,u,h,c,p,f,d,m,y,v,_,g,x,b,w,M,S,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]=m,this.uint16[T+15]=y,this.uint16[T+16]=v,this.uint16[T+17]=_,this.uint16[T+18]=g,this.uint16[T+19]=x,this.uint16[T+20]=b,this.uint16[T+21]=w,this.uint32[I+11]=M,this.float32[I+12]=S,this.float32[I+13]=E,this.float32[I+14]=k,t},e}(Cn);Gn.prototype.bytesPerElement=60,Nr("StructArrayLayout8i14ui1ul3f60",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.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}(Cn);Zn.prototype.bytesPerElement=4,Nr("StructArrayLayout1f4",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)},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}(Cn);Xn.prototype.bytesPerElement=6,Nr("StructArrayLayout3i6",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.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}(Cn);Wn.prototype.bytesPerElement=8,Nr("StructArrayLayout1ul2ui8",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.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}(Cn);Kn.prototype.bytesPerElement=6,Nr("StructArrayLayout3ui6",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.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}(Cn);Hn.prototype.bytesPerElement=4,Nr("StructArrayLayout2ui4",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.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}(Cn);Jn.prototype.bytesPerElement=2,Nr("StructArrayLayout1ui2",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,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}(Cn);Yn.prototype.bytesPerElement=8,Nr("StructArrayLayout2f8",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.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}(Cn);Qn.prototype.bytesPerElement=16,Nr("StructArrayLayout4f16",Qn);var $n=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}(In);$n.prototype.size=24;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.get=function(t){return new $n(this,t)},e}(Un);Nr("CollisionBoxArray",ta);var ea=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}(In);ea.prototype.size=48;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.get=function(t){return new ea(this,t)},e}(qn);Nr("PlacedSymbolArray",ia);var ra=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}(In);ra.prototype.size=60;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.get=function(t){return new ra(this,t)},e}(Gn);Nr("SymbolInstanceArray",na);var aa=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}(Zn);Nr("GlyphOffsetArray",aa);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.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}(Xn);Nr("SymbolLineVertexArray",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={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}(In);sa.prototype.size=8;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}(Wn);Nr("FeatureIndexArray",la);var ua=Pn([{name:"a_pos",components:2,type:"Int16"}],4).members,ha=function(t){void 0===t&&(t=[]),this.segments=t};function ca(t,e){return 256*(t=l(Math.floor(t),0,255))+l(Math.floor(e),0,255)}ha.prototype.prepareSegment=function(t,e,i,r){var n=this.segments[this.segments.length-1];return t>ha.MAX_VERTEX_ARRAY_LENGTH&&w("Max vertices per segment is "+ha.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!n||n.vertexLength+t>ha.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},ha.prototype.get=function(){return this.segments},ha.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()}},ha.simpleSegment=function(t,e,i,r){return new ha([{vertexOffset:t,primitiveOffset:e,vertexLength:i,primitiveLength:r,vaos:{},sortKey:0}])},ha.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Nr("SegmentVector",ha);var pa=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}}),fa=pa,da=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}});fa.murmur3=pa,fa.murmur2=da;var ma=function(){this.ids=[],this.positions=[],this.indexed=!1};ma.prototype.add=function(t,e,i,r){this.ids.push(va(t)),this.positions.push(e,i,r)},ma.prototype.getPositions=function(t){for(var e=va(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},ma.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;_a(e,o,s),_a(i,3*o,3*s),_a(i,3*o+1,3*s+1),_a(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}},ma.deserialize=function(t){var e=new ma;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e};var ya=Math.pow(2,53)-1;function va(t){var e=+t;return!isNaN(e)&&e<=ya?e:fa(String(t))}function _a(t,e,i){var r=t[e];t[e]=t[i],t[i]=r}Nr("FeaturePositionMap",ma);var ga=function(t,e){this.gl=t.gl,this.location=e},xa=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}(ga),ba=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}(ga),wa=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}(ga),Ma=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}(ga),Sa=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}(ga),Ea=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}(ga),ka=new Float32Array(16),Ta=function(t){function e(e,i){t.call(this,e,i),this.current=ka}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}(ga);function Ia(t){return[ca(255*t.r,255*t.g),ca(255*t.b,255*t.a)]}var Ca=function(t,e,i){this.value=t,this.uniformNames=e.map(function(t){return"u_"+t}),this.type=i};Ca.prototype.setUniform=function(t,e,i){t.set(i.constantOr(this.value))},Ca.prototype.getBinding=function(t,e,i){return"color"===this.type?new Ea(t,e):new ba(t,e)};var Pa=function(t,e){this.uniformNames=e.map(function(t){return"u_"+t}),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1};Pa.prototype.setConstantPatternPositions=function(t,e){this.pixelRatioFrom=e.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=e.tlbr,this.patternTo=t.tlbr},Pa.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)},Pa.prototype.getBinding=function(t,e,i){return"u_pattern"===i.substr(0,9)?new Sa(t,e):new ba(t,e)};var Aa=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};Aa.prototype.populatePaintArray=function(t,e,i,r,n){var a=this.paintVertexArray.length,o=this.expression.evaluate(new cn(0),e,{},r,[],n);this.paintVertexArray.resize(t),this._setPaintValue(a,t,o)},Aa.prototype.updatePaintArray=function(t,e,i,r){var n=this.expression.evaluate({zoom:0},i,r);this._setPaintValue(t,e,n)},Aa.prototype._setPaintValue=function(t,e,i){if("color"===this.type)for(var r=Ia(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))}},Aa.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))},Aa.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()};var La=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};La.prototype.populatePaintArray=function(t,e,i,r,n){var a=this.expression.evaluate(new cn(this.zoom),e,{},r,[],n),o=this.expression.evaluate(new cn(this.zoom+1),e,{},r,[],n),s=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(s,t,a,o)},La.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)},La.prototype._setPaintValue=function(t,e,i,r){if("color"===this.type)for(var n=Ia(i),a=Ia(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))}},La.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))},La.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},La.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)},La.prototype.getBinding=function(t,e,i){return new ba(t,e)};var za=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};za.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)},za.prototype.updatePaintArray=function(t,e,i,r,n){this._setPaintValues(t,e,i.patterns&&i.patterns[this.layerId],n)},za.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)}},za.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))},za.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()};var Da=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 _n&&Bi(o.property.specification)){var s=Oa(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 Pa(l.value,s):new Ca(l.value,s,u),n.push("/u_"+a);else if("source"===l.kind||p){var f=Ba(a,u,"source");this.binders[a]=p?new za(l,s,u,h,e,f,t.id):new Aa(l,s,u,f),n.push("/a_"+a)}else{var d=Ba(a,u,"composite");this.binders[a]=new La(l,s,u,h,e,d),n.push("/z_"+a)}}}this.cacheKey=n.sort().join("")};Da.prototype.getMaxValue=function(t){var e=this.binders[t];return e instanceof Aa||e instanceof La?e.maxValue:0},Da.prototype.populatePaintArrays=function(t,e,i,r,n){for(var a in this.binders){var o=this.binders[a];(o instanceof Aa||o instanceof La||o instanceof za)&&o.populatePaintArray(t,e,i,r,n)}},Da.prototype.setConstantPatternPositions=function(t,e){for(var i in this.binders){var r=this.binders[i];r instanceof Pa&&r.setConstantPatternPositions(t,e)}},Da.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 Aa||p instanceof La||p instanceof za)&&!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},Da.prototype.defines=function(){var t=[];for(var e in this.binders){var i=this.binders[e];(i instanceof Ca||i instanceof Pa)&&t.push.apply(t,i.uniformNames.map(function(t){return"#define HAS_UNIFORM_"+t}))}return t},Da.prototype.getPaintVertexBuffers=function(){return this._buffers},Da.prototype.getUniforms=function(t,e){var i=[];for(var r in this.binders){var n=this.binders[r];if(n instanceof Ca||n instanceof Pa||n instanceof La)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},Da.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)}},Da.prototype.updatePaintBuffers=function(t){for(var e in this._buffers=[],this.binders){var i=this.binders[e];if(t&&i instanceof za){var r=2===t.fromScale?i.zoomInPaintVertexBuffer:i.zoomOutPaintVertexBuffer;r&&this._buffers.push(r)}else(i instanceof Aa||i instanceof La)&&i.paintVertexBuffer&&this._buffers.push(i.paintVertexBuffer)}},Da.prototype.upload=function(t){for(var e in this.binders){var i=this.binders[e];(i instanceof Aa||i instanceof La||i instanceof za)&&i.upload(t)}this.updatePaintBuffers()},Da.prototype.destroy=function(){for(var t in this.binders){var e=this.binders[t];(e instanceof Aa||e instanceof La||e instanceof za)&&e.destroy()}};var Ra=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 Da(o,i,r,t)}this.needsUpload=!1,this._featureMap=new ma,this._bufferOffset=0};function Oa(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 Ba(t,e,i){var r={color:{source:Yn,composite:Qn},number:{source:Zn,composite:Yn}},n=function(t){return{"line-pattern":{source:On,composite:On},"fill-pattern":{source:On,composite:On},"fill-extrusion-pattern":{source:On,composite:On}}[t]}(t);return n&&n[i]||r[e][i]}Ra.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},Ra.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}},Ra.prototype.get=function(t){return this.programConfigurations[t]},Ra.prototype.upload=function(t){if(this.needsUpload){for(var e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}},Ra.prototype.destroy=function(){for(var t in this.programConfigurations)this.programConfigurations[t].destroy()},Nr("ConstantBinder",Ca),Nr("CrossFadedConstantBinder",Pa),Nr("SourceExpressionBinder",Aa),Nr("CrossFadedCompositeBinder",za),Nr("CompositeExpressionBinder",La),Nr("ProgramConfiguration",Da,{omit:["_buffers"]}),Nr("ProgramConfigurationSet",Ra);var Fa={min:-1*Math.pow(2,14),max:Math.pow(2,14)-1};function Va(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<Fa.min||o.x>Fa.max||o.y<Fa.min||o.y>Fa.max)&&(w("Geometry exceeds allowed extent, reduce your vector tile buffer size"),o.x=l(o.x,Fa.min,Fa.max),o.y=l(o.y,Fa.min,Fa.max))}return i}function Ua(t,e,i,r,n){t.emplaceBack(2*e+(r+1)/2,2*i+(n+1)/2)}var Na=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 Ln,this.indexArray=new Kn,this.segments=new ha,this.programConfigurations=new Ra(ua,t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter(function(t){return t.isStateDependent()}).map(function(t){return t.id})};function ja(t,e){for(var i=0;i<t.length;i++)if(Ya(e,t[i]))return!0;for(var r=0;r<e.length;r++)if(Ya(t,e[r]))return!0;return!!Xa(t,e)}function qa(t,e,i){return!!Ya(t,e)||!!Ka(e,t,i)}function Ga(t,e){if(1===t.length)return Ja(e,t[0]);for(var i=0;i<e.length;i++)for(var r=e[i],n=0;n<r.length;n++)if(Ya(t,r[n]))return!0;for(var a=0;a<t.length;a++)if(Ja(e,t[a]))return!0;for(var o=0;o<e.length;o++)if(Xa(t,e[o]))return!0;return!1}function Za(t,e,i){if(t.length>1){if(Xa(t,e))return!0;for(var r=0;r<e.length;r++)if(Ka(e[r],t,i))return!0}for(var n=0;n<t.length;n++)if(Ka(t[n],e,i))return!0;return!1}function Xa(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(Wa(r,n,e[a],e[a+1]))return!0;return!1}function Wa(t,e,i,r){return M(t,i,r)!==M(e,i,r)&&M(t,e,i)!==M(t,e,r)}function Ka(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(Ha(t,e[n-1],e[n])<r)return!0;return!1}function Ha(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 Ja(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 Ya(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 Qa(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=M(t,e,i[0]);return a!==M(t,e,i[1])||a!==M(t,e,i[2])||a!==M(t,e,i[3])}function $a(t,e,i){var r=e.paint.get(t).value;return"constant"===r.kind?r.value:i.programConfigurations.get(e.id).getMaxValue(t)}function to(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function eo(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}Na.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?Va(u):[]};if(this.layers[0]._featureFilter.filter(new cn(this.zoom),d,i)){f||(d.geometry=Va(u));var m=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:m})}}a&&n.sort(function(t,e){return t.sortKey-e.sortKey});for(var y=0,v=n;y<v.length;y+=1){var _=v[y],g=_.geometry,x=_.index,b=_.sourceLayerIndex,w=t[x].feature;this.addFeature(_,g,x,i),e.featureIndex.insert(w,g,x,b,this.index)}},Na.prototype.update=function(t,e,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,i)},Na.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Na.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Na.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ua),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},Na.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Na.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;Ua(this.layoutVertexArray,u,h,-1,-1),Ua(this.layoutVertexArray,u,h,1,-1),Ua(this.layoutVertexArray,u,h,1,1),Ua(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)},Nr("CircleBucket",Na,{omit:["layers"]});var io,ro=new En({"circle-sort-key":new bn(Ct.layout_circle["circle-sort-key"])}),no={paint:new En({"circle-radius":new bn(Ct.paint_circle["circle-radius"]),"circle-color":new bn(Ct.paint_circle["circle-color"]),"circle-blur":new bn(Ct.paint_circle["circle-blur"]),"circle-opacity":new bn(Ct.paint_circle["circle-opacity"]),"circle-translate":new xn(Ct.paint_circle["circle-translate"]),"circle-translate-anchor":new xn(Ct.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new xn(Ct.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new xn(Ct.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new bn(Ct.paint_circle["circle-stroke-width"]),"circle-stroke-color":new bn(Ct.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new bn(Ct.paint_circle["circle-stroke-opacity"])}),layout:ro},ao="undefined"!=typeof Float32Array?Float32Array:Array;function oo(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)}),io=new ao(3),ao!=Float32Array&&(io[0]=0,io[1]=0,io[2]=0),function(){var t=new ao(4);ao!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0)}();var so=(function(){var t=new ao(2);ao!=Float32Array&&(t[0]=0,t[1]=0)}(),function(t){function e(e){t.call(this,e,no)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new Na(t)},e.prototype.queryRadius=function(t){var e=t;return $a("circle-radius",this,e)+$a("circle-stroke-width",this,e)+to(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,i,r,n,a,o,s){for(var l=eo(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 lo(t,e)})}(0,s),p=h?u*o:u,f=0,d=r;f<d.length;f+=1)for(var m=0,y=d[f];m<y.length;m+=1){var v=y[m],_=h?v:lo(v,s),g=p,x=oo([],[v.x,v.y,0,1],s);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?g*=x[3]/a.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(g*=a.cameraToCenterDistance/x[3]),qa(c,_,g))return!0}return!1},e}(kn));function lo(t,e){var i=oo([],[t.x,t.y,0,1],e);return new n(i[0]/i[3],i[1]/i[3])}var uo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(Na);function ho(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 co(t,e,i){var r=e.width,n=e.height;if(r!==t.width||n!==t.height){var a=ho({},{width:r,height:n},i);po(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 po(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}Nr("HeatmapBucket",uo,{omit:["layers"]});var fo=function(t,e){ho(this,t,1,e)};fo.prototype.resize=function(t){co(this,t,1)},fo.prototype.clone=function(){return new fo({width:this.width,height:this.height},new Uint8Array(this.data))},fo.copy=function(t,e,i,r,n){po(t,e,i,r,n,1)};var mo=function(t,e){ho(this,t,4,e)};mo.prototype.resize=function(t){co(this,t,4)},mo.prototype.replace=function(t,e){e?this.data.set(t):this.data=t instanceof Uint8ClampedArray?new Uint8Array(t.buffer):t},mo.prototype.clone=function(){return new mo({width:this.width,height:this.height},new Uint8Array(this.data))},mo.copy=function(t,e,i,r,n){po(t,e,i,r,n,4)},Nr("AlphaImage",fo),Nr("RGBAImage",mo);var yo={paint:new En({"heatmap-radius":new bn(Ct.paint_heatmap["heatmap-radius"]),"heatmap-weight":new bn(Ct.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new xn(Ct.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Sn(Ct.paint_heatmap["heatmap-color"]),"heatmap-opacity":new xn(Ct.paint_heatmap["heatmap-opacity"])})};function vo(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 mo({width:256,height:1},i)}var _o=function(t){function e(e){t.call(this,e,yo),this._updateColorRamp()}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new uo(t)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){"heatmap-color"===t&&this._updateColorRamp()},e.prototype._updateColorRamp=function(){this.colorRamp=vo(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}(kn),go={paint:new En({"hillshade-illumination-direction":new xn(Ct.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new xn(Ct.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new xn(Ct.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new xn(Ct.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new xn(Ct.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new xn(Ct.paint_hillshade["hillshade-accent-color"])})},xo=function(t){function e(e){t.call(this,e,go)}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}(kn),bo=Pn([{name:"a_pos",components:2,type:"Int16"}],4).members,wo=So,Mo=So;function So(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=Eo(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=Eo(t,e[n]*r,n<a-1?e[n+1]*r:t.length,r,!1))===o.next&&(o.steiner=!0),s.push(Oo(o));for(s.sort(Lo),n=0;n<s.length;n++)i=zo(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 To(p,f,i,r,n,u,0),f}function Eo(t,e,i,r,n){var a,o;if(n===Ho(t,e,i,r)>0)for(a=e;a<i;a+=r)o=Xo(a,t[a],t[a+1],o);else for(a=i-r;a>=e;a-=r)o=Xo(a,t[a],t[a+1],o);return o&&Uo(o,o.next)&&(Wo(o),o=o.next),o}function ko(t,e){if(!t)return t;e||(e=t);var i,r=t;do{if(i=!1,r.steiner||!Uo(r,r.next)&&0!==Vo(r.prev,r,r.next))r=r.next;else{if(Wo(r),(r=e=r.prev)===r.next)break;i=!0}}while(i||r!==e);return e}function To(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=Ro(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?Co(t,r,n,a):Io(t))e.push(s.i/i|0),e.push(t.i/i|0),e.push(l.i/i|0),Wo(t),t=l.next,u=l.next;else if((t=l)===u){o?1===o?To(t=Po(ko(t),e,i),e,i,r,n,a,2):2===o&&Ao(t,e,i,r,n,a):To(ko(t),e,i,r,n,a,1);break}}}function Io(t){var e=t.prev,i=t,r=t.next;if(Vo(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&&Bo(n,s,a,l,o,u,d.x,d.y)&&Vo(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function Co(t,e,i,r){var n=t.prev,a=t,o=t.next;if(Vo(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,m=s>l?s>u?s:u:l>u?l:u,y=h>c?h>p?h:p:c>p?c:p,v=Ro(f,d,e,i,r),_=Ro(m,y,e,i,r),g=t.prevZ,x=t.nextZ;g&&g.z>=v&&x&&x.z<=_;){if(g.x>=f&&g.x<=m&&g.y>=d&&g.y<=y&&g!==n&&g!==o&&Bo(s,h,l,c,u,p,g.x,g.y)&&Vo(g.prev,g,g.next)>=0)return!1;if(g=g.prevZ,x.x>=f&&x.x<=m&&x.y>=d&&x.y<=y&&x!==n&&x!==o&&Bo(s,h,l,c,u,p,x.x,x.y)&&Vo(x.prev,x,x.next)>=0)return!1;x=x.nextZ}for(;g&&g.z>=v;){if(g.x>=f&&g.x<=m&&g.y>=d&&g.y<=y&&g!==n&&g!==o&&Bo(s,h,l,c,u,p,g.x,g.y)&&Vo(g.prev,g,g.next)>=0)return!1;g=g.prevZ}for(;x&&x.z<=_;){if(x.x>=f&&x.x<=m&&x.y>=d&&x.y<=y&&x!==n&&x!==o&&Bo(s,h,l,c,u,p,x.x,x.y)&&Vo(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function Po(t,e,i){var r=t;do{var n=r.prev,a=r.next.next;!Uo(n,a)&&No(n,r,r.next,a)&&Go(n,a)&&Go(a,n)&&(e.push(n.i/i|0),e.push(r.i/i|0),e.push(a.i/i|0),Wo(r),Wo(r.next),r=t=a),r=r.next}while(r!==t);return ko(r)}function Ao(t,e,i,r,n,a){var o=t;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&Fo(o,s)){var l=Zo(o,s);return o=ko(o,o.next),l=ko(l,l.next),To(o,e,i,r,n,a,0),void To(l,e,i,r,n,a,0)}s=s.next}o=o.next}while(o!==t)}function Lo(t,e){return t.x-e.x}function zo(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&&Bo(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),Go(r,t)&&(l<p||l===p&&(r.x>i.x||r.x===i.x&&Do(i,r)))&&(i=r,p=l)),r=r.next}while(r!==u);return i}(t,e);if(!i)return e;var r=Zo(i,t);return ko(r,r.next),ko(i,i.next)}function Do(t,e){return Vo(t.prev,t,e.prev)<0&&Vo(e.next,t,t.next)<0}function Ro(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 Oo(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 Bo(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 Fo(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&&No(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(Go(t,e)&&Go(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)&&(Vo(t.prev,t,e.prev)||Vo(t,e.prev,e))||Uo(t,e)&&Vo(t.prev,t,t.next)>0&&Vo(e.prev,e,e.next)>0)}function Vo(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function Uo(t,e){return t.x===e.x&&t.y===e.y}function No(t,e,i,r){var n=qo(Vo(t,e,i)),a=qo(Vo(t,e,r)),o=qo(Vo(i,r,t)),s=qo(Vo(i,r,e));return n!==a&&o!==s||!(0!==n||!jo(t,i,e))||!(0!==a||!jo(t,r,e))||!(0!==o||!jo(i,t,r))||!(0!==s||!jo(i,e,r))}function jo(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 qo(t){return t>0?1:t<0?-1:0}function Go(t,e){return Vo(t.prev,t,t.next)<0?Vo(t,e,t.next)>=0&&Vo(t,t.prev,e)>=0:Vo(t,e,t.prev)<0||Vo(t,t.next,e)<0}function Zo(t,e){var i=new Ko(t.i,t.x,t.y),r=new Ko(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 Xo(t,e,i,r){var n=new Ko(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 Wo(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 Ko(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 Ho(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 Jo(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(Yo(e,r,i),a(e[n],c)>0&&Yo(e,r,n);p<f;){for(Yo(e,p,f),p++,f--;a(e[p],c)<0;)p++;for(;a(e[f],c)>0;)f--}0===a(e[r],c)?Yo(e,r,f):Yo(e,++f,n),f<=i&&(r=f+1),i<=f&&(n=f-1)}}(t,e,i||0,r||t.length-1,n||Qo)}function Yo(t,e,i){var r=t[e];t[e]=t[i],t[i]=r}function Qo(t,e){return t<e?-1:t>e?1:0}function $o(t,e){var i=t.length;if(i<=1)return[t];for(var r,n,a=[],o=0;o<i;o++){var s=S(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||(Jo(a[l],e,1,a[l].length-1,ts),a[l]=a[l].slice(0,e));return a}function ts(t,e){return e.area-t.area}function es(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 is(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}So.deviation=function(t,e,i,r){var n=e&&e.length,a=Math.abs(Ho(t,0,n?e[0]*i:t.length,i));if(n)for(var o=0,s=e.length;o<s;o++)a-=Math.abs(Ho(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)},So.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},wo.default=Mo;var rs=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 Ln,this.indexArray=new Kn,this.indexArray2=new Hn,this.programConfigurations=new Ra(bo,t.layers,t.zoom),this.segments=new ha,this.segments2=new ha,this.stateDependentLayerIds=this.layers.filter(function(t){return t.isStateDependent()}).map(function(t){return t.id})};rs.prototype.populate=function(t,e,i){this.hasPattern=es("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?Va(l):[]};if(this.layers[0]._featureFilter.filter(new cn(this.zoom),f,i)){p||(f.geometry=Va(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 m=0,y=n;m<y.length;m+=1){var v=y[m],_=v.geometry,g=v.index,x=v.sourceLayerIndex;if(this.hasPattern){var b=is("fill",this.layers,v,this.zoom,e);this.patternFeatures.push(b)}else this.addFeature(v,_,g,i,{});e.featureIndex.insert(t[g].feature,_,g,x,this.index)}},rs.prototype.update=function(t,e,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,i)},rs.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)}},rs.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},rs.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},rs.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,bo),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0},rs.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},rs.prototype.addFeature=function(t,e,i,r,n){for(var a=0,o=$o(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=[],m=0,y=s;m<y.length;m+=1){var v=y[m];if(0!==v.length){v!==s[0]&&d.push(f.length/2);var _=this.segments2.prepareSegment(v.length,this.layoutVertexArray,this.indexArray2),g=_.vertexLength;this.layoutVertexArray.emplaceBack(v[0].x,v[0].y),this.indexArray2.emplaceBack(g+v.length-1,g),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(g+x-1,g+x),f.push(v[x].x),f.push(v[x].y);_.vertexLength+=v.length,_.primitiveLength+=v.length}}for(var b=wo(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)},Nr("FillBucket",rs,{omit:["layers","patternFeatures"]});var ns=new En({"fill-sort-key":new bn(Ct.layout_fill["fill-sort-key"])}),as={paint:new En({"fill-antialias":new xn(Ct.paint_fill["fill-antialias"]),"fill-opacity":new bn(Ct.paint_fill["fill-opacity"]),"fill-color":new bn(Ct.paint_fill["fill-color"]),"fill-outline-color":new bn(Ct.paint_fill["fill-outline-color"]),"fill-translate":new xn(Ct.paint_fill["fill-translate"]),"fill-translate-anchor":new xn(Ct.paint_fill["fill-translate-anchor"]),"fill-pattern":new wn(Ct.paint_fill["fill-pattern"])}),layout:ns},os=function(t){function e(e){t.call(this,e,as)}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 rs(t)},e.prototype.queryRadius=function(){return to(this.paint.get("fill-translate"))},e.prototype.queryIntersectsFeature=function(t,e,i,r,n,a,o){return Ga(eo(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),a.angle,o),r)},e.prototype.isTileClipped=function(){return!0},e}(kn),ss=Pn([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,ls=us;function us(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(hs,this,e)}function hs(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 cs(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}us.types=["Unknown","Point","LineString","Polygon"],us.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},us.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]},us.prototype.toGeoJSON=function(t,e,i){var r,n,a=this.extent*Math.pow(2,i),o=this.extent*t,s=this.extent*e,l=this.loadGeometry(),u=us.types[this.type];function h(t){for(var e=0;e<t.length;e++){var i=t[e];t[e]=[360*(i.x+o)/a-180,360/Math.PI*Math.atan(Math.exp((180-360*(i.y+s)/a)*Math.PI/180))-90]}}switch(this.type){case 1:var c=[];for(r=0;r<l.length;r++)c[r]=l[r][0];h(l=c);break;case 2:for(r=0;r<l.length;r++)h(l[r]);break;case 3:for(l=function(t){var e=t.length;if(e<=1)return[t];for(var i,r,n=[],a=0;a<e;a++){var o=cs(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}(l),r=0;r<l.length;r++)for(n=0;n<l[r].length;n++)h(l[r][n])}1===l.length?l=l[0]:u="Multi"+u;var p={type:"Feature",geometry:{type:u,coordinates:l},properties:this.properties};return"id"in this&&(p.id=this.id),p};var ps=fs;function fs(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(ds,this,e),this.length=this._features.length}function ds(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 ms(t,e,i){if(3===t){var r=new ps(i,i.readVarint()+i.pos);r.length&&(e[r.name]=r)}}fs.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 ls(this._pbf,e,this.extent,this._keys,this._values)};var ys={VectorTile:function(t,e){this.layers=t.readFields(ms,{},e)},VectorTileFeature:ls,VectorTileLayer:ps},vs=ys.VectorTileFeature.types,_s=Math.pow(2,13);function gs(t,e,i,r,n,a,o,s){t.emplaceBack(e,i,2*Math.floor(r*_s)+o,n*_s*2,a*_s*2,Math.round(s))}var xs=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 Dn,this.indexArray=new Kn,this.programConfigurations=new Ra(ss,t.layers,t.zoom),this.segments=new ha,this.stateDependentLayerIds=this.layers.filter(function(t){return t.isStateDependent()}).map(function(t){return t.id})};function bs(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}xs.prototype.populate=function(t,e,i){this.features=[],this.hasPattern=es("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?Va(o):[]};if(this.layers[0]._featureFilter.filter(new cn(this.zoom),c,i)){var p={id:s,sourceLayerIndex:u,index:l,geometry:h?c.geometry:Va(o),properties:o.properties,type:o.type,patterns:{}};void 0!==o.id&&(p.id=o.id),this.hasPattern?this.features.push(is("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)}}},xs.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)}},xs.prototype.update=function(t,e,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,i)},xs.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},xs.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},xs.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ss),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},xs.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},xs.prototype.addFeature=function(t,e,i,r,n){for(var a=0,o=$o(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 m=0,y=0;y<d.length;y++){var v=d[y];if(y>=1){var _=d[y-1];if(!bs(v,_)){c.vertexLength+4>ha.MAX_VERTEX_ARRAY_LENGTH&&(c=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var g=v.sub(_)._perp()._unit(),x=_.dist(v);m+x>32768&&(m=0),gs(this.layoutVertexArray,v.x,v.y,g.x,g.y,0,0,m),gs(this.layoutVertexArray,v.x,v.y,g.x,g.y,0,1,m),gs(this.layoutVertexArray,_.x,_.y,g.x,g.y,0,0,m+=x),gs(this.layoutVertexArray,_.x,_.y,g.x,g.y,0,1,m);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>ha.MAX_VERTEX_ARRAY_LENGTH&&(c=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray)),"Polygon"===vs[t.type]){for(var w=[],M=[],S=c.vertexLength,E=0,k=s;E<k.length;E+=1){var T=k[E];if(0!==T.length){T!==s[0]&&M.push(w.length/2);for(var I=0;I<T.length;I++){var C=T[I];gs(this.layoutVertexArray,C.x,C.y,0,0,1,1,0),w.push(C.x),w.push(C.y)}}}for(var P=wo(w,M),A=0;A<P.length;A+=3)this.indexArray.emplaceBack(S+P[A],S+P[A+2],S+P[A+1]);c.primitiveLength+=P.length/3,c.vertexLength+=l}}var L;this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,n,r)},Nr("FillExtrusionBucket",xs,{omit:["layers","features"]});var ws={paint:new En({"fill-extrusion-opacity":new xn(Ct["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new bn(Ct["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new xn(Ct["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new xn(Ct["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new wn(Ct["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new bn(Ct["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new bn(Ct["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new xn(Ct["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})},Ms=function(t){function e(e){t.call(this,e,ws)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new xs(t)},e.prototype.queryRadius=function(){return to(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=eo(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];oo(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,m=0,y=t;m<y.length;m+=1){for(var v=[],_=[],g=0,x=y[m];g<x.length;g+=1){var b=x[g],w=b.x,M=b.y,S=r[0]*w+r[4]*M+r[12],E=r[1]*w+r[5]*M+r[13],k=r[2]*w+r[6]*M+r[14],T=r[3]*w+r[7]*M+r[15],I=k+u,C=T+h,P=S+c,A=E+p,L=k+f,z=T+d,D=new n((S+s)/C,(E+l)/C);D.z=I/C,v.push(D);var R=new n(P/z,A/z);R.z=L/z,_.push(R)}a.push(v),o.push(_)}return[a,o]}(r,c,h,l);return function(t,e,i){var r=1/0;Ga(i,e)&&(r=Es(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];ja(i,u)&&(r=Math.min(r,Es(i,u)))}return r!==1/0&&r}(f[0],f[1],p)},e}(kn);function Ss(t,e){return t.x*e.x+t.y*e.y}function Es(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=Ss(s,s),c=Ss(s,l),p=Ss(l,l),f=Ss(u,s),d=Ss(u,l),m=h*p-c*c,y=(p*f-c*d)/m,v=(h*d-c*f)/m,_=n.z*(1-y-v)+i.z*y+a.z*v;if(isFinite(_))return _}return 1/0}for(var g=1/0,x=0,b=e;x<b.length;x+=1)g=Math.min(g,b[x].z);return g}var ks=Pn([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,Ts=ys.VectorTileFeature.types,Is=Math.cos(Math.PI/180*37.5),Cs=Math.pow(2,14)/.5,Ps=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 Rn,this.indexArray=new Kn,this.programConfigurations=new Ra(ks,t.layers,t.zoom),this.segments=new ha,this.stateDependentLayerIds=this.layers.filter(function(t){return t.isStateDependent()}).map(function(t){return t.id})};Ps.prototype.populate=function(t,e,i){this.hasPattern=es("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?Va(l):[]};if(this.layers[0]._featureFilter.filter(new cn(this.zoom),f,i)){p||(f.geometry=Va(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 m=0,y=n;m<y.length;m+=1){var v=y[m],_=v.geometry,g=v.index,x=v.sourceLayerIndex;if(this.hasPattern){var b=is("line",this.layers,v,this.zoom,e);this.patternFeatures.push(b)}else this.addFeature(v,_,g,i,{});e.featureIndex.insert(t[g].feature,_,g,x,this.index)}},Ps.prototype.update=function(t,e,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,i)},Ps.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)}},Ps.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Ps.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Ps.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ks),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},Ps.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Ps.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)},Ps.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"===Ts[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,m=void 0,y=void 0;this.e1=this.e2=-1,s&&(y=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)){y&&(m=y),h&&(f=h),h=t[v],y=d?d.sub(h)._unit()._perp():m;var _=(m=m||y).add(y);0===_.x&&0===_.y||_._unit();var g=m.x*y.x+m.y*y.y,x=_.x*y.x+_.y*y.y,b=0!==x?1/x:1/0,w=2*Math.sqrt(2-2*x),M=x<Is&&f&&d,S=m.x*y.y-m.y*y.x>0;if(M&&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,m,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)_._mult(b),this.addCurrentVertex(h,_,0,0,p);else if("flipbevel"===I){if(b>100)_=y.mult(-1);else{var C=b*m.add(y).mag()/m.sub(y).mag();_._perp()._mult(C*(S?-1:1))}this.addCurrentVertex(h,_,0,0,p),this.addCurrentVertex(h,_.mult(-1),0,0,p)}else if("bevel"===I||"fakeround"===I){var P=-Math.sqrt(b*b-1),A=S?P:0,L=S?0:P;if(f&&this.addCurrentVertex(h,m,A,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+g*(g*(3.55645-1.43519*g)-3.2452))*O*O+(.848013+g*(.215638*g-1.06021)))}var B=y.sub(m)._mult(R)._add(m)._unit()._mult(S?-1:1);this.addHalfVertex(h,B.x,B.y,!1,S,0,p)}d&&this.addCurrentVertex(h,y,-A,-L,p)}else if("butt"===I)this.addCurrentVertex(h,_,0,0,p);else if("square"===I){var F=f?1:-1;this.addCurrentVertex(h,_,F,F,p)}else"round"===I&&(f&&(this.addCurrentVertex(h,m,0,0,p),this.addCurrentVertex(h,m,1,1,p,!0)),d&&(this.addCurrentVertex(h,y,-1,-1,p,!0),this.addCurrentVertex(h,y,0,0,p)));if(M&&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,y,0,0,p),h=U}}}}},Ps.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>Cs/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,i,r,n,a))},Ps.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},Ps.prototype.updateScaledDistance=function(){this.scaledDistance=this.totalDistance>0?(this.clipStart+(this.clipEnd-this.clipStart)*this.distance/this.totalDistance)*(Cs-1):this.distance},Ps.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.updateScaledDistance()},Nr("LineBucket",Ps,{omit:["layers","patternFeatures"]});var As=new En({"line-cap":new xn(Ct.layout_line["line-cap"]),"line-join":new bn(Ct.layout_line["line-join"]),"line-miter-limit":new xn(Ct.layout_line["line-miter-limit"]),"line-round-limit":new xn(Ct.layout_line["line-round-limit"]),"line-sort-key":new bn(Ct.layout_line["line-sort-key"])}),Ls={paint:new En({"line-opacity":new bn(Ct.paint_line["line-opacity"]),"line-color":new bn(Ct.paint_line["line-color"]),"line-translate":new xn(Ct.paint_line["line-translate"]),"line-translate-anchor":new xn(Ct.paint_line["line-translate-anchor"]),"line-width":new bn(Ct.paint_line["line-width"]),"line-gap-width":new bn(Ct.paint_line["line-gap-width"]),"line-offset":new bn(Ct.paint_line["line-offset"]),"line-blur":new bn(Ct.paint_line["line-blur"]),"line-dasharray":new Mn(Ct.paint_line["line-dasharray"]),"line-pattern":new wn(Ct.paint_line["line-pattern"]),"line-gradient":new Sn(Ct.paint_line["line-gradient"])}),layout:As},zs=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 cn(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}(bn))(Ls.paint.properties["line-width"].specification);zs.useIntegerZoom=!0;var Ds=function(t){function e(e){t.call(this,e,Ls)}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=vo(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"]=zs.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new Ps(t)},e.prototype.queryRadius=function(t){var e=t,i=Rs($a("line-width",this,e),$a("line-gap-width",this,e)),r=$a("line-offset",this,e);return i/2+Math.abs(r)+to(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,i,r,a,o,s){var l=eo(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),o.angle,s),u=s/2*Rs(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(Ya(t,n[a]))return!0;if(Za(t,n,i))return!0}return!1}(l,r,u)},e.prototype.isTileClipped=function(){return!0},e}(kn);function Rs(t,e){return e>0?e+2*t:t}var Os=Pn([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Bs=Pn([{name:"a_projected_pos",components:3,type:"Float32"}],4),Fs=(Pn([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Pn([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Vs=(Pn([{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"}]),Pn([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),Us=Pn([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4);function Ns(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()),hn.applyArabicShaping&&(t=hn.applyArabicShaping(t)),t}(t.text,e,i)}),t}Pn([{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"}]),Pn([{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"}]),Pn([{type:"Float32",name:"offsetX"}]),Pn([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var js={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},qs=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)},Gs=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,m=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*m},Zs=Xs;function Xs(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Xs.Varint=0,Xs.Fixed64=1,Xs.Bytes=2,Xs.Fixed32=5;var Ws="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function Ks(t){return t.type===Xs.Bytes?t.readVarint()+t.pos:t.pos+1}function Hs(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Js(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 Ys(t,e){for(var i=0;i<t.length;i++)e.writeVarint(t[i])}function Qs(t,e){for(var i=0;i<t.length;i++)e.writeSVarint(t[i])}function $s(t,e){for(var i=0;i<t.length;i++)e.writeFloat(t[i])}function tl(t,e){for(var i=0;i<t.length;i++)e.writeDouble(t[i])}function el(t,e){for(var i=0;i<t.length;i++)e.writeBoolean(t[i])}function il(t,e){for(var i=0;i<t.length;i++)e.writeFixed32(t[i])}function rl(t,e){for(var i=0;i<t.length;i++)e.writeSFixed32(t[i])}function nl(t,e){for(var i=0;i<t.length;i++)e.writeFixed64(t[i])}function al(t,e){for(var i=0;i<t.length;i++)e.writeSFixed64(t[i])}function ol(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function sl(t,e,i){t[i]=e,t[i+1]=e>>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function ll(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function ul(t,e,i){1===t&&i.readMessage(hl,e)}function hl(t,e,i){if(3===t){var r=i.readMessage(cl,{}),n=r.width,a=r.height,o=r.left,s=r.top,l=r.advance;e.push({id:r.id,bitmap:new fo({width:n+6,height:a+6},r.bitmap),metrics:{width:n,height:a,left:o,top:s,advance:l}})}}function cl(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 pl(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}}Xs.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=ol(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=ll(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=ol(this.buf,this.pos)+4294967296*ol(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=ol(this.buf,this.pos)+4294967296*ll(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=qs(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=qs(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 Hs(t,r,e);if(r|=(127&(n=a[i.pos++]))<<3,n<128)return Hs(t,r,e);if(r|=(127&(n=a[i.pos++]))<<10,n<128)return Hs(t,r,e);if(r|=(127&(n=a[i.pos++]))<<17,n<128)return Hs(t,r,e);if(r|=(127&(n=a[i.pos++]))<<24,n<128)return Hs(t,r,e);if(r|=(1&(n=a[i.pos++]))<<31,n<128)return Hs(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&&Ws?function(t,e,i){return Ws.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!==Xs.Bytes)return t.push(this.readVarint(e));var i=Ks(this);for(t=t||[];this.pos<i;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==Xs.Bytes)return t.push(this.readSVarint());var e=Ks(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==Xs.Bytes)return t.push(this.readBoolean());var e=Ks(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==Xs.Bytes)return t.push(this.readFloat());var e=Ks(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==Xs.Bytes)return t.push(this.readDouble());var e=Ks(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==Xs.Bytes)return t.push(this.readFixed32());var e=Ks(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==Xs.Bytes)return t.push(this.readSFixed32());var e=Ks(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==Xs.Bytes)return t.push(this.readFixed64());var e=Ks(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==Xs.Bytes)return t.push(this.readSFixed64());var e=Ks(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===Xs.Varint)for(;this.buf[this.pos++]>127;);else if(e===Xs.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Xs.Fixed32)this.pos+=4;else{if(e!==Xs.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),sl(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),sl(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),sl(this.buf,-1&t,this.pos),sl(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),sl(this.buf,-1&t,this.pos),sl(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&&Js(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),Gs(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Gs(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&&Js(i,r,this),this.pos=i-1,this.writeVarint(r),this.pos+=r},writeMessage:function(t,e,i){this.writeTag(t,Xs.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Ys,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Qs,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,el,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,$s,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,tl,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,il,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,rl,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,nl,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,al,e)},writeBytesField:function(t,e){this.writeTag(t,Xs.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Xs.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Xs.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Xs.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Xs.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Xs.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Xs.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Xs.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Xs.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Xs.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var fl=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},dl={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};dl.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},dl.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},dl.tlbr.get=function(){return this.tl.concat(this.br)},dl.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(fl.prototype,dl);var ml=function(t,e){var i={},r={};this.haveRenderCallbacks=[];var n=[];this.addImages(t,i,n),this.addImages(e,r,n);var a=pl(n),o=new mo({width:a.w||1,height:a.h||1});for(var s in t){var l=t[s],u=i[s].paddedRect;mo.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,m=c.data.width,y=c.data.height;mo.copy(c.data,o,{x:0,y:0},{x:f,y:d},c.data),mo.copy(c.data,o,{x:0,y:y-1},{x:f,y:d-1},{width:m,height:1}),mo.copy(c.data,o,{x:0,y:0},{x:f,y:d+y},{width:m,height:1}),mo.copy(c.data,o,{x:m-1,y:0},{x:f-1,y:d},{width:1,height:y}),mo.copy(c.data,o,{x:0,y:0},{x:f+m,y:d},{width:1,height:y})}this.image=o,this.iconPositions=i,this.patternPositions=r};ml.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 fl(a,n),n.hasRenderCallback&&this.haveRenderCallbacks.push(r)}},ml.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)},ml.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]})}},Nr("ImagePosition",fl),Nr("ImageAtlas",ml);var yl={horizontal:1,vertical:2,horizontalOnly:3},vl=function(){this.scale=1,this.fontStack="",this.imageName=null};vl.forText=function(t,e){var i=new vl;return i.scale=t||1,i.fontStack=e,i},vl.forImage=function(t){var e=new vl;return e.imageName=t,e};var _l=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function gl(t,e,i,r,n,a,o,s,l,u,h,c,p,f,d,m){var y,v=_l.fromFeature(t,n);c===yl.vertical&&v.verticalizePunctuation();var _=hn.processBidirectionalText,g=hn.processStyledBidirectionalText;if(_&&1===v.sections.length){y=[];for(var x=0,b=_(v.toString(),kl(v,u,a,e,r,f,d));x<b.length;x+=1){var w=b[x],M=new _l;M.text=w,M.sections=v.sections;for(var S=0;S<w.length;S++)M.sectionIndex.push(0);y.push(M)}}else if(g){y=[];for(var E=0,k=g(v.text,v.sectionIndex,kl(v,u,a,e,r,f,d));E<k.length;E+=1){var T=k[E],I=new _l;I.text=T[0],I.sectionIndex=T[1],I.sections=v.sections,y.push(I)}}else y=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,kl(v,u,a,e,r,f,d));var C=[],P={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,m=0,y="right"===s?1:"left"===s?0:.5,v=0,_=0,g=n;_<g.length;_+=1){var x=g[_];x.trim();var b=x.getMaxScale(),w=24*(b-1),M={positionedGlyphs:[],lineOffset:0};t.positionedLines[v]=M;var S=M.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),P=0,A=null,L=null,z=null,D=24,R=!(l===yl.horizontal||!h&&!Jr(C)||h&&(xl[C]||(G=C,Kr.Arabic(G)||Kr["Arabic Supplement"](G)||Kr["Arabic Extended-A"](G)||Kr["Arabic Presentation Forms-A"](G)||Kr["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,P=w+(24-B[1]*T.scale),D=(A={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,A=U.metrics;else{var N=e[T.fontStack],j=N&&N[C];if(!j)continue;A=j.metrics}P=24*(b-T.scale)}R?(t.verticalizable=!0,S.push({glyph:C,imageName:z,x:p,y:f+P,vertical:R,scale:T.scale,fontStack:T.fontStack,sectionIndex:I,metrics:A,rect:L}),p+=D*T.scale+u):(S.push({glyph:C,imageName:z,x:p,y:f+P,vertical:R,scale:T.scale,fontStack:T.fontStack,sectionIndex:I,metrics:A,rect:L}),p+=A.advance*T.scale+u)}0!==S.length&&(d=Math.max(p-u,d),Il(S,0,S.length-1,y,E)),p=0;var q=a*b+E;M.lineOffset=Math.max(E,w),f+=q,m=Math.max(q,m),++v}else f+=a,++v}var G,Z=f- -17,X=Tl(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 m=d[f];m.x+=h,m.y+=u}})(t.positionedLines,y,W,K,d,m,a,Z,n.length),t.top+=-K*Z,t.bottom=t.top+Z,t.left+=-W*d,t.right=t.left+d}(P,e,i,r,y,o,s,l,c,u,p,m),!function(t){for(var e=0,i=C;e<i.length;e+=1)if(0!==i[e].positionedGlyphs.length)return!1;return!0}()&&P}_l.fromFeature=function(t,e){for(var i=new _l,r=0;r<t.sections.length;r++){var n=t.sections[r];n.image?i.addImageSection(n):i.addTextSection(n,e)}return i},_l.prototype.length=function(){return this.text.length},_l.prototype.getSection=function(t){return this.sections[this.sectionIndex[t]]},_l.prototype.getSectionIndex=function(t){return this.sectionIndex[t]},_l.prototype.getCharCode=function(t){return this.text.charCodeAt(t)},_l.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&&Yr(r)&&!js[t[i+1]]||n&&Yr(n)&&!js[t[i-1]]||!js[t[i]]?t[i]:js[t[i]]}return e}(this.text)},_l.prototype.trim=function(){for(var t=0,e=0;e<this.text.length&&xl[this.text.charCodeAt(e)];e++)t++;for(var i=this.text.length,r=this.text.length-1;r>=0&&r>=t&&xl[this.text.charCodeAt(r)];r--)i--;this.text=this.text.substring(t,i),this.sectionIndex=this.sectionIndex.slice(t,i)},_l.prototype.substring=function(t,e){var i=new _l;return i.text=this.text.substring(t,e),i.sectionIndex=this.sectionIndex.slice(t,e),i.sections=this.sections,i},_l.prototype.toString=function(){return this.text},_l.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce(function(e,i){return Math.max(e,t.sections[i].scale)},0)},_l.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(vl.forText(t.scale,t.fontStack||e));for(var i=this.sections.length-1,r=0;r<t.text.length;++r)this.sectionIndex.push(i)},_l.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(vl.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.")},_l.prototype.getNextImageSectionCharCode=function(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var xl={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},bl={};function wl(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 Ml(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 Sl(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 El(t,e,i,r,n,a){for(var o=null,s=Ml(e,i,n,a),l=0,u=r;l<u.length;l+=1){var h=u[l],c=Ml(e-h.x,i,n,a)+h.badness;c<=s&&(o=h,s=c)}return{index:t,x:e,priorBreak:o,badness:s}}function kl(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+=wl(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(xl[d]||(c+=wl(d,f,r,n,e,o)),p<t.length()-1){var m=!((s=d)<11904||!(Kr["Bopomofo Extended"](s)||Kr.Bopomofo(s)||Kr["CJK Compatibility Forms"](s)||Kr["CJK Compatibility Ideographs"](s)||Kr["CJK Compatibility"](s)||Kr["CJK Radicals Supplement"](s)||Kr["CJK Strokes"](s)||Kr["CJK Symbols and Punctuation"](s)||Kr["CJK Unified Ideographs Extension A"](s)||Kr["CJK Unified Ideographs"](s)||Kr["Enclosed CJK Letters and Months"](s)||Kr["Halfwidth and Fullwidth Forms"](s)||Kr.Hiragana(s)||Kr["Ideographic Description Characters"](s)||Kr["Kangxi Radicals"](s)||Kr["Katakana Phonetic Extensions"](s)||Kr.Katakana(s)||Kr["Vertical Forms"](s)||Kr["Yi Radicals"](s)||Kr["Yi Syllables"](s)));(bl[d]||m||f.imageName)&&l.push(El(p+1,c,u,l,Sl(d,t.getCharCode(p+1),m&&h),!1))}}return function t(e){return e?t(e.priorBreak).concat(e.index):[]}(El(t.length(),c,u,l,0,!0))}function Tl(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 Il(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 Cl(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,m=e.right*a;"width"===i||"both"===i?(f=n[0]+d-r[3],c=n[0]+m+r[1]):c=(f=n[0]+(d+m-s.displaySize[0])/2)+s.displaySize[0];var y=e.top*a,v=e.bottom*a;return"height"===i||"both"===i?(h=n[1]+y-r[0],p=n[1]+v+r[2]):p=(h=n[1]+(y+v-s.displaySize[1])/2)+s.displaySize[1],{image:s,top:h,right:c,bottom:p,left:f,collisionPadding:o}}bl[10]=!0,bl[32]=!0,bl[38]=!0,bl[40]=!0,bl[41]=!0,bl[43]=!0,bl[45]=!0,bl[47]=!0,bl[173]=!0,bl[183]=!0,bl[8203]=!0,bl[8208]=!0,bl[8211]=!0,bl[8231]=!0;var Pl=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 Al(t,e){var i=e.expression;if("constant"===i.kind)return{kind:"constant",layoutSize:i.evaluate(new cn(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 cn(s)),maxSize:i.evaluate(new cn(l)),interpolationType:n}}function Ll(t,e,i){var r=e.uSize,n=i.lowerSize;return"source"===t.kind?n/128:"composite"===t.kind?Ye(n/128,i.upperSize/128,e.uSizeT):r}function zl(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(ci.interpolationFactor(n,e,t.minZoom,t.maxZoom),0,1):0;"camera"===t.kind?r=Ye(t.minSize,t.maxSize,a):i=a}return{uSizeT:i,uSize:r}}Nr("Anchor",Pl);var Dl=Object.freeze({__proto__:null,getSizeData:Al,evaluateSizeForFeature:Ll,evaluateSizeForZoom:zl,SIZE_PACK_FACTOR:128});function Rl(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 Ol(t){for(var e=0,i=0;i<t.length-1;i++)e+=t[i].dist(t[i+1]);return e}function Bl(t,e,i){return t?.6*e*i:0}function Fl(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function Vl(t,e,i,r,n,a){for(var o=Bl(i,n,a),s=Fl(i,r)*a,l=0,u=Ol(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,m=Ye(c.x,p.x,d),y=Ye(c.y,p.y,d),v=new Pl(m,y,p.angleTo(c),h);return v._round(),!o||Rl(t,v,s,o,e)?v:void 0}l+=f}}function Ul(t,e,i,r,n,a,o,s,l){var u=Bl(r,a,o),h=Fl(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=Ol(e),p=0,f=i-r,d=[],m=0;m<e.length-1;m++){for(var y=e[m],v=e[m+1],_=y.dist(v),g=v.angleTo(y);f+r<p+_;){var x=((f+=r)-p)/_,b=Ye(y.x,v.x,x),w=Ye(y.y,v.y,x);if(b>=0&&b<u&&w>=0&&w<u&&f-h>=0&&f+h<=c){var M=new Pl(b,w,g,m);M._round(),n&&!Rl(e,M,o,n,a)||d.push(M)}}p+=_}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 Nl(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]},m=p.reduce(d,0),y=f.reduce(d,0),v=l-m,_=u-y,g=0,x=m,b=0,w=y,M=0,S=v,E=0,k=_;if(o.content&&r){var T=o.content;g=jl(p,0,T[0]),b=jl(f,0,T[1]),x=jl(p,T[0],T[2]),w=jl(f,T[1],T[3]),M=T[0]-g,E=T[1]-b,S=T[2]-T[0]-x,k=T[3]-T[1]-w}var I=function(r,a,l,u){var p=Gl(r.stretch-g,x,h,t.left),f=Zl(r.fixed-M,S,r.stretch,m),d=Gl(a.stretch-b,w,c,t.top),v=Zl(a.fixed-E,k,a.stretch,y),_=Gl(l.stretch-g,x,h,t.left),T=Zl(l.fixed-M,S,l.stretch,m),I=Gl(u.stretch-b,w,c,t.top),C=Zl(u.fixed-E,k,u.stretch,y),P=new n(p,d),A=new n(_,d),L=new n(_,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];P._matMult(V),A._matMult(V),z._matMult(V),L._matMult(V)}var U=r.stretch+r.fixed,N=a.stretch+a.fixed;return{tl:P,tr:A,bl:z,br:L,tex:{x:o.paddedRect.x+1+U,y:o.paddedRect.y+1+N,w:l.stretch+l.fixed-U,h:u.stretch+u.fixed-N},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:D,pixelOffsetBR:R,minFontScaleX:S/s/h,minFontScaleY:k/s/c,isSDF:i}};if(r&&(o.stretchX||o.stretchY))for(var C=ql(p,v,m),P=ql(f,_,y),A=0;A<C.length-1;A++)for(var L=C[A],z=C[A+1],D=0;D<P.length-1;D++)a.push(I(L,P[D],z,P[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 jl(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 ql(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 Gl(t,e,i,r){return t/e*i+r}function Zl(t,e,i,r){return t-e*i/r}var Xl=function(t,e,i,r,a,o,s,l,u,h,c,p){var f=s.top*l-u,d=s.bottom*l+u,m=s.left*l-u,y=s.right*l+u,v=s.collisionPadding;if(v&&(m-=v[0]*l,f-=v[1]*l,y+=v[2]*l,d+=v[3]*l),this.boxStartIndex=t.length,h){var _=d-f,g=y-m;_>0&&(_=Math.max(10*l,_),this._addLineCollisionCircles(t,e,i,i.segment,g,_,r,a,o,c))}else{if(p){var x=new n(m,f),b=new n(y,f),w=new n(m,d),M=new n(y,d),S=p*Math.PI/180;x._rotate(S),b._rotate(S),w._rotate(S),M._rotate(S),m=Math.min(x.x,b.x,w.x,M.x),y=Math.max(x.x,b.x,w.x,M.x),f=Math.min(x.y,b.y,w.y,M.y),d=Math.max(x.y,b.y,w.y,M.y)}t.emplaceBack(i.x,i.y,m,f,y,d,r,a,o,0,0)}this.boxEndIndex=t.length};Xl.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,m=i,y=r+1,v=d,_=-n/2,g=_-n/4;do{if(--y<0){if(v>_)return;y=0;break}v-=e[y].dist(m),m=e[y]}while(v>g);for(var x=e[y].dist(e[y+1]),b=-f;b<c+f;b++){var w=b*h,M=_+w;if(w<0&&(M+=w),w>n&&(M+=w-n),!(M<v)){for(;v+x<M;){if(v+=x,++y+1>=e.length)return;x=e[y].dist(e[y+1])}var S=M-v,E=e[y],k=e[y+1].sub(E)._unit()._mult(S)._add(E)._round(),T=Math.abs(M-d)<h?0:.8*(M-d);t.emplaceBack(k.x,k.y,-a/2,-a/2,a/2,a/2,o,s,l,a/2,T)}}};var Wl=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=Kl),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 Kl(t,e){return t<e?-1:t>e?1:0}function Hl(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 Wl([],Jl);if(0===c)return new n(r,a);for(var d=r;d<o;d+=c)for(var m=a;m<s;m+=c)f.push(new Yl(d+p,m+p,p,t));for(var y=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 Yl(i/e,r/e,0,t)}(t),v=f.length;f.length;){var _=f.pop();(_.d>y.d||!y.d)&&(y=_,i&&console.log("found best %d after %d probes",Math.round(1e4*_.d)/1e4,v)),_.max-y.d<=e||(f.push(new Yl(_.p.x-(p=_.h/2),_.p.y-p,p,t)),f.push(new Yl(_.p.x+p,_.p.y-p,p,t)),f.push(new Yl(_.p.x-p,_.p.y+p,p,t)),f.push(new Yl(_.p.x+p,_.p.y+p,p,t)),v+=4)}return i&&(console.log("num probes: "+v),console.log("best distance: "+y.d)),y.p}function Jl(t,e){return e.max-t.max}function Yl(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,Ha(t,u,h))}return(i?1:-1)*Math.sqrt(r)}(this.p,r),this.max=this.d+this.h*Math.SQRT2}Wl.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},Wl.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}},Wl.prototype.peek=function(){return this.data[0]},Wl.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},Wl.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 Ql=Number.POSITIVE_INFINITY;function $l(t,e){return e[1]!==Ql?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 tu(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 eu(t,e,i,r,a,o,s,l,u,h,c,p,f,d,m){var y=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,m=f.positionedGlyphs;d<m.length;d+=1){var y=m[d];if(y.rect){var v=y.rect||{},_=4,g=!0,x=1,b=0,w=(a||l)&&y.vertical,M=y.metrics.advance*y.scale/2;if(l&&e.verticalizable&&(b=f.lineOffset/2-(y.imageName?-(24-y.metrics.width*y.scale)/2:24*(y.scale-1))),y.imageName){var S=s[y.imageName];g=S.sdf,_=1/(x=S.pixelRatio)}var E=a?[y.x+M,y.y]:[0,0],k=a?[0,0]:[y.x+M+i[0],y.y+i[1]-b],T=[0,0];w&&(T=k,k=[0,0]);var I=(y.metrics.left-_)*y.scale-M+k[0],C=(-y.metrics.top-_)*y.scale+k[1],P=I+v.w*y.scale/x,A=C+v.h*y.scale/x,L=new n(I,C),z=new n(P,C),D=new n(I,A),R=new n(P,A);if(w){var O=new n(-M,M- -17),B=-Math.PI/2,F=12-M,V=new n(22-F,-(y.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 N=Math.sin(u),j=Math.cos(u),q=[j,-N,N,j];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:y.sectionIndex,isSDF:g,pixelOffsetTL:G,pixelOffsetBR:Z,minFontScaleX:0,minFontScaleY:0})}}return h}(0,i,l,a,o,s,r,t.allowVerticalPlacement),v=t.textSizeData,_=null;"source"===v.kind?(_=[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&&((_=[128*d.compositeTextSizes[0].evaluate(s,{},m),128*d.compositeTextSizes[1].evaluate(s,{},m)])[0]>32640||_[1]>32640)&&w(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),t.addSymbols(t.text,y,_,l,o,s,h,e,u.lineStartIndex,u.lineLength,f,m);for(var g=0,x=c;g<x.length;g+=1)p[x[g]]=t.text.placedSymbolArray.length-1;return 4*y.length}function iu(t){for(var e in t)return t[e];return null}function ru(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 nu=ys.VectorTileFeature.types,au=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function ou(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 su(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 lu(t){for(var e=0,i=t.sections;e<i.length;e+=1)if(tn(i[e].text))return!0;return!1}var uu=function(t){this.layoutVertexArray=new Bn,this.indexArray=new Kn,this.programConfigurations=t,this.segments=new ha,this.dynamicLayoutVertexArray=new Fn,this.opacityVertexArray=new Vn,this.placedSymbolArray=new ia};uu.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length},uu.prototype.upload=function(t,e,i,r){this.isEmpty()||(i&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Os.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,Bs.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,au,!0),this.opacityVertexBuffer.itemSize=1),(i||r)&&this.programConfigurations.upload(t))},uu.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},Nr("SymbolBuffers",uu);var hu=function(t,e,i){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new i,this.segments=new ha,this.collisionVertexArray=new jn};hu.prototype.upload=function(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,Fs.members,!0)},hu.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},Nr("CollisionBuffers",hu);var cu=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=Al(this.zoom,e["text-size"]),this.iconSizeData=Al(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 yl[t]})),this.stateDependentLayerIds=this.layers.filter(function(t){return t.isStateDependent()}).map(function(t){return t.id}),this.sourceID=t.sourceID};cu.prototype.createArrays=function(){this.text=new uu(new Ra(Os.members,this.layers,this.zoom,function(t){return/^text/.test(t)})),this.icon=new uu(new Ra(Os.members,this.layers,this.zoom,function(t){return/^icon/.test(t)})),this.glyphOffsetArray=new aa,this.lineVertexArray=new oa,this.symbolInstances=new na},cu.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=js[t.charAt(a)];o&&(e[o.charCodeAt(0)]=!0)}},cu.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 cn(this.zoom),m=0,y=t;m<y.length;m+=1){var v=y[m],_=v.feature,g=v.id,x=v.index,b=v.sourceLayerIndex,w=r._featureFilter.needGeometry,M={type:_.type,id:g,properties:_.properties,geometry:w?Va(_):[]};if(r._featureFilter.filter(d,M,i)){w||(M.geometry=Va(_));var S=void 0;if(l){var E=r.getValueAndResolveTokens("text-field",M,i,f),k=ee.factory(E);lu(k)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===ln()||this.hasRTLText&&hn.isParsed())&&(S=Ns(k,r,M))}var T=void 0;if(u){var I=r.getValueAndResolveTokens("icon-image",M,i,f);T=I instanceof ie?I:ie.fromString(I)}if(S||T){var C=this.sortFeaturesByKey?h.evaluate(M,{},i):void 0,P={id:g,text:S,icon:T,index:x,sourceLayerIndex:b,geometry:Va(_),properties:_.properties,type:nu[_.type],sortKey:C};if(this.features.push(P),T&&(c[T.name]=!0),S){var A=a.evaluate(M,{},i).join(","),L="map"===n.get("text-rotation-alignment")&&"point"!==n.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(yl.vertical)>=0;for(var z=0,D=S.sections;z<D.length;z+=1){var R=D[z];if(R.image)c[R.image.name]=!0;else{var O=Hr(S.toString()),B=R.fontStack||A,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 m=s(f,d,c),y=o(f,d,r[m].geometry);delete e[f],delete i[d],i[l(p,r[y].geometry,!0)]=y,r[m].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})}},cu.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))},cu.prototype.isEmpty=function(){return 0===this.symbolInstances.length&&!this.hasRTLText},cu.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},cu.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},cu.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy(),this.textCollisionCircle.destroy(),this.iconCollisionCircle.destroy()},cu.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()},cu.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}},cu.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),m=this.glyphOffsetArray.length,y=d.vertexLength,v=this.allowVerticalPlacement&&o===yl.vertical?Math.PI/2:0,_=a.text&&a.text.sections,g=0;g<e.length;g++){var x=e[g],b=x.tl,w=x.tr,M=x.bl,S=x.br,E=x.tex,k=x.pixelOffsetTL,T=x.pixelOffsetBR,I=x.minFontScaleX,C=x.minFontScaleY,P=x.glyphOffset,A=x.isSDF,L=x.sectionIndex,z=d.vertexLength,D=P[1];ou(f,s.x,s.y,b.x,D+b.y,E.x,E.y,i,A,k.x,k.y,I,C),ou(f,s.x,s.y,w.x,D+w.y,E.x+E.w,E.y,i,A,T.x,k.y,I,C),ou(f,s.x,s.y,M.x,D+M.y,E.x,E.y+E.h,i,A,k.x,T.y,I,C),ou(f,s.x,s.y,S.x,D+S.y,E.x+E.w,E.y+E.h,i,A,T.x,T.y,I,C),su(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(P[0]),g!==e.length-1&&L===e[g+1].sectionIndex||t.programConfigurations.populatePaintArrays(f.length,a,a.index,{},c,_&&_[L])}t.placedSymbolArray.emplaceBack(s.x,s.y,m,this.glyphOffsetArray.length-m,y,l,u,s.segment,i?i[0]:0,i?i[1]:0,r[0],r[1],o,0,!1,0,h)},cu.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))},cu.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 m=a.indexArray;m.emplaceBack(h,h+1,h+2),m.emplaceBack(h,h+2,h+3),u.primitiveLength+=2}else{var y=a.indexArray;y.emplaceBack(h,h+1),y.emplaceBack(h+1,h+2),y.emplaceBack(h+2,h+3),y.emplaceBack(h+3,h),u.primitiveLength+=4}},cu.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)}},cu.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new hu(Nn,Vs.members,Hn),this.iconCollisionBox=new hu(Nn,Vs.members,Hn),this.textCollisionCircle=new hu(Nn,Us.members,Kn),this.iconCollisionCircle=new hu(Nn,Us.members,Kn);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)}},cu.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 m=t.get(d);if(0===m.radius){u.iconBox={x1:m.x1,y1:m.y1,x2:m.x2,y2:m.y2,anchorPointX:m.anchorPointX,anchorPointY:m.anchorPointY},u.iconFeatureIndex=m.featureIndex;break}}for(var y=s;y<l;y++){var v=t.get(y);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},cu.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))}},cu.prototype.hasTextData=function(){return this.text.segments.get().length>0},cu.prototype.hasIconData=function(){return this.icon.segments.get().length>0},cu.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox&&this.textCollisionCircle&&this.iconCollisionCircle},cu.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},cu.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},cu.prototype.hasTextCollisionCircleData=function(){return this.hasDebugData()&&this.textCollisionCircle.segments.get().length>0},cu.prototype.hasIconCollisionCircleData=function(){return this.hasDebugData()&&this.iconCollisionCircle.segments.get().length>0},cu.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)},cu.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},cu.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})},cu.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)}},Nr("SymbolBucket",cu,{omit:["layers","collisionBoxArray","features","compareText"]}),cu.MAX_GLYPHS=65535,cu.addDynamicAttributes=su;var pu=new En({"symbol-placement":new xn(Ct.layout_symbol["symbol-placement"]),"symbol-spacing":new xn(Ct.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new xn(Ct.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new bn(Ct.layout_symbol["symbol-sort-key"]),"symbol-z-order":new xn(Ct.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new xn(Ct.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new xn(Ct.layout_symbol["icon-ignore-placement"]),"icon-optional":new xn(Ct.layout_symbol["icon-optional"]),"icon-rotation-alignment":new xn(Ct.layout_symbol["icon-rotation-alignment"]),"icon-size":new bn(Ct.layout_symbol["icon-size"]),"icon-text-fit":new xn(Ct.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new xn(Ct.layout_symbol["icon-text-fit-padding"]),"icon-image":new bn(Ct.layout_symbol["icon-image"]),"icon-rotate":new bn(Ct.layout_symbol["icon-rotate"]),"icon-padding":new xn(Ct.layout_symbol["icon-padding"]),"icon-keep-upright":new xn(Ct.layout_symbol["icon-keep-upright"]),"icon-offset":new bn(Ct.layout_symbol["icon-offset"]),"icon-anchor":new bn(Ct.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new xn(Ct.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new xn(Ct.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new xn(Ct.layout_symbol["text-rotation-alignment"]),"text-field":new bn(Ct.layout_symbol["text-field"]),"text-font":new bn(Ct.layout_symbol["text-font"]),"text-size":new bn(Ct.layout_symbol["text-size"]),"text-max-width":new bn(Ct.layout_symbol["text-max-width"]),"text-line-height":new xn(Ct.layout_symbol["text-line-height"]),"text-letter-spacing":new bn(Ct.layout_symbol["text-letter-spacing"]),"text-justify":new bn(Ct.layout_symbol["text-justify"]),"text-radial-offset":new bn(Ct.layout_symbol["text-radial-offset"]),"text-variable-anchor":new xn(Ct.layout_symbol["text-variable-anchor"]),"text-anchor":new bn(Ct.layout_symbol["text-anchor"]),"text-max-angle":new xn(Ct.layout_symbol["text-max-angle"]),"text-writing-mode":new xn(Ct.layout_symbol["text-writing-mode"]),"text-rotate":new bn(Ct.layout_symbol["text-rotate"]),"text-padding":new xn(Ct.layout_symbol["text-padding"]),"text-keep-upright":new xn(Ct.layout_symbol["text-keep-upright"]),"text-transform":new bn(Ct.layout_symbol["text-transform"]),"text-offset":new bn(Ct.layout_symbol["text-offset"]),"text-allow-overlap":new xn(Ct.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new xn(Ct.layout_symbol["text-ignore-placement"]),"text-optional":new xn(Ct.layout_symbol["text-optional"])}),fu={paint:new En({"icon-opacity":new bn(Ct.paint_symbol["icon-opacity"]),"icon-color":new bn(Ct.paint_symbol["icon-color"]),"icon-halo-color":new bn(Ct.paint_symbol["icon-halo-color"]),"icon-halo-width":new bn(Ct.paint_symbol["icon-halo-width"]),"icon-halo-blur":new bn(Ct.paint_symbol["icon-halo-blur"]),"icon-translate":new xn(Ct.paint_symbol["icon-translate"]),"icon-translate-anchor":new xn(Ct.paint_symbol["icon-translate-anchor"]),"text-opacity":new bn(Ct.paint_symbol["text-opacity"]),"text-color":new bn(Ct.paint_symbol["text-color"],{runtimeType:Nt,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new bn(Ct.paint_symbol["text-halo-color"]),"text-halo-width":new bn(Ct.paint_symbol["text-halo-width"]),"text-halo-blur":new bn(Ct.paint_symbol["text-halo-blur"]),"text-translate":new xn(Ct.paint_symbol["text-translate"]),"text-translate-anchor":new xn(Ct.paint_symbol["text-translate-anchor"])}),layout:pu},du=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:Bt,this.defaultValue=t};du.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},du.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},du.prototype.outputDefined=function(){return!1},du.prototype.serialize=function(){return null},Nr("FormatSectionOverride",du,{omit:["defaultValue"]});var mu=function(t){function e(e){t.call(this,e,fu)}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()||Hi(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 cu(t)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return!1},e.prototype._setPaintOverrides=function(){for(var t=0,i=fu.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 du(a),s=new Ki(o,a.property.specification);n="constant"===a.value.kind||"source"===a.value.kind?new Yi("source",s):new Qi("composite",s,a.value.zoomStops,a.value._interpolationType),this.paint._values[r]=new _n(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=fu.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}(kn),yu={paint:new En({"background-color":new xn(Ct.paint_background["background-color"]),"background-pattern":new Mn(Ct.paint_background["background-pattern"]),"background-opacity":new xn(Ct.paint_background["background-opacity"])})},vu=function(t){function e(e){t.call(this,e,yu)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(kn),_u={paint:new En({"raster-opacity":new xn(Ct.paint_raster["raster-opacity"]),"raster-hue-rotate":new xn(Ct.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new xn(Ct.paint_raster["raster-brightness-min"]),"raster-brightness-max":new xn(Ct.paint_raster["raster-brightness-max"]),"raster-saturation":new xn(Ct.paint_raster["raster-saturation"]),"raster-contrast":new xn(Ct.paint_raster["raster-contrast"]),"raster-resampling":new xn(Ct.paint_raster["raster-resampling"]),"raster-fade-duration":new xn(Ct.paint_raster["raster-fade-duration"])})},gu=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}(kn),xu=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}(kn),bu={circle:so,heatmap:_o,hillshade:xo,fill:os,"fill-extrusion":Ms,line:Ds,symbol:mu,background:vu,raster:gu},wu=self.HTMLImageElement,Mu=self.HTMLCanvasElement,Su=self.HTMLVideoElement,Eu=self.ImageData,ku=self.ImageBitmap,Tu=function(t,e,i,r){this.context=t,this.format=i,this.texture=t.gl.createTexture(),this.update(e,r)};Tu.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 wu||t instanceof Mu||t instanceof Su||t instanceof Eu||ku&&t instanceof ku?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 wu||t instanceof Mu||t instanceof Su||t instanceof Eu||ku&&t instanceof ku?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)},Tu.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)},Tu.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},Tu.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null};var Iu=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()})};Iu.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))},Iu.prototype.remove=function(){delete this._channel,this._callback=function(){}};var Cu=function(t,e,i){this.target=t,this.parent=e,this.mapId=i,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},y(["receive","process"],this),this.invoker=new Iu(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=E()?t:self};function Pu(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]}Cu.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:Zr(e,s)},s),{cancel:function(){i&&delete a.callbacks[o],a.target.postMessage({id:o,type:"<cancel>",targetMapId:r,sourceMapId:a.mapId})}}},Cu.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)},Cu.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)}},Cu.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(Xr(e.error)):r(null,Xr(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?Zr(e):null,data:Zr(r,a)},a)}:function(t){n=!0},s=null,l=Xr(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)}},Cu.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var Au=function(){};Au.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]},Au.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 Lu=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}(Au),zu=6378137,Du=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[zu*r*n,zu*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/zu,(2*Math.atan(Math.exp(i[1]/zu))-Math.PI/2)*r]},e}(Au),Ru=function t(e,i){if(this._parseParams(arguments),!this.getExtent())throw new Error("未设置坐标系范围bounds");if(!this.origin)throw new Error("未设置裁图原点");this._setProjection(),this._calcResolutionAndOffset(),t.set(this)};Ru.prototype._parseParams=function(t){this.epsgCode=t[0],this._parseOptions(t[1]||{})},Ru.prototype._parseOptions=function(t){this.origin=t.origin,this.dpi=t.dpi||96,this.unit=t.unit||"degree",this.extent=t.bounds,this._resolutions={},this._scale={},this._zoomOffset=0,this.tileSize=-1},Ru.prototype._setProjection=function(){this.projection=function(t){var e;switch(t){case"EPSG:4326":case"EPSG:4214":case"EPSG:4490":case"EPSG:4610":e=new Lu;break;case"EPSG:3857":e=new Du;break;default:throw new Error("未找到坐标系对应的投影信息")}return e}(this.epsgCode,this.getExtent())},Ru.prototype.getExtent=function(){if(!this._rectifyExtent){var t=this.origin,e=this.extent[2]-t[0],i=t[1]-this.extent[1];if(e===i)this._rectifyExtent=[t[0],this.extent[1],this.extent[2],t[1]];else{var r=Math.max(e,i);this._rectifyExtent=[t[0],t[1]-r,t[0]+r,t[1]]}}return this._rectifyExtent},Ru.prototype.getOrigin=function(){return this.origin},Ru.prototype.getEpsgCode=function(){return this.epsgCode},Ru.prototype.getUnit=function(){return this.unit},Ru.prototype.getDpi=function(){return this.dpi},Ru.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},Ru.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]},Ru.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]},Ru.prototype.getCoordsInfo=function(t){var e=this.projection.unproject([t[0],t[3]]),i=e[0],r=e[1],n=this.projection.unproject([t[2],t[1]]);return this._getCoordsInfo(t,[i,n[1],n[0],r])},Ru.prototype._getCoordsInfo=function(t,e){var i=e[0],r=e[1],n=e[3],a=e[2]-i,o=n-r;return{width:t[2]-t[0],height:t[3]-t[1],centerX:(t[2]+t[0])/2,centerY:(t[3]+t[1])/2,origin:this.origin,originX:this.origin[0],originY:this.origin[1],latlngBounds:e,latlngWidth:a,latlngHeight:o,latlngCenterX:i+a/2,latlngCenterY:r+o/2,latlngOrigin:[i,n],latlngOriginX:i,latlngOriginY:n}},Ru.prototype._calcResolutionAndOffset=function(){var t=this;if(this.tileSize>-1){var e=this.getExtent(),i=e[2]-e[0],r=e[3]-e[1],n=this._resolutions[0];if(void 0===n)throw new Error("分辨率传入参数错误");var a=this.tileSize*n,o=Math.max(i,r),s=this.origin,l=Object.values(this._resolutions),u=0;if(a<o){for(var h=1;h<l.length;h++){var c=2*l[0];if(l.unshift(c),o<=c*this.tileSize){u=h;break}}this._zoomOffset=-u}else{for(var p=1;p<l.length;p++)if(o>l[p]*this.tileSize){u=p-1;break}l.splice(0,u),this._zoomOffset=u}l.length>=20&&(l=l.slice(0,20)),this._resolutions={},l.forEach(function(e,i){t._resolutions[i]=e}),this._rectifyExtent=[s[0],s[1]-this.tileSize*l[0],s[0]+this.tileSize*l[0],s[1]]}},Ru.prototype.getZoomOffset=function(){return this._zoomOffset},Ru.prototype._isInRange=function(t,e){return!!(t>=e[0]&&t<=e[1])},Ru.get=function(t){for(var e in Ru)if(Ru.hasOwnProperty(e)&&Ru[e].getEpsgCode&&Ru[e].getEpsgCode()===t)return Ru[e];return null},Ru.set=function(t){var e=t.getEpsgCode().replace(":","").toUpperCase();Ru[e]=t},Ru.EPSG4326=new Ru("EPSG:4326",{origin:[-180,90],bounds:[-180,-90,180,90]}),Ru.EPSG4214=new Ru("EPSG:4214",{origin:[-180,90],bounds:[-180,-90,180,90]}),Ru.EPSG4490=new Ru("EPSG:4490",{origin:[-180,90],bounds:[-180,-90,180,90]}),Ru.EPSG4610=new Ru("EPSG:4610",{origin:[-180,90],bounds:[-180,-90,180,90]}),Ru.EPSG3857=new Ru("EPSG:3857",{origin:[-20037508.3427892,20037508.3427892],bounds:[-20037508.3427892,-20037508.3427892,20037508.3427892,20037508.3427892]});var Ou=function(t,e,i){this.z=t,this.x=e,this.y=i,this.key=Vu(0,t,t,e,i),this.z_replace=void 0,this.x_replace=void 0,this.y_replace=void 0};Ou.prototype.offsetZ=function(t){t&&(this.z+=t)},Ou.prototype.replaceX=function(t){this.x_replace=t},Ou.prototype.replaceY=function(t){this.y_replace=t},Ou.prototype.replaceZ=function(t){this.z_replace=t},Ou.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},Ou.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},Ou.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},Ou.prototype.url=function(t,e){var i=this.x_replace,r=this.y_replace,n=this.z_replace,a=t[(this.x+this.y)%t.length],o=a.indexOf("reversebbox=true")>=0,s=this.getTileBBox(this.x,this.y,this.z);if(o){var l=s.split(",");s=l[1]+","+l[0]+","+l[3]+","+l[2],console.warn("reverse",s)}var u=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),h=this.z,c=this.x,p=this.y;return(i||r||n)&&(n&&(h=this.replaceRule(n,this.z)),i&&(c=this.replaceRule(i,this.x)),r&&(p=this.replaceRule(r,this.y))),a.replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(h)).replace("{x}",String(c)).replace("{y}",String("tms"===e?Math.pow(2,this.z)-this.y-1:p)).replace("{quadkey}",u).replace("{bbox}",s)},Ou.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))},Ou.prototype.getTileBBox=function(t,e,i){return function(t,e,i){var r=Pu(256*t,256*(e=Math.pow(2,i)-e-1),i),n=Pu(256*(t+1),256*(e+1),i);return r[0]+","+r[1]+","+n[0]+","+n[1]}(t,e,i)},Ou.prototype.getCRS=function(){return Ru.EPSG3857},Ou.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var Bu=function(t,e){this.wrap=t,this.canonical=e,this.key=Vu(t,e.z,e.z,e.x,e.y),this.scaleFactors={},this.sourceId=""},Fu=function(t,e,i,r,n){this.overscaledZ=t,this.wrap=e,this.canonical=new Ou(i,+r,+n),this.key=Vu(e,t,i,r,n),this.scaleFactors={},this.sourceId=""};function Vu(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)+i.toString(36)+e.toString(36)}function Uu(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)})}Fu.prototype.equals=function(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)},Fu.prototype.scaledTo=function(t){var e=this.canonical.z-t;if(t>this.canonical.z){var i=new Fu(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y);return i.scaleFactors=this.scaleFactors,i.sourceId=this.sourceId,i}var r=new Fu(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e);return r.scaleFactors=this.scaleFactors,r.sourceId=this.sourceId,r},Fu.prototype.calculateScaledKey=function(t,e){var i=this.canonical.z-t;return t>this.canonical.z?Vu(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):Vu(this.wrap*+e,t,t,this.canonical.x>>i,this.canonical.y>>i)},Fu.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},Fu.prototype.children=function(t){var e=this;if(this.overscaledZ>=t){var i=new Fu(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y);return i.scaleFactors=this.scaleFactors,i.sourceId=this.sourceId,[i]}var r=this.canonical.z+1,n=2*this.canonical.x,a=2*this.canonical.y,o=[new Fu(r,this.wrap,r,n,a),new Fu(r,this.wrap,r,n+1,a),new Fu(r,this.wrap,r,n,a+1),new Fu(r,this.wrap,r,n+1,a+1)];return o.forEach(function(t){t.scaleFactors=e.scaleFactors,t.sourceId=e.sourceId}),o},Fu.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))},Fu.prototype.wrapped=function(){var t=new Fu(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y);return t.scaleFactors=this.scaleFactors,t.sourceId=this.sourceId,t},Fu.prototype.unwrapTo=function(t){var e=new Fu(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y);return e.scaleFactors=this.scaleFactors,e.sourceId=this.sourceId,e},Fu.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},Fu.prototype.toUnwrapped=function(){var t=new Bu(this.wrap,this.canonical);return t.scaleFactors=this.scaleFactors,t.sourceId=this.sourceId,t},Fu.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},Fu.prototype.getTilePoint=function(t){return this.canonical.getTilePoint(new Te(t.x-this.wrap,t.y))},Nr("CanonicalTileID",Ou),Nr("OverscaledTileID",Fu,{omit:["posMatrix"]});var Nu=function(t,e,i){this.bounds=ge.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=Math.pow(2,t.z),i=Math.floor(Me(this.bounds.getWest())*e),r=Math.floor(Se(this.bounds.getNorth())*e),n=Math.ceil(Me(this.bounds.getEast())*e),a=Math.ceil(Se(this.bounds.getSouth())*e);return t.x>=i&&t.x<n&&t.y>=r&&t.y<a};var ju=function(t){function e(e,i,r,n){t.call(this),this.id=e,this.dispatcher=r,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=Uu(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.onAdd=function(t){this.map=t,this.load()},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=this._options.mapgisOffset||0;t.tileID.canonical.offsetZ(n+this.getZoomOffset());var a=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);t.tileID.canonical.offsetZ(0-n-this.getZoomOffset()),t.request=Mt(this.map._requestManager.transformRequest(a,dt.Tile),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 Tu(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}(It),qu=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)]};qu.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])},qu.prototype.getUnpackVector=function(){return"terrarium"===this.encoding?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},qu.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)},qu.prototype._unpackMapbox=function(t,e,i){return(256*t*256+256*e+i)/10-1e4},qu.prototype._unpackTerrarium=function(t,e,i){return 256*t+e+i/256-32768},qu.prototype.getPixels=function(){return new mo({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},qu.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)]},Nr("DEMData",qu);var Gu=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}};Gu.prototype.encode=function(t){return this._stringToNumber[t]},Gu.prototype.decode=function(t){return this._numberToString[t]};var Zu=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},Xu={geometry:{configurable:!0}};Xu.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},Xu.geometry.set=function(t){this._geometry=t},Zu.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(Zu.prototype,Xu);var Wu=function(){this.state={},this.stateChanges={},this.deletedStates={}};Wu.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]},Wu.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}},Wu.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},Wu.prototype.initializeTileState=function(t,e){t.setFeatureState(this.state,e)},Wu.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 Ku=function(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new Or(8192,16,0),this.grid3D=new Or(8192,16,0),this.featureIndexArray=new la,this.promoteId=e};function Hu(t,e,i,r,n){return _(t,function(t,a){var o=e instanceof gn?e.get(a):null;return o&&o.evaluate?o.evaluate(i,r,n):o})}function Ju(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 Yu(t,e){return e-t}Ku.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])}},Ku.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new ys.VectorTile(new Zs(this.rawTileData)).layers,this.sourceLayerCoder=new Gu(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Ku.prototype.query=function(t,e,i,r){var a=this;this.loadVTLayers();for(var o=t.params||{},s=8192/t.tileSize/t.scale,l=ur(o.filter),u=t.queryGeometry,h=t.queryPadding*s,c=Ju(u),p=this.grid.query(c.minX-h,c.minY-h,c.maxX+h,c.maxY+h),f=Ju(t.cameraQueryGeometry),d=0,m=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(Ya(t,c[h]))return!0;for(var p=0;p<t.length-1;p++)if(Qa(t[p],t[p+1],u))return!0;return!1}(t.cameraQueryGeometry,e-h,i-h,r+h,a+h)});d<m.length;d+=1)p.push(m[d]);p.sort(Yu);for(var y,v={},_=function(n){var h=p[n];if(h!==y){y=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=Va(e)),i.queryIntersectsFeature(u,e,r,f,a.z,t.transform,s,t.pixelPosMatrix)})}},g=0;g<p.length;g++)_(g);return v},Ku.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 cn(this.tileID.overscaledZ),f))for(var d=this.getId(f,p),m=new Ou(0,0,0),y=0;y<c.length;y++){var v=c[y];if(!(a&&a.indexOf(v)<0)){var _=s[v];if(_){var g={};void 0!==d&&u&&(g=u.getState(_.sourceLayer||"_geojsonTileLayer",d));var x=l[v];x.paint=Hu(x.paint,_.paint,f,g,o),x.layout=Hu(x.layout,_.layout,f,g,o);var b=!h||h(f,_,g);if(b){var w=new Zu(f,this.z,this.x,this.y,d,m.getCRS().getEpsgCode());w.layer=x;var M=t[v];void 0===M&&(M=t[v]=[]),M.push({featureIndex:r,feature:w,intersectionZ:b})}}}}}},Ku.prototype.lookupSymbolFeatures=function(t,e,i,r,n,a,o,s){var l={};this.loadVTLayers();for(var u=ur(n),h=0,c=t;h<c.length;h+=1)this.loadMatchingFeature(l,i,r,c[h],u,a,o,s,e);return l},Ku.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},Ku.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},Nr("FeatureIndex",Ku,{omit:["rawTileData","sourceLayerCoder"]});var Qu=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"};Qu.prototype.registerFadeDuration=function(t){var e=t+this.timeAdded;e<B.now()||this.fadeEndTime&&e<this.fadeEndTime||(this.fadeEndTime=e)},Qu.prototype.wasRequested=function(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state},Qu.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 cu){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 cu&&o.hasRTLText){this.hasRTLText=!0,hn.isLoading()||hn.isLoaded()||"deferred"!==ln()||un();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 ta},Qu.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"},Qu.prototype.getBucket=function(t){return this.buckets[t.id]},Qu.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 Tu(t,this.imageAtlas.image,r.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Tu(t,this.glyphAtlasImage,r.ALPHA),this.glyphAtlasImage=null)},Qu.prototype.prepare=function(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)},Qu.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):{}},Qu.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=ur(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 cn(this.tileID.overscaledZ),f)){var d=i.getId(f,n),m=new Zu(f,l,u,h,d);m.tile=c,t.push(m)}}}},Qu.prototype.hasData=function(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state},Qu.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},Qu.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}},Qu.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)},Qu.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)))}}}},Qu.prototype.holdingForFade=function(){return void 0!==this.symbolFadeHoldUntil},Qu.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<B.now()},Qu.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},Qu.prototype.setHoldDuration=function(t){this.symbolFadeHoldUntil=B.now()+t},Qu.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},Qu.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 $u=self.performance,th=function(t){this._marks={start:[t.url,"start"].join("#"),end:[t.url,"end"].join("#"),measure:t.url.toString()},$u.mark(this._marks.start)};th.prototype.finish=function(){$u.mark(this._marks.end);var t=$u.getEntriesByName(this._marks.measure);return 0===t.length&&($u.measure(this._marks.measure,this._marks.start,this._marks.end),t=$u.getEntriesByName(this._marks.measure),$u.clearMarks(this._marks.start),$u.clearMarks(this._marks.end),$u.clearMeasures(this._marks.measure)),t};var eh=function(){};eh.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"))},eh.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 ih=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 eh.openDatabase(t)},e.prototype.copyDatabaseFile=function(t,e,i){return eh.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 Tu(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}(ju);t.Actor=Cu,t.AlphaImage=fo,t.CRS=Ru,t.CanonicalTileID=Ou,t.CollisionBoxArray=ta,t.Color=Qt,t.DEMData=qu,t.DataConstantProperty=xn,t.Database=eh,t.DictionaryCoder=Gu,t.EXTENT=8192,t.ErrorEvent=Tt,t.EvaluationParameters=cn,t.Event=kt,t.Evented=It,t.FeatureIndex=Ku,t.FillBucket=rs,t.FillExtrusionBucket=xs,t.GeoJSONFeature=Zu,t.ImageAtlas=ml,t.ImagePosition=fl,t.LineBucket=Ps,t.LngLat=xe,t.LngLatBounds=ge,t.MercatorCoordinate=Te,t.ONE_EM=24,t.OverscaledTileID=Fu,t.Point=n,t.Point$1=n,t.Projection=Au,t.Properties=En,t.Protobuf=Zs,t.RGBAImage=mo,t.RasterTileSource=ju,t.RasterTileSourceOffline=ih,t.RequestManager=G,t.RequestPerformance=th,t.ResourceType=dt,t.SegmentVector=ha,t.SourceFeatureState=Wu,t.StructArrayLayout1ui2=Jn,t.StructArrayLayout2i4=Ln,t.StructArrayLayout3ui6=Kn,t.StructArrayLayout4i8=zn,t.SymbolBucket=cu,t.Texture=Tu,t.Tile=Qu,t.TileBounds=Nu,t.Transitionable=dn,t.Uniform1f=ba,t.Uniform1i=xa,t.Uniform2f=wa,t.Uniform3f=Ma,t.Uniform4f=Sa,t.UniformColor=Ea,t.UniformMatrix4f=Ta,t.UnwrappedTileID=Bu,t.ValidationError=Pt,t.WritingMode=yl,t.ZoomHistory=Wr,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=su,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=y,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 ao(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 ao(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},t.config=F,t.create=function(){var t=new ao(16);return ao!=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 ao(9);return ao!=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 ao(4);return ao!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},t.createCommonjsModule=e,t.createExpression=Ji,t.createLayout=Pn,t.createStyleLayer=function(t){return"custom"===t.type?new xu(t):new bu[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=Rr,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=Ll,t.evaluateSizeForZoom=zl,t.evaluateVariableOffset=$l,t.evented=sn,t.extend=h,t.featureFilter=ur,t.filterObject=g,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=Tl,t.getAnchorJustification=tu,t.getArrayBuffer=bt,t.getImage=Mt,t.getJSON=xt,t.getRTLTextPluginStatus=ln,t.getReferrer=_t,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],m=e[13],y=e[14],v=e[15],_=i*s-r*o,g=i*l-n*o,x=i*u-a*o,b=r*l-n*s,w=r*u-a*s,M=n*u-a*l,S=h*m-c*d,E=h*y-p*d,k=h*v-f*d,T=c*y-p*m,I=c*v-f*m,C=p*v-f*y,P=_*C-g*I+x*T+b*k-w*E+M*S;return P?(t[0]=(s*C-l*I+u*T)*(P=1/P),t[1]=(n*I-r*C-a*T)*P,t[2]=(m*M-y*w+v*b)*P,t[3]=(p*w-c*M-f*b)*P,t[4]=(l*k-o*C-u*E)*P,t[5]=(i*C-n*k+a*E)*P,t[6]=(y*x-d*M-v*g)*P,t[7]=(h*M-p*x+f*g)*P,t[8]=(o*I-s*k+u*S)*P,t[9]=(r*k-i*I-a*S)*P,t[10]=(d*w-m*x+v*_)*P,t[11]=(c*x-h*w-f*_)*P,t[12]=(s*E-o*T-l*S)*P,t[13]=(i*T-r*E+n*S)*P,t[14]=(m*g-d*b-y*_)*P,t[15]=(h*b-c*g+p*_)*P,t):null},t.isChar=Kr,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=Uu,t.makeRequest=gt,t.mapObject=_,t.mercatorZfromAltitude=Ee,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],m=e[12],y=e[13],v=e[14],_=e[15],g=i[0],x=i[1],b=i[2],w=i[3];return t[0]=g*r+x*s+b*c+w*m,t[1]=g*n+x*l+b*p+w*y,t[2]=g*a+x*u+b*f+w*v,t[3]=g*o+x*h+b*d+w*_,t[4]=(g=i[4])*r+(x=i[5])*s+(b=i[6])*c+(w=i[7])*m,t[5]=g*n+x*l+b*p+w*y,t[6]=g*a+x*u+b*f+w*v,t[7]=g*o+x*h+b*d+w*_,t[8]=(g=i[8])*r+(x=i[9])*s+(b=i[10])*c+(w=i[11])*m,t[9]=g*n+x*l+b*p+w*y,t[10]=g*a+x*u+b*f+w*v,t[11]=g*o+x*h+b*d+w*_,t[12]=(g=i[12])*r+(x=i[13])*s+(b=i[14])*c+(w=i[15])*m,t[13]=g*n+x*l+b*p+w*y,t[14]=g*a+x*u+b*f+w*v,t[15]=g*o+x*h+b*d+w*_,t},t.mvt=ys,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=Ye,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 Zs(t).readFields(ul,[])},t.pbf=Zs,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 cn(c.minZoom),s),u["text-size"].possiblyEvaluate(new cn(p),s)]}if("composite"===t.iconSizeData.kind){var f=t.iconSizeData,d=f.maxZoom;h.compositeIconSizes=[u["icon-size"].possiblyEvaluate(new cn(f.minZoom),s),u["icon-size"].possiblyEvaluate(new cn(d),s)]}h.layoutTextSize=u["text-size"].possiblyEvaluate(new cn(t.zoom+1),s),h.layoutIconSize=u["icon-size"].possiblyEvaluate(new cn(t.zoom+1),s),h.textMaxSize=u["text-size"].possiblyEvaluate(new cn(18));for(var m=24*l.get("text-line-height"),y="map"===l.get("text-rotation-alignment")&&"point"!==l.get("symbol-placement"),v=l.get("text-keep-upright"),_=l.get("text-size"),g=function(){var o=b[x],u=l.get("text-font").evaluate(o,{},s).join(","),c=_.evaluate(o,{},s),p=h.layoutTextSize.evaluate(o,{},s),f=h.layoutIconSize.evaluate(o,{},s),d={horizontal:{},vertical:void 0},g=o.text,M=[0,0];if(g){var S=g.toString(),E=24*l.get("text-letter-spacing").evaluate(o,{},s),k=function(t){for(var e=0,i=S;e<i.length;e+=1)if(r=i[e].charCodeAt(0),Kr.Arabic(r)||Kr["Arabic Supplement"](r)||Kr["Arabic Extended-A"](r)||Kr["Arabic Presentation Forms-A"](r)||Kr["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);M=C?$l(T,[24*C,Ql]):l.get("text-offset").evaluate(o,{},s).map(function(t){return 24*t})}var P=y?"center":l.get("text-justify").evaluate(o,{},s),A=l.get("symbol-placement"),L="point"===A?24*l.get("text-max-width").evaluate(o,{},s):0,z=function(){t.allowVerticalPlacement&&Hr(S)&&(d.vertical=gl(g,e,i,a,u,L,m,T,"left",k,M,yl.vertical,!0,A,p,c))};if(!y&&I){for(var D="auto"===P?I.map(function(t){return tu(t)}):[P],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=gl(g,e,i,a,u,L,m,"center",B,k,M,yl.horizontal,!1,A,p,c);F&&(d.horizontal[B]=F,R=1===F.positionedLines.length)}}z()}else{"auto"===P&&(P=tu(T));var V=gl(g,e,i,a,u,L,m,T,P,k,M,yl.horizontal,!1,A,p,c);V&&(d.horizontal[P]=V),z(),Hr(S)&&y&&v&&(d.vertical=gl(g,e,i,a,u,L,m,T,P,k,M,yl.vertical,!1,A,p,c))}}var U=void 0,N=!1;if(o.icon&&o.icon.name){var j=r[o.icon.name];j&&(U=function(t,e,i){var r=Tl(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)),N=j.sdf,void 0===t.sdfIcons?t.sdfIcons=j.sdf:t.sdfIcons!==j.sdf&&w("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(j.pixelRatio!==t.pixelRatio||0!==l.get("icon-rotate").constantOr(1))&&(t.iconsNeedLinear=!0))}var q=iu(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,m=d.get("icon-offset").evaluate(e,{},c),y=iu(i.horizontal),v=s/24,_=t.tilePixelRatio*v,g=t.tilePixelRatio*p/24,x=t.tilePixelRatio*l,b=t.tilePixelRatio*d.get("symbol-spacing"),M=d.get("text-padding")*t.tilePixelRatio,S=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,P=d.get("icon-text-fit");r&&"none"!==P&&(t.allowVerticalPlacement&&i.vertical&&(f=Cl(r,i.vertical,P,d.get("icon-text-fit-padding"),m,v)),y&&(r=Cl(r,y,P,d.get("icon-text-fit-padding"),m,v)));var A=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,m,y,v,_,g,x,b,M,S){var E,k,T,I,C,P=t.addToLineVertexArray(e,i),A=0,L=0,z=0,D=0,R=-1,O=-1,B={},F=fa(""),V=0,U=0;if(void 0===s._unevaluatedLayout.getValue("text-radial-offset")?(V=(E=s.layout.get("text-offset").evaluate(x,{},S).map(function(t){return 24*t}))[0],U=E[1]):(V=24*s.layout.get("text-radial-offset").evaluate(x,{},S),U=Ql),t.allowVerticalPlacement&&r.vertical){var N=s.layout.get("text-rotate").evaluate(x,{},S)+90;I=new Xl(l,i,e,u,h,c,r.vertical,p,f,d,t.overscaling,N),o&&(C=new Xl(l,i,e,u,h,c,o,y,v,d,t.overscaling,N))}if(n){var j=s.layout.get("icon-rotate").evaluate(x,{}),q="none"!==s.layout.get("icon-text-fit"),G=Nl(n,j,M,q),Z=o?Nl(o,j,M,q):void 0;T=new Xl(l,i,e,u,h,c,n,y,v,!1,t.overscaling,j),A=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,{},S),128*b.compositeIconSizes[1].evaluate(x,{},S)])[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,P.lineStartIndex,P.lineLength,-1,S),R=t.icon.placedSymbolArray.length-1,Z&&(L=4*Z.length,t.addSymbols(t.icon,Z,W,g,_,x,yl.vertical,e,P.lineStartIndex,P.lineLength,-1,S),O=t.icon.placedSymbolArray.length-1)}for(var K in r.horizontal){var H=r.horizontal[K];if(!k){F=fa(H.text);var J=s.layout.get("text-rotate").evaluate(x,{},S);k=new Xl(l,i,e,u,h,c,H,p,f,d,t.overscaling,J)}var Y=1===H.positionedLines.length;if(z+=eu(t,e,H,a,s,d,x,m,P,r.vertical?yl.horizontal:yl.horizontalOnly,Y?Object.keys(r.horizontal):[K],B,R,b,S),Y)break}r.vertical&&(D+=eu(t,e,r.vertical,a,s,d,x,m,P,yl.vertical,["vertical"],B,O,b,S));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>=cu.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,A,L,0,p,V,U)}(t,s,n,i,r,a,f,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,_,M,k,u,x,S,T,m,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=Ul(D,b,E,i.vertical||y,r,24,g,t.overscaling,8192);R<O.length;R+=1){var B=O[R];y&&ru(t,y.text,C,B)||A(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 N=Vl(U,E,i.vertical||y,r,24,g);N&&A(U,N)}}else if("Polygon"===e.type)for(var j=0,q=$o(e.geometry,0);j<q.length;j+=1){var G=q[j],Z=Hl(G,16);A(G[0],new Pl(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];A(K,new Pl(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];A([$],new Pl($.x,$.y,0))}}(t,o,d,U,r,h,p,f,M,N,s)},x=0,b=t.features;x<b.length;x+=1)g();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=hn,t.polygonIntersectsPolygon=ja,t.postMapLoadEvent=at,t.postTurnstileEvent=rt,t.potpack=pl,t.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],t.register=Nr,t.registerForPluginStateChange=function(t){return t({pluginStatus:rn,pluginURL:nn}),sn.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"===rn||"loading"===rn||"loaded"===rn)throw new Error("setRTLTextPlugin cannot be called multiple times.");nn=B.resolveURL(t),rn="deferred",en=e,on(),i||un()},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=Dl,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=oo,t.translate=function(t,e,i){var r,n,a,o,s,l,u,h,c,p,f,d,m=i[0],y=i[1],v=i[2];return e===t?(t[12]=e[0]*m+e[4]*y+e[8]*v+e[12],t[13]=e[1]*m+e[5]*y+e[9]*v+e[13],t[14]=e[2]*m+e[6]*y+e[10]*v+e[14],t[15]=e[3]*m+e[7]*y+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*m+s*y+c*v+e[12],t[13]=n*m+l*y+p*v+e[13],t[14]=a*m+u*y+f*v+e[14],t[15]=o*m+h*y+d*v+e[15]),t},t.triggerPluginCompletionEvent=an,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=Lr,t.validateStyle=Ar,t.values=function(t){var e=[];for(var i in t)e.push(t[i]);return e},t.vectorTile=ys,t.version="17.0.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]}),m=d[0];if("none"!==m.visibility){var y=m.source||"",v=this.familiesBySource[y];v||(v=this.familiesBySource[y]={});var _=m.sourceLayer||"_geojsonTileLayer",g=v[_];g||(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 m=f[+d];if(m&&0!==m.bitmap.width&&0!==m.bitmap.height){var y=i[p][d].rect;t.AlphaImage.copy(m.bitmap,c,{x:0,y:0},{x:y.x+1,y:y.y+1},m.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,m={},y={featureIndex:h,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:r},v=i.familiesBySource[this.source];for(var _ in v){var g=e.layers[_];if(g){1===g.version&&t.warnOnce('Vector tile source "'+this.source+'" layer "'+_+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var x=u.encode(_),b=[],w=0;w<g.length;w++){var M=g.feature(w),S=h.getId(M,_);b.push({feature:M,id:S,index:w,sourceLayerIndex:x})}for(var E=0,k=v[_];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),(m[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,y,this.tileID.canonical),h.bucketLayerIDs.push(T.map(function(t){return t.id})))}}}var C=t.mapObject(y.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 P=Object.keys(y.iconDependencies);P.length?a.send("getImages",{icons:P,source:this.source,tileID:this.tileID,type:"icons"},function(t,e){c||(c=t,f=e,L.call(l))}):f={};var A=Object.keys(y.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 m){var l=m[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(y,this.tileID.canonical,i.patternPositions))}this.status="done",s(null,{buckets:t.values(m).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})}}A.length?a.send("getImages",{icons:A,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 m=function(e){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=t.EXTENT,this.length=e.length,this._features=e};m.prototype.feature=function(t){return new d(this._features[t])};var y=t.vectorTile.VectorTileFeature,v=_;function _(t,e){this.options=e||{},this.features=t,this.length=t.length}function g(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}_.prototype.feature=function(t){return new g(this.features[t],this.options.extent)},g.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},g.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]},g.prototype.toGeoJSON=y.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,M,t.layers[i])}(e,i),i.finish()}function M(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,S,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 S(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 P(t,e,i,r){A(t,i,r),A(e,2*i,2*r),A(e,2*i+1,2*r+1)}function A(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(P(e,i,n,r),i[2*a+o]>p&&P(e,i,n,a);f<d;){for(P(e,i,f,d),f++,d--;i[2*f+o]<p;)f++;for(;i[2*d+o]>p;)d--}i[2*n+o]===p?P(e,i,n,d):P(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 m=Math.floor((f+p)/2);l=e[2*m+1],(s=e[2*m])>=i&&s<=n&&l>=r&&l<=a&&h.push(t[m]);var y=(c+1)%2;(0===c?i<=s:r<=l)&&(u.push(f),u.push(m-1),u.push(y)),(0===c?n>=s:a>=l)&&(u.push(m+1),u.push(p),u.push(y))}}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],m=e[2*f+1];L(d,m,i,r)<=l&&s.push(t[f]);var y=(u+1)%2;(0===u?i-n<=d:r-n<=m)&&(o.push(c),o.push(f-1),o.push(y)),(0===u?i+n>=d:r+n>=m)&&(o.push(f+1),o.push(h),o.push(y))}}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:j(r[0]),y:q(n,i),zoom:1/0,index:e,parentId:-1}}function U(t,e){return{type:"Feature",id:t.id,properties:N(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 N(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 j(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(j(r),q(o,i),j(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?N(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 m=u.points[d[f]];m.zoom>e&&(p+=m.numPoints||1)}if(p>=a){for(var y=l.x*c,v=l.y*c,_=n&&c>1?this._map(l,!0):null,g=(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 M=w.numPoints||1;y+=w.x*M,v+=w.y*M,w.parentId=g,n&&(_||(_=this._map(l,!0)),n(_,this._map(w)))}}l.parentId=g,i.push(F(y/p,v/p,g,p,_))}else if(i.push(l),p>1)for(var S=0,E=h;S<E.length;S+=1){var k=u.points[E[S]];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 mt(t){var e=this;if(2===arguments.length){var i=arguments[1];mt[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)?mt.apply(e,t):mt(t)});if("string"==typeof t){if(t in mt)return mt[t]}else"EPSG"in t?mt["EPSG:"+t.EPSG]=t:"ESRI"in t?mt["ESRI:"+t.ESRI]=t:"IAU2000"in t?mt["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"]}(mt);var yt=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"],vt=["3857","900913","3785","102113"];function _t(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 gt(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 Mt(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 St(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):gt(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=Mt(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:St,inverse:St,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}},Pt={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"}},At=Pt.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};Pt.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 mt}(t))return mt[t];if(function(t){return yt.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 mt["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(Pt,r);a||(a=At),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);_t(this,i),_t(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(t)}else e(t)}function Nt(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 jt(t,e,i,r){var n,a,o,s,l,u,h,c,p,f,d,m,y,v,_,g=t.x,x=t.y,b=t.z?t.z:0;if(n=Math.sqrt(g*g+x*x),a=Math.sqrt(g*g+x*x+b*b),n/i<1e-12){if(v=0,a/i<1e-12)return _=-r,{x:t.x,y:t.y,z:t.z}}else v=Math.atan2(x,g);o=b/a,c=(s=n/a)*(1-e)*(l=1/Math.sqrt(1-e*(2-e)*s*s)),p=o*l,y=0;do{y++,u=e*(h=i/Math.sqrt(1-e*p*p))/(h+(_=n*c+b*p-h*(1-e*p*p))),m=(d=o*(l=1/Math.sqrt(1-u*(2-u)*s*s)))*c-(f=s*(1-u)*l)*p,c=f,p=d}while(m*m>1e-24&&y<30);return{x:v,y:Math.atan(d/Math.abs(f)),z:_}}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 m=e.cvs[i][1],y=o*s,v=o*(1-s),_=(1-o)*(1-s),g=(1-o)*s;return l.x=_*u+v*c+g*e.cvs[i][0]+y*f,l.y=_*h+v*p+g*m+y*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=Nt(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=jt(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.splice(3)):[n.x,n.y,i[2]].concat(i.splice(3)):[n.x,n.y].concat(i.splice(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,m=.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&&(m+=1e7),{northing:Math.round(m),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)),m=i-5e5,y=e;r<"N"&&(y-=1e7),h=6*(n-1)-180+3,p=(c=y/.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=m/(.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(g=h+le(g),t.accuracy){var x=ue({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});_={top:x.lat,right:x.lon,bottom:v,left:g}}else _={lat:v,lon:g};return _}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,m=c/2,y=0,v=0;return m>0&&(p=1e5/Math.pow(10,m),f=t.substring(a,a+m),y=parseFloat(f)*p,d=t.substring(a+m),v=parseFloat(d)*p),{easting:y+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 me(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 ye(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=(ye(n,o,Math.cos(n),i)-t)*(s*Math.sqrt(s))*r,Math.abs(s)<1e-10)return n}return n}var _e={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=me(this.es),this.ml0=ye(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 m=ye(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*(m-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 y=s*Math.sin(a);if(Math.abs(Math.abs(y)-1)<1e-10)return 93;if(i=.5*this.a*this.k0*Math.log((1+y)/(1-y))+this.x0,r=s*Math.cos(a)/Math.sqrt(1-Math.pow(y,2)),(y=Math.abs(r))>=1){if(y-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,m=Math.pow(d,2);r=i-(e*=u)*m/(1-this.es)*.5*(1-m/12*(5+3*p-9*h*p+h-4*c-m/30*(61+90*p-252*h*p+45*f+46*h-m/56*(1385+3633*p+4095*f+1574*f*p)))),n=bt(this.long0+d*(1-m/6*(1+2*p+h-m/20*(5+28*p+24*f+8*h*p+6*h-m/42*(61+662*p+1320*f+720*f*p))))/l)}else r=K*xt(o),n=0;else{var y=Math.exp(a/this.k0),v=.5*(y-1/y),_=Math.cos(this.lat0+o/this.k0);e=Math.sqrt((1-Math.pow(_,2))/(1+Math.pow(v,2))),r=Math.asin(e),o<0&&(r=-r),n=0===v&&0===_?0:bt(Math.atan2(v,_)+this.long0)}return t.x=n,t.y=r,t},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]};function ge(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=ge(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,m=0;--c>=0;)r=d,n=f,p=u*(d=p)-r-h*(f=m)+t[c],m=h*d-n+u*f;return[(u=a*l)*p-(h=o*s)*m,u*m+h*p]}var Me={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&&(_e.init.apply(this),this.forward=_e.forward,this.inverse=_e.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(ge(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"]},Se={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,Me.init.apply(this),this.forward=Me.forward,this.inverse=Me.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*gt(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=gt(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*Mt(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*Mt(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"]},Pe={init:function(){var t,e,i,r,n,a,o,s,l,u,h,c,p,f=0,d=0,m=0,y=0,v=0,_=0,g=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&&(g=this.alpha),b&&(f=this.rectified_grid_angle*H),x||b)d=this.longc;else if(m=this.long1,v=this.lat1,y=this.long2,_=this.lat2,Math.abs(v-_)<=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(_)-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(g)/r),b||(f=g)):(h=f,g=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,_,Math.sin(_)),this.B),n=this.E/a,l=(o-a)/(o+a),u=((u=this.E*this.E)-o*a)/(u+o*a),(t=m-y)<-Math.pi?y-=Q:t>Math.pi&&(y+=Q),this.lam0=bt(.5*(m+y)-Math.atan(u*Math.tan(.5*this.B*(m-y))/l)/this.B),h=Math.atan(2*Math.sin(this.B*bt(m-this.lam0))/(n-1/n)),f=g=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(g))),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=Mt(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"]},Ae={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=gt(this.e,e,i),n=wt(this.e,this.lat1,e),a=Math.sin(this.lat2),o=Math.cos(this.lat2),s=gt(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=Mt(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 Ne={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 je(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=je(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=je(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=je(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,m=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||(m=Math.sin(i),d=Math.cos(i)),this.mode){case this.EQUIT:i=Math.abs(f)<=1e-10?0:Math.asin(p*m/f),c*=m,p=d*f;break;case this.OBLIQ:i=Math.abs(f)<=1e-10?this.lat0:Math.asin(d*this.sinph0+p*m*this.cosph0/f),c*=m*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=gt(this.e3,this.sin_po,this.cos_po),this.qs1=je(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=gt(this.e3,this.sin_po,this.cos_po),this.qs2=je(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=je(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=je(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=gt(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=je(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,m;for(s=r*r/this.a/this.a+(o=(this.ml0+n)/this.a)*o,l=o,a=20;a;--a)if(m=this.e*Math.sin(l),c=Math.sqrt(1-m*m)*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 m=this.B_re[1],y=this.B_im[1];for(e=2;e<=6;e++)h=p*s+c*l,m+=e*(this.B_re[e]*(c=c*s-p*l)-this.B_im[e]*(p=h)),y+=e*(this.B_im[e]*c+this.B_re[e]*p);var v=m*m+y*y;s=(f*m+d*y)/v,l=(d*m-f*y)/v}var _=s,g=l,x=1,b=0;for(e=1;e<=9;e++)b+=this.D[e]*(x*=_);var w=this.lat0+b*W*1e5;return t.x=this.long0+g,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=me(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*ye(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=gt(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=gt(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,m,y,v,_,g,x,b,w,M=t.x,S=t.y,E=Math.sin(t.y),k=Math.cos(t.y),T=bt(M-this.long0);return this.sphere?Math.abs(this.sin_p12-1)<=1e-10?(t.x=this.x0+this.a*(K-S)*Math.sin(T),t.y=this.y0-this.a*(K-S)*Math.cos(T),t):Math.abs(this.sin_p12+1)<=1e-10?(t.x=this.x0+this.a*(K+S)*Math.sin(T),t.y=this.y0+this.a*(K+S)*Math.cos(T),t):(_=this.sin_p12*E+this.cos_p12*k*Math.cos(T),v=(y=Math.acos(_))?y/Math.sin(y):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,S),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,S),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)),g=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+(y=l*g*(1-(x=g*g)*(m=f*f)*(1-m)/6+(b=x*g)/8*(d=p*f)*(1-2*m)+(w=b*g)/120*(m*(4-7*m)-3*p*p*(1-7*m))-w*g/48*d))*Math.sin(c),t.y=this.y0+y*Math.cos(c),t))},inverse:function(t){var e,i,r,n,a,o,s,l,u,h,c,p,f,d,m,y,v,_,g,x,b,w,M;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),m=Math.atan2(t.x,t.y),f=Fe(this.a,this.e,this.sin_p12),y=Math.cos(m),g=3*this.es*(1-(_=-(v=this.e*this.cos_p12*y)*v/(1-this.es)))*this.sin_p12*this.cos_p12*y/(1-this.es),w=1-_*(b=(x=e/f)-_*(1+_)*Math.pow(x,3)/6-g*(1+3*_)*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)*y),a=bt(this.long0+Math.asin(Math.sin(m)*Math.sin(b)/Math.cos(d))),M=Math.sin(d),o=Math.atan2((M-this.es*w*this.sin_p12)*Math.tan(d),M*(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 m,y,v;u=(m=s)*m,y=(u+=(v=u>=1?0:Math.sqrt(1-u)*Math.sin(o))*v)>=1?0:Math.sqrt(1-u),2===d.value?(u=y,y=-v,v=u):3===d.value?(y=-y,v=-v):4===d.value&&(u=y,y=v,v=-u),2===this.face?(u=m,m=-y,y=u):3===this.face?(m=-m,y=-y):4===this.face&&(u=m,m=y,y=-u),f.phi=Math.acos(-v)-K,f.lam=Math.atan2(y,m),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 Nt(t,this.es,this.a)},inverse:function(t){return jt(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"]},mi=1.340264,yi=-.081106,vi=893e-6,_i=.003796,gi=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(gi*Math.sin(t.y)),r=i*i,n=r*r*r;return t.x=e*Math.cos(i)/(gi*(mi+3*yi*r+n*(7*vi+9*_i*r))),t.y=i*(mi+yi*r+n*(vi+_i*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*(mi+yi*(e=a*a)+(i=e*e*e)*(vi+_i*e))-t.y)/(mi+3*yi*e+i*(7*vi+9*_i*e)),!(Math.abs(r)<1e-9));++n);return t.x=gi*t.x*(mi+3*yi*(e=a*a)+(i=e*e*e)*(7*vi+9*_i*e))/Math.cos(a),t.y=Math.asin(Math.sin(a)/gi),t.x=bt(t.x+this.long0),t},names:["eqearth","Equal Earth","Equal_Earth"]};te.defaultDatum="WGS84",te.Proj=Ut,te.WGS84=new te.Proj("WGS84"),te.Point=fe,te.toPoint=Kt,te.defs=mt,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(_e),t.Proj.projections.add(Me),t.Proj.projections.add(Se),t.Proj.projections.add(Te),t.Proj.projections.add(Ie),t.Proj.projections.add(Ce),t.Proj.projections.add(Pe),t.Proj.projections.add(Ae),t.Proj.projections.add(Le),t.Proj.projections.add(Ne),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)}(te);var bi=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 wi(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 Mi(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)Si(n,i);else if("Polygon"===e)Si(n,i[0]);else if("MultiLineString"===e)for(var a=0,o=i;a<o.length;a+=1)Si(n,o[a]);else if("MultiPolygon"===e)for(var s=0,l=i;s<l.length;s+=1)Si(n,l[s][0]);return n}function Si(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 Ei(t,e,i,r){if(e.geometry){var n,a=i.crs,o=i.projectionParams;o&&o.def&&(n=new bi(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)ki(s,h,a,n);else if("MultiPoint"===l)for(var p=0,f=s;p<f.length;p+=1)ki(f[p],h,a,n);else if("LineString"===l)Ti(s,h,u,!1,a,n);else if("MultiLineString"===l){if(i.lineMetrics){for(var d=0,m=s;d<m.length;d+=1)Ti(m[d],h=[],u,!1,a,n),t.push(Mi(c,"LineString",h,e.properties));return}Ii(s,h,u,!1,a,n)}else if("Polygon"===l)Ii(s,h,u,!0,a,n);else{if("MultiPolygon"!==l){if("GeometryCollection"===l){for(var y=0,v=e.geometry.geometries;y<v.length;y+=1)Ei(t,{id:c,geometry:v[y],properties:e.properties},i,r);return}throw new Error("Input data is not a valid GeoJSON object.")}for(var _=0,g=s;_<g.length;_+=1){var x=[];Ii(g[_],x,u,!0,a,n),h.push(x)}}t.push(Mi(c,l,h,e.properties))}}function ki(t,e,i,r){console.log("convertPoint: ",ki);var n=Ci(t,i,r);e.push(n[0],n[1],0)}function Ti(t,e,i,r,n,a){for(var o,s,l=0,u=0;u<t.length;u++){var h=Ci(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=wi(e[f],e[f+1],u,h,c,p);if(d>o)a=f,o=d;else if(d===o){var m=Math.abs(f-s);m<l&&(a=f,l=m)}}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 Ii(t,e,i,r,n,a){for(var o=0;o<t.length;o++){var s=[];Ti(t[o],s,i,r,n,a),e.push(s)}}function Ci(t,e,i){var r=[];if(i)(r=i.project([t[0],t[1]]))[1]=r[1]<0?0:r[1]>1?1:r[1];else if("EPSG:3857"===e){var n=t[0]/360+.5,a=Math.sin(t[1]*Math.PI/180),o=.5-.25*Math.log((1+a)/(1-a))/Math.PI;r=[n,o=o<0?0:o>1?1:o]}else{if("EPSG:4326"!==e)throw new Error("未预定义投影转换方法");var s=(90-t[1])/360;r=[t[0]/360+.5,s=s<0?0:s>1?1:s]}return r}function Pi(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,m=0===n?c.maxX:c.maxY;if(d>=i&&m<r)l.push(c);else if(!(m<i||d>=r)){var y=[];if("Point"===f||"MultiPoint"===f)Ai(p,y,i,r,n);else if("LineString"===f)Li(p,y,i,r,n,!1,s.lineMetrics);else if("MultiLineString"===f)Di(p,y,i,r,n,!1);else if("Polygon"===f)Di(p,y,i,r,n,!0);else if("MultiPolygon"===f)for(var v=0,_=p;v<_.length;v+=1){var g=[];Di(_[v],g,i,r,n,!0),g.length&&y.push(g)}if(y.length){if(s.lineMetrics&&"LineString"===f){for(var x=0,b=y;x<b.length;x+=1)l.push(Mi(c.id,f,b[x],c.tags));continue}"LineString"!==f&&"MultiLineString"!==f||(1===y.length?(f="LineString",y=y[0]):f="MultiLineString"),"Point"!==f&&"MultiPoint"!==f||(f=3===y.length?"Point":"MultiPoint"),l.push(Mi(c.id,f,y,c.tags))}}}return l.length?l:null}function Ai(t,e,i,r,n){for(var a=0;a<t.length;a+=3){var o=t[a+n];o>=i&&o<=r&&Ri(e,t[a],t[a+1],t[a+2])}}function Li(t,e,i,r,n,a,o){for(var s,l,u=zi(t),h=0===n?Oi:Bi,c=t.start,p=0;p<t.length-3;p+=3){var f=t[p],d=t[p+1],m=t[p+2],y=t[p+3],v=t[p+4],_=0===n?f:d,g=0===n?y:v,x=!1;o&&(s=Math.sqrt(Math.pow(f-y,2)+Math.pow(d-v,2))),_<i?g>i&&(l=h(u,f,d,y,v,i),o&&(u.start=c+s*l)):_>r?g<r&&(l=h(u,f,d,y,v,r),o&&(u.start=c+s*l)):Ri(u,f,d,m),g<i&&_>=i&&(l=h(u,f,d,y,v,i),x=!0),g>r&&_<=r&&(l=h(u,f,d,y,v,r),x=!0),!a&&x&&(o&&(u.end=c+s*l),e.push(u),u=zi(t)),o&&(c+=s)}var b=t.length-3,w=t[b],M=t[b+1],S=0===n?w:M;S>=i&&S<=r&&Ri(u,w,M,t[b+2]),b=u.length-3,a&&b>=3&&(u[b]!==u[0]||u[b+1]!==u[1])&&Ri(u,u[0],u[1],u[2]),u.length&&e.push(u)}function zi(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function Di(t,e,i,r,n,a){for(var o=0,s=t;o<s.length;o+=1)Li(s[o],e,i,r,n,a,!1)}function Ri(t,e,i,r){t.push(e,i,r)}function Oi(t,e,i,r,n,a){var o=(a-e)/(r-e);return Ri(t,a,i+(n-i)*o,1),o}function Bi(t,e,i,r,n,a){var o=(a-i)/(n-i);return Ri(t,e+(r-e)*o,a,1),o}function Fi(t,e){for(var i=[],r=0;r<t.length;r++){var n=t[r],a=n.type,o=void 0;if("Point"===a||"MultiPoint"===a||"LineString"===a)o=Vi(n.geometry,e);else if("MultiLineString"===a||"Polygon"===a){o=[];for(var s=0,l=n.geometry;s<l.length;s+=1)o.push(Vi(l[s],e))}else if("MultiPolygon"===a){o=[];for(var u=0,h=n.geometry;u<h.length;u+=1){for(var c=[],p=0,f=h[u];p<f.length;p+=1)c.push(Vi(f[p],e));o.push(c)}}i.push(Mi(n.id,a,o,n.tags))}return i}function Vi(t,e){var i=[];i.size=t.size,void 0!==t.start&&(i.start=t.start,i.end=t.end);for(var r=0;r<t.length;r+=3)i.push(t[r]+e,t[r+1],t[r+2]);return i}function Ui(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(Ni(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(Ni(l[c][f],l[c][f+1],e,i,r,n));s.geometry.push(p)}}return t.transformed=!0,t}function Ni(t,e,i,r,n,a){return[Math.round(i*(t*r-n)),Math.round(i*(e*r-a))]}function ji(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:2,minY:1,maxX:-1,maxY:0},s=0,l=t;s<l.length;s+=1)qi(o,l[s],a,n);return o}function qi(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)Gi(o,n,t,i,!1,!1);else if("MultiLineString"===a||"Polygon"===a)for(var l=0;l<n.length;l++)Gi(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++)Gi(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 Gi(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)}}bi.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]},bi.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])},bi.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)},bi.prototype._isProj4Obj=function(t){return void 0!==t.inverse&&void 0!==t.forward};var Zi={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},Xi=function(t,e){var i=(e=this.options=function(t,e){for(var i in e)t[i]=e[i];return t}(Object.create(Zi),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++)Ei(i,t.features[r],e,r);else Ei(i,"Feature"===t.type?t:{geometry:t},e);return i}(t,e);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),e.isWrapData&&(r=function(t,e){var i=e.buffer/e.extent,r=t,n=Pi(t,1,-1-i,i,0,-1,2,e),a=Pi(t,1,1-i,2+i,0,-1,2,e);return(n||a)&&(r=Pi(t,1,-i,1+i,0,-1,2,e)||[],n&&(r=Fi(n,1).concat(r)),a&&(r=r.concat(Fi(a,-1)))),r}(r,e)),r.length&&this.splitTile(r,0,0,0),i&&(r.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))};function Wi(t,e,i){return 32*((1<<t)*i+e)+t}function Ki(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 m(r.features),a=x(n);0===a.byteOffset&&a.byteLength===a.buffer.byteLength||(a=new Uint8Array(a)),e(null,{vectorTile:n,rawData:a.buffer})}Xi.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=Wi(e,i,r),p=this.tiles[c];if(!p&&(u>1&&console.time("creation"),p=this.tiles[c]=ji(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 m=.5*l.buffer/l.extent,y=.5-m,v=.5+m,_=1+m,g=null,x=null,b=null,w=null,M=Pi(t,h,i-m,i+v,0,p.minX,p.maxX,l),S=Pi(t,h,i+y,i+_,0,p.minX,p.maxX,l);t=null,M&&(g=Pi(M,h,r-m,r+v,1,p.minY,p.maxY,l),x=Pi(M,h,r+y,r+_,1,p.minY,p.maxY,l),M=null),S&&(b=Pi(S,h,r-m,r+v,1,p.minY,p.maxY,l),w=Pi(S,h,r+y,r+_,1,p.minY,p.maxY,l),S=null),u>1&&console.timeEnd("clipping"),s.push(g||[],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)}}},Xi.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=1<<t,s=Wi(t,e=(e=+e)+o&o-1,i=+i);if(this.tiles[s])return Ui(this.tiles[s],n);a>1&&console.log("drilling down to z%d-%d-%d",t,e,i);for(var l,u=t,h=e,c=i;!l&&u>0;)u--,l=this.tiles[Wi(u,h>>=1,c>>=1)];return l&&l.source?(a>1&&(console.log("found parent tile z%d-%d-%d",u,h,c),console.time("drilling down")),this.splitTile(l.source,u,h,c,t,e,i),a>1&&console.timeEnd("drilling down"),this.tiles[s]?Ui(this.tiles[s],n):null):null};var Hi=function(e){function i(t,i,r,n){e.call(this,t,i,r,Ki),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]),m=t.createExpression("string"==typeof f?[f,["accumulated"],["get",c]]:f);n[c]=d.value,a[c]=m.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 Xi(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),Ji=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:Hi,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 Ji.prototype.setReferrer=function(t,e){this.referrer=e},Ji.prototype.setImages=function(t,e,i){this.availableImages[t]=e,i()},Ji.prototype.setLayers=function(t,e,i){this.getLayerIndex(t).replace(e),i()},Ji.prototype.updateLayers=function(t,e,i){this.getLayerIndex(t).update(e.layers,e.removedIds),i()},Ji.prototype.loadTile=function(t,e,i){this.getWorkerSource(t,e.type,e.source).loadTile(e,i)},Ji.prototype.loadDEMTile=function(t,e,i){this.getDEMWorkerSource(t,e.source).loadTile(e,i)},Ji.prototype.reloadTile=function(t,e,i){this.getWorkerSource(t,e.type,e.source).reloadTile(e,i)},Ji.prototype.abortTile=function(t,e,i){this.getWorkerSource(t,e.type,e.source).abortTile(e,i)},Ji.prototype.removeTile=function(t,e,i){this.getWorkerSource(t,e.type,e.source).removeTile(e,i)},Ji.prototype.removeDEMTile=function(t,e){this.getDEMWorkerSource(t,e.source).removeTile(e)},Ji.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()}},Ji.prototype.loadWorkerSource=function(t,e,i){try{this.self.importScripts(e.url),i()}catch(t){i(t.toString())}},Ji.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())}},Ji.prototype.getAvailableImages=function(t){var e=this.availableImages[t];return e||(e=[]),e},Ji.prototype.getLayerIndex=function(t){var e=this.layerIndexes[t];return e||(e=this.layerIndexes[t]=new r),e},Ji.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]},Ji.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]},Ji.prototype.enforceCacheSizeLimit=function(e,i){t.enforceCacheSizeLimit(i)},"undefined"!=typeof WorkerGlobalScope&&void 0!==t.window&&t.window instanceof WorkerGlobalScope&&(t.window.worker=new Ji(t.window)),Ji}),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=y,d=y,m=1e20;function y(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++)_(t,o,e,i,r,n,a);for(var s=0;s<i;s++)_(t,s*e,1,e,r,n,a)}function _(t,e,i,r,n,a,o){var s,l,u,h;for(a[0]=0,o[0]=-m,o[1]=m,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]=m}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)}}y.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(m,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]=m;else if(0===c)a[h]=m,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}}},y.prototype.draw=function(t){return this._draw(t,!1).data},y.prototype.drawWithMetrics=function(t){return this._draw(t,!0)},f.default=d;var g=function(t,e){this.requestManager=t,this.localIdeographFontFamily=e,this.entries={}};g.prototype.setURL=function(t){this.url=t},g.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]=[],g.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)}})},g.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))},g.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 g.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}}}},g.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)}})},g.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),M=function(t,e){this.width=t,this.height=e,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}};M.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]},M.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},M.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))}},M.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))}},M.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},M.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 S=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)}};S.prototype.broadcast=function(e,i,r){t.asyncAll(this.actors,function(t,r){t.send(e,i,r)},r=r||function(){})},S.prototype.getActor=function(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]},S.prototype.remove=function(){this.actors.forEach(function(t){t.remove()}),this.actors=[],this.workerPool.release(this.id)},S.Actor=t.Actor;var E=function(e){function i(i,r,n,a){if(e.call(this),this.id=i,this.dispatcher=n,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.onAdd=function(t){this.map=t,this.load()},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._options.mapgisOffset||0;e.tileID.canonical.offsetZ(r+this.getZoomOffset());var n=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme));e.tileID.canonical.offsetZ(0-r-this.getZoomOffset());var a={request:this.map._requestManager.transformRequest(n,t.ResourceType.Tile),uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function o(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)))}a.request.collectResourceTiming=this._collectResourceTiming,e.actor&&"expired"!==e.state?"loading"===e.state?e.reloadCallback=i:e.request=e.actor.send("reloadTile",a,o.bind(this)):(e.actor=this.dispatcher.getActor(),e.request=e.actor.send("loadTile",a,o.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.Evented),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"}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.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.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.onAdd=function(t){this.map=t,this.load()},i.prototype.setCoordinates=function(e){var i=this;this.coordinates=e;var r=e.map(t.MercatorCoordinate.fromLngLat);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))}(r),this.minzoom=this.maxzoom=this.tileID.z;var n=r.map(function(t){return i.tileID.getTilePoint(t)._round()});return this._boundsArray=new t.StructArrayLayout4i8,this._boundsArray.emplaceBack(n[0].x,n[0].y,0,0),this._boundsArray.emplaceBack(n[1].x,n[1].y,t.EXTENT,0),this._boundsArray.emplaceBack(n[3].x,n[3].y,0,t.EXTENT),this._boundsArray.emplaceBack(n[2].x,n[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{type:"image",url:this.options.url,coordinates:this.coordinates}},i.prototype.hasTransition=function(){return!1},i}(t.Evented),C=function(e){function i(t,i,r,n){e.call(this,t,i,r,n),this.rebaseRequestUrl=i.rebaseRequestUrl||function(){},this.coordinates=[],this.type="image-map"}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)),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=e||this.transfromMapCoords(),a=this.map._containerDimensions(),o=this.applyUrl(this.url,n,a[0],a[1]);t.getImage(this.map._requestManager.transformRequest(o,t.ResourceType.Image),function(e,a){r._loaded=!0,e?r.fire(new t.ErrorEvent(e)):a&&(r.image=a,n&&(r.coordinates=n),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.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=e.map(t.MercatorCoordinate.fromLngLat);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))}(r),this.minzoom=this.maxzoom=this.tileID.z;var n=r.map(function(t){return i.tileID.getTilePoint(t)._round()});return this._boundsArray=new t.StructArrayLayout4i8,this._boundsArray.emplaceBack(n[0].x,n[0].y,0,0),this._boundsArray.emplaceBack(n[1].x,n[1].y,t.EXTENT,0),this._boundsArray.emplaceBack(n[3].x,n[3].y,0,t.EXTENT),this._boundsArray.emplaceBack(n[2].x,n[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}(I);function P(t){var e=(90+t)/180*90;return e||45+e/2}function A(t){return t.geometry.coordinates=t.geometry.coordinates.map(function(t){return t[1]=P(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]=P(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]=P(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.setEventedParent(a),this.crs=this.getCrs(),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.getCrs(),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.getCrs(),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.getCrs()},clusterProperties:r.clusterProperties},r.workerOptions)}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.getCrs=function(){return"EPSG:3857"},i.prototype.fixCrsData=function(e){return this.getCrs()!==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]=P(i.geometry.coordinates[1]),e=i):"LineString"===e.geometry.type||"MultiPoint"===t.type?e=A(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=A(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()},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(){return t.extend({},this._options,{type:this.type,data:this._data})},i.prototype.hasTransition=function(){return!1},i}(t.Evented),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 m=d[f];c[m.featureIndex]||(c[m.featureIndex]=!0,p.push(m))}}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 N=function(t,e){this.max=t,this.onRemove=e,this.reset()};N.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},N.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},N.prototype.has=function(t){return t.wrapped().key in this.data},N.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},N.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},N.prototype.getByKey=function(t){var e=this.data[t];return e?e[0].value:null},N.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},N.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},N.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},N.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 j=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};j.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},j.prototype.updateData=function(t){var e=this.context.gl;this.context.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)},j.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),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.bindRenderbuffer(e.RENDERBUFFER,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.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),_t=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),gt=function(t){function e(e){t.call(this,e),this.vao=e.extVertexArrayObject}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).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),Mt=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),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.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}(Mt),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}(Mt),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 St(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 Pt=function(t,e,i){this.enable=t,this.mode=e,this.frontFace=i};Pt.disabled=new Pt(!1,1029,2305),Pt.backCCW=new Pt(!0,1029,2305);var At=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 mt(this),this.bindTexture=new yt(this),this.bindVertexBuffer=new vt(this),this.bindElementBuffer=new _t(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new gt(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")};At.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()},At.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},At.prototype.createIndexBuffer=function(t,e){return new j(this,t,e)},At.prototype.createVertexBuffer=function(t,e,i){return new G(this,t,e,i)},At.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},At.prototype.createFramebuffer=function(t,e,i){return new kt(this,t,e,i)},At.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)},At.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))},At.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)},At.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)},At.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)},At.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.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 N(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;if(this.transform=e,this._sourceLoaded&&!this._paused){var n;this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?n=e.getVisibleUnwrappedCoordinates(this._source.tileID).map(function(e){return new t.OverscaledTileID(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y)}):(n=e.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&&(n=n.filter(function(t){return r._source.hasTile(t)}))):n=[];var a=e.coveringZoomLevel(this._source),o=Math.max(a-i.maxOverzooming,this._source.minzoom),s=Math.max(a+i.maxUnderzooming,this._source.minzoom),l=this._updateRetainedTiles(n,a);if(Dt(this._source.type)){for(var u={},h={},c=0,p=Object.keys(l);c<p.length;c+=1){var f=p[c],d=l[f],m=this._tiles[f];if(m&&!(m.fadeEndTime&&m.fadeEndTime<=t.browser.now())){var y=this.findLoadedParent(d,o);y&&(this._addTile(y.tileID),u[y.tileID.key]=y.tileID),h[f]=d}}for(var v in this._retainLoadedChildren(h,a,s,l),u)l[v]||(this._coveredTiles[v]=!0,l[v]=u[v])}for(var _ in l)this._tiles[_].clearFadeHold();for(var g=0,x=t.keysDifference(this._tiles,l);g<x.length;g+=1){var b=x[g],w=this._tiles[b];w.hasSymbolBuckets&&!w.holdingForFade()?w.setHoldDuration(this.map._fadeDuration):w.hasSymbolBuckets&&!w.symbolFadeFinished()||this._removeTile(b)}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],m=this._tiles[d.key];if(!m.hasData()){if(e+1>this._source.maxzoom){var y=d.children(this._source.maxzoom)[0],v=this.getTile(y);if(v&&v.hasData()){r[y.key]=y;continue}}else{var _=d.children(this._source.maxzoom);if(r[_[0].key]&&r[_[1].key]&&r[_[2].key]&&r[_[3].key])continue}for(var g=m.wasRequested(),x=d.overscaledZ-1;x>=a;--x){var b=d.scaledTo(x);if(n[b.key])break;if(n[b.key]=!0,!(m=this.getTile(b))&&g&&(m=this._addTile(b)),m&&(r[b.key]=b,g=m.wasRequested(),m.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,m=0,y=u;m<y.length;m+=1){var v=y[m];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 _=function(e){var r=n._tiles[h[e]];if(!r.holdingForFade()){var s=r.tileID,m=Math.pow(2,o.zoom-r.tileID.overscaledZ),y=i*r.queryPadding*t.EXTENT/r.tileSize/m,v=[s.getTilePoint(new t.MercatorCoordinate(c,p)),s.getTilePoint(new t.MercatorCoordinate(f,d))];if(v[0].x-y<t.EXTENT&&v[0].y-y<t.EXTENT&&v[1].x+y>=0&&v[1].y+y>=0){var _=l.map(function(t){return s.getTilePoint(t)}),g=u.map(function(t){return s.getTilePoint(t)});a.push({tile:r,tileID:s,queryGeometry:_,cameraQueryGeometry:g,scale:m})}}},g=0;g<h.length;g++)_(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 Nt={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 jt(t,e,i){i.push({command:Nt.addSource,args:[t,e[t]]})}function qt(t,e,i){e.push({command:Nt.removeSource,args:[t]}),i[t]=!0}function Gt(t,e,i,r){qt(t,i,r),jt(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,m=r.transform.width/r.transform.height,y=!1,v=0;v<d.length;v++){var _=d.get(v);if(_.hidden||_.writingMode===t.WritingMode.vertical&&!y)se(_.numGlyphs,p);else{y=!1;var g=[_.anchorX,_.anchorY,0,1];if(t.transformMat4(g,g,i),$t(g,c)){var x=.5+g[3]/r.transform.cameraToCenterDistance*.5,b=t.evaluateSizeForFeature(u,h,_),w=s?b*x:b/x,M=new t.Point(_.anchorX,_.anchorY),S=Qt(M,a).point,E={},k=re(_,w,!1,l,i,a,o,e.glyphOffsetArray,f,p,S,M,E,m);y=k.useVertical,(k.notEnoughRoom||y||k.needsFlipping&&re(_,w,!0,l,i,a,o,e.glyphOffsetArray,f,p,S,M,E,m).notEnoughRoom)&&se(_.numGlyphs,p)}else se(_.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,m=e.getoffsetX(s.glyphStartIndex),y=e.getoffsetX(p-1),v=ae(t*m,i,r,n,a,o,s.segment,f,d,l,u,h,c);if(!v)return null;var _=ae(t*y,i,r,n,a,o,s.segment,f,d,l,u,h,c);return _?{first:v,last:_}: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 m,y=i/24,v=e.lineOffsetX*y,_=e.lineOffsetY*y;if(e.numGlyphs>1){var g=e.glyphStartIndex+e.numGlyphs,x=e.lineStartIndex,b=e.lineStartIndex+e.lineLength,w=ee(y,l,v,_,r,c,p,e,u,o,f,!1);if(!w)return{notEnoughRoom:!0};var M=Qt(w.first.point,s).point,S=Qt(w.last.point,s).point;if(n&&!r){var E=ie(e.writingMode,M,S,d);if(E)return E}m=[w.first];for(var k=e.glyphStartIndex+1;k<g-1;k++)m.push(ae(y*l.getoffsetX(k),v,_,r,c,p,e.segment,x,b,u,o,f,!1));m.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)),P=Qt(C,a),A=P.signedDistanceFromCamera>0?P.point:ne(p,C,T,1,a),L=ie(e.writingMode,T,A,d);if(L)return L}var z=ae(y*l.getoffsetX(e.glyphStartIndex),v,_,r,c,p,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,u,o,f,!1);if(!z)return{notEnoughRoom:!0};m=[z]}for(var D=0,R=m;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,m=d>0?1:-1,y=0;n&&(m*=-1,y=Math.PI),m<0&&(y+=Math.PI);for(var v=m>0?l+s:l+s+1,_=v,g=a,x=a,b=0,w=0,M=Math.abs(d);b+w<=M;){if((v+=m)<l||v>=u)return null;if(x=g,void 0===(g=p[v])){var S=new t.Point(h.getx(v),h.gety(v)),E=Qt(S,c);if(E.signedDistanceFromCamera>0)g=p[v]=E.point;else{var k=v-m;g=ne(0===b?o:new t.Point(h.getx(k),h.gety(k)),S,x,M-b+1,c)}}b+=w,w=x.dist(g)}var T=(M-b)/w,I=g.sub(x),C=I.mult(T)._add(x);return C._add(I._unit()._perp()._mult(r*m)),{point:C,angle:y+Math.atan2(g.y-x.y,g.x-x.x),tileDistance:f?{prevTileDistance:v-m===_?0:h.gettileUnitDistanceFromAnchor(v-m),lastSegmentViewportDistance:M-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 m=this.circleCells[n];if(null!==m)for(var y=this.circles,v=0,_=m;v<_.length;v+=1){var g=_[v];if(!l.circle[g]){l.circle[g]=!0;var x=3*g;if(this._circleAndRectCollide(y[x],y[x+1],y[x+2],t,e,i,r)&&(!s||s(this.circleKeys[g]))){if(o.hitTest)return a.push(!0),!0;var b=y[x],w=y[x+1],M=y[x+2];a.push({key:this.circleKeys[g],x1:b-M,y1:w-M,x2:b+M,y2:w+M})}}}},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 m=4*d;if(this._circleAndRectCollide(l.x,l.y,l.radius,c[m+0],c[m+1],c[m+2],c[m+3])&&(!s||s(this.boxKeys[d])))return a.push(!0),!0}}var y=this.circleCells[n];if(null!==y)for(var v=this.circles,_=0,g=y;_<g.length;_+=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=[],m=this.projectAnchor(u,a.anchorX,a.anchorY),y=l/24,v=a.lineOffsetX*l,_=a.lineOffsetY*l,g=new t.Point(a.anchorX,a.anchorY),x=ee(y,s,v,_,!1,Qt(g,h).point,g,a,o,h,{},!0),b=!1,w=!1,M=!0,S=m.perspectiveRatio*n,E=1/(n*r),k=0,T=0;x&&(k=this.approximateTileDistance(x.first.tileDistance,x.first.angle,E,m.cameraDistance,p),T=this.approximateTileDistance(x.last.tileDistance,x.last.angle,E,m.cameraDistance,p));for(var I=0;I<e.length;I+=5){var C=e[I],P=e[I+1],A=e[I+2],L=e[I+3];if(!x||L<-k||L>T)he(e,I,!1);else{var z=this.projectPoint(u,C,P),D=A*S;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,N=z.y+D;if(M=M&&this.isOffscreen(F,V,U,N),w=w||this.isInsideGrid(F,V,U,N),!i&&this.grid.hitTestCircle(z.x,z.y,D,f)){if(!c)return{circles:[],offscreen:!1};b=!0}}}return{circles:b||!w?[]:d,offscreen:M}},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 m=d[f],y=m.key;if(void 0===c[y.bucketInstanceId]&&(c[y.bucketInstanceId]={}),!c[y.bucketInstanceId][y.featureIndex]){var v=[new t.Point(m.x1,m.y1),new t.Point(m.x2,m.y1),new t.Point(m.x2,m.y2),new t.Point(m.x1,m.y2)];t.polygonIntersectsPolygon(i,v)&&(c[y.bucketInstanceId][y.featureIndex]=!0,void 0===p[y.bucketInstanceId]&&(p[y.bucketInstanceId]=[]),p[y.bucketInstanceId].push(y.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},me=function(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}};function ye(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}}me.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 _e=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 me(i),this.prevPlacement=r,r&&(r.prevPlacement=void 0),this.placedOrientations={}};function ge(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)}_e.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,m=a.sortKeyRanges;d<m.length;d+=1){var y=m[d];e.push({sortKey:y.sortKey,symbolInstanceStart:y.symbolInstanceStart,symbolInstanceEnd:y.symbolInstanceEnd,parameters:f})}else e.push({symbolInstanceStart:0,symbolInstanceEnd:a.symbolInstances.length,parameters:f})}},_e.prototype.attemptAnchorPlacement=function(t,e,i,r,n,a,o,s,l,u,h,c,p,f,d){var m,y=[c.textOffset0,c.textOffset1],v=ye(t,i,r,y,n),_=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 _.box.length>0?(this.prevPlacement&&this.prevPlacement.variableOffsets[c.crossTileID]&&this.prevPlacement.placements[c.crossTileID]&&this.prevPlacement.placements[c.crossTileID].text&&(m=this.prevPlacement.variableOffsets[c.crossTileID].anchor),this.variableOffsets[c.crossTileID]={textOffset:y,width:i,height:r,anchor:t,textBoxScale:n,prevAnchor:m},this.markUsedJustification(p,t,c,f),p.allowVerticalPlacement&&(this.markUsedOrientation(p,f,c),this.placedOrientations[c.crossTileID]=f),{shift:v,placedGlyphBoxes:_}):void 0},_e.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,m=a.collisionGroup,y=s.get("text-optional"),v=s.get("icon-optional"),_=s.get("text-allow-overlap"),g=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"),M="viewport-y"===s.get("symbol-z-order"),S=_&&(g||!o.hasIconData()||v),E=g&&(_||!o.hasTextData()||y);!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,M=!1,k=!1,T=!0,I=null,C={box:null,offscreen:null},P={box:null,offscreen:null},A=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(),P=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 N=function(t,i,r){for(var a=t.x2-t.x1,s=t.y2-t.y1,u=e.textBoxScale,h=w&&!g?i:null,p={box:[],offscreen:!1},f=_?2*V.length:V.length,d=0;d<f;++d){var y=n.attemptAnchorPlacement(V[d%V.length],t,a,s,u,x,b,c,l,m,d>=V.length,e,o,r,h);if(y&&(p=y.placedGlyphBoxes)&&p.box&&p.box.length){M=!0,I=y.shift;break}}return p};F(function(){return N(O,a.iconBox,t.WritingMode.horizontal)},function(){var i=a.verticalTextBox;return o.allowVerticalPlacement&&!(C&&C.box&&C.box.length)&&e.numVerticalGlyphVertices>0&&i?N(i,a.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null}}),C&&(M=C.box,T=C.offscreen);var j=B(C&&C.box);if(!M&&n.prevPlacement){var q=n.prevPlacement.variableOffsets[e.crossTileID];q&&(n.variableOffsets[e.crossTileID]=q,n.markUsedJustification(o,q.anchor,e,j))}}else{var G=function(t,i){var r=n.collisionIndex.placeCollisionBox(t,_,c,l,m.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)}}M=(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);A=n.collisionIndex.placeCollisionCircles(Z,_,h,c,X,o.lineVertexArray,o.glyphOffsetArray,W,l,u,r,b,m.predicate),M=_||A.circles.length>0,T=T&&A.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,g,c,l,m.predicate)};k=P&&P.box&&P.box.length&&a.verticalIconBox?(L=K(a.verticalIconBox)).box.length>0:(L=K(a.iconBox)).box.length>0,T=T&&L.offscreen}var H=y||0===e.numHorizontalGlyphVertices&&0===e.numVerticalGlyphVertices,J=v||0===e.numIconVertices;H||J?J?H||(k=k&&M):M=k&&M:k=M=k&&M,M&&f&&f.box&&n.collisionIndex.insertCollisionBox(f.box,s.get("text-ignore-placement"),o.bucketInstanceId,P&&P.box&&D?D:z,m.ID),k&&L&&n.collisionIndex.insertCollisionBox(L.box,s.get("icon-ignore-placement"),o.bucketInstanceId,R,m.ID),M&&A&&n.collisionIndex.insertCollisionCircles(A.circles,s.get("text-ignore-placement"),o.bucketInstanceId,z,m.ID),n.placements[e.crossTileID]=new de(M||S,k||E,T||o.justReloaded),i[e.crossTileID]=!0}};if(M)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 P=e.symbolInstanceStart;P<e.symbolInstanceEnd;P++)k(o.symbolInstances.get(P),o.collisionArrays[P]);o.justReloaded=!1},_e.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)}},_e.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)},_e.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)},_e.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)}},_e.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)},m=function(r){var a=e.symbolInstances.get(r),s=a.numHorizontalGlyphVertices,l=a.numVerticalGlyphVertices,m=a.crossTileID,y=i[m],v=n.opacities[m];y?v=o:v||(n.opacities[m]=v=f),i[m]=!0;var _=a.numIconVertices>0,g=n.placedOrientations[a.crossTileID],x=g===t.WritingMode.vertical,b=g===t.WritingMode.horizontal||g===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 M=v.text.isHidden();[a.rightJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.leftJustifiedTextSymbolIndex].forEach(function(t){t>=0&&(e.text.placedSymbolArray.get(t).hidden=M||x?1:0)}),a.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(a.verticalPlacedTextSymbolIndex).hidden=M||b?1:0);var S=n.variableOffsets[a.crossTileID];S&&n.markUsedJustification(e,S.anchor,a,g);var E=n.placedOrientations[a.crossTileID];E&&(n.markUsedJustification(e,"left",a,E),n.markUsedOrientation(e,E,a))}if(_){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 P=!0;if(u){var A=n.variableOffsets[m];A?(C=ye(A.anchor,A.width,A.height,A.textOffset,A.textBoxScale),h&&C._rotate(c?n.transform.angle:-n.transform.angle)):P=!1}I.textBox&&ge(e.textCollisionBox.collisionVertexArray,v.text.placed,!P||x,C.x,C.y),I.verticalTextBox&&ge(e.textCollisionBox.collisionVertexArray,v.text.placed,!P||b,C.x,C.y)}var L=Boolean(!b&&I.verticalIconBox);I.iconBox&&ge(e.iconCollisionBox.collisionVertexArray,v.icon.placed,L,p?C.x:0,p?C.y:0),I.verticalIconBox&&ge(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)ge(e.textCollisionCircle.collisionVertexArray,v.text.placed,y||0===z[D+4])}}},y=0;y<e.symbolInstances.length;y++)m(y);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)},_e.prototype.symbolFadeChange=function(t){return 0===this.fadeDuration?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment},_e.prototype.zoomAdjustment=function(t){return Math.max(0,(this.transform.zoom-t)/1.5)},_e.prototype.hasTransitions=function(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration},_e.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},_e.prototype.setStale=function(){this.stale=!0};var xe=Math.pow(2,25),be=Math.pow(2,24),we=Math.pow(2,17),Me=Math.pow(2,16),Se=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*Me+i*Se+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 Pe=function(t,e,i,r,n,a,o){this.placement=new _e(t,n,a,o),this._currentPlacementIndex=e.length-1,this._forceFullPlacement=i,this._showCollisionBoxes=r,this._done=!1};Pe.prototype.isDone=function(){return this._done},Pe.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},Pe.prototype.commit=function(t){return this.placement.commit(t),this.placement};var Ae=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=Ae/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(Nt,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),Fe=t.pick(Nt,["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 S((Bt||(Bt=new Ot),Bt),this),this.imageManager=new p,this.imageManager.setEventedParent(this),this.glyphManager=new g(r._requestManager,n.localIdeographFontFamily),this.lineAtlas=new M(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,m=l.stretchX,y=l.stretchY,v=l.content,_=new t.RGBAImage({width:u,height:h});t.RGBAImage.copy(e,_,{x:c,y:p},{x:0,y:0},{width:u,height:h}),i[s]={data:_,pixelRatio:d,sdf:f,stretchX:m,stretchY:y,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]];c.recalculate(e,this._availableImages),!c.isHidden(e.zoom)&&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:Nt.setStyle,args:[i]}];var r=[];try{if(!t.deepEqual(e.version,i.version))return[{command:Nt.setStyle,args:[i]}];t.deepEqual(e.center,i.center)||r.push({command:Nt.setCenter,args:[i.center]}),t.deepEqual(e.zoom,i.zoom)||r.push({command:Nt.setZoom,args:[i.zoom]}),t.deepEqual(e.bearing,i.bearing)||r.push({command:Nt.setBearing,args:[i.bearing]}),t.deepEqual(e.pitch,i.pitch)||r.push({command:Nt.setPitch,args:[i.pitch]}),t.deepEqual(e.sprite,i.sprite)||r.push({command:Nt.setSprite,args:[i.sprite]}),t.deepEqual(e.glyphs,i.glyphs)||r.push({command:Nt.setGlyphs,args:[i.glyphs]}),t.deepEqual(e.transition,i.transition)||r.push({command:Nt.setTransition,args:[i.transition]}),t.deepEqual(e.light,i.light)||r.push({command:Nt.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:Nt.setGeoJSONSourceData,args:[a,i[a].data]}):Gt(a,i,r,n)):jt(a,i,r))}(e.sources,i.sources,a,n);var o=[];e.layers&&e.layers.forEach(function(t){n[t.source]?r.push({command:Nt.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,{}),m=c.slice(),y=Object.create(null);for(n=0,a=0;n<c.length;n++)d.hasOwnProperty(o=c[n])?a++:(r.push({command:Nt.removeLayer,args:[o]}),m.splice(m.indexOf(o,a),1));for(n=0,a=0;n<p.length;n++)m[m.length-1-n]!==(o=p[p.length-1-n])&&(f.hasOwnProperty(o)?(r.push({command:Nt.removeLayer,args:[o]}),m.splice(m.lastIndexOf(o,m.length-a),1)):a++,r.push({command:Nt.addLayer,args:[d[o],u=m[m.length-n]]}),m.splice(m.length-n,0,o),y[o]=!0);for(n=0;n<p.length;n++)if(s=f[o=p[n]],l=d[o],!y[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,Nt.setLayoutProperty),Xt(s.paint,l.paint,r,o,null,Nt.setPaintProperty),t.deepEqual(s.filter,l.filter)||r.push({command:Nt.setFilter,args:[o,l.filter]}),t.deepEqual(s.minzoom,l.minzoom)&&t.deepEqual(s.maxzoom,l.maxzoom)||r.push({command:Nt.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),Nt.setPaintProperty):t.deepEqual(s[h],l[h])||r.push({command:Nt.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),Nt.setPaintProperty):t.deepEqual(s[h],l[h])||r.push({command:Nt.setLayerProperty,args:[o,h,l[h]]}))}else r.push({command:Nt.removeLayer,args:[o]}),u=m[m.lastIndexOf(o)+1],r.push({command:Nt.addLayer,args:[l,u]})}(o,i.layers,r)}catch(t){console.warn("Unable to compute style diff:",t),r=[{command:Nt.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.sourceCaches[e]=new Lt(e,i,this.dispatcher);a.style=this,a.setEventedParent(this,function(){return{isSourceLoaded:n.loaded(),source:a.serialize(),sourceId:e}}),a.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 m=n.length-1;m>=0;m--){var y=n[m].feature;if(r[y.layer.id]<f)break;p.push(y),n.pop()}else for(var v=0,_=t;v<_.length;v+=1){var g=_[v][d];if(g)for(var x=0,b=g;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 m=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 y in s)m(y);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 Pe(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,m=this._order;d<m.length;d+=1){var y=this._layers[m[d]];"symbol"===y.type&&this.placement.updateLayerOpacities(y,l[y.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 Ne=t.createLayout([{name:"a_pos",type:"Int16",components:2}]),je=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 mi=Object.freeze({__proto__:null,prelude:je,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}),yi=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};yi.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)},yi.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,m=i;d<m.length;d+=1){var y=m[d];y.bind(),y.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},yi.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(je.fragmentSource,e.fragmentSource).join("\n"),l=o.concat(je.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 m=a.getActiveAttrib(this.program,d);m&&(this.attributes[m.name]=a.getAttribLocation(this.program,m.name))}for(var y=a.getProgramParameter(this.program,a.ACTIVE_UNIFORMS),v=0;v<y;v++){var _=a.getActiveUniform(this.program,v);_&&(f[_.name]=a.getUniformLocation(this.program,_.name))}this.fixedUniforms=r(t,f),this.binderUniforms=i?i.getUniforms(t,f):[]}}};function _i(t,e,i){var r=1/ce(i,1,e.transform.tileZoom),n=Math.pow(2,i.tileID.overscaledZ),a=i.tileSize*Math.pow(2,e.transform.tileZoom)/n,o=a*(i.tileID.canonical.x+i.tileID.wrap*n),s=a*i.tileID.canonical.y;return{u_image:0,u_texsize:i.imageAtlasTexture.size,u_scale:[r,t.fromScale,t.toScale],u_fade:t.t,u_pixel_coord_upper:[o>>16,s>>16],u_pixel_coord_lower:[65535&o,65535&s]}}vi.prototype.draw=function(t,e,i,r,n,a,o,s,l,u,h,c,p,f,d,m){var y,v=t.gl;if(!this.failedToCreate){for(var _ in t.program.set(this.program),t.setDepthMode(i),t.setStencilMode(r),t.setColorMode(n),t.setCullFace(a),this.fixedUniforms)this.fixedUniforms[_].set(o[_]);f&&f.setUniforms(t,this.binderUniforms,c,{zoom:p});for(var g=(y={},y[v.LINES]=2,y[v.TRIANGLES]=3,y[v.LINE_STRIP]=1,y)[e],x=0,b=h.get();x<b.length;x+=1){var w=b[x],M=w.vaos||(w.vaos={});(M[s]||(M[s]=new yi)).bind(t,this,l,f?f.getPaintVertexBuffers():[],u,w.vertexOffset,d,m),v.drawElements(e,w.primitiveLength*g,v.UNSIGNED_SHORT,w.primitiveOffset*g*2)}}};var gi=function(e,i,r,n){var a=i.style.light,o=a.properties.get("position"),s=[o.x,o.y,o.z],l=t.create$1();"viewport"===a.properties.get("anchor")&&t.fromRotation(l,-i.transform.angle),t.transformMat3(s,s,l);var u=a.properties.get("color");return{u_matrix:e,u_lightpos:s,u_lightintensity:a.properties.get("intensity"),u_lightcolor:[u.r,u.g,u.b],u_vertical_gradient:+r,u_opacity:n}},xi=function(e,i,r,n,a,o,s){return t.extend(gi(e,i,r,n),_i(o,i,s),{u_height_factor:-Math.pow(2,a.overscaledZ)/s.tileSize/8})},bi=function(t){return{u_matrix:t}},wi=function(e,i,r,n){return t.extend(bi(e),_i(r,i,n))},Mi=function(t,e){return{u_matrix:t,u_world:e}},Si=function(e,i,r,n,a){return t.extend(wi(e,i,r,n),{u_world:a})},Ei=function(e,i,r,n){var a,o,s=e.transform;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}},Pi=function(t,e,i,r){return{u_matrix:t,u_extrude_scale:ce(e,1,i),u_intensity:r}},Ai=function(e,i,r){var n=e.transform;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(Ai(e,i,r),{u_image:0})},zi=function(e,i,r,n){var a=e.transform,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.lineAtlas,s=Ri(i,e.transform),l="round"===r.layout.get("line-cap"),u=o.getDash(n.from,l),h=o.getDash(n.to,l),c=u.width*a.fromScale,p=h.width*a.toScale;return t.extend(Ai(e,i,r),{u_patternscale_a:[s/c,-u.height/2],u_patternscale_b:[s/p,-h.height/2],u_sdfgamma:o.width/(256*Math.min(c,p)*t.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:u.y,u_tex_y_b:h.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){var h=n.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance: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){var p=a.transform;return t.extend(Fi(e,i,r,n,a,o,s,l,u,h),{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){return t.extend(Vi(e,i,r,n,a,o,s,l,!0,u,!0),{u_texsize_icon:h,u_texture_icon:1})},Ni=function(t,e,i){return{u_matrix:t,u_opacity:e,u_color:i}},ji=function(e,i,r,n,a,o){return t.extend(function(t,e,i,r){var n=i.imageManager.getPattern(t.from.toString()),a=i.imageManager.getPattern(t.to.toString()),o=i.imageManager.getPixelSize(),s=o.width,l=o.height,u=Math.pow(2,r.tileID.overscaledZ),h=r.tileSize*Math.pow(2,i.transform.tileZoom)/u,c=h*(r.tileID.canonical.x+r.tileID.wrap*u),p=h*r.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:n.tl,u_pattern_br_a:n.br,u_pattern_tl_b:a.tl,u_pattern_br_b:a.br,u_texsize:[s,l],u_mix:e.t,u_pattern_size_a:n.displaySize,u_pattern_size_b:a.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/ce(r,1,i.transform.tileZoom),u_pixel_coord_upper:[c>>16,p>>16],u_pixel_coord_lower:[65535&c,65535&p]}}(n,o,r,a),{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=0;c<r.length;c++){var p=r[c],f=e.getTile(p),d=f.getBucket(i);if(d){var m=n?s?d.textCollisionCircle:d.iconCollisionCircle:s?d.textCollisionBox:d.iconCollisionBox;if(m){var y=p.posMatrix;0===a[0]&&0===a[1]||(y=t.translatePosMatrix(p.posMatrix,f,a,o)),h.draw(l,n?u.TRIANGLES:u.LINES,Tt.disabled,It.disabled,t.colorModeForRenderPass(),Pt.disabled,Ti(y,t.transform,f),i.id,m.layoutVertexBuffer,m.indexBuffer,m.segments,null,t.transform.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,m={};f.clear();for(var y=0;y<p.length;y++){var v=p.get(y),_=v.hidden||!v.crossTileID||e.allowVerticalPlacement&&!v.placedOrientation?null:n[v.crossTileID];if(_){var g=new t.Point(v.anchorX,v.anchorY),x=Qt(g,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 M=Wi(_.anchor,_.width,_.height,_.textOffset,_.textBoxScale,w),S=r?Qt(g.add(M),s).point:x.point.add(i?M.rotate(-o.angle):M),E=e.allowVerticalPlacement&&v.placedOrientation===t.WritingMode.vertical?Math.PI/2:0,k=0;k<v.numGlyphs;k++)t.addDynamicAttributes(f,S,E);c&&v.associatedIconIndex>=0&&(m[v.associatedIconIndex]={shiftedAnchor:S,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 P=m[I];if(P)for(var A=0;A<C.numGlyphs;A++)t.addDynamicAttributes(d,P.shiftedAnchor,P.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,m=e.context,y=m.gl,v=e.transform,_="map"===l,g="map"===u,x=_&&"point"!==r.layout.get("symbol-placement"),b=_&&!g&&!x,w=void 0!==r.layout.get("symbol-sort-key").constantOr(1),M=e.depthModeForSublayer(0,Tt.ReadOnly),S=r.layout.get("text-variable-anchor"),E=[],k=0,T=n;k<T.length;k+=1){var I=T[k],C=i.getTile(I),P=C.getBucket(r);if(P){var A=a?P.text:P.icon;if(A&&A.segments.get().length){var L=A.programConfigurations.get(r.id),z=a||P.sdfIcons,D=a?P.textSizeData:P.iconSizeData,R=g||0!==v.pitch;f||(f=e.useProgram(Hi(z,a,P),L),d=t.evaluateSizeForZoom(D,v.zoom));var O=void 0,B=[0,0],F=void 0,V=void 0,U=null,N=void 0;if(a)F=C.glyphAtlasTexture,V=y.LINEAR,O=C.glyphAtlasTexture.size,P.iconsInText&&(B=C.imageAtlasTexture.size,U=C.imageAtlasTexture,N=R||e.options.rotating||e.options.zooming||"composite"===D.kind||"camera"===D.kind?y.LINEAR:y.NEAREST);else{var j=1!==r.layout.get("icon-size").constantOr(0)||P.iconsNeedLinear;F=C.imageAtlasTexture,V=z||e.options.rotating||e.options.zooming||j||R?y.LINEAR:y.NEAREST,O=C.imageAtlasTexture.size}var q=ce(C,1,e.transform.zoom),G=Jt(I.posMatrix,g,_,e.transform,q),Z=Yt(I.posMatrix,g,_,e.transform,q),X=S&&P.hasTextData(),W="none"!==r.layout.get("icon-text-fit")&&X&&P.hasIconData();x&&te(P,I.posMatrix,e,a,G,Z,g,h);var K=e.translatePosMatrix(I.posMatrix,C,o,s),H=x||a&&S||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:A,uniformValues:z?P.iconsInText?Ui(D.kind,d,b,g,e,K,H,J,O,B):Vi(D.kind,d,b,g,e,K,H,J,a,O,!0):Fi(D.kind,d,b,g,e,K,H,J,a,O),atlasTexture:F,atlasTextureIcon:U,atlasInterpolation:V,atlasInterpolationIcon:N,isSDF:z,hasHalo:Y};if(w)for(var $=0,tt=A.segments.get();$<tt.length;$+=1){var et=tt[$];E.push({segments:new t.SegmentVector([et]),sortKey:et.sortKey,state:Q})}else E.push({segments:A.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(m.activeTexture.set(y.TEXTURE0),at.atlasTexture.bind(at.atlasInterpolation,y.CLAMP_TO_EDGE),at.atlasTextureIcon&&(m.activeTexture.set(y.TEXTURE1),at.atlasTextureIcon&&at.atlasTextureIcon.bind(at.atlasInterpolationIcon,y.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,M,c,p,ot)),ot.u_is_halo=0}Yi(at.buffers,nt.segments,r,e,at.program,M,c,p,at.uniformValues)}}function Yi(t,e,i,r,n,a,o,s,l){var u=r.context;n.draw(u,u.gl.TRIANGLES,a,o,s,Pt.disabled,l,i.id,t.layoutVertexBuffer,t.indexBuffer,e,i.paint,r.transform.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=i.paint.get("fill-pattern"),d=f&&f.constantOr(1),m=i.getCrossfadeParameters();o?(l=d&&!i.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",s=p.LINES):(l=d?"fillPattern":"fill",s=p.TRIANGLES);for(var y=0,v=r;y<v.length;y+=1){var _=v[y],g=e.getTile(_);if(!d||g.patternsLoaded()){var x=g.getBucket(i);if(x){var b=x.programConfigurations.get(i.id),w=t.useProgram(l,b);d&&(t.context.activeTexture.set(p.TEXTURE0),g.imageAtlasTexture.bind(p.LINEAR,p.CLAMP_TO_EDGE),b.updatePaintBuffers(m));var M=f.constantOr(null);if(M&&g.imageAtlas){var S=g.imageAtlas,E=S.patternPositions[M.to.toString()],k=S.patternPositions[M.from.toString()];E&&k&&b.setConstantPatternPositions(E,k)}var T=t.translatePosMatrix(_.posMatrix,g,i.paint.get("fill-translate"),i.paint.get("fill-translate-anchor"));if(o){h=x.indexBuffer2,c=x.segments2;var I=[p.drawingBufferWidth,p.drawingBufferHeight];u="fillOutlinePattern"===l&&d?Si(T,t,m,g,I):Mi(T,I)}else h=x.indexBuffer,c=x.segments,u=d?wi(T,t,m,g):bi(T);w.draw(t.context,s,n,t.stencilModeForClipping(_),a,Pt.disabled,u,i.id,x.layoutVertexBuffer,h,c,i.paint,t.transform.zoom,b)}}}}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=0,d=r;f<d.length;f+=1){var m=d[f],y=e.getTile(m),v=y.getBucket(i);if(v){var _=v.programConfigurations.get(i.id),g=t.useProgram(h?"fillExtrusionPattern":"fillExtrusion",_);h&&(t.context.activeTexture.set(l.TEXTURE0),y.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),_.updatePaintBuffers(c));var x=u.constantOr(null);if(x&&y.imageAtlas){var b=y.imageAtlas,w=b.patternPositions[x.to.toString()],M=b.patternPositions[x.from.toString()];w&&M&&_.setConstantPatternPositions(w,M)}var S=t.translatePosMatrix(m.posMatrix,y,i.paint.get("fill-extrusion-translate"),i.paint.get("fill-extrusion-translate-anchor")),E=i.paint.get("fill-extrusion-vertical-gradient"),k=h?xi(S,t,E,p,m,c,y):gi(S,t,E,p);g.draw(s,s.gl.TRIANGLES,n,a,o,Pt.backCCW,k,i.id,v.layoutVertexBuffer,v.indexBuffer,v.segments,i.paint,t.transform.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=r.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===r.paint.get("hillshade-illumination-anchor")&&(s-=e.transform.angle);var l,u,h,c=!e.options.moving;return{u_matrix:e.transform.calculatePosMatrix(i.tileID.toUnwrapped(),c),u_image:0,u_latrange:(l=i.tileID,u=Math.pow(2,l.canonical.z),h=l.canonical.y,[new t.MercatorCoordinate(0,h/u).toLngLat().lat,new t.MercatorCoordinate(0,(h+1)/u).toLngLat().lat]),u_light:[r.paint.get("hillshade-exaggeration"),s],u_shadow:n,u_highlight:a,u_accent:o}}(e,i,r);h.draw(s,l.TRIANGLES,n,a,o,Pt.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 m=i.fbo;if(!m){var y=new t.Texture(l,{width:c,height:c,data:null},u.RGBA);y.bind(u.LINEAR,u.CLAMP_TO_EDGE),(m=i.fbo=l.createFramebuffer(c,c,!0)).colorAttachment.set(y.texture)}l.bindFramebuffer.set(m.framebuffer),l.viewport.set([0,0,c,c]),e.useProgram("hillshadePrepare").draw(l,u.TRIANGLES,a,o,s,Pt.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,Pt.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,m=r.canonical.toString();r.overscaledZ!==r.canonical.z&&(m+=" => "+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,m+" "+p+"kb"),s.draw(n,a.TRIANGLES,l,u,Ct.alphaBlended,Pt.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();r.layout.get("text-variable-anchor")&&function(e,i,r,n,a,o,s){for(var l=i.transform,u="map"===a,h="map"===o,c=0,p=e;c<p.length;c+=1){var f=p[c],d=n.getTile(f),m=d.getBucket(r);if(m&&m.text&&m.text.segments.get().length){var y=t.evaluateSizeForZoom(m.textSizeData,l.zoom),v=ce(d,1,i.transform.zoom),_=Jt(f.posMatrix,h,u,i.transform,v),g="none"!==r.layout.get("icon-text-fit")&&m.hasIconData();if(y){var x=Math.pow(2,l.zoom-d.tileID.overscaledZ);Ki(m,u,h,s,t.symbolSize,l,_,f.posMatrix,x,y,g)}}}}(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=[],m=0;m<n.length;m++){var y=n[m],v=i.getTile(y),_=v.getBucket(r);if(_){var g=_.programConfigurations.get(r.id),x={programConfiguration:g,program:e.useProgram("circle",g),layoutVertexBuffer:_.layoutVertexBuffer,indexBuffer:_.indexBuffer,uniformValues:Ei(e,y,v,r)};if(l)for(var b=0,w=_.segments.get();b<w.length;b+=1){var M=w[b];d.push({segments:new t.SegmentVector([M]),sortKey:M.sortKey,state:x})}else d.push({segments:_.segments,sortKey:0,state:x})}}l&&d.sort(function(t,e){return t.sortKey-e.sortKey});for(var S=0,E=d;S<E.length;S+=1){var k=E[S],T=k.state;T.program.draw(u,h.TRIANGLES,c,p,f,Pt.disabled,T.uniformValues,r.id,T.layoutVertexBuffer,T.indexBuffer,k.segments,r.paint,e.transform.zoom,T.programConfiguration)}}}},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);e.useProgram("heatmap",f).draw(a,o.TRIANGLES,Tt.disabled,s,l,Pt.disabled,Pi(h.posMatrix,c,e.transform.zoom,r.paint.get("heatmap-intensity")),r.id,p.layoutVertexBuffer,p.indexBuffer,p.segments,r.paint,e.transform.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),e.useProgram("heatmapTexture").draw(r,n.TRIANGLES,Tt.disabled,It.disabled,e.colorModeForRenderPass(),Pt.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,e.transform.zoom)}}(e,r))},line:function(e,i,r,n){if("translucent"===e.renderPass){var a=r.paint.get("line-opacity"),o=r.paint.get("line-width");if(0!==a.constantOr(1)&&0!==o.constantOr(1)){var s=e.depthModeForSublayer(0,Tt.ReadOnly),l=e.colorModeForRenderPass(),u=r.paint.get("line-dasharray"),h=r.paint.get("line-pattern"),c=h.constantOr(1),p=r.paint.get("line-gradient"),f=r.getCrossfadeParameters(),d=c?"linePattern":u?"lineSDF":p?"lineGradient":"line",m=e.context,y=m.gl,v=!0;if(p){m.activeTexture.set(y.TEXTURE0);var _=r.gradientTexture;if(!r.gradient)return;_||(_=r.gradientTexture=new t.Texture(m,r.gradient,y.RGBA)),_.bind(y.LINEAR,y.CLAMP_TO_EDGE)}for(var g=0,x=n;g<x.length;g+=1){var b=x[g],w=i.getTile(b);if(!c||w.patternsLoaded()){var M=w.getBucket(r);if(M){var S=M.programConfigurations.get(r.id),E=e.context.program.get(),k=e.useProgram(d,S),T=v||k.program!==E,I=h.constantOr(null);if(I&&w.imageAtlas){var C=w.imageAtlas,P=C.patternPositions[I.to.toString()],A=C.patternPositions[I.from.toString()];P&&A&&S.setConstantPatternPositions(P,A)}var L=c?zi(e,w,r,f):u?Di(e,w,r,u,f):p?Li(e,w,r):Ai(e,w,r);c?(m.activeTexture.set(y.TEXTURE0),w.imageAtlasTexture.bind(y.LINEAR,y.CLAMP_TO_EDGE),S.updatePaintBuffers(f)):u&&(T||e.lineAtlas.dirty)&&(m.activeTexture.set(y.TEXTURE0),e.lineAtlas.bind(m)),k.draw(m,y.TRIANGLES,s,e.stencilModeForClipping(b),l,Pt.disabled,L,r.id,M.layoutVertexBuffer,M.indexBuffer,M.segments,r.paint,e.transform.zoom,S),v=!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")&&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)for(var n=t.context,a=n.gl,o=e.getSource(),s=t.useProgram("raster"),l=t.colorModeForRenderPass(),u=o instanceof I?[{},r]:t.stencilConfigForOverlap(r),h=u[0],c=u[1],p=c[c.length-1].overscaledZ,f=!t.options.moving,d=0,m=c;d<m.length;d+=1){var y=m[d],v=t.depthModeForSublayer(y.overscaledZ-p,1===i.paint.get("raster-opacity")?Tt.ReadWrite:Tt.ReadOnly,a.LESS),_=e.getTile(y),g=t.transform.calculatePosMatrix(y.toUnwrapped(),f);_.registerFadeDuration(i.paint.get("raster-fade-duration"));var x=e.findLoadedParent(y,0),b=ir(_,x,e,i,t.transform),w=void 0,M=void 0,S="nearest"===i.paint.get("raster-resampling")?a.NEAREST:a.LINEAR;n.activeTexture.set(a.TEXTURE0),_.texture.bind(S,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),n.activeTexture.set(a.TEXTURE1),x?(x.texture.bind(S,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),w=Math.pow(2,x.tileID.overscaledZ-_.tileID.overscaledZ),M=[_.tileID.canonical.x*w%1,_.tileID.canonical.y*w%1]):_.texture.bind(S,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST);var E=Bi(g,M||[0,0],w||1,b,i);o instanceof I?s.draw(n,a.TRIANGLES,v,It.disabled,l,Pt.disabled,E,i.id,o.boundsBuffer,t.quadTriangleIndexBuffer,o.boundsSegments):s.draw(n,a.TRIANGLES,v,h[y.overscaledZ],l,Pt.disabled,E,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"),m=s.coveringTiles({tileSize:l});u&&(a.activeTexture.set(o.TEXTURE0),t.imageManager.bind(t.context));for(var y=i.getCrossfadeParameters(),v=0,_=m;v<_.length;v+=1){var g=_[v],x=t.transform.calculatePosMatrix(g.toUnwrapped()),b=u?ji(x,n,t,u,{tileID:g,tileSize:l},y):Ni(x,n,r);d.draw(a,o.TRIANGLES,p,c,f,Pt.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 At(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,Ne.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,Ne.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,Ne.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,Pt.disabled,Ci(r),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},fr.prototype._renderTileClippingMasks=function(t,e){if(this.currentStencilSource!==t.source&&t.isTileClipped()&&e&&e.length){this.currentStencilSource=t.source;var i=this.context,r=i.gl;this.nextStencilID+e.length>256&&this.clearStencil(),i.setColorMode(Ct.disabled),i.setDepthMode(Tt.disabled);var n=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var a=0,o=e;a<o.length;a+=1){var s=o[a],l=this._tileClippingMaskIDs[s.key]=this.nextStencilID++;n.draw(i,r.TRIANGLES,Tt.disabled,new It({func:r.ALWAYS,mask:0},l,255,r.KEEP,r.KEEP,r.REPLACE),Ct.disabled,Pt.disabled,Ci(s.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}},fr.prototype.stencilModeFor3D=function(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&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>256&&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 m=0;m<n.length;m++)if(this.style._layers[n[m]].is3D()){this.opaquePassCutoff=m;break}this.renderPass="offscreen";for(var y=0,v=n;y<v.length;y+=1){var _=this.style._layers[v[y]];if(_.hasOffscreenPass()&&!_.isHidden(this.transform.zoom)){var g=c[_.source];("custom"===_.type||g.length)&&this.renderLayer(this,a[_.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),this.renderLayer(this,b,x,w)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<n.length;this.currentLayer++){var M=this.style._layers[n[this.currentLayer]],S=a[M.source],E=("symbol"===M.type?p:c)[M.source];this._renderTileClippingMasks(M,h[M.source]),this.renderLayer(this,S,M,E)}this.options.showTileBoundaries&&(t.values(this.style._layers).forEach(function(t){t.source&&!t.isHidden(r.transform.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.transform.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,mi[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()};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 mr=function(e,i){this.min=e,this.max=i,this.center=t.scale$2([],t.add([],this.min,this.max),.5)};mr.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 mr(r,n)},mr.prototype.distanceX=function(t){return Math.max(Math.min(this.max[0],t[0]),this.min[0])-t[0]},mr.prototype.distanceY=function(t){return Math.max(Math.min(this.max[1],t[1]),this.min[1])-t[1]},mr.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 yr=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};yr.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},yr.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)},yr.prototype.equals=function(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right},yr.prototype.clone=function(){return new yr(this.top,this.bottom,this.left,this.right)},yr.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var vr=function(e,i,r,n,a){this.tileSize=512,this.maxValidLatitude=85.051129,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.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 yr,this._posMatrixCache={},this._alignedPosMatrixCache={},this._resetZoomScale=!0},_r={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.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},_r.minZoom.get=function(){return this._minZoom},_r.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},_r.maxZoom.get=function(){return this._maxZoom},_r.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},_r.minPitch.get=function(){return this._minPitch},_r.minPitch.set=function(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))},_r.maxPitch.get=function(){return this._maxPitch},_r.maxPitch.set=function(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))},_r.renderWorldCopies.get=function(){return this._renderWorldCopies},_r.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},_r.worldSize.get=function(){return this.tileSize*this.scale},_r.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},_r.size.get=function(){return new t.Point(this.width,this.height)},_r.bearing.get=function(){return-this.angle/Math.PI*180},_r.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))},_r.pitch.get=function(){return this._pitch/Math.PI*180},_r.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())},_r.fov.get=function(){return this._fov/Math.PI*180},_r.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())},_r.zoom.get=function(){return this._zoom},_r.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())},_r.center.get=function(){return this._center},_r.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},_r.padding.get=function(){return this._edgeInsets.toJSON()},_r.padding.set=function(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())},_r.resetZoomScale.set=function(t){this._resetZoomScale=t},_r.resetZoomScale.get=function(){return this._resetZoomScale},_r.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=e.source||{},a=1;n.scaleFactors&&(a=n.scaleFactors[i]||1);var o=t.MercatorCoordinate.fromLngLat(this.center),s=Math.pow(2,i),l=[s*o.x,s*o.y,0],u=dr.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize*a,i),h=e.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(h=i);var c=function(t){return{aabb:new mr([t*s,0,0],[(t+1)*s,s,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}},p=[],f=[],d=i,m=e.reparseOverscaled?r:i;if(this._renderWorldCopies)for(var y=1;y<=3;y++)p.push(c(-y)),p.push(c(y));for(p.push(c(0));p.length>0;){var v=p.pop(),_=v.x,g=v.y,x=v.fullyVisible;if(!x){var b=v.aabb.intersects(u);if(0===b)continue;x=2===b}var w=v.aabb.distanceX(l),M=v.aabb.distanceY(l),S=Math.max(Math.abs(w),Math.abs(M));if(v.zoom===d||S>3+(1<<d-v.zoom)-2&&v.zoom>=h)f.push({tileID:new t.OverscaledTileID(v.zoom===d?m:v.zoom,v.wrap,v.zoom,_,g),distanceSq:t.sqrLen([l[0]-.5-_,l[1]-.5-g])});else for(var E=0;E<4;E++){var k=(_<<1)+E%2,T=(g<<1)+(E>>1);p.push({aabb:v.aabb.quadrant(E),zoom:v.zoom+1,x:k,y:T,wrap:v.wrap,fullyVisible:x})}}var I=f.sort(function(t,e){return t.distanceSq-e.distanceSq}).map(function(t){return t.tileID});return!e.source||"vector"!==e.source.type&&"raster"!==e.source.type||I.forEach(function(t){t.scaleFactors=e.source.scaleFactors||{},t.sourceId=e.source.id}),I},vr.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},_r.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.project=function(e){var i=t.clamp(e.lat,-this.maxValidLatitude,this.maxValidLatitude);return new t.Point(this.lngX(e.lng),this.latY(i))},vr.prototype.unproject=function(e){return new t.LngLat(this.xLng(e.x),this.yLat(e.y))},_r.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)},vr.prototype.coordinateLocation=function(t){return t.toLngLat()},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+e.sourceId,n=i?this._alignedPosMatrixCache:this._posMatrixCache;if(n[r])return n[r];var a=e.canonical,o=((e.scaleFactors||{})[a.z]||1)*this.worldSize/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]}),m=f.x,y=f.y,v=d.x,_=d.y,g=Math.min(m,v),x=Math.max(m,v),b=Math.min(_,y),w=Math.max(_,y);o=(n=x)-(r=g)<u.x?u.x/(n-r):0,a=(i=w)-(e=b)<u.y?u.y/(i-e):0;var M=this.point,S=Math.max(o||0,a||0);if(S&&this._resetZoomScale)return this.center=this.unproject(new t.Point(o?(n+r)/2:M.x,a?(i+e)/2:M.y)),this.zoom+=this.scaleZoom(S),this._unmodified=h,void(this._constraining=!1);if(this.latRange){var E=M.y,k=u.y/2;E-k<e&&(l=e+k),E+k>i&&(l=i-k)}if(this.lngRange){var T=M.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.center=this.unproject(new t.Point(void 0!==s?s:M.x,void 0!==l?l:M.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.worldSize/(2*Math.PI*6378137*Math.abs(Math.cos(this.center.lat*(Math.PI/180))));"m"===this.units&&(c=this.worldSize/(this.latRange[1]-this.latRange[0])),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),m=Math.sin(this.angle),y=o-Math.round(o)+d*p+m*f,v=s-Math.round(s)+d*f+m*p,_=new Float64Array(h);if(t.translate(_,_,[y>.5?y-1:y,v>.5?v-1:v,0]),this.alignedProjMatrix=_,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,_r);var gr=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})};gr.prototype.addTo=function(e){return this._map=e,t.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},gr.prototype.remove=function(){return t.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},gr.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},gr.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("/")},gr.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},gr.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),Mr=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)};Mr.prototype.setZoomRate=function(t){this._defaultZoomRate=t},Mr.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t},Mr.prototype.isEnabled=function(){return!!this._enabled},Mr.prototype.isActive=function(){return!!this._active},Mr.prototype.isZooming=function(){return!!this._zooming},Mr.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},Mr.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Mr.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()}},Mr.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this.isActive()||this._start(t)},Mr.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))}},Mr.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))}},Mr.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 Sr=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)};Sr.prototype.isEnabled=function(){return!!this._enabled},Sr.prototype.isActive=function(){return!!this._active},Sr.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},Sr.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Sr.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)},Sr.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"}},Sr.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}))}},Sr.prototype._onKeyDown=function(t){27===t.keyCode&&(this._finish(),this._fireEvent("boxzoomcancel",t))},Sr.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},Sr.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 Pr(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:Pr,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 Ar=function(e){this._map=e,t.bindAll(["_onDblClick","_onZoomEnd"],this)};Ar.prototype.isEnabled=function(){return!!this._enabled},Ar.prototype.isActive=function(){return!!this._active},Ar.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},Ar.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Ar.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)},Ar.prototype._resetTapped=function(){clearTimeout(this._tapped),this._tapped=null,this._tappedPoint=null},Ar.prototype.onDblClick=function(t){this.isEnabled()&&(t.originalEvent.preventDefault(),this._zoom(t))},Ar.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)},Ar.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:Mr,boxZoom:Sr,dragRotate:kr,dragPan:Ir,keyboard:Cr,doubleClickZoom:Ar,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)),m=f.sub(d),y=(s.width-(l.left+l.right+n.padding.left+n.padding.right))/m.x,v=(s.height-(l.top+l.bottom+n.padding.top+n.padding.bottom))/m.y;if(!(v<0||y<0)){var _=Math.min(s.scaleZoom(s.scale*Math.min(y,v)),n.maxZoom),g=t.Point.convert(n.offset),x=new t.Point(g.x+(n.padding.left-n.padding.right)/2,g.y+(n.padding.top-n.padding.bottom)/2).mult(s.scale/s.zoomScale(_));return{center:s.unproject(u.add(h).div(2).sub(x)),zoom:_,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),m=n.pointLocation(d),y=t.LngLat.convert(e.center||m);this._normalizeCenter(y);var v,_,g=n.project(m),x=n.project(y).sub(g),b=n.zoomScale(u-a);return e.around&&(v=t.LngLat.convert(e.around),_=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,_);else{var m=n.zoomScale(n.zoom-a),y=u>a?Math.min(2,b):Math.max(.5,b),w=Math.pow(y,1-e),M=n.unproject(g.add(x.mult(e*w)).mult(m));n.setLocationAtPoint(n.renderWorldCopies?M.wrap():M,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),m=t.Point.convert(e.offset),y=a.centerPoint.add(m),v=a.pointLocation(y);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 _=t.LngLat.convert(e.center||v);this._normalizeCenter(_);var g=a.project(v),x=a.project(_).sub(g),b=e.curve,w=Math.max(a.width,a.height),M=w/d,S=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/S*2)}var T=b*b;function I(t){var e=(M*M-w*w+(t?-1:1)*T*T*S*S)/(2*(t?M:w)*T*S);return Math.log(Math.sqrt(e*e+1)-e)}function C(t){return(Math.exp(t)-Math.exp(-t))/2}function P(t){return(Math.exp(t)+Math.exp(-t))/2}var A=I(0),L=function(t){return P(A)/P(A+b*t)},z=function(t){return w*((P(A)*(C(e=A+b*t)/P(e))-C(A))/T)/S;var e},D=(I(1)-A)/b;if(Math.abs(S)<1e-6||!isFinite(D)){if(Math.abs(w-M)<1e-6)return this.easeTo(e,i);var R=M<w?-1:1;D=Math.abs(Math.log(M/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),y=a.centerPoint.add(m));var v=1===e?_:a.unproject(g.add(x.mult(z(n))).mult(d));a.setLocationAtPoint(a.renderWorldCopies?v.wrap():v,y),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,Nr=t.window.HTMLElement,jr=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=new vr(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies);if(r.call(this,a,e),this.crs=this.initCRS(e.crs),this.setCRS(this.crs),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),this._requestManager=new t.RequestManager(e.transformRequest,e.accessToken),"string"==typeof e.container){if(this._container=t.window.document.getElementById(e.container),!this._container)throw new Error("Container '"+e.container+"' not found.")}else{if(!(e.container instanceof Nr))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 gr("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.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||jr&&i instanceof jr){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||jr&&i instanceof jr?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||jr&&i instanceof jr)),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.initCRS=function(e){if(e){if("object"==typeof e)return e;if("string"==typeof e&&!(e=t.CRS.get(e)))throw new Error("crs "+e+" is not define")}return e||t.CRS.EPSG3857},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.getZoomOffset(),a=e.getCoordsInfo(i);if(i&&Array.isArray(i)&&4===i.length){this._tileExtent=i;var o=a.width,s=a.height,l=a.originX,u=a.originY;[t.RasterTileSource,E,D].forEach(function(t){if(t===D)t.prototype.scaleFactors={};else{var n={},a=e.tileSize;if(a>-1)for(var h=0;h<26;h++){var c=e.getResolution(h,a),p=Math.max(o,s)/Math.pow(2,h)/a;n[h]=c/p}t.prototype.scaleFactors=n}t.prototype.getCrs=function(t,i){return e.epsgCode},t.prototype.getProjectionParams=function(){return{code:e.epsgCode,def:r._def,originX:l,originY:u,width:o,height:s,bounds:Array.from(i)}},t.prototype.getZoomOffset=function(){return e.getZoomOffset()}}),t.CanonicalTileID.prototype.getTileBBox=function(){var t,i=e.tileSize;return(t=i<0?Math.max(o,s)/Math.pow(2,this.z-n):e.getResolution(this.z-n,i)*i)*this.x+l+","+(u-t*(this.y+1))+","+(t*(this.x+1)+l)+","+(u-t*this.y)},t.CanonicalTileID.prototype.getViewBounds=function(){var t=Math.pow(2,this.z);return'{"leftBottom":{"x":'+(l+o*this.x/t)+',"y":'+(u-s*(this.y+1)/t)+'},"rightTop":{"x":'+(l+o*(this.x+1)/t)+',"y": '+(u-s*this.y/t)+"}}"},t.CanonicalTileID.prototype.getCRS=function(){return e},vr.prototype.project=function(e){var i=r.project([e.lng,e.lat]);return new t.Point((i[0]-l)*this.worldSize/o,(u-i[1])*this.worldSize/s)},vr.prototype.unproject=function(e){var i=r.unproject([o*e.x/this.worldSize+l,u-s*e.y/this.worldSize]);return new t.LngLat(i[0],i[1])},t.TileBounds.prototype.contains=function(t){var e=Math.pow(2,t.z),i=Math.floor((this.bounds.getWest()-l)*e/o),r=Math.floor((u-this.bounds.getNorth())*e/s),n=Math.ceil((this.bounds.getEast()-l)*e/o),a=Math.ceil((u-this.bounds.getSouth())*e/s);return t.x>=i&&t.x<n&&t.y>=r&&t.y<a},t.GeoJSONFeature.prototype.yLat=function(t,e){return r.unproject([0,u-t*s/e])[1]},t.GeoJSONFeature.prototype.latY=function(t){var e=r.project([0,t])[1];return(u-e)*this.worldSize/s},this.updateTransform&&(this.mercatorZfromAltitude=t.mercatorZfromAltitude,this.updateTransform(e.getUnit(),a,r))}},n.prototype.updateTransform=function(e,i,r){var n=i.width,a=i.height,o=i.centerX,s=i.centerY,l=i.originX,u=i.originY,h=i.latlngBounds;this.transform.units=e,this.transform.latRange=[h[1],h[3]],this.transform.lngRange=[h[0],h[2]];var c=this.mercatorZfromAltitude;t.MercatorCoordinate.fromLngLat=function(e,i){i=i||0;var o=t.LngLat.convert(e),s=r.project(o);return new t.MercatorCoordinate((s[0]-l)/n,(u-s[1])/a,c(i,o.lat))},t.MercatorCoordinate.prototype.toLngLat=function(){var e=r.unproject([l+this.x*n,u-this.y*a]),i=e[0],o=e[1];return o=Math.max(-90,Math.min(90,o)),new t.LngLat(i,o)},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,m,y,v,_,g,x,b,w,M,S,E,k=t.state;S=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,m=k.distcode,y=(1<<k.lenbits)-1,v=(1<<k.distbits)-1;t:do{f<15&&(p+=S[i++]<<f,p+=S[i++]<<(f+=8),f+=8),_=d[p&y];e:for(;;){if(p>>>=g=_>>>24,f-=g,0==(g=_>>>16&255))E[n++]=65535&_;else{if(!(16&g)){if(0==(64&g)){_=d[(65535&_)+(p&(1<<g)-1)];continue e}if(32&g){k.mode=16191;break t}t.msg="invalid literal/length code",k.mode=16209;break t}x=65535&_,(g&=15)&&(f<g&&(p+=S[i++]<<f,f+=8),x+=p&(1<<g)-1,p>>>=g,f-=g),f<15&&(p+=S[i++]<<f,p+=S[i++]<<(f+=8),f+=8),_=m[p&v];i:for(;;){if(p>>>=g=_>>>24,f-=g,!(16&(g=_>>>16&255))){if(0==(64&g)){_=m[(65535&_)+(p&(1<<g)-1)];continue i}t.msg="invalid distance code",k.mode=16209;break t}if(b=65535&_,f<(g&=15)&&(p+=S[i++]<<f,(f+=8)<g&&(p+=S[i++]<<f,f+=8)),(b+=p&(1<<g)-1)>s){t.msg="invalid distance too far back",k.mode=16209;break t}if(p>>>=g,f-=g,b>(g=n-a)){if((g=b-g)>u&&k.sane){t.msg="invalid distance too far back",k.mode=16209;break t}if(w=0,M=c,0===h){if(w+=l-g,g<x){x-=g;do{E[n++]=c[w++]}while(--g);w=n-b,M=E}}else if(h<g){if(w+=l+h-g,(g-=h)<x){x-=g;do{E[n++]=c[w++]}while(--g);if(w=0,h<x){x-=g=h;do{E[n++]=c[w++]}while(--g);w=n-b,M=E}}}else if(w+=h-g,g<x){x-=g;do{E[n++]=c[w++]}while(--g);w=n-b,M=E}for(;x>2;)E[n++]=M[w++],E[n++]=M[w++],E[n++]=M[w++],x-=3;x&&(E[n++]=M[w++],x>1&&(E[n++]=M[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,m,y,v=s.bits,_=0,g=0,x=0,b=0,w=0,M=0,S=0,E=0,k=0,T=0,I=null,C=new Uint16Array(16),P=new Uint16Array(16),A=null;for(_=0;_<=15;_++)C[_]=0;for(g=0;g<r;g++)C[e[i+g]]++;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,_=1;_<=15;_++)if(E<<=1,(E-=C[_])<0)return-1;if(E>0&&(0===t||1!==b))return-1;for(P[1]=0,_=1;_<15;_++)P[_+1]=P[_]+C[_];for(g=0;g<r;g++)0!==e[i+g]&&(o[P[e[i+g]]++]=g);if(0===t?(I=A=o,f=20):1===t?(I=Qr,A=$r,f=257):(I=tn,A=en,f=0),T=0,g=0,_=x,p=a,M=w,S=0,h=-1,c=(k=1<<w)-1,1===t&&k>852||2===t&&k>592)return 1;for(;;){d=_-S,o[g]+1<f?(m=0,y=o[g]):o[g]>=f?(m=A[o[g]-f],y=I[o[g]-f]):(m=96,y=0),l=1<<_-S,x=u=1<<M;do{n[p+(T>>S)+(u-=l)]=d<<24|m<<16|y|0}while(0!==u);for(l=1<<_-1;T&l;)l>>=1;if(0!==l?(T&=l-1,T+=l):T=0,g++,0==--C[_]){if(_===b)break;_=e[i+o[g]]}if(_>w&&(T&c)!==h){for(0===S&&(S=w),p+=x,E=1<<(M=_-S);M+S<b&&!((E-=C[M+S])<=0);)M++,E<<=1;if(k+=1<<M,1===t&&k>852||2===t&&k>592)return 1;n[h=T&c]=w<<24|M<<16|p-a|0}}return 0!==T&&(n[p+T]=_-S<<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,mn=nn.Z_DEFLATED,yn=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},_n=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)},gn=!0,xn=function(t){if(gn){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}),gn=!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=_n,Mn=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,_n(t))}(t,e);return r!==ln&&(t.state=null),r},Sn=function(t,e){var i,r,n,a,o,s,l,u,h,c,p,f,d,m,y,v,_,g,x,b,w,M,S,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,M=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)!==mn){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)!==mn){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=yn(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,M=rn(0,i.lens,0,19,i.lencode,0,i.work,S={bits:i.lenbits}),i.lenbits=S.bits,M){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,_=65535&k,!((y=k>>>24)<=h);){if(0===s)break t;s--,u+=r[a++]<<h,h+=8}if(_<16)u>>>=y,h-=y,i.lens[i.have++]=_;else{if(16===_){for(E=y+2;h<E;){if(0===s)break t;s--,u+=r[a++]<<h,h+=8}if(u>>>=y,h-=y,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===_){for(E=y+3;h<E;){if(0===s)break t;s--,u+=r[a++]<<h,h+=8}h-=y,w=0,f=3+(7&(u>>>=y)),u>>>=3,h-=3}else{for(E=y+7;h<E;){if(0===s)break t;s--,u+=r[a++]<<h,h+=8}h-=y,w=0,f=11+(127&(u>>>=y)),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,M=rn(1,i.lens,0,i.nlen,i.lencode,0,i.work,S={bits:i.lenbits}),i.lenbits=S.bits,M){t.msg="invalid literal/lengths set",i.mode=16209;break}if(i.distbits=6,i.distcode=i.distdyn,M=rn(2,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,S={bits:i.distbits}),i.distbits=S.bits,M){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,_=65535&k,!((y=k>>>24)<=h);){if(0===s)break t;s--,u+=r[a++]<<h,h+=8}if(v&&0==(240&v)){for(g=y,x=v,b=_;v=(k=i.lencode[b+((u&(1<<g+x)-1)>>g)])>>>16&255,_=65535&k,!(g+(y=k>>>24)<=h);){if(0===s)break t;s--,u+=r[a++]<<h,h+=8}u>>>=g,h-=g,i.back+=g}if(u>>>=y,h-=y,i.back+=y,i.length=_,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,_=65535&k,!((y=k>>>24)<=h);){if(0===s)break t;s--,u+=r[a++]<<h,h+=8}if(0==(240&v)){for(g=y,x=v,b=_;v=(k=i.distcode[b+((u&(1<<g+x)-1)>>g)])>>>16&255,_=65535&k,!(g+(y=k>>>24)<=h);){if(0===s)break t;s--,u+=r[a++]<<h,h+=8}u>>>=g,h-=g,i.back+=g}if(u>>>=y,h-=y,i.back+=y,64&v){t.msg="invalid distance code",i.mode=16209;break}i.offset=_,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),m=i.window}else m=n,d=o-i.offset,f=i.length;f>l&&(f=l),l-=f,i.length-=f;do{n[o++]=m[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:yn(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:M=un;break t;case 16209:M=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)&&M===ln&&(M=dn),M},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),Pn=0;Pn<256;Pn++)Cn[Pn]=Pn>=252?6:Pn>=248?5:Pn>=240?4:Pn>=224?3:Pn>=192?2:1;Cn[254]=Cn[254]=1;var An=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,Nn=nn.Z_NEED_DICT,jn=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=Mn(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=Sn(a,r))===Nn&&s&&((i=kn(a,s))===Vn?i=Sn(a,r):i===qn&&(i=Nn));a.avail_in>0&&i===Un&&a.state.wrap>0&&0!==t[a.next_in];)wn(a),i=Sn(a,r);switch(i){case jn:case qn:case Nn: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=An(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 m=i.createNS("http://www.w3.org/2000/svg","path");m.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(m);var y=i.createNS("http://www.w3.org/2000/svg","g");y.setAttributeNS(null,"opacity","0.25"),y.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"),y.appendChild(v);var _=i.createNS("http://www.w3.org/2000/svg","g");_.setAttributeNS(null,"transform","translate(6.0, 7.0)"),_.setAttributeNS(null,"fill","#FFFFFF");var g=i.createNS("http://www.w3.org/2000/svg","g");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"),g.appendChild(x),g.appendChild(b),l.appendChild(u),l.appendChild(d),l.appendChild(y),l.appendChild(_),l.appendChild(g),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"},ma=function(e){this.options=t.extend({},da,e),t.bindAll(["_onMove","setUnit"],this)};function ya(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+"&nbsp;"+r}ma.prototype.getDefaultPosition=function(){return"bottom-left"},ma.prototype._onMove=function(){ya(this._map,this._container,this.options)},ma.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},ma.prototype.onRemove=function(){i.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},ma.prototype.setUnit=function(t){this.options.unit=t,ya(this._map,this._container,this.options)};var _a=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)};_a.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},_a.prototype.onMoveStart=function(){this.frames=0,this.time=performance.now(),this.map.on("render",this.onRender)},_a.prototype.onMoveEnd=function(){var t=performance.now();this.updateGraph(this.getFPS(t)),this.frames=0,this.time=null,this.map.off("render",this.onRender)},_a.prototype.onRender=function(){this.frames++;var t=performance.now();t>=this.time+1e3&&(this.updateGraph(this.getFPS(t)),this.frames=0,this.time=t)},_a.prototype.getFPS=function(t){return this.totalTime+=t-this.time,this.totalFrames+=this.frames,Math.round(1e3*this.frames/(t-this.time))||0},_a.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)},_a.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 ga=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")};ga.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},ga.prototype.onRemove=function(){i.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},ga.prototype._checkFullscreenSupport=function(){return!!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},ga.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)},ga.prototype._updateTitle=function(){var t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t},ga.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},ga.prototype._isFullscreen=function(){return this._fullscreen},ga.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())},ga.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="&#215;",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:ma,FullscreenControl:ga,FpsControl:_a,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){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=m(i(18)),n=m(i(7)),a=m(i(4)),o=m(i(0)),s=m(i(2)),l=m(i(5)),u=m(i(32)),h=m(i(6)),c=i(1),p=m(i(31)),f=i(169),d=i(172);function m(t){return t&&t.__esModule?t:{default:t}}var y=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,h.default)(e,t),(0,s.default)(e,[{key:"onAdd",value:function(t){return this._addInnerLayer()}},{key:"_processData",value:function(){return new n.default(function(t){})}},{key:"onRemove",value:function(t){return(0,u.default)(e.prototype.__proto__||(0,a.default)(e.prototype),"onRemove",this).call(this,t),this._removeLayers(),this._removeSources(),n.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()}}),n.default.resolve(this)}},{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 a=this;return new n.default(function(n){var o=void 0,s=function(){!function(){var n=!1;r instanceof c.ClusterRenderer&&(n=!0),e.addSource(t.id,{type:"geojson",data:a._convertSourceData(i),cluster:n}),a.sourceIDs=[],a.layerIDs=[],a.sourceIDs.push(t.id),a.renderType=r.type,a._updateState(r)}(),n(a),o&&clearInterval(o)};e.loaded()?s():(e.once("load",s),o=setInterval(function(){e.loaded()&&s()},16))})}},{key:"_rendererChangeAction",value:function(t){this._updateState()}},{key:"loadImage",value:function(t,e,i,r){return new n.default(function(n,a){t.loadImage(e,function(e,o){if(e)throw a(),e;r=r||"image-"+(0,c.getGUID)();var s={width:1,height:1};i&&(i.width&&(s.width=i.width/o.width),i.height&&(s.height=i.height/o.height)),t.addImage(r,o),n({imageId:r,sizeScale:s})})})}},{key:"_updateState",value:async function(t){var e=this.innerView,i=this.layer;if(e){t||(t=i.renderer);var n=i._opacity,a=this._getLayerViewVisible(),o=e.style,s={},l={},u=void 0;if(this.layerIDs.length>0){var h=!1;t.type!==this.renderType&&(h=!0);var p=t.symbol||t.defaultSymbol;if(t.type===this.renderType&&p&&p.type===c.SymbolType.pictureMarker&&(h=!0,p.type===c.SymbolType.pictureMarker)){var f="image-"+(0,c.getGUID)();u=await this.loadImage(e,p.url,{width:p.width,height:p.height},f)}h&&(this._removeLayers(),this._addLayers(),this.renderType=t.type,h=!1)}else this._addLayers();switch(t.type){case c.RendererType.cluster:var m=(0,d.getClusterCirclePaint)(t,{opacity:n});(0,r.default)(m).forEach(function(t){o.setPaintProperty(i.id+"_cluster",t,m[t])});var y=(0,d.getSymbolLayout)(t);(0,r.default)(y).forEach(function(t){o.setLayoutProperty(i.id+"_cluster_count",t,y[t])});var v=(0,d.getSymbolPaint)(t,{opacity:n});if((0,r.default)(v).forEach(function(t){o.setPaintProperty(i.id+"_cluster_count",t,v[t])}),t.defaultSymbol){var _=(0,d.getUnClusterCirclePaint)(t,{opacity:n});(0,r.default)(_).forEach(function(t){o.setPaintProperty(i.id+"_unclustered_point",t,_[t])})}break;case c.RendererType.random:var g=(0,d.getUniqueRendererFromRandomRenderer)(t,this.featureSet);this._setColorRenderer(g,a,n,s,l,o,i);break;case c.RendererType.rank:var x=this.featureSet.features;c.RendererUtil.updateRenderer(x,t);var b=void 0,w=t.symbol;if(w)switch(w.type){case c.SymbolType.simpleMarker:default:b=(0,d.getRankCircleStyle)(this.featureSet.features,t);break;case c.SymbolType.text:b=(0,d.getRankTextStyle)(this.featureSet.features,t)}b&&b.paint&&(0,r.default)(b.paint).forEach(function(t){o.setPaintProperty(""+i.id,t,b.paint[t])}),b&&b.layout&&(0,r.default)(b.layout).forEach(function(t){o.setLayoutProperty(""+i.id,t,b.layout[t])});break;default:this._setColorRenderer(t,a,n,s,l,o,i,u)}e._update(!0)}}},{key:"_setColorRenderer",value:function(t,e,i,n,a,o,s,l){var u=this._getMapboxglStyleLayerRenderType();(0,f.updateStyleLayer)(t,u,e,i,n,a,l),(0,r.default)(n).forEach(function(t){o.setPaintProperty(s.id,t,n[t])}),(0,r.default)(a).forEach(function(t){o.setLayoutProperty(s.id,t,a[t])})}},{key:"_convertSourceData",value:function(t){var e=t.features,i={type:"FeatureCollection",features:[]};return i.features=e.map(function(t){return p.default.convertToGeoJSON(t)}),i}},{key:"_getMapboxglStyleLayerRenderType",value:function(){var t=this.layer,e=t.renderer||{},i=e.symbol||e.defaultSymbol,r="circle";switch(t.geometryType){case c.GeometryType.polygon:case c.GeometryType.multiPolygon:case"Reg":r=e instanceof c.RandomRenderer?"fill":i.type===c.SymbolType.text||i.type===c.SymbolType.pictureMarker?"symbol":i.type===c.SymbolType.simpleMarker?"circle":"fill";break;case"Lin":case c.GeometryType.multiLineString:case c.GeometryType.lineString:r="line";break;case"Pnt":case c.GeometryType.point:case c.GeometryType.multiPoint:r=e instanceof c.RandomRenderer?"circle":i.type===c.SymbolType.text||i.type===c.SymbolType.pictureMarker?"symbol":"circle"}return r}},{key:"_addLayers",value:function(){var t=this.innerView,e=this.layer,i=e.renderer||{};switch(i.type){case c.RendererType.cluster:var r=(0,d.getClusterCirclePaint)(i);t.addLayer({id:e.id+"_cluster",type:"circle",source:e.id,filter:["has","point_count"],paint:r}),this.layerIDs.push(e.id+"_cluster");var n=(0,d.getSymbolLayout)(i),a=(0,d.getSymbolPaint)(i);t.addLayer({id:e.id+"_cluster_count",type:"symbol",source:e.id,filter:["has","point_count"],layout:n,paint:a}),this.layerIDs.push(e.id+"_cluster_count"),i.defaultSymbol&&(t.addLayer({id:e.id+"_unclustered_point",type:"circle",source:e.id,filter:["!",["has","point_count"]],paint:(0,d.getUnClusterCirclePaint)(i)}),this.layerIDs.push(e.id+"_unclustered_point"));break;default:var o=this._getMapboxglStyleLayerRenderType();t.addLayer({id:e.id,source:e.id,type:o}),this.layerIDs.push(e.id)}}},{key:"_removeLayers",value:function(){for(var t=0;t<this.layerIDs.length;t++)this.innerView.removeLayer(this.layerIDs[t]);this.layerIDs=[]}},{key:"_removeSources",value:function(){for(var t=0;t<this.sourceIDs.length;t++)this.innerView.removeSource(this.sourceIDs[t]);this.sourceIDs=[]}}]),e}(c.BaseRendererLayerView);e.default=y},function(t,e,i){t.exports=!i(11)&&!i(20)(function(){return 7!=Object.defineProperty(i(37)("div"),"a",{get:function(){return 7}}).a})},function(t,e,i){var r=i(13),n=i(12),a=i(21);t.exports=i(11)?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(17),n=i(15),a=i(87)(!1),o=i(42)("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(25);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,e,i){t.exports={default:i(89),__esModule:!0}},function(t,e){},function(t,e,i){"use strict";var r=i(26),n=i(10),a=i(64),o=i(16),s=i(22),l=i(92),u=i(35),h=i(66),c=i(9)("iterator"),p=!([].keys&&"next"in[].keys()),f=function(){return this};t.exports=function(t,e,i,d,m,y,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",M="values"==m,S=!1,E=t.prototype,k=E[c]||E["@@iterator"]||m&&E[m],T=k||b(m),I=m?M?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)),M&&k&&"values"!==k.name&&(S=!0,T=function(){return k.call(this)}),r&&!v||!p&&!S&&E[c]||o(E,c,T),s[e]=T,s[w]=f,m)if(_={values:M?T:b("values"),keys:y?T:b("keys"),entries:I},v)for(g in _)g in E||a(E,g,_[g]);else n(n.P+n.F*(p||S),e,_);return _}},function(t,e,i){t.exports=i(16)},function(t,e,i){var r=i(8).document;t.exports=r&&r.documentElement},function(t,e,i){var r=i(17),n=i(23),a=i(42)("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(12);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(22),n=i(9)("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(12),n=i(33),a=i(9)("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(19),s=i(99),l=i(65),u=i(37),h=i(8),c=h.process,p=h.setImmediate,f=h.clearImmediate,d=h.MessageChannel,m=h.Dispatch,y=0,v={},_=function(){var t=+this;if(v.hasOwnProperty(t)){var e=v[t];delete v[t],e()}},g=function(t){_.call(t.data)};p&&f||(p=function(t){for(var e=[],i=1;arguments.length>i;)e.push(arguments[i++]);return v[++y]=function(){s("function"==typeof t?t:Function(t),e)},r(y),y},f=function(t){delete v[t]},"process"==i(25)(c)?r=function(t){c.nextTick(o(_,t,1))}:m&&m.now?r=function(t){m.now(o(_,t,1))}:d?(a=(n=new d).port2,n.port1.onmessage=g,r=o(a.postMessage,a,1)):h.addEventListener&&"function"==typeof postMessage&&!h.importScripts?(r=function(t){h.postMessage(t+"","*")},h.addEventListener("message",g,!1)):r="onreadystatechange"in u("script")?function(t){l.appendChild(u("script")).onreadystatechange=function(){l.removeChild(this),_.call(t)}}:function(t){setTimeout(o(_,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(12),n=i(14),a=i(48);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(9)("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(59),n=i(44).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,n)}},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),a=i(30);var o=function t(){(0,r.default)(this,t)};o.addWMSLayer=function(t,e){var i=t.layer,r=t.innerView,n={service:"WMS",version:i.version,request:"GetMap",layers:i.layers,styles:i.styles,width:i.imageWidth,height:i.imageHeight,format:i.imageFormat,transparent:i.imageTransparency,crs:"EPSG:"+i.spatialReference.wkid,tokenKey:i.tokenKey,tokenValue:i.tokenValue},s="source_"+i.id,l="layer_"+i.id,u=o.initLayerUrl(i.url,n),h=(0,a.getRasterSource)(u,i.imageWidth),c=(0,a.getRasterLayer)(l,s,i,t);r.addSource(s,h),r.addLayer(c);var p=r.getLayer(l);return p.sourceID=s,p},o.initAllRequestParams=function(t){t=(0,n.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},o.initLayerUrl=function(t,e){var i=t+"?";return i+=encodeURI(o.initAllRequestParams(e).join("&")),i+="&bbox={bbox}"},o.setVisible=function(t){(0,a.setVisible)(t)},o.setOpacity=function(t){(0,a.setOpacity)(t)},o.refresh=function(t){t.innerView.removeLayer(t.innerLayer.id),t.innerView.removeSource(t.innerLayer.sourceID),t.innerLayer=o.addWMSLayer(t,{})},o.removeLayer=function(t){(0,a.removeLayer)(t)},e.default=o},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(158));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=i.graphics.items||[],o=this;return o.innerLayer=new h.default({id:i.id,opacity:i._opacity,visible:this._getLayerViewVisible()}),o.innerLayer.onAdd(n).then(function(){return o.innerLayer.commonLayerId=i.id,o._addFeature(o.innerLayer,a),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=h(i(7)),n=h(i(4)),a=h(i(0)),o=h(i(2)),s=h(i(5)),l=h(i(32)),u=h(i(6));function h(t){return t&&t.__esModule?t:{default:t}}var c=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(){var t=this.layer,e=t._createQueryOption();return e.resultRecordCount=1e5,t.queryFeatures(e).then(function(t){return t})}},{key:"onAdd",value:function(t){if("server"!==this.layer.renderMode)return(0,l.default)(e.prototype.__proto__||(0,n.default)(e.prototype),"onAdd",this).call(this,t)}},{key:"onRemove",value:function(t){return this.layer.gdbp?(this.innerView.removeLayer(this.innerLayer),r.default.resolve(this)):(0,l.default)(e.prototype.__proto__||(0,n.default)(e.prototype),"onRemove",this).call(this,t)}}]),e}(h(i(56)).default);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(56)).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(56)).default);e.default=u},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.mapboxCustomCRS=void 0;var r=u(i(32)),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=function(t){function i(t,r){(0,a.default)(this,i);var o=(0,s.default)(this,(i.__proto__||(0,n.default)(i)).call(this)),l=(r||{}).def;if(!l)throw new Error("自定义参考系必须指定参数系信息def");if(o._def=l,!e)throw new Error("proj4对象不存在,自定义投影必须引入proj4对象");var u=o._isProj4Obj(t);return o._proj=u?t:o._projFromCodeDef(t,l),o}return(0,l.default)(i,t),(0,o.default)(i,[{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,i){if(i)e.defs(t,i);else if(void 0===e.defs[t]){var r=t.split(":");if(r.length>3&&(t=r[r.length-3]+":"+r[r.length-1]),void 0===e.defs[t])throw"No projection definition for code "+t}return e(t)}},{key:"_isProj4Obj",value:function(t){return void 0!==t.inverse&&void 0!==t.forward}}]),i}(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}else this._resolutions={};if(!this._resolutions[0])throw new Error("自定义坐标系时,未设置分辨率数组");if(!this.origin)throw new Error("自定义坐标系时,未设置原点");this.tileSize=t.tileSize||-1}},{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}),e.mapboxCustomCRS=e.SketchEditorMapboxgl=e.MapViewMapboxgl=void 0;var r=i(82),n=i(186),a=i(80);i(1).Zondy.PluginVersion="17.0.0",e.MapViewMapboxgl=r.MapViewMapboxgl,e.SketchEditorMapboxgl=n.SketchEditorMapboxgl,e.mapboxCustomCRS=a.mapboxCustomCRS},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MapViewMapboxgl=void 0;var r=function(t){return t&&t.__esModule?t:{default:t}}(i(83));e.MapViewMapboxgl=r.default},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=S(i(84)),n=S(i(61)),a=S(i(7)),o=S(i(106)),s=S(i(18)),l=S(i(4)),u=S(i(0)),h=S(i(2)),c=S(i(5)),p=S(i(6)),f=i(1),d=S(i(55)),m=i(135),y=S(i(183)),v=S(i(184)),_=S(i(185)),g=i(80),x=S(i(76)),b=S(i(78)),w=S(i(77)),M=S(i(79));function S(t){return t&&t.__esModule?t:{default:t}}var E=function(t){function e(t){(0,u.default)(this,e);var i=(0,c.default)(this,(e.__proto__||(0,l.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,i.extendOptions=(0,f.defaultValue)(t.extendOptions,{}),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,h.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);var n=this._getMaxBounds();!this._zoom&&this._scale&&this._initScale(this._scale);var l=void 0;this._center||this._zoom||this._extent&&(l=[[this._extent.xmin,this._extent.ymin],[this._extent.xmax,this._extent.ymax]]);var u={crs:this.crs,maxBounds:n,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:l,preserveDrawingBuffer:!0};return(0,s.default)(this.extendOptions).forEach(function(t){"crs"!==t&&"container"!==t&&(u[t]=(0,o.default)(u[t],i.extendOptions[t]))}),this._innerView=new d.default.Map(u),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(),new a.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((0,g.mapboxCustomCRS)(d.default,f.proj4),t.spatialReference&&t.resolutions&&t.origin&&t.extent){var e=void 0;t.spatialReference.wkid?e=f.Projection.getEPSGByWKID(t.spatialReference.wkid).strProject:t.spatialReference.wkt&&(e=t.spatialReference.wkt);var i=[t.extent.xmin,t.extent.ymin,t.extent.xmax,t.extent.ymax],r="EPSG:"+t.spatialReference.wkid,n=e,a=new d.default.Proj.CRS(r,n,{resolutions:t.resolutions,origin:t.origin,tileSize:t.tileSize,bounds:i,lods:t.lod});return a.options=t,a}}},{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,y.default.getMouseEvent(t,e))},300),e.fire(f.ViewEventType.immediateClick,y.default.getMouseEvent(t,e))}),this._innerView.on("contextmenu",function(t){e._clickStore=setTimeout(function(){e._clickStore&&e.fire(f.ViewEventType.click,y.default.getMouseEvent(t,e))},300),e.fire(f.ViewEventType.immediateClick,y.default.getMouseEvent(t,e))}),this._innerView.on("dblclick",function(i){e._clickStore&&(clearTimeout(t._clickStore),e._clickStore=null),e.fire(f.ViewEventType.doubleClick,y.default.getMouseEvent(i,e))}),this._innerView.on("mousedown",function(i){e.fire(f.ViewEventType.pointerDown,y.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,y.default.getMouseEvent(i,e)),e._dragParams.isDrag&&"update"===t._dragParams.action&&(t._dragParams.action="end",e.fire(f.ViewEventType.drag,y.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,y.default.getMouseEvent(i,e)),e._dragParams.isDrag?(e.fire(f.ViewEventType.drag,y.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.origin={x:i.originalEvent.layerX,y:i.originalEvent.layerY},t._dragParams.action="start",e.fire(f.ViewEventType.drag,y.default.getDragEvent(i,e,t._dragParams.origin,t._dragParams.action))}),this._innerView.on("drag",function(i){t._dragParams.action="update",e.fire(f.ViewEventType.drag,y.default.getDragEvent(i,e,t._dragParams.origin,t._dragParams.action))}),this._innerView.on("dragend",function(i){t._dragParams.action="end",e.fire(f.ViewEventType.drag,y.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.origin={x:i.originalEvent.layerX,y:i.originalEvent.layerY},t._dragParams.action="start",e.fire(f.ViewEventType.drag,y.default.getDragEvent(i,e,t._dragParams.origin,t._dragParams.action))}),this._innerView.on("rotate",function(i){t._dragParams.action="update",e.fire(f.ViewEventType.drag,y.default.getDragEvent(i,e,t._dragParams.origin,t._dragParams.action))}),this._innerView.on("rotateend",function(i){t._dragParams.action="end",e.fire(f.ViewEventType.drag,y.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,y.default.getViewChangeEvent(t,e))}),this._innerView.on("moveend",function(t){e._moveEndHandler(),e.fire(f.ViewEventType.viewChange,y.default.getViewChangeEvent(t,e)),e.stationary=!0}),this._innerView.on("resize",function(){var t=Number(e.width),i=Number(e.height);e._initSize(),e.fire(f.ViewEventType.resize,{oldWidth:t,oldHeight:i,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,y.default.getKeyEvent(e,t))}),e.addEventListener("keyup",function(e){t.fire(f.ViewEventType.keyUp,y.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:"_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){return(0,m.getLayerView)(this,t)}},{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.layer.id.split("_")[0],a=r.properties.id,o=e.getLayer(n);o||(o=e._graphicsLayers.find(function(t){return t.id===n}));var s=null;if(o.type===f.LayerType.igsFeature||o.type===f.LayerType.geojson){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.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.layerIDs))}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 _.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);this._innerView&&(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))}},{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,n=void 0,s=new a.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}),n=!(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};if((0,f.isNull)(i)||((0,f.isNull)(i.animate)||(h.animate=i.animate),(0,f.isNull)(i.duration)||(h.duration=i.duration)),r){var c=r.coordinates[1],p=r.coordinates[0];if(this._fullExtent&&((c>this._fullExtent.ymax||c<this._fullExtent.ymin)&&(c=(this._fullExtent.ymax+this._fullExtent.ymin)/2),(p>this._fullExtent.xmax||p<this._fullExtent.xmin)&&(p=(this._fullExtent.xmax+this._fullExtent.xmin)/2)),isFinite(c)&&isFinite(p)){var d=!1,m=this._innerView.getCenter();if(n===this._zoom&&c===m.lat&&p===m.lng&&(d=!0),!d){var y={center:[r.coordinates[0],r.coordinates[1]],zoom:n};(0,o.default)(y,h),s=new a.default(function(e){t._innerView.flyTo(y),t._innerView.once("moveend",function(){e()})})}}}else if(l){var v=l.xmin,_=l.xmax,g=l.ymin,x=l.ymax;this._fullExtent&&(v<this._fullExtent.xmin&&(v=this._fullExtent.xmin),_>this._fullExtent.xmax&&(_=this._fullExtent.xmax),g<this._fullExtent.ymin&&(g=this._fullExtent.ymin),x>this._fullExtent.ymax&&(x=this._fullExtent.ymax)),isFinite(v)&&isFinite(_)&&isFinite(g)&&isFinite(x)&&this._innerView.fitBounds([[l.xmin,l.ymin],[l.xmax,l.ymax]],h)}}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(){return this._fullExtent?[[this._fullExtent.xmin,this._fullExtent.ymin],[this._fullExtent.xmax,this._fullExtent.ymax]]:[]}},{key:"_isEqualCrs",value:function(t,e){var i=!0;if(t&&e){var r=void 0;r=t.epsgCode.split(":").length>1?{wkid:t.epsgCode.split(":")[1]}:{wkid:this.crs.epsgCode};var a=void 0;if(void 0===(a=e.epsgCode.split(":").length>1?{wkid:e.epsgCode.split(":")[1]}:{wkid:e.epsgCode}).wkid||void 0===r.wkid?f.TileInfoUtil.isSameSpatialReference(a.wkt,r.wkt):f.TileInfoUtil.isSameSpatialReference(a.wkid,r.wkid)){if("4326"!==a.wkid&&"3857"!==a.wkid||e.options||(i=!0),e.options){var o=e.options;a.resolutions=o.resolutions,a.origin=o.origin,a.bounds=o.bounds,r.resolutions=this.crs.options.resolutions,r.origin=this.crs.options.origin,r.bounds=this.crs.options.bounds,(0,n.default)(a.resolutions)===(0,n.default)(r.resolutions)&&(0,n.default)(a.origin)===(0,n.default)(r.origin)&&this._isEqualBounds(r.bounds,a.bounds)||(i=!1)}}else i=!1}else(!t&&e||t&&!e)&&(i=!1);return i}},{key:"_moveLayerView",value:function(t,e){var i=void 0;if(t instanceof x.default){i=[];var r=t.innerLayer._sourceMetaDatas;(0,s.default)(r).forEach(function(t){i.push(r[t].layerId)})}else i=t instanceof b.default||t instanceof w.default||t instanceof M.default?t.id:t.innerLayer.id;var n=void 0;if(e instanceof x.default){var a=e.innerLayer._getBottomLayer();n=a.layerId}else n=e instanceof b.default||e instanceof w.default||e instanceof M.default?e.id:e.innerLayer.id;t instanceof x.default?i.forEach(function(e){t.innerView.moveLayer(e,n)}):t.innerView.moveLayer(i,n)}},{key:"toJSON",value:function(){return{extent:(0,f.toJSON)(this._extent,f.Extent),center:(0,f.toJSON)(this._center,f.Point),map:(0,f.toJSON)(this._map,f.Map),viewId:this._viewId,width:this.width,height:this.height,zoom:this.zoom,scale:this.scale,maxScale:this.maxScale,minScale:this.minScale,spatialReferenceLocked:this.spatialReferenceLocked}}}]),e}(f.MapView);(0,r.default)(f.MapView.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){}}}),E.fromJSON=function(t){return t=(0,f.defaultValue)(t,{}),new E(t)},f.Zondy.MapViewMapboxgl=E,e.default=E},function(t,e,i){t.exports={default:i(85),__esModule:!0}},function(t,e,i){i(86);var r=i(3).Object;t.exports=function(t,e){return r.defineProperties(t,e)}},function(t,e,i){var r=i(10);r(r.S+r.F*!i(11),"Object",{defineProperties:i(58)})},function(t,e,i){var r=i(15),n=i(40),a=i(88);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(41),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){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){i(62),i(27),i(36),i(96),i(104),i(105),t.exports=i(3).Promise},function(t,e,i){var r=i(41),n=i(39);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(45),n=i(24),a=i(35),o={};i(16)(o,i(9)("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(94),n=i(95),a=i(22),o=i(15);t.exports=i(63)(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(26),l=i(8),u=i(19),h=i(46),c=i(10),p=i(14),f=i(33),d=i(97),m=i(98),y=i(69),v=i(70).set,_=i(100)(),g=i(48),x=i(71),b=i(101),w=i(72),M=l.TypeError,S=l.process,E=S&&S.versions,k=E&&E.v8||"",T=l.Promise,I="process"==h(S),C=function(){},P=n=g.f,A=!!function(){try{var t=T.resolve(1),e=(t.constructor={})[i(9)("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;_(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(M("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?S.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?S.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 M("Promise can't be resolved itself");(e=L(t))?_(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)}}};A||(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(102)(T.prototype,{then:function(t,e){var i=P(y(this,T));return i.ok="function"!=typeof t||t,i.fail="function"==typeof e&&e,i.domain=I?S.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)},g.f=P=function(t){return t===T||t===o?new a(t):n(t)}),c(c.G+c.W+c.F*!A,{Promise:T}),i(35)(T,"Promise"),i(103)("Promise"),o=i(3).Promise,c(c.S+c.F*!A,"Promise",{reject:function(t){var e=P(this);return(0,e.reject)(t),e.promise}}),c(c.S+c.F*(s||!A),"Promise",{resolve:function(t){return w(s&&this===o?T:this,t)}}),c(c.S+c.F*!(A&&i(73)(function(t){T.all(t).catch(C)})),"Promise",{all:function(t){var e=this,i=P(e),r=i.resolve,n=i.reject,a=x(function(){var i=[],a=0,o=1;m(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=P(e),r=i.reject,n=x(function(){m(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(19),n=i(67),a=i(68),o=i(12),s=i(40),l=i(47),u={},h={};(e=t.exports=function(t,e,i,c,p){var f,d,m,y,v=p?function(){return t}:l(t),_=r(i,c,e?2:1),g=0;if("function"!=typeof v)throw TypeError(t+" is not iterable!");if(a(v)){for(f=s(t.length);f>g;g++)if((y=e?_(o(d=t[g])[0],d[1]):_(t[g]))===u||y===h)return y}else for(m=v.call(t);!(d=m.next()).done;)if((y=n(m,_,d.value,e))===u||y===h)return y}).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(8),n=i(70).set,a=r.MutationObserver||r.WebKitMutationObserver,o=r.process,s=r.Promise,l="process"==i(25)(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(8).navigator;t.exports=r&&r.userAgent||""},function(t,e,i){var r=i(16);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(8),n=i(3),a=i(13),o=i(11),s=i(9)("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(10),n=i(3),a=i(8),o=i(69),s=i(72);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(10),n=i(48),a=i(71);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){t.exports={default:i(107),__esModule:!0}},function(t,e,i){i(108),t.exports=i(3).Object.assign},function(t,e,i){var r=i(10);r(r.S+r.F,"Object",{assign:i(109)})},function(t,e,i){"use strict";var r=i(11),n=i(21),a=i(49),o=i(28),s=i(23),l=i(60),u=Object.assign;t.exports=!u||i(20)(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++]),m=c?n(d).concat(c(d)):n(d),y=m.length,v=0;y>v;)f=m[v++],r&&!p.call(d,f)||(i[f]=d[f]);return i}:u},function(t,e,i){i(111),t.exports=i(3).Object.keys},function(t,e,i){var r=i(23),n=i(21);i(50)("keys",function(){return function(t){return n(r(t))}})},function(t,e,i){i(113),t.exports=i(3).Object.getPrototypeOf},function(t,e,i){var r=i(23),n=i(66);i(50)("getPrototypeOf",function(){return function(t){return n(r(t))}})},function(t,e,i){t.exports={default:i(115),__esModule:!0}},function(t,e,i){i(116);var r=i(3).Object;t.exports=function(t,e,i){return r.defineProperty(t,e,i)}},function(t,e,i){var r=i(10);r(r.S+r.F*!i(11),"Object",{defineProperty:i(13).f})},function(t,e,i){t.exports={default:i(118),__esModule:!0}},function(t,e,i){i(27),i(36),t.exports=i(52).f("iterator")},function(t,e,i){t.exports={default:i(120),__esModule:!0}},function(t,e,i){i(121),i(62),i(126),i(127),t.exports=i(3).Symbol},function(t,e,i){"use strict";var r=i(8),n=i(17),a=i(11),o=i(10),s=i(64),l=i(122).KEY,u=i(20),h=i(43),c=i(35),p=i(34),f=i(9),d=i(52),m=i(53),y=i(123),v=i(124),_=i(12),g=i(14),x=i(23),b=i(15),w=i(38),M=i(24),S=i(45),E=i(125),k=i(54),T=i(49),I=i(13),C=i(21),P=k.f,A=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"),N=h("op-symbols"),j=Object.prototype,q="function"==typeof z&&!!T.f,G=r.QObject,Z=!G||!G.prototype||!G.prototype.findChild,X=a&&u(function(){return 7!=S(A({},"a",{get:function(){return A(this,"a",{value:7}).a}})).a})?function(t,e,i){var r=P(j,e);r&&delete j[e],A(t,e,i),r&&t!==j&&A(j,e,r)}:A,W=function(t){var e=U[t]=S(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===j&&H(N,e,i),_(t),e=w(e,!0),_(i),n(U,e)?(i.enumerable?(n(t,O)&&t[O][e]&&(t[O][e]=!1),i=S(i,{enumerable:M(0,!1)})):(n(t,O)||A(t,O,M(1,{})),t[O][e]=!0),X(t,e,i)):A(t,e,i)},J=function(t,e){_(t);for(var i,r=y(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===j&&n(U,t)&&!n(N,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!==j||!n(U,e)||n(N,e)){var i=P(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===j,r=L(i?N:b(t)),a=[],o=0;r.length>o;)!n(U,e=r[o++])||i&&!n(j,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===j&&e.call(N,i),n(this,O)&&n(this[O],t)&&(this[O][t]=!1),X(this,t,M(1,i))};return a&&Z&&X(j,t,{configurable:!0,set:e}),W(t)}).prototype,"toString",function(){return this._k}),k.f=Q,I.f=H,i(74).f=E.f=$,i(28).f=Y,T.f=tt,a&&!i(26)&&s(j,"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;)m(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?S(t):J(S(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],(g(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(16)(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(34)("meta"),n=i(14),a=i(17),o=i(13).f,s=0,l=Object.isExtensible||function(){return!0},u=!i(20)(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(21),n=i(49),a=i(28);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(25);t.exports=Array.isArray||function(t){return"Array"==r(t)}},function(t,e,i){var r=i(15),n=i(74).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(53)("asyncIterator")},function(t,e,i){i(53)("observable")},function(t,e,i){t.exports={default:i(129),__esModule:!0}},function(t,e,i){i(130),t.exports=i(3).Object.setPrototypeOf},function(t,e,i){var r=i(10);r(r.S,"Object",{setPrototypeOf:i(131).set})},function(t,e,i){var r=i(14),n=i(12),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(19)(Function.call,i(54).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(133),__esModule:!0}},function(t,e,i){i(134);var r=i(3).Object;t.exports=function(t,e){return r.create(t,e)}},function(t,e,i){var r=i(10);r(r.S,"Object",{create:i(45)})},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getLayerView=void 0;var r=i(1),n=_(i(136)),a=_(i(155)),o=_(i(156)),s=_(i(157)),l=_(i(76)),u=_(i(164)),h=_(i(165)),c=_(i(77)),p=_(i(78)),f=_(i(79)),d=_(i(173)),m=_(i(174)),y=_(i(175)),v=_(i(179));function _(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 m.default({view:t,layer:e});break;case r.LayerType.echarts:i=new y.default({view:t,layer:e});break;case r.LayerType.mapv:i=new v.default({view:t,layer:e})}return i}},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(29);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.IGSMapImageUtil.addIGSMapImageLayer(this),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)}}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=s(i(61)),n=s(i(0)),a=i(1),o=i(30);function s(t){return t&&t.__esModule?t:{default:t}}var l=function t(){(0,n.default)(this,t)};l.addIGSMapImageLayer=function(t){var e=t.layer,i=t.innerView,r={layers:e.layers,f:e.imageFormat,width:e.imageWidth,height:e.imageHeight,clientId:e.clientId,igsVersion:e._igsVersion,tokenKey:e.tokenKey,tokenValue:e.tokenValue,isAntialiasing:e.isAntialiasing,filters:e.getFilters(),format:"png",projectionSrs:(0,a.getProjectionSrs)(e.spatialReference)},n=(0,a.getIGSDynamicLayer)(e);n.length>0&&(r.dynamicLayers=n);var s=e.getFilters();s&&(r.filters=s);var u="source_"+e.id,h="layer_"+e.id,c=l.initLayerUrl(e.url,r),p=(0,o.getRasterSource)(c,e.imageWidth,e.renderMode),f=(0,o.getRasterLayer)(h,u,e,t);i.addSource(u,p),i.addLayer(f);var d=i.getLayer(h);return d.sourceID=u,d},l.initAllRequestParams=function(t){var e=[];return(t=(0,a.defaultValue)(t,{})).hasOwnProperty("layers")&&e.push("layers="+t.layers),t.hasOwnProperty("imageTransparent")&&e.push("imageTransparent="+t.imageTransparent),t.hasOwnProperty("isAntialiasing")&&null!==t.isAntialiasing&&void 0!==t.isAntialiasing&&e.push("isAntialiasing="+t.isAntialiasing),t.hasOwnProperty("tokenKey")&&t.hasOwnProperty("tokenValue")&&t.tokenValue&&e.push(t.tokenKey+"="+t.tokenValue),"2.0"===t.igsVersion?(e.push("size="+t.width+","+t.height),e.push("format="+t.format),e.push("f=image"),t.hasOwnProperty("styles")&&e.push("layerStyles="+t.styles),t.hasOwnProperty("filters")&&t.filters&&e.push("layerFilters="+t.filters),t.hasOwnProperty("dynamicLayers")&&e.push("dynamicLayers="+(0,r.default)(t.dynamicLayers)),t.hasOwnProperty("projectionSrs")&&e.push("projectionSrs="+t.projectionSrs),t.hasOwnProperty("clientId")&&e.push("clientId="+t.clientId)):(e.push("w="+t.width),e.push("h="+t.height),e.push("f=png"),t.hasOwnProperty("styles")&&e.push("style="+t.styles),t.hasOwnProperty("filters")&&e.push("filters="+t.filters),t.hasOwnProperty("clientId")&&e.push("guid="+t.clientId)),e},l.initLayerUrl=function(t,e){var i=t+"/image?";return i+=encodeURI(l.initAllRequestParams(e).join("&")),i+="&bbox={bbox}"},l.setVisible=function(t){(0,o.setVisible)(t)},l.setOpacity=function(t){(0,o.setOpacity)(t)},l.refresh=function(t){t.innerView.removeLayer(t.innerLayer.id),t.innerView.removeSource(t.innerLayer.sourceID),t.innerLayer=l.addIGSMapImageLayer(t,{})},l.removeLayer=function(t){(0,o.removeLayer)(t)},e.default=l},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=a(i(139)),n=a(i(146));function a(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){return"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("&").forEach(function(e){e.includes("size=")&&(t=t.replace(e,"size="+l+","+u)),e.includes("bbox=")&&(t=t.replace(e,"bbox="+o))}),t},type:"image-map"}:{type:"raster",tiles:[t],tileSize:e}},e.getRasterLayer=function(t,e,i,r){return{id:t,type:"raster",source:e,paint:{"raster-opacity":i.opacity},layout:{visibility:r._getLayerViewVisible(i.visible)?"visible":"none"}}}},function(t,e,i){"use strict";e.__esModule=!0;var r=a(i(140)),n=a(i(143));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){t.exports={default:i(141),__esModule:!0}},function(t,e,i){i(36),i(27),t.exports=i(142)},function(t,e,i){var r=i(46),n=i(9)("iterator"),a=i(22);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(144),__esModule:!0}},function(t,e,i){i(36),i(27),t.exports=i(145)},function(t,e,i){var r=i(12),n=i(47);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(147));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(148),__esModule:!0}},function(t,e,i){i(27),i(149),t.exports=i(3).Array.from},function(t,e,i){"use strict";var r=i(19),n=i(10),a=i(23),o=i(67),s=i(68),l=i(40),u=i(150),h=i(47);n(n.S+n.F*!i(73)(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,m=d>1?arguments[1]:void 0,y=void 0!==m,v=0,_=h(p);if(y&&(m=r(m,d>2?arguments[2]:void 0,2)),void 0==_||f==Array&&s(_))for(i=new f(e=l(p.length));e>v;v++)u(i,v,y?m(p[v],v):p[v]);else for(c=_.call(p),i=new f;!(n=c.next()).done;v++)u(i,v,y?o(c,m,[n.value,v],!0):n.value);return i.length=v,i}})},function(t,e,i){"use strict";var r=i(13),n=i(24);t.exports=function(t,e,i){e in t?r.f(t,e,n(0,i)):t[e]=i}},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(30);var a=function t(){(0,r.default)(this,t)};a.addIGSTileLayer=function(t){var e=t.layer,i=t.innerView,r={igsVersion:e._igsVersion,tokenKey:e.tokenKey,tokenValue:e.tokenValue},o="source_"+e.id,s="layer_"+e.id,l=a.initLayerUrl(e.url,r),u=(0,n.getRasterSource)(l,e.tileSize),h=(0,n.getRasterLayer)(s,o,e,t);i.addSource(o,u),i.addLayer(h);var c=i.getLayer(s);return c.sourceID=o,c},a.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},a.setVisible=function(t){(0,n.setVisible)(t)},a.setOpacity=function(t){(0,n.setOpacity)(t)},a.refresh=function(t){t.innerView.removeLayer(t.innerLayer.id),t.innerView.removeSource(t.innerLayer.sourceID),t.innerLayer=a.addIGSTileLayer(t,{})},a.removeLayer=function(t){(0,n.removeLayer)(t)},e.default=a},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),a=i(30);var o=function t(){(0,r.default)(this,t)};o.addWMTSLayer=function(t,e){var i=t.layer,r=i.activeLayer,n=t.innerView,s={service:"WMTS",version:i.version,request:"GetTile",layer:r.identifier,style:r.styleId,format:r.imageFormat,tileMatrixSet:r.tileMatrixSetId,tileMatrix:"{z}",tileRow:"{y}",tileCol:"{x}",tokenKey:i.tokenKey,tokenValue:i.tokenValue};s.version||(s.version="1.0.0");var l=i.getCurrentTileInfo().size[0],u="source_"+i.id,h="layer_"+i.id,c=o.initLayerUrl(i.url,s),p=(0,a.getRasterSource)(c,l),f=(0,a.getRasterLayer)(h,u,i,t);n.addSource(u,p),n.addLayer(f);var d=n.getLayer(h);return d.sourceID=u,d},o.initAllRequestParams=function(t){t=(0,n.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},o.initLayerUrl=function(t,e){var i=t+"?";return i+=o.initAllRequestParams(e).join("&")},o.setVisible=function(t){(0,a.setVisible)(t)},o.setOpacity=function(t){(0,a.setOpacity)(t)},o.refresh=function(t){t.innerView.removeLayer(t.innerLayer.id),t.innerView.removeSource(t.innerLayer.sourceID),t.innerLayer=o.addWMTSLayer(t,{})},o.removeLayer=function(t){(0,a.removeLayer)(t)},e.default=o},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=o(i(18)),n=o(i(0)),a=i(1);function o(t){return t&&t.__esModule?t:{default:t}}var s=function t(){(0,n.default)(this,t)};s.addIGSVectorTileLayer=function(t,e){var i=this;e=(0,a.defaultValue)(e,{});var r=t.layer,n=t.innerView,o=n.getStyle(),s=!1;o.glyphs!==r.style.glyphs&&(o.glyphs=r.style.glyphs,s=!0),o.sprite!==r.style.sprite&&(o.sprite=r.style.sprite,s=!0),s?(n.setStyle(o),n.on("style.load",function(){i._addSources(t),i._addLayers(t),e.callback&&e.callback instanceof Function&&e.callback(i._getInnerLayers(t))})):(this._addSources(t),this._addLayers(t),e.callback&&e.callback instanceof Function&&e.callback(this._getInnerLayers(t)))},s.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},s.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")})},s.setOpacity=function(t,e){var i=t.layer,n=t.innerView;i.style.layers.forEach(function(t){var a=i._getBackupProperties(t.id,"opacities");a&&(0,r.default)(a).forEach(function(i){n.setPaintProperty(t.id,i,a[i]*e)})})},s.removeLayer=function(t){for(var e=t.layer.style.layers,i=t.layer.style.sources,n=t.innerView,a=0;a<e.length;a++)n.getLayer(e[a].id)&&n.removeLayer(e[a].id);(0,r.default)(i).forEach(function(t){n.getSource(t)&&n.removeSource(t)})},s.setPaintProperties=function(t,e,i){var n=t.innerView;n.getLayer(e)&&i instanceof Object&&(0,r.default)(i).forEach(function(t){n.setPaintProperty(e,t,i[t])})},s.setLayoutProperties=function(t,e,i){var n=t.innerView;n.getLayer(e)&&i instanceof Object&&(0,r.default)(i).forEach(function(t){n.setLayoutProperty(e,t,i[t])})},s.updateStyleLayer=function(t){var e=t.innerView,i=t.layer,n=e.style;i.style.layers.forEach(function(t){if(n.getLayer(t.id)){if(t.paint)(0,r.default)(t.paint).forEach(function(e){n.setPaintProperty(t.id,e,t.paint[e])});if(t.layout)(0,r.default)(t.layout).forEach(function(e){n.setLayoutProperty(t.id,e,t.layout[e])})}}),e._update&&e._update(!0)},s._addSources=function(t){var e=t.layer.style.sources;(0,r.default)(e).forEach(function(i){t.innerView.addSource(i,e[i])})},s._addLayers=function(t){for(var e=t.layer,i=t.layer.style.layers,r=0;r<i.length;r++){var n=t._getLayerViewVisible(e.visible);if(i[r]&&i[r].layout&&i[r].layout instanceof Object&&(i[r].layout.visibility=n?"visible":"none"),i[r]&&i[r].paint&&i[r].paint instanceof Object){var a=[];switch(i[r].type){case"background":a.push("background-opacity");break;case"fill":default:a.push("fill-opacity");break;case"line":a.push("line-opacity");break;case"symbol":a.push("icon-opacity"),a.push("text-opacity");break;case"circle":a.push("circle-opacity");break;case"sky":a.push("sky-opacity")}for(var o=0;o<a.length;o++)i[r].paint[a[o]]=t.layer.opacity}t.innerView.addLayer(i[r])}},s._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=s},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=o(i(18)),n=o(i(0)),a=i(30);function o(t){return t&&t.__esModule?t:{default:t}}var s=function t(){(0,n.default)(this,t)};s.addWebTileLayer=function(t,e){var i=t.layer,r=t.innerView,n={};n[i.tokenKey]=i.tokenValue;var o=s.initLayerUrl(i.url,n),l="source_"+i.id,u="layer_"+i.id,h=(0,a.getRasterSource)(o,i.tileSize),c=(0,a.getRasterLayer)(u,l,i,t);r.addSource(l,h),r.addLayer(c);var p=r.getLayer(u);return p.sourceID=l,p},s.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},s.setVisible=function(t){(0,a.setVisible)(t)},s.setOpacity=function(t){(0,a.setOpacity)(t)},s.refresh=function(t){t.innerView.removeLayer(t.innerLayer.id),t.innerView.removeSource(t.innerLayer.sourceID),t.innerLayer=s.addWebTileLayer(t,{})},s.removeLayer=function(t){(0,a.removeLayer)(t)},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(29);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.IGSTileLayerUtil.addIGSTileLayer(this),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)}}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=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(75));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,e=this._getLayerViewVisible();return this.innerLayer=h.default.addWMSLayer(this,{visible:e}),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)}}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=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(29);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.WMTSLayerUtil.addWMTSLayer(this,{}),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)}}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=c(i(18)),n=c(i(159)),a=c(i(7)),o=c(i(0)),s=c(i(2)),l=i(1),u=c(i(31)),h=c(i(163));function c(t){return t&&t.__esModule?t:{default:t}}var p=function(){function t(e){var i=this;(0,o.default)(this,t),e=(0,l.defaultValue)(e,{}),this.id=e.id||(0,l.getGUID)(),this._opacity=e.opacity||1,this._visible=e.visible||!0,this.renderTypes=["fill","line","circle","text","icon"],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,i._sourceMetaDatas[t]=new h.default(e)})}return(0,s.default)(t,[{key:"onAdd",value:function(t){var e=this;if(t){this._map=t;var i=this;return new a.default(function(r){var n=void 0,a=function(){i.renderTypes.forEach(function(e){var r=i._sourceMetaDatas[e];t.addSource(r.sourceId,{type:"geojson",data:{type:"FeatureCollection",features:[]}}),"text"!==e&&"icon"!==e||(e="symbol"),t.addLayer({id:r.layerId,source:r.sourceId,type:e})}),r(e),n&&clearInterval(n)};t.loaded()?a():(t.once("load",a),n=setInterval(function(){t.loaded()&&a()},16))})}}},{key:"onRemove",value:function(t){var e=this;t&&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;Array.isArray(t)?t.forEach(function(t){e._updateGraphicToCollection(t)}):this._updateGraphicToCollection(t),this._refreshSourceAndLayers()}},{key:"_removeGraphicsToCollection",value:function(t){for(var e=(0,n.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(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 l.Feature){if(t.geometry){switch(t.geometry.type){case l.GeometryType.multiPoint:case l.GeometryType.point:e=this._dividePointGraphic(t);break;case l.GeometryType.multiLineString:case l.GeometryType.lineString:e=this._dividePolylineGraphic(t);break;case l.GeometryType.extent:case l.GeometryType.circle:case l.GeometryType.multiPolygon:case l.GeometryType.polygon:e=this._dividePolygonGraphic(t)}return e}l.Log.error("几何不存在")}}},{key:"remove",value:function(t){t&&(Array.isArray(t)?this._removeGraphicsToCollection(t):this._removeGraphicsToCollection([t]),this._refreshSourceAndLayers())}},{key:"removeAll",value:function(){for(var t=(0,n.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,r.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),r.setStyleLayerDirty(!1)),r.getSourceDirty()){var n=r.sourceId,a=r.featureCollection;i.getSource(n).setData({type:"FeatureCollection",features:a.map(function(t){return u.default.convertToGeoJSON(t)})}),r.setSourceDirty(!1)}}),i._update(!0),!0}},{key:"_setSourceMetaDataStyle",value:function(t){var e={},i={},r={};switch(t.renderType){case"circle":this._setCircleStyle(t,i,r);break;case"line":this._setLineStyle(t,i,r);break;case"fill":this._setFillStyle(t,i,r);break;case"text":this._setTextStyle(t,i,r);break;case"icon":this._setIconStyle(t,i,r)}return e.paint=i,e.layout=r,e}},{key:"_setCircleStyle",value:function(t,e,i){if(this._map){var r=this._map.style,n=t.layerId,a=t.featureCollection,o=this._opacity,s=this._visible,h={"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}};a.forEach(function(t){var e=t.id,i=t.symbol;i instanceof l.SimpleMarkerSymbol||(l.Log.info("不支持类型为"+i.type+"的符号!"),i=new l.SimpleMarkerSymbol);var r=u.default.applyVisibleAndOpacityToColor(i.color,s,o);h["circle-color"].values.push(e,r.toCssRGBString()),h["circle-opacity"].values.push(e,r.alpha);var n=u.default.applyVisibleAndOpacityToColor(i.outline.color,s,o);h["circle-stroke-color"].values.push(e,n.toCssRGBString()),h["circle-stroke-opacity"].values.push(e,n.alpha),h["circle-stroke-width"].values.push(e,i.outline.width),h["circle-radius"].values.push(e,i.size/2)}),this._setLayoutAndPaintCaches(n,h,{},e,i,r)}}},{key:"_setLineStyle",value:function(t,e,i){if(this._map){var r=this._map.style,n=t.layerId,a=t.featureCollection,o=this._opacity,s=this._visible,h={"line-color":{values:[],def:"#000000"},"line-width":{values:[],def:1},"line-opacity":{values:[],def:1}},c={"line-join":{values:[],def:"round"}};a.forEach(function(t){var e=t.id,i=t.symbol;i instanceof l.SimpleLineSymbol||(l.Log.info("不支持类型为"+i.type+"的符号!"),i=new l.SimpleLineSymbol);var r=u.default.applyVisibleAndOpacityToColor(i.color,s,o);h["line-color"].values.push(e,r.toCssRGBString()),h["line-opacity"].values.push(e,r.alpha),h["line-width"].values.push(e,i.width),c["line-join"].values.push(e,i.join)}),this._setLayoutAndPaintCaches(n,h,c,e,i,r)}}},{key:"_setFillStyle",value:function(t,e,i){if(this._map){var r=this._map.style,n=t.layerId,a=t.featureCollection,o=this._opacity,s=this._visible,h={"fill-color":{values:[],def:"#ffffff"},"fill-opacity":{values:[],def:.25},"fill-outline-color":{values:[],def:"#000000"}};a.forEach(function(t){var e=t.id,i=t.symbol;i instanceof l.SimpleFillSymbol||(l.Log.info("不支持类型为"+i.type+"的符号!"),i=new l.SimpleFillSymbol);var r=u.default.applyVisibleAndOpacityToColor(i.color,s,o),n=u.default.applyVisibleAndOpacityToColor(i.outline.color,s,o);h["fill-color"].values.push(e,r.toCssRGBString()),h["fill-opacity"].values.push(e,r.alpha),h["fill-outline-color"].values.push(e,n.toCssRGBAString())}),this._setLayoutAndPaintCaches(n,h,{},e,i,r)}}},{key:"_setTextStyle",value:function(t,e,i){if(this._map){var r=this._map.style,n=t.layerId,a=t.featureCollection,o=this._opacity,s=this._visible,h={"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}};a.forEach(function(t){var e=t.id,i=t.symbol;i instanceof l.TextSymbol||(l.Log.info("不支持类型为"+i.type+"的符号!"),i=new l.TextSymbol);var r=u.default.applyVisibleAndOpacityToColor(i.color,s,o),n=u.default.applyVisibleAndOpacityToColor(i.haloColor,s,o);h["text-color"].values.push(e,r.toCssRGBString()),h["text-opacity"].values.push(e,r.alpha),h["text-halo-color"].values.push(e,n.toCssRGBAString()),h["text-halo-width"].values.push(e,i.haloSize),c["text-field"].values.push(e,i.text),c["text-allow-overlap"]=!1,c["text-font"]=["Open Sans Regular","Arial Unicode MS Regular"],c["text-size"].values.push(e,i.font.size),c["text-justify"].values.push(e,i.horizontalAlignment),c["text-letter-spacing"].values.push(e,i.kerning?.1:0),c["text-rotate"].values.push(e,i.rotated&&0!==i.angle?i.angle:0)}),this._setLayoutAndPaintCaches(n,h,c,e,i,r,["text-allow-overlap","text-font"])}}},{key:"_setIconStyle",value:function(t,e,i){var r=this;if(this._map){var n=this._map.style,o=t.layerId,s=t.featureCollection,h=this._opacity,c=this._visible,p={"icon-color":{values:[],def:"#000000"},"icon-opacity":{values:[],def:1}},f={"icon-size":{values:[],def:20},"icon-rotate":{values:[],def:0},"icon-image":{values:[],def:"marker-15"}},d=[];s.forEach(function(t){var e=t.id,i=t.symbol;i instanceof l.PictureMarkerSymbol||(l.Log.info("不支持类型为"+i.type+"的符号!"),i=new l.PictureMarkerSymbol);var n=u.default.applyVisibleAndOpacityToColor(i.color,c,h);p["icon-color"].values.push(e,n.toCssRGBString()),p["icon-opacity"].values.push(e,n.alpha),f["icon-allow-overlap"]=!0,f["icon-rotate"].values.push(e,i.angle);var a="image-"+(0,l.getGUID)();d.push(r.loadImage(i.url,{width:i.width,height:i.height},a,e)),f["icon-image"].values.push(e,a)}),a.default.all(d).then(function(t){t.forEach(function(t){f["icon-size"].values.push(t.featureId,Math.min(t.sizeScale.width,t.sizeScale.height))}),r._setLayoutAndPaintCaches(o,p,f,e,i,n,["icon-allow-overlap"])})}}},{key:"loadImage",value:function(t,e,i,r){var n=this;return new a.default(function(a,o){n._map.loadImage(t,function(t,s){if(t)throw o(),t;i=i||"image-"+(0,l.getGUID)();var u={width:1,height:1};e&&(e.width&&(u.width=e.width/s.width),e.height&&(u.height=e.height/s.height)),n._map.addImage(i,s),a({imageId:i,sizeScale:u,featureId:r})})})}},{key:"_setLayoutAndPaintCaches",value:function(t,e,i,r,n,a,o){o||(o=[]);var s=function(i){if(o.findIndex(function(t){return t===i})>-1)r[i]=e[i],a.setPaintProperty(t,i,e[i]);else if(e[i].values.length>0){var n=[];n.push("match"),n.push(["get","id"]),(n=n.concat(e[i].values)).push(e[i].def),r[i]=n,a.setPaintProperty(t,i,n)}else r[i]=e[i].def,a.setPaintProperty(t,i,e[i].def)};for(var l in e)s(l);var u=function(e){if(o.findIndex(function(t){return t===e})>-1)n[e]=i[e],a.setLayoutProperty(t,e,i[e]);else if(i[e].values.length>0){var r=[];r.push("match"),r.push(["get","id"]),(r=r.concat(i[e].values)).push(i[e].def),n[e]=r,a.setLayoutProperty(t,e,r)}else n[e]=i[e].def,a.setLayoutProperty(t,e,i[e].def)};for(var l in i)u(l)}},{key:"_dividePointGraphic",value:function(t){var e=t.symbol,i=!1,r=this._sourceMetaDatas.circle;switch(e.type){case l.SymbolType.simpleMarker:i=this._replaceSourceLayer(t,"circle"),r=this._sourceMetaDatas.circle;break;case l.SymbolType.text:i=this._replaceSourceLayer(t,"text"),r=this._sourceMetaDatas.text;break;case l.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;switch(i.type){case l.SymbolType.simpleMarker:e=this._replaceSourceLayer(t,"circle"),r=this._sourceMetaDatas.circle;break;case l.SymbolType.text:e=this._replaceSourceLayer(t,"text"),r=this._sourceMetaDatas.text;break;case l.SymbolType.pictureMarker:e=this._replaceSourceLayer(t,"icon"),r=this._sourceMetaDatas.icon;break;case l.SymbolType.pictureFill:case l.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,n.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=p},function(t,e,i){t.exports={default:i(160),__esModule:!0}},function(t,e,i){i(161),t.exports=i(3).Object.values},function(t,e,i){var r=i(10),n=i(162)(!1);r(r.S,"Object",{values:function(t){return n(t)}})},function(t,e,i){var r=i(11),n=i(21),a=i(15),o=i(28).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=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._sourceDirty=!1,this._styleLayerDirty=!1}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=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=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(29);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;return this._layerViewVisible=this._getLayerViewVisible(this.layer.visble),h.VectorTileLayerUtil.addIGSVectorTileLayer(this,{callback:function(e){for(var i=0;i<e.length;i++)e[i].commonLayerId=t.layer.id}}),r.default.resolve(this)}},{key:"onRemove",value:function(){return h.VectorTileLayerUtil.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],n=i.params;if(i)switch(i.name){case"setPaintProperties":h.VectorTileLayerUtil.setPaintProperties(this,n[0],n[1]);break;case"setLayoutProperties":h.VectorTileLayerUtil.setLayoutProperties(this,n[0],n[1]);break;case"setStyleLayer":case"deleteStyleLayer":h.VectorTileLayerUtil.updateStyleLayer(this);break;case"opacity":h.VectorTileLayerUtil.setOpacity(this,n[0]);break;case"visible":var a=this._getLayerViewVisible(n[0]);this._layerViewVisible!==a&&(h.VectorTileLayerUtil.setVisible(this,a),this._layerViewVisible=a)}}return r.default.resolve(this)}}]),e}(u.LayerView);e.default=p},function(t,e,i){t.exports={default:i(167),__esModule:!0}},function(t,e,i){i(168);var r=i(3).Object;t.exports=function(t,e){return r.getOwnPropertyDescriptor(t,e)}},function(t,e,i){var r=i(15),n=i(54).f;i(50)("getOwnPropertyDescriptor",function(){return function(t,e){return n(r(t),e)}})},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.convertSymbol=e.updateStyleLayer=void 0;var r=l(i(18)),n=i(1),a=l(i(31)),o=l(i(170)),s=l(i(171));function l(t){return t&&t.__esModule?t:{default:t}}function u(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 h(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={},a={index:0,key:null,isNum:e};r.forEach(function(t){a.index+=1;var r="calc_"+a.index;a.key=r,n[r]=e?["to-number",["get",t.split(".")[1]]]:["get",t.split(".")[1]],i=i.replace(t,""+r)});var o=i.match(/>=|<=|==|\+|-|\*|\/|>|<|=/);o&&o.length>0&&o.forEach(function(t){i=i.replace(t," "+t+" ")});var s=i.split(" ").filter(function(t){return""!==t});if(u(n,s,["*","/","%"],a),u(n,s,["+","-"],a),u(n,s,["<","<=",">",">="],a),u(n,s,["=="],a),a.key)return n[a.key]}catch(t){}}(e,i);return r||["get","undefined"]}function c(t,e,i,r,o,s,l){switch(e){case"line":t instanceof n.SimpleLineSymbol||(t=new n.SimpleLineSymbol),function(t,e,i,r,n,o){var s=a.default.applyVisibleAndOpacityToColor(r.color,n,o);e["line-color"]=s.toCssRGBString(),e["line-opacity"]=r.opacity,e["line-width"]=r.width,i["line-cap"]=r.cap,i["line-miter-limit"]=r.miterLimit,i["line-join"]=r.join;var l=a.default.convertLineStyle(r.style,"butt"===r.cap);l&&(e["line-dasharray"]=l)}(0,i,r,t,o,s);break;case"fill":t instanceof n.SimpleFillSymbol||(t=new n.SimpleFillSymbol),function(t,e,i,r,n,o){switch(t){case"fill":var s=a.default.applyVisibleAndOpacityToColor(r.color,n,o),l=a.default.applyVisibleAndOpacityToColor(r.outline.color,n,o);e["fill-color"]=s.toCssRGBString(),e["fill-opacity"]=s.alpha,e["fill-outline-color"]=l.toCssRGBAString()}}(e,i,0,t,o,s);break;case"circle":t instanceof n.SimpleMarkerSymbol||(t=new n.SimpleMarkerSymbol),function(t,e,i,r,n,o){switch(t){case"circle":var s=r.xoffset,l=r.yoffset;e["circle-translate"]=[parseFloat(s),parseFloat(l)];var u=a.default.applyVisibleAndOpacityToColor(r.color,n,o);e["circle-opacity"]=u.alpha,e["circle-color"]=u.toCssRGBString();var h=a.default.applyVisibleAndOpacityToColor(r.outline.color,n,o);e["circle-stroke-color"]=h.toCssRGBString(),e["circle-stroke-opacity"]=h.alpha,e["circle-stroke-width"]=r.outline.width,e["circle-radius"]=r.size/2}}(e,i,0,t,o,s);break;case"symbol":t.type===n.SymbolType.text?function(t,e,i,r,o,s){var l=a.default.applyVisibleAndOpacityToColor(r.color,o,s),u=a.default.applyVisibleAndOpacityToColor(r.haloColor,o,s);switch(e["text-color"]=l.toCssRGBString(),e["text-opacity"]=l.alpha,e["text-halo-color"]=u.toCssRGBAString(),e["text-halo-width"]=r.haloSize,i["text-field"]=r.text||"",i["text-allow-overlap"]=!1,i["text-font"]=["Open Sans Regular","Arial Unicode MS Regular"],i["text-size"]=r.font.size,i["text-justify"]=r.horizontalAlignment,i["text-letter-spacing"]=r.kerning?.1:0,i["text-rotate"]=r.rotated&&0!==r.angle?r.angle:0,i["text-offset"]=[r.xoffset,r.yoffset],i["text-line-height"]=r.lineHeight?1.2:0,i["text-max-width"]=(0,n.defaultValue)(r.lineWidth,192),i["text-anchor"]="center",r.verticalAlignment){case"top":switch(r.horizontalAlignment){case"left":i["text-anchor"]="top-left";break;case"right":i["text-anchor"]="top-right";break;default:i["text-anchor"]="top"}break;case"bottom":switch(r.horizontalAlignment){case"left":i["text-anchor"]="bottom-left";break;case"right":i["text-anchor"]="bottom-right";break;default:i["text-anchor"]="bottom"}break;default:switch(r.horizontalAlignment){case"left":i["text-anchor"]="left";break;case"right":i["text-anchor"]="right";break;default:i["text-anchor"]="center"}}}(0,i,r,t,o,s):t.type===n.SymbolType.pictureMarker&&function(t,e,i,r,n,o,s){var l=a.default.applyVisibleAndOpacityToColor(r.color,n,o);e["icon-color"]=l.toCssRGBString(),e["icon-opacity"]=l.alpha,i["icon-allow-overlap"]=!0,i["icon-size"]=s&&s.sizeScale?s.sizeScale:1,i["icon-rotate"]=r.angle,i["icon-image"]=s&&s.imageId?s.imageId:"",i["icon-offset"]=[r.xoffset,r.yoffset]}(0,i,r,t,o,s,l)}}e.updateStyleLayer=function(t,e,i,a,l,u,p){switch(t.type){case n.RendererType.simple:!function(t,e,i,r,n,a,o){c(t.symbol,e,i,r,n,a,o)}(t,e,l,u,i,a,p);break;case n.RendererType.uniqueValue:!function(t,e,i,n,a,s){c(t.defaultSymbol,e,i,n,a,s);var l=h(t.field,t.valueExpression),u={},p={};(0,r.default)(i).forEach(function(t){u[t]=new o.default(l,i[t])}),(0,r.default)(n).forEach(function(t){p[t]=new o.default(l,n[t])}),(t.uniqueValueInfos||[]).forEach(function(t){var a={},h={};c(t.symbol,e,a,h,t.visible,s);var f=t.value;(0,r.default)(i).forEach(function(t){u[t]||(u[t]=new o.default(l,a[t])),u[t].addStep(f,a[t])}),(0,r.default)(n).forEach(function(t){p[t]||(p[t]=new o.default(l,h[t])),p[t].addStep(f,h[t])})}),(0,r.default)(u).forEach(function(t){i[t]=u[t].toExpress()}),(0,r.default)(p).forEach(function(t){n[t]=p[t].toExpress()})}(t,e,l,u,i,a);break;case n.RendererType.classBreak:!function(t,e,i,n,a,o){c(t.defaultSymbol,e,i,n,a,o);var l=h(t.field,t.valueExpression,!0),u={},p={};(0,r.default)(i).forEach(function(t){u[t]=new s.default(l,i[t])}),(0,r.default)(n).forEach(function(t){p[t]=new s.default(l,n[t])}),(t.classBreakInfos||[]).forEach(function(t){var a={},h={};c(t.symbol,e,a,h,t.visible,o),(0,r.default)(i).forEach(function(e){u[e]||(u[e]=new s.default(l,a[e])),u[e].addStep(t.minValue,t.maxValue,a[e])}),(0,r.default)(n).forEach(function(e){p[e]||(p[e]=new s.default(l,h[e])),p[e].addStep(t.minValue,t.maxValue,h[e])})}),(0,r.default)(u).forEach(function(t){i[t]=u[t].toExpress()}),(0,r.default)(p).forEach(function(t){n[t]=p[t].toExpress()})}(t,e,l,u,i,a);break;case n.RendererType.random:}},e.convertSymbol=c},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=o(i(0)),n=o(i(2)),a=o(i(31));function o(t){return t&&t.__esModule?t:{default:t}}var s=function(){function t(e,i){(0,r.default)(this,t),this.expression=e,this.defValue=i,this.steps=[]}return(0,n.default)(t,[{key:"addStep",value:function(t,e){e===this.defValue||a.default.isMapboxExpression(e)||(this.steps.push(["==",this.expression,t]),this.steps.push(e))}},{key:"toExpress",value:function(){if(0===this.steps.length)return this.defValue;var t=this.steps.map(function(t){return t});return t.unshift("case"),t.push(this.defValue),t}}]),t}();e.default=s},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=o(i(0)),n=o(i(2)),a=o(i(31));function o(t){return t&&t.__esModule?t:{default:t}}var s=function(){function t(e,i){(0,r.default)(this,t),this.expression=e,this.defValue=i,this.steps=[]}return(0,n.default)(t,[{key:"addStep",value:function(t,e,i){i===this.defValue||a.default.isMapboxExpression(i)||(this.steps.push(["all",[">=",this.expression,t],["<=",this.expression,e]]),this.steps.push(i))}},{key:"toExpress",value:function(){if(0===this.steps.length)return this.defValue;var t=this.steps.map(function(t){return t});return t.unshift("case"),t.push(this.defValue),t}}]),t}();e.default=s},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getRankTextStyle=e.getRankCircleStyle=e.getUniqueRendererFromRandomRenderer=e.getUnClusterCirclePaint=e.getSymbolPaint=e.getSymbolLayout=e.getClusterCirclePaint=void 0;var r=function(t){return t&&t.__esModule?t:{default:t}}(i(18)),n=i(1);e.getClusterCirclePaint=function(t,e){(e=(0,n.defaultValue)(e,{})).opacity=(0,n.defaultValue)(e.opacity,1);for(var i=t.clusterInfos,r=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=n.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=n.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=n.Color.fromColor(r.color);a["circle-color"].push(u.toCssRGBAString()),a["circle-opacity"].push(1),a["circle-radius"].push(r.size);var h=n.Symbol.fromJSON(r.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.getSymbolLayout=function(t){for(var e=t.clusterInfos,i=t.defaultLabelSymbol,r="宋体",a=0;a<e.length;a++){var o=n.Symbol.fromJSON(e[a].labelSymbol);o&&o.font&&o.font.family&&(r=o.font.family)}!r&&i&&i.font&&i.font.family&&(r=i.font.family);for(var s={"text-field":"{point_count}","text-font":[r,r],"text-size":["step",["get","point_count"]]},l=0;l<e.length;l++){var u=n.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.getSymbolPaint=function(t,e){(e=(0,n.defaultValue)(e,{})).opacity=(0,n.defaultValue)(e.opacity,1);for(var i=t.clusterInfos,r={"text-opacity":1},a=0;a<i.length;a++){var o=n.Symbol.fromJSON(i[a].labelSymbol);r["text-opacity"]=o.color.alpha*e.opacity}return r},e.getUnClusterCirclePaint=function(t,e){(e=(0,n.defaultValue)(e,{})).opacity=(0,n.defaultValue)(e.opacity,1);var i=t.defaultSymbol,r=n.Color.fromColor(i.color),a=n.Symbol.fromJSON(i.outline),o=n.Color.fromColor(a.color);return{"circle-opacity":r.alpha*e.opacity,"circle-color":r.toCssRGBAString(),"circle-radius":i.size,"circle-stroke-width":a.width,"circle-stroke-color":o.toCssRGBAString(),"circle-stroke-opacity":o.alpha*e.opacity}},e.getUniqueRendererFromRandomRenderer=function(t,e){var i=e.features,a=t.field;if(!a){for(var o=(0,r.default)(i[0].attributes),s=0;s<o.length;s++)if("oid"===o[s].toLowerCase()){a=o[s];break}a=o[0]}for(var l=[],u=0;u<i.length;u++){var h=void 0;switch(i[u].geometry.type){case n.GeometryType.polygon:case n.GeometryType.multiPolygon:case n.GeometryType.extent:case n.GeometryType.circle:default:h={value:i[u].attributes[a],symbol:new n.SimpleFillSymbol({color:new n.Color(parseInt(255*Math.random()),parseInt(255*Math.random()),parseInt(255*Math.random()),1)})};break;case n.GeometryType.lineString:case n.GeometryType.multiLineString:h={value:i[u].attributes[a],symbol:new n.SimpleLineSymbol({color:new n.Color(parseInt(255*Math.random()),parseInt(255*Math.random()),parseInt(255*Math.random()),1),width:3})};break;case n.GeometryType.point:case n.GeometryType.multiPoint:h={value:i[u].attributes[a],symbol:new n.SimpleMarkerSymbol({color:new n.Color(parseInt(255*Math.random()),parseInt(255*Math.random()),parseInt(255*Math.random()),1)})}}l.push(h)}return new n.UniqueValueRenderer({field:a,uniqueValueInfos:l})},e.getRankCircleStyle=function(t,e,i){(i=(0,n.defaultValue)(i,{})).defaultSize=(0,n.defaultValue)(i.defaultSize,20);var a=e.symbol,o=(0,n.defaultValue)(e.defaultSymbol,{}),s=i.defaultSize;o&&o.size&&(s=o.size);for(var l=a.outline,u=["case"],h=e.field,c={},p=0;p<t.length;p++)c.hasOwnProperty(t[p].attributes[h])||(c[t[p].attributes[h]]=t[p].symbol.size);return(0,r.default)(c).forEach(function(t){u.push(["==",["get",h],t]),u.push(c[t])}),u.push(s),{paint:{"circle-color":a.color.toCssRGBString(),"circle-opacity":a.color.alpha,"circle-radius":u,"circle-stroke-color":l.color.toCssRGBString(),"circle-stroke-opacity":l.color.alpha,"circle-stroke-width":l.width}}},e.getRankTextStyle=function(t,e,i){(i=(0,n.defaultValue)(i,{})).defaultSize=(0,n.defaultValue)(i.defaultSize,20),i.fontFamily=(0,n.defaultValue)(i.fontFamily,"宋体");var a=e.field,o=e.symbol,s=(0,n.defaultValue)(e.defaultSymbol,{}),l=i.fontFamily,u=o.font,h=s.font;u&&u.family?l=u.family:h&&h.family&&(l=h.family);var c=i.defaultSize;s&&s.size&&(c=s.size);for(var p={},f=0;f<t.length;f++)p.hasOwnProperty(t[f].attributes[a])||(p[t[f].attributes[a]]=t[f].symbol.font.size);var d=["case"];(0,r.default)(p).forEach(function(t){d.push(["==",["get",a],t]),d.push(p[t])}),d.push(c);var m=void 0;return{paint:{"text-color":(m=o&&o.color?o.color:s&&s.color?o.color:new n.Color(0,0,0,1)).toCssRGBString(),"text-opacity":m.alpha},layout:{"text-field":a,"text-font":[l,l],"text-size":d}}}},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(29);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,e=this._getLayerViewVisible();return this.innerLayer=h.WebTileLayerUtil.addWebTileLayer(this,{visible:e}),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)}}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=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(176));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=a(i(0)),n=a(i(177));function a(t){return t&&t.__esModule?t:{default:t}}var o=function t(){(0,r.default)(this,t)};o.addEchartsLayer=function(t,e){var i=new n.default(e,t.echartsOptions).addTo(e);return i.id=t.id,i},o.removeLayer=function(t){t.remove()},e.default=o},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=o(i(0)),n=o(i(2)),a=o(i(178));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),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=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=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(180));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=a(i(0)),n=a(i(181));function a(t){return t&&t.__esModule?t:{default:t}}var o=function t(){(0,r.default)(this,t)};o.addMapVLayer=function(t,e){var i=new n.default(e,t.data,t.mapVOptions);return i.id=t.id,i},o.removeLayer=function(t){t.remove()},e.default=o},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=s(i(0)),n=s(i(2)),a=s(i(55)),o=s(i(182));function s(t){return t&&t.__esModule?t:{default:t}}var l=function(){function t(e,i,n){(0,r.default)(this,t),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=h(i(4)),n=h(i(0)),a=h(i(2)),o=h(i(5)),s=h(i(32)),l=h(i(6)),u=h(i(55));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,m=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=m},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});var r=h(i(51)),n=h(i(4)),a=h(i(0)),o=h(i(2)),s=h(i(5)),l=h(i(6)),u=i(1);function h(t){return t&&t.__esModule?t:{default:t}}var c=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(){}},{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.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 mapboxgl.Popup({closeOnClick:!1,closeButton:!1,maxWidth:"1900px"}).setLngLat(this.location.coordinates).setDOMContent(e).addTo(this.view._innerView),this._popup.toggleClassName("highlighted");var i=this._popup._container.getElementsByClassName("mapboxgl-popup-content");for(var r in i)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 m=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(m),m.onclick=function(){n.view._setZoomAndCenter({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=c},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 l(n,e.filename),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}),e.SketchEditorMapboxgl=void 0;var r=function(t){return t&&t.__esModule?t:{default:t}}(i(187));e.SketchEditorMapboxgl=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(32)),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);u.Zondy.SketchEditorMapboxgl=c,e.default=c}])});