@local-logic/sdks-app 1.7.2 → 2.1.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.
- package/dist/assets/index-legacy.0a642cb5.js +1 -0
- package/dist/assets/index-legacy.4e44eb64.js +1 -0
- package/dist/assets/index-legacy.7f6983e2.js +1 -0
- package/dist/assets/index-legacy.919f470f.js +1 -0
- package/dist/assets/index-legacy.95ccb44a.js +106 -0
- package/dist/assets/index-legacy.c9e59904.js +23 -0
- package/dist/assets/index-legacy.fc3fe26b.js +1 -0
- package/dist/assets/{index.10935833.js → index.1bb375cb.js} +13 -13
- package/dist/assets/index.621fb294.js +149 -0
- package/dist/assets/index.795111c8.js +1 -0
- package/dist/assets/index.7a7d9dc0.js +1 -0
- package/dist/assets/index.937af76a.js +247 -0
- package/dist/assets/index.9af49ac7.js +1318 -0
- package/dist/assets/index.f59985f7.js +35 -0
- package/dist/assets/polyfills-legacy.db2bc606.js +1 -0
- package/dist/assets/{useIsMobile-legacy.a1dad04e.js → useIsMobile-legacy.ed5dee46.js} +1 -1
- package/dist/assets/{useIsMobile.5dc7840d.js → useIsMobile.456ed35b.js} +1 -1
- package/dist/assets/useQuery-legacy.97f1ad62.js +1 -0
- package/dist/assets/useQuery.83f2b67b.js +9 -0
- package/dist/index.html +3 -3
- package/dist/types/context/languageProvider/data-explorer/locales/en/index.d.ts.map +1 -1
- package/dist/types/context/languageProvider/data-explorer/locales/en/index.js +3 -0
- package/dist/types/context/languageProvider/data-explorer/locales/en/index.js.map +1 -1
- package/dist/types/context/languageProvider/data-explorer/locales/fr/index.d.ts.map +1 -1
- package/dist/types/context/languageProvider/data-explorer/locales/fr/index.js +3 -0
- package/dist/types/context/languageProvider/data-explorer/locales/fr/index.js.map +1 -1
- package/dist/types/context/languageProvider/data-explorer/types.d.ts +3 -3
- package/dist/types/context/languageProvider/data-explorer/types.d.ts.map +1 -1
- package/dist/types/context/languageProvider/index.d.ts +2 -2
- package/dist/types/context/languageProvider/index.d.ts.map +1 -1
- package/dist/types/sdks/DataExplorer/components/DataTable/index.d.ts +4 -0
- package/dist/types/sdks/DataExplorer/components/DataTable/index.d.ts.map +1 -0
- package/dist/types/sdks/DataExplorer/components/DataTable/index.js +65 -0
- package/dist/types/sdks/DataExplorer/components/DataTable/index.js.map +1 -0
- package/dist/types/sdks/DataExplorer/components/DataTable/styles.d.ts +6 -0
- package/dist/types/sdks/DataExplorer/components/DataTable/styles.d.ts.map +1 -0
- package/dist/types/sdks/DataExplorer/components/DataTable/styles.js +27 -0
- package/dist/types/sdks/DataExplorer/components/DataTable/styles.js.map +1 -0
- package/dist/types/sdks/DataExplorer/components/Export/index.d.ts.map +1 -1
- package/dist/types/sdks/DataExplorer/components/Export/index.js +7 -11
- package/dist/types/sdks/DataExplorer/components/Export/index.js.map +1 -1
- package/dist/types/sdks/DataExplorer/components/Filters/index.d.ts +4 -0
- package/dist/types/sdks/DataExplorer/components/Filters/index.d.ts.map +1 -0
- package/dist/types/sdks/DataExplorer/components/Filters/index.js +51 -0
- package/dist/types/sdks/DataExplorer/components/Filters/index.js.map +1 -0
- package/dist/types/sdks/DataExplorer/components/Filters/styles.d.ts +6 -0
- package/dist/types/sdks/DataExplorer/components/Filters/styles.d.ts.map +1 -0
- package/dist/types/sdks/DataExplorer/components/Filters/styles.js +12 -0
- package/dist/types/sdks/DataExplorer/components/Filters/styles.js.map +1 -0
- package/dist/types/sdks/DataExplorer/components/Section/index.d.ts +2 -4
- package/dist/types/sdks/DataExplorer/components/Section/index.d.ts.map +1 -1
- package/dist/types/sdks/DataExplorer/components/Section/index.js +6 -18
- package/dist/types/sdks/DataExplorer/components/Section/index.js.map +1 -1
- package/dist/types/sdks/DataExplorer/context.d.ts +4 -5
- package/dist/types/sdks/DataExplorer/context.d.ts.map +1 -1
- package/dist/types/sdks/DataExplorer/context.js +4 -5
- package/dist/types/sdks/DataExplorer/context.js.map +1 -1
- package/dist/types/sdks/DataExplorer/index.d.ts.map +1 -1
- package/dist/types/sdks/DataExplorer/index.js +10 -59
- package/dist/types/sdks/DataExplorer/index.js.map +1 -1
- package/dist/types/sdks/DataExplorer/styles.d.ts +3 -2
- package/dist/types/sdks/DataExplorer/styles.d.ts.map +1 -1
- package/dist/types/sdks/DataExplorer/styles.js +17 -7
- package/dist/types/sdks/DataExplorer/styles.js.map +1 -1
- package/dist/types/sdks/Demographics/components/Content/Household/index.d.ts.map +1 -1
- package/dist/types/sdks/Demographics/components/Content/Household/index.js +2 -1
- package/dist/types/sdks/Demographics/components/Content/Household/index.js.map +1 -1
- package/dist/types/sdks/Demographics/components/Content/Household/styles.d.ts +3 -0
- package/dist/types/sdks/Demographics/components/Content/Household/styles.d.ts.map +1 -0
- package/dist/types/sdks/Demographics/components/Content/Household/styles.js +19 -0
- package/dist/types/sdks/Demographics/components/Content/Household/styles.js.map +1 -0
- package/dist/types/sdks/Demographics/components/Content/Housing/index.d.ts.map +1 -1
- package/dist/types/sdks/Demographics/components/Content/Housing/index.js +10 -7
- package/dist/types/sdks/Demographics/components/Content/Housing/index.js.map +1 -1
- package/dist/types/sdks/Demographics/components/Content/Housing/styles.d.ts +3 -0
- package/dist/types/sdks/Demographics/components/Content/Housing/styles.d.ts.map +1 -0
- package/dist/types/sdks/Demographics/components/Content/Housing/styles.js +12 -0
- package/dist/types/sdks/Demographics/components/Content/Housing/styles.js.map +1 -0
- package/dist/types/sdks/Demographics/components/Content/Languages/index.d.ts +3 -0
- package/dist/types/sdks/Demographics/components/Content/Languages/index.d.ts.map +1 -0
- package/dist/types/sdks/Demographics/components/Content/Languages/index.js +14 -0
- package/dist/types/sdks/Demographics/components/Content/Languages/index.js.map +1 -0
- package/dist/types/sdks/Demographics/components/Content/index.d.ts.map +1 -1
- package/dist/types/sdks/Demographics/components/Content/index.js +3 -0
- package/dist/types/sdks/Demographics/components/Content/index.js.map +1 -1
- package/dist/types/sdks/Demographics/components/Content/styles.js +1 -1
- package/dist/types/sdks/Demographics/components/Content/styles.js.map +1 -1
- package/dist/types/sdks/Demographics/context.d.ts +3 -0
- package/dist/types/sdks/Demographics/context.d.ts.map +1 -1
- package/dist/types/sdks/Demographics/context.js.map +1 -1
- package/dist/types/sdks/Demographics/styles.d.ts.map +1 -1
- package/dist/types/sdks/Demographics/styles.js +0 -1
- package/dist/types/sdks/Demographics/styles.js.map +1 -1
- package/package.json +4 -3
- package/dist/assets/index-legacy.128bbb90.js +0 -106
- package/dist/assets/index-legacy.3a8c6aa8.js +0 -1
- package/dist/assets/index-legacy.46f64d17.js +0 -1
- package/dist/assets/index-legacy.60df4146.js +0 -1
- package/dist/assets/index-legacy.7c9f6b15.js +0 -1
- package/dist/assets/index-legacy.935e7346.js +0 -1
- package/dist/assets/index-legacy.93d69255.js +0 -1
- package/dist/assets/index.1df47f40.js +0 -28
- package/dist/assets/index.71eb35ea.js +0 -247
- package/dist/assets/index.97d3a920.js +0 -1374
- package/dist/assets/index.d464e7cf.js +0 -1
- package/dist/assets/index.e63e2d64.js +0 -1
- package/dist/assets/index.ed99fd65.js +0 -120
- package/dist/assets/keyFactory-legacy.782b8549.js +0 -1
- package/dist/assets/keyFactory.e1cd5707.js +0 -1
- package/dist/assets/polyfills-legacy.147ba02d.js +0 -1
- package/dist/assets/useQuery-legacy.6ce02414.js +0 -1
- package/dist/assets/useQuery.7c643982.js +0 -9
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(){var e,t,r,i,n,a,o,s=["scope","children"],l=["children"],u=["children"],c=["scope","children"],h=["asChild"],p=["__scopeCollapsible","open","defaultOpen","disabled","onOpenChange"],f=["__scopeCollapsible"],d=["forceMount"],m=["__scopeCollapsible","present","children"],v=["type"],y=["value","defaultValue","onValueChange","collapsible"],g=["value","defaultValue","onValueChange"],_=["__scopeAccordion","disabled"],x=["__scopeAccordion","value"],b=["__scopeAccordion"],w=["__scopeAccordion"],k=["__scopeAccordion"];function E(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function T(e,t){if(null==e)return{};var r,i,n=function(e,t){if(null==e)return{};var r,i,n={},a=Object.keys(e);for(i=0;i<a.length;i++)r=a[i],t.indexOf(r)>=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function S(){return S="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var i=C(e,t);if(i){var n=Object.getOwnPropertyDescriptor(i,t);return n.get?n.get.call(arguments.length<3?e:r):n.value}},S.apply(this,arguments)}function C(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=O(e)););return e}function I(e){return function(e){if(Array.isArray(e))return Y(e)}(e)||z(e)||J(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function z(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function A(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&F(e,t)}function M(e){var t=B();return function(){var r,i=O(e);if(t){var n=O(this).constructor;r=Reflect.construct(i,arguments,n)}else r=i.apply(this,arguments);return P(this,r)}}function P(e,t){if(t&&("object"===Z(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return D(e)}function D(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function L(e){var t="function"==typeof Map?new Map:void 0;return L=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return R(e,arguments,O(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),F(i,e)},L(e)}function R(e,t,r){return R=B()?Reflect.construct.bind():function(e,t,r){var i=[null];i.push.apply(i,t);var n=new(Function.bind.apply(e,i));return r&&F(n,r.prototype),n},R.apply(null,arguments)}function B(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function F(e,t){return F=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},F(e,t)}function O(e){return O=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},O(e)}function V(e,t){return N(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var i,n,a=[],o=!0,s=!1;try{for(r=r.call(e);!(o=(i=r.next()).done)&&(a.push(i.value),!t||a.length!==t);o=!0);}catch(l){s=!0,n=l}finally{try{o||null==r.return||r.return()}finally{if(s)throw n}}return a}(e,t)||J(e,t)||U()}function U(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function N(e){if(Array.isArray(e))return e}function j(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function G(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function q(e,t,r){return t&&G(e.prototype,t),r&&G(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Z(e){return Z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Z(e)}function X(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function H(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?X(Object(r),!0).forEach((function(t){W(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):X(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function W(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function K(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=J(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var i=0,n=function(){};return{s:n,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function J(e,t){if(e){if("string"==typeof e)return Y(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Y(e,t):void 0}}function Y(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}System.register(["./index-legacy.95ccb44a.js","./useQuery-legacy.97f1ad62.js"],(function(C,B){"use strict";var F,G,X,Y,Q,$,ee,te,re,ie,ne,ae,oe,se,le,ue,ce,he=document.createElement("style");return he.innerHTML=".mapboxgl-map,.maplibregl-map{-webkit-tap-highlight-color:rgb(0 0 0/0);font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative}.mapboxgl-canvas,.maplibregl-canvas{left:0;position:absolute;top:0}.mapboxgl-map:fullscreen,.maplibregl-map:fullscreen{height:100%;width:100%}.mapboxgl-canvas-container.mapboxgl-interactive,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass,.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.mapboxgl-canvas-container.mapboxgl-interactive.mapboxgl-track-pointer,.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.mapboxgl-canvas-container.mapboxgl-interactive:active,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass:active,.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.mapboxgl-canvas-container.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas,.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.mapboxgl-ctrl-bottom-left,.mapboxgl-ctrl-bottom-right,.mapboxgl-ctrl-top-left,.mapboxgl-ctrl-top-right,.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.mapboxgl-ctrl-top-left,.maplibregl-ctrl-top-left{left:0;top:0}.mapboxgl-ctrl-top-right,.maplibregl-ctrl-top-right{right:0;top:0}.mapboxgl-ctrl-bottom-left,.maplibregl-ctrl-bottom-left{bottom:0;left:0}.mapboxgl-ctrl-bottom-right,.maplibregl-ctrl-bottom-right{bottom:0;right:0}.mapboxgl-ctrl,.maplibregl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.mapboxgl-ctrl-top-left .mapboxgl-ctrl,.maplibregl-ctrl-top-left .maplibregl-ctrl{float:left;margin:10px 0 0 10px}.mapboxgl-ctrl-top-right .mapboxgl-ctrl,.maplibregl-ctrl-top-right .maplibregl-ctrl{float:right;margin:10px 10px 0 0}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl,.maplibregl-ctrl-bottom-left .maplibregl-ctrl{float:left;margin:0 0 10px 10px}.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl,.maplibregl-ctrl-bottom-right .maplibregl-ctrl{float:right;margin:0 10px 10px 0}.mapboxgl-ctrl-group,.maplibregl-ctrl-group{background:#fff;border-radius:4px}.mapboxgl-ctrl-group:not(:empty),.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (-ms-high-contrast:active){.mapboxgl-ctrl-group:not(:empty),.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.mapboxgl-ctrl-group button,.maplibregl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;padding:0;width:29px}.mapboxgl-ctrl-group button+button,.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.mapboxgl-ctrl button .mapboxgl-ctrl-icon,.maplibregl-ctrl button .maplibregl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (-ms-high-contrast:active){.mapboxgl-ctrl-icon,.maplibregl-ctrl-icon{background-color:transparent}.mapboxgl-ctrl-group button+button,.maplibregl-ctrl-group button+button{border-top:1px solid ButtonText}}.mapboxgl-ctrl button::-moz-focus-inner,.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.mapboxgl-ctrl-attrib-button:focus,.mapboxgl-ctrl-group button:focus,.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl button:disabled,.maplibregl-ctrl button:disabled{cursor:not-allowed}.mapboxgl-ctrl button:disabled .mapboxgl-ctrl-icon,.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}.mapboxgl-ctrl button:not(:disabled):hover,.maplibregl-ctrl button:not(:disabled):hover{background-color:rgba(0,0,0,.05)}.mapboxgl-ctrl-group button:focus:focus-visible,.maplibregl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl-group button:focus:not(:focus-visible),.maplibregl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.mapboxgl-ctrl-group button:focus:first-child,.maplibregl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.mapboxgl-ctrl-group button:focus:last-child,.maplibregl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.mapboxgl-ctrl-group button:focus:only-child,.maplibregl-ctrl-group button:focus:only-child{border-radius:inherit}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E\")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E\")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='m10.5 14 4-8 4 8h-8z'/%3E%3Cpath d='m10.5 16 4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E\")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='m10.5 14 4-8 4 8h-8z'/%3E%3Cpath d='m10.5 16 4 8 4-8h-8z' fill='%23999'/%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m10.5 14 4-8 4 8h-8z'/%3E%3Cpath d='m10.5 16 4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl button.mapboxgl-ctrl-terrain .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22' fill='%23333'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-terrain-enabled .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22' fill='%2333b5e5'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23aaa'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='m14 5 1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-waiting .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{animation:maplibregl-spin 2s linear infinite}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23999'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='m14 5 1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23666'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='m14 5 1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E\")}}@keyframes maplibregl-spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}a.mapboxgl-ctrl-logo,a.maplibregl-ctrl-logo{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.255 1.255 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.255 1.255 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5.11 5.11 0 0 1 .314-.787l.009-.016a4.623 4.623 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.548 4.548 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4.314.319.566.676.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.416 2.416 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.448 2.448 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675c.211.2.381.43.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.76 4.76 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.407 3.407 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.255 1.255 0 0 1 .689 1.004 4.73 4.73 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528 0 .343-.02.694-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.815 5.815 0 0 1-.548-2.512c0-.286.017-.567.053-.843a1.255 1.255 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.778 4.778 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.47 4.47 0 0 1-1.935-.424 1.252 1.252 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.402 2.402 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.703 4.703 0 0 1-1.782 1.884 4.767 4.767 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.47 4.47 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a4.983 4.983 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.255 1.255 0 0 1-1.115.676h-.098a1.255 1.255 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15c.329-.237.574-.499.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267c-.088-.22-.264-.438-.526-.658l-.032-.028a3.16 3.16 0 0 0-.668-.428l-.27-.12a3.293 3.293 0 0 0-1.235-.23c-.757 0-1.415.163-1.974.493a3.36 3.36 0 0 0-1.3 1.382c-.297.593-.444 1.284-.444 2.074 0 .8.17 1.503.51 2.107a3.795 3.795 0 0 0 1.382 1.381 3.883 3.883 0 0 0 1.893.477c.53 0 1.015-.11 1.455-.33zm-2.789-5.38c-.384.45-.575 1.038-.575 1.762 0 .735.186 1.332.559 1.794.384.45.933.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.17 2.17 0 0 0 .468-.29l.178-.161a2.163 2.163 0 0 0 .397-.561c.163-.333.244-.717.244-1.15v-.115c0-.472-.098-.894-.296-1.267l-.043-.077a2.211 2.211 0 0 0-.633-.709l-.13-.086-.047-.028a2.099 2.099 0 0 0-1.073-.285c-.702 0-1.244.231-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.958.958 0 0 0-.353-.389.851.851 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.626 2.626 0 0 0 .331.423c.213.22.464.402.755.548l.173.074c.433.17.93.255 1.49.255.68 0 1.295-.165 1.844-.493a3.447 3.447 0 0 0 1.316-1.4c.329-.603.493-1.299.493-2.089 0-1.273-.33-2.243-.988-2.913-.658-.68-1.52-1.02-2.584-1.02-.598 0-1.124.115-1.575.347a2.807 2.807 0 0 0-.415.262l-.199.166a3.35 3.35 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138c.137.193.297.36.48.5l.155.11.053.034c.34.197.713.297 1.119.297.714 0 1.262-.225 1.645-.675.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.29 0-.569.053-.835.16a2.366 2.366 0 0 0-.284.136 1.99 1.99 0 0 0-.363.254 2.237 2.237 0 0 0-.46.569l-.082.162a2.56 2.56 0 0 0-.213 1.072v.115c0 .471.098.894.296 1.267l.135.211zm.964-.818a1.11 1.11 0 0 0 .367.385.937.937 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a.995.995 0 0 0-.503.135l-.012.007a.859.859 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.43 1.43 0 0 0 .14.66zm15.7-6.222c.232-.23.346-.516.346-.856a1.053 1.053 0 0 0-.345-.79 1.175 1.175 0 0 0-.84-.329c-.34 0-.625.11-.855.33a1.053 1.053 0 0 0-.346.79c0 .34.115.625.346.855.23.23.516.346.856.346.34 0 .62-.115.839-.346zm4.337 9.314.033-1.332c.128.269.324.518.59.747l.098.081a3.727 3.727 0 0 0 .316.224l.223.122a3.21 3.21 0 0 0 1.44.322 3.785 3.785 0 0 0 1.875-.477 3.52 3.52 0 0 0 1.382-1.366c.352-.593.526-1.29.526-2.09 0-.79-.147-1.48-.444-2.073a3.235 3.235 0 0 0-1.283-1.399c-.549-.34-1.195-.51-1.942-.51a3.476 3.476 0 0 0-1.527.344l-.086.043-.165.09a3.412 3.412 0 0 0-.33.214c-.288.21-.507.446-.656.707a1.893 1.893 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.482 2.482 0 0 0 .566.7c.078.065.159.125.245.18l.144.08a2.105 2.105 0 0 0 .975.232c.713 0 1.262-.225 1.645-.675.384-.46.576-1.053.576-1.778 0-.734-.192-1.327-.576-1.777-.373-.46-.921-.692-1.645-.692a2.18 2.18 0 0 0-1.015.235c-.147.075-.285.17-.415.282l-.15.142a2.086 2.086 0 0 0-.42.594c-.149.32-.223.685-.223 1.1v.115c0 .47.097.89.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.868.868 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.13 1.13 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013c.23-.087.472-.134.724-.14l.069-.002c.329 0 .542.033.642.099l.247-1.794c-.13-.066-.37-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2.086 2.086 0 0 0-.411.148 2.18 2.18 0 0 0-.4.249 2.482 2.482 0 0 0-.485.499 2.659 2.659 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884c0-.364.053-.678.159-.943a1.49 1.49 0 0 1 .466-.636 2.52 2.52 0 0 1 .399-.253 2.19 2.19 0 0 1 .224-.099zm9.784 2.656.05-.922c0-1.162-.285-2.062-.856-2.698-.559-.647-1.42-.97-2.584-.97-.746 0-1.415.163-2.007.493a3.462 3.462 0 0 0-1.4 1.382c-.329.604-.493 1.306-.493 2.106 0 .714.143 1.371.428 1.975.285.593.73 1.07 1.332 1.432.604.351 1.355.526 2.255.526.649 0 1.204-.062 1.668-.185l.044-.012.135-.04c.409-.122.736-.263.984-.421l-.542-1.267c-.2.108-.415.199-.642.274l-.297.087c-.34.088-.773.131-1.3.131-.636 0-1.135-.147-1.497-.444a1.573 1.573 0 0 1-.192-.193c-.244-.294-.415-.705-.512-1.234l-.004-.021h5.43zm-5.427-1.256-.003.022h3.752v-.138c-.007-.485-.104-.857-.288-1.118a1.056 1.056 0 0 0-.156-.176c-.307-.285-.746-.428-1.316-.428-.657 0-1.155.202-1.494.604-.253.3-.417.712-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z' fill='%23000' fill-opacity='.4' fill-rule='evenodd'/%3E%3Cpath d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81c-.68 0-1.311-.16-1.893-.478a3.795 3.795 0 0 1-1.381-1.382c-.34-.604-.51-1.306-.51-2.106 0-.79.147-1.482.444-2.074a3.364 3.364 0 0 1 1.3-1.382c.559-.33 1.217-.494 1.974-.494a3.293 3.293 0 0 1 1.234.231 3.341 3.341 0 0 1 .97.575c.264.22.44.439.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332c-.186.395-.526.746-1.02 1.053a3.167 3.167 0 0 1-1.662.444zm.296-1.482c.626 0 1.152-.214 1.58-.642.428-.44.642-1.01.642-1.711v-.115c0-.472-.098-.894-.296-1.267a2.211 2.211 0 0 0-.807-.872 2.098 2.098 0 0 0-1.119-.313c-.702 0-1.245.231-1.629.692-.384.45-.575 1.037-.575 1.76 0 .736.186 1.333.559 1.795.384.45.933.675 1.645.675zm6.521-6.237h1.711v1.4c.604-1.065 1.547-1.597 2.83-1.597 1.064 0 1.926.34 2.584 1.02.659.67.988 1.641.988 2.914 0 .79-.164 1.487-.493 2.09a3.456 3.456 0 0 1-1.316 1.399 3.51 3.51 0 0 1-1.844.493c-.636 0-1.19-.11-1.662-.329a2.665 2.665 0 0 1-1.086-.97l.017 5.134h-1.728V9.242zm4.048 6.22c.714 0 1.262-.224 1.645-.674.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.395 0-.768.098-1.12.296-.34.187-.613.46-.822.823-.197.351-.296.763-.296 1.234v.115c0 .472.098.894.296 1.267.209.362.483.647.823.855.34.197.713.297 1.119.297z' fill='%23fff'/%3E%3Cpath d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.159 1.159 0 0 1-.856-.346 1.165 1.165 0 0 1-.346-.856 1.053 1.053 0 0 1 .346-.79c.23-.219.516-.329.856-.329.329 0 .609.11.839.33a1.053 1.053 0 0 1 .345.79 1.159 1.159 0 0 1-.345.855c-.22.23-.5.346-.84.346zm7.875 9.133a3.167 3.167 0 0 1-1.662-.444c-.482-.307-.817-.658-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283c.186-.438.548-.812 1.086-1.119a3.486 3.486 0 0 1 1.778-.477c.746 0 1.393.17 1.942.51a3.235 3.235 0 0 1 1.283 1.4c.297.592.444 1.282.444 2.072 0 .8-.175 1.498-.526 2.09a3.52 3.52 0 0 1-1.382 1.366 3.785 3.785 0 0 1-1.876.477zm-.296-1.481c.713 0 1.26-.225 1.645-.675.384-.46.577-1.053.577-1.778 0-.734-.193-1.327-.577-1.776-.373-.46-.921-.692-1.645-.692a2.115 2.115 0 0 0-1.58.659c-.428.428-.642.992-.642 1.694v.115c0 .473.098.895.296 1.267a2.385 2.385 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481c.176-.505.46-.91.856-1.217a2.14 2.14 0 0 1 1.349-.46c.351 0 .593.032.724.098l-.247 1.794c-.099-.066-.313-.099-.642-.099-.516 0-.988.164-1.416.494-.417.329-.626.855-.626 1.58v3.883h-1.777V9.242zm9.534 7.718c-.9 0-1.651-.175-2.255-.526-.603-.362-1.047-.84-1.332-1.432a4.567 4.567 0 0 1-.428-1.975c0-.8.164-1.502.493-2.106a3.462 3.462 0 0 1 1.4-1.382c.592-.33 1.262-.494 2.007-.494 1.163 0 2.024.324 2.584.97.57.637.856 1.537.856 2.7 0 .296-.017.603-.05.92h-5.43c.12.67.356 1.153.708 1.45.362.296.86.443 1.497.443.526 0 .96-.044 1.3-.131a4.123 4.123 0 0 0 .938-.362l.542 1.267c-.274.175-.647.329-1.119.46-.472.132-1.042.197-1.711.197zm1.596-4.558c.01-.68-.137-1.158-.444-1.432-.307-.285-.746-.428-1.316-.428-1.152 0-1.815.62-1.991 1.86h3.752z' fill='%23e1e3e9'/%3E%3Cg fill-rule='evenodd' stroke-width='1.036'%3E%3Cpath d='m8.166 16.146-.002.002a1.54 1.54 0 0 1-2.009 0l-.002-.002-.043-.034-.002-.002-.199-.162H4.377a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659H8.411l-.202.164zm-1.121-.905a.29.29 0 0 0 .113.023.286.286 0 0 0 .189-.07l.077-.063c.634-.508 4.672-3.743 4.672-7.575 0-2.55-2.215-4.625-4.938-4.625S2.221 5.006 2.221 7.556c0 3.225 2.86 6.027 4.144 7.137h.004l.04.038.484.4.077.063a.628.628 0 0 0 .074.047zm-2.52-.548a16.898 16.898 0 0 1-1.183-1.315C2.187 11.942.967 9.897.967 7.555c0-3.319 2.855-5.88 6.192-5.88 3.338 0 6.193 2.561 6.193 5.881 0 2.34-1.22 4.387-2.376 5.822a16.898 16.898 0 0 1-1.182 1.315h.15a1.912 1.912 0 0 1 1.914 1.914v1.84a1.912 1.912 0 0 1-1.914 1.914H4.377a1.912 1.912 0 0 1-1.914-1.914v-1.84a1.912 1.912 0 0 1 1.914-1.914zm3.82-6.935c0 .692-.55 1.222-1.187 1.222s-1.185-.529-1.185-1.222.548-1.222 1.185-1.222c.638 0 1.186.529 1.186 1.222zm-1.186 2.477c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477zm2.048 7.71H5.114v-.838h4.093z' fill='%23000' fill-opacity='.4'/%3E%3Cpath d='M2.222 7.555c0-2.55 2.214-4.625 4.937-4.625 2.723 0 4.938 2.075 4.938 4.625 0 3.832-4.038 7.068-4.672 7.575l-.077.063a.286.286 0 0 1-.189.07.286.286 0 0 1-.188-.07l-.077-.063c-.634-.507-4.672-3.743-4.672-7.575zm4.937 2.68c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477z' fill='%23e1e3e9'/%3E%3Cpath d='M4.377 15.948a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659zm4.83 1.16H5.114v.838h4.093z' fill='%23fff'/%3E%3C/g%3E%3C/svg%3E\");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.mapboxgl-ctrl-logo.mapboxgl-compact,a.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media (-ms-high-contrast:active){a.mapboxgl-ctrl-logo,a.maplibregl-ctrl-logo{background-color:transparent;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.255 1.255 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.255 1.255 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5.11 5.11 0 0 1 .314-.787l.009-.016a4.623 4.623 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.548 4.548 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4.314.319.566.676.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.416 2.416 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.448 2.448 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675c.211.2.381.43.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.76 4.76 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.407 3.407 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.255 1.255 0 0 1 .689 1.004 4.73 4.73 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528 0 .343-.02.694-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.815 5.815 0 0 1-.548-2.512c0-.286.017-.567.053-.843a1.255 1.255 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.778 4.778 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.47 4.47 0 0 1-1.935-.424 1.252 1.252 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.402 2.402 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.703 4.703 0 0 1-1.782 1.884 4.767 4.767 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.47 4.47 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a4.983 4.983 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.255 1.255 0 0 1-1.115.676h-.098a1.255 1.255 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15c.329-.237.574-.499.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267c-.088-.22-.264-.438-.526-.658l-.032-.028a3.16 3.16 0 0 0-.668-.428l-.27-.12a3.293 3.293 0 0 0-1.235-.23c-.757 0-1.415.163-1.974.493a3.36 3.36 0 0 0-1.3 1.382c-.297.593-.444 1.284-.444 2.074 0 .8.17 1.503.51 2.107a3.795 3.795 0 0 0 1.382 1.381 3.883 3.883 0 0 0 1.893.477c.53 0 1.015-.11 1.455-.33zm-2.789-5.38c-.384.45-.575 1.038-.575 1.762 0 .735.186 1.332.559 1.794.384.45.933.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.17 2.17 0 0 0 .468-.29l.178-.161a2.163 2.163 0 0 0 .397-.561c.163-.333.244-.717.244-1.15v-.115c0-.472-.098-.894-.296-1.267l-.043-.077a2.211 2.211 0 0 0-.633-.709l-.13-.086-.047-.028a2.099 2.099 0 0 0-1.073-.285c-.702 0-1.244.231-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.958.958 0 0 0-.353-.389.851.851 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.626 2.626 0 0 0 .331.423c.213.22.464.402.755.548l.173.074c.433.17.93.255 1.49.255.68 0 1.295-.165 1.844-.493a3.447 3.447 0 0 0 1.316-1.4c.329-.603.493-1.299.493-2.089 0-1.273-.33-2.243-.988-2.913-.658-.68-1.52-1.02-2.584-1.02-.598 0-1.124.115-1.575.347a2.807 2.807 0 0 0-.415.262l-.199.166a3.35 3.35 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138c.137.193.297.36.48.5l.155.11.053.034c.34.197.713.297 1.119.297.714 0 1.262-.225 1.645-.675.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.29 0-.569.053-.835.16a2.366 2.366 0 0 0-.284.136 1.99 1.99 0 0 0-.363.254 2.237 2.237 0 0 0-.46.569l-.082.162a2.56 2.56 0 0 0-.213 1.072v.115c0 .471.098.894.296 1.267l.135.211zm.964-.818a1.11 1.11 0 0 0 .367.385.937.937 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a.995.995 0 0 0-.503.135l-.012.007a.859.859 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.43 1.43 0 0 0 .14.66zm15.7-6.222c.232-.23.346-.516.346-.856a1.053 1.053 0 0 0-.345-.79 1.175 1.175 0 0 0-.84-.329c-.34 0-.625.11-.855.33a1.053 1.053 0 0 0-.346.79c0 .34.115.625.346.855.23.23.516.346.856.346.34 0 .62-.115.839-.346zm4.337 9.314.033-1.332c.128.269.324.518.59.747l.098.081a3.727 3.727 0 0 0 .316.224l.223.122a3.21 3.21 0 0 0 1.44.322 3.785 3.785 0 0 0 1.875-.477 3.52 3.52 0 0 0 1.382-1.366c.352-.593.526-1.29.526-2.09 0-.79-.147-1.48-.444-2.073a3.235 3.235 0 0 0-1.283-1.399c-.549-.34-1.195-.51-1.942-.51a3.476 3.476 0 0 0-1.527.344l-.086.043-.165.09a3.412 3.412 0 0 0-.33.214c-.288.21-.507.446-.656.707a1.893 1.893 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.482 2.482 0 0 0 .566.7c.078.065.159.125.245.18l.144.08a2.105 2.105 0 0 0 .975.232c.713 0 1.262-.225 1.645-.675.384-.46.576-1.053.576-1.778 0-.734-.192-1.327-.576-1.777-.373-.46-.921-.692-1.645-.692a2.18 2.18 0 0 0-1.015.235c-.147.075-.285.17-.415.282l-.15.142a2.086 2.086 0 0 0-.42.594c-.149.32-.223.685-.223 1.1v.115c0 .47.097.89.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.868.868 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.13 1.13 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013c.23-.087.472-.134.724-.14l.069-.002c.329 0 .542.033.642.099l.247-1.794c-.13-.066-.37-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2.086 2.086 0 0 0-.411.148 2.18 2.18 0 0 0-.4.249 2.482 2.482 0 0 0-.485.499 2.659 2.659 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884c0-.364.053-.678.159-.943a1.49 1.49 0 0 1 .466-.636 2.52 2.52 0 0 1 .399-.253 2.19 2.19 0 0 1 .224-.099zm9.784 2.656.05-.922c0-1.162-.285-2.062-.856-2.698-.559-.647-1.42-.97-2.584-.97-.746 0-1.415.163-2.007.493a3.462 3.462 0 0 0-1.4 1.382c-.329.604-.493 1.306-.493 2.106 0 .714.143 1.371.428 1.975.285.593.73 1.07 1.332 1.432.604.351 1.355.526 2.255.526.649 0 1.204-.062 1.668-.185l.044-.012.135-.04c.409-.122.736-.263.984-.421l-.542-1.267c-.2.108-.415.199-.642.274l-.297.087c-.34.088-.773.131-1.3.131-.636 0-1.135-.147-1.497-.444a1.573 1.573 0 0 1-.192-.193c-.244-.294-.415-.705-.512-1.234l-.004-.021h5.43zm-5.427-1.256-.003.022h3.752v-.138c-.007-.485-.104-.857-.288-1.118a1.056 1.056 0 0 0-.156-.176c-.307-.285-.746-.428-1.316-.428-.657 0-1.155.202-1.494.604-.253.3-.417.712-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z' fill='%23000' fill-opacity='.4' fill-rule='evenodd'/%3E%3Cpath d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81c-.68 0-1.311-.16-1.893-.478a3.795 3.795 0 0 1-1.381-1.382c-.34-.604-.51-1.306-.51-2.106 0-.79.147-1.482.444-2.074a3.364 3.364 0 0 1 1.3-1.382c.559-.33 1.217-.494 1.974-.494a3.293 3.293 0 0 1 1.234.231 3.341 3.341 0 0 1 .97.575c.264.22.44.439.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332c-.186.395-.526.746-1.02 1.053a3.167 3.167 0 0 1-1.662.444zm.296-1.482c.626 0 1.152-.214 1.58-.642.428-.44.642-1.01.642-1.711v-.115c0-.472-.098-.894-.296-1.267a2.211 2.211 0 0 0-.807-.872 2.098 2.098 0 0 0-1.119-.313c-.702 0-1.245.231-1.629.692-.384.45-.575 1.037-.575 1.76 0 .736.186 1.333.559 1.795.384.45.933.675 1.645.675zm6.521-6.237h1.711v1.4c.604-1.065 1.547-1.597 2.83-1.597 1.064 0 1.926.34 2.584 1.02.659.67.988 1.641.988 2.914 0 .79-.164 1.487-.493 2.09a3.456 3.456 0 0 1-1.316 1.399 3.51 3.51 0 0 1-1.844.493c-.636 0-1.19-.11-1.662-.329a2.665 2.665 0 0 1-1.086-.97l.017 5.134h-1.728V9.242zm4.048 6.22c.714 0 1.262-.224 1.645-.674.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.395 0-.768.098-1.12.296-.34.187-.613.46-.822.823-.197.351-.296.763-.296 1.234v.115c0 .472.098.894.296 1.267.209.362.483.647.823.855.34.197.713.297 1.119.297z' fill='%23fff'/%3E%3Cpath d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.159 1.159 0 0 1-.856-.346 1.165 1.165 0 0 1-.346-.856 1.053 1.053 0 0 1 .346-.79c.23-.219.516-.329.856-.329.329 0 .609.11.839.33a1.053 1.053 0 0 1 .345.79 1.159 1.159 0 0 1-.345.855c-.22.23-.5.346-.84.346zm7.875 9.133a3.167 3.167 0 0 1-1.662-.444c-.482-.307-.817-.658-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283c.186-.438.548-.812 1.086-1.119a3.486 3.486 0 0 1 1.778-.477c.746 0 1.393.17 1.942.51a3.235 3.235 0 0 1 1.283 1.4c.297.592.444 1.282.444 2.072 0 .8-.175 1.498-.526 2.09a3.52 3.52 0 0 1-1.382 1.366 3.785 3.785 0 0 1-1.876.477zm-.296-1.481c.713 0 1.26-.225 1.645-.675.384-.46.577-1.053.577-1.778 0-.734-.193-1.327-.577-1.776-.373-.46-.921-.692-1.645-.692a2.115 2.115 0 0 0-1.58.659c-.428.428-.642.992-.642 1.694v.115c0 .473.098.895.296 1.267a2.385 2.385 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481c.176-.505.46-.91.856-1.217a2.14 2.14 0 0 1 1.349-.46c.351 0 .593.032.724.098l-.247 1.794c-.099-.066-.313-.099-.642-.099-.516 0-.988.164-1.416.494-.417.329-.626.855-.626 1.58v3.883h-1.777V9.242zm9.534 7.718c-.9 0-1.651-.175-2.255-.526-.603-.362-1.047-.84-1.332-1.432a4.567 4.567 0 0 1-.428-1.975c0-.8.164-1.502.493-2.106a3.462 3.462 0 0 1 1.4-1.382c.592-.33 1.262-.494 2.007-.494 1.163 0 2.024.324 2.584.97.57.637.856 1.537.856 2.7 0 .296-.017.603-.05.92h-5.43c.12.67.356 1.153.708 1.45.362.296.86.443 1.497.443.526 0 .96-.044 1.3-.131a4.123 4.123 0 0 0 .938-.362l.542 1.267c-.274.175-.647.329-1.119.46-.472.132-1.042.197-1.711.197zm1.596-4.558c.01-.68-.137-1.158-.444-1.432-.307-.285-.746-.428-1.316-.428-1.152 0-1.815.62-1.991 1.86h3.752z' fill='%23e1e3e9'/%3E%3Cg fill-rule='evenodd' stroke-width='1.036'%3E%3Cpath d='m8.166 16.146-.002.002a1.54 1.54 0 0 1-2.009 0l-.002-.002-.043-.034-.002-.002-.199-.162H4.377a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659H8.411l-.202.164zm-1.121-.905a.29.29 0 0 0 .113.023.286.286 0 0 0 .189-.07l.077-.063c.634-.508 4.672-3.743 4.672-7.575 0-2.55-2.215-4.625-4.938-4.625S2.221 5.006 2.221 7.556c0 3.225 2.86 6.027 4.144 7.137h.004l.04.038.484.4.077.063a.628.628 0 0 0 .074.047zm-2.52-.548a16.898 16.898 0 0 1-1.183-1.315C2.187 11.942.967 9.897.967 7.555c0-3.319 2.855-5.88 6.192-5.88 3.338 0 6.193 2.561 6.193 5.881 0 2.34-1.22 4.387-2.376 5.822a16.898 16.898 0 0 1-1.182 1.315h.15a1.912 1.912 0 0 1 1.914 1.914v1.84a1.912 1.912 0 0 1-1.914 1.914H4.377a1.912 1.912 0 0 1-1.914-1.914v-1.84a1.912 1.912 0 0 1 1.914-1.914zm3.82-6.935c0 .692-.55 1.222-1.187 1.222s-1.185-.529-1.185-1.222.548-1.222 1.185-1.222c.638 0 1.186.529 1.186 1.222zm-1.186 2.477c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477zm2.048 7.71H5.114v-.838h4.093z' fill='%23000' fill-opacity='.4'/%3E%3Cpath d='M2.222 7.555c0-2.55 2.214-4.625 4.937-4.625 2.723 0 4.938 2.075 4.938 4.625 0 3.832-4.038 7.068-4.672 7.575l-.077.063a.286.286 0 0 1-.189.07.286.286 0 0 1-.188-.07l-.077-.063c-.634-.507-4.672-3.743-4.672-7.575zm4.937 2.68c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477z' fill='%23e1e3e9'/%3E%3Cpath d='M4.377 15.948a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659zm4.83 1.16H5.114v.838h4.093z' fill='%23fff'/%3E%3C/g%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){a.mapboxgl-ctrl-logo,a.maplibregl-ctrl-logo{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.255 1.255 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.255 1.255 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5.11 5.11 0 0 1 .314-.787l.009-.016a4.623 4.623 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.548 4.548 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4.314.319.566.676.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.416 2.416 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.448 2.448 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675c.211.2.381.43.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.76 4.76 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.407 3.407 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.255 1.255 0 0 1 .689 1.004 4.73 4.73 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528 0 .343-.02.694-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.815 5.815 0 0 1-.548-2.512c0-.286.017-.567.053-.843a1.255 1.255 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.778 4.778 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.47 4.47 0 0 1-1.935-.424 1.252 1.252 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.402 2.402 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.703 4.703 0 0 1-1.782 1.884 4.767 4.767 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.47 4.47 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a4.983 4.983 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.255 1.255 0 0 1-1.115.676h-.098a1.255 1.255 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15c.329-.237.574-.499.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267c-.088-.22-.264-.438-.526-.658l-.032-.028a3.16 3.16 0 0 0-.668-.428l-.27-.12a3.293 3.293 0 0 0-1.235-.23c-.757 0-1.415.163-1.974.493a3.36 3.36 0 0 0-1.3 1.382c-.297.593-.444 1.284-.444 2.074 0 .8.17 1.503.51 2.107a3.795 3.795 0 0 0 1.382 1.381 3.883 3.883 0 0 0 1.893.477c.53 0 1.015-.11 1.455-.33zm-2.789-5.38c-.384.45-.575 1.038-.575 1.762 0 .735.186 1.332.559 1.794.384.45.933.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.17 2.17 0 0 0 .468-.29l.178-.161a2.163 2.163 0 0 0 .397-.561c.163-.333.244-.717.244-1.15v-.115c0-.472-.098-.894-.296-1.267l-.043-.077a2.211 2.211 0 0 0-.633-.709l-.13-.086-.047-.028a2.099 2.099 0 0 0-1.073-.285c-.702 0-1.244.231-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.958.958 0 0 0-.353-.389.851.851 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.626 2.626 0 0 0 .331.423c.213.22.464.402.755.548l.173.074c.433.17.93.255 1.49.255.68 0 1.295-.165 1.844-.493a3.447 3.447 0 0 0 1.316-1.4c.329-.603.493-1.299.493-2.089 0-1.273-.33-2.243-.988-2.913-.658-.68-1.52-1.02-2.584-1.02-.598 0-1.124.115-1.575.347a2.807 2.807 0 0 0-.415.262l-.199.166a3.35 3.35 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138c.137.193.297.36.48.5l.155.11.053.034c.34.197.713.297 1.119.297.714 0 1.262-.225 1.645-.675.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.29 0-.569.053-.835.16a2.366 2.366 0 0 0-.284.136 1.99 1.99 0 0 0-.363.254 2.237 2.237 0 0 0-.46.569l-.082.162a2.56 2.56 0 0 0-.213 1.072v.115c0 .471.098.894.296 1.267l.135.211zm.964-.818a1.11 1.11 0 0 0 .367.385.937.937 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a.995.995 0 0 0-.503.135l-.012.007a.859.859 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.43 1.43 0 0 0 .14.66zm15.7-6.222c.232-.23.346-.516.346-.856a1.053 1.053 0 0 0-.345-.79 1.175 1.175 0 0 0-.84-.329c-.34 0-.625.11-.855.33a1.053 1.053 0 0 0-.346.79c0 .34.115.625.346.855.23.23.516.346.856.346.34 0 .62-.115.839-.346zm4.337 9.314.033-1.332c.128.269.324.518.59.747l.098.081a3.727 3.727 0 0 0 .316.224l.223.122a3.21 3.21 0 0 0 1.44.322 3.785 3.785 0 0 0 1.875-.477 3.52 3.52 0 0 0 1.382-1.366c.352-.593.526-1.29.526-2.09 0-.79-.147-1.48-.444-2.073a3.235 3.235 0 0 0-1.283-1.399c-.549-.34-1.195-.51-1.942-.51a3.476 3.476 0 0 0-1.527.344l-.086.043-.165.09a3.412 3.412 0 0 0-.33.214c-.288.21-.507.446-.656.707a1.893 1.893 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.482 2.482 0 0 0 .566.7c.078.065.159.125.245.18l.144.08a2.105 2.105 0 0 0 .975.232c.713 0 1.262-.225 1.645-.675.384-.46.576-1.053.576-1.778 0-.734-.192-1.327-.576-1.777-.373-.46-.921-.692-1.645-.692a2.18 2.18 0 0 0-1.015.235c-.147.075-.285.17-.415.282l-.15.142a2.086 2.086 0 0 0-.42.594c-.149.32-.223.685-.223 1.1v.115c0 .47.097.89.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.868.868 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.13 1.13 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013c.23-.087.472-.134.724-.14l.069-.002c.329 0 .542.033.642.099l.247-1.794c-.13-.066-.37-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2.086 2.086 0 0 0-.411.148 2.18 2.18 0 0 0-.4.249 2.482 2.482 0 0 0-.485.499 2.659 2.659 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884c0-.364.053-.678.159-.943a1.49 1.49 0 0 1 .466-.636 2.52 2.52 0 0 1 .399-.253 2.19 2.19 0 0 1 .224-.099zm9.784 2.656.05-.922c0-1.162-.285-2.062-.856-2.698-.559-.647-1.42-.97-2.584-.97-.746 0-1.415.163-2.007.493a3.462 3.462 0 0 0-1.4 1.382c-.329.604-.493 1.306-.493 2.106 0 .714.143 1.371.428 1.975.285.593.73 1.07 1.332 1.432.604.351 1.355.526 2.255.526.649 0 1.204-.062 1.668-.185l.044-.012.135-.04c.409-.122.736-.263.984-.421l-.542-1.267c-.2.108-.415.199-.642.274l-.297.087c-.34.088-.773.131-1.3.131-.636 0-1.135-.147-1.497-.444a1.573 1.573 0 0 1-.192-.193c-.244-.294-.415-.705-.512-1.234l-.004-.021h5.43zm-5.427-1.256-.003.022h3.752v-.138c-.007-.485-.104-.857-.288-1.118a1.056 1.056 0 0 0-.156-.176c-.307-.285-.746-.428-1.316-.428-.657 0-1.155.202-1.494.604-.253.3-.417.712-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z' fill='%23000' fill-opacity='.4' fill-rule='evenodd'/%3E%3Cpath d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81c-.68 0-1.311-.16-1.893-.478a3.795 3.795 0 0 1-1.381-1.382c-.34-.604-.51-1.306-.51-2.106 0-.79.147-1.482.444-2.074a3.364 3.364 0 0 1 1.3-1.382c.559-.33 1.217-.494 1.974-.494a3.293 3.293 0 0 1 1.234.231 3.341 3.341 0 0 1 .97.575c.264.22.44.439.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332c-.186.395-.526.746-1.02 1.053a3.167 3.167 0 0 1-1.662.444zm.296-1.482c.626 0 1.152-.214 1.58-.642.428-.44.642-1.01.642-1.711v-.115c0-.472-.098-.894-.296-1.267a2.211 2.211 0 0 0-.807-.872 2.098 2.098 0 0 0-1.119-.313c-.702 0-1.245.231-1.629.692-.384.45-.575 1.037-.575 1.76 0 .736.186 1.333.559 1.795.384.45.933.675 1.645.675zm6.521-6.237h1.711v1.4c.604-1.065 1.547-1.597 2.83-1.597 1.064 0 1.926.34 2.584 1.02.659.67.988 1.641.988 2.914 0 .79-.164 1.487-.493 2.09a3.456 3.456 0 0 1-1.316 1.399 3.51 3.51 0 0 1-1.844.493c-.636 0-1.19-.11-1.662-.329a2.665 2.665 0 0 1-1.086-.97l.017 5.134h-1.728V9.242zm4.048 6.22c.714 0 1.262-.224 1.645-.674.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.395 0-.768.098-1.12.296-.34.187-.613.46-.822.823-.197.351-.296.763-.296 1.234v.115c0 .472.098.894.296 1.267.209.362.483.647.823.855.34.197.713.297 1.119.297z' fill='%23fff'/%3E%3Cpath d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.159 1.159 0 0 1-.856-.346 1.165 1.165 0 0 1-.346-.856 1.053 1.053 0 0 1 .346-.79c.23-.219.516-.329.856-.329.329 0 .609.11.839.33a1.053 1.053 0 0 1 .345.79 1.159 1.159 0 0 1-.345.855c-.22.23-.5.346-.84.346zm7.875 9.133a3.167 3.167 0 0 1-1.662-.444c-.482-.307-.817-.658-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283c.186-.438.548-.812 1.086-1.119a3.486 3.486 0 0 1 1.778-.477c.746 0 1.393.17 1.942.51a3.235 3.235 0 0 1 1.283 1.4c.297.592.444 1.282.444 2.072 0 .8-.175 1.498-.526 2.09a3.52 3.52 0 0 1-1.382 1.366 3.785 3.785 0 0 1-1.876.477zm-.296-1.481c.713 0 1.26-.225 1.645-.675.384-.46.577-1.053.577-1.778 0-.734-.193-1.327-.577-1.776-.373-.46-.921-.692-1.645-.692a2.115 2.115 0 0 0-1.58.659c-.428.428-.642.992-.642 1.694v.115c0 .473.098.895.296 1.267a2.385 2.385 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481c.176-.505.46-.91.856-1.217a2.14 2.14 0 0 1 1.349-.46c.351 0 .593.032.724.098l-.247 1.794c-.099-.066-.313-.099-.642-.099-.516 0-.988.164-1.416.494-.417.329-.626.855-.626 1.58v3.883h-1.777V9.242zm9.534 7.718c-.9 0-1.651-.175-2.255-.526-.603-.362-1.047-.84-1.332-1.432a4.567 4.567 0 0 1-.428-1.975c0-.8.164-1.502.493-2.106a3.462 3.462 0 0 1 1.4-1.382c.592-.33 1.262-.494 2.007-.494 1.163 0 2.024.324 2.584.97.57.637.856 1.537.856 2.7 0 .296-.017.603-.05.92h-5.43c.12.67.356 1.153.708 1.45.362.296.86.443 1.497.443.526 0 .96-.044 1.3-.131a4.123 4.123 0 0 0 .938-.362l.542 1.267c-.274.175-.647.329-1.119.46-.472.132-1.042.197-1.711.197zm1.596-4.558c.01-.68-.137-1.158-.444-1.432-.307-.285-.746-.428-1.316-.428-1.152 0-1.815.62-1.991 1.86h3.752z' fill='%23e1e3e9'/%3E%3Cg fill-rule='evenodd' stroke-width='1.036'%3E%3Cpath d='m8.166 16.146-.002.002a1.54 1.54 0 0 1-2.009 0l-.002-.002-.043-.034-.002-.002-.199-.162H4.377a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659H8.411l-.202.164zm-1.121-.905a.29.29 0 0 0 .113.023.286.286 0 0 0 .189-.07l.077-.063c.634-.508 4.672-3.743 4.672-7.575 0-2.55-2.215-4.625-4.938-4.625S2.221 5.006 2.221 7.556c0 3.225 2.86 6.027 4.144 7.137h.004l.04.038.484.4.077.063a.628.628 0 0 0 .074.047zm-2.52-.548a16.898 16.898 0 0 1-1.183-1.315C2.187 11.942.967 9.897.967 7.555c0-3.319 2.855-5.88 6.192-5.88 3.338 0 6.193 2.561 6.193 5.881 0 2.34-1.22 4.387-2.376 5.822a16.898 16.898 0 0 1-1.182 1.315h.15a1.912 1.912 0 0 1 1.914 1.914v1.84a1.912 1.912 0 0 1-1.914 1.914H4.377a1.912 1.912 0 0 1-1.914-1.914v-1.84a1.912 1.912 0 0 1 1.914-1.914zm3.82-6.935c0 .692-.55 1.222-1.187 1.222s-1.185-.529-1.185-1.222.548-1.222 1.185-1.222c.638 0 1.186.529 1.186 1.222zm-1.186 2.477c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477zm2.048 7.71H5.114v-.838h4.093z' fill='%23000' fill-opacity='.4'/%3E%3Cpath d='M2.222 7.555c0-2.55 2.214-4.625 4.937-4.625 2.723 0 4.938 2.075 4.938 4.625 0 3.832-4.038 7.068-4.672 7.575l-.077.063a.286.286 0 0 1-.189.07.286.286 0 0 1-.188-.07l-.077-.063c-.634-.507-4.672-3.743-4.672-7.575zm4.937 2.68c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477z' fill='%23e1e3e9'/%3E%3Cpath d='M4.377 15.948a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659zm4.83 1.16H5.114v.838h4.093z' fill='%23fff'/%3E%3C/g%3E%3C/svg%3E\")}}.mapboxgl-ctrl.mapboxgl-ctrl-attrib,.maplibregl-ctrl.maplibregl-ctrl-attrib{background-color:rgba(255,255,255,.5);margin:0;padding:0 5px}@media screen{.mapboxgl-ctrl-attrib.mapboxgl-compact,.maplibregl-ctrl-attrib.maplibregl-compact{background-color:#fff;border-radius:12px;box-sizing:content-box;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner,.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.mapboxgl-ctrl-attrib-button,.maplibregl-ctrl-attrib-button{background-color:rgba(255,255,255,.5);background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E\");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button{appearance:none;list-style:none}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker{display:none}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-top-left .mapboxgl-ctrl-attrib-button,.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button{left:0}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-inner,.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{display:block}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button{background-color:rgba(0,0,0,.05)}.mapboxgl-ctrl-bottom-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after,.maplibregl-ctrl-bottom-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;right:0}.mapboxgl-ctrl-top-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after,.maplibregl-ctrl-top-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{right:0;top:0}.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{left:0;top:0}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after,.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;left:0}}@media screen and (-ms-high-contrast:active){.mapboxgl-ctrl-attrib.mapboxgl-compact:after,.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' fill='%23fff'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E\")}}@media screen and (-ms-high-contrast:black-on-white){.mapboxgl-ctrl-attrib.mapboxgl-compact:after,.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl-attrib a,.maplibregl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.mapboxgl-ctrl-attrib a:hover,.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.mapboxgl-attrib-empty,.maplibregl-attrib-empty{display:none}.mapboxgl-ctrl-scale,.maplibregl-ctrl-scale{background-color:rgba(255,255,255,.75);border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px}.mapboxgl-popup,.maplibregl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.mapboxgl-popup-anchor-top,.mapboxgl-popup-anchor-top-left,.mapboxgl-popup-anchor-top-right,.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.mapboxgl-popup-anchor-bottom,.mapboxgl-popup-anchor-bottom-left,.mapboxgl-popup-anchor-bottom-right,.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.mapboxgl-popup-anchor-left,.maplibregl-popup-anchor-left{flex-direction:row}.mapboxgl-popup-anchor-right,.maplibregl-popup-anchor-right{flex-direction:row-reverse}.mapboxgl-popup-tip,.maplibregl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.mapboxgl-popup-anchor-top .mapboxgl-popup-tip,.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip,.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip,.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip,.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip,.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip,.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.mapboxgl-popup-anchor-left .mapboxgl-popup-tip,.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.mapboxgl-popup-anchor-right .mapboxgl-popup-tip,.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.mapboxgl-popup-close-button,.maplibregl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.mapboxgl-popup-close-button:hover,.maplibregl-popup-close-button:hover{background-color:rgba(0,0,0,.05)}.mapboxgl-popup-content,.maplibregl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:15px 10px;pointer-events:auto;position:relative}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-content,.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-content,.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-content,.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-content,.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.mapboxgl-popup-track-pointer,.maplibregl-popup-track-pointer{display:none}.mapboxgl-popup-track-pointer *,.maplibregl-popup-track-pointer *{pointer-events:none;user-select:none}.mapboxgl-map:hover .mapboxgl-popup-track-pointer,.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.mapboxgl-map:active .mapboxgl-popup-track-pointer,.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.mapboxgl-marker,.maplibregl-marker{left:0;position:absolute;top:0;will-change:transform}.mapboxgl-user-location-dot,.maplibregl-user-location-dot{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.mapboxgl-user-location-dot:before,.maplibregl-user-location-dot:before{animation:maplibregl-user-location-dot-pulse 2s infinite;background-color:#1da1f2;border-radius:50%;content:\"\";height:15px;position:absolute;width:15px}.mapboxgl-user-location-dot:after,.maplibregl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px rgba(0,0,0,.35);box-sizing:border-box;content:\"\";height:19px;left:-2px;position:absolute;top:-2px;width:19px}@keyframes maplibregl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.mapboxgl-user-location-dot-stale,.maplibregl-user-location-dot-stale{background-color:#aaa}.mapboxgl-user-location-dot-stale:after,.maplibregl-user-location-dot-stale:after{display:none}.mapboxgl-user-location-accuracy-circle,.maplibregl-user-location-accuracy-circle{background-color:rgba(29,161,242,.2);border-radius:100%;height:1px;width:1px}.mapboxgl-crosshair,.mapboxgl-crosshair .mapboxgl-interactive,.mapboxgl-crosshair .mapboxgl-interactive:active,.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.mapboxgl-boxzoom,.maplibregl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}.maplibregl-cooperative-gesture-screen{align-items:center;background:rgba(0,0,0,.4);bottom:0;color:#fff;display:flex;font-size:1.4em;justify-content:center;left:0;line-height:1.2;opacity:0;padding:1rem;pointer-events:none;position:absolute;right:0;top:0;transition:opacity 1s ease 1s}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media (hover:none),(max-width:480px){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}\n",document.head.appendChild(he),{setters:[function(e){F=e.r,G=e._,X=e.j,Y=e.x,e.y,Q=e.R,$=e.Y,ee=e.$,te=e.s,re=e.m,ie=e.C,ne=e.z,ae=e.a,oe=e.A,se=e.e,le=e.H,ue=e.I},function(e){ce=e.u}],execute:function(){C("d",ve);var he=F.exports.createContext(null);function pe(e){return{longitude:e.center.lng,latitude:e.center.lat,zoom:e.zoom,pitch:e.pitch,bearing:e.bearing,padding:e.padding}}function fe(e,t){var r=t.viewState||t,i=!1;if("longitude"in r&&"latitude"in r){var n=e.center;e.center=new n.constructor(r.longitude,r.latitude),i=i||n!==e.center}if("zoom"in r){var a=e.zoom;e.zoom=r.zoom,i=i||a!==e.zoom}if("bearing"in r){var o=e.bearing;e.bearing=r.bearing,i=i||o!==e.bearing}if("pitch"in r){var s=e.pitch;e.pitch=r.pitch,i=i||s!==e.pitch}return r.padding&&!e.isPaddingEqual(r.padding)&&(i=!0,e.padding=r.padding),i}var de=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function me(e){if(!e)return null;if("string"==typeof e)return e;if("toJS"in e&&(e=e.toJS()),!e.layers)return e;var t,r={},i=K(e.layers);try{for(i.s();!(t=i.n()).done;){var n=t.value;r[n.id]=n}}catch(o){i.e(o)}finally{i.f()}var a=e.layers.map((function(e){var t=r[e.ref],i=null;if("interactive"in e&&delete(i=H({},e)).interactive,t){delete(i=i||H({},e)).ref;var n,a=K(de);try{for(a.s();!(n=a.n()).done;){var s=n.value;s in t&&(i[s]=t[s])}}catch(o){a.e(o)}finally{a.f()}}return i||e}));return H(H({},e),{},{layers:a})}function ve(e,t){if(e===t)return!0;if(!e||!t)return!1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!ve(e[r],t[r]))return!1;return!0}if(Array.isArray(t))return!1;if("object"===Z(e)&&"object"===Z(t)){var i=Object.keys(e),n=Object.keys(t);if(i.length!==n.length)return!1;for(var a=0,o=i;a<o.length;a++){var s=o[a];if(!t.hasOwnProperty(s))return!1;if(!ve(e[s],t[s]))return!1}return!0}return!1}var ye={mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",click:"onClick",dblclick:"onDblClick",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mouseout:"onMouseOut",contextmenu:"onContextMenu",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",touchcancel:"onTouchCancel"},ge={movestart:"onMoveStart",move:"onMove",moveend:"onMoveEnd",dragstart:"onDragStart",drag:"onDrag",dragend:"onDragEnd",zoomstart:"onZoomStart",zoom:"onZoom",zoomend:"onZoomEnd",rotatestart:"onRotateStart",rotate:"onRotate",rotateend:"onRotateEnd",pitchstart:"onPitchStart",pitch:"onPitch",pitchend:"onPitchEnd"},_e={wheel:"onWheel",boxzoomstart:"onBoxZoomStart",boxzoomend:"onBoxZoomEnd",boxzoomcancel:"onBoxZoomCancel",resize:"onResize",load:"onLoad",render:"onRender",idle:"onIdle",remove:"onRemove",data:"onData",styledata:"onStyleData",sourcedata:"onSourceData",error:"onError"},xe=["minZoom","maxZoom","minPitch","maxPitch","maxBounds","projection","renderWorldCopies"],be=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate","touchPitch"],we=function(){function e(t,r,i){var n=this;j(this,e),this._map=null,this._internalUpdate=!1,this._inRender=!1,this._hoveredFeatures=null,this._deferredEvents={move:!1,zoom:!1,pitch:!1,rotate:!1},this._onEvent=function(e){var t=n.props[_e[e.type]];t&&t(e)},this._onPointerEvent=function(e){"mousemove"!==e.type&&"mouseout"!==e.type||n._updateHover(e);var t=n.props[ye[e.type]];if(t){if(n.props.interactiveLayerIds&&"mouseover"!==e.type&&"mouseout"!==e.type){var r=n._hoveredFeatures||n._map.queryRenderedFeatures(e.point,{layers:n.props.interactiveLayerIds});e.features=r}t(e),delete e.features}},this._onCameraEvent=function(e){if(!n._internalUpdate){var t=n.props[ge[e.type]];t&&t(e)}e.type in n._deferredEvents&&(n._deferredEvents[e.type]=!1)},this._MapClass=t,this.props=r,this._initialize(i)}return q(e,[{key:"map",get:function(){return this._map}},{key:"transform",get:function(){return this._renderTransform}},{key:"setProps",value:function(e){var t=this.props;this.props=e;var r=this._updateSettings(e,t);r&&this._createShadowTransform(this._map);var i=this._updateSize(e),n=this._updateViewState(e,!0);this._updateStyle(e,t),this._updateStyleComponents(e,t),this._updateHandlers(e,t),(r||i||n&&!this._map.isMoving())&&this.redraw()}},{key:"_initialize",value:function(e){var t=this,r=this.props,i=H(H(H({},r),r.initialViewState),{},{accessToken:r.mapboxAccessToken||ke()||null,container:e,style:me(r.mapStyle)}),n=i.initialViewState||i.viewState||i;if(Object.assign(i,{center:[n.longitude||0,n.latitude||0],zoom:n.zoom||0,pitch:n.pitch||0,bearing:n.bearing||0}),r.gl){var a=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=function(){return HTMLCanvasElement.prototype.getContext=a,r.gl}}var o=new this._MapClass(i);n.padding&&o.setPadding(n.padding),r.cursor&&(o.getCanvas().style.cursor=r.cursor),this._createShadowTransform(o);var s=o._render;o._render=function(e){t._inRender=!0,s.call(o,e),t._inRender=!1};var l=o._renderTaskQueue.run;o._renderTaskQueue.run=function(e){l.call(o._renderTaskQueue,e),t._onBeforeRepaint()},o.on("render",(function(){return t._onAfterRepaint()}));var u=o.fire;for(var c in o.fire=this._fireEvent.bind(this,u),o.on("resize",(function(){t._renderTransform.resize(o.transform.width,o.transform.height)})),o.on("styledata",(function(){return t._updateStyleComponents(t.props,{})})),o.on("sourcedata",(function(){return t._updateStyleComponents(t.props,{})})),ye)o.on(c,this._onPointerEvent);for(var h in ge)o.on(h,this._onCameraEvent);for(var p in _e)o.on(p,this._onEvent);this._map=o}},{key:"recycle",value:function(){e.savedMaps.push(this)}},{key:"destroy",value:function(){this._map.remove()}},{key:"redraw",value:function(){var e=this._map;!this._inRender&&e.style&&(e._frame&&(e._frame.cancel(),e._frame=null),e._render())}},{key:"_createShadowTransform",value:function(e){var t,r,i=(t=e.transform,(r=t.clone()).pixelsToGLUnits=t.pixelsToGLUnits,r);e.painter.transform=i,this._renderTransform=i}},{key:"_updateSize",value:function(e){var t=e.viewState;if(t){var r=this._map;if(t.width!==r.transform.width||t.height!==r.transform.height)return r.resize(),!0}return!1}},{key:"_updateViewState",value:function(e,t){if(this._internalUpdate)return!1;var r=this._map,i=this._renderTransform,n=i.zoom,a=i.pitch,o=i.bearing,s=r.isMoving();s&&(i.cameraElevationReference="sea");var l=fe(i,H(H({},pe(r.transform)),e));if(s&&(i.cameraElevationReference="ground"),l&&t){var u=this._deferredEvents;u.move=!0,u.zoom||(u.zoom=n!==i.zoom),u.rotate||(u.rotate=o!==i.bearing),u.pitch||(u.pitch=a!==i.pitch)}return s||fe(r.transform,e),l}},{key:"_updateSettings",value:function(e,t){var r,i=this._map,n=!1,a=K(xe);try{for(a.s();!(r=a.n()).done;){var o=r.value;o in e&&!ve(e[o],t[o])&&(n=!0,i["set".concat(o[0].toUpperCase()).concat(o.slice(1))](e[o]))}}catch(s){a.e(s)}finally{a.f()}return n}},{key:"_updateStyle",value:function(e,t){if(e.cursor!==t.cursor&&(this._map.getCanvas().style.cursor=e.cursor),e.mapStyle!==t.mapStyle){var r={diff:e.styleDiffing};return"localIdeographFontFamily"in e&&(r.localIdeographFontFamily=e.localIdeographFontFamily),this._map.setStyle(me(e.mapStyle),r),!0}return!1}},{key:"_updateStyleComponents",value:function(e,t){var r=this._map,i=!1;return r.style.loaded()&&("light"in e&&!ve(e.light,t.light)&&(i=!0,r.setLight(e.light)),"fog"in e&&!ve(e.fog,t.fog)&&(i=!0,r.setFog(e.fog)),"terrain"in e&&!ve(e.terrain,t.terrain)&&(e.terrain&&!r.getSource(e.terrain.source)||(i=!0,r.setTerrain(e.terrain)))),i}},{key:"_updateHandlers",value:function(e,t){var r,i=this._map,n=!1,a=K(be);try{for(a.s();!(r=a.n()).done;){var o=r.value,s=e[o];ve(s,t[o])||(n=!0,s?i[o].enable(s):i[o].disable())}}catch(l){a.e(l)}finally{a.f()}return n}},{key:"_updateHover",value:function(e){var t,r=this.props;if(r.interactiveLayerIds&&(r.onMouseMove||r.onMouseEnter||r.onMouseLeave)){var i,n=e.type,a=(null===(t=this._hoveredFeatures)||void 0===t?void 0:t.length)>0;if("mousemove"===n)try{i=this._map.queryRenderedFeatures(e.point,{layers:r.interactiveLayerIds})}catch(s){i=[]}else i=[];var o=i.length>0;!o&&a&&(e.type="mouseleave",this._onPointerEvent(e)),this._hoveredFeatures=i,o&&!a&&(e.type="mouseenter",this._onPointerEvent(e)),e.type=n}else this._hoveredFeatures=null}},{key:"_fireEvent",value:function(e,t,r){var i=this._map,n=i.transform,a="string"==typeof t?t:t.type;return"move"===a&&this._updateViewState(this.props,!1),a in ge&&("object"===Z(t)&&(t.viewState=pe(n)),this._map.isMoving())?(i.transform=this._renderTransform,e.call(i,t,r),i.transform=n,i):(e.call(i,t,r),i)}},{key:"_onBeforeRepaint",value:function(){var e=this,t=this._map;for(var r in this._internalUpdate=!0,this._deferredEvents)this._deferredEvents[r]&&t.fire(r);this._internalUpdate=!1;var i=this._map.transform;this._map.transform=this._renderTransform,this._onAfterRepaint=function(){e._map.transform=i}}}],[{key:"reuse",value:function(t,r){var i=e.savedMaps.pop();if(!i)return null;var n=i.map,a=n.getContainer();for(r.className=a.className;a.childNodes.length>0;)r.appendChild(a.childNodes[0]);n._container=r,i.setProps(H(H({},t),{},{styleDiffing:!1})),n.resize();var o=t.initialViewState;return o&&(o.bounds?n.fitBounds(o.bounds,H(H({},o.fitBoundsOptions),{},{duration:0})):i._updateViewState(o,!1)),n.isStyleLoaded()?n.fire("load"):n.once("styledata",(function(){return n.fire("load")})),i}}]),e}();function ke(){var e=null;if("undefined"!=typeof location){var t=/access_token=([^&\/]*)/.exec(location.search);e=t&&t[1]}try{e=e||process.env.MapboxAccessToken}catch(r){}try{e=e||process.env.REACT_APP_MAPBOX_ACCESS_TOKEN}catch(i){}return e}we.savedMaps=[];var Ee=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function Te(e,t){if(!e)return null;var r,i=e.map,n={getMap:function(){return i},getCenter:function(){return e.transform.center},getZoom:function(){return e.transform.zoom},getBearing:function(){return e.transform.bearing},getPitch:function(){return e.transform.pitch},getPadding:function(){return e.transform.padding},getBounds:function(){return e.transform.getBounds()},project:function(r){return e.transform.locationPoint(t.LngLat.convert(r))},unproject:function(r){return e.transform.pointLocation(t.Point.convert(r))},queryTerrainElevation:function(t,r){var n=i.transform;i.transform=e.transform;var a=i.queryTerrainElevation(t,r);return i.transform=n,a}},a=K(function(e){var t=new Set,r=e;for(;r;){var i,n=K(Object.getOwnPropertyNames(r));try{for(n.s();!(i=n.n()).done;){var a=i.value;"_"!==a[0]&&"function"==typeof e[a]&&"fire"!==a&&"setEventedParent"!==a&&t.add(a)}}catch(o){n.e(o)}finally{n.f()}r=Object.getPrototypeOf(r)}return Array.from(t)}(i));try{for(a.s();!(r=a.n()).done;){var o=r.value;o in n||Ee.includes(o)||(n[o]=i[o].bind(i))}}catch(s){a.e(s)}finally{a.f()}return n}var Se="undefined"!=typeof document?F.exports.useLayoutEffect:F.exports.useEffect,Ce=["baseApiUrl","maxParallelImageRequests","workerClass","workerCount","workerUrl"];var Ie=C("M",F.exports.createContext(null)),ze={minZoom:0,maxZoom:22,minPitch:0,maxPitch:60,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,mapStyle:{version:8,sources:{},layers:[]},styleDiffing:!0,projection:"mercator",renderWorldCopies:!0,onError:function(e){return console.error(e.error)},RTLTextPlugin:"https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js"},Ae=C("i",F.exports.forwardRef((function(e,t){var r=F.exports.useContext(he),i=V(F.exports.useState(null),2),n=i[0],a=i[1],o=F.exports.useRef(),s=F.exports.useRef({mapLib:null,map:null}).current;F.exports.useEffect((function(){var t,i=e.mapLib,n=!0;return Promise.resolve(i||G((function(){return B.import("./index-legacy.eb53f1ed.js").then((function(e){return e.i}))}),void 0)).then((function(i){if(n){if(i.Map||(i=i.default),!i||!i.Map)throw new Error("Invalid mapLib");if(!i.supported(e))throw new Error("Map is not supported by this browser");!function(e,t){var r,i=K(Ce);try{for(i.s();!(r=i.n()).done;){var n=r.value;n in t&&(e[n]=t[n])}}catch(a){i.e(a)}finally{i.f()}t.RTLTextPlugin&&e.getRTLTextPluginStatus&&"unavailable"===e.getRTLTextPluginStatus()&&e.setRTLTextPlugin(t.RTLTextPlugin,(function(e){e&&console.error(e)}),!1)}(i,e),e.reuseMaps&&(t=we.reuse(e,o.current)),t||(t=new we(i.Map,e,o.current)),s.map=Te(t,i),s.mapLib=i,a(t),null==r||r.onMapMount(s.map,e.id)}})).catch((function(t){e.onError({type:"error",target:null,originalEvent:null,error:t})})),function(){n=!1,t&&(null==r||r.onMapUnmount(e.id),e.reuseMaps?t.recycle():t.destroy())}}),[]),Se((function(){n&&n.setProps(e)})),F.exports.useImperativeHandle(t,(function(){return s.map}),[n]);var l=F.exports.useMemo((function(){return H({position:"relative",width:"100%",height:"100%"},e.style)}),[e.style]);return X("div",{id:e.id,ref:o,style:l,children:n&&X(Ie.Provider,{value:s,children:e.children})})})));Ae.displayName="Map",Ae.defaultProps=ze;var Me=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function Pe(e,t){if(e&&t){var r=e.style;for(var i in t){var n=t[i];Number.isFinite(n)&&!Me.test(i)?r[i]="".concat(n,"px"):r[i]=n}}}function De(e){var t=F.exports.useContext(Ie),r=t.map,i=t.mapLib,n=F.exports.useRef({props:e});n.current.props=e;var a,o,s,l,u,c,h=F.exports.useMemo((function(){var t=!1;F.exports.Children.forEach(e.children,(function(e){e&&(t=!0)}));var r=H(H({},e),{},{element:t?document.createElement("div"):null}),a=new i.Marker(r).setLngLat([e.longitude,e.latitude]);return a.getElement().addEventListener("click",(function(e){var t,r;null===(r=(t=n.current.props).onClick)||void 0===r||r.call(t,{type:"click",target:a,originalEvent:e})})),a.on("dragstart",(function(e){var t,r,i=e;i.lngLat=h.getLngLat(),null===(r=(t=n.current.props).onDragStart)||void 0===r||r.call(t,i)})),a.on("drag",(function(e){var t,r,i=e;i.lngLat=h.getLngLat(),null===(r=(t=n.current.props).onDrag)||void 0===r||r.call(t,i)})),a.on("dragend",(function(e){var t,r,i=e;i.lngLat=h.getLngLat(),null===(r=(t=n.current.props).onDragEnd)||void 0===r||r.call(t,i)})),a}),[]);return F.exports.useEffect((function(){return h.addTo(r.getMap()),function(){h.remove()}}),[]),F.exports.useEffect((function(){Pe(h.getElement(),e.style)}),[e.style]),h.getLngLat().lng===e.longitude&&h.getLngLat().lat===e.latitude||h.setLngLat([e.longitude,e.latitude]),e.offset&&(a=h.getOffset(),o=e.offset,s=Array.isArray(a)?a[0]:a?a.x:0,l=Array.isArray(a)?a[1]:a?a.y:0,u=Array.isArray(o)?o[0]:o?o.x:0,c=Array.isArray(o)?o[1]:o?o.y:0,s!==u||l!==c)&&h.setOffset(e.offset),h.isDraggable()!==e.draggable&&h.setDraggable(e.draggable),h.getRotation()!==e.rotation&&h.setRotation(e.rotation),h.getRotationAlignment()!==e.rotationAlignment&&h.setRotationAlignment(e.rotationAlignment),h.getPitchAlignment()!==e.pitchAlignment&&h.setPitchAlignment(e.pitchAlignment),h.getPopup()!==e.popup&&h.setPopup(e.popup),Y.exports.createPortal(e.children,h.getElement())}De.defaultProps={draggable:!1,popup:null,rotation:0,rotationAlignment:"auto",pitchAlignment:"auto"};var Le=C("a",F.exports.memo(De));function Re(e){return new Set(e?e.trim().split(/\s+/):[])}function Be(e,t,r,i){var n=F.exports.useContext(Ie),a=F.exports.useMemo((function(){return e(n)}),[]);return F.exports.useEffect((function(){var e=i||r||t,o="function"==typeof t&&"function"==typeof r?t:null,s="function"==typeof r?r:"function"==typeof t?t:null,l=n.map;return l.hasControl(a)||(l.addControl(a,null==e?void 0:e.position),o&&o(n)),function(){s&&s(n),l.hasControl(a)&&l.removeControl(a)}}),[]),a}F.exports.memo((function(e){var t=F.exports.useContext(Ie),r=t.map,i=t.mapLib,n=F.exports.useMemo((function(){return document.createElement("div")}),[]),a=F.exports.useRef({props:e});a.current.props=e;var o=F.exports.useMemo((function(){var t=H({},e),r=new i.Popup(t).setLngLat([e.longitude,e.latitude]);return r.once("open",(function(e){var t,r;null===(r=(t=a.current.props).onOpen)||void 0===r||r.call(t,e)})),r}),[]);if(F.exports.useEffect((function(){var e=function(e){var t,r;null===(r=(t=a.current.props).onClose)||void 0===r||r.call(t,e)};return o.on("close",e),o.setDOMContent(n).addTo(r.getMap()),function(){o.off("close",e),o.isOpen()&&o.remove()}}),[]),F.exports.useEffect((function(){Pe(o.getElement(),e.style)}),[e.style]),o.isOpen()&&(o.getLngLat().lng===e.longitude&&o.getLngLat().lat===e.latitude||o.setLngLat([e.longitude,e.latitude]),e.offset&&!ve(o.options.offset,e.offset)&&o.setOffset(e.offset),o.options.anchor===e.anchor&&o.options.maxWidth===e.maxWidth||(o.options.anchor=e.anchor,o.setMaxWidth(e.maxWidth)),o.options.className!==e.className)){var s,l=Re(o.options.className),u=Re(e.className),c=K(l);try{for(c.s();!(s=c.n()).done;){var h=s.value;u.has(h)||o.removeClassName(h)}}catch(m){c.e(m)}finally{c.f()}var p,f=K(u);try{for(f.s();!(p=f.n()).done;){var d=p.value;l.has(d)||o.addClassName(d)}}catch(m){f.e(m)}finally{f.f()}o.options.className=e.className}return Y.exports.createPortal(e.children,n)}));C("j",F.exports.memo((function(e){var t=Be((function(t){return new t.mapLib.AttributionControl(e)}),{position:e.position});return F.exports.useEffect((function(){Pe(t._container,e.style)}),[e.style]),null})));F.exports.memo((function(e){var t=Be((function(t){return new t.mapLib.FullscreenControl({container:e.containerId&&document.getElementById(e.containerId)})}),{position:e.position});return F.exports.useEffect((function(){Pe(t._controlContainer,e.style)}),[e.style]),null}));var Fe=F.exports.forwardRef((function(e,t){var r=F.exports.useRef({props:e}),i=Be((function(t){var i=new t.mapLib.GeolocateControl(e),n=i._setupUI;return i._setupUI=function(e){i._container.hasChildNodes()||n(e)},i.on("geolocate",(function(e){var t,i;null===(i=(t=r.current.props).onGeolocate)||void 0===i||i.call(t,e)})),i.on("error",(function(e){var t,i;null===(i=(t=r.current.props).onError)||void 0===i||i.call(t,e)})),i.on("outofmaxbounds",(function(e){var t,i;null===(i=(t=r.current.props).onOutOfMaxBounds)||void 0===i||i.call(t,e)})),i.on("trackuserlocationstart",(function(e){var t,i;null===(i=(t=r.current.props).onTrackUserLocationStart)||void 0===i||i.call(t,e)})),i.on("trackuserlocationend",(function(e){var t,i;null===(i=(t=r.current.props).onTrackUserLocationEnd)||void 0===i||i.call(t,e)})),i}),{position:e.position});return r.current.props=e,F.exports.useImperativeHandle(t,(function(){return{trigger:function(){return i.trigger()}}}),[]),F.exports.useEffect((function(){Pe(i._container,e.style)}),[e.style]),null}));Fe.displayName="GeolocateControl",F.exports.memo(Fe);C("N",F.exports.memo((function(e){var t=Be((function(t){return new t.mapLib.NavigationControl(e)}),{position:e.position});return F.exports.useEffect((function(){Pe(t._container,e.style)}),[e.style]),null})));function Oe(e){var t=Be((function(t){return new t.mapLib.ScaleControl(e)}),{position:e.position});return t.options.unit===e.unit&&t.options.maxWidth===e.maxWidth||(t.options.maxWidth=e.maxWidth,t.setUnit(e.unit)),F.exports.useEffect((function(){Pe(t._container,e.style)}),[e.style]),null}Oe.defaultProps={unit:"metric",maxWidth:100},F.exports.memo(Oe);var Ve={exports:{}};!function(e,t){e.exports=function(){var e,t,r;function i(i,n){if(e)if(t){var a="var sharedChunk = {}; ("+e+")(sharedChunk); ("+t+")(sharedChunk);",o={};e(o),r=n(o),"undefined"!=typeof window&&(r.workerUrl=window.URL.createObjectURL(new Blob([a],{type:"text/javascript"})))}else t=n;else e=n}return i(["exports"],(function(e){var t=r;function r(e,t,r,i){this.cx=3*e,this.bx=3*(r-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(i-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=t,this.p2x=r,this.p2y=i}function i(e,r,i,n){var a=new t(e,r,i,n);return function(e){return a.solve(e)}}r.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,t){if(void 0===t&&(t=1e-6),e<0)return 0;if(e>1)return 1;for(var r=e,i=0;i<8;i++){var n=this.sampleCurveX(r)-e;if(Math.abs(n)<t)return r;var a=this.sampleCurveDerivativeX(r);if(Math.abs(a)<1e-6)break;r-=n/a}var o=0,s=1;for(r=e,i=0;i<20&&(n=this.sampleCurveX(r),!(Math.abs(n-e)<t));i++)e>n?o=r:s=r,r=.5*(s-o)+o;return r},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}};var n=i(.25,.1,.25,1);function a(e,t,r){return Math.min(r,Math.max(t,e))}function o(e,t,r){var i=r-t,n=((e-t)%i+i)%i+t;return n===t?r:n}function s(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];for(var n=0,a=r;n<a.length;n++){var o=a[n];for(var s in o)e[s]=o[s]}return e}var l=1;function u(e,t){e.forEach((function(e){t[e]&&(t[e]=t[e].bind(t))}))}function c(e,t,r){var i={};for(var n in e)i[n]=t.call(r||this,e[n],n,e);return i}function h(e,t,r){var i={};for(var n in e)t.call(r||this,e[n],n,e)&&(i[n]=e[n]);return i}function p(e){return Array.isArray(e)?e.map(p):"object"==Z(e)&&e?c(e,p):e}var f={};function d(e){f[e]||("undefined"!=typeof console&&console.warn(e),f[e]=!0)}function m(e,t,r){return(r.y-e.y)*(t.x-e.x)>(t.y-e.y)*(r.x-e.x)}function v(e){for(var t,r,i=0,n=0,a=e.length,o=a-1;n<a;o=n++)t=e[n],i+=((r=e[o]).x-t.x)*(t.y+r.y);return i}function y(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}function g(e){var t={};if(e.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(e,r,i,n){var a=i||n;return t[r]=!a||a.toLowerCase(),""})),t["max-age"]){var r=parseInt(t["max-age"],10);isNaN(r)?delete t["max-age"]:t["max-age"]=r}return t}var _,x,b=null;function w(e){if(null==b){var t=e.navigator?e.navigator.userAgent:null;b=!!e.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return b}function k(e){return"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap}var E={now:"undefined"!=typeof performance&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frame:function(e){var t=requestAnimationFrame(e);return{cancel:function(){return cancelAnimationFrame(t)}}},getImageData:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=window.document.createElement("canvas"),i=r.getContext("2d");if(!i)throw new Error("failed to create canvas 2d context");return r.width=e.width,r.height=e.height,i.drawImage(e,0,0,e.width,e.height),i.getImageData(-t,-t,e.width+2*t,e.height+2*t)},resolveURL:function(e){return _||(_=document.createElement("a")),_.href=e,_.href},hardwareConcurrency:"undefined"!=typeof navigator&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(null==x&&(x=matchMedia("(prefers-reduced-motion: reduce)")),x.matches)}},T=C;function C(e,t){this.x=e,this.y=t}C.prototype={clone:function(){return new C(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},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(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,r=e.y-this.y;return t*t+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[2]*this.x+e[3]*this.y;return this.x=e[0]*this.x+e[1]*this.y,this.y=t,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),r=Math.sin(e),i=r*this.x+t*this.y;return this.x=t*this.x-r*this.y,this.y=i,this},_rotateAround:function(e,t){var r=Math.cos(e),i=Math.sin(e),n=t.y+i*(this.x-t.x)+r*(this.y-t.y);return this.x=t.x+r*(this.x-t.x)-i*(this.y-t.y),this.y=n,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},C.convert=function(e){return e instanceof C?e:Array.isArray(e)?new C(e[0],e[1]):e};var D,B,F={MAX_PARALLEL_IMAGE_REQUESTS:16,REGISTERED_PROTOCOLS:{}},G="mapbox-tiles",X=500,H=50;function W(){"undefined"==typeof caches||D||(D=caches.open(G))}var Y,Q,$=1/0,ee={supported:!1,testSupport:function(e){!te&&Q&&(re?ie(e):Y=e)}},te=!1,re=!1;function ie(e){var t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t);try{if(e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,Q),e.isContextLost())return;ee.supported=!0}catch(e){}e.deleteTexture(t),te=!0}"undefined"!=typeof document&&((Q=document.createElement("img")).onload=function(){Y&&ie(Y),Y=null,re=!0},Q.onerror=function(){te=!0,Y=null},Q.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var ne={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(ne);var ae=function(e){A(r,e);var t=M(r);function r(e,i,n,a){var o;return j(this,r),(o=t.call(this,"AJAXError: ".concat(i," (").concat(e,"): ").concat(n))).status=e,o.statusText=i,o.url=n,o.body=a,o}return q(r)}(L(Error)),oe=y()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===window.location.protocol?window.parent:window).location.href};function se(e,t){var r=new AbortController,i=new Request(e.url,{method:e.method||"GET",body:e.body,credentials:e.credentials,headers:e.headers,referrer:oe(),signal:r.signal}),n=!1,a=!1;return"json"===e.type&&i.headers.set("Accept","application/json"),function(r,o,s){if(!a){var l=Date.now();fetch(i).then((function(r){return r.ok?function(r,o,s){("arrayBuffer"===e.type?r.arrayBuffer():"json"===e.type?r.json():r.text()).then((function(e){a||(o&&s&&function(e,t,r){if(W(),D){var i={status:t.status,statusText:t.statusText,headers:new Headers};t.headers.forEach((function(e,t){return i.headers.set(t,e)}));var n=g(t.headers.get("Cache-Control")||"");n["no-store"]||(n["max-age"]&&i.headers.set("Expires",new Date(r+1e3*n["max-age"]).toUTCString()),new Date(i.headers.get("Expires")).getTime()-r<42e4||function(e,t){if(void 0===B)try{new Response(new ReadableStream),B=!0}catch(e){B=!1}B?t(e.body):e.blob().then(t)}(t,(function(t){var r=new Response(t,i);W(),D&&D.then((function(t){return t.put(function(e){var t=e.indexOf("?");return t<0?e:e.slice(0,t)}(e.url),r)})).catch((function(e){return d(e.message)}))})))}}(i,o,s),n=!0,t(null,e,r.headers.get("Cache-Control"),r.headers.get("Expires")))})).catch((function(e){a||t(new Error(e.message))}))}(r,null,l):r.blob().then((function(i){return t(new ae(r.status,r.statusText,e.url,i))}))})).catch((function(e){20!==e.code&&t(new Error(e.message))}))}}(),{cancel:function(){a=!0,n||r.abort()}}}var le=function(e,t){if(/:\/\//.test(e.url)&&!/^https?:|^file:/.test(e.url)){if(y()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",e,t);if(!y()){var r=e.url.substring(0,e.url.indexOf("://"));return(F.REGISTERED_PROTOCOLS[r]||se)(e,t)}}if(!(/^file:/.test(i=e.url)||/^file:/.test(oe())&&!/^\w+:/.test(i))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return se(e,t);if(y()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",e,t,void 0,!0)}var i;return function(e,t){var r=new XMLHttpRequest;for(var i in r.open(e.method||"GET",e.url,!0),"arrayBuffer"===e.type&&(r.responseType="arraybuffer"),e.headers)r.setRequestHeader(i,e.headers[i]);return"json"===e.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===e.credentials,r.onerror=function(){t(new Error(r.statusText))},r.onload=function(){if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){var i=r.response;if("json"===e.type)try{i=JSON.parse(r.response)}catch(e){return t(e)}t(null,i,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else{var n=new Blob([r.response],{type:r.getResponseHeader("Content-Type")});t(new ae(r.status,r.statusText,e.url,n))}},r.send(e.body),{cancel:function(){return r.abort()}}}(e,t)},ue=function(e,t){return le(s(e,{type:"arrayBuffer"}),t)};function ce(e){var t=window.document.createElement("a");return t.href=e,t.protocol===window.document.location.protocol&&t.host===window.document.location.host}var he,pe,fe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";he=[],pe=0;var de=function e(t,r){if(ee.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),pe>=F.MAX_PARALLEL_IMAGE_REQUESTS){var i={requestParameters:t,callback:r,cancelled:!1,cancel:function(){this.cancelled=!0}};return he.push(i),i}pe++;var n=!1,a=function(){if(!n)for(n=!0,pe--;he.length&&pe<F.MAX_PARALLEL_IMAGE_REQUESTS;){var t=he.shift(),r=t.requestParameters,i=t.callback;t.cancelled||(t.cancel=e(r,i).cancel)}},o=ue(t,(function(e,t,i,n){a(),e?r(e):t&&function(e,t){"function"==typeof createImageBitmap?function(e,t){var r=new Blob([new Uint8Array(e)],{type:"image/png"});createImageBitmap(r).then((function(e){t(null,e)})).catch((function(e){t(new Error("Could not load image because of ".concat(e.message,". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.")))}))}(e,t):function(e,t){var r=new Image;r.onload=function(){t(null,r),URL.revokeObjectURL(r.src),r.onload=null,window.requestAnimationFrame((function(){r.src=fe}))},r.onerror=function(){return t(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 i=new Blob([new Uint8Array(e)],{type:"image/png"});r.src=e.byteLength?URL.createObjectURL(i):fe}(e,t)}(t,(function(e,t){null!=e?r(e):null!=t&&r(null,t,{cacheControl:i,expires:n})}))}));return{cancel:function(){o.cancel(),a()}}};function me(e,t,r){r[e]&&-1!==r[e].indexOf(t)||(r[e]=r[e]||[],r[e].push(t))}function ve(e,t,r){if(r&&r[e]){var i=r[e].indexOf(t);-1!==i&&r[e].splice(i,1)}}var ye=q((function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};j(this,e),s(this,r),this.type=t})),ge=function(e){A(r,e);var t=M(r);function r(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return j(this,r),t.call(this,"error",s({error:e},i))}return q(r)}(ye),_e=function(){function e(){j(this,e)}return q(e,[{key:"on",value:function(e,t){return this._listeners=this._listeners||{},me(e,t,this._listeners),this}},{key:"off",value:function(e,t){return ve(e,t,this._listeners),ve(e,t,this._oneTimeListeners),this}},{key:"once",value:function(e,t){return this._oneTimeListeners=this._oneTimeListeners||{},me(e,t,this._oneTimeListeners),this}},{key:"fire",value:function(e,t){"string"==typeof e&&(e=new ye(e,t||{}));var r=e.type;if(this.listens(r)){e.target=this;var i,n=K(this._listeners&&this._listeners[r]?this._listeners[r].slice():[]);try{for(n.s();!(i=n.n()).done;)i.value.call(this,e)}catch(c){n.e(c)}finally{n.f()}var a,o=K(this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[]);try{for(o.s();!(a=o.n()).done;){var l=a.value;ve(r,l,this._oneTimeListeners),l.call(this,e)}}catch(c){o.e(c)}finally{o.f()}var u=this._eventedParent;u&&(s(e,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),u.fire(e))}else e instanceof ge&&console.error(e.error);return this}},{key:"listens",value:function(e){return this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)}},{key:"setEventedParent",value:function(e,t){return this._eventedParent=e,this._eventedParentData=t,this}}]),e}(),xe={$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"},terrain:{type:"terrain"},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"},volatile:{type:"boolean",default:!1},"*":{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"},volatile:{type:"boolean",default:!1},"*":{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"},volatile:{type:"boolean",default:!1},"*":{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},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},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",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},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:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"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:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},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":{},within:{}}},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},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}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1},elevationOffset:{type:"number",default:450}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},be=q((function e(t,r,i,n){j(this,e),this.message=(t?"".concat(t,": "):"")+i,n&&(this.identifier=n),null!=r&&r.__line__&&(this.line=r.__line__)}));function we(e){var t=e.value;return t?[new be(e.key,t,"constants have been deprecated as of v8")]:[]}function ke(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];for(var n=0,a=r;n<a.length;n++){var o=a[n];for(var s in o)e[s]=o[s]}return e}function Ee(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function Te(e){if(Array.isArray(e))return e.map(Te);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){var t={};for(var r in e)t[r]=Te(e[r]);return t}return Ee(e)}var Se=function(e){A(r,e);var t=M(r);function r(e,i){var n;return j(this,r),(n=t.call(this,i)).message=i,n.key=e,n}return q(r)}(L(Error)),Ce=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];j(this,e),this.parent=t,this.bindings={};var i,n=K(r);try{for(n.s();!(i=n.n()).done;){var a=V(i.value,2),o=a[0],s=a[1];this.bindings[o]=s}}catch(l){n.e(l)}finally{n.f()}}return q(e,[{key:"concat",value:function(t){return new e(this,t)}},{key:"get",value:function(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error("".concat(e," not found in scope."))}},{key:"has",value:function(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}]),e}(),Ie={kind:"null"},ze={kind:"number"},Ae={kind:"string"},Me={kind:"boolean"},Pe={kind:"color"},De={kind:"object"},Le={kind:"value"},Re={kind:"collator"},Be={kind:"formatted"},Fe={kind:"padding"},Oe={kind:"resolvedImage"};function Ve(e,t){return{kind:"array",itemType:e,N:t}}function Ue(e){if("array"===e.kind){var t=Ue(e.itemType);return"number"==typeof e.N?"array<".concat(t,", ").concat(e.N,">"):"value"===e.itemType.kind?"array":"array<".concat(t,">")}return e.kind}var Ne=[Ie,ze,Ae,Me,Pe,Be,De,Ve(Le),Fe,Oe];function je(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!je(e.itemType,t.itemType))&&("number"!=typeof e.N||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if("value"===e.kind){var r,i=K(Ne);try{for(i.s();!(r=i.n()).done;)if(!je(r.value,t))return null}catch(n){i.e(n)}finally{i.f()}}}return"Expected ".concat(Ue(e)," but found ").concat(Ue(t)," instead.")}function Ge(e,t){return t.some((function(t){return t.kind===e.kind}))}function qe(e,t){return t.some((function(t){return"null"===t?null===e:"array"===t?Array.isArray(e):"object"===t?e&&!Array.isArray(e)&&"object"==Z(e):t===Z(e)}))}var Ze,Xe={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 He(e){return(e=Math.round(e))<0?0:e>255?255:e}function We(e){return He("%"===e[e.length-1]?parseFloat(e)/100*255:parseInt(e))}function Ke(e){return(t="%"===e[e.length-1]?parseFloat(e)/100:parseFloat(e))<0?0:t>1?1:t;var t}function Je(e,t,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?e+(t-e)*r*6:2*r<1?t:3*r<2?e+(t-e)*(2/3-r)*6:e}try{Ze={}.parseCSSColor=function(e){var t,r=e.replace(/ /g,"").toLowerCase();if(r in Xe)return Xe[r].slice();if("#"===r[0])return 4===r.length?(t=parseInt(r.substr(1),16))>=0&&t<=4095?[(3840&t)>>4|(3840&t)>>8,240&t|(240&t)>>4,15&t|(15&t)<<4,1]:null:7===r.length&&(t=parseInt(r.substr(1),16))>=0&&t<=16777215?[(16711680&t)>>16,(65280&t)>>8,255&t,1]:null;var i=r.indexOf("("),n=r.indexOf(")");if(-1!==i&&n+1===r.length){var a=r.substr(0,i),o=r.substr(i+1,n-(i+1)).split(","),s=1;switch(a){case"rgba":if(4!==o.length)return null;s=Ke(o.pop());case"rgb":return 3!==o.length?null:[We(o[0]),We(o[1]),We(o[2]),s];case"hsla":if(4!==o.length)return null;s=Ke(o.pop());case"hsl":if(3!==o.length)return null;var l=(parseFloat(o[0])%360+360)%360/360,u=Ke(o[1]),c=Ke(o[2]),h=c<=.5?c*(u+1):c+u-c*u,p=2*c-h;return[He(255*Je(p,h,l+1/3)),He(255*Je(p,h,l)),He(255*Je(p,h,l-1/3)),s];default:return null}}return null}}catch(e){}var Ye=function(){function e(t,r,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;j(this,e),this.r=t,this.g=r,this.b=i,this.a=n}return q(e,[{key:"toString",value:function(){var e=V(this.toArray(),4),t=e[0],r=e[1],i=e[2],n=e[3];return"rgba(".concat(Math.round(t),",").concat(Math.round(r),",").concat(Math.round(i),",").concat(n,")")}},{key:"toArray",value:function(){var e=this.r,t=this.g,r=this.b,i=this.a;return 0===i?[0,0,0,0]:[255*e/i,255*t/i,255*r/i,i]}}],[{key:"parse",value:function(t){if(t){if(t instanceof e)return t;if("string"==typeof t){var r=Ze(t);return r?new e(r[0]/255*r[3],r[1]/255*r[3],r[2]/255*r[3],r[3]):void 0}}}}]),e}();Ye.black=new Ye(0,0,0,1),Ye.white=new Ye(1,1,1,1),Ye.transparent=new Ye(0,0,0,0),Ye.red=new Ye(1,0,0,1);var Qe=function(){function e(t,r,i){j(this,e),this.sensitivity=t?r?"variant":"case":r?"accent":"base",this.locale=i,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}return q(e,[{key:"compare",value:function(e,t){return this.collator.compare(e,t)}},{key:"resolvedLocale",value:function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}]),e}(),$e=q((function e(t,r,i,n,a){j(this,e),this.text=t,this.image=r,this.scale=i,this.fontStack=n,this.textColor=a})),et=function(){function e(t){j(this,e),this.sections=t}return q(e,[{key:"isEmpty",value:function(){return 0===this.sections.length||!this.sections.some((function(e){return 0!==e.text.length||e.image&&0!==e.image.name.length}))}},{key:"toString",value:function(){return 0===this.sections.length?"":this.sections.map((function(e){return e.text})).join("")}}],[{key:"fromString",value:function(t){return new e([new $e(t,null,null,null,null)])}},{key:"factory",value:function(t){return t instanceof e?t:e.fromString(t)}}]),e}(),tt=function(){function e(t){j(this,e),this.values=t.slice()}return q(e,[{key:"toString",value:function(){return JSON.stringify(this.values)}}],[{key:"parse",value:function(t){if(t instanceof e)return t;if("number"==typeof t)return new e([t,t,t,t]);if(Array.isArray(t)&&!(t.length<1||t.length>4)){var r,i=K(t);try{for(i.s();!(r=i.n()).done;)if("number"!=typeof r.value)return}catch(n){i.e(n)}finally{i.f()}switch(t.length){case 1:t=[t[0],t[0],t[0],t[0]];break;case 2:t=[t[0],t[1],t[0],t[1]];break;case 3:t=[t[0],t[1],t[2],t[1]]}return new e(t)}}}]),e}(),rt=function(){function e(t){j(this,e),this.name=t.name,this.available=t.available}return q(e,[{key:"toString",value:function(){return this.name}}],[{key:"fromString",value:function(t){return t?new e({name:t,available:!1}):null}}]),e}();function it(e,t,r,i){return"number"==typeof e&&e>=0&&e<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===i||"number"==typeof i&&i>=0&&i<=1?null:"Invalid rgba value [".concat([e,t,r,i].join(", "),"]: 'a' must be between 0 and 1."):"Invalid rgba value [".concat(("number"==typeof i?[e,t,r,i]:[e,t,r]).join(", "),"]: 'r', 'g', and 'b' must be between 0 and 255.")}function nt(e){if(null===e)return!0;if("string"==typeof e)return!0;if("boolean"==typeof e)return!0;if("number"==typeof e)return!0;if(e instanceof Ye)return!0;if(e instanceof Qe)return!0;if(e instanceof et)return!0;if(e instanceof tt)return!0;if(e instanceof rt)return!0;if(Array.isArray(e)){var t,r=K(e);try{for(r.s();!(t=r.n()).done;)if(!nt(t.value))return!1}catch(n){r.e(n)}finally{r.f()}return!0}if("object"==Z(e)){for(var i in e)if(!nt(e[i]))return!1;return!0}return!1}function at(e){if(null===e)return Ie;if("string"==typeof e)return Ae;if("boolean"==typeof e)return Me;if("number"==typeof e)return ze;if(e instanceof Ye)return Pe;if(e instanceof Qe)return Re;if(e instanceof et)return Be;if(e instanceof tt)return Fe;if(e instanceof rt)return Oe;if(Array.isArray(e)){var t,r,i=e.length,n=K(e);try{for(n.s();!(r=n.n()).done;){var a=at(r.value);if(t){if(t===a)continue;t=Le;break}t=a}}catch(o){n.e(o)}finally{n.f()}return Ve(t||Le,i)}return De}function ot(e){var t=Z(e);return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof Ye||e instanceof et||e instanceof tt||e instanceof rt?e.toString():JSON.stringify(e)}var st=function(){function e(t,r){j(this,e),this.type=t,this.value=r}return q(e,[{key:"evaluate",value:function(){return this.value}},{key:"eachChild",value:function(){}},{key:"outputDefined",value:function(){return!0}}],[{key:"parse",value:function(t,r){if(2!==t.length)return r.error("'literal' expression requires exactly one argument, but found ".concat(t.length-1," instead."));if(!nt(t[1]))return r.error("invalid value");var i=t[1],n=at(i),a=r.expectedType;return"array"!==n.kind||0!==n.N||!a||"array"!==a.kind||"number"==typeof a.N&&0!==a.N||(n=a),new e(n,i)}}]),e}(),lt=function(){function e(t){j(this,e),this.name="ExpressionEvaluationError",this.message=t}return q(e,[{key:"toJSON",value:function(){return this.message}}]),e}(),ut={string:Ae,number:ze,boolean:Me,object:De},ct=function(){function e(t,r){j(this,e),this.type=t,this.args=r}return q(e,[{key:"evaluate",value:function(e){for(var t=0;t<this.args.length;t++){var r=this.args[t].evaluate(e);if(!je(this.type,at(r)))return r;if(t===this.args.length-1)throw new lt("Expected value to be of type ".concat(Ue(this.type),", but found ").concat(Ue(at(r))," instead."))}throw new Error}},{key:"eachChild",value:function(e){this.args.forEach(e)}},{key:"outputDefined",value:function(){return this.args.every((function(e){return e.outputDefined()}))}}],[{key:"parse",value:function(t,r){if(t.length<2)return r.error("Expected at least one argument.");var i,n=1,a=t[0];if("array"===a){var o,s;if(t.length>2){var l=t[1];if("string"!=typeof l||!(l in ut)||"object"===l)return r.error('The item type argument of "array" must be one of string, number, boolean',1);o=ut[l],n++}else o=Le;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return r.error('The length argument to "array" must be a positive integer literal',2);s=t[2],n++}i=Ve(o,s)}else{if(!ut[a])throw new Error("Types doesn't contain name = ".concat(a));i=ut[a]}for(var u=[];n<t.length;n++){var c=r.parse(t[n],n,Le);if(!c)return null;u.push(c)}return new e(i,u)}}]),e}(),ht={"to-boolean":Me,"to-color":Pe,"to-number":ze,"to-string":Ae},pt=function(){function e(t,r){j(this,e),this.type=t,this.args=r}return q(e,[{key:"evaluate",value:function(e){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(e));if("color"===this.type.kind){var t,r,i,n=K(this.args);try{for(n.s();!(i=n.n()).done;){if(t=i.value.evaluate(e),r=null,t instanceof Ye)return t;if("string"==typeof t){var a=e.parseColor(t);if(a)return a}else if(Array.isArray(t)&&!(r=t.length<3||t.length>4?"Invalid rbga value ".concat(JSON.stringify(t),": expected an array containing either three or four numeric values."):it(t[0],t[1],t[2],t[3])))return new Ye(t[0]/255,t[1]/255,t[2]/255,t[3])}}catch(d){n.e(d)}finally{n.f()}throw new lt(r||"Could not parse color from value '".concat("string"==typeof t?t:JSON.stringify(t),"'"))}if("padding"===this.type.kind){var o,s,l=K(this.args);try{for(l.s();!(s=l.n()).done;){o=s.value.evaluate(e);var u=tt.parse(o);if(u)return u}}catch(d){l.e(d)}finally{l.f()}throw new lt("Could not parse padding from value '".concat("string"==typeof o?o:JSON.stringify(o),"'"))}if("number"===this.type.kind){var c,h=null,p=K(this.args);try{for(p.s();!(c=p.n()).done;){if(null===(h=c.value.evaluate(e)))return 0;var f=Number(h);if(!isNaN(f))return f}}catch(d){p.e(d)}finally{p.f()}throw new lt("Could not convert ".concat(JSON.stringify(h)," to number."))}return"formatted"===this.type.kind?et.fromString(ot(this.args[0].evaluate(e))):"resolvedImage"===this.type.kind?rt.fromString(ot(this.args[0].evaluate(e))):ot(this.args[0].evaluate(e))}},{key:"eachChild",value:function(e){this.args.forEach(e)}},{key:"outputDefined",value:function(){return this.args.every((function(e){return e.outputDefined()}))}}],[{key:"parse",value:function(t,r){if(t.length<2)return r.error("Expected at least one argument.");var i=t[0];if(!ht[i])throw new Error("Can't parse ".concat(i," as it is not part of the known types"));if(("to-boolean"===i||"to-string"===i)&&2!==t.length)return r.error("Expected one argument.");for(var n=ht[i],a=[],o=1;o<t.length;o++){var s=r.parse(t[o],o,Le);if(!s)return null;a.push(s)}return new e(n,a)}}]),e}(),ft=["Unknown","Point","LineString","Polygon"],dt=function(){function e(){j(this,e),this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}return q(e,[{key:"id",value:function(){return this.feature&&"id"in this.feature?this.feature.id:null}},{key:"geometryType",value:function(){return this.feature?"number"==typeof this.feature.type?ft[this.feature.type]:this.feature.type:null}},{key:"geometry",value:function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}},{key:"canonicalID",value:function(){return this.canonical}},{key:"properties",value:function(){return this.feature&&this.feature.properties||{}}},{key:"parseColor",value:function(e){var t=this._parseColorCache[e];return t||(t=this._parseColorCache[e]=Ye.parse(e)),t}}]),e}(),mt=function(){function e(t,r,i,n){j(this,e),this.name=t,this.type=r,this._evaluate=i,this.args=n}return q(e,[{key:"evaluate",value:function(e){return this._evaluate(e,this.args)}},{key:"eachChild",value:function(e){this.args.forEach(e)}},{key:"outputDefined",value:function(){return!1}}],[{key:"parse",value:function(t,r){var i,n=t[0],a=e.definitions[n];if(!a)return r.error('Unknown expression "'.concat(n,'". If you wanted a literal array, use ["literal", [...]].'),0);var o,s=Array.isArray(a)?a[0]:a.type,l=Array.isArray(a)?[[a[1],a[2]]]:a.overloads,u=l.filter((function(e){var r=V(e,1)[0];return!Array.isArray(r)||r.length===t.length-1})),c=null,h=K(u);try{for(h.s();!(o=h.n()).done;){var p=V(o.value,2),f=p[0],d=p[1];c=new Ot(r.registry,r.path,null,r.scope);for(var m=[],v=!1,y=1;y<t.length;y++){var g=t[y],_=Array.isArray(f)?f[y-1]:f.type,x=c.parse(g,1+m.length,_);if(!x){v=!0;break}m.push(x)}if(!v)if(Array.isArray(f)&&f.length!==m.length)c.error("Expected ".concat(f.length," arguments, but found ").concat(m.length," instead."));else{for(var b=0;b<m.length;b++){var w=Array.isArray(f)?f[b]:f.type,k=m[b];c.concat(b+1).checkSubtype(w,k.type)}if(0===c.errors.length)return new e(n,s,d,m)}}}catch(z){h.e(z)}finally{h.f()}if(1===u.length)(i=r.errors).push.apply(i,I(c.errors));else{for(var E=(u.length?u:l).map((function(e){var t;return t=V(e,1)[0],Array.isArray(t)?"(".concat(t.map(Ue).join(", "),")"):"(".concat(Ue(t.type),"...)")})).join(" | "),T=[],S=1;S<t.length;S++){var C=r.parse(t[S],1+T.length);if(!C)return null;T.push(Ue(C.type))}r.error("Expected arguments of type ".concat(E,", but found (").concat(T.join(", "),") instead."))}return null}},{key:"register",value:function(t,r){for(var i in e.definitions=r,r)t[i]=e}}]),e}(),vt=function(){function e(t,r,i){j(this,e),this.type=Re,this.locale=i,this.caseSensitive=t,this.diacriticSensitive=r}return q(e,[{key:"evaluate",value:function(e){return new Qe(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}},{key:"eachChild",value:function(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}},{key:"outputDefined",value:function(){return!1}}],[{key:"parse",value:function(t,r){if(2!==t.length)return r.error("Expected one argument.");var i=t[1];if("object"!=Z(i)||Array.isArray(i))return r.error("Collator options argument must be an object.");var n=r.parse(void 0!==i["case-sensitive"]&&i["case-sensitive"],1,Me);if(!n)return null;var a=r.parse(void 0!==i["diacritic-sensitive"]&&i["diacritic-sensitive"],1,Me);if(!a)return null;var o=null;return i.locale&&!(o=r.parse(i.locale,1,Ae))?null:new e(n,a,o)}}]),e}(),yt=8192;function gt(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function _t(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function xt(e,t){var r=(180+e[0])/360,i=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e[1]*Math.PI/360)))/360,n=Math.pow(2,t.z);return[Math.round(r*n*yt),Math.round(i*n*yt)]}function bt(e,t,r){var i=e[0]-t[0],n=e[1]-t[1],a=e[0]-r[0],o=e[1]-r[1];return i*o-a*n==0&&i*a<=0&&n*o<=0}function wt(e,t){for(var r,i,n,a=!1,o=0,s=t.length;o<s;o++)for(var l=t[o],u=0,c=l.length;u<c-1;u++){if(bt(e,l[u],l[u+1]))return!1;(i=l[u])[1]>(r=e)[1]!=(n=l[u+1])[1]>r[1]&&r[0]<(n[0]-i[0])*(r[1]-i[1])/(n[1]-i[1])+i[0]&&(a=!a)}return a}function kt(e,t){for(var r=0;r<t.length;r++)if(wt(e,t[r]))return!0;return!1}function Et(e,t,r,i){var n=i[0]-r[0],a=i[1]-r[1],o=(e[0]-r[0])*a-n*(e[1]-r[1]),s=(t[0]-r[0])*a-n*(t[1]-r[1]);return o>0&&s<0||o<0&&s>0}function Tt(e,t,r){var i,n,a,o,s,l,u,c=K(r);try{for(c.s();!(i=c.n()).done;)for(var h=i.value,p=0;p<h.length-1;++p)if(0!=(l=[(s=h[p+1])[0]-(o=h[p])[0],s[1]-o[1]])[0]*(u=[(a=t)[0]-(n=e)[0],a[1]-n[1]])[1]-l[1]*u[0]&&Et(n,a,o,s)&&Et(o,s,n,a))return!0}catch(f){c.e(f)}finally{c.f()}return!1}function St(e,t){for(var r=0;r<e.length;++r)if(!wt(e[r],t))return!1;for(var i=0;i<e.length-1;++i)if(Tt(e[i],e[i+1],t))return!1;return!0}function Ct(e,t){for(var r=0;r<t.length;r++)if(St(e,t[r]))return!0;return!1}function It(e,t,r){for(var i=[],n=0;n<e.length;n++){for(var a=[],o=0;o<e[n].length;o++){var s=xt(e[n][o],r);gt(t,s),a.push(s)}i.push(a)}return i}function zt(e,t,r){for(var i=[],n=0;n<e.length;n++){var a=It(e[n],t,r);i.push(a)}return i}function At(e,t,r,i){if(e[0]<r[0]||e[0]>r[2]){var n=.5*i,a=e[0]-r[0]>n?-i:r[0]-e[0]>n?i:0;0===a&&(a=e[0]-r[2]>n?-i:r[2]-e[0]>n?i:0),e[0]+=a}gt(t,e)}function Mt(e,t,r,i){var n,a=Math.pow(2,i.z)*yt,o=[i.x*yt,i.y*yt],s=[],l=K(e);try{for(l.s();!(n=l.n()).done;){var u,c=K(n.value);try{for(c.s();!(u=c.n()).done;){var h=u.value,p=[h.x+o[0],h.y+o[1]];At(p,t,r,a),s.push(p)}}catch(f){c.e(f)}finally{c.f()}}}catch(f){l.e(f)}finally{l.f()}return s}function Pt(e,t,r,i){var n,a,o=Math.pow(2,i.z)*yt,s=[i.x*yt,i.y*yt],l=[],u=K(e);try{for(u.s();!(n=u.n()).done;){var c,h=n.value,p=[],f=K(h);try{for(f.s();!(c=f.n()).done;){var d=c.value,m=[d.x+s[0],d.y+s[1]];gt(t,m),p.push(m)}}catch(x){f.e(x)}finally{f.f()}l.push(p)}}catch(x){u.e(x)}finally{u.f()}if(t[2]-t[0]<=o/2){(a=t)[0]=a[1]=1/0,a[2]=a[3]=-1/0;var v,y=K(l);try{for(y.s();!(v=y.n()).done;){var g,_=K(v.value);try{for(_.s();!(g=_.n()).done;)At(g.value,t,r,o)}catch(x){_.e(x)}finally{_.f()}}}catch(x){y.e(x)}finally{y.f()}}return l}var Dt=function(){function e(t,r){j(this,e),this.type=Me,this.geojson=t,this.geometries=r}return q(e,[{key:"evaluate",value:function(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){var r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=e.canonicalID();if("Polygon"===t.type){var a=It(t.coordinates,i,n),o=Mt(e.geometry(),r,i,n);if(!_t(r,i))return!1;var s,l=K(o);try{for(l.s();!(s=l.n()).done;)if(!wt(s.value,a))return!1}catch(f){l.e(f)}finally{l.f()}}if("MultiPolygon"===t.type){var u=zt(t.coordinates,i,n),c=Mt(e.geometry(),r,i,n);if(!_t(r,i))return!1;var h,p=K(c);try{for(p.s();!(h=p.n()).done;)if(!kt(h.value,u))return!1}catch(f){p.e(f)}finally{p.f()}}return!0}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){var r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=e.canonicalID();if("Polygon"===t.type){var a=It(t.coordinates,i,n),o=Pt(e.geometry(),r,i,n);if(!_t(r,i))return!1;var s,l=K(o);try{for(l.s();!(s=l.n()).done;)if(!St(s.value,a))return!1}catch(f){l.e(f)}finally{l.f()}}if("MultiPolygon"===t.type){var u=zt(t.coordinates,i,n),c=Pt(e.geometry(),r,i,n);if(!_t(r,i))return!1;var h,p=K(c);try{for(p.s();!(h=p.n()).done;)if(!Ct(h.value,u))return!1}catch(f){p.e(f)}finally{p.f()}}return!0}(e,this.geometries)}return!1}},{key:"eachChild",value:function(){}},{key:"outputDefined",value:function(){return!0}}],[{key:"parse",value:function(t,r){if(2!==t.length)return r.error("'within' expression requires exactly one argument, but found ".concat(t.length-1," instead."));if(nt(t[1])){var i=t[1];if("FeatureCollection"===i.type)for(var n=0;n<i.features.length;++n){var a=i.features[n].geometry.type;if("Polygon"===a||"MultiPolygon"===a)return new e(i,i.features[n].geometry)}else if("Feature"===i.type){var o=i.geometry.type;if("Polygon"===o||"MultiPolygon"===o)return new e(i,i.geometry)}else if("Polygon"===i.type||"MultiPolygon"===i.type)return new e(i,i)}return r.error("'within' expression requires valid geojson object that contains polygon geometry type.")}}]),e}();function Lt(e){if(e instanceof mt){if("get"===e.name&&1===e.args.length)return!1;if("feature-state"===e.name)return!1;if("has"===e.name&&1===e.args.length)return!1;if("properties"===e.name||"geometry-type"===e.name||"id"===e.name)return!1;if(/^filter-/.test(e.name))return!1}if(e instanceof Dt)return!1;var t=!0;return e.eachChild((function(e){t&&!Lt(e)&&(t=!1)})),t}function Rt(e){if(e instanceof mt&&"feature-state"===e.name)return!1;var t=!0;return e.eachChild((function(e){t&&!Rt(e)&&(t=!1)})),t}function Bt(e,t){if(e instanceof mt&&t.indexOf(e.name)>=0)return!1;var r=!0;return e.eachChild((function(e){r&&!Bt(e,t)&&(r=!1)})),r}var Ft=function(){function e(t,r){j(this,e),this.type=r.type,this.name=t,this.boundExpression=r}return q(e,[{key:"evaluate",value:function(e){return this.boundExpression.evaluate(e)}},{key:"eachChild",value:function(){}},{key:"outputDefined",value:function(){return!1}}],[{key:"parse",value:function(t,r){if(2!==t.length||"string"!=typeof t[1])return r.error("'var' expression requires exactly one string literal argument.");var i=t[1];return r.scope.has(i)?new e(i,r.scope.get(i)):r.error('Unknown variable "'.concat(i,'". Make sure "').concat(i,'" has been bound in an enclosing "let" expression before using it.'),1)}}]),e}(),Ot=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new Ce,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];j(this,e),this.registry=t,this.path=r,this.key=r.map((function(e){return"[".concat(e,"]")})).join(""),this.scope=n,this.errors=a,this.expectedType=i}return q(e,[{key:"parse",value:function(e,t,r,i){var n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return t?this.concat(t,r,i)._parse(e,n):this._parse(e,n)}},{key:"_parse",value:function(e,t){function r(e,t,r){return"assert"===r?new ct(t,[e]):"coerce"===r?new pt(t,[e]):e}if(null!==e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var i=e[0];if("string"!=typeof i)return this.error("Expression name must be a string, but found ".concat(Z(i),' instead. If you wanted a literal array, use ["literal", [...]].'),0),null;var n=this.registry[i];if(n){var a=n.parse(e,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("padding"!==o.kind||"value"!==s.kind&&"number"!==s.kind&&"array"!==s.kind){if(this.checkSubtype(o,s))return null}else a=r(a,o,t.typeAnnotation||"coerce");else a=r(a,o,t.typeAnnotation||"coerce");else a=r(a,o,t.typeAnnotation||"assert")}if(!(a instanceof st)&&"resolvedImage"!==a.type.kind&&Vt(a)){var l=new dt;try{a=new st(a.type,a.evaluate(l))}catch(e){return this.error(e.message),null}}return a}return this.error('Unknown expression "'.concat(i,'". If you wanted a literal array, use ["literal", [...]].'),0)}return this.error(void 0===e?"'undefined' value invalid. Use null instead.":"object"==Z(e)?'Bare objects invalid. Use ["literal", {...}] instead.':"Expected an array, but found ".concat(Z(e)," instead."))}},{key:"concat",value:function(t,r,i){var n="number"==typeof t?this.path.concat(t):this.path,a=i?this.scope.concat(i):this.scope;return new e(this.registry,n,r||null,a,this.errors)}},{key:"error",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];var n="".concat(this.key).concat(r.map((function(e){return"[".concat(e,"]")})).join(""));this.errors.push(new Se(n,e))}},{key:"checkSubtype",value:function(e,t){var r=je(e,t);return r&&this.error(r),r}}]),e}();function Vt(e){if(e instanceof Ft)return Vt(e.boundExpression);if(e instanceof mt&&"error"===e.name)return!1;if(e instanceof vt)return!1;if(e instanceof Dt)return!1;var t=e instanceof pt||e instanceof ct,r=!0;return e.eachChild((function(e){r=t?r&&Vt(e):r&&e instanceof st})),!!r&&Lt(e)&&Bt(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Ut(e,t){for(var r,i,n=e.length-1,a=0,o=n,s=0;a<=o;)if(r=e[s=Math.floor((a+o)/2)],i=e[s+1],r<=t){if(s===n||t<i)return s;a=s+1}else{if(!(r>t))throw new lt("Input is not a number.");o=s-1}return 0}var Nt=function(){function e(t,r,i){j(this,e),this.type=t,this.input=r,this.labels=[],this.outputs=[];var n,a=K(i);try{for(a.s();!(n=a.n()).done;){var o=V(n.value,2),s=o[0],l=o[1];this.labels.push(s),this.outputs.push(l)}}catch(u){a.e(u)}finally{a.f()}}return q(e,[{key:"evaluate",value:function(e){var t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);var i=this.input.evaluate(e);if(i<=t[0])return r[0].evaluate(e);var n=t.length;return i>=t[n-1]?r[n-1].evaluate(e):r[Ut(t,i)].evaluate(e)}},{key:"eachChild",value:function(e){e(this.input);var t,r=K(this.outputs);try{for(r.s();!(t=r.n()).done;)e(t.value)}catch(i){r.e(i)}finally{r.f()}}},{key:"outputDefined",value:function(){return this.outputs.every((function(e){return e.outputDefined()}))}}],[{key:"parse",value:function(t,r){if(t.length-1<4)return r.error("Expected at least 4 arguments, but found only ".concat(t.length-1,"."));if((t.length-1)%2!=0)return r.error("Expected an even number of arguments.");var i=r.parse(t[1],1,ze);if(!i)return null;var n=[],a=null;r.expectedType&&"value"!==r.expectedType.kind&&(a=r.expectedType);for(var o=1;o<t.length;o+=2){var s=1===o?-1/0:t[o],l=t[o+1],u=o,c=o+1;if("number"!=typeof s)return r.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',u);if(n.length&&n[n.length-1][0]>=s)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',u);var h=r.parse(l,c,a);if(!h)return null;a=a||h.type,n.push([s,h])}return new e(a,i,n)}}]),e}();function jt(e,t,r){return e*(1-r)+t*r}var Gt=Object.freeze({__proto__:null,number:jt,color:function(e,t,r){return new Ye(jt(e.r,t.r,r),jt(e.g,t.g,r),jt(e.b,t.b,r),jt(e.a,t.a,r))},array:function(e,t,r){return e.map((function(e,i){return jt(e,t[i],r)}))},padding:function(e,t,r){var i=e.values,n=t.values;return new tt([jt(i[0],n[0],r),jt(i[1],n[1],r),jt(i[2],n[2],r),jt(i[3],n[3],r)])}}),qt=.95047,Zt=1.08883,Xt=4/29,Ht=6/29,Wt=3*Ht*Ht,Kt=Math.PI/180,Jt=180/Math.PI;function Yt(e){return e>.008856451679035631?Math.pow(e,1/3):e/Wt+Xt}function Qt(e){return e>Ht?e*e*e:Wt*(e-Xt)}function $t(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function er(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function tr(e){var t=er(e.r),r=er(e.g),i=er(e.b),n=Yt((.4124564*t+.3575761*r+.1804375*i)/qt),a=Yt((.2126729*t+.7151522*r+.072175*i)/1);return{l:116*a-16,a:500*(n-a),b:200*(a-Yt((.0193339*t+.119192*r+.9503041*i)/Zt)),alpha:e.a}}function rr(e){var t=(e.l+16)/116,r=isNaN(e.a)?t:t+e.a/500,i=isNaN(e.b)?t:t-e.b/200;return t=1*Qt(t),r=qt*Qt(r),i=Zt*Qt(i),new Ye($t(3.2404542*r-1.5371385*t-.4985314*i),$t(-.969266*r+1.8760108*t+.041556*i),$t(.0556434*r-.2040259*t+1.0572252*i),e.alpha)}function ir(e,t,r){var i=t-e;return e+r*(i>180||i<-180?i-360*Math.round(i/360):i)}var nr={forward:tr,reverse:rr,interpolate:function(e,t,r){return{l:jt(e.l,t.l,r),a:jt(e.a,t.a,r),b:jt(e.b,t.b,r),alpha:jt(e.alpha,t.alpha,r)}}},ar={forward:function(e){var t=tr(e),r=t.l,i=t.a,n=t.b,a=Math.atan2(n,i)*Jt;return{h:a<0?a+360:a,c:Math.sqrt(i*i+n*n),l:r,alpha:e.a}},reverse:function(e){var t=e.h*Kt,r=e.c;return rr({l:e.l,a:Math.cos(t)*r,b:Math.sin(t)*r,alpha:e.alpha})},interpolate:function(e,t,r){return{h:ir(e.h,t.h,r),c:jt(e.c,t.c,r),l:jt(e.l,t.l,r),alpha:jt(e.alpha,t.alpha,r)}}},or=Object.freeze({__proto__:null,lab:nr,hcl:ar}),sr=function(){function e(t,r,i,n,a){j(this,e),this.type=t,this.operator=r,this.interpolation=i,this.input=n,this.labels=[],this.outputs=[];var o,s=K(a);try{for(s.s();!(o=s.n()).done;){var l=V(o.value,2),u=l[0],c=l[1];this.labels.push(u),this.outputs.push(c)}}catch(h){s.e(h)}finally{s.f()}}return q(e,[{key:"evaluate",value:function(t){var r=this.labels,i=this.outputs;if(1===r.length)return i[0].evaluate(t);var n=this.input.evaluate(t);if(n<=r[0])return i[0].evaluate(t);var a=r.length;if(n>=r[a-1])return i[a-1].evaluate(t);var o=Ut(r,n),s=e.interpolationFactor(this.interpolation,n,r[o],r[o+1]),l=i[o].evaluate(t),u=i[o+1].evaluate(t);return"interpolate"===this.operator?Gt[this.type.kind.toLowerCase()](l,u,s):"interpolate-hcl"===this.operator?ar.reverse(ar.interpolate(ar.forward(l),ar.forward(u),s)):nr.reverse(nr.interpolate(nr.forward(l),nr.forward(u),s))}},{key:"eachChild",value:function(e){e(this.input);var t,r=K(this.outputs);try{for(r.s();!(t=r.n()).done;)e(t.value)}catch(i){r.e(i)}finally{r.f()}}},{key:"outputDefined",value:function(){return this.outputs.every((function(e){return e.outputDefined()}))}}],[{key:"interpolationFactor",value:function(e,r,i,n){var a=0;if("exponential"===e.name)a=lr(r,e.base,i,n);else if("linear"===e.name)a=lr(r,1,i,n);else if("cubic-bezier"===e.name){var o=e.controlPoints;a=new t(o[0],o[1],o[2],o[3]).solve(lr(r,1,i,n))}return a}},{key:"parse",value:function(t,r){var i,n=N(i=t)||z(i)||J(i)||U(),a=n[0],o=n[1],s=n[2],l=n.slice(3);if(!Array.isArray(o)||0===o.length)return r.error("Expected an interpolation type expression.",1);if("linear"===o[0])o={name:"linear"};else if("exponential"===o[0]){var u=o[1];if("number"!=typeof u)return r.error("Exponential interpolation requires a numeric base.",1,1);o={name:"exponential",base:u}}else{if("cubic-bezier"!==o[0])return r.error("Unknown interpolation type ".concat(String(o[0])),1,0);var c=o.slice(1);if(4!==c.length||c.some((function(e){return"number"!=typeof e||e<0||e>1})))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);o={name:"cubic-bezier",controlPoints:c}}if(t.length-1<4)return r.error("Expected at least 4 arguments, but found only ".concat(t.length-1,"."));if((t.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(!(s=r.parse(s,2,ze)))return null;var h=[],p=null;"interpolate-hcl"===a||"interpolate-lab"===a?p=Pe:r.expectedType&&"value"!==r.expectedType.kind&&(p=r.expectedType);for(var f=0;f<l.length;f+=2){var d=l[f],m=l[f+1],v=f+3,y=f+4;if("number"!=typeof d)return r.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',v);if(h.length&&h[h.length-1][0]>=d)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',v);var g=r.parse(m,y,p);if(!g)return null;p=p||g.type,h.push([d,g])}return"number"===p.kind||"color"===p.kind||"padding"===p.kind||"array"===p.kind&&"number"===p.itemType.kind&&"number"==typeof p.N?new e(p,a,o,s,h):r.error("Type ".concat(Ue(p)," is not interpolatable."))}}]),e}();function lr(e,t,r,i){var n=i-r,a=e-r;return 0===n?0:1===t?a/n:(Math.pow(t,a)-1)/(Math.pow(t,n)-1)}var ur=function(){function e(t,r){j(this,e),this.type=t,this.args=r}return q(e,[{key:"evaluate",value:function(e){var t,r,i=null,n=0,a=K(this.args);try{for(a.s();!(r=a.n()).done;){var o=r.value;if(n++,(i=o.evaluate(e))&&i instanceof rt&&!i.available&&(t||(t=i.name),i=null,n===this.args.length&&(i=t)),null!==i)break}}catch(s){a.e(s)}finally{a.f()}return i}},{key:"eachChild",value:function(e){this.args.forEach(e)}},{key:"outputDefined",value:function(){return this.args.every((function(e){return e.outputDefined()}))}}],[{key:"parse",value:function(t,r){if(t.length<2)return r.error("Expectected at least one argument.");var i=null,n=r.expectedType;n&&"value"!==n.kind&&(i=n);var a,o=[],s=K(t.slice(1));try{for(s.s();!(a=s.n()).done;){var l=a.value,u=r.parse(l,1+o.length,i,void 0,{typeAnnotation:"omit"});if(!u)return null;i=i||u.type,o.push(u)}}catch(h){s.e(h)}finally{s.f()}if(!i)throw new Error("No output type");var c=n&&o.some((function(e){return je(n,e.type)}));return new e(c?Le:i,o)}}]),e}(),cr=function(){function e(t,r){j(this,e),this.type=r.type,this.bindings=[].concat(t),this.result=r}return q(e,[{key:"evaluate",value:function(e){return this.result.evaluate(e)}},{key:"eachChild",value:function(e){var t,r=K(this.bindings);try{for(r.s();!(t=r.n()).done;)e(t.value[1])}catch(i){r.e(i)}finally{r.f()}e(this.result)}},{key:"outputDefined",value:function(){return this.result.outputDefined()}}],[{key:"parse",value:function(t,r){if(t.length<4)return r.error("Expected at least 3 arguments, but found ".concat(t.length-1," instead."));for(var i=[],n=1;n<t.length-1;n+=2){var a=t[n];if("string"!=typeof a)return r.error("Expected string, but found ".concat(Z(a)," instead."),n);if(/[^a-zA-Z0-9_]/.test(a))return r.error("Variable names must contain only alphanumeric characters or '_'.",n);var o=r.parse(t[n+1],n+1);if(!o)return null;i.push([a,o])}var s=r.parse(t[t.length-1],t.length-1,r.expectedType,i);return s?new e(i,s):null}}]),e}(),hr=function(){function e(t,r,i){j(this,e),this.type=t,this.index=r,this.input=i}return q(e,[{key:"evaluate",value:function(e){var t=this.index.evaluate(e),r=this.input.evaluate(e);if(t<0)throw new lt("Array index out of bounds: ".concat(t," < 0."));if(t>=r.length)throw new lt("Array index out of bounds: ".concat(t," > ").concat(r.length-1,"."));if(t!==Math.floor(t))throw new lt("Array index must be an integer, but found ".concat(t," instead."));return r[t]}},{key:"eachChild",value:function(e){e(this.index),e(this.input)}},{key:"outputDefined",value:function(){return!1}}],[{key:"parse",value:function(t,r){if(3!==t.length)return r.error("Expected 2 arguments, but found ".concat(t.length-1," instead."));var i=r.parse(t[1],1,ze),n=r.parse(t[2],2,Ve(r.expectedType||Le));return i&&n?new e(n.type.itemType,i,n):null}}]),e}(),pr=function(){function e(t,r){j(this,e),this.type=Me,this.needle=t,this.haystack=r}return q(e,[{key:"evaluate",value:function(e){var t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!r)return!1;if(!qe(t,["boolean","string","number","null"]))throw new lt("Expected first argument to be of type boolean, string, number or null, but found ".concat(Ue(at(t))," instead."));if(!qe(r,["string","array"]))throw new lt("Expected second argument to be of type array or string, but found ".concat(Ue(at(r))," instead."));return r.indexOf(t)>=0}},{key:"eachChild",value:function(e){e(this.needle),e(this.haystack)}},{key:"outputDefined",value:function(){return!0}}],[{key:"parse",value:function(t,r){if(3!==t.length)return r.error("Expected 2 arguments, but found ".concat(t.length-1," instead."));var i=r.parse(t[1],1,Le),n=r.parse(t[2],2,Le);return i&&n?Ge(i.type,[Me,Ae,ze,Ie,Le])?new e(i,n):r.error("Expected first argument to be of type boolean, string, number or null, but found ".concat(Ue(i.type)," instead")):null}}]),e}(),fr=function(){function e(t,r,i){j(this,e),this.type=ze,this.needle=t,this.haystack=r,this.fromIndex=i}return q(e,[{key:"evaluate",value:function(e){var t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!qe(t,["boolean","string","number","null"]))throw new lt("Expected first argument to be of type boolean, string, number or null, but found ".concat(Ue(at(t))," instead."));if(!qe(r,["string","array"]))throw new lt("Expected second argument to be of type array or string, but found ".concat(Ue(at(r))," instead."));if(this.fromIndex){var i=this.fromIndex.evaluate(e);return r.indexOf(t,i)}return r.indexOf(t)}},{key:"eachChild",value:function(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}},{key:"outputDefined",value:function(){return!1}}],[{key:"parse",value:function(t,r){if(t.length<=2||t.length>=5)return r.error("Expected 3 or 4 arguments, but found ".concat(t.length-1," instead."));var i=r.parse(t[1],1,Le),n=r.parse(t[2],2,Le);if(!i||!n)return null;if(!Ge(i.type,[Me,Ae,ze,Ie,Le]))return r.error("Expected first argument to be of type boolean, string, number or null, but found ".concat(Ue(i.type)," instead"));if(4===t.length){var a=r.parse(t[3],3,ze);return a?new e(i,n,a):null}return new e(i,n)}}]),e}(),dr=function(){function e(t,r,i,n,a,o){j(this,e),this.inputType=t,this.type=r,this.input=i,this.cases=n,this.outputs=a,this.otherwise=o}return q(e,[{key:"evaluate",value:function(e){var t=this.input.evaluate(e);return(at(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}},{key:"eachChild",value:function(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}},{key:"outputDefined",value:function(){return this.outputs.every((function(e){return e.outputDefined()}))&&this.otherwise.outputDefined()}}],[{key:"parse",value:function(t,r){if(t.length<5)return r.error("Expected at least 4 arguments, but found only ".concat(t.length-1,"."));if(t.length%2!=1)return r.error("Expected an even number of arguments.");var i,n;r.expectedType&&"value"!==r.expectedType.kind&&(n=r.expectedType);for(var a={},o=[],s=2;s<t.length-1;s+=2){var l=t[s],u=t[s+1];Array.isArray(l)||(l=[l]);var c=r.concat(s);if(0===l.length)return c.error("Expected at least one branch label.");var h,p=K(l);try{for(p.s();!(h=p.n()).done;){var f=h.value;if("number"!=typeof f&&"string"!=typeof f)return c.error("Branch labels must be numbers or strings.");if("number"==typeof f&&Math.abs(f)>Number.MAX_SAFE_INTEGER)return c.error("Branch labels must be integers no larger than ".concat(Number.MAX_SAFE_INTEGER,"."));if("number"==typeof f&&Math.floor(f)!==f)return c.error("Numeric branch labels must be integer values.");if(i){if(c.checkSubtype(i,at(f)))return null}else i=at(f);if(void 0!==a[String(f)])return c.error("Branch labels must be unique.");a[String(f)]=o.length}}catch(y){p.e(y)}finally{p.f()}var d=r.parse(u,s,n);if(!d)return null;n=n||d.type,o.push(d)}var m=r.parse(t[1],1,Le);if(!m)return null;var v=r.parse(t[t.length-1],t.length-1,n);return v?"value"!==m.type.kind&&r.concat(1).checkSubtype(i,m.type)?null:new e(i,n,m,a,o,v):null}}]),e}(),mr=function(){function e(t,r,i){j(this,e),this.type=t,this.branches=r,this.otherwise=i}return q(e,[{key:"evaluate",value:function(e){var t,r=K(this.branches);try{for(r.s();!(t=r.n()).done;){var i=V(t.value,2),n=i[0],a=i[1];if(n.evaluate(e))return a.evaluate(e)}}catch(o){r.e(o)}finally{r.f()}return this.otherwise.evaluate(e)}},{key:"eachChild",value:function(e){var t,r=K(this.branches);try{for(r.s();!(t=r.n()).done;){var i=V(t.value,2),n=i[0],a=i[1];e(n),e(a)}}catch(o){r.e(o)}finally{r.f()}e(this.otherwise)}},{key:"outputDefined",value:function(){return this.branches.every((function(e){var t=V(e,2);return t[0],t[1].outputDefined()}))&&this.otherwise.outputDefined()}}],[{key:"parse",value:function(t,r){if(t.length<4)return r.error("Expected at least 3 arguments, but found only ".concat(t.length-1,"."));if(t.length%2!=0)return r.error("Expected an odd number of arguments.");var i;r.expectedType&&"value"!==r.expectedType.kind&&(i=r.expectedType);for(var n=[],a=1;a<t.length-1;a+=2){var o=r.parse(t[a],a,Me);if(!o)return null;var s=r.parse(t[a+1],a+1,i);if(!s)return null;n.push([o,s]),i=i||s.type}var l=r.parse(t[t.length-1],t.length-1,i);if(!l)return null;if(!i)throw new Error("Can't infer output type");return new e(i,n,l)}}]),e}(),vr=function(){function e(t,r,i,n){j(this,e),this.type=t,this.input=r,this.beginIndex=i,this.endIndex=n}return q(e,[{key:"evaluate",value:function(e){var t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);if(!qe(t,["string","array"]))throw new lt("Expected first argument to be of type array or string, but found ".concat(Ue(at(t))," instead."));if(this.endIndex){var i=this.endIndex.evaluate(e);return t.slice(r,i)}return t.slice(r)}},{key:"eachChild",value:function(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}},{key:"outputDefined",value:function(){return!1}}],[{key:"parse",value:function(t,r){if(t.length<=2||t.length>=5)return r.error("Expected 3 or 4 arguments, but found ".concat(t.length-1," instead."));var i=r.parse(t[1],1,Le),n=r.parse(t[2],2,ze);if(!i||!n)return null;if(!Ge(i.type,[Ve(Le),Ae,Le]))return r.error("Expected first argument to be of type array or string, but found ".concat(Ue(i.type)," instead"));if(4===t.length){var a=r.parse(t[3],3,ze);return a?new e(i.type,i,n,a):null}return new e(i.type,i,n)}}]),e}();function yr(e,t){return"=="===e||"!="===e?"boolean"===t.kind||"string"===t.kind||"number"===t.kind||"null"===t.kind||"value"===t.kind:"string"===t.kind||"number"===t.kind||"value"===t.kind}function gr(e,t,r,i){return 0===i.compare(t,r)}function _r(e,t,r){var i="=="!==e&&"!="!==e;return function(){function n(e,t,r){j(this,n),this.type=Me,this.lhs=e,this.rhs=t,this.collator=r,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}return q(n,[{key:"evaluate",value:function(n){var a=this.lhs.evaluate(n),o=this.rhs.evaluate(n);if(i&&this.hasUntypedArgument){var s=at(a),l=at(o);if(s.kind!==l.kind||"string"!==s.kind&&"number"!==s.kind)throw new lt('Expected arguments for "'.concat(e,'" to be (string, string) or (number, number), but found (').concat(s.kind,", ").concat(l.kind,") instead."))}if(this.collator&&!i&&this.hasUntypedArgument){var u=at(a),c=at(o);if("string"!==u.kind||"string"!==c.kind)return t(n,a,o)}return this.collator?r(n,a,o,this.collator.evaluate(n)):t(n,a,o)}},{key:"eachChild",value:function(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)}},{key:"outputDefined",value:function(){return!0}}],[{key:"parse",value:function(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");var r=e[0],a=t.parse(e[1],1,Le);if(!a)return null;if(!yr(r,a.type))return t.concat(1).error('"'.concat(r,"\" comparisons are not supported for type '").concat(Ue(a.type),"'."));var o=t.parse(e[2],2,Le);if(!o)return null;if(!yr(r,o.type))return t.concat(2).error('"'.concat(r,"\" comparisons are not supported for type '").concat(Ue(o.type),"'."));if(a.type.kind!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return t.error("Cannot compare types '".concat(Ue(a.type),"' and '").concat(Ue(o.type),"'."));i&&("value"===a.type.kind&&"value"!==o.type.kind?a=new ct(o.type,[a]):"value"!==a.type.kind&&"value"===o.type.kind&&(o=new ct(a.type,[o])));var s=null;if(4===e.length){if("string"!==a.type.kind&&"string"!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return t.error("Cannot use collator to compare non-string types.");if(!(s=t.parse(e[3],3,Re)))return null}return new n(a,o,s)}}]),n}()}var xr=_r("==",(function(e,t,r){return t===r}),gr),br=_r("!=",(function(e,t,r){return t!==r}),(function(e,t,r,i){return!gr(0,t,r,i)})),wr=_r("<",(function(e,t,r){return t<r}),(function(e,t,r,i){return i.compare(t,r)<0})),kr=_r(">",(function(e,t,r){return t>r}),(function(e,t,r,i){return i.compare(t,r)>0})),Er=_r("<=",(function(e,t,r){return t<=r}),(function(e,t,r,i){return i.compare(t,r)<=0})),Tr=_r(">=",(function(e,t,r){return t>=r}),(function(e,t,r,i){return i.compare(t,r)>=0})),Sr=function(){function e(t,r,i,n,a){j(this,e),this.type=Ae,this.number=t,this.locale=r,this.currency=i,this.minFractionDigits=n,this.maxFractionDigits=a}return q(e,[{key:"evaluate",value:function(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}},{key:"eachChild",value:function(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}},{key:"outputDefined",value:function(){return!1}}],[{key:"parse",value:function(t,r){if(3!==t.length)return r.error("Expected two arguments.");var i=r.parse(t[1],1,ze);if(!i)return null;var n=t[2];if("object"!=Z(n)||Array.isArray(n))return r.error("NumberFormat options argument must be an object.");var a=null;if(n.locale&&!(a=r.parse(n.locale,1,Ae)))return null;var o=null;if(n.currency&&!(o=r.parse(n.currency,1,Ae)))return null;var s=null;if(n["min-fraction-digits"]&&!(s=r.parse(n["min-fraction-digits"],1,ze)))return null;var l=null;return n["max-fraction-digits"]&&!(l=r.parse(n["max-fraction-digits"],1,ze))?null:new e(i,a,o,s,l)}}]),e}(),Cr=function(){function e(t){j(this,e),this.type=Be,this.sections=t}return q(e,[{key:"evaluate",value:function(e){return new et(this.sections.map((function(t){var r=t.content.evaluate(e);return at(r)===Oe?new $e("",r,null,null,null):new $e(ot(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)})))}},{key:"eachChild",value:function(e){var t,r=K(this.sections);try{for(r.s();!(t=r.n()).done;){var i=t.value;e(i.content),i.scale&&e(i.scale),i.font&&e(i.font),i.textColor&&e(i.textColor)}}catch(n){r.e(n)}finally{r.f()}}},{key:"outputDefined",value:function(){return!1}}],[{key:"parse",value:function(t,r){if(t.length<2)return r.error("Expected at least one argument.");var i=t[1];if(!Array.isArray(i)&&"object"==Z(i))return r.error("First argument must be an image or text section.");for(var n=[],a=!1,o=1;o<=t.length-1;++o){var s=t[o];if(a&&"object"==Z(s)&&!Array.isArray(s)){a=!1;var l=null;if(s["font-scale"]&&!(l=r.parse(s["font-scale"],1,ze)))return null;var u=null;if(s["text-font"]&&!(u=r.parse(s["text-font"],1,Ve(Ae))))return null;var c=null;if(s["text-color"]&&!(c=r.parse(s["text-color"],1,Pe)))return null;var h=n[n.length-1];h.scale=l,h.font=u,h.textColor=c}else{var p=r.parse(t[o],1,Le);if(!p)return null;var f=p.type.kind;if("string"!==f&&"value"!==f&&"null"!==f&&"resolvedImage"!==f)return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");a=!0,n.push({content:p,scale:null,font:null,textColor:null})}}return new e(n)}}]),e}(),Ir=function(){function e(t){j(this,e),this.type=Oe,this.input=t}return q(e,[{key:"evaluate",value:function(e){var t=this.input.evaluate(e),r=rt.fromString(t);return r&&e.availableImages&&(r.available=e.availableImages.indexOf(t)>-1),r}},{key:"eachChild",value:function(e){e(this.input)}},{key:"outputDefined",value:function(){return!1}}],[{key:"parse",value:function(t,r){if(2!==t.length)return r.error("Expected two arguments.");var i=r.parse(t[1],1,Ae);return i?new e(i):r.error("No image name provided.")}}]),e}(),zr=function(){function e(t){j(this,e),this.type=ze,this.input=t}return q(e,[{key:"evaluate",value:function(e){var t=this.input.evaluate(e);if("string"==typeof t)return t.length;if(Array.isArray(t))return t.length;throw new lt("Expected value to be of type string or array, but found ".concat(Ue(at(t))," instead."))}},{key:"eachChild",value:function(e){e(this.input)}},{key:"outputDefined",value:function(){return!1}}],[{key:"parse",value:function(t,r){if(2!==t.length)return r.error("Expected 1 argument, but found ".concat(t.length-1," instead."));var i=r.parse(t[1],1);return i?"array"!==i.type.kind&&"string"!==i.type.kind&&"value"!==i.type.kind?r.error("Expected argument of type string or array, but found ".concat(Ue(i.type)," instead.")):new e(i):null}}]),e}(),Ar={"==":xr,"!=":br,">":kr,"<":wr,">=":Tr,"<=":Er,array:ct,at:hr,boolean:ct,case:mr,coalesce:ur,collator:vt,format:Cr,image:Ir,in:pr,"index-of":fr,interpolate:sr,"interpolate-hcl":sr,"interpolate-lab":sr,length:zr,let:cr,literal:st,match:dr,number:ct,"number-format":Sr,object:ct,slice:vr,step:Nt,string:ct,"to-boolean":pt,"to-color":pt,"to-number":pt,"to-string":pt,var:Ft,within:Dt};function Mr(e,t){var r=V(t,4),i=r[0],n=r[1],a=r[2],o=r[3];i=i.evaluate(e),n=n.evaluate(e),a=a.evaluate(e);var s=o?o.evaluate(e):1,l=it(i,n,a,s);if(l)throw new lt(l);return new Ye(i/255*s,n/255*s,a/255*s,s)}function Pr(e,t){return e in t}function Dr(e,t){var r=t[e];return void 0===r?null:r}function Lr(e){return{type:e}}function Rr(e){return{result:"success",value:e}}function Br(e){return{result:"error",value:e}}function Fr(e){return"data-driven"===e["property-type"]||"cross-faded-data-driven"===e["property-type"]}function Or(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function Vr(e){return!!e.expression&&e.expression.interpolated}function Ur(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":null===e?"null":Z(e)}function Nr(e){return"object"==Z(e)&&null!==e&&!Array.isArray(e)}function jr(e){return e}function Gr(e,t){var r,i,n,a="color"===t.type,o=e.stops&&"object"==Z(e.stops[0][0]),s=o||!(o||void 0!==e.property),l=e.type||(Vr(t)?"exponential":"interval");if(a||"padding"===t.type){var u=a?Ye.parse:tt.parse;(e=ke({},e)).stops&&(e.stops=e.stops.map((function(e){return[e[0],u(e[1])]}))),e.default=u(e.default?e.default:t.default)}if(e.colorSpace&&"rgb"!==e.colorSpace&&!or[e.colorSpace])throw new Error("Unknown color space: ".concat(e.colorSpace));if("exponential"===l)r=Hr;else if("interval"===l)r=Xr;else if("categorical"===l){r=Zr,i=Object.create(null);var c,h=K(e.stops);try{for(h.s();!(c=h.n()).done;){var p=c.value;i[p[0]]=p[1]}}catch(E){h.e(E)}finally{h.f()}n=Z(e.stops[0][0])}else{if("identity"!==l)throw new Error('Unknown function type "'.concat(l,'"'));r=Wr}if(o){for(var f={},d=[],m=0;m<e.stops.length;m++){var v=e.stops[m],y=v[0].zoom;void 0===f[y]&&(f[y]={zoom:y,type:e.type,property:e.property,default:e.default,stops:[]},d.push(y)),f[y].stops.push([v[0].value,v[1]])}for(var g=[],_=0,x=d;_<x.length;_++){var b=x[_];g.push([f[b].zoom,Gr(f[b],t)])}var w={name:"linear"};return{kind:"composite",interpolationType:w,interpolationFactor:sr.interpolationFactor.bind(void 0,w),zoomStops:g.map((function(e){return e[0]})),evaluate:function(r,i){var n=r.zoom;return Hr({stops:g,base:e.base},t,n).evaluate(n,i)}}}if(s){var k="exponential"===l?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:k,interpolationFactor:sr.interpolationFactor.bind(void 0,k),zoomStops:e.stops.map((function(e){return e[0]})),evaluate:function(a){var o=a.zoom;return r(e,t,o,i,n)}}}return{kind:"source",evaluate:function(a,o){var s=o&&o.properties?o.properties[e.property]:void 0;return void 0===s?qr(e.default,t.default):r(e,t,s,i,n)}}}function qr(e,t,r){return void 0!==e?e:void 0!==t?t:void 0!==r?r:void 0}function Zr(e,t,r,i,n){return qr(Z(r)===n?i[r]:void 0,e.default,t.default)}function Xr(e,t,r){if("number"!==Ur(r))return qr(e.default,t.default);var i=e.stops.length;if(1===i)return e.stops[0][1];if(r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[i-1][0])return e.stops[i-1][1];var n=Ut(e.stops.map((function(e){return e[0]})),r);return e.stops[n][1]}function Hr(e,t,r){var i=void 0!==e.base?e.base:1;if("number"!==Ur(r))return qr(e.default,t.default);var n=e.stops.length;if(1===n)return e.stops[0][1];if(r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[n-1][0])return e.stops[n-1][1];var a=Ut(e.stops.map((function(e){return e[0]})),r),o=function(e,t,r,i){var n=i-r,a=e-r;return 0===n?0:1===t?a/n:(Math.pow(t,a)-1)/(Math.pow(t,n)-1)}(r,i,e.stops[a][0],e.stops[a+1][0]),s=e.stops[a][1],l=e.stops[a+1][1],u=Gt[t.type]||jr;if(e.colorSpace&&"rgb"!==e.colorSpace){var c=or[e.colorSpace];u=function(e,t){return c.reverse(c.interpolate(c.forward(e),c.forward(t),o))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var i=s.evaluate.apply(void 0,t),n=l.evaluate.apply(void 0,t);if(void 0!==i&&void 0!==n)return u(i,n,o)}}:u(s,l,o)}function Wr(e,t,r){switch(t.type){case"color":r=Ye.parse(r);break;case"formatted":r=et.fromString(r.toString());break;case"resolvedImage":r=rt.fromString(r.toString());break;case"padding":r=tt.parse(r);break;default:Ur(r)===t.type||"enum"===t.type&&t.values[r]||(r=void 0)}return qr(r,e.default,t.default)}mt.register(Ar,{error:[{kind:"error"},[Ae],function(e,t){var r=V(t,1)[0];throw new lt(r.evaluate(e))}],typeof:[Ae,[Le],function(e,t){return Ue(at(V(t,1)[0].evaluate(e)))}],"to-rgba":[Ve(ze,4),[Pe],function(e,t){return V(t,1)[0].evaluate(e).toArray()}],rgb:[Pe,[ze,ze,ze],Mr],rgba:[Pe,[ze,ze,ze,ze],Mr],has:{type:Me,overloads:[[[Ae],function(e,t){return Pr(V(t,1)[0].evaluate(e),e.properties())}],[[Ae,De],function(e,t){var r=V(t,2),i=r[0],n=r[1];return Pr(i.evaluate(e),n.evaluate(e))}]]},get:{type:Le,overloads:[[[Ae],function(e,t){return Dr(V(t,1)[0].evaluate(e),e.properties())}],[[Ae,De],function(e,t){var r=V(t,2),i=r[0],n=r[1];return Dr(i.evaluate(e),n.evaluate(e))}]]},"feature-state":[Le,[Ae],function(e,t){return Dr(V(t,1)[0].evaluate(e),e.featureState||{})}],properties:[De,[],function(e){return e.properties()}],"geometry-type":[Ae,[],function(e){return e.geometryType()}],id:[Le,[],function(e){return e.id()}],zoom:[ze,[],function(e){return e.globals.zoom}],"heatmap-density":[ze,[],function(e){return e.globals.heatmapDensity||0}],"line-progress":[ze,[],function(e){return e.globals.lineProgress||0}],accumulated:[Le,[],function(e){return void 0===e.globals.accumulated?null:e.globals.accumulated}],"+":[ze,Lr(ze),function(e,t){var r,i=0,n=K(t);try{for(n.s();!(r=n.n()).done;)i+=r.value.evaluate(e)}catch(a){n.e(a)}finally{n.f()}return i}],"*":[ze,Lr(ze),function(e,t){var r,i=1,n=K(t);try{for(n.s();!(r=n.n()).done;)i*=r.value.evaluate(e)}catch(a){n.e(a)}finally{n.f()}return i}],"-":{type:ze,overloads:[[[ze,ze],function(e,t){var r=V(t,2),i=r[0],n=r[1];return i.evaluate(e)-n.evaluate(e)}],[[ze],function(e,t){return-V(t,1)[0].evaluate(e)}]]},"/":[ze,[ze,ze],function(e,t){var r=V(t,2),i=r[0],n=r[1];return i.evaluate(e)/n.evaluate(e)}],"%":[ze,[ze,ze],function(e,t){var r=V(t,2),i=r[0],n=r[1];return i.evaluate(e)%n.evaluate(e)}],ln2:[ze,[],function(){return Math.LN2}],pi:[ze,[],function(){return Math.PI}],e:[ze,[],function(){return Math.E}],"^":[ze,[ze,ze],function(e,t){var r=V(t,2),i=r[0],n=r[1];return Math.pow(i.evaluate(e),n.evaluate(e))}],sqrt:[ze,[ze],function(e,t){var r=V(t,1)[0];return Math.sqrt(r.evaluate(e))}],log10:[ze,[ze],function(e,t){var r=V(t,1)[0];return Math.log(r.evaluate(e))/Math.LN10}],ln:[ze,[ze],function(e,t){var r=V(t,1)[0];return Math.log(r.evaluate(e))}],log2:[ze,[ze],function(e,t){var r=V(t,1)[0];return Math.log(r.evaluate(e))/Math.LN2}],sin:[ze,[ze],function(e,t){var r=V(t,1)[0];return Math.sin(r.evaluate(e))}],cos:[ze,[ze],function(e,t){var r=V(t,1)[0];return Math.cos(r.evaluate(e))}],tan:[ze,[ze],function(e,t){var r=V(t,1)[0];return Math.tan(r.evaluate(e))}],asin:[ze,[ze],function(e,t){var r=V(t,1)[0];return Math.asin(r.evaluate(e))}],acos:[ze,[ze],function(e,t){var r=V(t,1)[0];return Math.acos(r.evaluate(e))}],atan:[ze,[ze],function(e,t){var r=V(t,1)[0];return Math.atan(r.evaluate(e))}],min:[ze,Lr(ze),function(e,t){return Math.min.apply(Math,I(t.map((function(t){return t.evaluate(e)}))))}],max:[ze,Lr(ze),function(e,t){return Math.max.apply(Math,I(t.map((function(t){return t.evaluate(e)}))))}],abs:[ze,[ze],function(e,t){var r=V(t,1)[0];return Math.abs(r.evaluate(e))}],round:[ze,[ze],function(e,t){var r=V(t,1)[0].evaluate(e);return r<0?-Math.round(-r):Math.round(r)}],floor:[ze,[ze],function(e,t){var r=V(t,1)[0];return Math.floor(r.evaluate(e))}],ceil:[ze,[ze],function(e,t){var r=V(t,1)[0];return Math.ceil(r.evaluate(e))}],"filter-==":[Me,[Ae,Le],function(e,t){var r=V(t,2),i=r[0],n=r[1];return e.properties()[i.value]===n.value}],"filter-id-==":[Me,[Le],function(e,t){var r=V(t,1)[0];return e.id()===r.value}],"filter-type-==":[Me,[Ae],function(e,t){var r=V(t,1)[0];return e.geometryType()===r.value}],"filter-<":[Me,[Ae,Le],function(e,t){var r=V(t,2),i=r[0],n=r[1],a=e.properties()[i.value],o=n.value;return Z(a)==Z(o)&&a<o}],"filter-id-<":[Me,[Le],function(e,t){var r=V(t,1)[0],i=e.id(),n=r.value;return Z(i)==Z(n)&&i<n}],"filter->":[Me,[Ae,Le],function(e,t){var r=V(t,2),i=r[0],n=r[1],a=e.properties()[i.value],o=n.value;return Z(a)==Z(o)&&a>o}],"filter-id->":[Me,[Le],function(e,t){var r=V(t,1)[0],i=e.id(),n=r.value;return Z(i)==Z(n)&&i>n}],"filter-<=":[Me,[Ae,Le],function(e,t){var r=V(t,2),i=r[0],n=r[1],a=e.properties()[i.value],o=n.value;return Z(a)==Z(o)&&a<=o}],"filter-id-<=":[Me,[Le],function(e,t){var r=V(t,1)[0],i=e.id(),n=r.value;return Z(i)==Z(n)&&i<=n}],"filter->=":[Me,[Ae,Le],function(e,t){var r=V(t,2),i=r[0],n=r[1],a=e.properties()[i.value],o=n.value;return Z(a)==Z(o)&&a>=o}],"filter-id->=":[Me,[Le],function(e,t){var r=V(t,1)[0],i=e.id(),n=r.value;return Z(i)==Z(n)&&i>=n}],"filter-has":[Me,[Le],function(e,t){return V(t,1)[0].value in e.properties()}],"filter-has-id":[Me,[],function(e){return null!==e.id()&&void 0!==e.id()}],"filter-type-in":[Me,[Ve(Ae)],function(e,t){return V(t,1)[0].value.indexOf(e.geometryType())>=0}],"filter-id-in":[Me,[Ve(Le)],function(e,t){return V(t,1)[0].value.indexOf(e.id())>=0}],"filter-in-small":[Me,[Ae,Ve(Le)],function(e,t){var r=V(t,2),i=r[0];return r[1].value.indexOf(e.properties()[i.value])>=0}],"filter-in-large":[Me,[Ae,Ve(Le)],function(e,t){var r=V(t,2),i=r[0],n=r[1];return function(e,t,r,i){for(;r<=i;){var n=r+i>>1;if(t[n]===e)return!0;t[n]>e?i=n-1:r=n+1}return!1}(e.properties()[i.value],n.value,0,n.value.length-1)}],all:{type:Me,overloads:[[[Me,Me],function(e,t){var r=V(t,2),i=r[0],n=r[1];return i.evaluate(e)&&n.evaluate(e)}],[Lr(Me),function(e,t){var r,i=K(t);try{for(i.s();!(r=i.n()).done;)if(!r.value.evaluate(e))return!1}catch(n){i.e(n)}finally{i.f()}return!0}]]},any:{type:Me,overloads:[[[Me,Me],function(e,t){var r=V(t,2),i=r[0],n=r[1];return i.evaluate(e)||n.evaluate(e)}],[Lr(Me),function(e,t){var r,i=K(t);try{for(i.s();!(r=i.n()).done;)if(r.value.evaluate(e))return!0}catch(n){i.e(n)}finally{i.f()}return!1}]]},"!":[Me,[Me],function(e,t){return!V(t,1)[0].evaluate(e)}],"is-supported-script":[Me,[Ae],function(e,t){var r=V(t,1)[0],i=e.globals&&e.globals.isSupportedScript;return!i||i(r.evaluate(e))}],upcase:[Ae,[Ae],function(e,t){return V(t,1)[0].evaluate(e).toUpperCase()}],downcase:[Ae,[Ae],function(e,t){return V(t,1)[0].evaluate(e).toLowerCase()}],concat:[Ae,Lr(Le),function(e,t){return t.map((function(t){return ot(t.evaluate(e))})).join("")}],"resolved-locale":[Ae,[Re],function(e,t){return V(t,1)[0].evaluate(e).resolvedLocale()}]});var Kr=function(){function e(t,r){j(this,e),this.expression=t,this._warningHistory={},this._evaluator=new dt,this._defaultValue=r?function(e){return"color"===e.type&&Nr(e.default)?new Ye(0,0,0,0):"color"===e.type?Ye.parse(e.default)||null:"padding"===e.type?tt.parse(e.default)||null:void 0===e.default?null:e.default}(r):null,this._enumValues=r&&"enum"===r.type?r.values:null}return q(e,[{key:"evaluateWithoutErrorHandling",value:function(e,t,r,i,n,a){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}},{key:"evaluate",value:function(e,t,r,i,n,a){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=i,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 lt("Expected value to be one of ".concat(Object.keys(this._enumValues).map((function(e){return JSON.stringify(e)})).join(", "),", but found ").concat(JSON.stringify(o)," instead."));return o}catch(e){return this._warningHistory[e.message]||(this._warningHistory[e.message]=!0,"undefined"!=typeof console&&console.warn(e.message)),this._defaultValue}}}]),e}();function Jr(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]&&e[0]in Ar}function Yr(e,t){var r=new Ot(Ar,[],t?function(e){var t={color:Pe,string:Ae,number:ze,enum:Ae,boolean:Me,formatted:Be,padding:Fe,resolvedImage:Oe};return"array"===e.type?Ve(t[e.value]||Le,e.length):t[e.type]}(t):void 0),i=r.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return i?Rr(new Kr(i,t)):Br(r.errors)}var Qr=function(){function e(t,r){j(this,e),this.kind=t,this._styleExpression=r,this.isStateDependent="constant"!==t&&!Rt(r.expression)}return q(e,[{key:"evaluateWithoutErrorHandling",value:function(e,t,r,i,n,a){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,i,n,a)}},{key:"evaluate",value:function(e,t,r,i,n,a){return this._styleExpression.evaluate(e,t,r,i,n,a)}}]),e}(),$r=function(){function e(t,r,i,n){j(this,e),this.kind=t,this.zoomStops=i,this._styleExpression=r,this.isStateDependent="camera"!==t&&!Rt(r.expression),this.interpolationType=n}return q(e,[{key:"evaluateWithoutErrorHandling",value:function(e,t,r,i,n,a){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,i,n,a)}},{key:"evaluate",value:function(e,t,r,i,n,a){return this._styleExpression.evaluate(e,t,r,i,n,a)}},{key:"interpolationFactor",value:function(e,t,r){return this.interpolationType?sr.interpolationFactor(this.interpolationType,e,t,r):0}}]),e}();function ei(e,t){var r=Yr(e,t);if("error"===r.result)return r;var i=r.value.expression,n=Lt(i);if(!n&&!Fr(t))return Br([new Se("","data expressions not supported")]);var a=Bt(i,["zoom"]);if(!a&&!Or(t))return Br([new Se("","zoom expressions not supported")]);var o=ri(i);return o||a?o instanceof Se?Br([o]):o instanceof sr&&!Vr(t)?Br([new Se("",'"interpolate" expressions cannot be used with this property')]):Rr(o?new $r(n?"camera":"composite",r.value,o.labels,o instanceof sr?o.interpolation:void 0):new Qr(n?"constant":"source",r.value)):Br([new Se("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}var ti=function(){function e(t,r){j(this,e),this._parameters=t,this._specification=r,ke(this,Gr(this._parameters,this._specification))}return q(e,null,[{key:"deserialize",value:function(t){return new e(t._parameters,t._specification)}},{key:"serialize",value:function(e){return{_parameters:e._parameters,_specification:e._specification}}}]),e}();function ri(e){var t=null;if(e instanceof cr)t=ri(e.result);else if(e instanceof ur){var r,i=K(e.args);try{for(i.s();!(r=i.n()).done;){var n=r.value;if(t=ri(n))break}}catch(a){i.e(a)}finally{i.f()}}else(e instanceof Nt||e instanceof sr)&&e.input instanceof mt&&"zoom"===e.input.name&&(t=e);return t instanceof Se||e.eachChild((function(e){var r=ri(e);r instanceof Se?t=r:!t&&r?t=new Se("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&r&&t!==r&&(t=new Se("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),t}function ii(e){var t=e.key,r=e.value,i=e.valueSpec||{},n=e.objectElementValidators||{},a=e.style,o=e.styleSpec,s=[],l=Ur(r);if("object"!==l)return[new be(t,r,"object expected, ".concat(l," found"))];for(var u in r){var c=u.split(".")[0],h=i[c]||i["*"],p=void 0;if(n[c])p=n[c];else if(i[c])p=Mi;else if(n["*"])p=n["*"];else{if(!i["*"]){s.push(new be(t,r[u],'unknown property "'.concat(u,'"')));continue}p=Mi}s=s.concat(p({key:(t?"".concat(t,"."):t)+u,value:r[u],valueSpec:h,style:a,styleSpec:o,object:r,objectKey:u},r))}for(var f in i)n[f]||i[f].required&&void 0===i[f].default&&void 0===r[f]&&s.push(new be(t,r,'missing required property "'.concat(f,'"')));return s}function ni(e){var t=e.value,r=e.valueSpec,i=e.style,n=e.styleSpec,a=e.key,o=e.arrayElementValidator||Mi;if("array"!==Ur(t))return[new be(a,t,"array expected, ".concat(Ur(t)," found"))];if(r.length&&t.length!==r.length)return[new be(a,t,"array length ".concat(r.length," expected, length ").concat(t.length," found"))];if(r["min-length"]&&t.length<r["min-length"])return[new be(a,t,"array length at least ".concat(r["min-length"]," expected, length ").concat(t.length," found"))];var s={type:r.value,values:r.values};n.$version<7&&(s.function=r.function),"object"===Ur(r.value)&&(s=r.value);for(var l=[],u=0;u<t.length;u++)l=l.concat(o({array:t,arrayIndex:u,value:t[u],valueSpec:s,style:i,styleSpec:n,key:"".concat(a,"[").concat(u,"]")}));return l}function ai(e){var t=e.key,r=e.value,i=e.valueSpec,n=Ur(r);return"number"===n&&r!=r&&(n="NaN"),"number"!==n?[new be(t,r,"number expected, ".concat(n," found"))]:"minimum"in i&&r<i.minimum?[new be(t,r,"".concat(r," is less than the minimum value ").concat(i.minimum))]:"maximum"in i&&r>i.maximum?[new be(t,r,"".concat(r," is greater than the maximum value ").concat(i.maximum))]:[]}function oi(e){var t,r,i,n=e.valueSpec,a=Ee(e.value.type),o={},s="categorical"!==a&&void 0===e.value.property,l=!s,u="array"===Ur(e.value.stops)&&"array"===Ur(e.value.stops[0])&&"object"===Ur(e.value.stops[0][0]),c=ii({key:e.key,value:e.value,valueSpec:e.styleSpec.function,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:function(e){if("identity"===a)return[new be(e.key,e.value,'identity function may not have a "stops" property')];var t=[],r=e.value;return t=t.concat(ni({key:e.key,value:r,valueSpec:e.valueSpec,style:e.style,styleSpec:e.styleSpec,arrayElementValidator:h})),"array"===Ur(r)&&0===r.length&&t.push(new be(e.key,r,"array must have at least one stop")),t},default:function(e){return Mi({key:e.key,value:e.value,valueSpec:n,style:e.style,styleSpec:e.styleSpec})}}});return"identity"===a&&s&&c.push(new be(e.key,e.value,'missing required property "property"')),"identity"===a||e.value.stops||c.push(new be(e.key,e.value,'missing required property "stops"')),"exponential"===a&&e.valueSpec.expression&&!Vr(e.valueSpec)&&c.push(new be(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(l&&!Fr(e.valueSpec)?c.push(new be(e.key,e.value,"property functions not supported")):s&&!Or(e.valueSpec)&&c.push(new be(e.key,e.value,"zoom functions not supported"))),"categorical"!==a&&!u||void 0!==e.value.property||c.push(new be(e.key,e.value,'"property" property is required')),c;function h(e){var t=[],a=e.value,s=e.key;if("array"!==Ur(a))return[new be(s,a,"array expected, ".concat(Ur(a)," found"))];if(2!==a.length)return[new be(s,a,"array length 2 expected, length ".concat(a.length," found"))];if(u){if("object"!==Ur(a[0]))return[new be(s,a,"object expected, ".concat(Ur(a[0])," found"))];if(void 0===a[0].zoom)return[new be(s,a,"object stop key must have zoom")];if(void 0===a[0].value)return[new be(s,a,"object stop key must have value")];if(i&&i>Ee(a[0].zoom))return[new be(s,a[0].zoom,"stop zoom values must appear in ascending order")];Ee(a[0].zoom)!==i&&(i=Ee(a[0].zoom),r=void 0,o={}),t=t.concat(ii({key:"".concat(s,"[0]"),value:a[0],valueSpec:{zoom:{}},style:e.style,styleSpec:e.styleSpec,objectElementValidators:{zoom:ai,value:p}}))}else t=t.concat(p({key:"".concat(s,"[0]"),value:a[0],valueSpec:{},style:e.style,styleSpec:e.styleSpec},a));return Jr(Te(a[1]))?t.concat([new be("".concat(s,"[1]"),a[1],"expressions are not allowed in function stops.")]):t.concat(Mi({key:"".concat(s,"[1]"),value:a[1],valueSpec:n,style:e.style,styleSpec:e.styleSpec}))}function p(e,i){var s=Ur(e.value),l=Ee(e.value),u=null!==e.value?e.value:i;if(t){if(s!==t)return[new be(e.key,u,"".concat(s," stop domain type must match previous stop domain type ").concat(t))]}else t=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new be(e.key,u,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==a){var c="number expected, ".concat(s," found");return Fr(n)&&void 0===a&&(c+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new be(e.key,u,c)]}return"categorical"!==a||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==a&&"number"===s&&void 0!==r&&l<r?[new be(e.key,u,"stop domain values must appear in ascending order")]:(r=l,"categorical"===a&&l in o?[new be(e.key,u,"stop domain values must be unique")]:(o[l]=!0,[])):[new be(e.key,u,"integer expected, found ".concat(l))]}}function si(e){var t=("property"===e.expressionContext?ei:Yr)(Te(e.value),e.valueSpec);if("error"===t.result)return t.value.map((function(t){return new be("".concat(e.key).concat(t.key),e.value,t.message)}));var r=t.value.expression||t.value._styleExpression.expression;if("property"===e.expressionContext&&"text-font"===e.propertyKey&&!r.outputDefined())return[new be(e.key,e.value,'Invalid data expression for "'.concat(e.propertyKey,'". Output values must be contained as literals within the expression.'))];if("property"===e.expressionContext&&"layout"===e.propertyType&&!Rt(r))return[new be(e.key,e.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===e.expressionContext&&!Rt(r))return[new be(e.key,e.value,'"feature-state" data expressions are not supported with filters.')];if(e.expressionContext&&0===e.expressionContext.indexOf("cluster")){if(!Bt(r,["zoom","feature-state"]))return[new be(e.key,e.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===e.expressionContext&&!Lt(r))return[new be(e.key,e.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function li(e){var t=e.key,r=e.value,i=e.valueSpec,n=[];return Array.isArray(i.values)?-1===i.values.indexOf(Ee(r))&&n.push(new be(t,r,"expected one of [".concat(i.values.join(", "),"], ").concat(JSON.stringify(r)," found"))):-1===Object.keys(i.values).indexOf(Ee(r))&&n.push(new be(t,r,"expected one of [".concat(Object.keys(i.values).join(", "),"], ").concat(JSON.stringify(r)," found"))),n}function ui(e){if(!0===e||!1===e)return!0;if(!Array.isArray(e)||0===e.length)return!1;switch(e[0]){case"has":return e.length>=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!=typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":var t,r=K(e.slice(1));try{for(r.s();!(t=r.n()).done;){var i=t.value;if(!ui(i)&&"boolean"!=typeof i)return!1}}catch(n){r.e(n)}finally{r.f()}return!0;default:return!0}}var ci={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function hi(e){if(null==e)return{filter:function(){return!0},needGeometry:!1};ui(e)||(e=di(e));var t=Yr(e,ci);if("error"===t.result)throw new Error(t.value.map((function(e){return"".concat(e.key,": ").concat(e.message)})).join(", "));return{filter:function(e,r,i){return t.value.evaluate(e,r,{},i)},needGeometry:fi(e)}}function pi(e,t){return e<t?-1:e>t?1:0}function fi(e){if(!Array.isArray(e))return!1;if("within"===e[0])return!0;for(var t=1;t<e.length;t++)if(fi(e[t]))return!0;return!1}function di(e){if(!e)return!0;var t,r=e[0];return e.length<=1?"any"!==r:"=="===r?mi(e[1],e[2],"=="):"!="===r?gi(mi(e[1],e[2],"==")):"<"===r||">"===r||"<="===r||">="===r?mi(e[1],e[2],r):"any"===r?(t=e.slice(1),["any"].concat(t.map(di))):"all"===r?["all"].concat(e.slice(1).map(di)):"none"===r?["all"].concat(e.slice(1).map(di).map(gi)):"in"===r?vi(e[1],e.slice(2)):"!in"===r?gi(vi(e[1],e.slice(2))):"has"===r?yi(e[1]):"!has"===r?gi(yi(e[1])):"within"!==r||e}function mi(e,t,r){switch(e){case"$type":return["filter-type-".concat(r),t];case"$id":return["filter-id-".concat(r),t];default:return["filter-".concat(r),e,t]}}function vi(e,t){if(0===t.length)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some((function(e){return Z(e)!=Z(t[0])}))?["filter-in-large",e,["literal",t.sort(pi)]]:["filter-in-small",e,["literal",t]]}}function yi(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function gi(e){return["!",e]}function _i(e){return ui(Te(e.value))?si(ke({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}})):xi(e)}function xi(e){var t=e.value,r=e.key;if("array"!==Ur(t))return[new be(r,t,"array expected, ".concat(Ur(t)," found"))];var i,n=e.styleSpec,a=[];if(t.length<1)return[new be(r,t,"filter array must have at least 1 element")];switch(a=a.concat(li({key:"".concat(r,"[0]"),value:t[0],valueSpec:n.filter_operator,style:e.style,styleSpec:e.styleSpec})),Ee(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&"$type"===Ee(t[1])&&a.push(new be(r,t,'"$type" cannot be use with operator "'.concat(t[0],'"')));case"==":case"!=":3!==t.length&&a.push(new be(r,t,'filter array for operator "'.concat(t[0],'" must have 3 elements')));case"in":case"!in":t.length>=2&&"string"!==(i=Ur(t[1]))&&a.push(new be("".concat(r,"[1]"),t[1],"string expected, ".concat(i," found")));for(var o=2;o<t.length;o++)i=Ur(t[o]),"$type"===Ee(t[1])?a=a.concat(li({key:"".concat(r,"[").concat(o,"]"),value:t[o],valueSpec:n.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"!==i&&"number"!==i&&"boolean"!==i&&a.push(new be("".concat(r,"[").concat(o,"]"),t[o],"string, number, or boolean expected, ".concat(i," found")));break;case"any":case"all":case"none":for(var s=1;s<t.length;s++)a=a.concat(xi({key:"".concat(r,"[").concat(s,"]"),value:t[s],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":i=Ur(t[1]),2!==t.length?a.push(new be(r,t,'filter array for "'.concat(t[0],'" operator must have 2 elements'))):"string"!==i&&a.push(new be("".concat(r,"[1]"),t[1],"string expected, ".concat(i," found")));break;case"within":i=Ur(t[1]),2!==t.length?a.push(new be(r,t,'filter array for "'.concat(t[0],'" operator must have 2 elements'))):"object"!==i&&a.push(new be("".concat(r,"[1]"),t[1],"object expected, ".concat(i," found")))}return a}function bi(e,t){var r=e.key,i=e.style,n=e.styleSpec,a=e.value,o=e.objectKey,s=n["".concat(t,"_").concat(e.layerType)];if(!s)return[];var l=o.match(/^(.*)-transition$/);if("paint"===t&&l&&s[l[1]]&&s[l[1]].transition)return Mi({key:r,value:a,valueSpec:n.transition,style:i,styleSpec:n});var u,c=e.valueSpec||s[o];if(!c)return[new be(r,a,'unknown property "'.concat(o,'"'))];if("string"===Ur(a)&&Fr(c)&&!c.tokens&&(u=/^{([^}]+)}$/.exec(a)))return[new be(r,a,'"'.concat(o,'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": ').concat(JSON.stringify(u[1])," }`."))];var h=[];return"symbol"===e.layerType&&("text-field"===o&&i&&!i.glyphs&&h.push(new be(r,a,'use of "text-field" requires a style "glyphs" property')),"text-font"===o&&Nr(Te(a))&&"identity"===Ee(a.type)&&h.push(new be(r,a,'"text-font" does not support identity functions'))),h.concat(Mi({key:e.key,value:a,valueSpec:c,style:i,styleSpec:n,expressionContext:"property",propertyType:t,propertyKey:o}))}function wi(e){return bi(e,"paint")}function ki(e){return bi(e,"layout")}function Ei(e){var t=[],r=e.value,i=e.key,n=e.style,a=e.styleSpec;r.type||r.ref||t.push(new be(i,r,'either "type" or "ref" is required'));var o,s=Ee(r.type),l=Ee(r.ref);if(r.id)for(var u=Ee(r.id),c=0;c<e.arrayIndex;c++){var h=n.layers[c];Ee(h.id)===u&&t.push(new be(i,r.id,'duplicate layer id "'.concat(r.id,'", previously used at line ').concat(h.id.__line__)))}if("ref"in r)["type","source","source-layer","filter","layout"].forEach((function(e){e in r&&t.push(new be(i,r[e],'"'.concat(e,'" is prohibited for ref layers')))})),n.layers.forEach((function(e){Ee(e.id)===l&&(o=e)})),o?o.ref?t.push(new be(i,r.ref,"ref cannot reference another ref layer")):s=Ee(o.type):t.push(new be(i,r.ref,'ref layer "'.concat(l,'" not found')));else if("background"!==s)if(r.source){var p=n.sources&&n.sources[r.source],f=p&&Ee(p.type);p?"vector"===f&&"raster"===s?t.push(new be(i,r.source,'layer "'.concat(r.id,'" requires a raster source'))):"raster"===f&&"raster"!==s?t.push(new be(i,r.source,'layer "'.concat(r.id,'" requires a vector source'))):"vector"!==f||r["source-layer"]?"raster-dem"===f&&"hillshade"!==s?t.push(new be(i,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==s||!r.paint||!r.paint["line-gradient"]||"geojson"===f&&p.lineMetrics||t.push(new be(i,r,'layer "'.concat(r.id,'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.'))):t.push(new be(i,r,'layer "'.concat(r.id,'" must specify a "source-layer"'))):t.push(new be(i,r.source,'source "'.concat(r.source,'" not found')))}else t.push(new be(i,r,'missing required property "source"'));return t=t.concat(ii({key:i,value:r,valueSpec:a.layer,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return Mi({key:"".concat(i,".type"),value:r.type,valueSpec:a.layer.type,style:e.style,styleSpec:e.styleSpec,object:r,objectKey:"type"})},filter:_i,layout:function(e){return ii({layer:r,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":function(e){return ki(ke({layerType:s},e))}}})},paint:function(e){return ii({layer:r,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":function(e){return wi(ke({layerType:s},e))}}})}}})),t}function Ti(e){var t=e.value,r=e.key,i=Ur(t);return"string"!==i?[new be(r,t,"string expected, ".concat(i," found"))]:[]}var Si={promoteId:function(e){var t=e.key,r=e.value;if("string"===Ur(r))return Ti({key:t,value:r});var i=[];for(var n in r)i.push.apply(i,I(Ti({key:"".concat(t,".").concat(n),value:r[n]})));return i}};function Ci(e){var t=e.value,r=e.key,i=e.styleSpec,n=e.style;if(!t.type)return[new be(r,t,'"type" is required')];var a,o=Ee(t.type);switch(o){case"vector":case"raster":case"raster-dem":return a=ii({key:r,value:t,valueSpec:i["source_".concat(o.replace("-","_"))],style:e.style,styleSpec:i,objectElementValidators:Si});case"geojson":if(a=ii({key:r,value:t,valueSpec:i.source_geojson,style:n,styleSpec:i,objectElementValidators:Si}),t.cluster)for(var s in t.clusterProperties){var l,u,c=V(t.clusterProperties[s],2),h=c[0],p=c[1],f="string"==typeof h?[h,["accumulated"],["get",s]]:h;(l=a).push.apply(l,I(si({key:"".concat(r,".").concat(s,".map"),value:p,expressionContext:"cluster-map"}))),(u=a).push.apply(u,I(si({key:"".concat(r,".").concat(s,".reduce"),value:f,expressionContext:"cluster-reduce"})))}return a;case"video":return ii({key:r,value:t,valueSpec:i.source_video,style:n,styleSpec:i});case"image":return ii({key:r,value:t,valueSpec:i.source_image,style:n,styleSpec:i});case"canvas":return[new be(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return li({key:"".concat(r,".type"),value:t.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:n,styleSpec:i})}}function Ii(e){var t=e.value,r=e.styleSpec,i=r.light,n=e.style,a=[],o=Ur(t);if(void 0===t)return a;if("object"!==o)return a=a.concat([new be("light",t,"object expected, ".concat(o," found"))]);for(var s in t){var l=s.match(/^(.*)-transition$/);a=a.concat(l&&i[l[1]]&&i[l[1]].transition?Mi({key:s,value:t[s],valueSpec:r.transition,style:n,styleSpec:r}):i[s]?Mi({key:s,value:t[s],valueSpec:i[s],style:n,styleSpec:r}):[new be(s,t[s],'unknown property "'.concat(s,'"'))])}return a}function zi(e){var t=e.value,r=e.styleSpec,i=r.terrain,n=e.style,a=[],o=Ur(t);if(void 0===t)return a;if("object"!==o)return a=a.concat([new be("terrain",t,"object expected, ".concat(o," found"))]);for(var s in t)a=a.concat(i[s]?Mi({key:s,value:t[s],valueSpec:i[s],style:n,styleSpec:r}):[new be(s,t[s],'unknown property "'.concat(s,'"'))]);return a}var Ai={"*":function(){return[]},array:ni,boolean:function(e){var t=e.value,r=e.key,i=Ur(t);return"boolean"!==i?[new be(r,t,"boolean expected, ".concat(i," found"))]:[]},number:ai,color:function(e){var t=e.key,r=e.value,i=Ur(r);return"string"!==i?[new be(t,r,"color expected, ".concat(i," found"))]:null===Ze(r)?[new be(t,r,'color expected, "'.concat(r,'" found'))]:[]},constants:we,enum:li,filter:_i,function:oi,layer:Ei,object:ii,source:Ci,light:Ii,terrain:zi,string:Ti,formatted:function(e){return 0===Ti(e).length?[]:si(e)},resolvedImage:function(e){return 0===Ti(e).length?[]:si(e)},padding:function(e){var t=e.key,r=e.value;if("array"===Ur(r)){if(r.length<1||r.length>4)return[new be(t,r,"padding requires 1 to 4 values; ".concat(r.length," values found"))];for(var i={type:"number"},n=[],a=0;a<r.length;a++)n=n.concat(Mi({key:"".concat(t,"[").concat(a,"]"),value:r[a],valueSpec:i}));return n}return ai({key:t,value:r,valueSpec:{}})}};function Mi(e){var t=e.value,r=e.valueSpec,i=e.styleSpec;return r.expression&&Nr(Ee(t))?oi(e):r.expression&&Jr(Te(t))?si(e):r.type&&Ai[r.type]?Ai[r.type](e):ii(ke({},e,{valueSpec:r.type?i[r.type]:r}))}function Pi(e){var t=e.value,r=e.key,i=Ti(e);return i.length||(-1===t.indexOf("{fontstack}")&&i.push(new be(r,t,'"glyphs" url must include a "{fontstack}" token')),-1===t.indexOf("{range}")&&i.push(new be(r,t,'"glyphs" url must include a "{range}" token'))),i}function Di(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:xe,r=[];return r=r.concat(Mi({key:"",value:e,valueSpec:t.$root,styleSpec:t,style:e,objectElementValidators:{glyphs:Pi,"*":function(){return[]}}})),e.constants&&(r=r.concat(we({key:"constants",value:e.constants,style:e,styleSpec:t}))),Li(r)}function Li(e){return[].concat(e).sort((function(e,t){return e.line-t.line}))}function Ri(e){return function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return Li(e.apply(this,r))}}Di.source=Ri(Ci),Di.light=Ri(Ii),Di.terrain=Ri(zi),Di.layer=Ri(Ei),Di.filter=Ri(_i),Di.paintProperty=Ri(wi),Di.layoutProperty=Ri(ki);var Bi=Di,Fi=Bi.light,Oi=Bi.paintProperty,Vi=Bi.layoutProperty;function Ui(e,t){var r=!1;if(t&&t.length){var i,n=K(t);try{for(n.s();!(i=n.n()).done;){var a=i.value;e.fire(new ge(new Error(a.message))),r=!0}}catch(o){n.e(o)}finally{n.f()}}return r}var Ni=function(){function e(t,r,i){j(this,e);var n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var a=new Int32Array(this.arrayBuffer);t=a[0],this.d=(r=a[1])+2*(i=a[2]);for(var o=0;o<this.d*this.d;o++){var s=a[3+o],l=a[3+o+1];n.push(s===l?null:a.subarray(s,l))}var u=a[3+n.length+1];this.keys=a.subarray(a[3+n.length],u),this.bboxes=a.subarray(u),this.insert=this._insertReadonly}else{this.d=r+2*i;for(var c=0;c<this.d*this.d;c++)n.push([]);this.keys=[],this.bboxes=[]}this.n=r,this.extent=t,this.padding=i,this.scale=r/t,this.uid=0;var h=i/r*t;this.min=-h,this.max=t+h}return q(e,[{key:"insert",value:function(e,t,r,i,n){this._forEachCell(t,r,i,n,this._insertCell,this.uid++,void 0,void 0),this.keys.push(e),this.bboxes.push(t),this.bboxes.push(r),this.bboxes.push(i),this.bboxes.push(n)}},{key:"_insertReadonly",value:function(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}},{key:"_insertCell",value:function(e,t,r,i,n,a){this.cells[n].push(a)}},{key:"query",value:function(e,t,r,i,n){var a=this.min,o=this.max;if(e<=a&&t<=a&&o<=r&&o<=i&&!n)return Array.prototype.slice.call(this.keys);var s=[];return this._forEachCell(e,t,r,i,this._queryCell,s,{},n),s}},{key:"_queryCell",value:function(e,t,r,i,n,a,o,s){var l=this.cells[n];if(null!==l)for(var u=this.keys,c=this.bboxes,h=0;h<l.length;h++){var p=l[h];if(void 0===o[p]){var f=4*p;(s?s(c[f+0],c[f+1],c[f+2],c[f+3]):e<=c[f+2]&&t<=c[f+3]&&r>=c[f+0]&&i>=c[f+1])?(o[p]=!0,a.push(u[p])):o[p]=!1}}}},{key:"_forEachCell",value:function(e,t,r,i,n,a,o,s){for(var l=this._convertToCellCoord(e),u=this._convertToCellCoord(t),c=this._convertToCellCoord(r),h=this._convertToCellCoord(i),p=l;p<=c;p++)for(var f=u;f<=h;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,e,t,r,i,d,a,o,s))return}}},{key:"_convertFromCellCoord",value:function(e){return(e-this.padding)/this.scale}},{key:"_convertToCellCoord",value:function(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}},{key:"toArrayBuffer",value:function(){if(this.arrayBuffer)return this.arrayBuffer;for(var e=this.cells,t=3+this.cells.length+1+1,r=0,i=0;i<this.cells.length;i++)r+=this.cells[i].length;var n=new Int32Array(t+r+this.keys.length+this.bboxes.length);n[0]=this.extent,n[1]=this.n,n[2]=this.padding;for(var a=t,o=0;o<e.length;o++){var s=e[o];n[3+o]=a,n.set(s,a),a+=s.length}return n[3+e.length]=a,n.set(this.keys,a),a+=this.keys.length,n[3+e.length+1]=a,n.set(this.bboxes,a),a+=this.bboxes.length,n.buffer}}],[{key:"serialize",value:function(e,t){var r=e.toArrayBuffer();return t&&t.push(r),{buffer:r}}},{key:"deserialize",value:function(t){return new e(t.buffer)}}]),e}(),ji={};function Gi(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(ji[e])throw new Error("".concat(e," is already registered."));Object.defineProperty(t,"_classRegistryKey",{value:e,writeable:!1}),ji[e]={klass:t,omit:r.omit||[],shallow:r.shallow||[]}}for(var qi in Gi("Object",Object),Gi("TransferableGridIndex",Ni),Gi("Color",Ye),Gi("Error",Error),Gi("AJAXError",ae),Gi("ResolvedImage",rt),Gi("StylePropertyFunction",ti),Gi("StyleExpression",Kr,{omit:["_evaluator"]}),Gi("ZoomDependentExpression",$r),Gi("ZoomConstantExpression",Qr),Gi("CompoundExpression",mt,{omit:["_evaluate"]}),Ar)Ar[qi]._classRegistryKey||Gi("Expression_".concat(qi),Ar[qi]);function Zi(e){return e&&"undefined"!=typeof ArrayBuffer&&(e instanceof ArrayBuffer||e.constructor&&"ArrayBuffer"===e.constructor.name)}function Xi(e,t){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||e instanceof Blob)return e;if(Zi(e))return t&&t.push(e),e;if(k(e))return t&&t.push(e),e;if(ArrayBuffer.isView(e)){var r=e;return t&&t.push(r.buffer),r}if(e instanceof ImageData)return t&&t.push(e.data.buffer),e;if(Array.isArray(e)){var i,n=[],a=K(e);try{for(a.s();!(i=a.n()).done;){var o=i.value;n.push(Xi(o,t))}}catch(p){a.e(p)}finally{a.f()}return n}if("object"==Z(e)){var s=e.constructor,l=s._classRegistryKey;if(!l)throw new Error("can't serialize object of unregistered class");if(!ji[l])throw new Error("".concat(l," is not registered."));var u=s.serialize?s.serialize(e,t):{};if(s.serialize){if(t&&u===t[t.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(var c in e)if(e.hasOwnProperty(c)&&!(ji[l].omit.indexOf(c)>=0)){var h=e[c];u[c]=ji[l].shallow.indexOf(c)>=0?h:Xi(h,t)}e instanceof Error&&(u.message=e.message)}if(u.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==l&&(u.$name=l),u}throw new Error("can't serialize object of type "+Z(e))}function Hi(e){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||e instanceof Blob||Zi(e)||k(e)||ArrayBuffer.isView(e)||e instanceof ImageData)return e;if(Array.isArray(e))return e.map(Hi);if("object"==Z(e)){var t=e.$name||"Object";if(!ji[t])throw new Error("can't deserialize unregistered class ".concat(t));var r=ji[t].klass;if(!r)throw new Error("can't deserialize unregistered class ".concat(t));if(r.deserialize)return r.deserialize(e);for(var i=Object.create(r.prototype),n=0,a=Object.keys(e);n<a.length;n++){var o=a[n];if("$name"!==o){var s=e[o];i[o]=ji[t].shallow.indexOf(o)>=0?s:Hi(s)}}return i}throw new Error("can't deserialize object of type "+Z(e))}var Wi=function(){function e(){j(this,e),this.first=!0}return q(e,[{key:"update",value:function(e,t){var r=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=t):this.lastFloorZoom<r&&(this.lastIntegerZoom=r,this.lastIntegerZoomTime=t),e!==this.lastZoom&&(this.lastZoom=e,this.lastFloorZoom=r,!0))}}]),e}(),Ki={"Latin-1 Supplement":function(e){return e>=128&&e<=255},Arabic:function(e){return e>=1536&&e<=1791},"Arabic Supplement":function(e){return e>=1872&&e<=1919},"Arabic Extended-A":function(e){return e>=2208&&e<=2303},"Hangul Jamo":function(e){return e>=4352&&e<=4607},"Unified Canadian Aboriginal Syllabics":function(e){return e>=5120&&e<=5759},Khmer:function(e){return e>=6016&&e<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(e){return e>=6320&&e<=6399},"General Punctuation":function(e){return e>=8192&&e<=8303},"Letterlike Symbols":function(e){return e>=8448&&e<=8527},"Number Forms":function(e){return e>=8528&&e<=8591},"Miscellaneous Technical":function(e){return e>=8960&&e<=9215},"Control Pictures":function(e){return e>=9216&&e<=9279},"Optical Character Recognition":function(e){return e>=9280&&e<=9311},"Enclosed Alphanumerics":function(e){return e>=9312&&e<=9471},"Geometric Shapes":function(e){return e>=9632&&e<=9727},"Miscellaneous Symbols":function(e){return e>=9728&&e<=9983},"Miscellaneous Symbols and Arrows":function(e){return e>=11008&&e<=11263},"CJK Radicals Supplement":function(e){return e>=11904&&e<=12031},"Kangxi Radicals":function(e){return e>=12032&&e<=12255},"Ideographic Description Characters":function(e){return e>=12272&&e<=12287},"CJK Symbols and Punctuation":function(e){return e>=12288&&e<=12351},Hiragana:function(e){return e>=12352&&e<=12447},Katakana:function(e){return e>=12448&&e<=12543},Bopomofo:function(e){return e>=12544&&e<=12591},"Hangul Compatibility Jamo":function(e){return e>=12592&&e<=12687},Kanbun:function(e){return e>=12688&&e<=12703},"Bopomofo Extended":function(e){return e>=12704&&e<=12735},"CJK Strokes":function(e){return e>=12736&&e<=12783},"Katakana Phonetic Extensions":function(e){return e>=12784&&e<=12799},"Enclosed CJK Letters and Months":function(e){return e>=12800&&e<=13055},"CJK Compatibility":function(e){return e>=13056&&e<=13311},"CJK Unified Ideographs Extension A":function(e){return e>=13312&&e<=19903},"Yijing Hexagram Symbols":function(e){return e>=19904&&e<=19967},"CJK Unified Ideographs":function(e){return e>=19968&&e<=40959},"Yi Syllables":function(e){return e>=40960&&e<=42127},"Yi Radicals":function(e){return e>=42128&&e<=42191},"Hangul Jamo Extended-A":function(e){return e>=43360&&e<=43391},"Hangul Syllables":function(e){return e>=44032&&e<=55215},"Hangul Jamo Extended-B":function(e){return e>=55216&&e<=55295},"Private Use Area":function(e){return e>=57344&&e<=63743},"CJK Compatibility Ideographs":function(e){return e>=63744&&e<=64255},"Arabic Presentation Forms-A":function(e){return e>=64336&&e<=65023},"Vertical Forms":function(e){return e>=65040&&e<=65055},"CJK Compatibility Forms":function(e){return e>=65072&&e<=65103},"Small Form Variants":function(e){return e>=65104&&e<=65135},"Arabic Presentation Forms-B":function(e){return e>=65136&&e<=65279},"Halfwidth and Fullwidth Forms":function(e){return e>=65280&&e<=65519}};function Ji(e){var t,r=K(e);try{for(r.s();!(t=r.n()).done;)if($i(t.value.charCodeAt(0)))return!0}catch(i){r.e(i)}finally{r.f()}return!1}function Yi(e){var t,r=K(e);try{for(r.s();!(t=r.n()).done;)if(!Qi(t.value.charCodeAt(0)))return!1}catch(i){r.e(i)}finally{r.f()}return!0}function Qi(e){return!(Ki.Arabic(e)||Ki["Arabic Supplement"](e)||Ki["Arabic Extended-A"](e)||Ki["Arabic Presentation Forms-A"](e)||Ki["Arabic Presentation Forms-B"](e))}function $i(e){return!(746!==e&&747!==e&&(e<4352||!(Ki["Bopomofo Extended"](e)||Ki.Bopomofo(e)||Ki["CJK Compatibility Forms"](e)&&!(e>=65097&&e<=65103)||Ki["CJK Compatibility Ideographs"](e)||Ki["CJK Compatibility"](e)||Ki["CJK Radicals Supplement"](e)||Ki["CJK Strokes"](e)||!(!Ki["CJK Symbols and Punctuation"](e)||e>=12296&&e<=12305||e>=12308&&e<=12319||12336===e)||Ki["CJK Unified Ideographs Extension A"](e)||Ki["CJK Unified Ideographs"](e)||Ki["Enclosed CJK Letters and Months"](e)||Ki["Hangul Compatibility Jamo"](e)||Ki["Hangul Jamo Extended-A"](e)||Ki["Hangul Jamo Extended-B"](e)||Ki["Hangul Jamo"](e)||Ki["Hangul Syllables"](e)||Ki.Hiragana(e)||Ki["Ideographic Description Characters"](e)||Ki.Kanbun(e)||Ki["Kangxi Radicals"](e)||Ki["Katakana Phonetic Extensions"](e)||Ki.Katakana(e)&&12540!==e||!(!Ki["Halfwidth and Fullwidth Forms"](e)||65288===e||65289===e||65293===e||e>=65306&&e<=65310||65339===e||65341===e||65343===e||e>=65371&&e<=65503||65507===e||e>=65512&&e<=65519)||!(!Ki["Small Form Variants"](e)||e>=65112&&e<=65118||e>=65123&&e<=65126)||Ki["Unified Canadian Aboriginal Syllabics"](e)||Ki["Unified Canadian Aboriginal Syllabics Extended"](e)||Ki["Vertical Forms"](e)||Ki["Yijing Hexagram Symbols"](e)||Ki["Yi Syllables"](e)||Ki["Yi Radicals"](e))))}function en(e){return!($i(e)||function(e){return!!(Ki["Latin-1 Supplement"](e)&&(167===e||169===e||174===e||177===e||188===e||189===e||190===e||215===e||247===e)||Ki["General Punctuation"](e)&&(8214===e||8224===e||8225===e||8240===e||8241===e||8251===e||8252===e||8258===e||8263===e||8264===e||8265===e||8273===e)||Ki["Letterlike Symbols"](e)||Ki["Number Forms"](e)||Ki["Miscellaneous Technical"](e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||9003===e||e>=9085&&e<=9114||e>=9150&&e<=9165||9167===e||e>=9169&&e<=9179||e>=9186&&e<=9215)||Ki["Control Pictures"](e)&&9251!==e||Ki["Optical Character Recognition"](e)||Ki["Enclosed Alphanumerics"](e)||Ki["Geometric Shapes"](e)||Ki["Miscellaneous Symbols"](e)&&!(e>=9754&&e<=9759)||Ki["Miscellaneous Symbols and Arrows"](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||Ki["CJK Symbols and Punctuation"](e)||Ki.Katakana(e)||Ki["Private Use Area"](e)||Ki["CJK Compatibility Forms"](e)||Ki["Small Form Variants"](e)||Ki["Halfwidth and Fullwidth Forms"](e)||8734===e||8756===e||8757===e||e>=9984&&e<=10087||e>=10102&&e<=10131||65532===e||65533===e)}(e))}function tn(e){return e>=1424&&e<=2303||Ki["Arabic Presentation Forms-A"](e)||Ki["Arabic Presentation Forms-B"](e)}function rn(e,t){return!(!t&&tn(e)||e>=2304&&e<=3583||e>=3840&&e<=4255||Ki.Khmer(e))}function nn(e){var t,r=K(e);try{for(r.s();!(t=r.n()).done;)if(tn(t.value.charCodeAt(0)))return!0}catch(i){r.e(i)}finally{r.f()}return!1}var an="deferred",on="loading",sn="loaded",ln=null,un="unavailable",cn=null,hn=function(e){e&&"string"==typeof e&&e.indexOf("NetworkError")>-1&&(un="error"),ln&&ln(e)};function pn(){fn.fire(new ye("pluginStateChange",{pluginStatus:un,pluginURL:cn}))}var fn=new _e,dn=function(){return un},mn=function(){if(un!==an||!cn)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");un=on,pn(),cn&&ue({url:cn},(function(e){e?hn(e):(un=sn,pn())}))},vn={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return un===sn||null!=vn.applyArabicShaping},isLoading:function(){return un===on},setState:function(e){if(!y())throw new Error("Cannot set the state of the rtl-text-plugin when not in the web-worker context");un=e.pluginStatus,cn=e.pluginURL},isParsed:function(){if(!y())throw new Error("rtl-text-plugin is only parsed on the worker-threads");return null!=vn.applyArabicShaping&&null!=vn.processBidirectionalText&&null!=vn.processStyledBidirectionalText},getPluginURL:function(){if(!y())throw new Error("rtl-text-plugin url can only be queried from the worker threads");return cn}},yn=function(){function e(t,r){j(this,e),this.zoom=t,r?(this.now=r.now,this.fadeDuration=r.fadeDuration,this.zoomHistory=r.zoomHistory,this.transition=r.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Wi,this.transition={})}return q(e,[{key:"isSupportedScript",value:function(e){return function(e,t){var r,i=K(e);try{for(i.s();!(r=i.n()).done;)if(!rn(r.value.charCodeAt(0),t))return!1}catch(n){i.e(n)}finally{i.f()}return!0}(e,vn.isLoaded())}},{key:"crossFadingFactor",value:function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}},{key:"getCrossfadeParameters",value:function(){var e=this.zoom,t=e-Math.floor(e),r=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:t+(1-t)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*t}}}]),e}(),gn=function(){function e(t,r){j(this,e),this.property=t,this.value=r,this.expression=function(e,t){if(Nr(e))return new ti(e,t);if(Jr(e)){var r=ei(e,t);if("error"===r.result)throw new Error(r.value.map((function(e){return"".concat(e.key,": ").concat(e.message)})).join(", "));return r.value}var i=e;return"color"===t.type&&"string"==typeof e?i=Ye.parse(e):"padding"!==t.type||"number"!=typeof e&&!Array.isArray(e)||(i=tt.parse(e)),{kind:"constant",evaluate:function(){return i}}}(void 0===r?t.specification.default:r,t.specification)}return q(e,[{key:"isDataDriven",value:function(){return"source"===this.expression.kind||"composite"===this.expression.kind}},{key:"possiblyEvaluate",value:function(e,t,r){return this.property.possiblyEvaluate(this,e,t,r)}}]),e}(),_n=function(){function e(t){j(this,e),this.property=t,this.value=new gn(t,void 0)}return q(e,[{key:"transitioned",value:function(e,t){return new bn(this.property,this.value,t,s({},e.transition,this.transition),e.now)}},{key:"untransitioned",value:function(){return new bn(this.property,this.value,null,{},0)}}]),e}(),xn=function(){function e(t){j(this,e),this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)}return q(e,[{key:"getValue",value:function(e){return p(this._values[e].value.value)}},{key:"setValue",value:function(e,t){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new _n(this._values[e].property)),this._values[e].value=new gn(this._values[e].property,null===t?void 0:p(t))}},{key:"getTransition",value:function(e){return p(this._values[e].transition)}},{key:"setTransition",value:function(e,t){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new _n(this._values[e].property)),this._values[e].transition=p(t)||void 0}},{key:"serialize",value:function(){for(var e={},t=0,r=Object.keys(this._values);t<r.length;t++){var i=r[t],n=this.getValue(i);void 0!==n&&(e[i]=n);var a=this.getTransition(i);void 0!==a&&(e["".concat(i,"-transition")]=a)}return e}},{key:"transitioned",value:function(e,t){for(var r=new wn(this._properties),i=0,n=Object.keys(this._values);i<n.length;i++){var a=n[i];r._values[a]=this._values[a].transitioned(e,t._values[a])}return r}},{key:"untransitioned",value:function(){for(var e=new wn(this._properties),t=0,r=Object.keys(this._values);t<r.length;t++){var i=r[t];e._values[i]=this._values[i].untransitioned()}return e}}]),e}(),bn=function(){function e(t,r,i,n,a){j(this,e),this.property=t,this.value=r,this.begin=a+n.delay||0,this.end=this.begin+n.duration||0,t.specification.transition&&(n.delay||n.duration)&&(this.prior=i)}return q(e,[{key:"possiblyEvaluate",value:function(e,t,r){var i=e.now||0,n=this.value.possiblyEvaluate(e,t,r),a=this.prior;if(a){if(i>this.end)return this.prior=null,n;if(this.value.isDataDriven())return this.prior=null,n;if(i<this.begin)return a.possiblyEvaluate(e,t,r);var o=(i-this.begin)/(this.end-this.begin);return this.property.interpolate(a.possiblyEvaluate(e,t,r),n,function(e){if(e<=0)return 0;if(e>=1)return 1;var t=e*e,r=t*e;return 4*(e<.5?r:3*(e-t)+r-.75)}(o))}return n}}]),e}(),wn=function(){function e(t){j(this,e),this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)}return q(e,[{key:"possiblyEvaluate",value:function(e,t,r){for(var i=new Tn(this._properties),n=0,a=Object.keys(this._values);n<a.length;n++){var o=a[n];i._values[o]=this._values[o].possiblyEvaluate(e,t,r)}return i}},{key:"hasTransition",value:function(){for(var e=0,t=Object.keys(this._values);e<t.length;e++){var r=t[e];if(this._values[r].prior)return!0}return!1}}]),e}(),kn=function(){function e(t){j(this,e),this._properties=t,this._values=Object.create(t.defaultPropertyValues)}return q(e,[{key:"getValue",value:function(e){return p(this._values[e].value)}},{key:"setValue",value:function(e,t){this._values[e]=new gn(this._values[e].property,null===t?void 0:p(t))}},{key:"serialize",value:function(){for(var e={},t=0,r=Object.keys(this._values);t<r.length;t++){var i=r[t],n=this.getValue(i);void 0!==n&&(e[i]=n)}return e}},{key:"possiblyEvaluate",value:function(e,t,r){for(var i=new Tn(this._properties),n=0,a=Object.keys(this._values);n<a.length;n++){var o=a[n];i._values[o]=this._values[o].possiblyEvaluate(e,t,r)}return i}}]),e}(),En=function(){function e(t,r,i){j(this,e),this.property=t,this.value=r,this.parameters=i}return q(e,[{key:"isConstant",value:function(){return"constant"===this.value.kind}},{key:"constantOr",value:function(e){return"constant"===this.value.kind?this.value.value:e}},{key:"evaluate",value:function(e,t,r,i){return this.property.evaluate(this.value,this.parameters,e,t,r,i)}}]),e}(),Tn=function(){function e(t){j(this,e),this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)}return q(e,[{key:"get",value:function(e){return this._values[e]}}]),e}(),Sn=function(){function e(t){j(this,e),this.specification=t}return q(e,[{key:"possiblyEvaluate",value:function(e,t){if(e.isDataDriven())throw new Error("Value should not be data driven");return e.expression.evaluate(t)}},{key:"interpolate",value:function(e,t,r){var i=Gt[this.specification.type];return i?i(e,t,r):e}}]),e}(),Cn=function(){function e(t,r){j(this,e),this.specification=t,this.overrides=r}return q(e,[{key:"possiblyEvaluate",value:function(e,t,r,i){return new En(this,"constant"===e.expression.kind||"camera"===e.expression.kind?{kind:"constant",value:e.expression.evaluate(t,null,{},r,i)}:e.expression,t)}},{key:"interpolate",value:function(e,t,r){if("constant"!==e.value.kind||"constant"!==t.value.kind)return e;if(void 0===e.value.value||void 0===t.value.value)return new En(this,{kind:"constant",value:void 0},e.parameters);var i=Gt[this.specification.type];return i?new En(this,{kind:"constant",value:i(e.value.value,t.value.value,r)},e.parameters):e}},{key:"evaluate",value:function(e,t,r,i,n,a){return"constant"===e.kind?e.value:e.evaluate(t,r,i,n,a)}}]),e}(),In=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"possiblyEvaluate",value:function(e,t,r,i){if(void 0===e.value)return new En(this,{kind:"constant",value:void 0},t);if("constant"===e.expression.kind){var n=e.expression.evaluate(t,null,{},r,i),a="resolvedImage"===e.property.specification.type&&"string"!=typeof n?n.name:n,o=this._calculate(a,a,a,t);return new En(this,{kind:"constant",value:o},t)}if("camera"===e.expression.kind){var s=this._calculate(e.expression.evaluate({zoom:t.zoom-1}),e.expression.evaluate({zoom:t.zoom}),e.expression.evaluate({zoom:t.zoom+1}),t);return new En(this,{kind:"constant",value:s},t)}return new En(this,e.expression,t)}},{key:"evaluate",value:function(e,t,r,i,n,a){if("source"===e.kind){var o=e.evaluate(t,r,i,n,a);return this._calculate(o,o,o,t)}return"composite"===e.kind?this._calculate(e.evaluate({zoom:Math.floor(t.zoom)-1},r,i),e.evaluate({zoom:Math.floor(t.zoom)},r,i),e.evaluate({zoom:Math.floor(t.zoom)+1},r,i),t):e.value}},{key:"_calculate",value:function(e,t,r,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}}},{key:"interpolate",value:function(e){return e}}]),r}(Cn),zn=function(){function e(t){j(this,e),this.specification=t}return q(e,[{key:"possiblyEvaluate",value:function(e,t,r,i){if(void 0!==e.value){if("constant"===e.expression.kind){var n=e.expression.evaluate(t,null,{},r,i);return this._calculate(n,n,n,t)}return this._calculate(e.expression.evaluate(new yn(Math.floor(t.zoom-1),t)),e.expression.evaluate(new yn(Math.floor(t.zoom),t)),e.expression.evaluate(new yn(Math.floor(t.zoom+1),t)),t)}}},{key:"_calculate",value:function(e,t,r,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}}},{key:"interpolate",value:function(e){return e}}]),e}(),An=function(){function e(t){j(this,e),this.specification=t}return q(e,[{key:"possiblyEvaluate",value:function(e,t,r,i){return!!e.expression.evaluate(t,null,{},r,i)}},{key:"interpolate",value:function(){return!1}}]),e}(),Mn=q((function e(t){for(var r in j(this,e),this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],t){var i=t[r];i.specification.overridable&&this.overridableProperties.push(r);var n=this.defaultPropertyValues[r]=new gn(i,void 0),a=this.defaultTransitionablePropertyValues[r]=new _n(i);this.defaultTransitioningPropertyValues[r]=a.untransitioned(),this.defaultPossiblyEvaluatedValues[r]=n.possiblyEvaluate({})}}));Gi("DataDrivenProperty",Cn),Gi("DataConstantProperty",Sn),Gi("CrossFadedDataDrivenProperty",In),Gi("CrossFadedProperty",zn),Gi("ColorRampProperty",An);var Pn="-transition",Dn=function(e){A(r,e);var t=M(r);function r(e,i){var n;if(j(this,r),(n=t.call(this)).id=e.id,n.type=e.type,n._featureFilter={filter:function(){return!0},needGeometry:!1},"custom"!==e.type&&(n.metadata=e.metadata,n.minzoom=e.minzoom,n.maxzoom=e.maxzoom,"background"!==e.type&&(n.source=e.source,n.sourceLayer=e["source-layer"],n.filter=e.filter),i.layout&&(n._unevaluatedLayout=new kn(i.layout)),i.paint)){for(var a in n._transitionablePaint=new xn(i.paint),e.paint)n.setPaintProperty(a,e.paint[a],{validate:!1});for(var o in e.layout)n.setLayoutProperty(o,e.layout[o],{validate:!1});n._transitioningPaint=n._transitionablePaint.untransitioned(),n.paint=new Tn(i.paint)}return P(n)}return q(r,[{key:"getCrossfadeParameters",value:function(){return this._crossfadeParameters}},{key:"getLayoutProperty",value:function(e){return"visibility"===e?this.visibility:this._unevaluatedLayout.getValue(e)}},{key:"setLayoutProperty",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};null!=t&&this._validate(Vi,"layers.".concat(this.id,".layout.").concat(e),e,t,r)||("visibility"!==e?this._unevaluatedLayout.setValue(e,t):this.visibility=t)}},{key:"getPaintProperty",value:function(e){return e.endsWith(Pn)?this._transitionablePaint.getTransition(e.slice(0,-Pn.length)):this._transitionablePaint.getValue(e)}},{key:"setPaintProperty",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null!=t&&this._validate(Oi,"layers.".concat(this.id,".paint.").concat(e),e,t,r))return!1;if(e.endsWith(Pn))return this._transitionablePaint.setTransition(e.slice(0,-Pn.length),t||void 0),!1;var i=this._transitionablePaint._values[e],n="cross-faded-data-driven"===i.property.specification["property-type"],a=i.value.isDataDriven(),o=i.value;this._transitionablePaint.setValue(e,t),this._handleSpecialPaintPropertyUpdate(e);var s=this._transitionablePaint._values[e].value;return s.isDataDriven()||a||n||this._handleOverridablePaintPropertyUpdate(e,o,s)}},{key:"_handleSpecialPaintPropertyUpdate",value:function(e){}},{key:"_handleOverridablePaintPropertyUpdate",value:function(e,t,r){return!1}},{key:"isHidden",value:function(e){return!!(this.minzoom&&e<this.minzoom)||!!(this.maxzoom&&e>=this.maxzoom)||"none"===this.visibility}},{key:"updateTransitions",value:function(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}},{key:"hasTransition",value:function(){return this._transitioningPaint.hasTransition()}},{key:"recalculate",value:function(e,t){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,t)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,t)}},{key:"serialize",value:function(){var e={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&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),h(e,(function(e,t){return!(void 0===e||"layout"===t&&!Object.keys(e).length||"paint"===t&&!Object.keys(e).length)}))}},{key:"_validate",value:function(e,t,r,i){var n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return(!n||!1!==n.validate)&&Ui(this,e.call(Bi,{key:t,layerType:this.type,objectKey:r,value:i,styleSpec:xe,style:{glyphs:!0,sprite:!0}}))}},{key:"is3D",value:function(){return!1}},{key:"isTileClipped",value:function(){return!1}},{key:"hasOffscreenPass",value:function(){return!1}},{key:"resize",value:function(){}},{key:"isStateDependent",value:function(){for(var e in this.paint._values){var t=this.paint.get(e);if(t instanceof En&&Fr(t.property.specification)&&("source"===t.value.kind||"composite"===t.value.kind)&&t.value.isStateDependent)return!0}return!1}}]),r}(_e),Ln={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Rn=q((function e(t,r){j(this,e),this._structArray=t,this._pos1=r*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8})),Bn=function(){function e(){j(this,e),this.isTransferred=!1,this.capacity=-1,this.resize(0)}return q(e,[{key:"_trim",value:function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}},{key:"clear",value:function(){this.length=0}},{key:"resize",value:function(e){this.reserve(e),this.length=e}},{key:"reserve",value:function(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}}},{key:"_refreshViews",value:function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}],[{key:"serialize",value:function(e,t){return e._trim(),t&&(e.isTransferred=!0,t.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}},{key:"deserialize",value:function(e){var t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t}}]),e}();function Fn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=0,i=0;return{members:e.map((function(e){var n=Ln[e.type].BYTES_PER_ELEMENT,a=r=On(r,Math.max(t,n)),o=e.components||1;return i=Math.max(i,n),r+=n*o,{name:e.name,type:e.type,components:o,offset:a}})),size:On(r,Math.max(i,t)),alignment:t}}function On(e,t){return Math.ceil(e/t)*t}var Vn=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t){var r=this.length;return this.resize(r+1),this.emplace(r,e,t)}},{key:"emplace",value:function(e,t,r){var i=2*e;return this.int16[i+0]=t,this.int16[i+1]=r,e}}]),r}(Bn);Vn.prototype.bytesPerElement=4,Gi("StructArrayLayout2i4",Vn);var Un=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t,r,i){var n=this.length;return this.resize(n+1),this.emplace(n,e,t,r,i)}},{key:"emplace",value:function(e,t,r,i,n){var a=4*e;return this.int16[a+0]=t,this.int16[a+1]=r,this.int16[a+2]=i,this.int16[a+3]=n,e}}]),r}(Bn);Un.prototype.bytesPerElement=8,Gi("StructArrayLayout4i8",Un);var Nn=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t,r,i,n,a){var o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,i,n,a)}},{key:"emplace",value:function(e,t,r,i,n,a,o){var s=6*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.int16[s+2]=i,this.int16[s+3]=n,this.int16[s+4]=a,this.int16[s+5]=o,e}}]),r}(Bn);Nn.prototype.bytesPerElement=12,Gi("StructArrayLayout2i4i12",Nn);var jn=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t,r,i,n,a){var o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,i,n,a)}},{key:"emplace",value:function(e,t,r,i,n,a,o){var s=4*e,l=8*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.uint8[l+4]=i,this.uint8[l+5]=n,this.uint8[l+6]=a,this.uint8[l+7]=o,e}}]),r}(Bn);jn.prototype.bytesPerElement=8,Gi("StructArrayLayout2i4ub8",jn);var Gn=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t){var r=this.length;return this.resize(r+1),this.emplace(r,e,t)}},{key:"emplace",value:function(e,t,r){var i=2*e;return this.float32[i+0]=t,this.float32[i+1]=r,e}}]),r}(Bn);Gn.prototype.bytesPerElement=8,Gi("StructArrayLayout2f8",Gn);var qn=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t,r,i,n,a,o,s,l,u){var c=this.length;return this.resize(c+1),this.emplace(c,e,t,r,i,n,a,o,s,l,u)}},{key:"emplace",value:function(e,t,r,i,n,a,o,s,l,u,c){var h=10*e;return this.uint16[h+0]=t,this.uint16[h+1]=r,this.uint16[h+2]=i,this.uint16[h+3]=n,this.uint16[h+4]=a,this.uint16[h+5]=o,this.uint16[h+6]=s,this.uint16[h+7]=l,this.uint16[h+8]=u,this.uint16[h+9]=c,e}}]),r}(Bn);qn.prototype.bytesPerElement=20,Gi("StructArrayLayout10ui20",qn);var Zn=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t,r,i,n,a,o,s,l,u,c,h){var p=this.length;return this.resize(p+1),this.emplace(p,e,t,r,i,n,a,o,s,l,u,c,h)}},{key:"emplace",value:function(e,t,r,i,n,a,o,s,l,u,c,h,p){var f=12*e;return this.int16[f+0]=t,this.int16[f+1]=r,this.int16[f+2]=i,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]=c,this.int16[f+10]=h,this.int16[f+11]=p,e}}]),r}(Bn);Zn.prototype.bytesPerElement=24,Gi("StructArrayLayout4i4ui4i24",Zn);var Xn=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t,r){var i=this.length;return this.resize(i+1),this.emplace(i,e,t,r)}},{key:"emplace",value:function(e,t,r,i){var n=3*e;return this.float32[n+0]=t,this.float32[n+1]=r,this.float32[n+2]=i,e}}]),r}(Bn);Xn.prototype.bytesPerElement=12,Gi("StructArrayLayout3f12",Xn);var Hn=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e){var t=this.length;return this.resize(t+1),this.emplace(t,e)}},{key:"emplace",value:function(e,t){return this.uint32[1*e+0]=t,e}}]),r}(Bn);Hn.prototype.bytesPerElement=4,Gi("StructArrayLayout1ul4",Hn);var Wn=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"_refreshViews",value: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)}},{key:"emplaceBack",value:function(e,t,r,i,n,a,o,s,l){var u=this.length;return this.resize(u+1),this.emplace(u,e,t,r,i,n,a,o,s,l)}},{key:"emplace",value:function(e,t,r,i,n,a,o,s,l,u){var c=10*e,h=5*e;return this.int16[c+0]=t,this.int16[c+1]=r,this.int16[c+2]=i,this.int16[c+3]=n,this.int16[c+4]=a,this.int16[c+5]=o,this.uint32[h+3]=s,this.uint16[c+8]=l,this.uint16[c+9]=u,e}}]),r}(Bn);Wn.prototype.bytesPerElement=20,Gi("StructArrayLayout6i1ul2ui20",Wn);var Kn=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t,r,i,n,a){var o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,i,n,a)}},{key:"emplace",value:function(e,t,r,i,n,a,o){var s=6*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.int16[s+2]=i,this.int16[s+3]=n,this.int16[s+4]=a,this.int16[s+5]=o,e}}]),r}(Bn);Kn.prototype.bytesPerElement=12,Gi("StructArrayLayout2i2i2i12",Kn);var Jn=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t,r,i,n){var a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,i,n)}},{key:"emplace",value:function(e,t,r,i,n,a){var o=4*e,s=8*e;return this.float32[o+0]=t,this.float32[o+1]=r,this.float32[o+2]=i,this.int16[s+6]=n,this.int16[s+7]=a,e}}]),r}(Bn);Jn.prototype.bytesPerElement=16,Gi("StructArrayLayout2f1f2i16",Jn);var Yn=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t,r,i){var n=this.length;return this.resize(n+1),this.emplace(n,e,t,r,i)}},{key:"emplace",value:function(e,t,r,i,n){var a=12*e,o=3*e;return this.uint8[a+0]=t,this.uint8[a+1]=r,this.float32[o+1]=i,this.float32[o+2]=n,e}}]),r}(Bn);Yn.prototype.bytesPerElement=12,Gi("StructArrayLayout2ub2f12",Yn);var Qn=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t,r){var i=this.length;return this.resize(i+1),this.emplace(i,e,t,r)}},{key:"emplace",value:function(e,t,r,i){var n=3*e;return this.uint16[n+0]=t,this.uint16[n+1]=r,this.uint16[n+2]=i,e}}]),r}(Bn);Qn.prototype.bytesPerElement=6,Gi("StructArrayLayout3ui6",Qn);var $n=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"_refreshViews",value: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)}},{key:"emplaceBack",value:function(e,t,r,i,n,a,o,s,l,u,c,h,p,f,d,m,v){var y=this.length;return this.resize(y+1),this.emplace(y,e,t,r,i,n,a,o,s,l,u,c,h,p,f,d,m,v)}},{key:"emplace",value:function(e,t,r,i,n,a,o,s,l,u,c,h,p,f,d,m,v,y){var g=24*e,_=12*e,x=48*e;return this.int16[g+0]=t,this.int16[g+1]=r,this.uint16[g+2]=i,this.uint16[g+3]=n,this.uint32[_+2]=a,this.uint32[_+3]=o,this.uint32[_+4]=s,this.uint16[g+10]=l,this.uint16[g+11]=u,this.uint16[g+12]=c,this.float32[_+7]=h,this.float32[_+8]=p,this.uint8[x+36]=f,this.uint8[x+37]=d,this.uint8[x+38]=m,this.uint32[_+10]=v,this.int16[g+22]=y,e}}]),r}(Bn);$n.prototype.bytesPerElement=48,Gi("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",$n);var ea=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"_refreshViews",value: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)}},{key:"emplaceBack",value:function(e,t,r,i,n,a,o,s,l,u,c,h,p,f,d,m,v,y,g,_,x,b,w,k,E,T,S,C){var I=this.length;return this.resize(I+1),this.emplace(I,e,t,r,i,n,a,o,s,l,u,c,h,p,f,d,m,v,y,g,_,x,b,w,k,E,T,S,C)}},{key:"emplace",value:function(e,t,r,i,n,a,o,s,l,u,c,h,p,f,d,m,v,y,g,_,x,b,w,k,E,T,S,C,I){var z=34*e,A=17*e;return this.int16[z+0]=t,this.int16[z+1]=r,this.int16[z+2]=i,this.int16[z+3]=n,this.int16[z+4]=a,this.int16[z+5]=o,this.int16[z+6]=s,this.int16[z+7]=l,this.uint16[z+8]=u,this.uint16[z+9]=c,this.uint16[z+10]=h,this.uint16[z+11]=p,this.uint16[z+12]=f,this.uint16[z+13]=d,this.uint16[z+14]=m,this.uint16[z+15]=v,this.uint16[z+16]=y,this.uint16[z+17]=g,this.uint16[z+18]=_,this.uint16[z+19]=x,this.uint16[z+20]=b,this.uint16[z+21]=w,this.uint16[z+22]=k,this.uint32[A+12]=E,this.float32[A+13]=T,this.float32[A+14]=S,this.float32[A+15]=C,this.float32[A+16]=I,e}}]),r}(Bn);ea.prototype.bytesPerElement=68,Gi("StructArrayLayout8i15ui1ul4f68",ea);var ta=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e){var t=this.length;return this.resize(t+1),this.emplace(t,e)}},{key:"emplace",value:function(e,t){return this.float32[1*e+0]=t,e}}]),r}(Bn);ta.prototype.bytesPerElement=4,Gi("StructArrayLayout1f4",ta);var ra=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t,r){var i=this.length;return this.resize(i+1),this.emplace(i,e,t,r)}},{key:"emplace",value:function(e,t,r,i){var n=3*e;return this.int16[n+0]=t,this.int16[n+1]=r,this.int16[n+2]=i,e}}]),r}(Bn);ra.prototype.bytesPerElement=6,Gi("StructArrayLayout3i6",ra);var ia=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t,r){var i=this.length;return this.resize(i+1),this.emplace(i,e,t,r)}},{key:"emplace",value:function(e,t,r,i){var n=4*e;return this.uint32[2*e+0]=t,this.uint16[n+2]=r,this.uint16[n+3]=i,e}}]),r}(Bn);ia.prototype.bytesPerElement=8,Gi("StructArrayLayout1ul2ui8",ia);var na=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t){var r=this.length;return this.resize(r+1),this.emplace(r,e,t)}},{key:"emplace",value:function(e,t,r){var i=2*e;return this.uint16[i+0]=t,this.uint16[i+1]=r,e}}]),r}(Bn);na.prototype.bytesPerElement=4,Gi("StructArrayLayout2ui4",na);var aa=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e){var t=this.length;return this.resize(t+1),this.emplace(t,e)}},{key:"emplace",value:function(e,t){return this.uint16[1*e+0]=t,e}}]),r}(Bn);aa.prototype.bytesPerElement=2,Gi("StructArrayLayout1ui2",aa);var oa=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t,r,i){var n=this.length;return this.resize(n+1),this.emplace(n,e,t,r,i)}},{key:"emplace",value:function(e,t,r,i,n){var a=4*e;return this.float32[a+0]=t,this.float32[a+1]=r,this.float32[a+2]=i,this.float32[a+3]=n,e}}]),r}(Bn);oa.prototype.bytesPerElement=16,Gi("StructArrayLayout4f16",oa);var sa=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"anchorPointX",get:function(){return this._structArray.int16[this._pos2+0]}},{key:"anchorPointY",get:function(){return this._structArray.int16[this._pos2+1]}},{key:"x1",get:function(){return this._structArray.int16[this._pos2+2]}},{key:"y1",get:function(){return this._structArray.int16[this._pos2+3]}},{key:"x2",get:function(){return this._structArray.int16[this._pos2+4]}},{key:"y2",get:function(){return this._structArray.int16[this._pos2+5]}},{key:"featureIndex",get:function(){return this._structArray.uint32[this._pos4+3]}},{key:"sourceLayerIndex",get:function(){return this._structArray.uint16[this._pos2+8]}},{key:"bucketIndex",get:function(){return this._structArray.uint16[this._pos2+9]}},{key:"anchorPoint",get:function(){return new T(this.anchorPointX,this.anchorPointY)}}]),r}(Rn);sa.prototype.size=20;var la=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"get",value:function(e){return new sa(this,e)}}]),r}(Wn);Gi("CollisionBoxArray",la);var ua=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"anchorX",get:function(){return this._structArray.int16[this._pos2+0]}},{key:"anchorY",get:function(){return this._structArray.int16[this._pos2+1]}},{key:"glyphStartIndex",get:function(){return this._structArray.uint16[this._pos2+2]}},{key:"numGlyphs",get:function(){return this._structArray.uint16[this._pos2+3]}},{key:"vertexStartIndex",get:function(){return this._structArray.uint32[this._pos4+2]}},{key:"lineStartIndex",get:function(){return this._structArray.uint32[this._pos4+3]}},{key:"lineLength",get:function(){return this._structArray.uint32[this._pos4+4]}},{key:"segment",get:function(){return this._structArray.uint16[this._pos2+10]}},{key:"lowerSize",get:function(){return this._structArray.uint16[this._pos2+11]}},{key:"upperSize",get:function(){return this._structArray.uint16[this._pos2+12]}},{key:"lineOffsetX",get:function(){return this._structArray.float32[this._pos4+7]}},{key:"lineOffsetY",get:function(){return this._structArray.float32[this._pos4+8]}},{key:"writingMode",get:function(){return this._structArray.uint8[this._pos1+36]}},{key:"placedOrientation",get:function(){return this._structArray.uint8[this._pos1+37]},set:function(e){this._structArray.uint8[this._pos1+37]=e}},{key:"hidden",get:function(){return this._structArray.uint8[this._pos1+38]},set:function(e){this._structArray.uint8[this._pos1+38]=e}},{key:"crossTileID",get:function(){return this._structArray.uint32[this._pos4+10]},set:function(e){this._structArray.uint32[this._pos4+10]=e}},{key:"associatedIconIndex",get:function(){return this._structArray.int16[this._pos2+22]}}]),r}(Rn);ua.prototype.size=48;var ca=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"get",value:function(e){return new ua(this,e)}}]),r}($n);Gi("PlacedSymbolArray",ca);var ha=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"anchorX",get:function(){return this._structArray.int16[this._pos2+0]}},{key:"anchorY",get:function(){return this._structArray.int16[this._pos2+1]}},{key:"rightJustifiedTextSymbolIndex",get:function(){return this._structArray.int16[this._pos2+2]}},{key:"centerJustifiedTextSymbolIndex",get:function(){return this._structArray.int16[this._pos2+3]}},{key:"leftJustifiedTextSymbolIndex",get:function(){return this._structArray.int16[this._pos2+4]}},{key:"verticalPlacedTextSymbolIndex",get:function(){return this._structArray.int16[this._pos2+5]}},{key:"placedIconSymbolIndex",get:function(){return this._structArray.int16[this._pos2+6]}},{key:"verticalPlacedIconSymbolIndex",get:function(){return this._structArray.int16[this._pos2+7]}},{key:"key",get:function(){return this._structArray.uint16[this._pos2+8]}},{key:"textBoxStartIndex",get:function(){return this._structArray.uint16[this._pos2+9]}},{key:"textBoxEndIndex",get:function(){return this._structArray.uint16[this._pos2+10]}},{key:"verticalTextBoxStartIndex",get:function(){return this._structArray.uint16[this._pos2+11]}},{key:"verticalTextBoxEndIndex",get:function(){return this._structArray.uint16[this._pos2+12]}},{key:"iconBoxStartIndex",get:function(){return this._structArray.uint16[this._pos2+13]}},{key:"iconBoxEndIndex",get:function(){return this._structArray.uint16[this._pos2+14]}},{key:"verticalIconBoxStartIndex",get:function(){return this._structArray.uint16[this._pos2+15]}},{key:"verticalIconBoxEndIndex",get:function(){return this._structArray.uint16[this._pos2+16]}},{key:"featureIndex",get:function(){return this._structArray.uint16[this._pos2+17]}},{key:"numHorizontalGlyphVertices",get:function(){return this._structArray.uint16[this._pos2+18]}},{key:"numVerticalGlyphVertices",get:function(){return this._structArray.uint16[this._pos2+19]}},{key:"numIconVertices",get:function(){return this._structArray.uint16[this._pos2+20]}},{key:"numVerticalIconVertices",get:function(){return this._structArray.uint16[this._pos2+21]}},{key:"useRuntimeCollisionCircles",get:function(){return this._structArray.uint16[this._pos2+22]}},{key:"crossTileID",get:function(){return this._structArray.uint32[this._pos4+12]},set:function(e){this._structArray.uint32[this._pos4+12]=e}},{key:"textBoxScale",get:function(){return this._structArray.float32[this._pos4+13]}},{key:"textOffset0",get:function(){return this._structArray.float32[this._pos4+14]}},{key:"textOffset1",get:function(){return this._structArray.float32[this._pos4+15]}},{key:"collisionCircleDiameter",get:function(){return this._structArray.float32[this._pos4+16]}}]),r}(Rn);ha.prototype.size=68;var pa=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"get",value:function(e){return new ha(this,e)}}]),r}(ea);Gi("SymbolInstanceArray",pa);var fa=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"getoffsetX",value:function(e){return this.float32[1*e+0]}}]),r}(ta);Gi("GlyphOffsetArray",fa);var da=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"getx",value:function(e){return this.int16[3*e+0]}},{key:"gety",value:function(e){return this.int16[3*e+1]}},{key:"gettileUnitDistanceFromAnchor",value:function(e){return this.int16[3*e+2]}}]),r}(ra);Gi("SymbolLineVertexArray",da);var ma=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"featureIndex",get:function(){return this._structArray.uint32[this._pos4+0]}},{key:"sourceLayerIndex",get:function(){return this._structArray.uint16[this._pos2+2]}},{key:"bucketIndex",get:function(){return this._structArray.uint16[this._pos2+3]}}]),r}(Rn);ma.prototype.size=8;var va=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"get",value:function(e){return new ma(this,e)}}]),r}(ia);Gi("FeatureIndexArray",va);var ya=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r)}(Vn),ga=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r)}(Vn),_a=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r)}(Vn),xa=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r)}(Nn),ba=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r)}(jn),wa=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r)}(Gn),ka=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r)}(qn),Ea=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r)}(Zn),Ta=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r)}(Xn),Sa=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r)}(Hn),Ca=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r)}(Kn),Ia=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r)}(Yn),za=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r)}(Qn),Aa=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r)}(na),Ma=Fn([{name:"a_pos",components:2,type:"Int16"}],4).members,Pa=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];j(this,e),this.segments=t}return q(e,[{key:"prepareSegment",value:function(t,r,i,n){var a=this.segments[this.segments.length-1];return t>e.MAX_VERTEX_ARRAY_LENGTH&&d("Max vertices per segment is ".concat(e.MAX_VERTEX_ARRAY_LENGTH,": bucket requested ").concat(t)),(!a||a.vertexLength+t>e.MAX_VERTEX_ARRAY_LENGTH||a.sortKey!==n)&&(a={vertexOffset:r.length,primitiveOffset:i.length,vertexLength:0,primitiveLength:0},void 0!==n&&(a.sortKey=n),this.segments.push(a)),a}},{key:"get",value:function(){return this.segments}},{key:"destroy",value:function(){var e,t=K(this.segments);try{for(t.s();!(e=t.n()).done;){var r=e.value;for(var i in r.vaos)r.vaos[i].destroy()}}catch(n){t.e(n)}finally{t.f()}}}],[{key:"simpleSegment",value:function(t,r,i,n){return new e([{vertexOffset:t,primitiveOffset:r,vertexLength:i,primitiveLength:n,vaos:{},sortKey:0}])}}]),e}();function Da(e,t){return 256*(e=a(Math.floor(e),0,255))+a(Math.floor(t),0,255)}Pa.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Gi("SegmentVector",Pa);var La=Fn([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]),Ra={exports:{}},Ba={exports:{}};Ba.exports=function(e,t){var r,i,n,a,o,s,l,u;for(i=e.length-(r=3&e.length),n=t,o=3432918353,s=461845907,u=0;u<i;)l=255&e.charCodeAt(u)|(255&e.charCodeAt(++u))<<8|(255&e.charCodeAt(++u))<<16|(255&e.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,r){case 3:l^=(255&e.charCodeAt(u+2))<<16;case 2:l^=(255&e.charCodeAt(u+1))<<8;case 1:n^=l=(65535&(l=(l=(65535&(l^=255&e.charCodeAt(u)))*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return n^=e.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};var Fa={exports:{}};Fa.exports=function(e,t){for(var r,i=e.length,n=t^i,a=0;i>=4;)r=1540483477*(65535&(r=255&e.charCodeAt(a)|(255&e.charCodeAt(++a))<<8|(255&e.charCodeAt(++a))<<16|(255&e.charCodeAt(++a))<<24))+((1540483477*(r>>>16)&65535)<<16),n=1540483477*(65535&n)+((1540483477*(n>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),i-=4,++a;switch(i){case 3:n^=(255&e.charCodeAt(a+2))<<16;case 2:n^=(255&e.charCodeAt(a+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(a)))+((1540483477*(n>>>16)&65535)<<16)}return n=1540483477*(65535&(n^=n>>>13))+((1540483477*(n>>>16)&65535)<<16),(n^=n>>>15)>>>0};var Oa=Ba.exports,Va=Fa.exports;Ra.exports=Oa,Ra.exports.murmur3=Oa,Ra.exports.murmur2=Va;var Ua=function(){function e(){j(this,e),this.ids=[],this.positions=[],this.indexed=!1}return q(e,[{key:"add",value:function(e,t,r,i){this.ids.push(Na(e)),this.positions.push(t,r,i)}},{key:"getPositions",value:function(e){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");for(var t=Na(e),r=0,i=this.ids.length-1;r<i;){var n=r+i>>1;this.ids[n]>=t?i=n:r=n+1}for(var a=[];this.ids[r]===t;)a.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return a}}],[{key:"serialize",value:function(e,t){var r=new Float64Array(e.ids),i=new Uint32Array(e.positions);return ja(r,i,0,r.length-1),t&&t.push(r.buffer,i.buffer),{ids:r,positions:i}}},{key:"deserialize",value:function(t){var r=new e;return r.ids=t.ids,r.positions=t.positions,r.indexed=!0,r}}]),e}();function Na(e){var t=+e;return!isNaN(t)&&t<=Number.MAX_SAFE_INTEGER?t:Ra.exports(String(e))}function ja(e,t,r,i){for(;r<i;){for(var n=e[r+i>>1],a=r-1,o=i+1;;){do{a++}while(e[a]<n);do{o--}while(e[o]>n);if(a>=o)break;Ga(e,a,o),Ga(t,3*a,3*o),Ga(t,3*a+1,3*o+1),Ga(t,3*a+2,3*o+2)}o-r<i-o?(ja(e,t,r,o),r=o+1):(ja(e,t,o+1,i),i=o)}}function Ga(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}Gi("FeaturePositionMap",Ua);var qa=q((function e(t,r){j(this,e),this.gl=t.gl,this.location=r})),Za=function(e){A(r,e);var t=M(r);function r(e,i){var n;return j(this,r),(n=t.call(this,e,i)).current=0,n}return q(r,[{key:"set",value:function(e){this.current!==e&&(this.current=e,this.gl.uniform1f(this.location,e))}}]),r}(qa),Xa=function(e){A(r,e);var t=M(r);function r(e,i){var n;return j(this,r),(n=t.call(this,e,i)).current=[0,0,0,0],n}return q(r,[{key:"set",value:function(e){e[0]===this.current[0]&&e[1]===this.current[1]&&e[2]===this.current[2]&&e[3]===this.current[3]||(this.current=e,this.gl.uniform4f(this.location,e[0],e[1],e[2],e[3]))}}]),r}(qa),Ha=function(e){A(r,e);var t=M(r);function r(e,i){var n;return j(this,r),(n=t.call(this,e,i)).current=Ye.transparent,n}return q(r,[{key:"set",value:function(e){e.r===this.current.r&&e.g===this.current.g&&e.b===this.current.b&&e.a===this.current.a||(this.current=e,this.gl.uniform4f(this.location,e.r,e.g,e.b,e.a))}}]),r}(qa),Wa=new Float32Array(16);function Ka(e){return[Da(255*e.r,255*e.g),Da(255*e.b,255*e.a)]}var Ja=function(){function e(t,r,i){j(this,e),this.value=t,this.uniformNames=r.map((function(e){return"u_".concat(e)})),this.type=i}return q(e,[{key:"setUniform",value:function(e,t,r){e.set(r.constantOr(this.value))}},{key:"getBinding",value:function(e,t,r){return"color"===this.type?new Ha(e,t):new Za(e,t)}}]),e}(),Ya=function(){function e(t,r){j(this,e),this.uniformNames=r.map((function(e){return"u_".concat(e)})),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}return q(e,[{key:"setConstantPatternPositions",value:function(e,t){this.pixelRatioFrom=t.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=t.tlbr,this.patternTo=e.tlbr}},{key:"setUniform",value:function(e,t,r,i){var n="u_pattern_to"===i?this.patternTo:"u_pattern_from"===i?this.patternFrom:"u_pixel_ratio_to"===i?this.pixelRatioTo:"u_pixel_ratio_from"===i?this.pixelRatioFrom:null;n&&e.set(n)}},{key:"getBinding",value:function(e,t,r){return"u_pattern"===r.substr(0,9)?new Xa(e,t):new Za(e,t)}}]),e}(),Qa=function(){function e(t,r,i,n){j(this,e),this.expression=t,this.type=i,this.maxValue=0,this.paintVertexAttributes=r.map((function(e){return{name:"a_".concat(e),type:"Float32",components:"color"===i?2:1,offset:0}})),this.paintVertexArray=new n}return q(e,[{key:"populatePaintArray",value:function(e,t,r,i,n){var a=this.paintVertexArray.length,o=this.expression.evaluate(new yn(0),t,{},i,[],n);this.paintVertexArray.resize(e),this._setPaintValue(a,e,o)}},{key:"updatePaintArray",value:function(e,t,r,i){var n=this.expression.evaluate({zoom:0},r,i);this._setPaintValue(e,t,n)}},{key:"_setPaintValue",value:function(e,t,r){if("color"===this.type)for(var i=Ka(r),n=e;n<t;n++)this.paintVertexArray.emplace(n,i[0],i[1]);else{for(var a=e;a<t;a++)this.paintVertexArray.emplace(a,r);this.maxValue=Math.max(this.maxValue,Math.abs(r))}}},{key:"upload",value:function(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}},{key:"destroy",value:function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}]),e}(),$a=function(){function e(t,r,i,n,a,o){j(this,e),this.expression=t,this.uniformNames=r.map((function(e){return"u_".concat(e,"_t")})),this.type=i,this.useIntegerZoom=n,this.zoom=a,this.maxValue=0,this.paintVertexAttributes=r.map((function(e){return{name:"a_".concat(e),type:"Float32",components:"color"===i?4:2,offset:0}})),this.paintVertexArray=new o}return q(e,[{key:"populatePaintArray",value:function(e,t,r,i,n){var a=this.expression.evaluate(new yn(this.zoom),t,{},i,[],n),o=this.expression.evaluate(new yn(this.zoom+1),t,{},i,[],n),s=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(s,e,a,o)}},{key:"updatePaintArray",value:function(e,t,r,i){var n=this.expression.evaluate({zoom:this.zoom},r,i),a=this.expression.evaluate({zoom:this.zoom+1},r,i);this._setPaintValue(e,t,n,a)}},{key:"_setPaintValue",value:function(e,t,r,i){if("color"===this.type)for(var n=Ka(r),a=Ka(i),o=e;o<t;o++)this.paintVertexArray.emplace(o,n[0],n[1],a[0],a[1]);else{for(var s=e;s<t;s++)this.paintVertexArray.emplace(s,r,i);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(i))}}},{key:"upload",value:function(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}},{key:"destroy",value:function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}},{key:"setUniform",value:function(e,t){var r=this.useIntegerZoom?Math.floor(t.zoom):t.zoom,i=a(this.expression.interpolationFactor(r,this.zoom,this.zoom+1),0,1);e.set(i)}},{key:"getBinding",value:function(e,t,r){return new Za(e,t)}}]),e}(),eo=function(){function e(t,r,i,n,a,o){j(this,e),this.expression=t,this.type=r,this.useIntegerZoom=i,this.zoom=n,this.layerId=o,this.zoomInPaintVertexArray=new a,this.zoomOutPaintVertexArray=new a}return q(e,[{key:"populatePaintArray",value:function(e,t,r){var i=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(i,e,t.patterns&&t.patterns[this.layerId],r)}},{key:"updatePaintArray",value:function(e,t,r,i,n){this._setPaintValues(e,t,r.patterns&&r.patterns[this.layerId],n)}},{key:"_setPaintValues",value:function(e,t,r,i){if(i&&r){var n=r.min,a=r.mid,o=r.max,s=i[n],l=i[a],u=i[o];if(s&&l&&u)for(var c=e;c<t;c++)this.zoomInPaintVertexArray.emplace(c,l.tl[0],l.tl[1],l.br[0],l.br[1],s.tl[0],s.tl[1],s.br[0],s.br[1],l.pixelRatio,s.pixelRatio),this.zoomOutPaintVertexArray.emplace(c,l.tl[0],l.tl[1],l.br[0],l.br[1],u.tl[0],u.tl[1],u.br[0],u.br[1],l.pixelRatio,u.pixelRatio)}}},{key:"upload",value:function(e){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=e.createVertexBuffer(this.zoomInPaintVertexArray,La.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,La.members,this.expression.isStateDependent))}},{key:"destroy",value:function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}]),e}(),to=function(){function e(t,r,i){j(this,e),this.binders={},this._buffers=[];var n=[];for(var a in t.paint._values)if(i(a)){var o=t.paint.get(a);if(o instanceof En&&Fr(o.property.specification)){var s=io(a,t.type),l=o.value,u=o.property.specification.type,c=o.property.useIntegerZoom,h=o.property.specification["property-type"],p="cross-faded"===h||"cross-faded-data-driven"===h;if("constant"===l.kind)this.binders[a]=p?new Ya(l.value,s):new Ja(l.value,s,u),n.push("/u_".concat(a));else if("source"===l.kind||p){var f=no(a,u,"source");this.binders[a]=p?new eo(l,u,c,r,f,t.id):new Qa(l,s,u,f),n.push("/a_".concat(a))}else{var d=no(a,u,"composite");this.binders[a]=new $a(l,s,u,c,r,d),n.push("/z_".concat(a))}}}this.cacheKey=n.sort().join("")}return q(e,[{key:"getMaxValue",value:function(e){var t=this.binders[e];return t instanceof Qa||t instanceof $a?t.maxValue:0}},{key:"populatePaintArrays",value:function(e,t,r,i,n){for(var a in this.binders){var o=this.binders[a];(o instanceof Qa||o instanceof $a||o instanceof eo)&&o.populatePaintArray(e,t,r,i,n)}}},{key:"setConstantPatternPositions",value:function(e,t){for(var r in this.binders){var i=this.binders[r];i instanceof Ya&&i.setConstantPatternPositions(e,t)}}},{key:"updatePaintArrays",value:function(e,t,r,i,n){var a=!1;for(var o in e){var s,l=K(t.getPositions(o));try{for(l.s();!(s=l.n()).done;){var u=s.value,c=r.feature(u.index);for(var h in this.binders){var p=this.binders[h];if((p instanceof Qa||p instanceof $a||p instanceof eo)&&!0===p.expression.isStateDependent){var f=i.paint.get(h);p.expression=f.value,p.updatePaintArray(u.start,u.end,c,e[o],n),a=!0}}}}catch(d){l.e(d)}finally{l.f()}}return a}},{key:"defines",value:function(){var e=[];for(var t in this.binders){var r=this.binders[t];(r instanceof Ja||r instanceof Ya)&&e.push.apply(e,I(r.uniformNames.map((function(e){return"#define HAS_UNIFORM_".concat(e)}))))}return e}},{key:"getBinderAttributes",value:function(){var e=[];for(var t in this.binders){var r=this.binders[t];if(r instanceof Qa||r instanceof $a)for(var i=0;i<r.paintVertexAttributes.length;i++)e.push(r.paintVertexAttributes[i].name);else if(r instanceof eo)for(var n=0;n<La.members.length;n++)e.push(La.members[n].name)}return e}},{key:"getBinderUniforms",value:function(){var e=[];for(var t in this.binders){var r=this.binders[t];if(r instanceof Ja||r instanceof Ya||r instanceof $a){var i,n=K(r.uniformNames);try{for(n.s();!(i=n.n()).done;){var a=i.value;e.push(a)}}catch(o){n.e(o)}finally{n.f()}}}return e}},{key:"getPaintVertexBuffers",value:function(){return this._buffers}},{key:"getUniforms",value:function(e,t){var r=[];for(var i in this.binders){var n=this.binders[i];if(n instanceof Ja||n instanceof Ya||n instanceof $a){var a,o=K(n.uniformNames);try{for(o.s();!(a=o.n()).done;){var s=a.value;if(t[s]){var l=n.getBinding(e,t[s],s);r.push({name:s,property:i,binding:l})}}}catch(u){o.e(u)}finally{o.f()}}}return r}},{key:"setUniforms",value:function(e,t,r,i){var n,a=K(t);try{for(a.s();!(n=a.n()).done;){var o=n.value,s=o.name,l=o.property,u=o.binding;this.binders[l].setUniform(u,i,r.get(l),s)}}catch(c){a.e(c)}finally{a.f()}}},{key:"updatePaintBuffers",value:function(e){for(var t in this._buffers=[],this.binders){var r=this.binders[t];if(e&&r instanceof eo){var i=2===e.fromScale?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;i&&this._buffers.push(i)}else(r instanceof Qa||r instanceof $a)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}}},{key:"upload",value:function(e){for(var t in this.binders){var r=this.binders[t];(r instanceof Qa||r instanceof $a||r instanceof eo)&&r.upload(e)}this.updatePaintBuffers()}},{key:"destroy",value:function(){for(var e in this.binders){var t=this.binders[e];(t instanceof Qa||t instanceof $a||t instanceof eo)&&t.destroy()}}}]),e}(),ro=function(){function e(t,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return!0};j(this,e),this.programConfigurations={};var n,a=K(t);try{for(a.s();!(n=a.n()).done;){var o=n.value;this.programConfigurations[o.id]=new to(o,r,i)}}catch(s){a.e(s)}finally{a.f()}this.needsUpload=!1,this._featureMap=new Ua,this._bufferOffset=0}return q(e,[{key:"populatePaintArrays",value:function(e,t,r,i,n,a){for(var o in this.programConfigurations)this.programConfigurations[o].populatePaintArrays(e,t,i,n,a);void 0!==t.id&&this._featureMap.add(t.id,r,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}},{key:"updatePaintArrays",value:function(e,t,r,i){var n,a=K(r);try{for(a.s();!(n=a.n()).done;){var o=n.value;this.needsUpload=this.programConfigurations[o.id].updatePaintArrays(e,this._featureMap,t,o,i)||this.needsUpload}}catch(s){a.e(s)}finally{a.f()}}},{key:"get",value:function(e){return this.programConfigurations[e]}},{key:"upload",value:function(e){if(this.needsUpload){for(var t in this.programConfigurations)this.programConfigurations[t].upload(e);this.needsUpload=!1}}},{key:"destroy",value:function(){for(var e in this.programConfigurations)this.programConfigurations[e].destroy()}}]),e}();function io(e,t){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"]}[e]||[e.replace("".concat(t,"-"),"").replace(/-/g,"_")]}function no(e,t,r){var i={color:{source:Gn,composite:oa},number:{source:ta,composite:Gn}},n=function(e){return{"line-pattern":{source:ka,composite:ka},"fill-pattern":{source:ka,composite:ka},"fill-extrusion-pattern":{source:ka,composite:ka}}[e]}(e);return n&&n[r]||i[t][r]}Gi("ConstantBinder",Ja),Gi("CrossFadedConstantBinder",Ya),Gi("SourceExpressionBinder",Qa),Gi("CrossFadedCompositeBinder",eo),Gi("CompositeExpressionBinder",$a),Gi("ProgramConfiguration",to,{omit:["_buffers"]}),Gi("ProgramConfigurationSet",ro);var ao=8192,oo=Math.pow(2,14)-1,so=-oo-1;function lo(e){for(var t=ao/e.extent,r=e.loadGeometry(),i=0;i<r.length;i++)for(var n=r[i],o=0;o<n.length;o++){var s=n[o],l=Math.round(s.x*t),u=Math.round(s.y*t);s.x=a(l,so,oo),s.y=a(u,so,oo),(l<s.x||l>s.x+1||u<s.y||u>s.y+1)&&d("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function uo(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?lo(e):[]}}function co(e,t,r,i,n){e.emplaceBack(2*t+(i+1)/2,2*r+(n+1)/2)}var ho=function(){function e(t){j(this,e),this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(e){return e.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new ga,this.indexArray=new za,this.segments=new Pa,this.programConfigurations=new ro(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id}))}return q(e,[{key:"populate",value:function(e,t,r){var i=this.layers[0],n=[],a=null,o=!1;"circle"===i.type&&(o=!(a=i.layout.get("circle-sort-key")).isConstant());var s,l=K(e);try{for(l.s();!(s=l.n()).done;){var u=s.value,c=u.feature,h=u.id,p=u.index,f=u.sourceLayerIndex,d=this.layers[0]._featureFilter.needGeometry,m=uo(c,d);if(this.layers[0]._featureFilter.filter(new yn(this.zoom),m,r)){var v=o?a.evaluate(m,{},r):void 0,y={id:h,properties:c.properties,type:c.type,sourceLayerIndex:f,index:p,geometry:d?m.geometry:lo(c),patterns:{},sortKey:v};n.push(y)}}}catch(T){l.e(T)}finally{l.f()}o&&n.sort((function(e,t){return e.sortKey-t.sortKey}));for(var g=0,_=n;g<_.length;g++){var x=_[g],b=x.geometry,w=x.index,k=x.sourceLayerIndex,E=e[w].feature;this.addFeature(x,b,w,r),t.featureIndex.insert(E,b,w,k,this.index)}}},{key:"update",value:function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)}},{key:"isEmpty",value:function(){return 0===this.layoutVertexArray.length}},{key:"uploadPending",value:function(){return!this.uploaded||this.programConfigurations.needsUpload}},{key:"upload",value:function(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Ma),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}},{key:"destroy",value:function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}},{key:"addFeature",value:function(e,t,r,i){var n,a=K(t);try{for(a.s();!(n=a.n()).done;){var o,s=K(n.value);try{for(s.s();!(o=s.n()).done;){var l=o.value,u=l.x,c=l.y;if(!(u<0||u>=ao||c<0||c>=ao)){var h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),p=h.vertexLength;co(this.layoutVertexArray,u,c,-1,-1),co(this.layoutVertexArray,u,c,1,-1),co(this.layoutVertexArray,u,c,1,1),co(this.layoutVertexArray,u,c,-1,1),this.indexArray.emplaceBack(p,p+1,p+2),this.indexArray.emplaceBack(p,p+3,p+2),h.vertexLength+=4,h.primitiveLength+=2}}}catch(f){s.e(f)}finally{s.f()}}}catch(f){a.e(f)}finally{a.f()}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{},i)}}]),e}();function po(e,t){for(var r=0;r<e.length;r++)if(wo(t,e[r]))return!0;for(var i=0;i<t.length;i++)if(wo(e,t[i]))return!0;return!!yo(e,t)}function fo(e,t,r){return!!wo(e,t)||!!_o(t,e,r)}function mo(e,t){if(1===e.length)return bo(t,e[0]);for(var r=0;r<t.length;r++)for(var i=t[r],n=0;n<i.length;n++)if(wo(e,i[n]))return!0;for(var a=0;a<e.length;a++)if(bo(t,e[a]))return!0;for(var o=0;o<t.length;o++)if(yo(e,t[o]))return!0;return!1}function vo(e,t,r){if(e.length>1){if(yo(e,t))return!0;for(var i=0;i<t.length;i++)if(_o(t[i],e,r))return!0}for(var n=0;n<e.length;n++)if(_o(e[n],t,r))return!0;return!1}function yo(e,t){if(0===e.length||0===t.length)return!1;for(var r=0;r<e.length-1;r++)for(var i=e[r],n=e[r+1],a=0;a<t.length-1;a++)if(go(i,n,t[a],t[a+1]))return!0;return!1}function go(e,t,r,i){return m(e,r,i)!==m(t,r,i)&&m(e,t,r)!==m(e,t,i)}function _o(e,t,r){var i=r*r;if(1===t.length)return e.distSqr(t[0])<i;for(var n=1;n<t.length;n++)if(xo(e,t[n-1],t[n])<i)return!0;return!1}function xo(e,t,r){var i=t.distSqr(r);if(0===i)return e.distSqr(t);var n=((e.x-t.x)*(r.x-t.x)+(e.y-t.y)*(r.y-t.y))/i;return e.distSqr(n<0?t:n>1?r:r.sub(t)._mult(n)._add(t))}function bo(e,t){for(var r,i,n,a=!1,o=0;o<e.length;o++)for(var s=0,l=(r=e[o]).length-1;s<r.length;l=s++)i=r[s],n=r[l],i.y>t.y!=n.y>t.y&&t.x<(n.x-i.x)*(t.y-i.y)/(n.y-i.y)+i.x&&(a=!a);return a}function wo(e,t){for(var r=!1,i=0,n=e.length-1;i<e.length;n=i++){var a=e[i],o=e[n];a.y>t.y!=o.y>t.y&&t.x<(o.x-a.x)*(t.y-a.y)/(o.y-a.y)+a.x&&(r=!r)}return r}function ko(e,t,r){var i=r[0],n=r[2];if(e.x<i.x&&t.x<i.x||e.x>n.x&&t.x>n.x||e.y<i.y&&t.y<i.y||e.y>n.y&&t.y>n.y)return!1;var a=m(e,t,r[0]);return a!==m(e,t,r[1])||a!==m(e,t,r[2])||a!==m(e,t,r[3])}function Eo(e,t,r){var i=t.paint.get(e).value;return"constant"===i.kind?i.value:r.programConfigurations.get(t.id).getMaxValue(e)}function To(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function So(e,t,r,i,n){if(!t[0]&&!t[1])return e;var a=T.convert(t)._mult(n);"viewport"===r&&a._rotate(-i);for(var o=[],s=0;s<e.length;s++)o.push(e[s].sub(a));return o}Gi("CircleBucket",ho,{omit:["layers"]});var Co=new Mn({"circle-sort-key":new Cn(xe.layout_circle["circle-sort-key"])}),Io={paint:new Mn({"circle-radius":new Cn(xe.paint_circle["circle-radius"]),"circle-color":new Cn(xe.paint_circle["circle-color"]),"circle-blur":new Cn(xe.paint_circle["circle-blur"]),"circle-opacity":new Cn(xe.paint_circle["circle-opacity"]),"circle-translate":new Sn(xe.paint_circle["circle-translate"]),"circle-translate-anchor":new Sn(xe.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Sn(xe.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Sn(xe.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Cn(xe.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Cn(xe.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Cn(xe.paint_circle["circle-stroke-opacity"])}),layout:Co},zo=1e-6,Ao="undefined"!=typeof Float32Array?Float32Array:Array;function Mo(){var e=new Ao(9);return Ao!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function Po(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Do(e,t,r){var i=t[0],n=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=t[6],c=t[7],h=t[8],p=t[9],f=t[10],d=t[11],m=t[12],v=t[13],y=t[14],g=t[15],_=r[0],x=r[1],b=r[2],w=r[3];return e[0]=_*i+x*s+b*h+w*m,e[1]=_*n+x*l+b*p+w*v,e[2]=_*a+x*u+b*f+w*y,e[3]=_*o+x*c+b*d+w*g,e[4]=(_=r[4])*i+(x=r[5])*s+(b=r[6])*h+(w=r[7])*m,e[5]=_*n+x*l+b*p+w*v,e[6]=_*a+x*u+b*f+w*y,e[7]=_*o+x*c+b*d+w*g,e[8]=(_=r[8])*i+(x=r[9])*s+(b=r[10])*h+(w=r[11])*m,e[9]=_*n+x*l+b*p+w*v,e[10]=_*a+x*u+b*f+w*y,e[11]=_*o+x*c+b*d+w*g,e[12]=(_=r[12])*i+(x=r[13])*s+(b=r[14])*h+(w=r[15])*m,e[13]=_*n+x*l+b*p+w*v,e[14]=_*a+x*u+b*f+w*y,e[15]=_*o+x*c+b*d+w*g,e}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var Lo,Ro=Do;function Bo(){var e=new Ao(3);return Ao!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function Fo(e,t,r){var i=new Ao(3);return i[0]=e,i[1]=t,i[2]=r,i}function Oo(e,t,r){var i=t[0],n=t[1],a=t[2],o=t[3];return e[0]=r[0]*i+r[4]*n+r[8]*a+r[12]*o,e[1]=r[1]*i+r[5]*n+r[9]*a+r[13]*o,e[2]=r[2]*i+r[6]*n+r[10]*a+r[14]*o,e[3]=r[3]*i+r[7]*n+r[11]*a+r[15]*o,e}function Vo(){var e=new Ao(4);return Ao!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function Uo(e,t){var r=Oo([],[e.x,e.y,0,1],t);return new T(r[0]/r[3],r[1]/r[3])}Bo(),Lo=new Ao(4),Ao!=Float32Array&&(Lo[0]=0,Lo[1]=0,Lo[2]=0,Lo[3]=0),Bo(),Fo(1,0,0),Fo(0,1,0),Vo(),Vo(),Mo(),function(){var e;e=new Ao(2),Ao!=Float32Array&&(e[0]=0,e[1]=0)}();var No=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r)}(ho);Gi("HeatmapBucket",No,{omit:["layers"]});var jo={paint:new Mn({"heatmap-radius":new Cn(xe.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Cn(xe.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Sn(xe.paint_heatmap["heatmap-intensity"]),"heatmap-color":new An(xe.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Sn(xe.paint_heatmap["heatmap-opacity"])})};function Go(e,t,r,i){var n=t.width,a=t.height;if(i){if(i instanceof Uint8ClampedArray)i=new Uint8Array(i.buffer);else if(i.length!==n*a*r)throw new RangeError("mismatched image size. expected: ".concat(i.length," but got: ").concat(n*a*r))}else i=new Uint8Array(n*a*r);return e.width=n,e.height=a,e.data=i,e}function qo(e,t,r){var i=t.width,n=t.height;if(i!==e.width||n!==e.height){var a=Go({},{width:i,height:n},r);Zo(e,a,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,i),height:Math.min(e.height,n)},r),e.width=i,e.height=n,e.data=a.data}}function Zo(e,t,r,i,n,a){if(0===n.width||0===n.height)return t;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 source coordinates for image copy");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 destination coordinates for image copy");var o=e.data,s=t.data;if(o===s)throw new Error("srcData equals dstData, so image is already copied");for(var l=0;l<n.height;l++)for(var u=((r.y+l)*e.width+r.x)*a,c=((i.y+l)*t.width+i.x)*a,h=0;h<n.width*a;h++)s[c+h]=o[u+h];return t}var Xo=function(){function e(t,r){j(this,e),Go(this,t,1,r)}return q(e,[{key:"resize",value:function(e){qo(this,e,1)}},{key:"clone",value:function(){return new e({width:this.width,height:this.height},new Uint8Array(this.data))}}],[{key:"copy",value:function(e,t,r,i,n){Zo(e,t,r,i,n,1)}}]),e}(),Ho=function(){function e(t,r){j(this,e),Go(this,t,4,r)}return q(e,[{key:"resize",value:function(e){qo(this,e,4)}},{key:"replace",value:function(e,t){t?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e}},{key:"clone",value:function(){return new e({width:this.width,height:this.height},new Uint8Array(this.data))}}],[{key:"copy",value:function(e,t,r,i,n){Zo(e,t,r,i,n,4)}}]),e}();function Wo(e){var t={},r=e.resolution||256,i=e.clips?e.clips.length:1,n=e.image||new Ho({width:r,height:i});if(Math.log(r)/Math.LN2%1!=0)throw new Error("width is not a power of 2 - ".concat(r));var a=function(r,i,a){t[e.evaluationKey]=a;var o=e.expression.evaluate(t);n.data[r+i+0]=Math.floor(255*o.r/o.a),n.data[r+i+1]=Math.floor(255*o.g/o.a),n.data[r+i+2]=Math.floor(255*o.b/o.a),n.data[r+i+3]=Math.floor(255*o.a)};if(e.clips)for(var o=0,s=0;o<i;++o,s+=4*r)for(var l=0,u=0;l<r;l++,u+=4){var c=l/(r-1),h=e.clips[o];a(s,u,h.start*(1-c)+h.end*c)}else for(var p=0,f=0;p<r;p++,f+=4)a(0,f,p/(r-1));return n}Gi("AlphaImage",Xo),Gi("RGBAImage",Ho);var Ko={paint:new Mn({"hillshade-illumination-direction":new Sn(xe.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Sn(xe.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Sn(xe.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Sn(xe.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Sn(xe.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Sn(xe.paint_hillshade["hillshade-accent-color"])})},Jo=Fn([{name:"a_pos",components:2,type:"Int16"}],4).members,Yo={exports:{}};function Qo(e,t,r){r=r||2;var i,n,a,o,s,l,u,c=t&&t.length,h=c?t[0]*r:e.length,p=$o(e,0,h,r,!0),f=[];if(!p||p.next===p.prev)return f;if(c&&(p=function(e,t,r,i){var n,a,o,s=[];for(n=0,a=t.length;n<a;n++)(o=$o(e,t[n]*i,n<a-1?t[n+1]*i:e.length,i,!1))===o.next&&(o.steiner=!0),s.push(cs(o));for(s.sort(os),n=0;n<s.length;n++)r=ss(s[n],r);return r}(e,t,p,r)),e.length>80*r){i=a=e[0],n=o=e[1];for(var d=r;d<h;d+=r)(s=e[d])<i&&(i=s),(l=e[d+1])<n&&(n=l),s>a&&(a=s),l>o&&(o=l);u=0!==(u=Math.max(a-i,o-n))?32767/u:0}return ts(p,f,r,i,n,u,0),f}function $o(e,t,r,i,n){var a,o;if(n===ks(e,t,r,i)>0)for(a=t;a<r;a+=i)o=xs(a,e[a],e[a+1],o);else for(a=r-i;a>=t;a-=i)o=xs(a,e[a],e[a+1],o);return o&&ds(o,o.next)&&(bs(o),o=o.next),o}function es(e,t){if(!e)return e;t||(t=e);var r,i=e;do{if(r=!1,i.steiner||!ds(i,i.next)&&0!==fs(i.prev,i,i.next))i=i.next;else{if(bs(i),(i=t=i.prev)===i.next)break;r=!0}}while(r||i!==t);return t}function ts(e,t,r,i,n,a,o){if(e){!o&&a&&function(e,t,r,i){var n=e;do{0===n.z&&(n.z=us(n.x,n.y,t,r,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==e);n.prevZ.nextZ=null,n.prevZ=null,function(e){var t,r,i,n,a,o,s,l,u=1;do{for(r=e,e=null,a=null,o=0;r;){for(o++,i=r,s=0,t=0;t<u&&(s++,i=i.nextZ);t++);for(l=u;s>0||l>0&&i;)0!==s&&(0===l||!i||r.z<=i.z)?(n=r,r=r.nextZ,s--):(n=i,i=i.nextZ,l--),a?a.nextZ=n:e=n,n.prevZ=a,a=n;r=i}a.nextZ=null,u*=2}while(o>1)}(n)}(e,i,n,a);for(var s,l,u=e;e.prev!==e.next;)if(s=e.prev,l=e.next,a?is(e,i,n,a):rs(e))t.push(s.i/r|0),t.push(e.i/r|0),t.push(l.i/r|0),bs(e),e=l.next,u=l.next;else if((e=l)===u){o?1===o?ts(e=ns(es(e),t,r),t,r,i,n,a,2):2===o&&as(e,t,r,i,n,a):ts(es(e),t,r,i,n,a,1);break}}}function rs(e){var t=e.prev,r=e,i=e.next;if(fs(t,r,i)>=0)return!1;for(var n=t.x,a=r.x,o=i.x,s=t.y,l=r.y,u=i.y,c=n<a?n<o?n:o:a<o?a:o,h=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=i.next;d!==t;){if(d.x>=c&&d.x<=p&&d.y>=h&&d.y<=f&&hs(n,s,a,l,o,u,d.x,d.y)&&fs(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function is(e,t,r,i){var n=e.prev,a=e,o=e.next;if(fs(n,a,o)>=0)return!1;for(var s=n.x,l=a.x,u=o.x,c=n.y,h=a.y,p=o.y,f=s<l?s<u?s:u:l<u?l:u,d=c<h?c<p?c:p:h<p?h:p,m=s>l?s>u?s:u:l>u?l:u,v=c>h?c>p?c:p:h>p?h:p,y=us(f,d,t,r,i),g=us(m,v,t,r,i),_=e.prevZ,x=e.nextZ;_&&_.z>=y&&x&&x.z<=g;){if(_.x>=f&&_.x<=m&&_.y>=d&&_.y<=v&&_!==n&&_!==o&&hs(s,c,l,h,u,p,_.x,_.y)&&fs(_.prev,_,_.next)>=0)return!1;if(_=_.prevZ,x.x>=f&&x.x<=m&&x.y>=d&&x.y<=v&&x!==n&&x!==o&&hs(s,c,l,h,u,p,x.x,x.y)&&fs(x.prev,x,x.next)>=0)return!1;x=x.nextZ}for(;_&&_.z>=y;){if(_.x>=f&&_.x<=m&&_.y>=d&&_.y<=v&&_!==n&&_!==o&&hs(s,c,l,h,u,p,_.x,_.y)&&fs(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;x&&x.z<=g;){if(x.x>=f&&x.x<=m&&x.y>=d&&x.y<=v&&x!==n&&x!==o&&hs(s,c,l,h,u,p,x.x,x.y)&&fs(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function ns(e,t,r){var i=e;do{var n=i.prev,a=i.next.next;!ds(n,a)&&ms(n,i,i.next,a)&&gs(n,a)&&gs(a,n)&&(t.push(n.i/r|0),t.push(i.i/r|0),t.push(a.i/r|0),bs(i),bs(i.next),i=e=a),i=i.next}while(i!==e);return es(i)}function as(e,t,r,i,n,a){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&ps(o,s)){var l=_s(o,s);return o=es(o,o.next),l=es(l,l.next),ts(o,t,r,i,n,a,0),void ts(l,t,r,i,n,a,0)}s=s.next}o=o.next}while(o!==e)}function os(e,t){return e.x-t.x}function ss(e,t){var r=function(e,t){var r,i=t,n=e.x,a=e.y,o=-1/0;do{if(a<=i.y&&a>=i.next.y&&i.next.y!==i.y){var s=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=n&&s>o&&(o=s,r=i.x<i.next.x?i:i.next,s===n))return r}i=i.next}while(i!==t);if(!r)return null;var l,u=r,c=r.x,h=r.y,p=1/0;i=r;do{n>=i.x&&i.x>=c&&n!==i.x&&hs(a<h?n:o,a,c,h,a<h?o:n,a,i.x,i.y)&&(l=Math.abs(a-i.y)/(n-i.x),gs(i,e)&&(l<p||l===p&&(i.x>r.x||i.x===r.x&&ls(r,i)))&&(r=i,p=l)),i=i.next}while(i!==u);return r}(e,t);if(!r)return t;var i=_s(r,e);return es(i,i.next),es(r,r.next)}function ls(e,t){return fs(e.prev,e,t.prev)<0&&fs(t.next,e,e.next)<0}function us(e,t,r,i,n){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*n|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*n|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function cs(e){var t=e,r=e;do{(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next}while(t!==e);return r}function hs(e,t,r,i,n,a,o,s){return(n-o)*(t-s)>=(e-o)*(a-s)&&(e-o)*(i-s)>=(r-o)*(t-s)&&(r-o)*(a-s)>=(n-o)*(i-s)}function ps(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&ms(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(e,t)&&(gs(e,t)&&gs(t,e)&&function(e,t){var r=e,i=!1,n=(e.x+t.x)/2,a=(e.y+t.y)/2;do{r.y>a!=r.next.y>a&&r.next.y!==r.y&&n<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next}while(r!==e);return i}(e,t)&&(fs(e.prev,e,t.prev)||fs(e,t.prev,t))||ds(e,t)&&fs(e.prev,e,e.next)>0&&fs(t.prev,t,t.next)>0)}function fs(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function ds(e,t){return e.x===t.x&&e.y===t.y}function ms(e,t,r,i){var n=ys(fs(e,t,r)),a=ys(fs(e,t,i)),o=ys(fs(r,i,e)),s=ys(fs(r,i,t));return n!==a&&o!==s||!(0!==n||!vs(e,r,t))||!(0!==a||!vs(e,i,t))||!(0!==o||!vs(r,e,i))||!(0!==s||!vs(r,t,i))}function vs(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function ys(e){return e>0?1:e<0?-1:0}function gs(e,t){return fs(e.prev,e,e.next)<0?fs(e,t,e.next)>=0&&fs(e,e.prev,t)>=0:fs(e,t,e.prev)<0||fs(e,e.next,t)<0}function _s(e,t){var r=new ws(e.i,e.x,e.y),i=new ws(t.i,t.x,t.y),n=e.next,a=t.prev;return e.next=t,t.prev=e,r.next=n,n.prev=r,i.next=r,r.prev=i,a.next=i,i.prev=a,i}function xs(e,t,r,i){var n=new ws(e,t,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function bs(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function ws(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function ks(e,t,r,i){for(var n=0,a=t,o=r-i;a<r;a+=i)n+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return n}function Es(e,t,r,i,n){Ts(e,t,r||0,i||e.length-1,n||Cs)}function Ts(e,t,r,i,n){for(;i>r;){if(i-r>600){var a=i-r+1,o=t-r+1,s=Math.log(a),l=.5*Math.exp(2*s/3),u=.5*Math.sqrt(s*l*(a-l)/a)*(o-a/2<0?-1:1);Ts(e,t,Math.max(r,Math.floor(t-o*l/a+u)),Math.min(i,Math.floor(t+(a-o)*l/a+u)),n)}var c=e[t],h=r,p=i;for(Ss(e,r,t),n(e[i],c)>0&&Ss(e,r,i);h<p;){for(Ss(e,h,p),h++,p--;n(e[h],c)<0;)h++;for(;n(e[p],c)>0;)p--}0===n(e[r],c)?Ss(e,r,p):Ss(e,++p,i),p<=t&&(r=p+1),t<=p&&(i=p-1)}}function Ss(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function Cs(e,t){return e<t?-1:e>t?1:0}function Is(e,t){var r=e.length;if(r<=1)return[e];for(var i,n,a=[],o=0;o<r;o++){var s=v(e[o]);0!==s&&(e[o].area=Math.abs(s),void 0===n&&(n=s<0),n===s<0?(i&&a.push(i),i=[e[o]]):i.push(e[o]))}if(i&&a.push(i),t>1)for(var l=0;l<a.length;l++)a[l].length<=t||(Es(a[l],t,1,a[l].length-1,zs),a[l]=a[l].slice(0,t));return a}function zs(e,t){return t.area-e.area}function As(e,t,r){var i,n=r.patternDependencies,a=!1,o=K(t);try{for(o.s();!(i=o.n()).done;){var s=i.value.paint.get("".concat(e,"-pattern"));s.isConstant()||(a=!0);var l=s.constantOr(null);l&&(a=!0,n[l.to]=!0,n[l.from]=!0)}}catch(u){o.e(u)}finally{o.f()}return a}function Ms(e,t,r,i,n){var a,o=n.patternDependencies,s=K(t);try{for(s.s();!(a=s.n()).done;){var l=a.value,u=l.paint.get("".concat(e,"-pattern")).value;if("constant"!==u.kind){var c=u.evaluate({zoom:i-1},r,{},n.availableImages),h=u.evaluate({zoom:i},r,{},n.availableImages),p=u.evaluate({zoom:i+1},r,{},n.availableImages);c=c&&c.name?c.name:c,h=h&&h.name?h.name:h,p=p&&p.name?p.name:p,o[c]=!0,o[h]=!0,o[p]=!0,r.patterns[l.id]={min:c,mid:h,max:p}}}}catch(f){s.e(f)}finally{s.f()}return r}Yo.exports=Qo,Yo.exports.default=Qo,Qo.deviation=function(e,t,r,i){var n=t&&t.length,a=Math.abs(ks(e,0,n?t[0]*r:e.length,r));if(n)for(var o=0,s=t.length;o<s;o++)a-=Math.abs(ks(e,t[o]*r,o<s-1?t[o+1]*r:e.length,r));var l=0;for(o=0;o<i.length;o+=3){var u=i[o]*r,c=i[o+1]*r,h=i[o+2]*r;l+=Math.abs((e[u]-e[h])*(e[c+1]-e[u+1])-(e[u]-e[c])*(e[h+1]-e[u+1]))}return 0===a&&0===l?0:Math.abs((l-a)/a)},Qo.flatten=function(e){for(var t=e[0][0].length,r={vertices:[],holes:[],dimensions:t},i=0,n=0;n<e.length;n++){for(var a=0;a<e[n].length;a++)for(var o=0;o<t;o++)r.vertices.push(e[n][a][o]);n>0&&r.holes.push(i+=e[n-1].length)}return r};var Ps=function(){function e(t){j(this,e),this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(e){return e.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new _a,this.indexArray=new za,this.indexArray2=new Aa,this.programConfigurations=new ro(t.layers,t.zoom),this.segments=new Pa,this.segments2=new Pa,this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id}))}return q(e,[{key:"populate",value:function(e,t,r){this.hasPattern=As("fill",this.layers,t);var i,n=this.layers[0].layout.get("fill-sort-key"),a=!n.isConstant(),o=[],s=K(e);try{for(s.s();!(i=s.n()).done;){var l=i.value,u=l.feature,c=l.id,h=l.index,p=l.sourceLayerIndex,f=this.layers[0]._featureFilter.needGeometry,d=uo(u,f);if(this.layers[0]._featureFilter.filter(new yn(this.zoom),d,r)){var m=a?n.evaluate(d,{},r,t.availableImages):void 0,v={id:c,properties:u.properties,type:u.type,sourceLayerIndex:p,index:h,geometry:f?d.geometry:lo(u),patterns:{},sortKey:m};o.push(v)}}}catch(E){s.e(E)}finally{s.f()}a&&o.sort((function(e,t){return e.sortKey-t.sortKey}));for(var y=0,g=o;y<g.length;y++){var _=g[y],x=_.geometry,b=_.index,w=_.sourceLayerIndex;if(this.hasPattern){var k=Ms("fill",this.layers,_,this.zoom,t);this.patternFeatures.push(k)}else this.addFeature(_,x,b,r,{});t.featureIndex.insert(e[b].feature,x,b,w,this.index)}}},{key:"update",value:function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)}},{key:"addFeatures",value:function(e,t,r){var i,n=K(this.patternFeatures);try{for(n.s();!(i=n.n()).done;){var a=i.value;this.addFeature(a,a.geometry,a.index,t,r)}}catch(o){n.e(o)}finally{n.f()}}},{key:"isEmpty",value:function(){return 0===this.layoutVertexArray.length}},{key:"uploadPending",value:function(){return!this.uploaded||this.programConfigurations.needsUpload}},{key:"upload",value:function(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Jo),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0}},{key:"destroy",value:function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}},{key:"addFeature",value:function(e,t,r,i,n){var a,o=K(Is(t,500));try{for(o.s();!(a=o.n()).done;){var s,l=a.value,u=0,c=K(l);try{for(c.s();!(s=c.n()).done;)u+=s.value.length}catch(k){c.e(k)}finally{c.f()}var h,p=this.segments.prepareSegment(u,this.layoutVertexArray,this.indexArray),f=p.vertexLength,d=[],m=[],v=K(l);try{for(v.s();!(h=v.n()).done;){var y=h.value;if(0!==y.length){y!==l[0]&&m.push(d.length/2);var g=this.segments2.prepareSegment(y.length,this.layoutVertexArray,this.indexArray2),_=g.vertexLength;this.layoutVertexArray.emplaceBack(y[0].x,y[0].y),this.indexArray2.emplaceBack(_+y.length-1,_),d.push(y[0].x),d.push(y[0].y);for(var x=1;x<y.length;x++)this.layoutVertexArray.emplaceBack(y[x].x,y[x].y),this.indexArray2.emplaceBack(_+x-1,_+x),d.push(y[x].x),d.push(y[x].y);g.vertexLength+=y.length,g.primitiveLength+=y.length}}}catch(k){v.e(k)}finally{v.f()}for(var b=Yo.exports(d,m),w=0;w<b.length;w+=3)this.indexArray.emplaceBack(f+b[w],f+b[w+1],f+b[w+2]);p.vertexLength+=u,p.primitiveLength+=b.length/3}}catch(k){o.e(k)}finally{o.f()}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,n,i)}}]),e}();Gi("FillBucket",Ps,{omit:["layers","patternFeatures"]});var Ds=new Mn({"fill-sort-key":new Cn(xe.layout_fill["fill-sort-key"])}),Ls={paint:new Mn({"fill-antialias":new Sn(xe.paint_fill["fill-antialias"]),"fill-opacity":new Cn(xe.paint_fill["fill-opacity"]),"fill-color":new Cn(xe.paint_fill["fill-color"]),"fill-outline-color":new Cn(xe.paint_fill["fill-outline-color"]),"fill-translate":new Sn(xe.paint_fill["fill-translate"]),"fill-translate-anchor":new Sn(xe.paint_fill["fill-translate-anchor"]),"fill-pattern":new In(xe.paint_fill["fill-pattern"])}),layout:Ds},Rs=Fn([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),Bs=Fn([{name:"a_centroid",components:2,type:"Int16"}],4),Fs=Rs.members,Os={},Vs=T,Us=Ns;function Ns(e,t,r,i,n){this.properties={},this.extent=r,this.type=0,this._pbf=e,this._geometry=-1,this._keys=i,this._values=n,e.readFields(js,this,t)}function js(e,t,r){1==e?t.id=r.readVarint():2==e?function(e,t){for(var r=e.readVarint()+e.pos;e.pos<r;){var i=t._keys[e.readVarint()],n=t._values[e.readVarint()];t.properties[i]=n}}(r,t):3==e?t.type=r.readVarint():4==e&&(t._geometry=r.pos)}function Gs(e){for(var t,r,i=0,n=0,a=e.length,o=a-1;n<a;o=n++)i+=((r=e[o]).x-(t=e[n]).x)*(t.y+r.y);return i}Ns.types=["Unknown","Point","LineString","Polygon"],Ns.prototype.loadGeometry=function(){var e=this._pbf;e.pos=this._geometry;for(var t,r=e.readVarint()+e.pos,i=1,n=0,a=0,o=0,s=[];e.pos<r;){if(n<=0){var l=e.readVarint();i=7&l,n=l>>3}if(n--,1===i||2===i)a+=e.readSVarint(),o+=e.readSVarint(),1===i&&(t&&s.push(t),t=[]),t.push(new Vs(a,o));else{if(7!==i)throw new Error("unknown command "+i);t&&t.push(t[0].clone())}}return t&&s.push(t),s},Ns.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,r=1,i=0,n=0,a=0,o=1/0,s=-1/0,l=1/0,u=-1/0;e.pos<t;){if(i<=0){var c=e.readVarint();r=7&c,i=c>>3}if(i--,1===r||2===r)(n+=e.readSVarint())<o&&(o=n),n>s&&(s=n),(a+=e.readSVarint())<l&&(l=a),a>u&&(u=a);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,u]},Ns.prototype.toGeoJSON=function(e,t,r){var i,n,a=this.extent*Math.pow(2,r),o=this.extent*e,s=this.extent*t,l=this.loadGeometry(),u=Ns.types[this.type];function c(e){for(var t=0;t<e.length;t++){var r=e[t];e[t]=[360*(r.x+o)/a-180,360/Math.PI*Math.atan(Math.exp((180-360*(r.y+s)/a)*Math.PI/180))-90]}}switch(this.type){case 1:var h=[];for(i=0;i<l.length;i++)h[i]=l[i][0];c(l=h);break;case 2:for(i=0;i<l.length;i++)c(l[i]);break;case 3:for(l=function(e){var t=e.length;if(t<=1)return[e];for(var r,i,n=[],a=0;a<t;a++){var o=Gs(e[a]);0!==o&&(void 0===i&&(i=o<0),i===o<0?(r&&n.push(r),r=[e[a]]):r.push(e[a]))}return r&&n.push(r),n}(l),i=0;i<l.length;i++)for(n=0;n<l[i].length;n++)c(l[i][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 qs=Us,Zs=Xs;function Xs(e,t){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(Hs,this,t),this.length=this._features.length}function Hs(e,t,r){15===e?t.version=r.readVarint():1===e?t.name=r.readString():5===e?t.extent=r.readVarint():2===e?t._features.push(r.pos):3===e?t._keys.push(r.readString()):4===e&&t._values.push(function(e){for(var t=null,r=e.readVarint()+e.pos;e.pos<r;){var i=e.readVarint()>>3;t=1===i?e.readString():2===i?e.readFloat():3===i?e.readDouble():4===i?e.readVarint64():5===i?e.readVarint():6===i?e.readSVarint():7===i?e.readBoolean():null}return t}(r))}Xs.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new qs(this._pbf,t,this.extent,this._keys,this._values)};var Ws=Zs;function Ks(e,t,r){if(3===e){var i=new Ws(r,r.readVarint()+r.pos);i.length&&(t[i.name]=i)}}Os.VectorTile=function(e,t){this.layers=e.readFields(Ks,{},t)},Os.VectorTileFeature=Us,Os.VectorTileLayer=Zs;var Js=Os.VectorTileFeature.types,Ys=Math.pow(2,13);function Qs(e,t,r,i,n,a,o,s){e.emplaceBack(t,r,2*Math.floor(i*Ys)+o,n*Ys*2,a*Ys*2,Math.round(s))}var $s=function(){function e(t){j(this,e),this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(e){return e.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new xa,this.centroidVertexArray=new ya,this.indexArray=new za,this.programConfigurations=new ro(t.layers,t.zoom),this.segments=new Pa,this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id}))}return q(e,[{key:"populate",value:function(e,t,r){this.features=[],this.hasPattern=As("fill-extrusion",this.layers,t);var i,n=K(e);try{for(n.s();!(i=n.n()).done;){var a=i.value,o=a.feature,s=a.id,l=a.index,u=a.sourceLayerIndex,c=this.layers[0]._featureFilter.needGeometry,h=uo(o,c);if(this.layers[0]._featureFilter.filter(new yn(this.zoom),h,r)){var p={id:s,sourceLayerIndex:u,index:l,geometry:c?h.geometry:lo(o),properties:o.properties,type:o.type,patterns:{}};this.hasPattern?this.features.push(Ms("fill-extrusion",this.layers,p,this.zoom,t)):this.addFeature(p,p.geometry,l,r,{}),t.featureIndex.insert(o,p.geometry,l,u,this.index,!0)}}}catch(f){n.e(f)}finally{n.f()}}},{key:"addFeatures",value:function(e,t,r){var i,n=K(this.features);try{for(n.s();!(i=n.n()).done;){var a=i.value,o=a.geometry;this.addFeature(a,o,a.index,t,r)}}catch(s){n.e(s)}finally{n.f()}}},{key:"update",value:function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)}},{key:"isEmpty",value:function(){return 0===this.layoutVertexArray.length&&0===this.centroidVertexArray.length}},{key:"uploadPending",value:function(){return!this.uploaded||this.programConfigurations.needsUpload}},{key:"upload",value:function(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Fs),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,Bs.members,!0),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}},{key:"destroy",value:function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}},{key:"addFeature",value:function(e,t,r,i,n){var a,o={x:0,y:0,vertexCount:0},s=K(Is(t,500));try{for(s.s();!(a=s.n()).done;){var l,u=a.value,c=0,h=K(u);try{for(h.s();!(l=h.n()).done;)c+=l.value.length}catch(L){h.e(L)}finally{h.f()}var p,f=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),d=K(u);try{for(d.s();!(p=d.n()).done;){var m=p.value;if(0!==m.length&&!tl(m))for(var v=0,y=0;y<m.length;y++){var g=m[y];if(y>=1){var _=m[y-1];if(!el(g,_)){f.vertexLength+4>Pa.MAX_VERTEX_ARRAY_LENGTH&&(f=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var x=g.sub(_)._perp()._unit(),b=_.dist(g);v+b>32768&&(v=0),Qs(this.layoutVertexArray,g.x,g.y,x.x,x.y,0,0,v),Qs(this.layoutVertexArray,g.x,g.y,x.x,x.y,0,1,v),o.x+=2*g.x,o.y+=2*g.y,o.vertexCount+=2,v+=b,Qs(this.layoutVertexArray,_.x,_.y,x.x,x.y,0,0,v),Qs(this.layoutVertexArray,_.x,_.y,x.x,x.y,0,1,v),o.x+=2*_.x,o.y+=2*_.y,o.vertexCount+=2;var w=f.vertexLength;this.indexArray.emplaceBack(w,w+2,w+1),this.indexArray.emplaceBack(w+1,w+2,w+3),f.vertexLength+=4,f.primitiveLength+=2}}}}}catch(L){d.e(L)}finally{d.f()}if(f.vertexLength+c>Pa.MAX_VERTEX_ARRAY_LENGTH&&(f=this.segments.prepareSegment(c,this.layoutVertexArray,this.indexArray)),"Polygon"===Js[e.type]){var k,E=[],T=[],S=f.vertexLength,C=K(u);try{for(C.s();!(k=C.n()).done;){var I=k.value;if(0!==I.length){I!==u[0]&&T.push(E.length/2);for(var z=0;z<I.length;z++){var A=I[z];Qs(this.layoutVertexArray,A.x,A.y,0,0,1,1,0),o.x+=A.x,o.y+=A.y,o.vertexCount+=1,E.push(A.x),E.push(A.y)}}}}catch(L){C.e(L)}finally{C.f()}for(var M=Yo.exports(E,T),P=0;P<M.length;P+=3)this.indexArray.emplaceBack(S+M[P],S+M[P+2],S+M[P+1]);f.primitiveLength+=M.length/3,f.vertexLength+=c}}}catch(L){s.e(L)}finally{s.f()}for(var D=0;D<o.vertexCount;D++)this.centroidVertexArray.emplaceBack(Math.floor(o.x/o.vertexCount),Math.floor(o.y/o.vertexCount));this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,n,i)}}]),e}();function el(e,t){return e.x===t.x&&(e.x<0||e.x>ao)||e.y===t.y&&(e.y<0||e.y>ao)}function tl(e){return e.every((function(e){return e.x<0}))||e.every((function(e){return e.x>ao}))||e.every((function(e){return e.y<0}))||e.every((function(e){return e.y>ao}))}Gi("FillExtrusionBucket",$s,{omit:["layers","features"]});var rl={paint:new Mn({"fill-extrusion-opacity":new Sn(xe["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Cn(xe["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Sn(xe["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Sn(xe["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new In(xe["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Cn(xe["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Cn(xe["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Sn(xe["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})};function il(e,t){return e.x*t.x+e.y*t.y}function nl(e,t){if(1===e.length){for(var r,i=0,n=t[i++];!r||n.equals(r);)if(!(r=t[i++]))return 1/0;for(;i<t.length;i++){var a=t[i],o=e[0],s=r.sub(n),l=a.sub(n),u=o.sub(n),c=il(s,s),h=il(s,l),p=il(l,l),f=il(u,s),d=il(u,l),m=c*p-h*h,v=(p*f-h*d)/m,y=(c*d-h*f)/m,g=n.z*(1-v-y)+r.z*v+a.z*y;if(isFinite(g))return g}return 1/0}var _,x=1/0,b=K(t);try{for(b.s();!(_=b.n()).done;){var w=_.value;x=Math.min(x,w.z)}}catch(k){b.e(k)}finally{b.f()}return x}var al=Fn([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,ol=Fn([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]).members,sl=Os.VectorTileFeature.types,ll=Math.cos(Math.PI/180*37.5),ul=Math.pow(2,14)/.5,cl=function(){function e(t){var r=this;j(this,e),this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(e){return e.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((function(e){r.gradients[e.id]={}})),this.layoutVertexArray=new ba,this.layoutVertexArray2=new wa,this.indexArray=new za,this.programConfigurations=new ro(t.layers,t.zoom),this.segments=new Pa,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id}))}return q(e,[{key:"populate",value:function(e,t,r){this.hasPattern=As("line",this.layers,t);var i,n=this.layers[0].layout.get("line-sort-key"),a=!n.isConstant(),o=[],s=K(e);try{for(s.s();!(i=s.n()).done;){var l=i.value,u=l.feature,c=l.id,h=l.index,p=l.sourceLayerIndex,f=this.layers[0]._featureFilter.needGeometry,d=uo(u,f);if(this.layers[0]._featureFilter.filter(new yn(this.zoom),d,r)){var m=a?n.evaluate(d,{},r):void 0,v={id:c,properties:u.properties,type:u.type,sourceLayerIndex:p,index:h,geometry:f?d.geometry:lo(u),patterns:{},sortKey:m};o.push(v)}}}catch(E){s.e(E)}finally{s.f()}a&&o.sort((function(e,t){return e.sortKey-t.sortKey}));for(var y=0,g=o;y<g.length;y++){var _=g[y],x=_.geometry,b=_.index,w=_.sourceLayerIndex;if(this.hasPattern){var k=Ms("line",this.layers,_,this.zoom,t);this.patternFeatures.push(k)}else this.addFeature(_,x,b,r,{});t.featureIndex.insert(e[b].feature,x,b,w,this.index)}}},{key:"update",value:function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)}},{key:"addFeatures",value:function(e,t,r){var i,n=K(this.patternFeatures);try{for(n.s();!(i=n.n()).done;){var a=i.value;this.addFeature(a,a.geometry,a.index,t,r)}}catch(o){n.e(o)}finally{n.f()}}},{key:"isEmpty",value:function(){return 0===this.layoutVertexArray.length}},{key:"uploadPending",value:function(){return!this.uploaded||this.programConfigurations.needsUpload}},{key:"upload",value:function(e){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,ol)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,al),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}},{key:"destroy",value:function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}},{key:"lineFeatureClips",value:function(e){if(e.properties&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}},{key:"addFeature",value:function(e,t,r,i,n){var a=this.layers[0].layout,o=a.get("line-join").evaluate(e,{}),s=a.get("line-cap"),l=a.get("line-miter-limit"),u=a.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);var c,h=K(t);try{for(h.s();!(c=h.n()).done;){var p=c.value;this.addLine(p,e,o,s,l,u)}}catch(f){h.e(f)}finally{h.f()}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,n,i)}},{key:"addLine",value:function(e,t,r,i,n,a){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(var o=0;o<e.length-1;o++)this.totalDistance+=e[o].dist(e[o+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}for(var s="Polygon"===sl[t.type],l=e.length;l>=2&&e[l-1].equals(e[l-2]);)l--;for(var u=0;u<l-1&&e[u].equals(e[u+1]);)u++;if(!(l<(s?3:2))){"bevel"===r&&(n=1.05);var c,h,p,f,d,m=this.overscaling<=16?122880/(512*this.overscaling):0,v=this.segments.prepareSegment(10*l,this.layoutVertexArray,this.indexArray);this.e1=this.e2=-1,s&&(c=e[l-2],d=e[u].sub(c)._unit()._perp());for(var y=u;y<l;y++)if(!(p=y===l-1?s?e[u+1]:void 0:e[y+1])||!e[y].equals(p)){d&&(f=d),c&&(h=c),c=e[y],d=p?p.sub(c)._unit()._perp():f;var g=(f=f||d).add(d);0===g.x&&0===g.y||g._unit();var _=f.x*d.x+f.y*d.y,x=g.x*d.x+g.y*d.y,b=0!==x?1/x:1/0,w=2*Math.sqrt(2-2*x),k=x<ll&&h&&p,E=f.x*d.y-f.y*d.x>0;if(k&&y>u){var T=c.dist(h);if(T>2*m){var S=c.sub(c.sub(h)._mult(m/T)._round());this.updateDistance(h,S),this.addCurrentVertex(S,f,0,0,v),h=S}}var C=h&&p,I=C?r:s?"butt":i;if(C&&"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")),h&&this.updateDistance(h,c),"miter"===I)g._mult(b),this.addCurrentVertex(c,g,0,0,v);else if("flipbevel"===I){if(b>100)g=d.mult(-1);else{var z=b*f.add(d).mag()/f.sub(d).mag();g._perp()._mult(z*(E?-1:1))}this.addCurrentVertex(c,g,0,0,v),this.addCurrentVertex(c,g.mult(-1),0,0,v)}else if("bevel"===I||"fakeround"===I){var A=-Math.sqrt(b*b-1),M=E?A:0,P=E?0:A;if(h&&this.addCurrentVertex(c,f,M,P,v),"fakeround"===I)for(var D=Math.round(180*w/Math.PI/20),L=1;L<D;L++){var R=L/D;if(.5!==R){var B=R-.5;R+=R*B*(R-1)*((1.0904+_*(_*(3.55645-1.43519*_)-3.2452))*B*B+(.848013+_*(.215638*_-1.06021)))}var F=d.sub(f)._mult(R)._add(f)._unit()._mult(E?-1:1);this.addHalfVertex(c,F.x,F.y,!1,E,0,v)}p&&this.addCurrentVertex(c,d,-M,-P,v)}else if("butt"===I)this.addCurrentVertex(c,g,0,0,v);else if("square"===I){var O=h?1:-1;this.addCurrentVertex(c,g,O,O,v)}else"round"===I&&(h&&(this.addCurrentVertex(c,f,0,0,v),this.addCurrentVertex(c,f,1,1,v,!0)),p&&(this.addCurrentVertex(c,d,-1,-1,v,!0),this.addCurrentVertex(c,d,0,0,v)));if(k&&y<l-1){var V=c.dist(p);if(V>2*m){var U=c.add(p.sub(c)._mult(m/V)._round());this.updateDistance(c,U),this.addCurrentVertex(U,d,0,0,v),c=U}}}}}},{key:"addCurrentVertex",value:function(e,t,r,i,n){var a=arguments.length>5&&void 0!==arguments[5]&&arguments[5],o=t.y*i-t.x,s=-t.y-t.x*i;this.addHalfVertex(e,t.x+t.y*r,t.y-t.x*r,a,!1,r,n),this.addHalfVertex(e,o,s,a,!0,-i,n),this.distance>ul/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(e,t,r,i,n,a))}},{key:"addHalfVertex",value:function(e,t,r,i,n,a,o){var s=e.x,l=e.y,u=.5*(this.lineClips?this.scaledDistance*(ul-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((s<<1)+(i?1:0),(l<<1)+(n?1:0),Math.round(63*t)+128,Math.round(63*r)+128,1+(0===a?0:a<0?-1:1)|(63&u)<<2,u>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);var c=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,c),o.primitiveLength++),n?this.e2=c:this.e1=c}},{key:"updateScaledDistance",value:function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}},{key:"updateDistance",value:function(e,t){this.distance+=e.dist(t),this.updateScaledDistance()}}]),e}();Gi("LineBucket",cl,{omit:["layers","patternFeatures"]});var hl=new Mn({"line-cap":new Sn(xe.layout_line["line-cap"]),"line-join":new Cn(xe.layout_line["line-join"]),"line-miter-limit":new Sn(xe.layout_line["line-miter-limit"]),"line-round-limit":new Sn(xe.layout_line["line-round-limit"]),"line-sort-key":new Cn(xe.layout_line["line-sort-key"])}),pl={paint:new Mn({"line-opacity":new Cn(xe.paint_line["line-opacity"]),"line-color":new Cn(xe.paint_line["line-color"]),"line-translate":new Sn(xe.paint_line["line-translate"]),"line-translate-anchor":new Sn(xe.paint_line["line-translate-anchor"]),"line-width":new Cn(xe.paint_line["line-width"]),"line-gap-width":new Cn(xe.paint_line["line-gap-width"]),"line-offset":new Cn(xe.paint_line["line-offset"]),"line-blur":new Cn(xe.paint_line["line-blur"]),"line-dasharray":new zn(xe.paint_line["line-dasharray"]),"line-pattern":new In(xe.paint_line["line-pattern"]),"line-gradient":new An(xe.paint_line["line-gradient"])}),layout:hl},fl=new(function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"possiblyEvaluate",value:function(e,t){return t=new yn(Math.floor(t.zoom),{now:t.now,fadeDuration:t.fadeDuration,zoomHistory:t.zoomHistory,transition:t.transition}),S(O(r.prototype),"possiblyEvaluate",this).call(this,e,t)}},{key:"evaluate",value:function(e,t,i,n){return t=s({},t,{zoom:Math.floor(t.zoom)}),S(O(r.prototype),"evaluate",this).call(this,e,t,i,n)}}]),r}(Cn))(pl.paint.properties["line-width"].specification);function dl(e,t){return t>0?t+2*e:e}fl.useIntegerZoom=!0;var ml=Fn([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),vl=Fn([{name:"a_projected_pos",components:3,type:"Float32"}],4);Fn([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);var yl=Fn([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);Fn([{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"}]);var gl=Fn([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),_l=Fn([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function xl(e,t,r){return e.sections.forEach((function(e){e.text=function(e,t,r){var i=t.layout.get("text-transform").evaluate(r,{});return"uppercase"===i?e=e.toLocaleUpperCase():"lowercase"===i&&(e=e.toLocaleLowerCase()),vn.applyArabicShaping&&(e=vn.applyArabicShaping(e)),e}(e.text,t,r)})),e}Fn([{name:"triangle",components:3,type:"Uint16"}]),Fn([{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"}]),Fn([{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:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),Fn([{type:"Float32",name:"offsetX"}]),Fn([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var bl={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},wl=24,kl=Sl,El=function(e,t,r,i,n){var a,o,s=8*n-i-1,l=(1<<s)-1,u=l>>1,c=-7,h=r?n-1:0,p=r?-1:1,f=e[t+h];for(h+=p,a=f&(1<<-c)-1,f>>=-c,c+=s;c>0;a=256*a+e[t+h],h+=p,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=i;c>0;o=256*o+e[t+h],h+=p,c-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,i),a-=u}return(f?-1:1)*o*Math.pow(2,a-i)},Tl=function(e,t,r,i,n,a){var o,s,l,u=8*a-n-1,c=(1<<u)-1,h=c>>1,p=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,f=i?0:a-1,d=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+h>=1?p/l:p*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=c?(s=0,o=c):o+h>=1?(s=(t*l-1)*Math.pow(2,n),o+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,n),o=0));n>=8;e[r+f]=255&s,f+=d,s/=256,n-=8);for(o=o<<n|s,u+=n;u>0;e[r+f]=255&o,f+=d,o/=256,u-=8);e[r+f-d]|=128*m};function Sl(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}Sl.Varint=0,Sl.Fixed64=1,Sl.Bytes=2,Sl.Fixed32=5;var Cl,Il=4294967296,zl=1/Il,Al="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function Ml(e){return e.type===Sl.Bytes?e.readVarint()+e.pos:e.pos+1}function Pl(e,t,r){return r?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function Dl(e,t,r){var i=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));r.realloc(i);for(var n=r.pos-1;n>=e;n--)r.buf[n+i]=r.buf[n]}function Ll(e,t){for(var r=0;r<e.length;r++)t.writeVarint(e[r])}function Rl(e,t){for(var r=0;r<e.length;r++)t.writeSVarint(e[r])}function Bl(e,t){for(var r=0;r<e.length;r++)t.writeFloat(e[r])}function Fl(e,t){for(var r=0;r<e.length;r++)t.writeDouble(e[r])}function Ol(e,t){for(var r=0;r<e.length;r++)t.writeBoolean(e[r])}function Vl(e,t){for(var r=0;r<e.length;r++)t.writeFixed32(e[r])}function Ul(e,t){for(var r=0;r<e.length;r++)t.writeSFixed32(e[r])}function Nl(e,t){for(var r=0;r<e.length;r++)t.writeFixed64(e[r])}function jl(e,t){for(var r=0;r<e.length;r++)t.writeSFixed64(e[r])}function Gl(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+16777216*e[t+3]}function ql(e,t,r){e[r]=t,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24}function Zl(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}function Xl(e,t,r){1===e&&r.readMessage(Hl,t)}function Hl(e,t,r){if(3===e){var i=r.readMessage(Wl,{}),n=i.id,a=i.bitmap,o=i.width,s=i.height,l=i.left,u=i.top,c=i.advance;t.push({id:n,bitmap:new Xo({width:o+6,height:s+6},a),metrics:{width:o,height:s,left:l,top:u,advance:c}})}}function Wl(e,t,r){1===e?t.id=r.readVarint():2===e?t.bitmap=r.readBytes():3===e?t.width=r.readVarint():4===e?t.height=r.readVarint():5===e?t.left=r.readSVarint():6===e?t.top=r.readSVarint():7===e&&(t.advance=r.readVarint())}function Kl(e){var t,r=0,i=0,n=K(e);try{for(n.s();!(t=n.n()).done;){var a=t.value;r+=a.w*a.h,i=Math.max(i,a.w)}}catch(m){n.e(m)}finally{n.f()}e.sort((function(e,t){return t.h-e.h}));var o,s=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(r/.95)),i),h:1/0}],l=0,u=0,c=K(e);try{for(c.s();!(o=c.n()).done;)for(var h=o.value,p=s.length-1;p>=0;p--){var f=s[p];if(!(h.w>f.w||h.h>f.h)){if(h.x=f.x,h.y=f.y,u=Math.max(u,h.y+h.h),l=Math.max(l,h.x+h.w),h.w===f.w&&h.h===f.h){var d=s.pop();p<s.length&&(s[p]=d)}else h.h===f.h?(f.x+=h.w,f.w-=h.w):h.w===f.w?(f.y+=h.h,f.h-=h.h):(s.push({x:f.x+h.w,y:f.y,w:f.w-h.w,h:h.h}),f.y+=h.h,f.h-=h.h);break}}}catch(m){c.e(m)}finally{c.f()}return{w:l,h:u,fill:r/(l*u)||0}}Sl.prototype={destroy:function(){this.buf=null},readFields:function(e,t,r){for(r=r||this.length;this.pos<r;){var i=this.readVarint(),n=i>>3,a=this.pos;this.type=7&i,e(n,t,this),this.pos===a&&this.skip(i)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=Gl(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=Zl(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=Gl(this.buf,this.pos)+Gl(this.buf,this.pos+4)*Il;return this.pos+=8,e},readSFixed64:function(){var e=Gl(this.buf,this.pos)+Zl(this.buf,this.pos+4)*Il;return this.pos+=8,e},readFloat:function(){var e=El(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=El(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,r,i=this.buf;return t=127&(r=i[this.pos++]),r<128?t:(t|=(127&(r=i[this.pos++]))<<7,r<128?t:(t|=(127&(r=i[this.pos++]))<<14,r<128?t:(t|=(127&(r=i[this.pos++]))<<21,r<128?t:function(e,t,r){var i,n,a=r.buf;if(i=(112&(n=a[r.pos++]))>>4,n<128)return Pl(e,i,t);if(i|=(127&(n=a[r.pos++]))<<3,n<128)return Pl(e,i,t);if(i|=(127&(n=a[r.pos++]))<<10,n<128)return Pl(e,i,t);if(i|=(127&(n=a[r.pos++]))<<17,n<128)return Pl(e,i,t);if(i|=(127&(n=a[r.pos++]))<<24,n<128)return Pl(e,i,t);if(i|=(1&(n=a[r.pos++]))<<31,n<128)return Pl(e,i,t);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(r=i[this.pos]))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&Al?function(e,t,r){return Al.decode(e.subarray(t,r))}(this.buf,t,e):function(e,t,r){for(var i="",n=t;n<r;){var a,o,s,l=e[n],u=null,c=l>239?4:l>223?3:l>191?2:1;if(n+c>r)break;1===c?l<128&&(u=l):2===c?128==(192&(a=e[n+1]))&&(u=(31&l)<<6|63&a)<=127&&(u=null):3===c?(o=e[n+2],128==(192&(a=e[n+1]))&&128==(192&o)&&((u=(15&l)<<12|(63&a)<<6|63&o)<=2047||u>=55296&&u<=57343)&&(u=null)):4===c&&(o=e[n+2],s=e[n+3],128==(192&(a=e[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,c=1):u>65535&&(u-=65536,i+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),i+=String.fromCharCode(u),n+=c}return i}(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==Sl.Bytes)return e.push(this.readVarint(t));var r=Ml(this);for(e=e||[];this.pos<r;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==Sl.Bytes)return e.push(this.readSVarint());var t=Ml(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==Sl.Bytes)return e.push(this.readBoolean());var t=Ml(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==Sl.Bytes)return e.push(this.readFloat());var t=Ml(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==Sl.Bytes)return e.push(this.readDouble());var t=Ml(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==Sl.Bytes)return e.push(this.readFixed32());var t=Ml(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==Sl.Bytes)return e.push(this.readSFixed32());var t=Ml(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==Sl.Bytes)return e.push(this.readFixed64());var t=Ml(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==Sl.Bytes)return e.push(this.readSFixed64());var t=Ml(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=7&e;if(t===Sl.Varint)for(;this.buf[this.pos++]>127;);else if(t===Sl.Bytes)this.pos=this.readVarint()+this.pos;else if(t===Sl.Fixed32)this.pos+=4;else{if(t!==Sl.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t<this.pos+e;)t*=2;if(t!==this.length){var r=new Uint8Array(t);r.set(this.buf),this.buf=r,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),ql(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),ql(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),ql(this.buf,-1&e,this.pos),ql(this.buf,Math.floor(e*zl),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),ql(this.buf,-1&e,this.pos),ql(this.buf,Math.floor(e*zl),this.pos+4),this.pos+=8},writeVarint:function(e){(e=+e||0)>268435455||e<0?function(e,t){var r,i;if(e>=0?(r=e%4294967296|0,i=e/4294967296|0):(i=~(-e/4294967296),4294967295^(r=~(-e%4294967296))?r=r+1|0:(r=0,i=i+1|0)),e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),function(e,t,r){r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,r.buf[r.pos]=127&(e>>>=7)}(r,0,t),function(e,t){var r=(7&e)<<4;t.buf[t.pos++]|=r|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e)))))}(i,t)}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=function(e,t,r){for(var i,n,a=0;a<t.length;a++){if((i=t.charCodeAt(a))>55295&&i<57344){if(!n){i>56319||a+1===t.length?(e[r++]=239,e[r++]=191,e[r++]=189):n=i;continue}if(i<56320){e[r++]=239,e[r++]=191,e[r++]=189,n=i;continue}i=n-55296<<10|i-56320|65536,n=null}else n&&(e[r++]=239,e[r++]=191,e[r++]=189,n=null);i<128?e[r++]=i:(i<2048?e[r++]=i>>6|192:(i<65536?e[r++]=i>>12|224:(e[r++]=i>>18|240,e[r++]=i>>12&63|128),e[r++]=i>>6&63|128),e[r++]=63&i|128)}return r}(this.buf,e,this.pos);var r=this.pos-t;r>=128&&Dl(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(e){this.realloc(4),Tl(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),Tl(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var r=0;r<t;r++)this.buf[this.pos++]=e[r]},writeRawMessage:function(e,t){this.pos++;var r=this.pos;e(t,this);var i=this.pos-r;i>=128&&Dl(r,i,this),this.pos=r-1,this.writeVarint(i),this.pos+=i},writeMessage:function(e,t,r){this.writeTag(e,Sl.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,Ll,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,Rl,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,Ol,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,Bl,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,Fl,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,Vl,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,Ul,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,Nl,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,jl,t)},writeBytesField:function(e,t){this.writeTag(e,Sl.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,Sl.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,Sl.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,Sl.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,Sl.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,Sl.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,Sl.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,Sl.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,Sl.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,Sl.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}};var Jl=function(){function e(t,r){var i=r.pixelRatio,n=r.version,a=r.stretchX,o=r.stretchY,s=r.content;j(this,e),this.paddedRect=t,this.pixelRatio=i,this.stretchX=a,this.stretchY=o,this.content=s,this.version=n}return q(e,[{key:"tl",get:function(){return[this.paddedRect.x+1,this.paddedRect.y+1]}},{key:"br",get:function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}},{key:"tlbr",get:function(){return this.tl.concat(this.br)}},{key:"displaySize",get:function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}}]),e}(),Yl=function(){function e(t,r){j(this,e);var i={},n={};this.haveRenderCallbacks=[];var a=[];this.addImages(t,i,a),this.addImages(r,n,a);var o=Kl(a),s=o.w,l=o.h,u=new Ho({width:s||1,height:l||1});for(var c in t){var h=t[c],p=i[c].paddedRect;Ho.copy(h.data,u,{x:0,y:0},{x:p.x+1,y:p.y+1},h.data)}for(var f in r){var d=r[f],m=n[f].paddedRect,v=m.x+1,y=m.y+1,g=d.data.width,_=d.data.height;Ho.copy(d.data,u,{x:0,y:0},{x:v,y:y},d.data),Ho.copy(d.data,u,{x:0,y:_-1},{x:v,y:y-1},{width:g,height:1}),Ho.copy(d.data,u,{x:0,y:0},{x:v,y:y+_},{width:g,height:1}),Ho.copy(d.data,u,{x:g-1,y:0},{x:v-1,y:y},{width:1,height:_}),Ho.copy(d.data,u,{x:0,y:0},{x:v+g,y:y},{width:1,height:_})}this.image=u,this.iconPositions=i,this.patternPositions=n}return q(e,[{key:"addImages",value:function(e,t,r){for(var i in e){var n=e[i],a={x:0,y:0,w:n.data.width+2,h:n.data.height+2};r.push(a),t[i]=new Jl(a,n),n.hasRenderCallback&&this.haveRenderCallbacks.push(i)}}},{key:"patchUpdatedImages",value:function(e,t){for(var r in e.dispatchRenderCallbacks(this.haveRenderCallbacks),e.updatedImages)this.patchUpdatedImage(this.iconPositions[r],e.getImage(r),t),this.patchUpdatedImage(this.patternPositions[r],e.getImage(r),t)}},{key:"patchUpdatedImage",value:function(e,t,r){if(e&&t&&e.version!==t.version){e.version=t.version;var i=V(e.tl,2),n=i[0],a=i[1];r.update(t.data,void 0,{x:n,y:a})}}}]),e}();Gi("ImagePosition",Jl),Gi("ImageAtlas",Yl),e.WritingMode=void 0,(Cl=e.WritingMode||(e.WritingMode={}))[Cl.none=0]="none",Cl[Cl.horizontal=1]="horizontal",Cl[Cl.vertical=2]="vertical",Cl[Cl.horizontalOnly=3]="horizontalOnly";var Ql=-17,$l=function(){function e(){j(this,e),this.scale=1,this.fontStack="",this.imageName=null}return q(e,null,[{key:"forText",value:function(t,r){var i=new e;return i.scale=t||1,i.fontStack=r,i}},{key:"forImage",value:function(t){var r=new e;return r.imageName=t,r}}]),e}(),eu=function(){function e(){j(this,e),this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}return q(e,[{key:"length",value:function(){return this.text.length}},{key:"getSection",value:function(e){return this.sections[this.sectionIndex[e]]}},{key:"getSectionIndex",value:function(e){return this.sectionIndex[e]}},{key:"getCharCode",value:function(e){return this.text.charCodeAt(e)}},{key:"verticalizePunctuation",value:function(){this.text=function(e){for(var t="",r=0;r<e.length;r++){var i=e.charCodeAt(r+1)||null,n=e.charCodeAt(r-1)||null;t+=i&&en(i)&&!bl[e[r+1]]||n&&en(n)&&!bl[e[r-1]]||!bl[e[r]]?e[r]:bl[e[r]]}return t}(this.text)}},{key:"trim",value:function(){for(var e=0,t=0;t<this.text.length&&ru[this.text.charCodeAt(t)];t++)e++;for(var r=this.text.length,i=this.text.length-1;i>=0&&i>=e&&ru[this.text.charCodeAt(i)];i--)r--;this.text=this.text.substring(e,r),this.sectionIndex=this.sectionIndex.slice(e,r)}},{key:"substring",value:function(t,r){var i=new e;return i.text=this.text.substring(t,r),i.sectionIndex=this.sectionIndex.slice(t,r),i.sections=this.sections,i}},{key:"toString",value:function(){return this.text}},{key:"getMaxScale",value:function(){var e=this;return this.sectionIndex.reduce((function(t,r){return Math.max(t,e.sections[r].scale)}),0)}},{key:"addTextSection",value:function(e,t){this.text+=e.text,this.sections.push($l.forText(e.scale,e.fontStack||t));for(var r=this.sections.length-1,i=0;i<e.text.length;++i)this.sectionIndex.push(r)}},{key:"addImageSection",value:function(e){var t=e.image?e.image.name:"";if(0!==t.length){var r=this.getNextImageSectionCharCode();r?(this.text+=String.fromCharCode(r),this.sections.push($l.forImage(t)),this.sectionIndex.push(this.sections.length-1)):d("Reached maximum number of images 6401")}else d("Can't add FormattedSection with an empty image.")}},{key:"getNextImageSectionCharCode",value:function(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}],[{key:"fromFeature",value:function(t,r){for(var i=new e,n=0;n<t.sections.length;n++){var a=t.sections[n];a.image?i.addImageSection(a):i.addTextSection(a,r)}return i}}]),e}();function tu(t,r,i,n,a,o,s,l,u,c,h,p,f,d,m,v){var y,g=eu.fromFeature(t,a);p===e.WritingMode.vertical&&g.verticalizePunctuation();var _=vn.processBidirectionalText,x=vn.processStyledBidirectionalText;if(_&&1===g.sections.length){y=[];var b,w=K(_(g.toString(),uu(g,c,o,r,n,d,m)));try{for(w.s();!(b=w.n()).done;){var k=b.value,E=new eu;E.text=k,E.sections=g.sections;for(var T=0;T<k.length;T++)E.sectionIndex.push(0);y.push(E)}}catch(P){w.e(P)}finally{w.f()}}else if(x){y=[];var S,C=K(x(g.text,g.sectionIndex,uu(g,c,o,r,n,d,m)));try{for(C.s();!(S=C.n()).done;){var I=S.value,z=new eu;z.text=I[0],z.sectionIndex=I[1],z.sections=g.sections,y.push(z)}}catch(P){C.e(P)}finally{C.f()}}else y=function(e,t){var r,i=[],n=e.text,a=0,o=K(t);try{for(o.s();!(r=o.n()).done;){var s=r.value;i.push(e.substring(a,s)),a=s}}catch(P){o.e(P)}finally{o.f()}return a<n.length&&i.push(e.substring(a,n.length)),i}(g,uu(g,c,o,r,n,d,m));var A=[],M={positionedLines:A,text:g.toString(),top:h[1],bottom:h[1],left:h[0],right:h[0],writingMode:p,iconsInText:!1,verticalizable:!1};return function(t,r,i,n,a,o,s,l,u,c,h,p){var f,d,m=0,v=Ql,y=0,g=0,_="right"===l?1:"left"===l?0:.5,x=0,b=K(a);try{for(b.s();!(f=b.n()).done;){var w=f.value;w.trim();var k=w.getMaxScale(),E=(k-1)*wl,T={positionedGlyphs:[],lineOffset:0};t.positionedLines[x]=T;var S=T.positionedGlyphs,C=0;if(w.length()){for(var I=0;I<w.length();I++){var z=w.getSection(I),A=w.getSectionIndex(I),M=w.getCharCode(I),D=0,L=null,R=null,B=null,F=wl,O=!(u===e.WritingMode.horizontal||!h&&!$i(M)||h&&(ru[M]||(d=M,Ki.Arabic(d)||Ki["Arabic Supplement"](d)||Ki["Arabic Extended-A"](d)||Ki["Arabic Presentation Forms-A"](d)||Ki["Arabic Presentation Forms-B"](d))));if(z.imageName){var V=n[z.imageName];if(!V)continue;B=z.imageName,t.iconsInText=t.iconsInText||!0,R=V.paddedRect;var U=V.displaySize;z.scale=z.scale*wl/p,L={width:U[0],height:U[1],left:1,top:-3,advance:O?U[1]:U[0]},D=E+(wl-U[1]*z.scale),F=L.advance;var N=O?U[0]*z.scale-wl*k:U[1]*z.scale-wl*k;N>0&&N>C&&(C=N)}else{var j=i[z.fontStack],G=j&&j[M];if(G&&G.rect)R=G.rect,L=G.metrics;else{var q=r[z.fontStack],Z=q&&q[M];if(!Z)continue;L=Z.metrics}D=(k-z.scale)*wl}O?(t.verticalizable=!0,S.push({glyph:M,imageName:B,x:m,y:v+D,vertical:O,scale:z.scale,fontStack:z.fontStack,sectionIndex:A,metrics:L,rect:R}),m+=F*z.scale+c):(S.push({glyph:M,imageName:B,x:m,y:v+D,vertical:O,scale:z.scale,fontStack:z.fontStack,sectionIndex:A,metrics:L,rect:R}),m+=L.advance*z.scale+c)}0!==S.length&&(y=Math.max(m-c,y),hu(S,0,S.length-1,_,C)),m=0;var X=o*k+C;T.lineOffset=Math.max(C,E),v+=X,g=Math.max(X,g),++x}else v+=o,++x}}catch(P){b.e(P)}finally{b.f()}var H=v-Ql,W=cu(s),J=W.horizontalAlign,Y=W.verticalAlign;(function(e,t,r,i,n,a,o,s,l){var u=(t-r)*n,c=0;c=a!==o?-s*i-Ql:(-i*l+.5)*o;var h,p=K(e);try{for(p.s();!(h=p.n()).done;){var f,d=K(h.value.positionedGlyphs);try{for(d.s();!(f=d.n()).done;){var m=f.value;m.x+=u,m.y+=c}}catch(P){d.e(P)}finally{d.f()}}}catch(P){p.e(P)}finally{p.f()}})(t.positionedLines,_,J,Y,y,g,o,H,a.length),t.top+=-Y*H,t.bottom=t.top+H,t.left+=-J*y,t.right=t.left+y}(M,r,i,n,y,s,l,u,p,c,f,v),!function(e){var t,r=K(e);try{for(r.s();!(t=r.n()).done;)if(0!==t.value.positionedGlyphs.length)return!1}catch(P){r.e(P)}finally{r.f()}return!0}(A)&&M}var ru={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},iu={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function nu(e,t,r,i,n,a){if(t.imageName){var o=i[t.imageName];return o?o.displaySize[0]*t.scale*wl/a+n:0}var s=r[t.fontStack],l=s&&s[e];return l?l.metrics.advance*t.scale+n:0}function au(e,t,r,i){var n=Math.pow(e-t,2);return i?e<t?n/2:2*n:n+Math.abs(r)*r}function ou(e,t,r){var i=0;return 10===e&&(i-=1e4),r&&(i+=150),40!==e&&65288!==e||(i+=50),41!==t&&65289!==t||(i+=50),i}function su(e,t,r,i,n,a){var o,s=null,l=au(t,r,n,a),u=K(i);try{for(u.s();!(o=u.n()).done;){var c=o.value,h=au(t-c.x,r,n,a)+c.badness;h<=l&&(s=c,l=h)}}catch(p){u.e(p)}finally{u.f()}return{index:e,x:t,priorBreak:s,badness:l}}function lu(e){return e?lu(e.priorBreak).concat(e.index):[]}function uu(e,t,r,i,n,a,o){if("point"!==a)return[];if(!e)return[];for(var s,l=[],u=function(e,t,r,i,n,a){for(var o=0,s=0;s<e.length();s++){var l=e.getSection(s);o+=nu(e.getCharCode(s),l,i,n,t,a)}return o/Math.max(1,Math.ceil(o/r))}(e,t,r,i,n,o),c=e.text.indexOf("")>=0,h=0,p=0;p<e.length();p++){var f=e.getSection(p),d=e.getCharCode(p);if(ru[d]||(h+=nu(d,f,i,n,t,o)),p<e.length()-1){var m=!((s=d)<11904||!(Ki["Bopomofo Extended"](s)||Ki.Bopomofo(s)||Ki["CJK Compatibility Forms"](s)||Ki["CJK Compatibility Ideographs"](s)||Ki["CJK Compatibility"](s)||Ki["CJK Radicals Supplement"](s)||Ki["CJK Strokes"](s)||Ki["CJK Symbols and Punctuation"](s)||Ki["CJK Unified Ideographs Extension A"](s)||Ki["CJK Unified Ideographs"](s)||Ki["Enclosed CJK Letters and Months"](s)||Ki["Halfwidth and Fullwidth Forms"](s)||Ki.Hiragana(s)||Ki["Ideographic Description Characters"](s)||Ki["Kangxi Radicals"](s)||Ki["Katakana Phonetic Extensions"](s)||Ki.Katakana(s)||Ki["Vertical Forms"](s)||Ki["Yi Radicals"](s)||Ki["Yi Syllables"](s)));(iu[d]||m||f.imageName)&&l.push(su(p+1,h,u,l,ou(d,e.getCharCode(p+1),m&&c),!1))}}return lu(su(e.length(),h,u,l,0,!0))}function cu(e){var t=.5,r=.5;switch(e){case"right":case"top-right":case"bottom-right":t=1;break;case"left":case"top-left":case"bottom-left":t=0}switch(e){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:t,verticalAlign:r}}function hu(e,t,r,i,n){if(i||n)for(var a=e[r],o=(e[r].x+a.metrics.advance*a.scale)*i,s=t;s<=r;s++)e[s].x-=o,e[s].y+=n}function pu(e,t,r){var i=cu(r),n=i.horizontalAlign,a=i.verticalAlign,o=t[0]-e.displaySize[0]*n,s=t[1]-e.displaySize[1]*a;return{image:e,top:s,bottom:s+e.displaySize[1],left:o,right:o+e.displaySize[0]}}function fu(e,t,r,i,n,a){var o,s=e.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 c,h,p,f,d=t.left*a,m=t.right*a;"width"===r||"both"===r?(f=n[0]+d-i[3],h=n[0]+m+i[1]):h=(f=n[0]+(d+m-s.displaySize[0])/2)+s.displaySize[0];var v=t.top*a,y=t.bottom*a;return"height"===r||"both"===r?(c=n[1]+v-i[0],p=n[1]+y+i[2]):p=(c=n[1]+(v+y-s.displaySize[1])/2)+s.displaySize[1],{image:s,top:c,right:h,bottom:p,left:f,collisionPadding:o}}var du=128;function mu(e,t){var r=t.expression;if("constant"===r.kind)return{kind:"constant",layoutSize:r.evaluate(new yn(e+1))};if("source"===r.kind)return{kind:"source"};for(var i=r.zoomStops,n=r.interpolationType,a=0;a<i.length&&i[a]<=e;)a++;for(var o=a=Math.max(0,a-1);o<i.length&&i[o]<e+1;)o++;o=Math.min(i.length-1,o);var s=i[a],l=i[o];return"composite"===r.kind?{kind:"composite",minZoom:s,maxZoom:l,interpolationType:n}:{kind:"camera",minZoom:s,maxZoom:l,minSize:r.evaluate(new yn(s)),maxSize:r.evaluate(new yn(l)),interpolationType:n}}var vu=function(e){A(r,e);var t=M(r);function r(e,i,n,a){var o;return j(this,r),(o=t.call(this,e,i)).angle=n,void 0!==a&&(o.segment=a),o}return q(r,[{key:"clone",value:function(){return new r(this.x,this.y,this.angle,this.segment)}}]),r}(T);function yu(e,t,r,i,n){if(void 0===t.segment)return!0;for(var a=t,o=t.segment+1,s=0;s>-r/2;){if(--o<0)return!1;s-=e[o].dist(a),a=e[o]}s+=e[o].dist(e[o+1]),o++;for(var l=[],u=0;s<r/2;){var c=e[o],h=e[o+1];if(!h)return!1;var p=e[o-1].angleTo(c)-c.angleTo(h);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>i;)u-=l.shift().angleDelta;if(u>n)return!1;o++,s+=c.dist(h)}return!0}function gu(e){for(var t=0,r=0;r<e.length-1;r++)t+=e[r].dist(e[r+1]);return t}function _u(e,t,r){return e?.6*t*r:0}function xu(e,t){return Math.max(e?e.right-e.left:0,t?t.right-t.left:0)}function bu(e,t,r,i,n,a){for(var o=_u(r,n,a),s=xu(r,i)*a,l=0,u=gu(e)/2,c=0;c<e.length-1;c++){var h=e[c],p=e[c+1],f=h.dist(p);if(l+f>u){var d=(u-l)/f,m=jt(h.x,p.x,d),v=jt(h.y,p.y,d),y=new vu(m,v,p.angleTo(h),c);return y._round(),!o||yu(e,y,s,o,t)?y:void 0}l+=f}}function wu(e,t,r,i,n,a,o,s,l){var u=_u(i,a,o),c=xu(i,n),h=c*o,p=0===e[0].x||e[0].x===l||0===e[0].y||e[0].y===l;return t-h<t/4&&(t=h+t/4),ku(e,p?t/2*s%t:(c/2+2*a)*o*s%t,t,u,r,h,p,!1,l)}function ku(e,t,r,i,n,a,o,s,l){for(var u=a/2,c=gu(e),h=0,p=t-r,f=[],d=0;d<e.length-1;d++){for(var m=e[d],v=e[d+1],y=m.dist(v),g=v.angleTo(m);p+r<h+y;){var _=((p+=r)-h)/y,x=jt(m.x,v.x,_),b=jt(m.y,v.y,_);if(x>=0&&x<l&&b>=0&&b<l&&p-u>=0&&p+u<=c){var w=new vu(x,b,g,d);w._round(),i&&!yu(e,w,a,i,n)||f.push(w)}}h+=y}return s||f.length||o||(f=ku(e,h/2,r,i,n,a,o,!0,l)),f}function Eu(e,t,r,i,n){for(var a=[],o=0;o<e.length;o++)for(var s=e[o],l=void 0,u=0;u<s.length-1;u++){var c=s[u],h=s[u+1];c.x<t&&h.x<t||(c.x<t?c=new T(t,c.y+(t-c.x)/(h.x-c.x)*(h.y-c.y))._round():h.x<t&&(h=new T(t,c.y+(t-c.x)/(h.x-c.x)*(h.y-c.y))._round()),c.y<r&&h.y<r||(c.y<r?c=new T(c.x+(r-c.y)/(h.y-c.y)*(h.x-c.x),r)._round():h.y<r&&(h=new T(c.x+(r-c.y)/(h.y-c.y)*(h.x-c.x),r)._round()),c.x>=i&&h.x>=i||(c.x>=i?c=new T(i,c.y+(i-c.x)/(h.x-c.x)*(h.y-c.y))._round():h.x>=i&&(h=new T(i,c.y+(i-c.x)/(h.x-c.x)*(h.y-c.y))._round()),c.y>=n&&h.y>=n||(c.y>=n?c=new T(c.x+(n-c.y)/(h.y-c.y)*(h.x-c.x),n)._round():h.y>=n&&(h=new T(c.x+(n-c.y)/(h.y-c.y)*(h.x-c.x),n)._round()),l&&c.equals(l[l.length-1])||(l=[c],a.push(l)),l.push(h)))))}return a}function Tu(e,t,r,i){var n=[],a=e.image,o=a.pixelRatio,s=a.paddedRect.w-2,l=a.paddedRect.h-2,u=e.right-e.left,c=e.bottom-e.top,h=a.stretchX||[[0,s]],p=a.stretchY||[[0,l]],f=function(e,t){return e+t[1]-t[0]},d=h.reduce(f,0),m=p.reduce(f,0),v=s-d,y=l-m,g=0,_=d,x=0,b=m,w=0,k=v,E=0,S=y;if(a.content&&i){var C=a.content;g=Su(h,0,C[0]),x=Su(p,0,C[1]),_=Su(h,C[0],C[2]),b=Su(p,C[1],C[3]),w=C[0]-g,E=C[1]-x,k=C[2]-C[0]-_,S=C[3]-C[1]-b}var I=function(i,n,s,l){var h=Iu(i.stretch-g,_,u,e.left),p=zu(i.fixed-w,k,i.stretch,d),f=Iu(n.stretch-x,b,c,e.top),v=zu(n.fixed-E,S,n.stretch,m),y=Iu(s.stretch-g,_,u,e.left),C=zu(s.fixed-w,k,s.stretch,d),I=Iu(l.stretch-x,b,c,e.top),z=zu(l.fixed-E,S,l.stretch,m),A=new T(h,f),M=new T(y,f),P=new T(y,I),D=new T(h,I),L=new T(p/o,v/o),R=new T(C/o,z/o),B=t*Math.PI/180;if(B){var F=Math.sin(B),O=Math.cos(B),V=[O,-F,F,O];A._matMult(V),M._matMult(V),D._matMult(V),P._matMult(V)}var U=i.stretch+i.fixed,N=n.stretch+n.fixed;return{tl:A,tr:M,bl:D,br:P,tex:{x:a.paddedRect.x+1+U,y:a.paddedRect.y+1+N,w:s.stretch+s.fixed-U,h:l.stretch+l.fixed-N},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:L,pixelOffsetBR:R,minFontScaleX:k/o/u,minFontScaleY:S/o/c,isSDF:r}};if(i&&(a.stretchX||a.stretchY))for(var z=Cu(h,v,d),A=Cu(p,y,m),M=0;M<z.length-1;M++)for(var P=z[M],D=z[M+1],L=0;L<A.length-1;L++)n.push(I(P,A[L],D,A[L+1]));else n.push(I({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:s+1},{fixed:0,stretch:l+1}));return n}function Su(e,t,r){var i,n=0,a=K(e);try{for(a.s();!(i=a.n()).done;){var o=i.value;n+=Math.max(t,Math.min(r,o[1]))-Math.max(t,Math.min(r,o[0]))}}catch(s){a.e(s)}finally{a.f()}return n}function Cu(e,t,r){var i,n=[{fixed:-1,stretch:0}],a=K(e);try{for(a.s();!(i=a.n()).done;){var o=V(i.value,2),s=o[0],l=o[1],u=n[n.length-1];n.push({fixed:s-u.stretch,stretch:u.stretch}),n.push({fixed:s-u.stretch,stretch:u.stretch+(l-s)})}}catch(c){a.e(c)}finally{a.f()}return n.push({fixed:t+1,stretch:r}),n}function Iu(e,t,r,i){return e/t*r+i}function zu(e,t,r,i){return e-t*r/i}Gi("Anchor",vu);var Au=q((function e(t,r,i,n,a,o,s,l,u,c){if(j(this,e),this.boxStartIndex=t.length,u){var h=o.top,p=o.bottom,f=o.collisionPadding;f&&(h-=f[1],p+=f[3]);var d=p-h;d>0&&(d=Math.max(10,d),this.circleDiameter=d)}else{var m=o.top*s-l[0],v=o.bottom*s+l[2],y=o.left*s-l[3],g=o.right*s+l[1],_=o.collisionPadding;if(_&&(y-=_[0]*s,m-=_[1]*s,g+=_[2]*s,v+=_[3]*s),c){var x=new T(y,m),b=new T(g,m),w=new T(y,v),k=new T(g,v),E=c*Math.PI/180;x._rotate(E),b._rotate(E),w._rotate(E),k._rotate(E),y=Math.min(x.x,b.x,w.x,k.x),g=Math.max(x.x,b.x,w.x,k.x),m=Math.min(x.y,b.y,w.y,k.y),v=Math.max(x.y,b.y,w.y,k.y)}t.emplaceBack(r.x,r.y,y,m,g,v,i,n,a)}this.boxEndIndex=t.length})),Mu=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Pu;if(j(this,e),this.data=t,this.length=this.data.length,this.compare=r,this.length>0)for(var i=(this.length>>1)-1;i>=0;i--)this._down(i)}return q(e,[{key:"push",value:function(e){this.data.push(e),this.length++,this._up(this.length-1)}},{key:"pop",value:function(){if(0!==this.length){var e=this.data[0],t=this.data.pop();return this.length--,this.length>0&&(this.data[0]=t,this._down(0)),e}}},{key:"peek",value:function(){return this.data[0]}},{key:"_up",value:function(e){for(var t=this.data,r=this.compare,i=t[e];e>0;){var n=e-1>>1,a=t[n];if(r(i,a)>=0)break;t[e]=a,e=n}t[e]=i}},{key:"_down",value:function(e){for(var t=this.data,r=this.compare,i=this.length>>1,n=t[e];e<i;){var a=1+(e<<1),o=t[a],s=a+1;if(s<this.length&&r(t[s],o)<0&&(a=s,o=t[s]),r(o,n)>=0)break;t[e]=o,e=a}t[e]=n}}]),e}();function Pu(e,t){return e<t?-1:e>t?1:0}function Du(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=1/0,n=1/0,a=-1/0,o=-1/0,s=e[0],l=0;l<s.length;l++){var u=s[l];(!l||u.x<i)&&(i=u.x),(!l||u.y<n)&&(n=u.y),(!l||u.x>a)&&(a=u.x),(!l||u.y>o)&&(o=u.y)}var c=Math.min(a-i,o-n),h=c/2,p=new Mu([],Lu);if(0===c)return new T(i,n);for(var f=i;f<a;f+=c)for(var d=n;d<o;d+=c)p.push(new Ru(f+h,d+h,h,e));for(var m=function(e){for(var t=0,r=0,i=0,n=e[0],a=0,o=n.length,s=o-1;a<o;s=a++){var l=n[a],u=n[s],c=l.x*u.y-u.x*l.y;r+=(l.x+u.x)*c,i+=(l.y+u.y)*c,t+=3*c}return new Ru(r/t,i/t,0,e)}(e),v=p.length;p.length;){var y=p.pop();(y.d>m.d||!m.d)&&(m=y,r&&console.log("found best %d after %d probes",Math.round(1e4*y.d)/1e4,v)),y.max-m.d<=t||(h=y.h/2,p.push(new Ru(y.p.x-h,y.p.y-h,h,e)),p.push(new Ru(y.p.x+h,y.p.y-h,h,e)),p.push(new Ru(y.p.x-h,y.p.y+h,h,e)),p.push(new Ru(y.p.x+h,y.p.y+h,h,e)),v+=4)}return r&&(console.log("num probes: ".concat(v)),console.log("best distance: ".concat(m.d))),m.p}function Lu(e,t){return t.max-e.max}function Ru(e,t,r,i){this.p=new T(e,t),this.h=r,this.d=function(e,t){for(var r=!1,i=1/0,n=0;n<t.length;n++)for(var a=t[n],o=0,s=a.length,l=s-1;o<s;l=o++){var u=a[o],c=a[l];u.y>e.y!=c.y>e.y&&e.x<(c.x-u.x)*(e.y-u.y)/(c.y-u.y)+u.x&&(r=!r),i=Math.min(i,xo(e,u,c))}return(r?1:-1)*Math.sqrt(i)}(this.p,i),this.max=this.d+this.h*Math.SQRT2}var Bu=Number.POSITIVE_INFINITY;function Fu(e,t){return t[1]!==Bu?function(e,t,r){var i=0,n=0;switch(t=Math.abs(t),r=Math.abs(r),e){case"top-right":case"top-left":case"top":n=r-7;break;case"bottom-right":case"bottom-left":case"bottom":n=7-r}switch(e){case"top-right":case"bottom-right":case"right":i=-t;break;case"top-left":case"bottom-left":case"left":i=t}return[i,n]}(e,t[0],t[1]):function(e,t){var r=0,i=0;t<0&&(t=0);var n=t/Math.sqrt(2);switch(e){case"top-right":case"top-left":i=n-7;break;case"bottom-right":case"bottom-left":i=7-n;break;case"bottom":i=7-t;break;case"top":i=t-7}switch(e){case"top-right":case"bottom-right":r=-n;break;case"top-left":case"bottom-left":r=n;break;case"left":r=t;break;case"right":r=-t}return[r,i]}(e,t[0])}function Ou(e){switch(e){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Vu(t,r,i,n,a,o,s,l,u,c,h){var p=o.textMaxSize.evaluate(r,{});void 0===p&&(p=s);var f,m=t.layers[0].layout,v=m.get("icon-offset").evaluate(r,{},h),y=ju(i.horizontal),g=s/24,_=t.tilePixelRatio*g,x=t.tilePixelRatio*p/24,b=t.tilePixelRatio*l,w=t.tilePixelRatio*m.get("symbol-spacing"),k=m.get("text-padding")*t.tilePixelRatio,E=function(e,t,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,n=e.get("icon-padding").evaluate(t,{},r),a=n&&n.values;return[a[0]*i,a[1]*i,a[2]*i,a[3]*i]}(m,r,h,t.tilePixelRatio),T=m.get("text-max-angle")/180*Math.PI,S="viewport"!==m.get("text-rotation-alignment")&&"point"!==m.get("symbol-placement"),C="map"===m.get("icon-rotation-alignment")&&"point"!==m.get("symbol-placement"),I=m.get("symbol-placement"),z=w/2,A=m.get("icon-text-fit");n&&"none"!==A&&(t.allowVerticalPlacement&&i.vertical&&(f=fu(n,i.vertical,A,m.get("icon-text-fit-padding"),v,g)),y&&(n=fu(n,y,A,m.get("icon-text-fit-padding"),v,g)));var M=function(l,p){p.x<0||p.x>=ao||p.y<0||p.y>=ao||function(t,r,i,n,a,o,s,l,u,c,h,p,f,m,v,y,g,_,x,b,w,k,E,T,S){var C,I,z,A,M,P,D=t.addToLineVertexArray(r,i),L=0,R=0,B=0,F=0,O=-1,U=-1,N={},j=Ra.exports(""),G=0,q=0;if(void 0===l._unevaluatedLayout.getValue("text-radial-offset")?(C=l.layout.get("text-offset").evaluate(w,{},T).map((function(e){return e*wl})),G=(I=V(C,2))[0],q=I[1]):(G=l.layout.get("text-radial-offset").evaluate(w,{},T)*wl,q=Bu),t.allowVerticalPlacement&&n.vertical){var Z=l.layout.get("text-rotate").evaluate(w,{},T)+90;M=new Au(u,r,c,h,p,n.vertical,f,m,v,Z),s&&(P=new Au(u,r,c,h,p,s,g,_,v,Z))}if(a){var X=l.layout.get("icon-rotate").evaluate(w,{}),H="none"!==l.layout.get("icon-text-fit"),W=Tu(a,X,E,H),K=s?Tu(s,X,E,H):void 0;A=new Au(u,r,c,h,p,a,g,_,!1,X),L=4*W.length;var J=t.iconSizeData,Y=null;"source"===J.kind?(Y=[du*l.layout.get("icon-size").evaluate(w,{})])[0]>Uu&&d("".concat(t.layerIds[0],': Value for "icon-size" is >= 255. Reduce your "icon-size".')):"composite"===J.kind&&((Y=[du*k.compositeIconSizes[0].evaluate(w,{},T),du*k.compositeIconSizes[1].evaluate(w,{},T)])[0]>Uu||Y[1]>Uu)&&d("".concat(t.layerIds[0],': Value for "icon-size" is >= 255. Reduce your "icon-size".')),t.addSymbols(t.icon,W,Y,b,x,w,e.WritingMode.none,r,D.lineStartIndex,D.lineLength,-1,T),O=t.icon.placedSymbolArray.length-1,K&&(R=4*K.length,t.addSymbols(t.icon,K,Y,b,x,w,e.WritingMode.vertical,r,D.lineStartIndex,D.lineLength,-1,T),U=t.icon.placedSymbolArray.length-1)}for(var Q=Object.keys(n.horizontal),$=0,ee=Q;$<ee.length;$++){var te=ee[$],re=n.horizontal[te];if(!z){j=Ra.exports(re.text);var ie=l.layout.get("text-rotate").evaluate(w,{},T);z=new Au(u,r,c,h,p,re,f,m,v,ie)}var ne=1===re.positionedLines.length;if(B+=Nu(t,r,re,o,l,v,w,y,D,n.vertical?e.WritingMode.horizontal:e.WritingMode.horizontalOnly,ne?Q:[te],N,O,k,T),ne)break}n.vertical&&(F+=Nu(t,r,n.vertical,o,l,v,w,y,D,e.WritingMode.vertical,["vertical"],N,U,k,T));var ae=z?z.boxStartIndex:t.collisionBoxArray.length,oe=z?z.boxEndIndex:t.collisionBoxArray.length,se=M?M.boxStartIndex:t.collisionBoxArray.length,le=M?M.boxEndIndex:t.collisionBoxArray.length,ue=A?A.boxStartIndex:t.collisionBoxArray.length,ce=A?A.boxEndIndex:t.collisionBoxArray.length,he=P?P.boxStartIndex:t.collisionBoxArray.length,pe=P?P.boxEndIndex:t.collisionBoxArray.length,fe=-1,de=function(e,t){return e&&e.circleDiameter?Math.max(e.circleDiameter,t):t};fe=de(z,fe),fe=de(M,fe),fe=de(A,fe);var me=(fe=de(P,fe))>-1?1:0;me&&(fe*=S/wl),t.glyphOffsetArray.length>=Yu.MAX_GLYPHS&&d("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==w.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,w.sortKey),t.symbolInstances.emplaceBack(r.x,r.y,N.right>=0?N.right:-1,N.center>=0?N.center:-1,N.left>=0?N.left:-1,N.vertical||-1,O,U,j,ae,oe,se,le,ue,ce,he,pe,c,B,F,L,R,me,0,f,G,q,fe)}(t,p,l,i,n,a,f,t.layers[0],t.collisionBoxArray,r.index,r.sourceLayerIndex,t.index,_,[k,k,k,k],S,u,b,E,C,v,r,o,c,h,s)};if("line"===I){var P,D=K(Eu(r.geometry,0,0,ao,ao));try{for(D.s();!(P=D.n()).done;){var L,R=P.value,B=K(wu(R,w,T,i.vertical||y,n,24,x,t.overscaling,ao));try{for(B.s();!(L=B.n()).done;){var F=L.value;y&&Gu(t,y.text,z,F)||M(R,F)}}catch(re){B.e(re)}finally{B.f()}}}catch(re){D.e(re)}finally{D.f()}}else if("line-center"===I){var O,U=K(r.geometry);try{for(U.s();!(O=U.n()).done;){var N=O.value;if(N.length>1){var j=bu(N,T,i.vertical||y,n,24,x);j&&M(N,j)}}}catch(re){U.e(re)}finally{U.f()}}else if("Polygon"===r.type){var G,q=K(Is(r.geometry,0));try{for(q.s();!(G=q.n()).done;){var Z=G.value,X=Du(Z,16);M(Z[0],new vu(X.x,X.y,0))}}catch(re){q.e(re)}finally{q.f()}}else if("LineString"===r.type){var H,W=K(r.geometry);try{for(W.s();!(H=W.n()).done;){var J=H.value;M(J,new vu(J[0].x,J[0].y,0))}}catch(re){W.e(re)}finally{W.f()}}else if("Point"===r.type){var Y,Q=K(r.geometry);try{for(Q.s();!(Y=Q.n()).done;){var $,ee=K(Y.value);try{for(ee.s();!($=ee.n()).done;){var te=$.value;M([te],new vu(te.x,te.y,0))}}catch(re){ee.e(re)}finally{ee.f()}}}catch(re){Q.e(re)}finally{Q.f()}}}var Uu=32640;function Nu(e,t,r,i,n,a,o,s,l,u,c,h,p,f,m){var v=function(e,t,r,i,n,a,o,s){var l,u=i.layout.get("text-rotate").evaluate(a,{})*Math.PI/180,c=[],h=K(t.positionedLines);try{for(h.s();!(l=h.n()).done;){var p,f=l.value,d=K(f.positionedGlyphs);try{for(d.s();!(p=d.n()).done;){var m=p.value;if(m.rect){var v=m.rect||{},y=4,g=!0,_=1,x=0,b=(n||s)&&m.vertical,w=m.metrics.advance*m.scale/2;if(s&&t.verticalizable){var k=(m.scale-1)*wl,E=(wl-m.metrics.width*m.scale)/2;x=f.lineOffset/2-(m.imageName?-E:k)}if(m.imageName){var S=o[m.imageName];g=S.sdf,y=1/(_=S.pixelRatio)}var C=n?[m.x+w,m.y]:[0,0],z=n?[0,0]:[m.x+w+r[0],m.y+r[1]-x],A=[0,0];b&&(A=z,z=[0,0]);var M=(m.metrics.left-y)*m.scale-w+z[0],P=(-m.metrics.top-y)*m.scale+z[1],D=M+v.w*m.scale/_,L=P+v.h*m.scale/_,B=new T(M,P),F=new T(D,P),O=new T(M,L),V=new T(D,L);if(b){var U=new T(-w,w-Ql),N=-Math.PI/2,j=12-w,G=new T(22-j,-(m.imageName?j:0)),q=R(T,I(A));B._rotateAround(N,U)._add(G)._add(q),F._rotateAround(N,U)._add(G)._add(q),O._rotateAround(N,U)._add(G)._add(q),V._rotateAround(N,U)._add(G)._add(q)}if(u){var Z=Math.sin(u),X=Math.cos(u),H=[X,-Z,Z,X];B._matMult(H),F._matMult(H),O._matMult(H),V._matMult(H)}var W=new T(0,0),J=new T(0,0);c.push({tl:B,tr:F,bl:O,br:V,tex:v,writingMode:t.writingMode,glyphOffset:C,sectionIndex:m.sectionIndex,isSDF:g,pixelOffsetTL:W,pixelOffsetBR:J,minFontScaleX:0,minFontScaleY:0})}}}catch(Y){d.e(Y)}finally{d.f()}}}catch(Y){h.e(Y)}finally{h.f()}return c}(0,r,s,n,a,o,i,e.allowVerticalPlacement),y=e.textSizeData,g=null;"source"===y.kind?(g=[du*n.layout.get("text-size").evaluate(o,{})])[0]>Uu&&d("".concat(e.layerIds[0],': Value for "text-size" is >= 255. Reduce your "text-size".')):"composite"===y.kind&&((g=[du*f.compositeTextSizes[0].evaluate(o,{},m),du*f.compositeTextSizes[1].evaluate(o,{},m)])[0]>Uu||g[1]>Uu)&&d("".concat(e.layerIds[0],': Value for "text-size" is >= 255. Reduce your "text-size".')),e.addSymbols(e.text,v,g,s,a,o,u,t,l.lineStartIndex,l.lineLength,p,m);var _,x=K(c);try{for(x.s();!(_=x.n()).done;)h[_.value]=e.text.placedSymbolArray.length-1}catch(b){x.e(b)}finally{x.f()}return 4*v.length}function ju(e){for(var t in e)return e[t];return null}function Gu(e,t,r,i){var n=e.compareText;if(t in n){for(var a=n[t],o=a.length-1;o>=0;o--)if(i.dist(a[o])<r)return!0}else n[t]=[];return n[t].push(i),!1}var qu=Os.VectorTileFeature.types,Zu=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Xu(e,t,r,i,n,a,o,s,l,u,c,h,p){var f=s?Math.min(Uu,Math.round(s[0])):0,d=s?Math.min(Uu,Math.round(s[1])):0;e.emplaceBack(t,r,Math.round(32*i),Math.round(32*n),a,o,(f<<1)+(l?1:0),d,16*u,16*c,256*h,256*p)}function Hu(e,t,r){e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r)}function Wu(e){var t,r=K(e.sections);try{for(r.s();!(t=r.n()).done;)if(nn(t.value.text))return!0}catch(i){r.e(i)}finally{r.f()}return!1}var Ku=function(){function e(t){j(this,e),this.layoutVertexArray=new Ea,this.indexArray=new za,this.programConfigurations=t,this.segments=new Pa,this.dynamicLayoutVertexArray=new Ta,this.opacityVertexArray=new Sa,this.placedSymbolArray=new ca}return q(e,[{key:"isEmpty",value:function(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length}},{key:"upload",value:function(e,t,r,i){this.isEmpty()||(r&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,ml.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,t),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,vl.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,Zu,!0),this.opacityVertexBuffer.itemSize=1),(r||i)&&this.programConfigurations.upload(e))}},{key:"destroy",value:function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}]),e}();Gi("SymbolBuffers",Ku);var Ju=function(){function e(t,r,i){j(this,e),this.layoutVertexArray=new t,this.layoutAttributes=r,this.indexArray=new i,this.segments=new Pa,this.collisionVertexArray=new Ia}return q(e,[{key:"upload",value:function(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,yl.members,!0)}},{key:"destroy",value:function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}]),e}();Gi("CollisionBuffers",Ju);var Yu=function(){function t(r){j(this,t),this.collisionBoxArray=r.collisionBoxArray,this.zoom=r.zoom,this.overscaling=r.overscaling,this.layers=r.layers,this.layerIds=this.layers.map((function(e){return e.id})),this.index=r.index,this.pixelRatio=r.pixelRatio,this.sourceLayerIndex=r.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Po([]),this.placementViewportMatrix=Po([]);var i=this.layers[0]._unevaluatedLayout._values;this.textSizeData=mu(this.zoom,i["text-size"]),this.iconSizeData=mu(this.zoom,i["icon-size"]);var n=this.layers[0].layout,a=n.get("symbol-sort-key"),o=n.get("symbol-z-order");this.canOverlap="never"!==rc(n,"text-overlap","text-allow-overlap")||"never"!==rc(n,"icon-overlap","icon-allow-overlap")||n.get("text-ignore-placement")||n.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==o&&!a.isConstant(),this.sortFeaturesByY=("viewport-y"===o||"auto"===o&&!this.sortFeaturesByKey)&&this.canOverlap,"point"===n.get("symbol-placement")&&(this.writingModes=n.get("text-writing-mode").map((function(t){return e.WritingMode[t]}))),this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id})),this.sourceID=r.sourceID}return q(t,[{key:"createArrays",value:function(){this.text=new Ku(new ro(this.layers,this.zoom,(function(e){return/^text/.test(e)}))),this.icon=new Ku(new ro(this.layers,this.zoom,(function(e){return/^icon/.test(e)}))),this.glyphOffsetArray=new fa,this.lineVertexArray=new da,this.symbolInstances=new pa}},{key:"calculateGlyphDependencies",value:function(e,t,r,i,n){for(var a=0;a<e.length;a++)if(t[e.charCodeAt(a)]=!0,(r||i)&&n){var o=bl[e.charAt(a)];o&&(t[o.charCodeAt(0)]=!0)}}},{key:"populate",value:function(t,r,i){var n=this.layers[0],a=n.layout,o=a.get("text-font"),s=a.get("text-field"),l=a.get("icon-image"),u=("constant"!==s.value.kind||s.value.value instanceof et&&!s.value.value.isEmpty()||s.value.value.toString().length>0)&&("constant"!==o.value.kind||o.value.value.length>0),c="constant"!==l.value.kind||!!l.value.value||Object.keys(l.parameters).length>0,h=a.get("symbol-sort-key");if(this.features=[],u||c){var p,f=r.iconDependencies,d=r.glyphDependencies,m=r.availableImages,v=new yn(this.zoom),y=K(t);try{for(y.s();!(p=y.n()).done;){var g=p.value,_=g.feature,x=g.id,b=g.index,w=g.sourceLayerIndex,k=n._featureFilter.needGeometry,E=uo(_,k);if(n._featureFilter.filter(v,E,i)){var T=void 0,S=void 0;if(k||(E.geometry=lo(_)),u){var C=n.getValueAndResolveTokens("text-field",E,i,m),I=et.factory(C);Wu(I)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===dn()||this.hasRTLText&&vn.isParsed())&&(T=xl(I,n,E))}if(c){var z=n.getValueAndResolveTokens("icon-image",E,i,m);S=z instanceof rt?z:rt.fromString(z)}if(T||S){var A=this.sortFeaturesByKey?h.evaluate(E,{},i):void 0;if(this.features.push({id:x,text:T,icon:S,index:b,sourceLayerIndex:w,geometry:E.geometry,properties:_.properties,type:qu[_.type],sortKey:A}),S&&(f[S.name]=!0),T){var M=o.evaluate(E,{},i).join(","),P="viewport"!==a.get("text-rotation-alignment")&&"point"!==a.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(e.WritingMode.vertical)>=0;var D,L=K(T.sections);try{for(L.s();!(D=L.n()).done;){var R=D.value;if(R.image)f[R.image.name]=!0;else{var B=Ji(T.toString()),F=R.fontStack||M,O=d[F]=d[F]||{};this.calculateGlyphDependencies(R.text,O,P,this.allowVerticalPlacement,B)}}}catch(V){L.e(V)}finally{L.f()}}}}}}catch(V){y.e(V)}finally{y.f()}"line"===a.get("symbol-placement")&&(this.features=function(e){var t={},r={},i=[],n=0;function a(t){i.push(e[t]),n++}function o(e,t,n){var a=r[e];return delete r[e],r[t]=a,i[a].geometry[0].pop(),i[a].geometry[0]=i[a].geometry[0].concat(n[0]),a}function s(e,r,n){var a=t[r];return delete t[r],t[e]=a,i[a].geometry[0].shift(),i[a].geometry[0]=n[0].concat(i[a].geometry[0]),a}function l(e,t,r){var i=r?t[0][t[0].length-1]:t[0][0];return"".concat(e,":").concat(i.x,":").concat(i.y)}for(var u=0;u<e.length;u++){var c=e[u],h=c.geometry,p=c.text?c.text.toString():null;if(p){var f=l(p,h),d=l(p,h,!0);if(f in r&&d in t&&r[f]!==t[d]){var m=s(f,d,h),v=o(f,d,i[m].geometry);delete t[f],delete r[d],r[l(p,i[v].geometry,!0)]=v,i[m].geometry=null}else f in r?o(f,d,h):d in t?s(f,d,h):(a(u),t[f]=n-1,r[d]=n-1)}else a(u)}return i.filter((function(e){return e.geometry}))}(this.features)),this.sortFeaturesByKey&&this.features.sort((function(e,t){return e.sortKey-t.sortKey}))}}},{key:"update",value:function(e,t,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,t,this.layers,r),this.icon.programConfigurations.updatePaintArrays(e,t,this.layers,r))}},{key:"isEmpty",value:function(){return 0===this.symbolInstances.length&&!this.hasRTLText}},{key:"uploadPending",value:function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}},{key:"upload",value:function(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}},{key:"destroyDebugData",value:function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}},{key:"destroy",value:function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}},{key:"addToLineVertexArray",value:function(e,t){var r=this.lineVertexArray.length;if(void 0!==e.segment){for(var i=e.dist(t[e.segment+1]),n=e.dist(t[e.segment]),a={},o=e.segment+1;o<t.length;o++)a[o]={x:t[o].x,y:t[o].y,tileUnitDistanceFromAnchor:i},o<t.length-1&&(i+=t[o+1].dist(t[o]));for(var s=e.segment||0;s>=0;s--)a[s]={x:t[s].x,y:t[s].y,tileUnitDistanceFromAnchor:n},s>0&&(n+=t[s-1].dist(t[s]));for(var l=0;l<t.length;l++){var u=a[l];this.lineVertexArray.emplaceBack(u.x,u.y,u.tileUnitDistanceFromAnchor)}}return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}}},{key:"addSymbols",value:function(t,r,i,n,a,o,s,l,u,c,h,p){for(var f=t.indexArray,d=t.layoutVertexArray,m=t.segments.prepareSegment(4*r.length,d,f,this.canOverlap?o.sortKey:void 0),v=this.glyphOffsetArray.length,y=m.vertexLength,g=this.allowVerticalPlacement&&s===e.WritingMode.vertical?Math.PI/2:0,_=o.text&&o.text.sections,x=0;x<r.length;x++){var b=r[x],w=b.tl,k=b.tr,E=b.bl,T=b.br,S=b.tex,C=b.pixelOffsetTL,I=b.pixelOffsetBR,z=b.minFontScaleX,A=b.minFontScaleY,M=b.glyphOffset,P=b.isSDF,D=b.sectionIndex,L=m.vertexLength,R=M[1];Xu(d,l.x,l.y,w.x,R+w.y,S.x,S.y,i,P,C.x,C.y,z,A),Xu(d,l.x,l.y,k.x,R+k.y,S.x+S.w,S.y,i,P,I.x,C.y,z,A),Xu(d,l.x,l.y,E.x,R+E.y,S.x,S.y+S.h,i,P,C.x,I.y,z,A),Xu(d,l.x,l.y,T.x,R+T.y,S.x+S.w,S.y+S.h,i,P,I.x,I.y,z,A),Hu(t.dynamicLayoutVertexArray,l,g),f.emplaceBack(L,L+1,L+2),f.emplaceBack(L+1,L+2,L+3),m.vertexLength+=4,m.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(M[0]),x!==r.length-1&&D===r[x+1].sectionIndex||t.programConfigurations.populatePaintArrays(d.length,o,o.index,{},p,_&&_[D])}t.placedSymbolArray.emplaceBack(l.x,l.y,v,this.glyphOffsetArray.length-v,y,u,c,l.segment,i?i[0]:0,i?i[1]:0,n[0],n[1],s,0,!1,0,h)}},{key:"_addCollisionDebugVertex",value:function(e,t,r,i,n,a){return t.emplaceBack(0,0),e.emplaceBack(r.x,r.y,i,n,Math.round(a.x),Math.round(a.y))}},{key:"addCollisionDebugVertices",value:function(e,t,r,i,n,a,o){var s=n.segments.prepareSegment(4,n.layoutVertexArray,n.indexArray),l=s.vertexLength,u=n.layoutVertexArray,c=n.collisionVertexArray,h=o.anchorX,p=o.anchorY;this._addCollisionDebugVertex(u,c,a,h,p,new T(e,t)),this._addCollisionDebugVertex(u,c,a,h,p,new T(r,t)),this._addCollisionDebugVertex(u,c,a,h,p,new T(r,i)),this._addCollisionDebugVertex(u,c,a,h,p,new T(e,i)),s.vertexLength+=4;var f=n.indexArray;f.emplaceBack(l,l+1),f.emplaceBack(l+1,l+2),f.emplaceBack(l+2,l+3),f.emplaceBack(l+3,l),s.primitiveLength+=4}},{key:"addDebugCollisionBoxes",value:function(e,t,r,i){for(var n=e;n<t;n++){var a=this.collisionBoxArray.get(n);this.addCollisionDebugVertices(a.x1,a.y1,a.x2,a.y2,i?this.textCollisionBox:this.iconCollisionBox,a.anchorPoint,r)}}},{key:"generateCollisionDebugBuffers",value:function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new Ju(Ca,gl.members,Aa),this.iconCollisionBox=new Ju(Ca,gl.members,Aa);for(var e=0;e<this.symbolInstances.length;e++){var t=this.symbolInstances.get(e);this.addDebugCollisionBoxes(t.textBoxStartIndex,t.textBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.verticalTextBoxStartIndex,t.verticalTextBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.iconBoxStartIndex,t.iconBoxEndIndex,t,!1),this.addDebugCollisionBoxes(t.verticalIconBoxStartIndex,t.verticalIconBoxEndIndex,t,!1)}}},{key:"_deserializeCollisionBoxesForSymbol",value:function(e,t,r,i,n,a,o,s,l){for(var u={},c=t;c<r;c++){var h=e.get(c);u.textBox={x1:h.x1,y1:h.y1,x2:h.x2,y2:h.y2,anchorPointX:h.anchorPointX,anchorPointY:h.anchorPointY},u.textFeatureIndex=h.featureIndex;break}for(var p=i;p<n;p++){var f=e.get(p);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=e.get(d);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 v=s;v<l;v++){var y=e.get(v);u.verticalIconBox={x1:y.x1,y1:y.y1,x2:y.x2,y2:y.y2,anchorPointX:y.anchorPointX,anchorPointY:y.anchorPointY},u.verticalIconFeatureIndex=y.featureIndex;break}return u}},{key:"deserializeCollisionBoxes",value:function(e){this.collisionArrays=[];for(var t=0;t<this.symbolInstances.length;t++){var r=this.symbolInstances.get(t);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex))}}},{key:"hasTextData",value:function(){return this.text.segments.get().length>0}},{key:"hasIconData",value:function(){return this.icon.segments.get().length>0}},{key:"hasDebugData",value:function(){return this.textCollisionBox&&this.iconCollisionBox}},{key:"hasTextCollisionBoxData",value:function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}},{key:"hasIconCollisionBoxData",value:function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}},{key:"addIndicesForPlacedSymbol",value:function(e,t){for(var r=e.placedSymbolArray.get(t),i=r.vertexStartIndex+4*r.numGlyphs,n=r.vertexStartIndex;n<i;n+=4)e.indexArray.emplaceBack(n,n+1,n+2),e.indexArray.emplaceBack(n+1,n+2,n+3)}},{key:"getSortedSymbolIndexes",value:function(e){if(this.sortedAngle===e&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;for(var t=Math.sin(e),r=Math.cos(e),i=[],n=[],a=[],o=0;o<this.symbolInstances.length;++o){a.push(o);var s=this.symbolInstances.get(o);i.push(0|Math.round(t*s.anchorX+r*s.anchorY)),n.push(s.featureIndex)}return a.sort((function(e,t){return i[e]-i[t]||n[t]-n[e]})),a}},{key:"addToSortKeyRanges",value:function(e,t){var r=this.sortKeyRanges[this.sortKeyRanges.length-1];r&&r.sortKey===t?r.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:t,symbolInstanceStart:e,symbolInstanceEnd:e+1})}},{key:"sortFeatures",value:function(e){var t=this;if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];var r,i=K(this.symbolInstanceIndexes);try{for(i.s();!(r=i.n()).done;){var n=r.value,a=this.symbolInstances.get(n);this.featureSortOrder.push(a.featureIndex),[a.rightJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.leftJustifiedTextSymbolIndex].forEach((function(e,r,i){e>=0&&i.indexOf(e)===r&&t.addIndicesForPlacedSymbol(t.text,e)})),a.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,a.verticalPlacedTextSymbolIndex),a.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.placedIconSymbolIndex),a.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.verticalPlacedIconSymbolIndex)}}catch(o){i.e(o)}finally{i.f()}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}]),t}();Gi("SymbolBucket",Yu,{omit:["layers","collisionBoxArray","features","compareText"]}),Yu.MAX_GLYPHS=65535,Yu.addDynamicAttributes=Hu;var Qu=new Mn({"symbol-placement":new Sn(xe.layout_symbol["symbol-placement"]),"symbol-spacing":new Sn(xe.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Sn(xe.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Cn(xe.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Sn(xe.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Sn(xe.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Sn(xe.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Sn(xe.layout_symbol["icon-ignore-placement"]),"icon-optional":new Sn(xe.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Sn(xe.layout_symbol["icon-rotation-alignment"]),"icon-size":new Cn(xe.layout_symbol["icon-size"]),"icon-text-fit":new Sn(xe.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Sn(xe.layout_symbol["icon-text-fit-padding"]),"icon-image":new Cn(xe.layout_symbol["icon-image"]),"icon-rotate":new Cn(xe.layout_symbol["icon-rotate"]),"icon-padding":new Cn(xe.layout_symbol["icon-padding"]),"icon-keep-upright":new Sn(xe.layout_symbol["icon-keep-upright"]),"icon-offset":new Cn(xe.layout_symbol["icon-offset"]),"icon-anchor":new Cn(xe.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Sn(xe.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Sn(xe.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Sn(xe.layout_symbol["text-rotation-alignment"]),"text-field":new Cn(xe.layout_symbol["text-field"]),"text-font":new Cn(xe.layout_symbol["text-font"]),"text-size":new Cn(xe.layout_symbol["text-size"]),"text-max-width":new Cn(xe.layout_symbol["text-max-width"]),"text-line-height":new Sn(xe.layout_symbol["text-line-height"]),"text-letter-spacing":new Cn(xe.layout_symbol["text-letter-spacing"]),"text-justify":new Cn(xe.layout_symbol["text-justify"]),"text-radial-offset":new Cn(xe.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Sn(xe.layout_symbol["text-variable-anchor"]),"text-anchor":new Cn(xe.layout_symbol["text-anchor"]),"text-max-angle":new Sn(xe.layout_symbol["text-max-angle"]),"text-writing-mode":new Sn(xe.layout_symbol["text-writing-mode"]),"text-rotate":new Cn(xe.layout_symbol["text-rotate"]),"text-padding":new Sn(xe.layout_symbol["text-padding"]),"text-keep-upright":new Sn(xe.layout_symbol["text-keep-upright"]),"text-transform":new Cn(xe.layout_symbol["text-transform"]),"text-offset":new Cn(xe.layout_symbol["text-offset"]),"text-allow-overlap":new Sn(xe.layout_symbol["text-allow-overlap"]),"text-overlap":new Sn(xe.layout_symbol["text-overlap"]),"text-ignore-placement":new Sn(xe.layout_symbol["text-ignore-placement"]),"text-optional":new Sn(xe.layout_symbol["text-optional"])}),$u={paint:new Mn({"icon-opacity":new Cn(xe.paint_symbol["icon-opacity"]),"icon-color":new Cn(xe.paint_symbol["icon-color"]),"icon-halo-color":new Cn(xe.paint_symbol["icon-halo-color"]),"icon-halo-width":new Cn(xe.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Cn(xe.paint_symbol["icon-halo-blur"]),"icon-translate":new Sn(xe.paint_symbol["icon-translate"]),"icon-translate-anchor":new Sn(xe.paint_symbol["icon-translate-anchor"]),"text-opacity":new Cn(xe.paint_symbol["text-opacity"]),"text-color":new Cn(xe.paint_symbol["text-color"],{runtimeType:Pe,getOverride:function(e){return e.textColor},hasOverride:function(e){return!!e.textColor}}),"text-halo-color":new Cn(xe.paint_symbol["text-halo-color"]),"text-halo-width":new Cn(xe.paint_symbol["text-halo-width"]),"text-halo-blur":new Cn(xe.paint_symbol["text-halo-blur"]),"text-translate":new Sn(xe.paint_symbol["text-translate"]),"text-translate-anchor":new Sn(xe.paint_symbol["text-translate-anchor"])}),layout:Qu},ec=function(){function e(t){if(j(this,e),void 0===t.property.overrides)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=t.property.overrides?t.property.overrides.runtimeType:Ie,this.defaultValue=t}return q(e,[{key:"evaluate",value:function(e){if(e.formattedSection){var t=this.defaultValue.property.overrides;if(t&&t.hasOverride(e.formattedSection))return t.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}},{key:"eachChild",value:function(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){return null}}]),e}();Gi("FormatSectionOverride",ec,{omit:["defaultValue"]});var tc=function(e){A(r,e);var t=M(r);function r(e){return j(this,r),t.call(this,e,$u)}return q(r,[{key:"recalculate",value:function(e,t){if(S(O(r.prototype),"recalculate",this).call(this,e,t),"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"]="map"===this.layout.get("text-rotation-alignment")?"map":"viewport"),"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 i=this.layout.get("text-writing-mode");if(i){var n,a=[],o=K(i);try{for(o.s();!(n=o.n()).done;){var s=n.value;a.indexOf(s)<0&&a.push(s)}}catch(l){o.e(l)}finally{o.f()}this.layout._values["text-writing-mode"]=a}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}},{key:"getValueAndResolveTokens",value:function(e,t,r,i){var n=this.layout.get(e).evaluate(t,{},r,i),a=this._unevaluatedLayout._values[e];return a.isDataDriven()||Jr(a.value)||!n?n:function(e,t){return t.replace(/{([^{}]+)}/g,(function(t,r){return r in e?String(e[r]):""}))}(t.properties,n)}},{key:"createBucket",value:function(e){return new Yu(e)}},{key:"queryRadius",value:function(){return 0}},{key:"queryIntersectsFeature",value:function(){throw new Error("Should take a different path in FeatureIndex")}},{key:"_setPaintOverrides",value:function(){var e,t=K($u.paint.overridableProperties);try{for(t.s();!(e=t.n()).done;){var i=e.value;if(r.hasPaintOverride(this.layout,i)){var n=this.paint.get(i),a=new ec(n),o=new Kr(a,n.property.specification),s=null;s="constant"===n.value.kind||"source"===n.value.kind?new Qr("source",o):new $r("composite",o,n.value.zoomStops),this.paint._values[i]=new En(n.property,s,n.parameters)}}}catch(l){t.e(l)}finally{t.f()}}},{key:"_handleOverridablePaintPropertyUpdate",value:function(e,t,i){return!(!this.layout||t.isDataDriven()||i.isDataDriven())&&r.hasPaintOverride(this.layout,e)}}],[{key:"hasPaintOverride",value:function(e,t){var r=e.get("text-field"),i=$u.paint.properties[t],n=!1,a=function(e){var t,r=K(e);try{for(r.s();!(t=r.n()).done;){var a=t.value;if(i.overrides&&i.overrides.hasOverride(a))return void(n=!0)}}catch(o){r.e(o)}finally{r.f()}};if("constant"===r.value.kind&&r.value.value instanceof et)a(r.value.value.sections);else if("source"===r.value.kind){var o=function e(t){n||(t instanceof st&&at(t.value)===Be?a(t.value.sections):t instanceof Cr?a(t.sections):t.eachChild(e))},s=r.value;s._styleExpression&&o(s._styleExpression.expression)}return n}}]),r}(Dn);function rc(e,t,r){var i="never",n=e.get(t);return n?i=n:e.get(r)&&(i="always"),i}var ic={paint:new Mn({"background-color":new Sn(xe.paint_background["background-color"]),"background-pattern":new zn(xe.paint_background["background-pattern"]),"background-opacity":new Sn(xe.paint_background["background-opacity"])})},nc={paint:new Mn({"raster-opacity":new Sn(xe.paint_raster["raster-opacity"]),"raster-hue-rotate":new Sn(xe.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Sn(xe.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Sn(xe.paint_raster["raster-brightness-max"]),"raster-saturation":new Sn(xe.paint_raster["raster-saturation"]),"raster-contrast":new Sn(xe.paint_raster["raster-contrast"]),"raster-resampling":new Sn(xe.paint_raster["raster-resampling"]),"raster-fade-duration":new Sn(xe.paint_raster["raster-fade-duration"])})},ac=function(e){A(r,e);var t=M(r);function r(e){var i;return j(this,r),(i=t.call(this,e,{})).onAdd=function(e){i.implementation.onAdd&&i.implementation.onAdd(e,e.painter.context.gl)},i.onRemove=function(e){i.implementation.onRemove&&i.implementation.onRemove(e,e.painter.context.gl)},i.implementation=e,i}return q(r,[{key:"is3D",value:function(){return"3d"===this.implementation.renderingMode}},{key:"hasOffscreenPass",value:function(){return void 0!==this.implementation.prerender}},{key:"recalculate",value:function(){}},{key:"updateTransitions",value:function(){}},{key:"hasTransition",value:function(){return!1}},{key:"serialize",value:function(){throw new Error("Custom layers cannot be serialized")}}]),r}(Dn),oc={circle:function(e){A(r,e);var t=M(r);function r(e){return j(this,r),t.call(this,e,Io)}return q(r,[{key:"createBucket",value:function(e){return new ho(e)}},{key:"queryRadius",value:function(e){var t=e;return Eo("circle-radius",this,t)+Eo("circle-stroke-width",this,t)+To(this.paint.get("circle-translate"))}},{key:"queryIntersectsFeature",value:function(e,t,r,i,n,a,o,s){var l,u=So(e,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),a.angle,o),c=this.paint.get("circle-radius").evaluate(t,r)+this.paint.get("circle-stroke-width").evaluate(t,r),h="map"===this.paint.get("circle-pitch-alignment"),p=h?u:function(e,t){return e.map((function(e){return Uo(e,t)}))}(u,s),f=h?c*o:c,d=K(i);try{for(d.s();!(l=d.n()).done;){var m,v=K(l.value);try{for(v.s();!(m=v.n()).done;){var y=m.value,g=h?y:Uo(y,s),_=f,x=Oo([],[y.x,y.y,0,1],s);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?_*=x[3]/a.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(_*=a.cameraToCenterDistance/x[3]),fo(p,g,_))return!0}}catch(b){v.e(b)}finally{v.f()}}}catch(b){d.e(b)}finally{d.f()}return!1}}]),r}(Dn),heatmap:function(e){A(r,e);var t=M(r);function r(e){var i;return j(this,r),(i=t.call(this,e,jo))._updateColorRamp(),i}return q(r,[{key:"createBucket",value:function(e){return new No(e)}},{key:"_handleSpecialPaintPropertyUpdate",value:function(e){"heatmap-color"===e&&this._updateColorRamp()}},{key:"_updateColorRamp",value:function(){this.colorRamp=Wo({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}},{key:"resize",value:function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}},{key:"queryRadius",value:function(){return 0}},{key:"queryIntersectsFeature",value:function(){return!1}},{key:"hasOffscreenPass",value:function(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility}}]),r}(Dn),hillshade:function(e){A(r,e);var t=M(r);function r(e){return j(this,r),t.call(this,e,Ko)}return q(r,[{key:"hasOffscreenPass",value:function(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility}}]),r}(Dn),fill:function(e){A(r,e);var t=M(r);function r(e){return j(this,r),t.call(this,e,Ls)}return q(r,[{key:"recalculate",value:function(e,t){S(O(r.prototype),"recalculate",this).call(this,e,t);var i=this.paint._values["fill-outline-color"];"constant"===i.value.kind&&void 0===i.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}},{key:"createBucket",value:function(e){return new Ps(e)}},{key:"queryRadius",value:function(){return To(this.paint.get("fill-translate"))}},{key:"queryIntersectsFeature",value:function(e,t,r,i,n,a,o){return mo(So(e,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),a.angle,o),i)}},{key:"isTileClipped",value:function(){return!0}}]),r}(Dn),"fill-extrusion":function(e){A(r,e);var t=M(r);function r(e){return j(this,r),t.call(this,e,rl)}return q(r,[{key:"createBucket",value:function(e){return new $s(e)}},{key:"queryRadius",value:function(){return To(this.paint.get("fill-extrusion-translate"))}},{key:"is3D",value:function(){return!0}},{key:"queryIntersectsFeature",value:function(e,t,r,i,n,a,o,s){var l=So(e,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),a.angle,o),u=this.paint.get("fill-extrusion-height").evaluate(t,r),c=this.paint.get("fill-extrusion-base").evaluate(t,r),h=function(e,t,r,i){var n,a=[],o=K(e);try{for(o.s();!(n=o.n()).done;){var s=n.value,l=[s.x,s.y,0,1];Oo(l,l,t),a.push(new T(l[0]/l[3],l[1]/l[3]))}}catch(u){o.e(u)}finally{o.f()}return a}(l,s),p=function(e,t,r,i){var n,a=[],o=[],s=i[8]*t,l=i[9]*t,u=i[10]*t,c=i[11]*t,h=i[8]*r,p=i[9]*r,f=i[10]*r,d=i[11]*r,m=K(e);try{for(m.s();!(n=m.n()).done;){var v,y=n.value,g=[],_=[],x=K(y);try{for(x.s();!(v=x.n()).done;){var b=v.value,w=b.x,k=b.y,E=i[0]*w+i[4]*k+i[12],S=i[1]*w+i[5]*k+i[13],C=i[2]*w+i[6]*k+i[14],I=i[3]*w+i[7]*k+i[15],z=C+u,A=I+c,M=E+h,P=S+p,D=C+f,L=I+d,R=new T((E+s)/A,(S+l)/A);R.z=z/A,g.push(R);var B=new T(M/L,P/L);B.z=D/L,_.push(B)}}catch(F){x.e(F)}finally{x.f()}a.push(g),o.push(_)}}catch(F){m.e(F)}finally{m.f()}return[a,o]}(i,c,u,s);return function(e,t,r){var i=1/0;mo(r,t)&&(i=nl(r,t[0]));for(var n=0;n<t.length;n++)for(var a=t[n],o=e[n],s=0;s<a.length-1;s++){var l=a[s],u=[l,a[s+1],o[s+1],o[s],l];po(r,u)&&(i=Math.min(i,nl(r,u)))}return i!==1/0&&i}(p[0],p[1],h)}}]),r}(Dn),line:function(e){A(r,e);var t=M(r);function r(e){var i;return j(this,r),(i=t.call(this,e,pl)).gradientVersion=0,i}return q(r,[{key:"_handleSpecialPaintPropertyUpdate",value:function(e){"line-gradient"===e&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof Nt,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER)}},{key:"gradientExpression",value:function(){return this._transitionablePaint._values["line-gradient"].value.expression}},{key:"recalculate",value:function(e,t){S(O(r.prototype),"recalculate",this).call(this,e,t),this.paint._values["line-floorwidth"]=fl.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}},{key:"createBucket",value:function(e){return new cl(e)}},{key:"queryRadius",value:function(e){var t=e,r=dl(Eo("line-width",this,t),Eo("line-gap-width",this,t)),i=Eo("line-offset",this,t);return r/2+Math.abs(i)+To(this.paint.get("line-translate"))}},{key:"queryIntersectsFeature",value:function(e,t,r,i,n,a,o){var s=So(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,o),l=o/2*dl(this.paint.get("line-width").evaluate(t,r),this.paint.get("line-gap-width").evaluate(t,r)),u=this.paint.get("line-offset").evaluate(t,r);return u&&(i=function(e,t){for(var r=[],i=0;i<e.length;i++){for(var n=e[i],a=[],o=0;o<n.length;o++){var s=n[o-1],l=n[o],u=n[o+1],c=0===o?new T(0,0):l.sub(s)._unit()._perp(),h=o===n.length-1?new T(0,0):u.sub(l)._unit()._perp(),p=c._add(h)._unit(),f=p.x*h.x+p.y*h.y;0!==f&&p._mult(1/f),a.push(p._mult(t)._add(l))}r.push(a)}return r}(i,u*o)),function(e,t,r){for(var i=0;i<t.length;i++){var n=t[i];if(e.length>=3)for(var a=0;a<n.length;a++)if(wo(e,n[a]))return!0;if(vo(e,n,r))return!0}return!1}(s,i,l)}},{key:"isTileClipped",value:function(){return!0}}]),r}(Dn),symbol:tc,background:function(e){A(r,e);var t=M(r);function r(e){return j(this,r),t.call(this,e,ic)}return q(r)}(Dn),raster:function(e){A(r,e);var t=M(r);function r(e){return j(this,r),t.call(this,e,nc)}return q(r)}(Dn)},sc=function(){function e(t){var r=this;j(this,e),this._callback=t,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){r._triggered=!1,r._callback()})}return q(e,[{key:"trigger",value:function(){var e=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((function(){e._triggered=!1,e._callback()}),0))}},{key:"remove",value:function(){delete this._channel,this._callback=function(){}}}]),e}(),lc=6371008.8,uc=function(){function e(t,r){if(j(this,e),isNaN(t)||isNaN(r))throw new Error("Invalid LngLat object: (".concat(t,", ").concat(r,")"));if(this.lng=+t,this.lat=+r,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}return q(e,[{key:"wrap",value:function(){return new e(o(this.lng,-180,180),this.lat)}},{key:"toArray",value:function(){return[this.lng,this.lat]}},{key:"toString",value:function(){return"LngLat(".concat(this.lng,", ").concat(this.lat,")")}},{key:"distanceTo",value:function(e){var t=Math.PI/180,r=this.lat*t,i=e.lat*t,n=Math.sin(r)*Math.sin(i)+Math.cos(r)*Math.cos(i)*Math.cos((e.lng-this.lng)*t);return lc*Math.acos(Math.min(n,1))}},{key:"toBounds",value:function(){var t=360*(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0)/40075017,r=t/Math.cos(Math.PI/180*this.lat);return new cc(new e(this.lng-r,this.lat-t),new e(this.lng+r,this.lat+t))}}],[{key:"convert",value:function(t){if(t instanceof e)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new e(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==Z(t)&&null!==t)return new e(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>]")}}]),e}(),cc=function(){function e(t,r){j(this,e),t&&(r?this.setSouthWest(t).setNorthEast(r):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))}return q(e,[{key:"setNorthEast",value:function(e){return this._ne=e instanceof uc?new uc(e.lng,e.lat):uc.convert(e),this}},{key:"setSouthWest",value:function(e){return this._sw=e instanceof uc?new uc(e.lng,e.lat):uc.convert(e),this}},{key:"extend",value:function(t){var r,i,n=this._sw,a=this._ne;if(t instanceof uc)r=t,i=t;else{if(!(t instanceof e))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(e.convert(t)):this.extend(uc.convert(t)):this;if(r=t._sw,i=t._ne,!r||!i)return this}return n||a?(n.lng=Math.min(r.lng,n.lng),n.lat=Math.min(r.lat,n.lat),a.lng=Math.max(i.lng,a.lng),a.lat=Math.max(i.lat,a.lat)):(this._sw=new uc(r.lng,r.lat),this._ne=new uc(i.lng,i.lat)),this}},{key:"getCenter",value:function(){return new uc((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}},{key:"getSouthWest",value:function(){return this._sw}},{key:"getNorthEast",value:function(){return this._ne}},{key:"getNorthWest",value:function(){return new uc(this.getWest(),this.getNorth())}},{key:"getSouthEast",value:function(){return new uc(this.getEast(),this.getSouth())}},{key:"getWest",value:function(){return this._sw.lng}},{key:"getSouth",value:function(){return this._sw.lat}},{key:"getEast",value:function(){return this._ne.lng}},{key:"getNorth",value:function(){return this._ne.lat}},{key:"toArray",value:function(){return[this._sw.toArray(),this._ne.toArray()]}},{key:"toString",value:function(){return"LngLatBounds(".concat(this._sw.toString(),", ").concat(this._ne.toString(),")")}},{key:"isEmpty",value:function(){return!(this._sw&&this._ne)}},{key:"contains",value:function(e){var t=uc.convert(e),r=t.lng,i=t.lat,n=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(n=this._sw.lng>=r&&r>=this._ne.lng),this._sw.lat<=i&&i<=this._ne.lat&&n}}],[{key:"convert",value:function(t){return t instanceof e?t:t?new e(t):t}}]),e}(),hc=2*Math.PI*lc;function pc(e){return hc*Math.cos(e*Math.PI/180)}function fc(e){return(180+e)/360}function dc(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function mc(e,t){return e/pc(t)}function vc(e){return 360/Math.PI*Math.atan(Math.exp((180-360*e)*Math.PI/180))-90}var yc=function(){function e(t,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;j(this,e),this.x=+t,this.y=+r,this.z=+i}return q(e,[{key:"toLngLat",value:function(){return new uc(360*this.x-180,vc(this.y))}},{key:"toAltitude",value:function(){return this.z*pc(vc(this.y))}},{key:"meterInMercatorCoordinateUnits",value:function(){return 1/hc*(e=vc(this.y),1/Math.cos(e*Math.PI/180));var e}}],[{key:"fromLngLat",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=uc.convert(t);return new e(fc(i.lng),dc(i.lat),mc(r,i.lat))}}]),e}();function gc(e,t,r){var i=2*Math.PI*6378137/256/Math.pow(2,r);return[e*i-2*Math.PI*6378137/2,t*i-2*Math.PI*6378137/2]}var _c=function(){function e(t,r,i){if(j(this,e),t<0||t>25||i<0||i>=Math.pow(2,t)||r<0||r>=Math.pow(2,t))throw new Error("x=".concat(r,", y=").concat(i,", z=").concat(t," outside of bounds. 0<=x<").concat(Math.pow(2,t),", 0<=y<").concat(Math.pow(2,t)," 0<=z<=25 "));this.z=t,this.x=r,this.y=i,this.key=wc(0,t,t,r,i)}return q(e,[{key:"equals",value:function(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}},{key:"url",value:function(e,t,r){var i,n,a,o,s,l=(n=this.y,a=this.z,o=gc(256*(i=this.x),256*(n=Math.pow(2,a)-n-1),a),s=gc(256*(i+1),256*(n+1),a),o[0]+","+o[1]+","+s[0]+","+s[1]),u=function(e,t,r){for(var i,n="",a=e;a>0;a--)n+=(t&(i=1<<a-1)?1:0)+(r&i?2:0);return n}(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String("tms"===r?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,t>1?"@2x":"").replace(/{quadkey}/g,u).replace(/{bbox-epsg-3857}/g,l)}},{key:"isChildOf",value:function(e){var t=this.z-e.z;return t>0&&e.x===this.x>>t&&e.y===this.y>>t}},{key:"getTilePoint",value:function(e){var t=Math.pow(2,this.z);return new T((e.x*t-this.x)*ao,(e.y*t-this.y)*ao)}},{key:"toString",value:function(){return"".concat(this.z,"/").concat(this.x,"/").concat(this.y)}}]),e}(),xc=q((function e(t,r){j(this,e),this.wrap=t,this.canonical=r,this.key=wc(t,r.z,r.z,r.x,r.y)})),bc=function(){function e(t,r,i,n,a){if(j(this,e),t<i)throw new Error("overscaledZ should be >= z; overscaledZ = ".concat(t,"; z = ").concat(i));this.overscaledZ=t,this.wrap=r,this.canonical=new _c(i,+n,+a),this.key=wc(r,t,i,n,a)}return q(e,[{key:"clone",value:function(){return new e(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}},{key:"equals",value:function(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}},{key:"scaledTo",value:function(t){if(t>this.overscaledZ)throw new Error("targetZ > this.overscaledZ; targetZ = ".concat(t,"; overscaledZ = ").concat(this.overscaledZ));var r=this.canonical.z-t;return t>this.canonical.z?new e(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new e(t,this.wrap,t,this.canonical.x>>r,this.canonical.y>>r)}},{key:"calculateScaledKey",value:function(e,t){if(e>this.overscaledZ)throw new Error("targetZ > this.overscaledZ; targetZ = ".concat(e,"; overscaledZ = ").concat(this.overscaledZ));var r=this.canonical.z-e;return e>this.canonical.z?wc(this.wrap*+t,e,this.canonical.z,this.canonical.x,this.canonical.y):wc(this.wrap*+t,e,e,this.canonical.x>>r,this.canonical.y>>r)}},{key:"isChildOf",value:function(e){if(e.wrap!==this.wrap)return!1;var t=this.canonical.z-e.canonical.z;return 0===e.overscaledZ||e.overscaledZ<this.overscaledZ&&e.canonical.x===this.canonical.x>>t&&e.canonical.y===this.canonical.y>>t}},{key:"children",value:function(t){if(this.overscaledZ>=t)return[new e(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var r=this.canonical.z+1,i=2*this.canonical.x,n=2*this.canonical.y;return[new e(r,this.wrap,r,i,n),new e(r,this.wrap,r,i+1,n),new e(r,this.wrap,r,i,n+1),new e(r,this.wrap,r,i+1,n+1)]}},{key:"isLessThan",value:function(e){return this.wrap<e.wrap||!(this.wrap>e.wrap)&&(this.overscaledZ<e.overscaledZ||!(this.overscaledZ>e.overscaledZ)&&(this.canonical.x<e.canonical.x||!(this.canonical.x>e.canonical.x)&&this.canonical.y<e.canonical.y))}},{key:"wrapped",value:function(){return new e(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}},{key:"unwrapTo",value:function(t){return new e(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)}},{key:"overscaleFactor",value:function(){return Math.pow(2,this.overscaledZ-this.canonical.z)}},{key:"toUnwrapped",value:function(){return new xc(this.wrap,this.canonical)}},{key:"toString",value:function(){return"".concat(this.overscaledZ,"/").concat(this.canonical.x,"/").concat(this.canonical.y)}},{key:"getTilePoint",value:function(e){return this.canonical.getTilePoint(new yc(e.x-this.wrap,e.y))}}]),e}();function wc(e,t,r,i,n){(e*=2)<0&&(e=-1*e-1);var a=1<<r;return(a*a*e+a*n+i).toString(36)+r.toString(36)+t.toString(36)}Gi("CanonicalTileID",_c),Gi("OverscaledTileID",bc,{omit:["posMatrix"]});var kc=function(){function e(t,r,i){if(j(this,e),this.uid=t,r.height!==r.width)throw new RangeError("DEM tiles must be square");if(i&&"mapbox"!==i&&"terrarium"!==i)d('"'.concat(i,'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".'));else{this.stride=r.height;var n=this.dim=r.height-2;this.data=new Uint32Array(r.data.buffer),this.encoding=i||"mapbox";for(var a=0;a<n;a++)this.data[this._idx(-1,a)]=this.data[this._idx(0,a)],this.data[this._idx(n,a)]=this.data[this._idx(n-1,a)],this.data[this._idx(a,-1)]=this.data[this._idx(a,0)],this.data[this._idx(a,n)]=this.data[this._idx(a,n-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(n,-1)]=this.data[this._idx(n-1,0)],this.data[this._idx(-1,n)]=this.data[this._idx(0,n-1)],this.data[this._idx(n,n)]=this.data[this._idx(n-1,n-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(var o=0;o<n;o++)for(var s=0;s<n;s++){var l=this.get(o,s);l>this.max&&(this.max=l),l<this.min&&(this.min=l)}}}return q(e,[{key:"get",value:function(e,t){var r=new Uint8Array(this.data.buffer),i=4*this._idx(e,t);return("terrarium"===this.encoding?this._unpackTerrarium:this._unpackMapbox)(r[i],r[i+1],r[i+2])}},{key:"getUnpackVector",value:function(){return"terrarium"===this.encoding?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]}},{key:"_idx",value:function(e,t){if(e<-1||e>=this.dim+1||t<-1||t>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(t+1)*this.stride+(e+1)}},{key:"_unpackMapbox",value:function(e,t,r){return(256*e*256+256*t+r)/10-1e4}},{key:"_unpackTerrarium",value:function(e,t,r){return 256*e+t+r/256-32768}},{key:"getPixels",value:function(){return new Ho({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}},{key:"backfillBorder",value:function(e,t,r){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");var i=t*this.dim,n=t*this.dim+this.dim,a=r*this.dim,o=r*this.dim+this.dim;switch(t){case-1:i=n-1;break;case 1:n=i+1}switch(r){case-1:a=o-1;break;case 1:o=a+1}for(var s=-t*this.dim,l=-r*this.dim,u=a;u<o;u++)for(var c=i;c<n;c++)this.data[this._idx(c,u)]=e.data[this._idx(c+s,u+l)]}}]),e}();Gi("DEMData",kc);var Ec,Tc=function(){function e(t){j(this,e),this._stringToNumber={},this._numberToString=[];for(var r=0;r<t.length;r++){var i=t[r];this._stringToNumber[i]=r,this._numberToString[r]=i}}return q(e,[{key:"encode",value:function(e){return this._stringToNumber[e]}},{key:"decode",value:function(e){if(e>=this._numberToString.length)throw new Error("Out of bounds. Index requested n=".concat(e," can't be >= this._numberToString.length ").concat(this._numberToString.length));return this._numberToString[e]}}]),e}(),Sc=function(){function e(t,r,i,n,a){j(this,e),this.type="Feature",this._vectorTileFeature=t,t._z=r,t._x=i,t._y=n,this.properties=t.properties,this.id=a}return q(e,[{key:"geometry",get:function(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},set:function(e){this._geometry=e}},{key:"toJSON",value:function(){var e={geometry:this.geometry};for(var t in this)"_geometry"!==t&&"_vectorTileFeature"!==t&&(e[t]=this[t]);return e}}]),e}(),Cc=function(){function e(t,r){j(this,e),this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new Ni(ao,16,0),this.grid3D=new Ni(ao,16,0),this.featureIndexArray=new va,this.promoteId=r}return q(e,[{key:"insert",value:function(e,t,r,i,n,a){var o=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,i,n);for(var s=a?this.grid3D:this.grid,l=0;l<t.length;l++){for(var u=t[l],c=[1/0,1/0,-1/0,-1/0],h=0;h<u.length;h++){var p=u[h];c[0]=Math.min(c[0],p.x),c[1]=Math.min(c[1],p.y),c[2]=Math.max(c[2],p.x),c[3]=Math.max(c[3],p.y)}c[0]<ao&&c[1]<ao&&c[2]>=0&&c[3]>=0&&s.insert(o,c[0],c[1],c[2],c[3])}}},{key:"loadVTLayers",value:function(){return this.vtLayers||(this.vtLayers=new Os.VectorTile(new kl(this.rawTileData)).layers,this.sourceLayerCoder=new Tc(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}},{key:"query",value:function(e,t,r,i){var n=this;this.loadVTLayers();var a,o=e.params||{},s=ao/e.tileSize/e.scale,l=hi(o.filter),u=e.queryGeometry,c=e.queryPadding*s,h=zc(u),p=this.grid.query(h.minX-c,h.minY-c,h.maxX+c,h.maxY+c),f=zc(e.cameraQueryGeometry),d=this.grid3D.query(f.minX-c,f.minY-c,f.maxX+c,f.maxY+c,(function(t,r,i,n){return function(e,t,r,i,n){var a,o=K(e);try{for(o.s();!(a=o.n()).done;){var s=a.value;if(t<=s.x&&r<=s.y&&i>=s.x&&n>=s.y)return!0}}catch(p){o.e(p)}finally{o.f()}var l=[new T(t,r),new T(t,n),new T(i,n),new T(i,r)];if(e.length>2){var u,c=K(l);try{for(c.s();!(u=c.n()).done;)if(wo(e,u.value))return!0}catch(p){c.e(p)}finally{c.f()}}for(var h=0;h<e.length-1;h++)if(ko(e[h],e[h+1],l))return!0;return!1}(e.cameraQueryGeometry,t-c,r-c,i+c,n+c)})),m=K(d);try{for(m.s();!(a=m.n()).done;){var v=a.value;p.push(v)}}catch(b){m.e(b)}finally{m.f()}p.sort(Ac);for(var y,g={},_=function(a){var c=p[a];if(c===y)return"continue";y=c;var h=n.featureIndexArray.get(c),f=null;n.loadMatchingFeature(g,h.bucketIndex,h.sourceLayerIndex,h.featureIndex,l,o.layers,o.availableImages,t,r,i,(function(t,r,i){return f||(f=lo(t)),r.queryIntersectsFeature(u,t,i,f,n.z,e.transform,s,e.pixelPosMatrix)}))},x=0;x<p.length;x++)_(x);return g}},{key:"loadMatchingFeature",value:function(e,t,r,i,n,a,o,l,u,c,h){var p=this.bucketLayerIDs[t];if(!a||function(e,t){for(var r=0;r<e.length;r++)if(t.indexOf(e[r])>=0)return!0;return!1}(a,p)){var f=this.sourceLayerCoder.decode(r),d=this.vtLayers[f].feature(i);if(n.needGeometry){var m=uo(d,!0);if(!n.filter(new yn(this.tileID.overscaledZ),m,this.tileID.canonical))return}else if(!n.filter(new yn(this.tileID.overscaledZ),d))return;for(var v=this.getId(d,f),y=0;y<p.length;y++){var g=p[y];if(!(a&&a.indexOf(g)<0)){var _=l[g];if(_){var x={};v&&c&&(x=c.getState(_.sourceLayer||"_geojsonTileLayer",v));var b=s({},u[g]);b.paint=Ic(b.paint,_.paint,d,x,o),b.layout=Ic(b.layout,_.layout,d,x,o);var w=!h||h(d,_,x);if(w){var k=new Sc(d,this.z,this.x,this.y,v);k.layer=b;var E=e[g];void 0===E&&(E=e[g]=[]),E.push({featureIndex:i,feature:k,intersectionZ:w})}}}}}}},{key:"lookupSymbolFeatures",value:function(e,t,r,i,n,a,o,s){var l={};this.loadVTLayers();var u,c=hi(n),h=K(e);try{for(h.s();!(u=h.n()).done;){var p=u.value;this.loadMatchingFeature(l,r,i,p,c,a,o,s,t)}}catch(f){h.e(f)}finally{h.f()}return l}},{key:"hasLayer",value:function(e){var t,r=K(this.bucketLayerIDs);try{for(r.s();!(t=r.n()).done;){var i,n=K(t.value);try{for(n.s();!(i=n.n()).done;)if(e===i.value)return!0}catch(a){n.e(a)}finally{n.f()}}}catch(a){r.e(a)}finally{r.f()}return!1}},{key:"getId",value:function(e,t){var r=e.id;return this.promoteId&&"boolean"==typeof(r=e.properties["string"==typeof this.promoteId?this.promoteId:this.promoteId[t]])&&(r=Number(r)),r}}]),e}();function Ic(e,t,r,i,n){return c(e,(function(e,a){var o=t instanceof Tn?t.get(a):null;return o&&o.evaluate?o.evaluate(r,i,n):o}))}function zc(e){var t,r=1/0,i=1/0,n=-1/0,a=-1/0,o=K(e);try{for(o.s();!(t=o.n()).done;){var s=t.value;r=Math.min(r,s.x),i=Math.min(i,s.y),n=Math.max(n,s.x),a=Math.max(a,s.y)}}catch(l){o.e(l)}finally{o.f()}return{minX:r,minY:i,maxX:n,maxY:a}}function Ac(e,t){return t-e}Gi("FeatureIndex",Cc,{omit:["rawTileData","sourceLayerCoder"]}),e.PerformanceMarkers=void 0,(Ec=e.PerformanceMarkers||(e.PerformanceMarkers={})).create="create",Ec.load="load",Ec.fullLoad="fullLoad";var Mc=null,Pc=[],Dc=1e3/30,Lc={mark:function(e){performance.mark(e)},frame:function(e){var t=e;null!=Mc&&Pc.push(t-Mc),Mc=t},clearMetrics:function(){for(var t in Mc=null,Pc=[],performance.clearMeasures("loadTime"),performance.clearMeasures("fullLoadTime"),e.PerformanceMarkers)performance.clearMarks(e.PerformanceMarkers[t])},getPerformanceMetrics:function(){performance.measure("loadTime",e.PerformanceMarkers.create,e.PerformanceMarkers.load),performance.measure("fullLoadTime",e.PerformanceMarkers.create,e.PerformanceMarkers.fullLoad);var t=performance.getEntriesByName("loadTime")[0].duration,r=performance.getEntriesByName("fullLoadTime")[0].duration,i=Pc.length,n=1/(Pc.reduce((function(e,t){return e+t}),0)/i/1e3),a=Pc.filter((function(e){return e>Dc})).reduce((function(e,t){return e+(t-Dc)/Dc}),0);return{loadTime:t,fullLoadTime:r,fps:n,percentDroppedFrames:a/(i+a)*100}}};e.AJAXError=ae,e.ARRAY_TYPE=Ao,e.Actor=function(){function e(t,r,i){j(this,e),this.target=t,this.parent=r,this.mapId=i,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},u(["receive","process"],this),this.invoker=new sc(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=y()?t:window}return q(e,[{key:"send",value:function(e,t,r,i){var n=this,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[o]=r);var s=w(this.globalScope)?void 0:[];return this.target.postMessage({id:o,type:e,hasCallback:!!r,targetMapId:i,mustQueue:a,sourceMapId:this.mapId,data:Xi(t,s)},s),{cancel:function(){r&&delete n.callbacks[o],n.target.postMessage({id:o,type:"<cancel>",targetMapId:i,sourceMapId:n.mapId})}}}},{key:"receive",value:function(e){var t=e.data,r=t.id;if(r&&(!t.targetMapId||this.mapId===t.targetMapId))if("<cancel>"===t.type){delete this.tasks[r];var i=this.cancelCallbacks[r];delete this.cancelCallbacks[r],i&&i()}else y()||t.mustQueue?(this.tasks[r]=t,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,t)}},{key:"process",value:function(){if(this.taskQueue.length){var e=this.taskQueue.shift(),t=this.tasks[e];delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),t&&this.processTask(e,t)}}},{key:"processTask",value:function(e,t){var r=this;if("<response>"===t.type){var i=this.callbacks[e];delete this.callbacks[e],i&&(t.error?i(Hi(t.error)):i(null,Hi(t.data)))}else{var n=!1,a=w(this.globalScope)?void 0:[],o=t.hasCallback?function(t,i){n=!0,delete r.cancelCallbacks[e],r.target.postMessage({id:e,type:"<response>",sourceMapId:r.mapId,error:t?Xi(t):null,data:Xi(i,a)},a)}:function(e){n=!0},s=null,l=Hi(t.data);if(this.parent[t.type])s=this.parent[t.type](t.sourceMapId,l,o);else if(this.parent.getWorkerSource){var u=t.type.split(".");s=this.parent.getWorkerSource(t.sourceMapId,u[0],l.source)[u[1]](l,o)}else o(new Error("Could not find function ".concat(t.type)));!n&&s&&s.cancel&&(this.cancelCallbacks[e]=s.cancel)}}},{key:"remove",value:function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)}}]),e}(),e.AlphaImage=Xo,e.CanonicalTileID=_c,e.CollisionBoxArray=la,e.CollisionCircleLayoutArray=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r)}(Jn),e.Color=Ye,e.DEMData=kc,e.DataConstantProperty=Sn,e.DictionaryCoder=Tc,e.EXTENT=ao,e.ErrorEvent=ge,e.EvaluationParameters=yn,e.Event=ye,e.Evented=_e,e.FeatureIndex=Cc,e.FillBucket=Ps,e.FillExtrusionBucket=$s,e.GeoJSONFeature=Sc,e.ImageAtlas=Yl,e.ImagePosition=Jl,e.LineBucket=cl,e.LineStripIndexArray=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r)}(aa),e.LngLat=uc,e.LngLatBounds=cc,e.MercatorCoordinate=yc,e.ONE_EM=wl,e.OverscaledTileID=bc,e.PerformanceUtils=Lc,e.PosArray=ya,e.Properties=Mn,e.QuadTriangleArray=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r)}(Qn),e.RGBAImage=Ho,e.RasterBoundsArray=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r)}(Un),e.RequestPerformance=function(){function e(t){j(this,e),this._marks={start:[t.url,"start"].join("#"),end:[t.url,"end"].join("#"),measure:t.url.toString()},performance.mark(this._marks.start)}return q(e,[{key:"finish",value:function(){performance.mark(this._marks.end);var e=performance.getEntriesByName(this._marks.measure);return 0===e.length&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),e=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),e}}]),e}(),e.ResourceType=ne,e.SegmentVector=Pa,e.SymbolBucket=Yu,e.Transitionable=xn,e.TriangleIndexArray=za,e.Uniform1f=Za,e.Uniform1i=function(e){A(r,e);var t=M(r);function r(e,i){var n;return j(this,r),(n=t.call(this,e,i)).current=0,n}return q(r,[{key:"set",value:function(e){this.current!==e&&(this.current=e,this.gl.uniform1i(this.location,e))}}]),r}(qa),e.Uniform2f=function(e){A(r,e);var t=M(r);function r(e,i){var n;return j(this,r),(n=t.call(this,e,i)).current=[0,0],n}return q(r,[{key:"set",value:function(e){e[0]===this.current[0]&&e[1]===this.current[1]||(this.current=e,this.gl.uniform2f(this.location,e[0],e[1]))}}]),r}(qa),e.Uniform3f=function(e){A(r,e);var t=M(r);function r(e,i){var n;return j(this,r),(n=t.call(this,e,i)).current=[0,0,0],n}return q(r,[{key:"set",value:function(e){e[0]===this.current[0]&&e[1]===this.current[1]&&e[2]===this.current[2]||(this.current=e,this.gl.uniform3f(this.location,e[0],e[1],e[2]))}}]),r}(qa),e.Uniform4f=Xa,e.UniformColor=Ha,e.UniformMatrix4f=function(e){A(r,e);var t=M(r);function r(e,i){var n;return j(this,r),(n=t.call(this,e,i)).current=Wa,n}return q(r,[{key:"set",value:function(e){if(e[12]!==this.current[12]||e[0]!==this.current[0])return this.current=e,void this.gl.uniformMatrix4fv(this.location,!1,e);for(var t=1;t<16;t++)if(e[t]!==this.current[t]){this.current=e,this.gl.uniformMatrix4fv(this.location,!1,e);break}}}]),r}(qa),e.UnwrappedTileID=xc,e.ValidationError=be,e.ZoomHistory=Wi,e.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e},e.addDynamicAttributes=Hu,e.asyncAll=function(e,t,r){if(!e.length)return r(null,[]);var i=e.length,n=new Array(e.length),a=null;e.forEach((function(e,o){t(e,(function(e,t){e&&(a=e),n[o]=t,0==--i&&r(a,n)}))}))},e.bezier=i,e.bindAll=u,e.cacheEntryPossiblyAdded=function(e){++$>H&&(e.getActor().send("enforceCacheSizeLimit",X),$=0)},e.clamp=a,e.clearTileCache=function(e){var t=caches.delete(G);e&&t.catch(e).then((function(){return e()}))},e.clipLine=Eu,e.clone=function(e){var t=new Ao(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],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},e.clone$1=p,e.clone$2=function(e){var t=new Ao(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},e.collisionCircleLayout=_l,e.config=F,e.copy=function(e,t){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},e.create=function(){var e=new Ao(16);return Ao!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e},e.create$1=Mo,e.createExpression=Yr,e.createFilter=hi,e.createLayout=Fn,e.createStyleLayer=function(e){return"custom"===e.type?new ac(e):new oc[e.type](e)},e.cross=function(e,t,r){var i=t[0],n=t[1],a=t[2],o=r[0],s=r[1],l=r[2];return e[0]=n*l-a*s,e[1]=a*o-i*l,e[2]=i*s-n*o,e},e.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},e.dot$1=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},e.ease=n,e.emitValidationErrors=Ui,e.enforceCacheSizeLimit=function(e){W(),D&&D.then((function(t){t.keys().then((function(r){for(var i=0;i<r.length-e;i++)t.delete(r[i])}))}))},e.equals=function(e,t){var r=e[0],i=e[1],n=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=e[9],p=e[10],f=e[11],d=e[12],m=e[13],v=e[14],y=e[15],g=t[0],_=t[1],x=t[2],b=t[3],w=t[4],k=t[5],E=t[6],T=t[7],S=t[8],C=t[9],I=t[10],z=t[11],A=t[12],M=t[13],P=t[14],D=t[15];return Math.abs(r-g)<=zo*Math.max(1,Math.abs(r),Math.abs(g))&&Math.abs(i-_)<=zo*Math.max(1,Math.abs(i),Math.abs(_))&&Math.abs(n-x)<=zo*Math.max(1,Math.abs(n),Math.abs(x))&&Math.abs(a-b)<=zo*Math.max(1,Math.abs(a),Math.abs(b))&&Math.abs(o-w)<=zo*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(s-k)<=zo*Math.max(1,Math.abs(s),Math.abs(k))&&Math.abs(l-E)<=zo*Math.max(1,Math.abs(l),Math.abs(E))&&Math.abs(u-T)<=zo*Math.max(1,Math.abs(u),Math.abs(T))&&Math.abs(c-S)<=zo*Math.max(1,Math.abs(c),Math.abs(S))&&Math.abs(h-C)<=zo*Math.max(1,Math.abs(h),Math.abs(C))&&Math.abs(p-I)<=zo*Math.max(1,Math.abs(p),Math.abs(I))&&Math.abs(f-z)<=zo*Math.max(1,Math.abs(f),Math.abs(z))&&Math.abs(d-A)<=zo*Math.max(1,Math.abs(d),Math.abs(A))&&Math.abs(m-M)<=zo*Math.max(1,Math.abs(m),Math.abs(M))&&Math.abs(v-P)<=zo*Math.max(1,Math.abs(v),Math.abs(P))&&Math.abs(y-D)<=zo*Math.max(1,Math.abs(y),Math.abs(D))},e.evaluateSizeForFeature=function(e,t,r){var i=t.uSize,n=t.uSizeT,a=r.lowerSize,o=r.upperSize;return"source"===e.kind?a/du:"composite"===e.kind?jt(a/du,o/du,n):i},e.evaluateSizeForZoom=function(e,t){var r=0,i=0;if("constant"===e.kind)i=e.layoutSize;else if("source"!==e.kind){var n=e.interpolationType,o=e.minZoom,s=e.maxZoom,l=n?a(sr.interpolationFactor(n,t,o,s),0,1):0;"camera"===e.kind?i=jt(e.minSize,e.maxSize,l):r=l}return{uSizeT:r,uSize:i}},e.evaluateVariableOffset=Fu,e.evented=fn,e.exported=E,e.exported$1=ee,e.extend=s,e.filterObject=h,e.fromRotation=function(e,t){var r=Math.sin(t),i=Math.cos(t);return e[0]=i,e[1]=r,e[2]=0,e[3]=-r,e[4]=i,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},e.fromScaling=function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},e.getAnchorAlignment=cu,e.getAnchorJustification=Ou,e.getArrayBuffer=ue,e.getImage=de,e.getJSON=function(e,t){return le(s(e,{type:"json"}),t)},e.getOverlapMode=rc,e.getRTLTextPluginStatus=dn,e.getReferrer=oe,e.getVideo=function(e,t){var r=window.document.createElement("video");r.muted=!0,r.onloadstart=function(){t(null,r)};for(var i=0;i<e.length;i++){var n=window.document.createElement("source");ce(e[i])||(r.crossOrigin="Anonymous"),n.src=e[i],r.appendChild(n)}return{cancel:function(){}}},e.identity=Po,e.invert=function(e,t){var r=t[0],i=t[1],n=t[2],a=t[3],o=t[4],s=t[5],l=t[6],u=t[7],c=t[8],h=t[9],p=t[10],f=t[11],d=t[12],m=t[13],v=t[14],y=t[15],g=r*s-i*o,_=r*l-n*o,x=r*u-a*o,b=i*l-n*s,w=i*u-a*s,k=n*u-a*l,E=c*m-h*d,T=c*v-p*d,S=c*y-f*d,C=h*v-p*m,I=h*y-f*m,z=p*y-f*v,A=g*z-_*I+x*C+b*S-w*T+k*E;return A?(e[0]=(s*z-l*I+u*C)*(A=1/A),e[1]=(n*I-i*z-a*C)*A,e[2]=(m*k-v*w+y*b)*A,e[3]=(p*w-h*k-f*b)*A,e[4]=(l*S-o*z-u*T)*A,e[5]=(r*z-n*S+a*T)*A,e[6]=(v*x-d*k-y*_)*A,e[7]=(c*k-p*x+f*_)*A,e[8]=(o*I-s*S+u*E)*A,e[9]=(i*S-r*I-a*E)*A,e[10]=(d*w-m*x+y*g)*A,e[11]=(h*x-c*w-f*g)*A,e[12]=(s*T-o*C-l*E)*A,e[13]=(r*C-i*T+n*E)*A,e[14]=(m*_-d*b-v*g)*A,e[15]=(c*b-h*_+p*g)*A,e):null},e.isImageBitmap=k,e.isSafari=w,e.isWorker=y,e.keysDifference=function(e,t){var r=[];for(var i in e)i in t||r.push(i);return r},e.lazyLoadRTLTextPlugin=function(){vn.isLoading()||vn.isLoaded()||"deferred"!==dn()||mn()},e.makeRequest=le,e.mapObject=c,e.mercatorXfromLng=fc,e.mercatorYfromLat=dc,e.mercatorZfromAltitude=mc,e.mul=Ro,e.mul$1=function(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e[3]=t[3]*r[3],e},e.multiply=Do,e.nextPowerOfTwo=function(e){return e<=1?1:Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},e.normalize=function(e,t){var r=t[0],i=t[1],n=t[2],a=r*r+i*i+n*n;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e},e.number=jt,e.ortho=function(e,t,r,i,n,a,o){var s=1/(t-r),l=1/(i-n),u=1/(a-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(t+r)*s,e[13]=(n+i)*l,e[14]=(o+a)*u,e[15]=1,e},e.parseCacheControl=g,e.parseGlyphPbf=function(e){return new kl(e).readFields(Xl,[])},e.pbf=kl,e.performSymbolLayout=function(t){t.bucket.createArrays(),t.bucket.tilePixelRatio=ao/(512*t.bucket.overscaling),t.bucket.compareText={},t.bucket.iconsNeedLinear=!1;var r=t.bucket.layers[0].layout,i=t.bucket.layers[0]._unevaluatedLayout._values,n={layoutIconSize:i["icon-size"].possiblyEvaluate(new yn(t.bucket.zoom+1),t.canonical),layoutTextSize:i["text-size"].possiblyEvaluate(new yn(t.bucket.zoom+1),t.canonical),textMaxSize:i["text-size"].possiblyEvaluate(new yn(18))};if("composite"===t.bucket.textSizeData.kind){var a=t.bucket.textSizeData,o=a.minZoom,s=a.maxZoom;n.compositeTextSizes=[i["text-size"].possiblyEvaluate(new yn(o),t.canonical),i["text-size"].possiblyEvaluate(new yn(s),t.canonical)]}if("composite"===t.bucket.iconSizeData.kind){var l=t.bucket.iconSizeData,u=l.minZoom,c=l.maxZoom;n.compositeIconSizes=[i["icon-size"].possiblyEvaluate(new yn(u),t.canonical),i["icon-size"].possiblyEvaluate(new yn(c),t.canonical)]}var h,p=r.get("text-line-height")*wl,f="viewport"!==r.get("text-rotation-alignment")&&"point"!==r.get("symbol-placement"),m=r.get("text-keep-upright"),v=r.get("text-size"),y=K(t.bucket.features);try{var g=function(){var i=h.value,a=r.get("text-font").evaluate(i,{},t.canonical).join(","),o=v.evaluate(i,{},t.canonical),s=n.layoutTextSize.evaluate(i,{},t.canonical),l=n.layoutIconSize.evaluate(i,{},t.canonical),u={horizontal:{},vertical:void 0},c=i.text,y=void 0,g=[0,0];if(c){var _=c.toString(),x=r.get("text-letter-spacing").evaluate(i,{},t.canonical)*wl,b=Yi(_)?x:0,w=r.get("text-anchor").evaluate(i,{},t.canonical),k=r.get("text-variable-anchor");if(!k){var E=r.get("text-radial-offset").evaluate(i,{},t.canonical);g=E?Fu(w,[E*wl,Bu]):r.get("text-offset").evaluate(i,{},t.canonical).map((function(e){return e*wl}))}var T=f?"center":r.get("text-justify").evaluate(i,{},t.canonical),S=r.get("symbol-placement"),C="point"===S?r.get("text-max-width").evaluate(i,{},t.canonical)*wl:0,I=function(){t.bucket.allowVerticalPlacement&&Ji(_)&&(u.vertical=tu(c,t.glyphMap,t.glyphPositions,t.imagePositions,a,C,p,w,"left",b,g,e.WritingMode.vertical,!0,S,s,o))};if(!f&&k){for(var z="auto"===T?k.map((function(e){return Ou(e)})):[T],A=!1,M=0;M<z.length;M++){var P=z[M];if(!u.horizontal[P])if(A)u.horizontal[P]=u.horizontal[0];else{var D=tu(c,t.glyphMap,t.glyphPositions,t.imagePositions,a,C,p,"center",P,b,g,e.WritingMode.horizontal,!1,S,s,o);D&&(u.horizontal[P]=D,A=1===D.positionedLines.length)}}I()}else{"auto"===T&&(T=Ou(w));var L=tu(c,t.glyphMap,t.glyphPositions,t.imagePositions,a,C,p,w,T,b,g,e.WritingMode.horizontal,!1,S,s,o);L&&(u.horizontal[T]=L),I(),Ji(_)&&f&&m&&(u.vertical=tu(c,t.glyphMap,t.glyphPositions,t.imagePositions,a,C,p,w,T,b,g,e.WritingMode.vertical,!1,S,s,o))}}var R=!1;if(i.icon&&i.icon.name){var B=t.imageMap[i.icon.name];B&&(y=pu(t.imagePositions[i.icon.name],r.get("icon-offset").evaluate(i,{},t.canonical),r.get("icon-anchor").evaluate(i,{},t.canonical)),R=!!B.sdf,void 0===t.bucket.sdfIcons?t.bucket.sdfIcons=R:t.bucket.sdfIcons!==R&&d("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(B.pixelRatio!==t.bucket.pixelRatio||0!==r.get("icon-rotate").constantOr(1))&&(t.bucket.iconsNeedLinear=!0))}var F=ju(u.horizontal)||u.vertical;t.bucket.iconsInText=!!F&&F.iconsInText,(F||y)&&Vu(t.bucket,i,u,y,t.imageMap,n,s,l,g,R,t.canonical)};for(y.s();!(h=y.n()).done;)g()}catch(_){y.e(_)}finally{y.f()}t.showCollisionBoxes&&t.bucket.generateCollisionDebugBuffers()},e.perspective=function(e,t,r,i,n){var a,o=1/Math.tan(t/2);return e[0]=o/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=n&&n!==1/0?(e[10]=(n+i)*(a=1/(i-n)),e[14]=2*n*i*a):(e[10]=-1,e[14]=-2*i),e},e.pick=function(e,t){for(var r={},i=0;i<t.length;i++){var n=t[i];n in e&&(r[n]=e[n])}return r},e.plugin=vn,e.pointGeometry=T,e.polygonIntersectsPolygon=po,e.potpack=Kl,e.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],e.register=Gi,e.registerForPluginStateChange=function(e){return e({pluginStatus:un,pluginURL:cn}),fn.on("pluginStateChange",e),e},e.renderColorRamp=Wo,e.rotateX=function(e,t,r){var i=Math.sin(r),n=Math.cos(r),a=t[4],o=t[5],s=t[6],l=t[7],u=t[8],c=t[9],h=t[10],p=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*n+u*i,e[5]=o*n+c*i,e[6]=s*n+h*i,e[7]=l*n+p*i,e[8]=u*n-a*i,e[9]=c*n-o*i,e[10]=h*n-s*i,e[11]=p*n-l*i,e},e.rotateZ=function(e,t,r){var i=Math.sin(r),n=Math.cos(r),a=t[0],o=t[1],s=t[2],l=t[3],u=t[4],c=t[5],h=t[6],p=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*n+u*i,e[1]=o*n+c*i,e[2]=s*n+h*i,e[3]=l*n+p*i,e[4]=u*n-a*i,e[5]=c*n-o*i,e[6]=h*n-s*i,e[7]=p*n-l*i,e},e.scale=function(e,t,r){var i=r[0],n=r[1],a=r[2];return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},e.scale$1=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e},e.setCacheLimits=function(e,t){X=e,H=t},e.setRTLTextPlugin=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(un===an||un===on||un===sn)throw new Error("setRTLTextPlugin cannot be called multiple times.");cn=E.resolveURL(e),un=an,ln=t,pn(),r||mn()},e.spec=xe,e.sphericalToCartesian=function(e){var t=V(e,3),r=t[0],i=t[1],n=t[2];return i+=90,i*=Math.PI/180,n*=Math.PI/180,{x:r*Math.cos(i)*Math.sin(n),y:r*Math.sin(i)*Math.sin(n),z:r*Math.cos(n)}},e.sqrLen=function(e){var t=e[0],r=e[1];return t*t+r*r},e.sub=function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e},e.toEvaluationFeature=uo,e.transformMat3=function(e,t,r){var i=t[0],n=t[1],a=t[2];return e[0]=i*r[0]+n*r[3]+a*r[6],e[1]=i*r[1]+n*r[4]+a*r[7],e[2]=i*r[2]+n*r[5]+a*r[8],e},e.transformMat4=Oo,e.transformMat4$1=function(e,t,r){var i=t[0],n=t[1];return e[0]=r[0]*i+r[4]*n+r[12],e[1]=r[1]*i+r[5]*n+r[13],e},e.translate=function(e,t,r){var i,n,a,o,s,l,u,c,h,p,f,d,m=r[0],v=r[1],y=r[2];return t===e?(e[12]=t[0]*m+t[4]*v+t[8]*y+t[12],e[13]=t[1]*m+t[5]*v+t[9]*y+t[13],e[14]=t[2]*m+t[6]*v+t[10]*y+t[14],e[15]=t[3]*m+t[7]*v+t[11]*y+t[15]):(n=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=t[6],c=t[7],h=t[8],p=t[9],f=t[10],d=t[11],e[0]=i=t[0],e[1]=n,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e[6]=u,e[7]=c,e[8]=h,e[9]=p,e[10]=f,e[11]=d,e[12]=i*m+s*v+h*y+t[12],e[13]=n*m+l*v+p*y+t[13],e[14]=a*m+u*v+f*y+t[14],e[15]=o*m+c*v+d*y+t[15]),e},e.triggerPluginCompletionEvent=hn,e.unicodeBlockLookup=Ki,e.uniqueId=function(){return l++},e.validateCustomStyleLayer=function(e){var t=[],r=e.id;return void 0===r&&t.push({message:"layers.".concat(r,': missing required property "id"')}),void 0===e.render&&t.push({message:"layers.".concat(r,': missing required method "render"')}),e.renderingMode&&"2d"!==e.renderingMode&&"3d"!==e.renderingMode&&t.push({message:"layers.".concat(r,': property "renderingMode" must be either "2d" or "3d"')}),t},e.validateLight=Fi,e.validateStyle=Bi,e.vectorTile=Os,e.warnOnce=d,e.wrap=o})),i(["./shared"],(function(e){function t(e){var r=Z(e);if("number"===r||"boolean"===r||"string"===r||null==e)return JSON.stringify(e);if(Array.isArray(e)){var i,n="[",a=K(e);try{for(a.s();!(i=a.n()).done;){var o=i.value;n+="".concat(t(o),",")}}catch(c){a.e(c)}finally{a.f()}return"".concat(n,"]")}for(var s=Object.keys(e).sort(),l="{",u=0;u<s.length;u++)l+="".concat(JSON.stringify(s[u]),":").concat(t(e[s[u]]),",");return"".concat(l,"}")}function r(r){var i,n="",a=K(e.refProperties);try{for(a.s();!(i=a.n()).done;){var o=i.value;n+="/".concat(t(r[o]))}}catch(s){a.e(s)}finally{a.f()}return n}var i=function(){function t(e){j(this,t),this.keyCache={},e&&this.replace(e)}return q(t,[{key:"replace",value:function(e){this._layerConfigs={},this._layers={},this.update(e,[])}},{key:"update",value:function(t,i){var n,a=this,o=K(t);try{for(o.s();!(n=o.n()).done;){var s=n.value;this._layerConfigs[s.id]=s;var l=this._layers[s.id]=e.createStyleLayer(s);l._featureFilter=e.createFilter(l.filter),this.keyCache[s.id]&&delete this.keyCache[s.id]}}catch(b){o.e(b)}finally{o.f()}var u,c=K(i);try{for(c.s();!(u=c.n()).done;){var h=u.value;delete this.keyCache[h],delete this._layerConfigs[h],delete this._layers[h]}}catch(b){c.e(b)}finally{c.f()}this.familiesBySource={};var p,f=function(e,t){for(var i={},n=0;n<e.length;n++){var a=t&&t[e[n].id]||r(e[n]);t&&(t[e[n].id]=a);var o=i[a];o||(o=i[a]=[]),o.push(e[n])}var s=[];for(var l in i)s.push(i[l]);return s}(Object.values(this._layerConfigs),this.keyCache),d=K(f);try{for(d.s();!(p=d.n()).done;){var m=p.value.map((function(e){return a._layers[e.id]})),v=m[0];if("none"!==v.visibility){var y=v.source||"",g=this.familiesBySource[y];g||(g=this.familiesBySource[y]={});var _=v.sourceLayer||"_geojsonTileLayer",x=g[_];x||(x=g[_]=[]),x.push(m)}}}catch(b){d.e(b)}finally{d.f()}}}]),t}(),n=q((function t(r){j(this,t);var i={},n=[];for(var a in r){var o=r[a],s=i[a]={};for(var l in o){var u=o[+l];if(u&&0!==u.bitmap.width&&0!==u.bitmap.height){var c={x:0,y:0,w:u.bitmap.width+2,h:u.bitmap.height+2};n.push(c),s[l]={rect:c,metrics:u.metrics}}}}var h=e.potpack(n),p=h.w,f=h.h,d=new e.AlphaImage({width:p||1,height:f||1});for(var m in r){var v=r[m];for(var y in v){var g=v[+y];if(g&&0!==g.bitmap.width&&0!==g.bitmap.height){var _=i[m][y].rect;e.AlphaImage.copy(g.bitmap,d,{x:0,y:0},{x:_.x+1,y:_.y+1},g.bitmap)}}}this.image=d,this.positions=i}));e.register("GlyphAtlas",n);var a=function(){function t(r){j(this,t),this.tileID=new e.OverscaledTileID(r.tileID.overscaledZ,r.tileID.wrap,r.tileID.canonical.z,r.tileID.canonical.x,r.tileID.canonical.y),this.uid=r.uid,this.zoom=r.zoom,this.pixelRatio=r.pixelRatio,this.tileSize=r.tileSize,this.source=r.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=r.showCollisionBoxes,this.collectResourceTiming=!!r.collectResourceTiming,this.returnDependencies=!!r.returnDependencies,this.promoteId=r.promoteId}return q(t,[{key:"parse",value:function(t,r,i,a,s){var l=this;this.status="parsing",this.data=t,this.collisionBoxArray=new e.CollisionBoxArray;var u=new e.DictionaryCoder(Object.keys(t.layers).sort()),c=new e.FeatureIndex(this.tileID,this.promoteId);c.bucketLayerIDs=[];var h,p,f,d,m={},v={featureIndex:c,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:i},y=r.familiesBySource[this.source];for(var g in y){var _=t.layers[g];if(_){1===_.version&&e.warnOnce('Vector tile source "'.concat(this.source,'" layer "').concat(g,'" does not use vector tile spec v2 and therefore may have some rendering errors.'));for(var x=u.encode(g),b=[],w=0;w<_.length;w++){var k=_.feature(w),E=c.getId(k,g);b.push({feature:k,id:E,index:w,sourceLayerIndex:x})}var T,S=K(y[g]);try{for(S.s();!(T=S.n()).done;){var C=T.value,I=C[0];I.source!==this.source&&e.warnOnce("layer.source = ".concat(I.source," does not equal this.source = ").concat(this.source)),I.minzoom&&this.zoom<Math.floor(I.minzoom)||I.maxzoom&&this.zoom>=I.maxzoom||"none"!==I.visibility&&(o(C,this.zoom,i),(m[I.id]=I.createBucket({index:c.bucketLayerIDs.length,layers:C,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:x,sourceID:this.source})).populate(b,v,this.tileID.canonical),c.bucketLayerIDs.push(C.map((function(e){return e.id}))))}}catch(D){S.e(D)}finally{S.f()}}}var z=e.mapObject(v.glyphDependencies,(function(e){return Object.keys(e).map(Number)}));Object.keys(z).length?a.send("getGlyphs",{uid:this.uid,stacks:z},(function(e,t){h||(h=e,p=t,P.call(l))})):p={};var A=Object.keys(v.iconDependencies);A.length?a.send("getImages",{icons:A,source:this.source,tileID:this.tileID,type:"icons"},(function(e,t){h||(h=e,f=t,P.call(l))})):f={};var M=Object.keys(v.patternDependencies);function P(){if(h)return s(h);if(p&&f&&d){var t=new n(p),r=new e.ImageAtlas(f,d);for(var a in m){var l=m[a];l instanceof e.SymbolBucket?(o(l.layers,this.zoom,i),e.performSymbolLayout({bucket:l,glyphMap:p,glyphPositions:t.positions,imageMap:f,imagePositions:r.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):l.hasPattern&&(l instanceof e.LineBucket||l instanceof e.FillBucket||l instanceof e.FillExtrusionBucket)&&(o(l.layers,this.zoom,i),l.addFeatures(v,this.tileID.canonical,r.patternPositions))}this.status="done",s(null,{buckets:Object.values(m).filter((function(e){return!e.isEmpty()})),featureIndex:c,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:t.image,imageAtlas:r,glyphMap:this.returnDependencies?p:null,iconMap:this.returnDependencies?f:null,glyphPositions:this.returnDependencies?t.positions:null})}}M.length?a.send("getImages",{icons:M,source:this.source,tileID:this.tileID,type:"patterns"},(function(e,t){h||(h=e,d=t,P.call(l))})):d={},P.call(this)}}]),t}();function o(t,r,i){var n,a=new e.EvaluationParameters(r),o=K(t);try{for(o.s();!(n=o.n()).done;)n.value.recalculate(a,i)}catch(s){o.e(s)}finally{o.f()}}function s(t,r){var i=e.getArrayBuffer(t.request,(function(t,i,n,a){t?r(t):i&&r(null,{vectorTile:new e.vectorTile.VectorTile(new e.pbf(i)),rawData:i,cacheControl:n,expires:a})}));return function(){i.cancel(),r()}}var l=function(){function t(e,r,i,n){j(this,t),this.actor=e,this.layerIndex=r,this.availableImages=i,this.loadVectorData=n||s,this.loading={},this.loaded={}}return q(t,[{key:"loadTile",value:function(t,r){var i=this,n=t.uid;this.loading||(this.loading={});var o=!!(t&&t.request&&t.request.collectResourceTiming)&&new e.RequestPerformance(t.request),s=this.loading[n]=new a(t);s.abort=this.loadVectorData(t,(function(t,a){if(delete i.loading[n],t||!a)return s.status="done",i.loaded[n]=s,r(t);var l=a.rawData,u={};a.expires&&(u.expires=a.expires),a.cacheControl&&(u.cacheControl=a.cacheControl);var c={};if(o){var h=o.finish();h&&(c.resourceTiming=JSON.parse(JSON.stringify(h)))}s.vectorTile=a.vectorTile,s.parse(a.vectorTile,i.layerIndex,i.availableImages,i.actor,(function(t,i){if(t||!i)return r(t);r(null,e.extend({rawTileData:l.slice(0)},i,u,c))})),i.loaded=i.loaded||{},i.loaded[n]=s}))}},{key:"reloadTile",value:function(e,t){var r=this,i=this.loaded,n=e.uid,a=this;if(i&&i[n]){var o=i[n];o.showCollisionBoxes=e.showCollisionBoxes;var s=function(e,i){var n=o.reloadCallback;n&&(delete o.reloadCallback,o.parse(o.vectorTile,a.layerIndex,r.availableImages,a.actor,n)),t(e,i)};"parsing"===o.status?o.reloadCallback=s:"done"===o.status&&(o.vectorTile?o.parse(o.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s())}}},{key:"abortTile",value:function(e,t){var r=this.loading,i=e.uid;r&&r[i]&&r[i].abort&&(r[i].abort(),delete r[i]),t()}},{key:"removeTile",value:function(e,t){var r=this.loaded,i=e.uid;r&&r[i]&&delete r[i],t()}}]),t}(),u=function(){function t(){j(this,t),this.loaded={}}return q(t,[{key:"loadTile",value:function(t,r){var i=t.uid,n=t.encoding,a=t.rawImageData,o=e.isImageBitmap(a)?this.getImageData(a):a,s=new e.DEMData(i,o,n);this.loaded=this.loaded||{},this.loaded[i]=s,r(null,s)}},{key:"getImageData",value:function(t){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(t.width,t.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=t.width,this.offscreenCanvas.height=t.height,this.offscreenCanvasContext.drawImage(t,0,0,t.width,t.height);var r=this.offscreenCanvasContext.getImageData(-1,-1,t.width+2,t.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new e.RGBAImage({width:r.width,height:r.height},r.data)}},{key:"removeTile",value:function(e){var t=this.loaded,r=e.uid;t&&t[r]&&delete t[r]}}]),t}(),c=function e(t,r){var i,n=t&&t.type;if("FeatureCollection"===n)for(i=0;i<t.features.length;i++)e(t.features[i],r);else if("GeometryCollection"===n)for(i=0;i<t.geometries.length;i++)e(t.geometries[i],r);else if("Feature"===n)e(t.geometry,r);else if("Polygon"===n)h(t.coordinates,r);else if("MultiPolygon"===n)for(i=0;i<t.coordinates.length;i++)h(t.coordinates[i],r);return t};function h(e,t){if(0!==e.length){p(e[0],t);for(var r=1;r<e.length;r++)p(e[r],!t)}}function p(e,t){for(var r=0,i=0,n=0,a=e.length,o=a-1;n<a;o=n++){var s=(e[n][0]-e[o][0])*(e[o][1]+e[n][1]),l=r+s;i+=Math.abs(r)>=Math.abs(s)?r-l+s:s-l+r,r=l}r+i>=0!=!!t&&e.reverse()}var f=e.vectorTile.VectorTileFeature.prototype.toGeoJSON,d=function(){function t(r){j(this,t),this._feature=r,this.extent=e.EXTENT,this.type=r.type,this.properties=r.tags,"id"in r&&!isNaN(r.id)&&(this.id=parseInt(r.id,10))}return q(t,[{key:"loadGeometry",value:function(){if(1===this._feature.type){var t,r=[],i=K(this._feature.geometry);try{for(i.s();!(t=i.n()).done;){var n=t.value;r.push([new e.pointGeometry(n[0],n[1])])}}catch(f){i.e(f)}finally{i.f()}return r}var a,o=[],s=K(this._feature.geometry);try{for(s.s();!(a=s.n()).done;){var l,u=a.value,c=[],h=K(u);try{for(h.s();!(l=h.n()).done;){var p=l.value;c.push(new e.pointGeometry(p[0],p[1]))}}catch(f){h.e(f)}finally{h.f()}o.push(c)}}catch(f){s.e(f)}finally{s.f()}return o}},{key:"toGeoJSON",value:function(e,t,r){return f.call(this,e,t,r)}}]),t}(),m=function(){function t(r){j(this,t),this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=e.EXTENT,this.length=r.length,this._features=r}return q(t,[{key:"feature",value:function(e){return new d(this._features[e])}}]),t}(),v={exports:{}},y=e.pointGeometry,g=e.vectorTile.VectorTileFeature,_=x;function x(e,t){this.options=t||{},this.features=e,this.length=e.length}function b(e,t){this.id="number"==typeof e.id?e.id:void 0,this.type=e.type,this.rawGeometry=1===e.type?[e.geometry]:e.geometry,this.properties=e.tags,this.extent=t||4096}x.prototype.feature=function(e){return new b(this.features[e],this.options.extent)},b.prototype.loadGeometry=function(){var e=this.rawGeometry;this.geometry=[];for(var t=0;t<e.length;t++){for(var r=e[t],i=[],n=0;n<r.length;n++)i.push(new y(r[n][0],r[n][1]));this.geometry.push(i)}return this.geometry},b.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var e=this.geometry,t=1/0,r=-1/0,i=1/0,n=-1/0,a=0;a<e.length;a++)for(var o=e[a],s=0;s<o.length;s++){var l=o[s];t=Math.min(t,l.x),r=Math.max(r,l.x),i=Math.min(i,l.y),n=Math.max(n,l.y)}return[t,i,r,n]},b.prototype.toGeoJSON=g.prototype.toGeoJSON;var w=e.pbf,k=_;function E(e){var t=new w;return function(e,t){for(var r in e.layers)t.writeMessage(3,T,e.layers[r])}(e,t),t.finish()}function T(e,t){var r;t.writeVarintField(15,e.version||1),t.writeStringField(1,e.name||""),t.writeVarintField(5,e.extent||4096);var i={keys:[],values:[],keycache:{},valuecache:{}};for(r=0;r<e.length;r++)i.feature=e.feature(r),t.writeMessage(2,C,i);var n=i.keys;for(r=0;r<n.length;r++)t.writeStringField(3,n[r]);var a=i.values;for(r=0;r<a.length;r++)t.writeMessage(4,L,a[r])}function C(e,t){var r=e.feature;void 0!==r.id&&t.writeVarintField(1,r.id),t.writeMessage(2,I,e),t.writeVarintField(3,r.type),t.writeMessage(4,D,r)}function I(e,t){var r=e.feature,i=e.keys,n=e.values,a=e.keycache,o=e.valuecache;for(var s in r.properties){var l=r.properties[s],u=a[s];if(null!==l){void 0===u&&(i.push(s),a[s]=u=i.length-1),t.writeVarint(u);var c=Z(l);"string"!==c&&"boolean"!==c&&"number"!==c&&(l=JSON.stringify(l));var h=c+":"+l,p=o[h];void 0===p&&(n.push(l),o[h]=p=n.length-1),t.writeVarint(p)}}}function z(e,t){return(t<<3)+(7&e)}function P(e){return e<<1^e>>31}function D(e,t){for(var r=e.loadGeometry(),i=e.type,n=0,a=0,o=r.length,s=0;s<o;s++){var l=r[s],u=1;1===i&&(u=l.length),t.writeVarint(z(1,u));for(var c=3===i?l.length-1:l.length,h=0;h<c;h++){1===h&&1!==i&&t.writeVarint(z(2,c-1));var p=l[h].x-n,f=l[h].y-a;t.writeVarint(P(p)),t.writeVarint(P(f)),n+=p,a+=f}3===i&&t.writeVarint(z(7,1))}}function L(e,t){var r=Z(e);"string"===r?t.writeStringField(1,e):"boolean"===r?t.writeBooleanField(7,e):"number"===r&&(e%1!=0?t.writeDoubleField(3,e):e<0?t.writeSVarintField(6,e):t.writeVarintField(5,e))}function R(e,t,r,i,n,a){if(!(n-i<=r)){var o=i+n>>1;B(e,t,o,i,n,a%2),R(e,t,r,i,o-1,a+1),R(e,t,r,o+1,n,a+1)}}function B(e,t,r,i,n,a){for(;n>i;){if(n-i>600){var o=n-i+1,s=r-i+1,l=Math.log(o),u=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*u*(o-u)/o)*(s-o/2<0?-1:1);B(e,t,r,Math.max(i,Math.floor(r-s*u/o+c)),Math.min(n,Math.floor(r+(o-s)*u/o+c)),a)}var h=t[2*r+a],p=i,f=n;for(F(e,t,i,r),t[2*n+a]>h&&F(e,t,i,n);p<f;){for(F(e,t,p,f),p++,f--;t[2*p+a]<h;)p++;for(;t[2*f+a]>h;)f--}t[2*i+a]===h?F(e,t,i,f):F(e,t,++f,n),f<=r&&(i=f+1),r<=f&&(n=f-1)}}function F(e,t,r,i){U(e,r,i),U(t,2*r,2*i),U(t,2*r+1,2*i+1)}function U(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function N(e,t,r,i){var n=e-r,a=t-i;return n*n+a*a}v.exports=E,v.exports.fromVectorTileJs=E,v.exports.fromGeojsonVt=function(e,t){t=t||{};var r={};for(var i in e)r[i]=new k(e[i].features,t),r[i].name=i,r[i].version=t.version,r[i].extent=t.extent;return E({layers:r})},v.exports.GeoJSONWrapper=k;var G,X=function(e){return e[0]},H=function(e){return e[1]},W=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:X,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:H,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:64,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Float64Array;j(this,e),this.nodeSize=n,this.points=t;for(var o=t.length<65536?Uint16Array:Uint32Array,s=this.ids=new o(t.length),l=this.coords=new a(2*t.length),u=0;u<t.length;u++)s[u]=u,l[2*u]=r(t[u]),l[2*u+1]=i(t[u]);R(s,l,n,0,s.length-1,0)}return q(e,[{key:"range",value:function(e,t,r,i){return function(e,t,r,i,n,a,o){for(var s,l,u=[0,e.length-1,0],c=[];u.length;){var h=u.pop(),p=u.pop(),f=u.pop();if(p-f<=o)for(var d=f;d<=p;d++)s=t[2*d],l=t[2*d+1],s>=r&&s<=n&&l>=i&&l<=a&&c.push(e[d]);else{var m=Math.floor((f+p)/2);s=t[2*m],l=t[2*m+1],s>=r&&s<=n&&l>=i&&l<=a&&c.push(e[m]);var v=(h+1)%2;(0===h?r<=s:i<=l)&&(u.push(f),u.push(m-1),u.push(v)),(0===h?n>=s:a>=l)&&(u.push(m+1),u.push(p),u.push(v))}}return c}(this.ids,this.coords,e,t,r,i,this.nodeSize)}},{key:"within",value:function(e,t,r){return function(e,t,r,i,n,a){for(var o=[0,e.length-1,0],s=[],l=n*n;o.length;){var u=o.pop(),c=o.pop(),h=o.pop();if(c-h<=a)for(var p=h;p<=c;p++)N(t[2*p],t[2*p+1],r,i)<=l&&s.push(e[p]);else{var f=Math.floor((h+c)/2),d=t[2*f],m=t[2*f+1];N(d,m,r,i)<=l&&s.push(e[f]);var v=(u+1)%2;(0===u?r-n<=d:i-n<=m)&&(o.push(h),o.push(f-1),o.push(v)),(0===u?r+n>=d:i+n>=m)&&(o.push(f+1),o.push(c),o.push(v))}}return s}(this.ids,this.coords,e,t,r,this.nodeSize)}}]),e}(),J={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(e){return e}},Y=Math.fround||(G=new Float32Array(1),function(e){return G[0]=+e,G[0]}),Q=function(){function e(t){j(this,e),this.options=oe(Object.create(J),t),this.trees=new Array(this.options.maxZoom+1)}return q(e,[{key:"load",value:function(e){var t=this.options,r=t.log,i=t.minZoom,n=t.maxZoom,a=t.nodeSize;r&&console.time("total time");var o="prepare ".concat(e.length," points");r&&console.time(o),this.points=e;for(var s=[],l=0;l<e.length;l++)e[l].geometry&&s.push(ee(e[l],l));this.trees[n+1]=new W(s,se,le,a,Float32Array),r&&console.timeEnd(o);for(var u=n;u>=i;u--){var c=+Date.now();s=this._cluster(s,u),this.trees[u]=new W(s,se,le,a,Float32Array),r&&console.log("z%d: %d clusters in %dms",u,s.length,+Date.now()-c)}return r&&console.timeEnd("total time"),this}},{key:"getClusters",value:function(e,t){var r=((e[0]+180)%360+360)%360-180,i=Math.max(-90,Math.min(90,e[1])),n=180===e[2]?180:((e[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)r=-180,n=180;else if(r>n){var o=this.getClusters([r,i,180,a],t),s=this.getClusters([-180,i,n,a],t);return o.concat(s)}var l,u=this.trees[this._limitZoom(t)],c=[],h=K(u.range(ie(r),ne(a),ie(n),ne(i)));try{for(h.s();!(l=h.n()).done;){var p=l.value,f=u.points[p];c.push(f.numPoints?te(f):this.points[f.index])}}catch(d){h.e(d)}finally{h.f()}return c}},{key:"getChildren",value:function(e){var t=this._getOriginId(e),r=this._getOriginZoom(e),i="No cluster with the specified id.",n=this.trees[r];if(!n)throw new Error(i);var a=n.points[t];if(!a)throw new Error(i);var o,s=this.options.radius/(this.options.extent*Math.pow(2,r-1)),l=[],u=K(n.within(a.x,a.y,s));try{for(u.s();!(o=u.n()).done;){var c=o.value,h=n.points[c];h.parentId===e&&l.push(h.numPoints?te(h):this.points[h.index])}}catch(p){u.e(p)}finally{u.f()}if(0===l.length)throw new Error(i);return l}},{key:"getLeaves",value:function(e,t,r){var i=[];return this._appendLeaves(i,e,t=t||10,r=r||0,0),i}},{key:"getTile",value:function(e,t,r){var i=this.trees[this._limitZoom(e)],n=Math.pow(2,e),a=this.options,o=a.extent,s=a.radius/o,l=(r-s)/n,u=(r+1+s)/n,c={features:[]};return this._addTileFeatures(i.range((t-s)/n,l,(t+1+s)/n,u),i.points,t,r,n,c),0===t&&this._addTileFeatures(i.range(1-s/n,l,1,u),i.points,n,r,n,c),t===n-1&&this._addTileFeatures(i.range(0,l,s/n,u),i.points,-1,r,n,c),c.features.length?c:null}},{key:"getClusterExpansionZoom",value:function(e){for(var t=this._getOriginZoom(e)-1;t<=this.options.maxZoom;){var r=this.getChildren(e);if(t++,1!==r.length)break;e=r[0].properties.cluster_id}return t}},{key:"_appendLeaves",value:function(e,t,r,i,n){var a,o=K(this.getChildren(t));try{for(o.s();!(a=o.n()).done;){var s=a.value,l=s.properties;if(l&&l.cluster?n+l.point_count<=i?n+=l.point_count:n=this._appendLeaves(e,l.cluster_id,r,i,n):n<i?n++:e.push(s),e.length===r)break}}catch(u){o.e(u)}finally{o.f()}return n}},{key:"_addTileFeatures",value:function(e,t,r,i,n,a){var o,s=K(e);try{for(s.s();!(o=s.n()).done;){var l=t[o.value],u=l.numPoints,c=void 0,h=void 0,p=void 0;if(u)c=re(l),h=l.x,p=l.y;else{var f=this.points[l.index];c=f.properties,h=ie(f.geometry.coordinates[0]),p=ne(f.geometry.coordinates[1])}var d={type:1,geometry:[[Math.round(this.options.extent*(h*n-r)),Math.round(this.options.extent*(p*n-i))]],tags:c},m=void 0;u?m=l.id:this.options.generateId?m=l.index:this.points[l.index].id&&(m=this.points[l.index].id),void 0!==m&&(d.id=m),a.features.push(d)}}catch(v){s.e(v)}finally{s.f()}}},{key:"_limitZoom",value:function(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}},{key:"_cluster",value:function(e,t){for(var r=[],i=this.options,n=i.radius,a=i.extent,o=i.reduce,s=i.minPoints,l=n/(a*Math.pow(2,t)),u=0;u<e.length;u++){var c=e[u];if(!(c.zoom<=t)){c.zoom=t;var h,p=this.trees[t+1],f=p.within(c.x,c.y,l),d=c.numPoints||1,m=d,v=K(f);try{for(v.s();!(h=v.n()).done;){var y=h.value,g=p.points[y];g.zoom>t&&(m+=g.numPoints||1)}}catch(P){v.e(P)}finally{v.f()}if(m>d&&m>=s){var _,x=c.x*d,b=c.y*d,w=o&&d>1?this._map(c,!0):null,k=(u<<5)+(t+1)+this.points.length,E=K(f);try{for(E.s();!(_=E.n()).done;){var T=_.value,S=p.points[T];if(!(S.zoom<=t)){S.zoom=t;var C=S.numPoints||1;x+=S.x*C,b+=S.y*C,S.parentId=k,o&&(w||(w=this._map(c,!0)),o(w,this._map(S)))}}}catch(P){E.e(P)}finally{E.f()}c.parentId=k,r.push($(x/m,b/m,k,m,w))}else if(r.push(c),m>1){var I,z=K(f);try{for(z.s();!(I=z.n()).done;){var A=I.value,M=p.points[A];M.zoom<=t||(M.zoom=t,r.push(M))}}catch(P){z.e(P)}finally{z.f()}}}}return r}},{key:"_getOriginId",value:function(e){return e-this.points.length>>5}},{key:"_getOriginZoom",value:function(e){return(e-this.points.length)%32}},{key:"_map",value:function(e,t){if(e.numPoints)return t?oe({},e.properties):e.properties;var r=this.points[e.index].properties,i=this.options.map(r);return t&&i===r?oe({},i):i}}]),e}();function $(e,t,r,i,n){return{x:Y(e),y:Y(t),zoom:1/0,id:r,parentId:-1,numPoints:i,properties:n}}function ee(e,t){var r=V(e.geometry.coordinates,2),i=r[0],n=r[1];return{x:Y(ie(i)),y:Y(ne(n)),zoom:1/0,index:t,parentId:-1}}function te(e){return{type:"Feature",id:e.id,properties:re(e),geometry:{type:"Point",coordinates:[(t=e.x,360*(t-.5)),ae(e.y)]}};var t}function re(e){var t=e.numPoints,r=t>=1e4?"".concat(Math.round(t/1e3),"k"):t>=1e3?Math.round(t/100)/10+"k":t;return oe(oe({},e.properties),{cluster:!0,cluster_id:e.id,point_count:t,point_count_abbreviated:r})}function ie(e){return e/360+.5}function ne(e){var t=Math.sin(e*Math.PI/180),r=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return r<0?0:r>1?1:r}function ae(e){var t=(180-360*e)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}function oe(e,t){for(var r in t)e[r]=t[r];return e}function se(e){return e.x}function le(e){return e.y}function ue(e,t,r,i){for(var n,a=i,o=r-t>>1,s=r-t,l=e[t],u=e[t+1],c=e[r],h=e[r+1],p=t+3;p<r;p+=3){var f=ce(e[p],e[p+1],l,u,c,h);if(f>a)n=p,a=f;else if(f===a){var d=Math.abs(p-o);d<s&&(n=p,s=d)}}a>i&&(n-t>3&&ue(e,t,n,i),e[n+2]=a,r-n>3&&ue(e,n,r,i))}function ce(e,t,r,i,n,a){var o=n-r,s=a-i;if(0!==o||0!==s){var l=((e-r)*o+(t-i)*s)/(o*o+s*s);l>1?(r=n,i=a):l>0&&(r+=o*l,i+=s*l)}return(o=e-r)*o+(s=t-i)*s}function he(e,t,r,i){var n={id:void 0===e?null:e,type:t,geometry:r,tags:i,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(e){var t=e.geometry,r=e.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)pe(e,t);else if("Polygon"===r||"MultiLineString"===r)for(var i=0;i<t.length;i++)pe(e,t[i]);else if("MultiPolygon"===r)for(i=0;i<t.length;i++)for(var n=0;n<t[i].length;n++)pe(e,t[i][n])}(n),n}function pe(e,t){for(var r=0;r<t.length;r+=3)e.minX=Math.min(e.minX,t[r]),e.minY=Math.min(e.minY,t[r+1]),e.maxX=Math.max(e.maxX,t[r]),e.maxY=Math.max(e.maxY,t[r+1])}function fe(e,t,r,i){if(t.geometry){var n=t.geometry.coordinates,a=t.geometry.type,o=Math.pow(r.tolerance/((1<<r.maxZoom)*r.extent),2),s=[],l=t.id;if(r.promoteId?l=t.properties[r.promoteId]:r.generateId&&(l=i||0),"Point"===a)de(n,s);else if("MultiPoint"===a)for(var u=0;u<n.length;u++)de(n[u],s);else if("LineString"===a)me(n,s,o,!1);else if("MultiLineString"===a){if(r.lineMetrics){for(u=0;u<n.length;u++)me(n[u],s=[],o,!1),e.push(he(l,"LineString",s,t.properties));return}ve(n,s,o,!1)}else if("Polygon"===a)ve(n,s,o,!0);else{if("MultiPolygon"!==a){if("GeometryCollection"===a){for(u=0;u<t.geometry.geometries.length;u++)fe(e,{id:l,geometry:t.geometry.geometries[u],properties:t.properties},r,i);return}throw new Error("Input data is not a valid GeoJSON object.")}for(u=0;u<n.length;u++){var c=[];ve(n[u],c,o,!0),s.push(c)}}e.push(he(l,a,s,t.properties))}}function de(e,t){t.push(ye(e[0])),t.push(ge(e[1])),t.push(0)}function me(e,t,r,i){for(var n,a,o=0,s=0;s<e.length;s++){var l=ye(e[s][0]),u=ge(e[s][1]);t.push(l),t.push(u),t.push(0),s>0&&(o+=i?(n*u-l*a)/2:Math.sqrt(Math.pow(l-n,2)+Math.pow(u-a,2))),n=l,a=u}var c=t.length-3;t[2]=1,ue(t,0,c,r),t[c+2]=1,t.size=Math.abs(o),t.start=0,t.end=t.size}function ve(e,t,r,i){for(var n=0;n<e.length;n++){var a=[];me(e[n],a,r,i),t.push(a)}}function ye(e){return e/360+.5}function ge(e){var t=Math.sin(e*Math.PI/180),r=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return r<0?0:r>1?1:r}function _e(e,t,r,i,n,a,o,s){if(i/=t,a>=(r/=t)&&o<i)return e;if(o<r||a>=i)return null;for(var l=[],u=0;u<e.length;u++){var c=e[u],h=c.geometry,p=c.type,f=0===n?c.minX:c.minY,d=0===n?c.maxX:c.maxY;if(f>=r&&d<i)l.push(c);else if(!(d<r||f>=i)){var m=[];if("Point"===p||"MultiPoint"===p)xe(h,m,r,i,n);else if("LineString"===p)be(h,m,r,i,n,!1,s.lineMetrics);else if("MultiLineString"===p)ke(h,m,r,i,n,!1);else if("Polygon"===p)ke(h,m,r,i,n,!0);else if("MultiPolygon"===p)for(var v=0;v<h.length;v++){var y=[];ke(h[v],y,r,i,n,!0),y.length&&m.push(y)}if(m.length){if(s.lineMetrics&&"LineString"===p){for(v=0;v<m.length;v++)l.push(he(c.id,p,m[v],c.tags));continue}"LineString"!==p&&"MultiLineString"!==p||(1===m.length?(p="LineString",m=m[0]):p="MultiLineString"),"Point"!==p&&"MultiPoint"!==p||(p=3===m.length?"Point":"MultiPoint"),l.push(he(c.id,p,m,c.tags))}}}return l.length?l:null}function xe(e,t,r,i,n){for(var a=0;a<e.length;a+=3){var o=e[a+n];o>=r&&o<=i&&(t.push(e[a]),t.push(e[a+1]),t.push(e[a+2]))}}function be(e,t,r,i,n,a,o){for(var s,l,u=we(e),c=0===n?Te:Se,h=e.start,p=0;p<e.length-3;p+=3){var f=e[p],d=e[p+1],m=e[p+2],v=e[p+3],y=e[p+4],g=0===n?f:d,_=0===n?v:y,x=!1;o&&(s=Math.sqrt(Math.pow(f-v,2)+Math.pow(d-y,2))),g<r?_>r&&(l=c(u,f,d,v,y,r),o&&(u.start=h+s*l)):g>i?_<i&&(l=c(u,f,d,v,y,i),o&&(u.start=h+s*l)):Ee(u,f,d,m),_<r&&g>=r&&(l=c(u,f,d,v,y,r),x=!0),_>i&&g<=i&&(l=c(u,f,d,v,y,i),x=!0),!a&&x&&(o&&(u.end=h+s*l),t.push(u),u=we(e)),o&&(h+=s)}var b=e.length-3;f=e[b],d=e[b+1],m=e[b+2],(g=0===n?f:d)>=r&&g<=i&&Ee(u,f,d,m),b=u.length-3,a&&b>=3&&(u[b]!==u[0]||u[b+1]!==u[1])&&Ee(u,u[0],u[1],u[2]),u.length&&t.push(u)}function we(e){var t=[];return t.size=e.size,t.start=e.start,t.end=e.end,t}function ke(e,t,r,i,n,a){for(var o=0;o<e.length;o++)be(e[o],t,r,i,n,a,!1)}function Ee(e,t,r,i){e.push(t),e.push(r),e.push(i)}function Te(e,t,r,i,n,a){var o=(a-t)/(i-t);return e.push(a),e.push(r+(n-r)*o),e.push(1),o}function Se(e,t,r,i,n,a){var o=(a-r)/(n-r);return e.push(t+(i-t)*o),e.push(a),e.push(1),o}function Ce(e,t){for(var r=[],i=0;i<e.length;i++){var n,a=e[i],o=a.type;if("Point"===o||"MultiPoint"===o||"LineString"===o)n=Ie(a.geometry,t);else if("MultiLineString"===o||"Polygon"===o){n=[];for(var s=0;s<a.geometry.length;s++)n.push(Ie(a.geometry[s],t))}else if("MultiPolygon"===o)for(n=[],s=0;s<a.geometry.length;s++){for(var l=[],u=0;u<a.geometry[s].length;u++)l.push(Ie(a.geometry[s][u],t));n.push(l)}r.push(he(a.id,o,n,a.tags))}return r}function Ie(e,t){var r=[];r.size=e.size,void 0!==e.start&&(r.start=e.start,r.end=e.end);for(var i=0;i<e.length;i+=3)r.push(e[i]+t,e[i+1],e[i+2]);return r}function ze(e,t){if(e.transformed)return e;var r,i,n,a=1<<e.z,o=e.x,s=e.y;for(r=0;r<e.features.length;r++){var l=e.features[r],u=l.geometry,c=l.type;if(l.geometry=[],1===c)for(i=0;i<u.length;i+=2)l.geometry.push(Ae(u[i],u[i+1],t,a,o,s));else for(i=0;i<u.length;i++){var h=[];for(n=0;n<u[i].length;n+=2)h.push(Ae(u[i][n],u[i][n+1],t,a,o,s));l.geometry.push(h)}}return e.transformed=!0,e}function Ae(e,t,r,i,n,a){return[Math.round(r*(e*i-n)),Math.round(r*(t*i-a))]}function Me(e,t,r,i,n){for(var a=t===n.maxZoom?0:n.tolerance/((1<<t)*n.extent),o={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:i,z:t,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},s=0;s<e.length;s++){o.numFeatures++,Pe(o,e[s],a,n);var l=e[s].minX,u=e[s].minY,c=e[s].maxX,h=e[s].maxY;l<o.minX&&(o.minX=l),u<o.minY&&(o.minY=u),c>o.maxX&&(o.maxX=c),h>o.maxY&&(o.maxY=h)}return o}function Pe(e,t,r,i){var n=t.geometry,a=t.type,o=[];if("Point"===a||"MultiPoint"===a)for(var s=0;s<n.length;s+=3)o.push(n[s]),o.push(n[s+1]),e.numPoints++,e.numSimplified++;else if("LineString"===a)De(o,n,e,r,!1,!1);else if("MultiLineString"===a||"Polygon"===a)for(s=0;s<n.length;s++)De(o,n[s],e,r,"Polygon"===a,0===s);else if("MultiPolygon"===a)for(var l=0;l<n.length;l++){var u=n[l];for(s=0;s<u.length;s++)De(o,u[s],e,r,!0,0===s)}if(o.length){var c=t.tags||null;if("LineString"===a&&i.lineMetrics){for(var h in c={},t.tags)c[h]=t.tags[h];c.mapbox_clip_start=n.start/n.size,c.mapbox_clip_end=n.end/n.size}var p={geometry:o,type:"Polygon"===a||"MultiPolygon"===a?3:"LineString"===a||"MultiLineString"===a?2:1,tags:c};null!==t.id&&(p.id=t.id),e.features.push(p)}}function De(e,t,r,i,n,a){var o=i*i;if(i>0&&t.size<(n?o:i))r.numPoints+=t.length/3;else{for(var s=[],l=0;l<t.length;l+=3)(0===i||t[l+2]>o)&&(r.numSimplified++,s.push(t[l]),s.push(t[l+1])),r.numPoints++;n&&function(e,t){for(var r=0,i=0,n=e.length,a=n-2;i<n;a=i,i+=2)r+=(e[i]-e[a])*(e[i+1]+e[a+1]);if(r>0===t)for(i=0,n=e.length;i<n/2;i+=2){var o=e[i],s=e[i+1];e[i]=e[n-2-i],e[i+1]=e[n-1-i],e[n-2-i]=o,e[n-1-i]=s}}(s,a),e.push(s)}}function Le(e,t){var r=(t=this.options=function(e,t){for(var r in t)e[r]=t[r];return e}(Object.create(this.options),t)).debug;if(r&&console.time("preprocess data"),t.maxZoom<0||t.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(t.promoteId&&t.generateId)throw new Error("promoteId and generateId cannot be used together.");var i=function(e,t){var r=[];if("FeatureCollection"===e.type)for(var i=0;i<e.features.length;i++)fe(r,e.features[i],t,i);else fe(r,"Feature"===e.type?e:{geometry:e},t);return r}(e,t);this.tiles={},this.tileCoords=[],r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",t.indexMaxZoom,t.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),i=function(e,t){var r=t.buffer/t.extent,i=e,n=_e(e,1,-1-r,r,0,-1,2,t),a=_e(e,1,1-r,2+r,0,-1,2,t);return(n||a)&&(i=_e(e,1,-r,1+r,0,-1,2,t)||[],n&&(i=Ce(n,1).concat(i)),a&&(i=i.concat(Ce(a,-1)))),i}(i,t),i.length&&this.splitTile(i,0,0,0),r&&(i.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 Re(e,t,r){return 32*((1<<e)*r+t)+e}function Be(e,t){var r=e.tileID.canonical;if(!this._geoJSONIndex)return t(null,null);var i=this._geoJSONIndex.getTile(r.z,r.x,r.y);if(!i)return t(null,null);var n=new m(i.features),a=v.exports(n);0===a.byteOffset&&a.byteLength===a.buffer.byteLength||(a=new Uint8Array(a)),t(null,{vectorTile:n,rawData:a.buffer})}Le.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Le.prototype.splitTile=function(e,t,r,i,n,a,o){for(var s=[e,t,r,i],l=this.options,u=l.debug;s.length;){i=s.pop(),r=s.pop(),t=s.pop(),e=s.pop();var c=1<<t,h=Re(t,r,i),p=this.tiles[h];if(!p&&(u>1&&console.time("creation"),p=this.tiles[h]=Me(e,t,r,i,l),this.tileCoords.push({z:t,x:r,y:i}),u)){u>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",t,r,i,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd("creation"));var f="z"+t;this.stats[f]=(this.stats[f]||0)+1,this.total++}if(p.source=e,n){if(t===l.maxZoom||t===n)continue;var d=1<<n-t;if(r!==Math.floor(a/d)||i!==Math.floor(o/d))continue}else if(t===l.indexMaxZoom||p.numPoints<=l.indexMaxPoints)continue;if(p.source=null,0!==e.length){u>1&&console.time("clipping");var m,v,y,g,_,x,b=.5*l.buffer/l.extent,w=.5-b,k=.5+b,E=1+b;m=v=y=g=null,_=_e(e,c,r-b,r+k,0,p.minX,p.maxX,l),x=_e(e,c,r+w,r+E,0,p.minX,p.maxX,l),e=null,_&&(m=_e(_,c,i-b,i+k,1,p.minY,p.maxY,l),v=_e(_,c,i+w,i+E,1,p.minY,p.maxY,l),_=null),x&&(y=_e(x,c,i-b,i+k,1,p.minY,p.maxY,l),g=_e(x,c,i+w,i+E,1,p.minY,p.maxY,l),x=null),u>1&&console.timeEnd("clipping"),s.push(m||[],t+1,2*r,2*i),s.push(v||[],t+1,2*r,2*i+1),s.push(y||[],t+1,2*r+1,2*i),s.push(g||[],t+1,2*r+1,2*i+1)}}},Le.prototype.getTile=function(e,t,r){var i=this.options,n=i.extent,a=i.debug;if(e<0||e>24)return null;var o=1<<e,s=Re(e,t=(t%o+o)%o,r);if(this.tiles[s])return ze(this.tiles[s],n);a>1&&console.log("drilling down to z%d-%d-%d",e,t,r);for(var l,u=e,c=t,h=r;!l&&u>0;)u--,c=Math.floor(c/2),h=Math.floor(h/2),l=this.tiles[Re(u,c,h)];return l&&l.source?(a>1&&console.log("found parent tile z%d-%d-%d",u,c,h),a>1&&console.time("drilling down"),this.splitTile(l.source,u,c,h,e,t,r),a>1&&console.timeEnd("drilling down"),this.tiles[s]?ze(this.tiles[s],n):null):null};var Fe=function(t){A(i,t);var r=M(i);function i(e,t,n,a){var o;return j(this,i),o=r.call(this,e,t,n,Be),a&&(o.loadGeoJSON=a),o}return q(i,[{key:"loadData",value:function(t,r){var i,n=this;null===(i=this._pendingRequest)||void 0===i||i.cancel(),this._pendingCallback&&this._pendingCallback(null,{abandoned:!0});var a=!!(t&&t.request&&t.request.collectResourceTiming)&&new e.RequestPerformance(t.request);this._pendingCallback=r,this._pendingRequest=this.loadGeoJSON(t,(function(i,o){if(delete n._pendingCallback,delete n._pendingRequest,i||!o)return r(i);if("object"!=Z(o))return r(new Error("Input data given to '".concat(t.source,"' is not a valid GeoJSON object.")));c(o,!0);try{if(t.filter){var s=e.createExpression(t.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===s.result)throw new Error(s.value.map((function(e){return"".concat(e.key,": ").concat(e.message)})).join(", "));var l=o.features.filter((function(e){return s.value.evaluate({zoom:0},e)}));o={type:"FeatureCollection",features:l}}n._geoJSONIndex=t.cluster?new Q(function(t){var r=t.superclusterOptions,i=t.clusterProperties;if(!i||!r)return r;for(var n={},a={},o={accumulated:null,zoom:0},s={properties:null},l=Object.keys(i),u=0,c=l;u<c.length;u++){var h=c[u],p=V(i[h],2),f=p[0],d=p[1],m=e.createExpression(d),v=e.createExpression("string"==typeof f?[f,["accumulated"],["get",h]]:f);n[h]=m.value,a[h]=v.value}return r.map=function(e){s.properties=e;var t,r={},i=K(l);try{for(i.s();!(t=i.n()).done;){var a=t.value;r[a]=n[a].evaluate(o,s)}}catch(u){i.e(u)}finally{i.f()}return r},r.reduce=function(e,t){s.properties=t;var r,i=K(l);try{for(i.s();!(r=i.n()).done;){var n=r.value;o.accumulated=e[n],e[n]=a[n].evaluate(o,s)}}catch(u){i.e(u)}finally{i.f()}},r}(t)).load(o.features):function(e,t){return new Le(e,t)}(o,t.geojsonVtOptions)}catch(i){return r(i)}n.loaded={};var u={};if(a){var h=a.finish();h&&(u.resourceTiming={},u.resourceTiming[t.source]=JSON.parse(JSON.stringify(h)))}r(null,u)}))}},{key:"reloadTile",value:function(e,t){var r=this.loaded;return r&&r[e.uid]?S(O(i.prototype),"reloadTile",this).call(this,e,t):this.loadTile(e,t)}},{key:"loadGeoJSON",value:function(t,r){if(t.request)return e.getJSON(t.request,r);if("string"==typeof t.data)try{r(null,JSON.parse(t.data))}catch(e){r(new Error("Input data given to '".concat(t.source,"' is not a valid GeoJSON object.")))}else r(new Error("Input data given to '".concat(t.source,"' is not a valid GeoJSON object.")));return{cancel:function(){}}}},{key:"removeSource",value:function(e,t){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),t()}},{key:"getClusterExpansionZoom",value:function(e,t){try{t(null,this._geoJSONIndex.getClusterExpansionZoom(e.clusterId))}catch(e){t(e)}}},{key:"getClusterChildren",value:function(e,t){try{t(null,this._geoJSONIndex.getChildren(e.clusterId))}catch(e){t(e)}}},{key:"getClusterLeaves",value:function(e,t){try{t(null,this._geoJSONIndex.getLeaves(e.clusterId,e.limit,e.offset))}catch(e){t(e)}}}]),i}(l),Oe=function(){function t(r){var i=this;j(this,t),this.self=r,this.actor=new e.Actor(r,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:l,geojson:Fe},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(e,t){if(i.workerSourceTypes[e])throw new Error('Worker source with name "'.concat(e,'" already registered.'));i.workerSourceTypes[e]=t},this.self.registerRTLTextPlugin=function(t){if(e.plugin.isParsed())throw new Error("RTL text plugin already registered.");e.plugin.applyArabicShaping=t.applyArabicShaping,e.plugin.processBidirectionalText=t.processBidirectionalText,e.plugin.processStyledBidirectionalText=t.processStyledBidirectionalText}}return q(t,[{key:"setReferrer",value:function(e,t){this.referrer=t}},{key:"setImages",value:function(e,t,r){for(var i in this.availableImages[e]=t,this.workerSources[e]){var n=this.workerSources[e][i];for(var a in n)n[a].availableImages=t}r()}},{key:"setLayers",value:function(e,t,r){this.getLayerIndex(e).replace(t),r()}},{key:"updateLayers",value:function(e,t,r){this.getLayerIndex(e).update(t.layers,t.removedIds),r()}},{key:"loadTile",value:function(e,t,r){this.getWorkerSource(e,t.type,t.source).loadTile(t,r)}},{key:"loadDEMTile",value:function(e,t,r){this.getDEMWorkerSource(e,t.source).loadTile(t,r)}},{key:"reloadTile",value:function(e,t,r){this.getWorkerSource(e,t.type,t.source).reloadTile(t,r)}},{key:"abortTile",value:function(e,t,r){this.getWorkerSource(e,t.type,t.source).abortTile(t,r)}},{key:"removeTile",value:function(e,t,r){this.getWorkerSource(e,t.type,t.source).removeTile(t,r)}},{key:"removeDEMTile",value:function(e,t){this.getDEMWorkerSource(e,t.source).removeTile(t)}},{key:"removeSource",value:function(e,t,r){if(this.workerSources[e]&&this.workerSources[e][t.type]&&this.workerSources[e][t.type][t.source]){var i=this.workerSources[e][t.type][t.source];delete this.workerSources[e][t.type][t.source],void 0!==i.removeSource?i.removeSource(t,r):r()}}},{key:"loadWorkerSource",value:function(e,t,r){try{this.self.importScripts(t.url),r()}catch(e){r(e.toString())}}},{key:"syncRTLPluginState",value:function(t,r,i){try{e.plugin.setState(r);var n=e.plugin.getPluginURL();if(e.plugin.isLoaded()&&!e.plugin.isParsed()&&null!=n){this.self.importScripts(n);var a=e.plugin.isParsed();i(a?void 0:new Error("RTL Text Plugin failed to import scripts from ".concat(n)),a)}}catch(e){i(e.toString())}}},{key:"getAvailableImages",value:function(e){var t=this.availableImages[e];return t||(t=[]),t}},{key:"getLayerIndex",value:function(e){var t=this.layerIndexes[e];return t||(t=this.layerIndexes[e]=new i),t}},{key:"getWorkerSource",value:function(e,t,r){var i=this;if(this.workerSources[e]||(this.workerSources[e]={}),this.workerSources[e][t]||(this.workerSources[e][t]={}),!this.workerSources[e][t][r]){var n={send:function(t,r,n){i.actor.send(t,r,n,e)}};this.workerSources[e][t][r]=new this.workerSourceTypes[t](n,this.getLayerIndex(e),this.getAvailableImages(e))}return this.workerSources[e][t][r]}},{key:"getDEMWorkerSource",value:function(e,t){return this.demWorkerSources[e]||(this.demWorkerSources[e]={}),this.demWorkerSources[e][t]||(this.demWorkerSources[e][t]=new u),this.demWorkerSources[e][t]}},{key:"enforceCacheSizeLimit",value:function(t,r){e.enforceCacheSizeLimit(r)}}]),t}();return e.isWorker()&&(self.worker=new Oe(self)),Oe})),i(["./shared"],(function(e){var t=r;function r(e){return!function(e){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 e,t,r=new Blob([""],{type:"text/javascript"}),i=URL.createObjectURL(r);try{t=new Worker(i),e=!0}catch(t){e=!1}return t&&t.terminate(),URL.revokeObjectURL(i),e}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var e=document.createElement("canvas");e.width=e.height=1;var t=e.getContext("2d");if(!t)return!1;var r=t.getImageData(0,0,1,1);return r&&r.width===e.width}()?(void 0===i[t=e&&e.failIfMajorPerformanceCaveat]&&(i[t]=function(e){var t,i=function(e){var t=document.createElement("canvas"),i=Object.create(r.webGLContextAttributes);return i.failIfMajorPerformanceCaveat=e,t.getContext("webgl",i)||t.getContext("experimental-webgl",i)}(e);if(!i)return!1;try{t=i.createShader(i.VERTEX_SHADER)}catch(e){return!1}return!(!t||i.isContextLost())&&(i.shaderSource(t,"void main() {}"),i.compileShader(t),!0===i.getShaderParameter(t,i.COMPILE_STATUS))}(t)),i[t]?document.documentMode?"insufficient ECMAScript 6 support":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 t}(e)}var i={};function n(e,t){if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1;return!0}if("object"==Z(e)&&null!==e&&null!==t){if("object"!=Z(t))return!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var i in e)if(!n(e[i],t[i]))return!1;return!0}return e===t}r.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};var a=function(){function t(){j(this,t)}return q(t,null,[{key:"testProp",value:function(e){if(!t.docStyle)return e[0];for(var r=0;r<e.length;r++)if(e[r]in t.docStyle)return e[r];return e[0]}},{key:"create",value:function(e,t,r){var i=window.document.createElement(e);return void 0!==t&&(i.className=t),r&&r.appendChild(i),i}},{key:"createNS",value:function(e,t){return window.document.createElementNS(e,t)}},{key:"disableDrag",value:function(){t.docStyle&&t.selectProp&&(t.userSelect=t.docStyle[t.selectProp],t.docStyle[t.selectProp]="none")}},{key:"enableDrag",value:function(){t.docStyle&&t.selectProp&&(t.docStyle[t.selectProp]=t.userSelect)}},{key:"setTransform",value:function(e,r){e.style[t.transformProp]=r}},{key:"addEventListener",value:function(e,t,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};e.addEventListener(t,r,"passive"in i?i:i.capture)}},{key:"removeEventListener",value:function(e,t,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};e.removeEventListener(t,r,"passive"in i?i:i.capture)}},{key:"suppressClickInternal",value:function(e){e.preventDefault(),e.stopPropagation(),window.removeEventListener("click",t.suppressClickInternal,!0)}},{key:"suppressClick",value:function(){window.addEventListener("click",t.suppressClickInternal,!0),window.setTimeout((function(){window.removeEventListener("click",t.suppressClickInternal,!0)}),0)}},{key:"mousePos",value:function(t,r){var i=t.getBoundingClientRect();return new e.pointGeometry(r.clientX-i.left-t.clientLeft,r.clientY-i.top-t.clientTop)}},{key:"touchPos",value:function(t,r){for(var i=t.getBoundingClientRect(),n=[],a=0;a<r.length;a++)n.push(new e.pointGeometry(r[a].clientX-i.left-t.clientLeft,r[a].clientY-i.top-t.clientTop));return n}},{key:"mouseButton",value:function(e){return e.button}},{key:"remove",value:function(e){e.parentNode&&e.parentNode.removeChild(e)}}]),t}();a.docStyle="undefined"!=typeof window&&window.document&&window.document.documentElement.style,a.selectProp=a.testProp(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),a.transformProp=a.testProp(["transform","WebkitTransform"]);var o=function(){function e(t){j(this,e),this._transformRequestFn=t}return q(e,[{key:"transformRequest",value:function(e,t){return this._transformRequestFn&&this._transformRequestFn(e,t)||{url:e}}},{key:"normalizeSpriteURL",value:function(e,t,r){var i=function(e){var t=e.match(s);if(!t)throw new Error('Unable to parse URL "'.concat(e,'"'));return{protocol:t[1],authority:t[2],path:t[3]||"/",params:t[4]?t[4].split("&"):[]}}(e);return i.path+="".concat(t).concat(r),function(e){var t=e.params.length?"?".concat(e.params.join("&")):"";return"".concat(e.protocol,"://").concat(e.authority).concat(e.path).concat(t)}(i)}},{key:"setTransformRequest",value:function(e){this._transformRequestFn=e}}]),e}(),s=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/,l=function(){function t(e,r,i,n){j(this,t),this.context=e,this.format=i,this.texture=e.gl.createTexture(),this.update(r,n)}return q(t,[{key:"update",value:function(t,r,i){var n=t.width,a=t.height,o=!(this.size&&this.size[0]===n&&this.size[1]===a||i),s=this.context,l=s.gl;if(this.useMipmap=Boolean(r&&r.useMipmap),l.bindTexture(l.TEXTURE_2D,this.texture),s.pixelStoreUnpackFlipY.set(!1),s.pixelStoreUnpack.set(1),s.pixelStoreUnpackPremultiplyAlpha.set(this.format===l.RGBA&&(!r||!1!==r.premultiply)),o)this.size=[n,a],t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||e.isImageBitmap(t)?l.texImage2D(l.TEXTURE_2D,0,this.format,this.format,l.UNSIGNED_BYTE,t):l.texImage2D(l.TEXTURE_2D,0,this.format,n,a,0,this.format,l.UNSIGNED_BYTE,t.data);else{var u=i||{x:0,y:0},c=u.x,h=u.y;t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||e.isImageBitmap(t)?l.texSubImage2D(l.TEXTURE_2D,0,c,h,l.RGBA,l.UNSIGNED_BYTE,t):l.texSubImage2D(l.TEXTURE_2D,0,c,h,n,a,l.RGBA,l.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&l.generateMipmap(l.TEXTURE_2D)}},{key:"bind",value:function(e,t,r){var i=this.context.gl;i.bindTexture(i.TEXTURE_2D,this.texture),r!==i.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(r=i.LINEAR),e!==this.filter&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,e),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,r||e),this.filter=e),t!==this.wrap&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,t),this.wrap=t)}},{key:"isSizePowerOfTwo",value:function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}},{key:"destroy",value:function(){this.context.gl.deleteTexture(this.texture),this.texture=null}}]),t}();function u(e){var t=e.userImage;return!!(t&&t.render&&t.render())&&(e.data.replace(new Uint8Array(t.data.buffer)),!0)}var c=function(t){A(i,t);var r=M(i);function i(){var t;return j(this,i),(t=r.call(this)).images={},t.updatedImages={},t.callbackDispatchedThisFrame={},t.loaded=!1,t.requestors=[],t.patterns={},t.atlasImage=new e.RGBAImage({width:1,height:1}),t.dirty=!0,t}return q(i,[{key:"isLoaded",value:function(){return this.loaded}},{key:"setLoaded",value:function(e){if(this.loaded!==e&&(this.loaded=e,e)){var t,r=K(this.requestors);try{for(r.s();!(t=r.n()).done;){var i=t.value,n=i.ids,a=i.callback;this._notify(n,a)}}catch(o){r.e(o)}finally{r.f()}this.requestors=[]}}},{key:"getImage",value:function(e){return this.images[e]}},{key:"addImage",value:function(e,t){if(this.images[e])throw new Error("Image id ".concat(e," already exist, use updateImage instead"));this._validate(e,t)&&(this.images[e]=t)}},{key:"_validate",value:function(t,r){var i=!0;return this._validateStretch(r.stretchX,r.data&&r.data.width)||(this.fire(new e.ErrorEvent(new Error('Image "'.concat(t,'" has invalid "stretchX" value')))),i=!1),this._validateStretch(r.stretchY,r.data&&r.data.height)||(this.fire(new e.ErrorEvent(new Error('Image "'.concat(t,'" has invalid "stretchY" value')))),i=!1),this._validateContent(r.content,r)||(this.fire(new e.ErrorEvent(new Error('Image "'.concat(t,'" has invalid "content" value')))),i=!1),i}},{key:"_validateStretch",value:function(e,t){if(!e)return!0;var r,i=0,n=K(e);try{for(n.s();!(r=n.n()).done;){var a=r.value;if(a[0]<i||a[1]<a[0]||t<a[1])return!1;i=a[1]}}catch(o){n.e(o)}finally{n.f()}return!0}},{key:"_validateContent",value:function(e,t){return!(e&&(4!==e.length||e[0]<0||t.data.width<e[0]||e[1]<0||t.data.height<e[1]||e[2]<0||t.data.width<e[2]||e[3]<0||t.data.height<e[3]||e[2]<e[0]||e[3]<e[1]))}},{key:"updateImage",value:function(e,t){var r=this.images[e];if(r.data.width!==t.data.width||r.data.height!==t.data.height)throw new Error("size mismatch between old image (".concat(r.data.width,"x").concat(r.data.height,") and new image (").concat(t.data.width,"x").concat(t.data.height,")."));t.version=r.version+1,this.images[e]=t,this.updatedImages[e]=!0}},{key:"removeImage",value:function(e){var t=this.images[e];delete this.images[e],delete this.patterns[e],t.userImage&&t.userImage.onRemove&&t.userImage.onRemove()}},{key:"listImages",value:function(){return Object.keys(this.images)}},{key:"getImages",value:function(e,t){var r=!0;if(!this.isLoaded()){var i,n=K(e);try{for(n.s();!(i=n.n()).done;){var a=i.value;this.images[a]||(r=!1)}}catch(o){n.e(o)}finally{n.f()}}this.isLoaded()||r?this._notify(e,t):this.requestors.push({ids:e,callback:t})}},{key:"_notify",value:function(t,r){var i,n={},a=K(t);try{for(a.s();!(i=a.n()).done;){var o=i.value;this.images[o]||this.fire(new e.Event("styleimagemissing",{id:o}));var s=this.images[o];s?n[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)}:e.warnOnce('Image "'.concat(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.'))}}catch(l){a.e(l)}finally{a.f()}r(null,n)}},{key:"getPixelSize",value:function(){var e=this.atlasImage;return{width:e.width,height:e.height}}},{key:"getPattern",value:function(t){var r=this.patterns[t],i=this.getImage(t);if(!i)return null;if(r&&r.position.version===i.version)return r.position;if(r)r.position.version=i.version;else{var n={w:i.data.width+2,h:i.data.height+2,x:0,y:0},a=new e.ImagePosition(n,i);this.patterns[t]={bin:n,position:a}}return this._updatePatternAtlas(),this.patterns[t].position}},{key:"bind",value:function(e){var t=e.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new l(e,this.atlasImage,t.RGBA),this.atlasTexture.bind(t.LINEAR,t.CLAMP_TO_EDGE)}},{key:"_updatePatternAtlas",value:function(){var t=[];for(var r in this.patterns)t.push(this.patterns[r].bin);var i=e.potpack(t),n=i.w,a=i.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,c=l.y+1,h=this.images[s].data,p=h.width,f=h.height;e.RGBAImage.copy(h,o,{x:0,y:0},{x:u,y:c},{width:p,height:f}),e.RGBAImage.copy(h,o,{x:0,y:f-1},{x:u,y:c-1},{width:p,height:1}),e.RGBAImage.copy(h,o,{x:0,y:0},{x:u,y:c+f},{width:p,height:1}),e.RGBAImage.copy(h,o,{x:p-1,y:0},{x:u-1,y:c},{width:1,height:f}),e.RGBAImage.copy(h,o,{x:0,y:0},{x:u+p,y:c},{width:1,height:f})}this.dirty=!0}},{key:"beginFrame",value:function(){this.callbackDispatchedThisFrame={}}},{key:"dispatchRenderCallbacks",value:function(t){var r,i=K(t);try{for(i.s();!(r=i.n()).done;){var n=r.value;if(!this.callbackDispatchedThisFrame[n]){this.callbackDispatchedThisFrame[n]=!0;var a=this.images[n];a||e.warnOnce('Image with ID: "'.concat(n,'" was not found')),u(a)&&this.updateImage(n,a)}}}catch(o){i.e(o)}finally{i.f()}}}]),i}(e.Evented),h=1e20;function p(e,t,r,i,n,a,o,s,l){for(var u=t;u<t+i;u++)f(e,r*a+u,a,n,o,s,l);for(var c=r;c<r+n;c++)f(e,c*a+t,1,i,o,s,l)}function f(e,t,r,i,n,a,o){a[0]=0,o[0]=-h,o[1]=h,n[0]=e[t];for(var s=1,l=0,u=0;s<i;s++){n[s]=e[t+s*r];var c=s*s;do{var p=a[l];u=(n[s]-n[p]+c-p*p)/(s-p)/2}while(u<=o[l]&&--l>-1);a[++l]=s,o[l]=u,o[l+1]=h}for(var f=0,d=0;f<i;f++){for(;o[d+1]<f;)d++;var m=a[d],v=f-m;e[t+f*r]=n[m]+v*v}}var d=function(){function t(e,r){j(this,t),this.requestManager=e,this.localIdeographFontFamily=r,this.entries={}}return q(t,[{key:"setURL",value:function(e){this.url=e}},{key:"getGlyphs",value:function(r,i){var n=this,a=[];for(var o in r){var s,l=K(r[o]);try{for(l.s();!(s=l.n()).done;){var u=s.value;a.push({stack:o,id:u})}}catch(c){l.e(c)}finally{l.f()}}e.asyncAll(a,(function(e,r){var i=e.stack,a=e.id,o=n.entries[i];o||(o=n.entries[i]={glyphs:{},requests:{},ranges:{}});var s=o.glyphs[a];if(void 0===s){if(s=n._tinySDF(o,i,a))return o.glyphs[a]=s,void r(null,{stack:i,id:a,glyph:s});var l=Math.floor(a/256);if(256*l>65535)r(new Error("glyphs > 65535 not supported"));else if(o.ranges[l])r(null,{stack:i,id:a,glyph:s});else{var u=o.requests[l];u||(u=o.requests[l]=[],t.loadGlyphRange(i,l,n.url,n.requestManager,(function(e,t){if(t){for(var r in t)n._doesCharSupportLocalGlyph(+r)||(o.glyphs[+r]=t[+r]);o.ranges[l]=!0}var i,a=K(u);try{for(a.s();!(i=a.n()).done;)(0,i.value)(e,t)}catch(c){a.e(c)}finally{a.f()}delete o.requests[l]}))),u.push((function(e,t){e?r(e):t&&r(null,{stack:i,id:a,glyph:t[a]||null})}))}}else r(null,{stack:i,id:a,glyph:s})}),(function(e,t){if(e)i(e);else if(t){var r,n={},a=K(t);try{for(a.s();!(r=a.n()).done;){var o=r.value,s=o.stack,l=o.id,u=o.glyph;(n[s]||(n[s]={}))[l]=u&&{id:u.id,bitmap:u.bitmap.clone(),metrics:u.metrics}}}catch(c){a.e(c)}finally{a.f()}i(null,n)}}))}},{key:"_doesCharSupportLocalGlyph",value:function(t){return!!this.localIdeographFontFamily&&(e.unicodeBlockLookup["CJK Unified Ideographs"](t)||e.unicodeBlockLookup["Hangul Syllables"](t)||e.unicodeBlockLookup.Hiragana(t)||e.unicodeBlockLookup.Katakana(t))}},{key:"_tinySDF",value:function(r,i,n){var a=this.localIdeographFontFamily;if(a&&this._doesCharSupportLocalGlyph(n)){var o=r.tinySDF;if(!o){var s="400";/bold/i.test(i)?s="900":/medium/i.test(i)?s="500":/light/i.test(i)&&(s="200"),o=r.tinySDF=new t.TinySDF({fontSize:24,buffer:3,radius:8,cutoff:.25,fontFamily:a,fontWeight:s})}var l=o.draw(String.fromCharCode(n));return{id:n,bitmap:new e.AlphaImage({width:l.width||30,height:l.height||30},l.data),metrics:{width:l.glyphWidth||24,height:l.glyphHeight||24,left:l.glyphLeft||0,top:l.glyphTop-27||-8,advance:l.glyphAdvance||24}}}}}]),t}();d.loadGlyphRange=function(t,r,i,n,a){var o=256*r,s=o+255,l=n.transformRequest(i.replace("{fontstack}",t).replace("{range}","".concat(o,"-").concat(s)),e.ResourceType.Glyphs);e.getArrayBuffer(l,(function(t,r){if(t)a(t);else if(r){var i,n={},o=K(e.parseGlyphPbf(r));try{for(o.s();!(i=o.n()).done;){var s=i.value;n[s.id]=s}}catch(l){o.e(l)}finally{o.f()}a(null,n)}}))},d.TinySDF=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.fontSize,i=void 0===r?24:r,n=t.buffer,a=void 0===n?3:n,o=t.radius,s=void 0===o?8:o,l=t.cutoff,u=void 0===l?.25:l,c=t.fontFamily,h=void 0===c?"sans-serif":c,p=t.fontWeight,f=void 0===p?"normal":p,d=t.fontStyle,m=void 0===d?"normal":d;j(this,e),this.buffer=a,this.cutoff=u,this.radius=s;var v=this.size=i+4*a,y=this._createCanvas(v),g=this.ctx=y.getContext("2d",{willReadFrequently:!0});g.font="".concat(m," ").concat(f," ").concat(i,"px ").concat(h),g.textBaseline="alphabetic",g.textAlign="left",g.fillStyle="black",this.gridOuter=new Float64Array(v*v),this.gridInner=new Float64Array(v*v),this.f=new Float64Array(v),this.z=new Float64Array(v+1),this.v=new Uint16Array(v)}return q(e,[{key:"_createCanvas",value:function(e){var t=document.createElement("canvas");return t.width=t.height=e,t}},{key:"draw",value:function(e){var t=this.ctx.measureText(e),r=t.width,i=t.actualBoundingBoxAscent,n=t.actualBoundingBoxDescent,a=t.actualBoundingBoxLeft,o=t.actualBoundingBoxRight,s=Math.ceil(i),l=Math.min(this.size-this.buffer,Math.ceil(o-a)),u=Math.min(this.size-this.buffer,s+Math.ceil(n)),c=l+2*this.buffer,f=u+2*this.buffer,d=Math.max(c*f,0),m=new Uint8ClampedArray(d),v={data:m,width:c,height:f,glyphWidth:l,glyphHeight:u,glyphTop:s,glyphLeft:0,glyphAdvance:r};if(0===l||0===u)return v;var y=this.ctx,g=this.buffer,_=this.gridInner,x=this.gridOuter;y.clearRect(g,g,l,u),y.fillText(e,g,g+s);var b=y.getImageData(g,g,l,u);x.fill(h,0,d),_.fill(0,0,d);for(var w=0;w<u;w++)for(var k=0;k<l;k++){var E=b.data[4*(w*l+k)+3]/255;if(0!==E){var T=(w+g)*c+k+g;if(1===E)x[T]=0,_[T]=h;else{var S=.5-E;x[T]=S>0?S*S:0,_[T]=S<0?S*S:0}}}p(x,0,0,c,f,c,this.f,this.v,this.z),p(_,g,g,l,u,c,this.f,this.v,this.z);for(var C=0;C<d;C++){var I=Math.sqrt(x[C])-Math.sqrt(_[C]);m[C]=Math.round(255-255*(I/this.radius+this.cutoff))}return v}}]),e}();var m=new e.Properties({anchor:new e.DataConstantProperty(e.spec.light.anchor),position:new(function(){function t(){j(this,t),this.specification=e.spec.light.position}return q(t,[{key:"possiblyEvaluate",value:function(t,r){return e.sphericalToCartesian(t.expression.evaluate(r))}},{key:"interpolate",value:function(t,r,i){return{x:e.number(t.x,r.x,i),y:e.number(t.y,r.y,i),z:e.number(t.z,r.z,i)}}}]),t}()),color:new e.DataConstantProperty(e.spec.light.color),intensity:new e.DataConstantProperty(e.spec.light.intensity)}),v="-transition",y=function(t){A(i,t);var r=M(i);function i(t){var n;return j(this,i),(n=r.call(this))._transitionable=new e.Transitionable(m),n.setLight(t),n._transitioning=n._transitionable.untransitioned(),n}return q(i,[{key:"getLight",value:function(){return this._transitionable.serialize()}},{key:"setLight",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this._validate(e.validateLight,t,r))for(var i in t){var n=t[i];i.endsWith(v)?this._transitionable.setTransition(i.slice(0,-v.length),n):this._transitionable.setValue(i,n)}}},{key:"updateTransitions",value:function(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}},{key:"hasTransition",value:function(){return this._transitioning.hasTransition()}},{key:"recalculate",value:function(e){this.properties=this._transitioning.possiblyEvaluate(e)}},{key:"_validate",value:function(t,r,i){return(!i||!1!==i.validate)&&e.emitValidationErrors(this,t.call(e.validateStyle,e.extend({value:r,style:{glyphs:!0,sprite:!0},styleSpec:e.spec})))}}]),i}(e.Evented),g=function(){function t(e,r){j(this,t),this.width=e,this.height=r,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}return q(t,[{key:"getDash",value:function(e,t){var r=e.join(",")+String(t);return this.dashEntry[r]||(this.dashEntry[r]=this.addDash(e,t)),this.dashEntry[r]}},{key:"getDashRanges",value:function(e,t,r){var i=[],n=e.length%2==1?-e[e.length-1]*r:0,a=e[0]*r,o=!0;i.push({left:n,right:a,isDash:o,zeroLength:0===e[0]});for(var s=e[0],l=1;l<e.length;l++){o=!o;var u=e[l];n=s*r,a=(s+=u)*r,i.push({left:n,right:a,isDash:o,zeroLength:0===u})}return i}},{key:"addRoundDash",value:function(e,t,r){for(var i=t/2,n=-r;n<=r;n++)for(var a=this.width*(this.nextRow+r+n),o=0,s=e[o],l=0;l<this.width;l++){l/s.right>1&&(s=e[++o]);var u=Math.abs(l-s.left),c=Math.abs(l-s.right),h=Math.min(u,c),p=void 0,f=n/r*(i+1);if(s.isDash){var d=i-Math.abs(f);p=Math.sqrt(h*h+d*d)}else p=i-Math.sqrt(h*h+f*f);this.data[a+l]=Math.max(0,Math.min(255,p+128))}}},{key:"addRegularDash",value:function(e){for(var t=e.length-1;t>=0;--t){var r=e[t],i=e[t+1];r.zeroLength?e.splice(t,1):i&&i.isDash===r.isDash&&(i.left=r.left,e.splice(t,1))}var n=e[0],a=e[e.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=e[s],u=0;u<this.width;u++){u/l.right>1&&(l=e[++s]);var c=Math.abs(u-l.left),h=Math.abs(u-l.right),p=Math.min(c,h);this.data[o+u]=Math.max(0,Math.min(255,(l.isDash?p:-p)+128))}}},{key:"addDash",value:function(t,r){var i=r?7:0,n=2*i+1;if(this.nextRow+n>this.height)return e.warnOnce("LineAtlas out of space"),null;for(var a=0,o=0;o<t.length;o++)a+=t[o];if(0!==a){var s=this.width/a,l=this.getDashRanges(t,this.width,s);r?this.addRoundDash(l,s,i):this.addRegularDash(l)}var u={y:(this.nextRow+i+.5)/this.height,height:2*i/this.height,width:a};return this.nextRow+=n,this.dirty=!0,u}},{key:"bind",value:function(e){var t=e.gl;this.texture?(t.bindTexture(t.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,t.texSubImage2D(t.TEXTURE_2D,0,0,0,this.width,this.height,t.ALPHA,t.UNSIGNED_BYTE,this.data))):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texImage2D(t.TEXTURE_2D,0,t.ALPHA,this.width,this.height,0,t.ALPHA,t.UNSIGNED_BYTE,this.data))}}]),t}(),_=function(){function t(r,i){j(this,t),this.workerPool=r,this.actors=[],this.currentActor=0,this.id=e.uniqueId();for(var n=this.workerPool.acquire(this.id),a=0;a<n.length;a++){var o=new t.Actor(n[a],i,this.id);o.name="Worker ".concat(a),this.actors.push(o)}if(!this.actors.length)throw new Error("No actors found")}return q(t,[{key:"broadcast",value:function(t,r,i){e.asyncAll(this.actors,(function(e,i){e.send(t,r,i)}),i=i||function(){})}},{key:"getActor",value:function(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}},{key:"remove",value:function(){this.actors.forEach((function(e){e.remove()})),this.actors=[],this.workerPool.release(this.id)}}]),t}();function x(t,r,i){var n=function(r,n){if(r)return i(r);if(n){var a=e.pick(e.extend(n,t),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);n.vector_layers&&(a.vectorLayers=n.vector_layers,a.vectorLayerIds=a.vectorLayers.map((function(e){return e.id}))),i(null,a)}};return t.url?e.getJSON(r.transformRequest(t.url,e.ResourceType.Source),n):e.exported.frame((function(){return n(null,t)}))}_.Actor=e.Actor;var b,w=function(){function t(r,i,n){j(this,t),this.bounds=e.LngLatBounds.convert(this.validateBounds(r)),this.minzoom=i||0,this.maxzoom=n||24}return q(t,[{key:"validateBounds",value:function(e){return Array.isArray(e)&&4===e.length?[Math.max(-180,e[0]),Math.max(-90,e[1]),Math.min(180,e[2]),Math.min(90,e[3])]:[-180,-90,180,90]}},{key:"contains",value:function(t){var r=Math.pow(2,t.z),i=Math.floor(e.mercatorXfromLng(this.bounds.getWest())*r),n=Math.floor(e.mercatorYfromLat(this.bounds.getNorth())*r),a=Math.ceil(e.mercatorXfromLng(this.bounds.getEast())*r),o=Math.ceil(e.mercatorYfromLat(this.bounds.getSouth())*r);return t.x>=i&&t.x<a&&t.y>=n&&t.y<o}}]),t}(),k=function(t){A(i,t);var r=M(i);function i(t,n,a,o){var s;if(j(this,i),(s=r.call(this)).id=t,s.dispatcher=a,s.type="vector",s.minzoom=0,s.maxzoom=22,s.scheme="xyz",s.tileSize=512,s.reparseOverscaled=!0,s.isTileClipped=!0,s._loaded=!1,e.extend(D(s),e.pick(n,["url","scheme","tileSize","promoteId"])),s._options=e.extend({type:"vector"},n),s._collectResourceTiming=n.collectResourceTiming,512!==s.tileSize)throw new Error("vector tile sources must have a tileSize of 512");return s.setEventedParent(o),P(s)}return q(i,[{key:"load",value:function(){var t=this;this._loaded=!1,this.fire(new e.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=x(this._options,this.map._requestManager,(function(r,i){t._tileJSONRequest=null,t._loaded=!0,t.map.style.sourceCaches[t.id].clearTiles(),r?t.fire(new e.ErrorEvent(r)):i&&(e.extend(t,i),i.bounds&&(t.tileBounds=new w(i.bounds,t.minzoom,t.maxzoom)),t.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})),t.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"})))}))}},{key:"loaded",value:function(){return this._loaded}},{key:"hasTile",value:function(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}},{key:"onAdd",value:function(e){this.map=e,this.load()}},{key:"setSourceProperty",value:function(e){this._tileJSONRequest&&this._tileJSONRequest.cancel(),e(),this.load()}},{key:"setTiles",value:function(e){var t=this;return this.setSourceProperty((function(){t._options.tiles=e})),this}},{key:"setUrl",value:function(e){var t=this;return this.setSourceProperty((function(){t.url=e,t._options.url=e})),this}},{key:"onRemove",value:function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}},{key:"serialize",value:function(){return e.extend({},this._options)}},{key:"loadTile",value:function(t,r){var i=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),n={request:this.map._requestManager.transformRequest(i,e.ResourceType.Tile),uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function a(i,n){return delete t.request,t.aborted?r(null):i&&404!==i.status?r(i):(n&&n.resourceTiming&&(t.resourceTiming=n.resourceTiming),this.map._refreshExpiredTiles&&n&&t.setExpiryData(n),t.loadVectorData(n,this.map.painter),e.cacheEntryPossiblyAdded(this.dispatcher),r(null),void(t.reloadCallback&&(this.loadTile(t,t.reloadCallback),t.reloadCallback=null)))}n.request.collectResourceTiming=this._collectResourceTiming,t.actor&&"expired"!==t.state?"loading"===t.state?t.reloadCallback=r:t.request=t.actor.send("reloadTile",n,a.bind(this)):(t.actor=this.dispatcher.getActor(),t.request=t.actor.send("loadTile",n,a.bind(this)))}},{key:"abortTile",value:function(e){e.request&&(e.request.cancel(),delete e.request),e.actor&&e.actor.send("abortTile",{uid:e.uid,type:this.type,source:this.id},void 0)}},{key:"unloadTile",value:function(e){e.unloadVectorData(),e.actor&&e.actor.send("removeTile",{uid:e.uid,type:this.type,source:this.id},void 0)}},{key:"hasTransition",value:function(){return!1}}]),i}(e.Evented),E=function(t){A(i,t);var r=M(i);function i(t,n,a,o){var s;return j(this,i),(s=r.call(this)).id=t,s.dispatcher=a,s.setEventedParent(o),s.type="raster",s.minzoom=0,s.maxzoom=22,s.roundZoom=!0,s.scheme="xyz",s.tileSize=512,s._loaded=!1,s._options=e.extend({type:"raster"},n),e.extend(D(s),e.pick(n,["url","scheme","tileSize"])),s}return q(i,[{key:"load",value:function(){var t=this;this._loaded=!1,this.fire(new e.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=x(this._options,this.map._requestManager,(function(r,i){t._tileJSONRequest=null,t._loaded=!0,r?t.fire(new e.ErrorEvent(r)):i&&(e.extend(t,i),i.bounds&&(t.tileBounds=new w(i.bounds,t.minzoom,t.maxzoom)),t.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})),t.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"})))}))}},{key:"loaded",value:function(){return this._loaded}},{key:"onAdd",value:function(e){this.map=e,this.load()}},{key:"onRemove",value:function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}},{key:"serialize",value:function(){return e.extend({},this._options)}},{key:"hasTile",value:function(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}},{key:"loadTile",value:function(t,r){var i=this,n=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);t.request=e.getImage(this.map._requestManager.transformRequest(n,e.ResourceType.Tile),(function(n,a,o){if(delete t.request,t.aborted)t.state="unloaded",r(null);else if(n)t.state="errored",r(n);else if(a){i.map._refreshExpiredTiles&&t.setExpiryData(o);var s=i.map.painter.context,u=s.gl;t.texture=i.map.painter.getTileTexture(a.width),t.texture?t.texture.update(a,{useMipmap:!0}):(t.texture=new l(s,a,u.RGBA,{useMipmap:!0}),t.texture.bind(u.LINEAR,u.CLAMP_TO_EDGE,u.LINEAR_MIPMAP_NEAREST),s.extTextureFilterAnisotropic&&u.texParameterf(u.TEXTURE_2D,s.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,s.extTextureFilterAnisotropicMax)),t.state="loaded",e.cacheEntryPossiblyAdded(i.dispatcher),r(null)}}))}},{key:"abortTile",value:function(e,t){e.request&&(e.request.cancel(),delete e.request),t()}},{key:"unloadTile",value:function(e,t){e.texture&&this.map.painter.saveTileTexture(e.texture),t()}},{key:"hasTransition",value:function(){return!1}}]),i}(e.Evented),T=function(t){A(i,t);var r=M(i);function i(t,n,a,o){var s;return j(this,i),(s=r.call(this,t,n,a,o)).type="raster-dem",s.maxzoom=22,s._options=e.extend({type:"raster-dem"},n),s.encoding=n.encoding||"mapbox",s}return q(i,[{key:"serialize",value:function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}}},{key:"loadTile",value:function(t,r){var i=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);function n(e,i){e&&(t.state="errored",r(e)),i&&(t.dem=i,t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0,t.state="loaded",r(null))}t.request=e.getImage(this.map._requestManager.transformRequest(i,e.ResourceType.Tile),function(i,a){if(delete t.request,t.aborted)t.state="unloaded",r(null);else if(i)t.state="errored",r(i);else if(a){this.map._refreshExpiredTiles&&t.setExpiryData(a),delete a.cacheControl,delete a.expires;var o=e.isImageBitmap(a)&&(null==b&&(b="undefined"!=typeof OffscreenCanvas&&new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof createImageBitmap),b)?a:e.exported.getImageData(a,1),s={uid:t.uid,coord:t.tileID,source:this.id,rawImageData:o,encoding:this.encoding};t.actor&&"expired"!==t.state||(t.actor=this.dispatcher.getActor(),t.actor.send("loadDEMTile",s,n.bind(this)))}}.bind(this)),t.neighboringTiles=this._getNeighboringTiles(t.tileID)}},{key:"_getNeighboringTiles",value:function(t){var r=t.canonical,i=Math.pow(2,r.z),n=(r.x-1+i)%i,a=0===r.x?t.wrap-1:t.wrap,o=(r.x+1+i)%i,s=r.x+1===i?t.wrap+1:t.wrap,l={};return l[new e.OverscaledTileID(t.overscaledZ,a,r.z,n,r.y).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,s,r.z,o,r.y).key]={backfilled:!1},r.y>0&&(l[new e.OverscaledTileID(t.overscaledZ,a,r.z,n,r.y-1).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,t.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,s,r.z,o,r.y-1).key]={backfilled:!1}),r.y+1<i&&(l[new e.OverscaledTileID(t.overscaledZ,a,r.z,n,r.y+1).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,t.wrap,r.z,r.x,r.y+1).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,s,r.z,o,r.y+1).key]={backfilled:!1}),l}},{key:"unloadTile",value:function(e){e.demTexture&&this.map.painter.saveTileTexture(e.demTexture),e.fbo&&(e.fbo.destroy(),delete e.fbo),e.dem&&delete e.dem,delete e.neighboringTiles,e.state="unloaded",e.actor&&e.actor.send("removeDEMTile",{uid:e.uid,source:this.id})}}]),i}(E),C=function(t){A(i,t);var r=M(i);function i(t,n,a,o){var s;j(this,i),(s=r.call(this)).id=t,s.type="geojson",s.minzoom=0,s.maxzoom=18,s.tileSize=512,s.isTileClipped=!0,s.reparseOverscaled=!0,s._removed=!1,s._pendingLoads=0,s.actor=a.getActor(),s.setEventedParent(o),s._data=n.data,s._options=e.extend({},n),s._collectResourceTiming=n.collectResourceTiming,void 0!==n.maxzoom&&(s.maxzoom=n.maxzoom),n.type&&(s.type=n.type),n.attribution&&(s.attribution=n.attribution),s.promoteId=n.promoteId;var l=e.EXTENT/s.tileSize;return s.workerOptions=e.extend({source:s.id,cluster:n.cluster||!1,geojsonVtOptions:{buffer:(void 0!==n.buffer?n.buffer:128)*l,tolerance:(void 0!==n.tolerance?n.tolerance:.375)*l,extent:e.EXTENT,maxZoom:s.maxzoom,lineMetrics:n.lineMetrics||!1,generateId:n.generateId||!1},superclusterOptions:{maxZoom:void 0!==n.clusterMaxZoom?n.clusterMaxZoom:s.maxzoom-1,minPoints:Math.max(2,n.clusterMinPoints||2),extent:e.EXTENT,radius:(n.clusterRadius||50)*l,log:!1,generateId:n.generateId||!1},clusterProperties:n.clusterProperties,filter:n.filter},n.workerOptions),s}return q(i,[{key:"load",value:function(){this._updateWorkerData("metadata")}},{key:"onAdd",value:function(e){this.map=e,this.load()}},{key:"setData",value:function(e){return this._data=e,this._updateWorkerData("content"),this}},{key:"getClusterExpansionZoom",value:function(e,t){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:e,source:this.id},t),this}},{key:"getClusterChildren",value:function(e,t){return this.actor.send("geojson.getClusterChildren",{clusterId:e,source:this.id},t),this}},{key:"getClusterLeaves",value:function(e,t,r,i){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:e,limit:t,offset:r},i),this}},{key:"_updateWorkerData",value:function(t){var r=this,i=e.extend({},this.workerOptions),n=this._data;"string"==typeof n?(i.request=this.map._requestManager.transformRequest(e.exported.resolveURL(n),e.ResourceType.Source),i.request.collectResourceTiming=this._collectResourceTiming):i.data=JSON.stringify(n),this._pendingLoads++,this.fire(new e.Event("dataloading",{dataType:"source"})),this.actor.send("".concat(this.type,".loadData"),i,(function(i,n){if(r._pendingLoads--,r._removed||n&&n.abandoned)r.fire(new e.Event("dataabort",{dataType:"source",sourceDataType:t}));else{var a=null;if(n&&n.resourceTiming&&n.resourceTiming[r.id]&&(a=n.resourceTiming[r.id].slice(0)),i)r.fire(new e.ErrorEvent(i));else{var o={dataType:"source",sourceDataType:t};r._collectResourceTiming&&a&&a.length>0&&e.extend(o,{resourceTiming:a}),r.fire(new e.Event("data",o))}}}))}},{key:"loaded",value:function(){return 0===this._pendingLoads}},{key:"loadTile",value:function(e,t){var r=this,i=e.actor?"reloadTile":"loadTile";e.actor=this.actor;var n={type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};e.request=this.actor.send(i,n,(function(n,a){return delete e.request,e.unloadVectorData(),e.aborted?t(null):n?t(n):(e.loadVectorData(a,r.map.painter,"reloadTile"===i),t(null))}))}},{key:"abortTile",value:function(e){e.request&&(e.request.cancel(),delete e.request),e.aborted=!0}},{key:"unloadTile",value:function(e){e.unloadVectorData(),this.actor.send("removeTile",{uid:e.uid,type:this.type,source:this.id})}},{key:"onRemove",value:function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})}},{key:"serialize",value:function(){return e.extend({},this._options,{type:this.type,data:this._data})}},{key:"hasTransition",value:function(){return!1}}]),i}(e.Evented),I=e.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),z=function(t){A(i,t);var r=M(i);function i(e,t,n,a){var o;return j(this,i),(o=r.call(this)).id=e,o.dispatcher=n,o.coordinates=t.coordinates,o.type="image",o.minzoom=0,o.maxzoom=22,o.tileSize=512,o.tiles={},o._loaded=!1,o.setEventedParent(a),o.options=t,o}return q(i,[{key:"load",value:function(t,r){var i=this;this._loaded=!1,this.fire(new e.Event("dataloading",{dataType:"source"})),this.url=this.options.url,e.getImage(this.map._requestManager.transformRequest(this.url,e.ResourceType.Image),(function(n,a){i._loaded=!0,n?i.fire(new e.ErrorEvent(n)):a&&(i.image=a,t&&(i.coordinates=t),r&&r(),i._finishLoading())}))}},{key:"loaded",value:function(){return this._loaded}},{key:"updateImage",value:function(e){var t=this;return this.image&&e.url?(this.options.url=e.url,this.load(e.coordinates,(function(){t.texture=null})),this):this}},{key:"_finishLoading",value:function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})))}},{key:"onAdd",value:function(e){this.map=e,this.load()}},{key:"setCoordinates",value:function(t){var r=this;this.coordinates=t;var i=t.map(e.MercatorCoordinate.fromLngLat);this.tileID=function(t){var r,i=1/0,n=1/0,a=-1/0,o=-1/0,s=K(t);try{for(s.s();!(r=s.n()).done;){var l=r.value;i=Math.min(i,l.x),n=Math.min(n,l.y),a=Math.max(a,l.x),o=Math.max(o,l.y)}}catch(p){s.e(p)}finally{s.f()}var u=Math.max(a-i,o-n),c=Math.max(0,Math.floor(-Math.log(u)/Math.LN2)),h=Math.pow(2,c);return new e.CanonicalTileID(c,Math.floor((i+a)/2*h),Math.floor((n+o)/2*h))}(i),this.minzoom=this.maxzoom=this.tileID.z;var n=i.map((function(e){return r.tileID.getTilePoint(e)._round()}));return this._boundsArray=new e.RasterBoundsArray,this._boundsArray.emplaceBack(n[0].x,n[0].y,0,0),this._boundsArray.emplaceBack(n[1].x,n[1].y,e.EXTENT,0),this._boundsArray.emplaceBack(n[3].x,n[3].y,0,e.EXTENT),this._boundsArray.emplaceBack(n[2].x,n[2].y,e.EXTENT,e.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"})),this}},{key:"prepare",value:function(){if(0!==Object.keys(this.tiles).length&&this.image){var t=this.map.painter.context,r=t.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,I.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new l(t,this.image,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var n=this.tiles[i];"loaded"!==n.state&&(n.state="loaded",n.texture=this.texture)}}}},{key:"loadTile",value:function(e,t){this.tileID&&this.tileID.equals(e.tileID.canonical)?(this.tiles[String(e.tileID.wrap)]=e,e.buckets={},t(null)):(e.state="errored",t(null))}},{key:"serialize",value:function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}},{key:"hasTransition",value:function(){return!1}}]),i}(e.Evented),L=function(t){A(i,t);var r=M(i);function i(e,t,n,a){var o;return j(this,i),(o=r.call(this,e,t,n,a)).roundZoom=!0,o.type="video",o.options=t,o}return q(i,[{key:"load",value:function(){var t=this;this._loaded=!1;var r=this.options;this.urls=[];var i,n=K(r.urls);try{for(n.s();!(i=n.n()).done;){var a=i.value;this.urls.push(this.map._requestManager.transformRequest(a,e.ResourceType.Source).url)}}catch(o){n.e(o)}finally{n.f()}e.getVideo(this.urls,(function(r,i){t._loaded=!0,r?t.fire(new e.ErrorEvent(r)):i&&(t.video=i,t.video.loop=!0,t.video.addEventListener("playing",(function(){t.map.triggerRepaint()})),t.map&&t.video.play(),t._finishLoading())}))}},{key:"pause",value:function(){this.video&&this.video.pause()}},{key:"play",value:function(){this.video&&this.video.play()}},{key:"seek",value:function(t){if(this.video){var r=this.video.seekable;t<r.start(0)||t>r.end(0)?this.fire(new e.ErrorEvent(new e.ValidationError("sources.".concat(this.id),null,"Playback for this video can be set only between the ".concat(r.start(0)," and ").concat(r.end(0),"-second mark.")))):this.video.currentTime=t}}},{key:"getVideo",value:function(){return this.video}},{key:"onAdd",value:function(e){this.map||(this.map=e,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}},{key:"prepare",value:function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var t=this.map.painter.context,r=t.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,I.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new l(t,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var n=this.tiles[i];"loaded"!==n.state&&(n.state="loaded",n.texture=this.texture)}}}},{key:"serialize",value:function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}},{key:"hasTransition",value:function(){return this.video&&!this.video.paused}}]),i}(z),R=function(t){A(i,t);var r=M(i);function i(t,n,a,o){var s;return j(this,i),s=r.call(this,t,n,a,o),n.coordinates?Array.isArray(n.coordinates)&&4===n.coordinates.length&&!n.coordinates.some((function(e){return!Array.isArray(e)||2!==e.length||e.some((function(e){return"number"!=typeof e}))}))||s.fire(new e.ErrorEvent(new e.ValidationError("sources.".concat(t),null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):s.fire(new e.ErrorEvent(new e.ValidationError("sources.".concat(t),null,'missing required property "coordinates"'))),n.animate&&"boolean"!=typeof n.animate&&s.fire(new e.ErrorEvent(new e.ValidationError("sources.".concat(t),null,'optional "animate" property must be a boolean value'))),n.canvas?"string"==typeof n.canvas||n.canvas instanceof HTMLCanvasElement||s.fire(new e.ErrorEvent(new e.ValidationError("sources.".concat(t),null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):s.fire(new e.ErrorEvent(new e.ValidationError("sources.".concat(t),null,'missing required property "canvas"'))),s.options=n,s.animate=void 0===n.animate||n.animate,s}return q(i,[{key:"load",value:function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new e.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())}},{key:"getCanvas",value:function(){return this.canvas}},{key:"onAdd",value:function(e){this.map=e,this.load(),this.canvas&&this.animate&&this.play()}},{key:"onRemove",value:function(){this.pause()}},{key:"prepare",value:function(){var t=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){var r=this.map.painter.context,i=r.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,I.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new l(r,this.canvas,i.RGBA,{premultiply:!0}),this.tiles){var a=this.tiles[n];"loaded"!==a.state&&(a.state="loaded",a.texture=this.texture)}}}},{key:"serialize",value:function(){return{type:"canvas",coordinates:this.coordinates}}},{key:"hasTransition",value:function(){return this._playing}},{key:"_hasInvalidDimensions",value:function(){for(var e=0,t=[this.canvas.width,this.canvas.height];e<t.length;e++){var r=t[e];if(isNaN(r)||r<=0)return!0}return!1}}]),i}(z),B={vector:k,raster:E,"raster-dem":T,geojson:C,video:L,image:z,canvas:R};function F(t,r){var i=e.create();return e.translate(i,i,[1,1,0]),e.scale(i,i,[.5*t.width,.5*t.height,1]),e.multiply(i,i,t.calculatePosMatrix(r.toUnwrapped()))}function U(e,t,r,i,n,a){var o=function(e,t,r){if(e){var i,n=K(e);try{for(n.s();!(i=n.n()).done;){var a=t[i.value];if(a&&a.source===r&&"fill-extrusion"===a.type)return!0}}catch(l){n.e(l)}finally{n.f()}}else for(var o in t){var s=t[o];if(s.source===r&&"fill-extrusion"===s.type)return!0}return!1}(n&&n.layers,t,e.id),s=a.maxPitchScaleFactor(),l=e.tilesIn(i,s,o);l.sort(N);var u,c=[],h=K(l);try{for(h.s();!(u=h.n()).done;){var p=u.value;c.push({wrappedTileID:p.tileID.wrapped().key,queryResults:p.tile.queryRenderedFeatures(t,r,e._state,p.queryGeometry,p.cameraQueryGeometry,p.scale,n,a,s,F(e.transform,p.tileID))})}}catch(m){h.e(m)}finally{h.f()}var f=function(e){var t,r={},i={},n=K(e);try{for(n.s();!(t=n.n()).done;){var a=t.value,o=a.queryResults,s=a.wrappedTileID,l=i[s]=i[s]||{};for(var u in o){var c,h=o[u],p=l[u]=l[u]||{},f=r[u]=r[u]||[],d=K(h);try{for(d.s();!(c=d.n()).done;){var v=c.value;p[v.featureIndex]||(p[v.featureIndex]=!0,f.push(v))}}catch(m){d.e(m)}finally{d.f()}}}}catch(m){n.e(m)}finally{n.f()}return r}(c);for(var d in f)f[d].forEach((function(t){var r=t.feature,i=e.getFeatureState(r.layer["source-layer"],r.id);r.source=r.layer.source,r.layer["source-layer"]&&(r.sourceLayer=r.layer["source-layer"]),r.state=i}));return f}function N(e,t){var r=e.tileID,i=t.tileID;return r.overscaledZ-i.overscaledZ||r.canonical.y-i.canonical.y||r.wrap-i.wrap||r.canonical.x-i.canonical.x}var G=function(){function t(r,i){j(this,t),this.tileID=r,this.uid=e.uniqueId(),this.uses=0,this.tileSize=i,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.textures=[],this.textureCoords={},this.expiredRequestCount=0,this.state="loading"}return q(t,[{key:"registerFadeDuration",value:function(t){var r=t+this.timeAdded;r<e.exported.now()||this.fadeEndTime&&r<this.fadeEndTime||(this.fadeEndTime=r)}},{key:"wasRequested",value:function(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state}},{key:"clearTextures",value:function(e){this.demTexture&&e.saveTileTexture(this.demTexture),this.textures.forEach((function(t){return e.saveTileTexture(t)})),this.demTexture=null,this.textures=[],this.textureCoords={}}},{key:"loadVectorData",value:function(t,r,i){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){for(var n in t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestFeatureIndex.rawTileData=t.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=function(e,t){var r={};if(!t)return r;var i,n=K(e);try{var a=function(){var e=i.value,n=e.layerIds.map((function(e){return t.getLayer(e)})).filter(Boolean);if(0!==n.length){e.layers=n,e.stateDependentLayerIds&&(e.stateDependentLayers=e.stateDependentLayerIds.map((function(e){return n.filter((function(t){return t.id===e}))[0]})));var a,o=K(n);try{for(o.s();!(a=o.n()).done;){var s=a.value;r[s.id]=e}}catch(l){o.e(l)}finally{o.f()}}};for(n.s();!(i=n.n()).done;)a()}catch(o){n.e(o)}finally{n.f()}return r}(t.buckets,r.style),this.hasSymbolBuckets=!1,this.buckets){var a=this.buckets[n];if(a instanceof e.SymbolBucket){if(this.hasSymbolBuckets=!0,!i)break;a.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(var o in this.buckets){var s=this.buckets[o];if(s instanceof e.SymbolBucket&&s.hasRTLText){this.hasRTLText=!0,e.lazyLoadRTLTextPlugin();break}}for(var l in this.queryPadding=0,this.buckets){var u=this.buckets[l];this.queryPadding=Math.max(this.queryPadding,r.style.getLayer(l).queryRadius(u))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new e.CollisionBoxArray}},{key:"unloadVectorData",value:function(){for(var e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}},{key:"getBucket",value:function(e){return this.buckets[e.id]}},{key:"upload",value:function(e){for(var t in this.buckets){var r=this.buckets[t];r.uploadPending()&&r.upload(e)}var i=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new l(e,this.imageAtlas.image,i.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new l(e,this.glyphAtlasImage,i.ALPHA),this.glyphAtlasImage=null)}},{key:"prepare",value:function(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)}},{key:"queryRenderedFeatures",value:function(e,t,r,i,n,a,o,s,l,u){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:i,cameraQueryGeometry:n,scale:a,tileSize:this.tileSize,pixelPosMatrix:u,transform:s,params:o,queryPadding:this.queryPadding*l},e,t,r):{}}},{key:"querySourceFeatures",value:function(t,r){var i=this.latestFeatureIndex;if(i&&i.rawTileData){var n=i.loadVTLayers(),a=r?r.sourceLayer:"",o=n._geojsonTileLayer||n[a];if(o)for(var s=e.createFilter(r&&r.filter),l=this.tileID.canonical,u=l.z,c=l.x,h=l.y,p={z:u,x:c,y:h},f=0;f<o.length;f++){var d=o.feature(f);if(s.needGeometry){var m=e.toEvaluationFeature(d,!0);if(!s.filter(new e.EvaluationParameters(this.tileID.overscaledZ),m,this.tileID.canonical))continue}else if(!s.filter(new e.EvaluationParameters(this.tileID.overscaledZ),d))continue;var v=i.getId(d,a),y=new e.GeoJSONFeature(d,u,c,h,v);y.tile=p,t.push(y)}}}},{key:"hasData",value:function(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state}},{key:"patternsLoaded",value:function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}},{key:"setExpiryData",value:function(t){var r=this.expirationTime;if(t.cacheControl){var i=e.parseCacheControl(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 n=Date.now(),a=!1;if(this.expirationTime>n)a=!1;else if(r)if(this.expirationTime<r)a=!0;else{var o=this.expirationTime-r;o?this.expirationTime=n+Math.max(o,3e4):a=!0}else a=!0;a?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}}},{key:"getExpiryTimeout",value: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)}},{key:"setFeatureState",value:function(e,t){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData&&0!==Object.keys(e).length){var r=this.latestFeatureIndex.loadVTLayers();for(var i in this.buckets)if(t.style.hasLayer(i)){var n=this.buckets[i],a=n.layers[0].sourceLayer||"_geojsonTileLayer",o=r[a],s=e[a];if(o&&s&&0!==Object.keys(s).length){n.update(s,o,this.imageAtlas&&this.imageAtlas.patternPositions||{});var l=t&&t.style&&t.style.getLayer(i);l&&(this.queryPadding=Math.max(this.queryPadding,l.queryRadius(n)))}}}}},{key:"holdingForFade",value:function(){return void 0!==this.symbolFadeHoldUntil}},{key:"symbolFadeFinished",value:function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<e.exported.now()}},{key:"clearFadeHold",value:function(){this.symbolFadeHoldUntil=void 0}},{key:"setHoldDuration",value:function(t){this.symbolFadeHoldUntil=e.exported.now()+t}},{key:"setDependencies",value:function(e,t){var r,i={},n=K(t);try{for(n.s();!(r=n.n()).done;)i[r.value]=!0}catch(a){n.e(a)}finally{n.f()}this.dependencies[e]=i}},{key:"hasDependency",value:function(e,t){var r,i=K(e);try{for(i.s();!(r=i.n()).done;){var n=r.value,a=this.dependencies[n];if(a){var o,s=K(t);try{for(s.s();!(o=s.n()).done;)if(a[o.value])return!0}catch(l){s.e(l)}finally{s.f()}}}}catch(l){i.e(l)}finally{i.f()}return!1}}]),t}(),X=function(){function e(t,r){j(this,e),this.max=t,this.onRemove=r,this.reset()}return q(e,[{key:"reset",value:function(){for(var e in this.data){var t,r=K(this.data[e]);try{for(r.s();!(t=r.n()).done;){var i=t.value;i.timeout&&clearTimeout(i.timeout),this.onRemove(i.value)}}catch(n){r.e(n)}finally{r.f()}}return this.data={},this.order=[],this}},{key:"add",value:function(e,t,r){var i=this,n=e.wrapped().key;void 0===this.data[n]&&(this.data[n]=[]);var a={value:t,timeout:void 0};if(void 0!==r&&(a.timeout=setTimeout((function(){i.remove(e,a)}),r)),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}},{key:"has",value:function(e){return e.wrapped().key in this.data}},{key:"getAndRemove",value:function(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null}},{key:"_getAndRemoveByKey",value:function(e){var t=this.data[e].shift();return t.timeout&&clearTimeout(t.timeout),0===this.data[e].length&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),t.value}},{key:"getByKey",value:function(e){var t=this.data[e];return t?t[0].value:null}},{key:"get",value:function(e){return this.has(e)?this.data[e.wrapped().key][0].value:null}},{key:"remove",value:function(e,t){if(!this.has(e))return this;var r=e.wrapped().key,i=void 0===t?0:this.data[r].indexOf(t),n=this.data[r][i];return this.data[r].splice(i,1),n.timeout&&clearTimeout(n.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(n.value),this.order.splice(this.order.indexOf(r),1),this}},{key:"setMaxSize",value:function(e){for(this.max=e;this.order.length>this.max;){var t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t)}return this}},{key:"filter",value:function(e){var t=[];for(var r in this.data){var i,n=K(this.data[r]);try{for(n.s();!(i=n.n()).done;){var a=i.value;e(a.value)||t.push(a)}}catch(u){n.e(u)}finally{n.f()}}for(var o=0,s=t;o<s.length;o++){var l=s[o];this.remove(l.value.tileID,l)}}}]),e}(),H=function(){function t(){j(this,t),this.state={},this.stateChanges={},this.deletedStates={}}return q(t,[{key:"updateState",value:function(t,r,i){var n=String(r);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][n]=this.stateChanges[t][n]||{},e.extend(this.stateChanges[t][n],i),null===this.deletedStates[t])for(var a in this.deletedStates[t]={},this.state[t])a!==n&&(this.deletedStates[t][a]=null);else if(this.deletedStates[t]&&null===this.deletedStates[t][n])for(var o in this.deletedStates[t][n]={},this.state[t][n])i[o]||(this.deletedStates[t][n][o]=null);else for(var s in i)this.deletedStates[t]&&this.deletedStates[t][n]&&null===this.deletedStates[t][n][s]&&delete this.deletedStates[t][n][s]}},{key:"removeFeatureState",value:function(e,t,r){if(null!==this.deletedStates[e]){var i=String(t);if(this.deletedStates[e]=this.deletedStates[e]||{},r&&void 0!==t)null!==this.deletedStates[e][i]&&(this.deletedStates[e][i]=this.deletedStates[e][i]||{},this.deletedStates[e][i][r]=null);else if(void 0!==t)if(this.stateChanges[e]&&this.stateChanges[e][i])for(r in this.deletedStates[e][i]={},this.stateChanges[e][i])this.deletedStates[e][i][r]=null;else this.deletedStates[e][i]=null;else this.deletedStates[e]=null}}},{key:"getState",value:function(t,r){var i=String(r),n=e.extend({},(this.state[t]||{})[i],(this.stateChanges[t]||{})[i]);if(null===this.deletedStates[t])return{};if(this.deletedStates[t]){var a=this.deletedStates[t][r];if(null===a)return{};for(var o in a)delete n[o]}return n}},{key:"initializeTileState",value:function(e,t){e.setFeatureState(this.state,t)}},{key:"coalesceChanges",value:function(t,r){var i={};for(var n in this.stateChanges){this.state[n]=this.state[n]||{};var a={};for(var o in this.stateChanges[n])this.state[n][o]||(this.state[n][o]={}),e.extend(this.state[n][o],this.stateChanges[n][o]),a[o]=this.state[n][o];i[n]=a}for(var s in this.deletedStates){this.state[s]=this.state[s]||{};var l={};if(null===this.deletedStates[s])for(var u in this.state[s])l[u]={},this.state[s][u]={};else for(var c in this.deletedStates[s]){if(null===this.deletedStates[s][c])this.state[s][c]={};else for(var h=0,p=Object.keys(this.deletedStates[s][c]);h<p.length;h++){var f=p[h];delete this.state[s][c][f]}l[c]=this.state[s][c]}i[s]=i[s]||{},e.extend(i[s],l)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(i).length)for(var d in t)t[d].setFeatureState(i,r)}}]),t}(),J=function(t){A(i,t);var r=M(i);function i(t,n,a){var o;return j(this,i),(o=r.call(this)).id=t,o.dispatcher=a,o.on("data",(function(e){"source"===e.dataType&&"metadata"===e.sourceDataType&&(o._sourceLoaded=!0),o._sourceLoaded&&!o._paused&&"source"===e.dataType&&"content"===e.sourceDataType&&(o.reload(),o.transform&&o.update(o.transform,o.terrain))})),o.on("dataloading",(function(){o._sourceErrored=!1})),o.on("error",(function(){o._sourceErrored=o._source.loaded()})),o._source=function(t,r,i,n){var a=new B[r.type](t,r,i,n);if(a.id!==t)throw new Error("Expected Source id to be ".concat(t," instead of ").concat(a.id));return e.bindAll(["load","abort","unload","serialize","prepare"],a),a}(t,n,a,D(o)),o._tiles={},o._cache=new X(0,o._unloadTile.bind(D(o))),o._timers={},o._cacheTimers={},o._maxTileCacheSize=null,o._loadedParentTiles={},o._coveredTiles={},o._state=new H,o}return q(i,[{key:"onAdd",value:function(e){this.map=e,this._maxTileCacheSize=e?e._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(e)}},{key:"onRemove",value:function(e){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(e)}},{key:"loaded",value:function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;if(!this._source.loaded())return!1;for(var e in this._tiles){var t=this._tiles[e];if("loaded"!==t.state&&"errored"!==t.state)return!1}return!0}},{key:"getSource",value:function(){return this._source}},{key:"pause",value:function(){this._paused=!0}},{key:"resume",value:function(){if(this._paused){var e=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}}},{key:"_loadTile",value:function(e,t){return this._source.loadTile(e,t)}},{key:"_unloadTile",value:function(e){if(this._source.unloadTile)return this._source.unloadTile(e,(function(){}))}},{key:"_abortTile",value:function(t){this._source.abortTile&&this._source.abortTile(t,(function(){})),this._source.fire(new e.Event("dataabort",{tile:t,coord:t.tileID,dataType:"source"}))}},{key:"serialize",value:function(){return this._source.serialize()}},{key:"prepare",value:function(e){for(var t in this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null),this._tiles){var r=this._tiles[t];r.upload(e),r.prepare(this.map.style.imageManager)}}},{key:"getIds",value:function(){return Object.values(this._tiles).map((function(e){return e.tileID})).sort(Y).map((function(e){return e.key}))}},{key:"getRenderableIds",value:function(t){var r=this,i=[];for(var n in this._tiles)this._isIdRenderable(n,t)&&i.push(this._tiles[n]);return t?i.sort((function(t,i){var n=t.tileID,a=i.tileID,o=new e.pointGeometry(n.canonical.x,n.canonical.y)._rotate(r.transform.angle),s=new e.pointGeometry(a.canonical.x,a.canonical.y)._rotate(r.transform.angle);return n.overscaledZ-a.overscaledZ||s.y-o.y||s.x-o.x})).map((function(e){return e.tileID.key})):i.map((function(e){return e.tileID})).sort(Y).map((function(e){return e.key}))}},{key:"hasRenderableParent",value:function(e){var t=this.findLoadedParent(e,0);return!!t&&this._isIdRenderable(t.tileID.key)}},{key:"_isIdRenderable",value:function(e,t){return this._tiles[e]&&this._tiles[e].hasData()&&!this._coveredTiles[e]&&(t||!this._tiles[e].holdingForFade())}},{key:"reload",value:function(){if(this._paused)this._shouldReloadOnResume=!0;else for(var e in this._cache.reset(),this._tiles)"errored"!==this._tiles[e].state&&this._reloadTile(e,"reloading")}},{key:"_reloadTile",value:function(e,t){var r=this._tiles[e];r&&("loading"!==r.state&&(r.state=t),this._loadTile(r,this._tileLoaded.bind(this,r,e,t)))}},{key:"_tileLoaded",value:function(t,r,i,n){if(n)return t.state="errored",void(404!==n.status?this._source.fire(new e.ErrorEvent(n,{tile:t})):this.update(this.transform,this.terrain));t.timeAdded=e.exported.now(),"expired"===i&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(r,t),"raster-dem"===this.getSource().type&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null),t.aborted||this._source.fire(new e.Event("data",{dataType:"source",tile:t,coord:t.tileID}))}},{key:"_backfillDEM",value:function(e){for(var t=this.getRenderableIds(),r=0;r<t.length;r++){var i=t[r];if(e.neighboringTiles&&e.neighboringTiles[i]){var n=this.getTileByID(i);a(e,n),a(n,e)}}function a(e,t){e.needsHillshadePrepare=!0,e.needsTerrainPrepare=!0;var r=t.tileID.canonical.x-e.tileID.canonical.x,i=t.tileID.canonical.y-e.tileID.canonical.y,n=Math.pow(2,e.tileID.canonical.z),a=t.tileID.key;0===r&&0===i||Math.abs(i)>1||(Math.abs(r)>1&&(1===Math.abs(r+n)?r+=n:1===Math.abs(r-n)&&(r-=n)),t.dem&&e.dem&&(e.dem.backfillBorder(t.dem,r,i),e.neighboringTiles&&e.neighboringTiles[a]&&(e.neighboringTiles[a].backfilled=!0)))}}},{key:"getTile",value:function(e){return this.getTileByID(e.key)}},{key:"getTileByID",value:function(e){return this._tiles[e]}},{key:"_retainLoadedChildren",value:function(e,t,r,i){for(var n in this._tiles){var a=this._tiles[n];if(!(i[n]||!a.hasData()||a.tileID.overscaledZ<=t||a.tileID.overscaledZ>r)){for(var o=a.tileID;a&&a.tileID.overscaledZ>t+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>t;)if(e[(l=l.scaledTo(l.overscaledZ-1)).key]){i[o.key]=o;break}}}}},{key:"findLoadedParent",value:function(e,t){if(e.key in this._loadedParentTiles){var r=this._loadedParentTiles[e.key];return r&&r.tileID.overscaledZ>=t?r:null}for(var i=e.overscaledZ-1;i>=t;i--){var n=e.scaledTo(i),a=this._getLoadedTile(n);if(a)return a}}},{key:"_getLoadedTile",value:function(e){var t=this._tiles[e.key];return t&&t.hasData()?t:this._cache.getByKey(e.wrapped().key)}},{key:"updateCacheSize",value:function(e){var t=Math.ceil(e.width/this._source.tileSize)+1,r=Math.ceil(e.height/this._source.tileSize)+1,i=Math.floor(t*r*5),n="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,i):i;this._cache.setMaxSize(n)}},{key:"handleWrapJump",value:function(e){var t=Math.round((e-(void 0===this._prevLng?e:this._prevLng))/360);if(this._prevLng=e,t){var r={};for(var i in this._tiles){var n=this._tiles[i];n.tileID=n.tileID.unwrapTo(n.tileID.wrap+t),r[n.tileID.key]=n}for(var a in this._tiles=r,this._timers)clearTimeout(this._timers[a]),delete this._timers[a];for(var o in this._tiles)this._setTileReloadTimer(o,this._tiles[o])}}},{key:"update",value:function(t,r){var n=this;if(this.transform=t,this.terrain=r,this._sourceLoaded&&!this._paused){var a;this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?a=t.getVisibleUnwrappedCoordinates(this._source.tileID).map((function(t){return new e.OverscaledTileID(t.canonical.z,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y)})):(a=t.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:r}),this._source.hasTile&&(a=a.filter((function(e){return n._source.hasTile(e)})))):a=[];var o=t.coveringZoomLevel(this._source),s=Math.max(o-i.maxOverzooming,this._source.minzoom),l=Math.max(o+i.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){var u,c={},h=K(a);try{for(h.s();!(u=h.n()).done;){var p=u.value;if(p.canonical.z>this._source.minzoom){var f=p.scaledTo(p.canonical.z-1);c[f.key]=f;var d=p.scaledTo(Math.max(this._source.minzoom,Math.min(p.canonical.z,5)));c[d.key]=d}}}catch(N){h.e(N)}finally{h.f()}a=a.concat(Object.values(c))}var m=this._updateRetainedTiles(a,o);if(Q(this._source.type)){for(var v={},y={},g=0,_=Object.keys(m);g<_.length;g++){var x=_[g],b=m[x],w=this._tiles[x];if(w&&!(w.fadeEndTime&&w.fadeEndTime<=e.exported.now())){var k=this.findLoadedParent(b,s);k&&(this._addTile(k.tileID),v[k.tileID.key]=k.tileID),y[x]=b}}for(var E in this._retainLoadedChildren(y,o,l,m),v)m[E]||(this._coveredTiles[E]=!0,m[E]=v[E]);if(r){var T,S={},C={},I=K(a);try{for(I.s();!(T=I.n()).done;){var z=T.value;this._tiles[z.key].hasData()?S[z.key]=z:C[z.key]=z}}catch(N){I.e(N)}finally{I.f()}for(var A in C){var M=C[A].children(this._source.maxzoom);this._tiles[M[0].key]&&this._tiles[M[1].key]&&this._tiles[M[2].key]&&this._tiles[M[3].key]&&(S[M[0].key]=m[M[0].key]=M[0],S[M[1].key]=m[M[1].key]=M[1],S[M[2].key]=m[M[2].key]=M[2],S[M[3].key]=m[M[3].key]=M[3],delete C[A])}for(var P in C){var D=this.findLoadedParent(C[P],this._source.minzoom);if(D)for(var L in S[D.tileID.key]=m[D.tileID.key]=D.tileID,S)S[L].isChildOf(D.tileID)&&delete S[L]}for(var R in this._tiles)S[R]||(this._coveredTiles[R]=!0)}}for(var B in m)this._tiles[B].clearFadeHold();var F,O=K(e.keysDifference(this._tiles,m));try{for(O.s();!(F=O.n()).done;){var V=F.value,U=this._tiles[V];U.hasSymbolBuckets&&!U.holdingForFade()?U.setHoldDuration(this.map._fadeDuration):U.hasSymbolBuckets&&!U.symbolFadeFinished()||this._removeTile(V)}}catch(N){O.e(N)}finally{O.f()}this._updateLoadedParentTileCache()}}},{key:"releaseSymbolFadeTiles",value:function(){for(var e in this._tiles)this._tiles[e].holdingForFade()&&this._removeTile(e)}},{key:"_updateRetainedTiles",value:function(e,t){var r,n={},a={},o=Math.max(t-i.maxOverzooming,this._source.minzoom),s=Math.max(t+i.maxUnderzooming,this._source.minzoom),l={},u=K(e);try{for(u.s();!(r=u.n()).done;){var c=r.value,h=this._addTile(c);n[c.key]=c,h.hasData()||t<this._source.maxzoom&&(l[c.key]=c)}}catch(w){u.e(w)}finally{u.f()}this._retainLoadedChildren(l,t,s,n);var p,f=K(e);try{for(f.s();!(p=f.n()).done;){var d=p.value,m=this._tiles[d.key];if(!m.hasData()){if(t+1>this._source.maxzoom){var v=d.children(this._source.maxzoom)[0],y=this.getTile(v);if(y&&y.hasData()){n[v.key]=v;continue}}else{var g=d.children(this._source.maxzoom);if(n[g[0].key]&&n[g[1].key]&&n[g[2].key]&&n[g[3].key])continue}for(var _=m.wasRequested(),x=d.overscaledZ-1;x>=o;--x){var b=d.scaledTo(x);if(a[b.key])break;if(a[b.key]=!0,!(m=this.getTile(b))&&_&&(m=this._addTile(b)),m&&(n[b.key]=b,_=m.wasRequested(),m.hasData()))break}}}}catch(w){f.e(w)}finally{f.f()}return n}},{key:"_updateLoadedParentTileCache",value:function(){for(var e in this._loadedParentTiles={},this._tiles){for(var t=[],r=void 0,i=this._tiles[e].tileID;i.overscaledZ>0;){if(i.key in this._loadedParentTiles){r=this._loadedParentTiles[i.key];break}t.push(i.key);var n=i.scaledTo(i.overscaledZ-1);if(r=this._getLoadedTile(n))break;i=n}for(var a=0,o=t;a<o.length;a++){var s=o[a];this._loadedParentTiles[s]=r}}}},{key:"_addTile",value:function(t){var r=this._tiles[t.key];if(r)return r;(r=this._cache.getAndRemove(t))&&(this._setTileReloadTimer(t.key,r),r.tileID=t,this._state.initializeTileState(r,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,r)));var i=r;return r||(r=new G(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(r,this._tileLoaded.bind(this,r,t.key,r.state))),r.uses++,this._tiles[t.key]=r,i||this._source.fire(new e.Event("dataloading",{tile:r,coord:r.tileID,dataType:"source"})),r}},{key:"_setTileReloadTimer",value:function(e,t){var r=this;e in this._timers&&(clearTimeout(this._timers[e]),delete this._timers[e]);var i=t.getExpiryTimeout();i&&(this._timers[e]=setTimeout((function(){r._reloadTile(e,"expired"),delete r._timers[e]}),i))}},{key:"_removeTile",value:function(e){var t=this._tiles[e];t&&(t.uses--,delete this._tiles[e],this._timers[e]&&(clearTimeout(this._timers[e]),delete this._timers[e]),t.uses>0||(t.hasData()&&"reloading"!==t.state?this._cache.add(t.tileID,t,t.getExpiryTimeout()):(t.aborted=!0,this._abortTile(t),this._unloadTile(t))))}},{key:"clearTiles",value:function(){for(var e in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(e);this._cache.reset()}},{key:"tilesIn",value:function(t,r,i){var n=this,a=[],o=this.transform;if(!o)return a;var s,l=i?o.getCameraQueryGeometry(t):t,u=t.map((function(e){return o.pointCoordinate(e,n.terrain)})),c=l.map((function(e){return o.pointCoordinate(e,n.terrain)})),h=this.getIds(),p=1/0,f=1/0,d=-1/0,m=-1/0,v=K(c);try{for(v.s();!(s=v.n()).done;){var y=s.value;p=Math.min(p,y.x),f=Math.min(f,y.y),d=Math.max(d,y.x),m=Math.max(m,y.y)}}catch(x){v.e(x)}finally{v.f()}for(var g=function(t){var i=n._tiles[h[t]];if(i.holdingForFade())return"continue";var s=i.tileID,l=Math.pow(2,o.zoom-i.tileID.overscaledZ),v=r*i.queryPadding*e.EXTENT/i.tileSize/l,y=[s.getTilePoint(new e.MercatorCoordinate(p,f)),s.getTilePoint(new e.MercatorCoordinate(d,m))];if(y[0].x-v<e.EXTENT&&y[0].y-v<e.EXTENT&&y[1].x+v>=0&&y[1].y+v>=0){var g=u.map((function(e){return s.getTilePoint(e)})),_=c.map((function(e){return s.getTilePoint(e)}));a.push({tile:i,tileID:s,queryGeometry:g,cameraQueryGeometry:_,scale:l})}},_=0;_<h.length;_++)g(_);return a}},{key:"getVisibleCoordinates",value:function(e){var t,r=this,i=this.getRenderableIds(e).map((function(e){return r._tiles[e].tileID})),n=K(i);try{for(n.s();!(t=n.n()).done;){var a=t.value;a.posMatrix=this.transform.calculatePosMatrix(a.toUnwrapped())}}catch(o){n.e(o)}finally{n.f()}return i}},{key:"hasTransition",value:function(){if(this._source.hasTransition())return!0;if(Q(this._source.type))for(var t in this._tiles){var r=this._tiles[t];if(void 0!==r.fadeEndTime&&r.fadeEndTime>=e.exported.now())return!0}return!1}},{key:"setFeatureState",value:function(e,t,r){this._state.updateState(e=e||"_geojsonTileLayer",t,r)}},{key:"removeFeatureState",value:function(e,t,r){this._state.removeFeatureState(e=e||"_geojsonTileLayer",t,r)}},{key:"getFeatureState",value:function(e,t){return this._state.getState(e=e||"_geojsonTileLayer",t)}},{key:"setDependencies",value:function(e,t,r){var i=this._tiles[e];i&&i.setDependencies(t,r)}},{key:"reloadTilesForDependencies",value:function(e,t){for(var r in this._tiles)this._tiles[r].hasDependency(e,t)&&this._reloadTile(r,"reloading");this._cache.filter((function(r){return!r.hasDependency(e,t)}))}}]),i}(e.Evented);function Y(e,t){var r=Math.abs(2*e.wrap)-+(e.wrap<0),i=Math.abs(2*t.wrap)-+(t.wrap<0);return e.overscaledZ-t.overscaledZ||i-r||t.canonical.y-e.canonical.y||t.canonical.x-e.canonical.x}function Q(e){return"raster"===e||"image"===e||"video"===e}J.maxOverzooming=10,J.maxUnderzooming=3;var $,ee="mapboxgl_preloaded_worker_pool",te=function(){function e(){j(this,e),this.active={}}return q(e,[{key:"acquire",value:function(t){if(!this.workers)for(this.workers=[];this.workers.length<e.workerCount;)this.workers.push(new Worker(Dn.workerUrl));return this.active[t]=!0,this.workers.slice()}},{key:"release",value:function(e){delete this.active[e],0===this.numActive()&&(this.workers.forEach((function(e){e.terminate()})),this.workers=null)}},{key:"isPreloaded",value:function(){return!!this.active[ee]}},{key:"numActive",value:function(){return Object.keys(this.active).length}}]),e}(),re=Math.floor(e.exported.hardwareConcurrency/2);function ie(){return $||($=new te),$}function ne(t,r){var i={};for(var n in t)"ref"!==n&&(i[n]=t[n]);return e.refProperties.forEach((function(e){e in r&&(i[e]=r[e])})),i}function ae(e){e=e.slice();for(var t=Object.create(null),r=0;r<e.length;r++)t[e[r].id]=e[r];for(var i=0;i<e.length;i++)"ref"in e[i]&&(e[i]=ne(e[i],t[e[i].ref]));return e}te.workerCount=Math.max(Math.min(re,6),1);var oe={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 se(e,t,r){r.push({command:oe.addSource,args:[e,t[e]]})}function le(e,t,r){t.push({command:oe.removeSource,args:[e]}),r[e]=!0}function ue(e,t,r,i){le(e,r,i),se(e,t,r)}function ce(e,t,r){var i;for(i in e[r])if(Object.prototype.hasOwnProperty.call(e[r],i)&&"data"!==i&&!n(e[r][i],t[r][i]))return!1;for(i in t[r])if(Object.prototype.hasOwnProperty.call(t[r],i)&&"data"!==i&&!n(e[r][i],t[r][i]))return!1;return!0}function he(e,t,r,i,a,o){var s;for(s in t=t||{},e=e||{})Object.prototype.hasOwnProperty.call(e,s)&&(n(e[s],t[s])||r.push({command:o,args:[i,s,t[s],a]}));for(s in t)Object.prototype.hasOwnProperty.call(t,s)&&!Object.prototype.hasOwnProperty.call(e,s)&&(n(e[s],t[s])||r.push({command:o,args:[i,s,t[s],a]}))}function pe(e){return e.id}function fe(e,t){return e[t.id]=t,e}var de=function(){function t(e,r){j(this,t),this.reset(e,r)}return q(t,[{key:"reset",value:function(e,t){this.points=e||[],this._distances=[0];for(var r=1;r<this.points.length;r++)this._distances[r]=this._distances[r-1]+this.points[r].dist(this.points[r-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(t||0,.5*this.length),this.paddedLength=this.length-2*this.padding}},{key:"lerp",value:function(t){if(1===this.points.length)return this.points[0];t=e.clamp(t,0,1);for(var r=1,i=this._distances[r],n=t*this.paddedLength+this.padding;i<n&&r<this._distances.length;)i=this._distances[++r];var a=r-1,o=this._distances[a],s=i-o,l=s>0?(n-o)/s:0;return this.points[a].mult(1-l).add(this.points[r].mult(l))}}]),t}();function me(e,t){var r=!0;return"always"===e||"never"!==e&&"never"!==t||(r=!1),r}var ve=function(){function e(t,r,i){j(this,e);var n=this.boxCells=[],a=this.circleCells=[];this.xCellCount=Math.ceil(t/i),this.yCellCount=Math.ceil(r/i);for(var o=0;o<this.xCellCount*this.yCellCount;o++)n.push([]),a.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=t,this.height=r,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/r,this.boxUid=0,this.circleUid=0}return q(e,[{key:"keysLength",value:function(){return this.boxKeys.length+this.circleKeys.length}},{key:"insert",value:function(e,t,r,i,n){this._forEachCell(t,r,i,n,this._insertBoxCell,this.boxUid++),this.boxKeys.push(e),this.bboxes.push(t),this.bboxes.push(r),this.bboxes.push(i),this.bboxes.push(n)}},{key:"insertCircle",value:function(e,t,r,i){this._forEachCell(t-i,r-i,t+i,r+i,this._insertCircleCell,this.circleUid++),this.circleKeys.push(e),this.circles.push(t),this.circles.push(r),this.circles.push(i)}},{key:"_insertBoxCell",value:function(e,t,r,i,n,a){this.boxCells[n].push(a)}},{key:"_insertCircleCell",value:function(e,t,r,i,n,a){this.circleCells[n].push(a)}},{key:"_query",value:function(e,t,r,i,n,a,o){if(r<0||e>this.width||i<0||t>this.height)return[];var s=[];if(e<=0&&t<=0&&this.width<=r&&this.height<=i){if(n)return[{key:null,x1:e,y1:t,x2:r,y2:i}];for(var l=0;l<this.boxKeys.length;l++)s.push({key:this.boxKeys[l],x1:this.bboxes[4*l],y1:this.bboxes[4*l+1],x2:this.bboxes[4*l+2],y2:this.bboxes[4*l+3]});for(var u=0;u<this.circleKeys.length;u++){var c=this.circles[3*u],h=this.circles[3*u+1],p=this.circles[3*u+2];s.push({key:this.circleKeys[u],x1:c-p,y1:h-p,x2:c+p,y2:h+p})}}else this._forEachCell(e,t,r,i,this._queryCell,s,{hitTest:n,overlapMode:a,seenUids:{box:{},circle:{}}},o);return s}},{key:"query",value:function(e,t,r,i){return this._query(e,t,r,i,!1,null)}},{key:"hitTest",value:function(e,t,r,i,n,a){return this._query(e,t,r,i,!0,n,a).length>0}},{key:"hitTestCircle",value:function(e,t,r,i,n){var a=e-r,o=e+r,s=t-r,l=t+r;if(o<0||a>this.width||l<0||s>this.height)return!1;var u=[];return this._forEachCell(a,s,o,l,this._queryCellCircle,u,{hitTest:!0,overlapMode:i,circle:{x:e,y:t,radius:r},seenUids:{box:{},circle:{}}},n),u.length>0}},{key:"_queryCell",value:function(e,t,r,i,n,a,o,s){var l=o.seenUids,u=o.hitTest,c=o.overlapMode,h=this.boxCells[n];if(null!==h){var p,f=this.bboxes,d=K(h);try{for(d.s();!(p=d.n()).done;){var m=p.value;if(!l.box[m]){l.box[m]=!0;var v=4*m,y=this.boxKeys[m];if(e<=f[v+2]&&t<=f[v+3]&&r>=f[v+0]&&i>=f[v+1]&&(!s||s(y))&&(!u||!me(c,y.overlapMode))&&(a.push({key:y,x1:f[v],y1:f[v+1],x2:f[v+2],y2:f[v+3]}),u))return!0}}}catch(I){d.e(I)}finally{d.f()}}var g=this.circleCells[n];if(null!==g){var _,x=this.circles,b=K(g);try{for(b.s();!(_=b.n()).done;){var w=_.value;if(!l.circle[w]){l.circle[w]=!0;var k=3*w,E=this.circleKeys[w];if(this._circleAndRectCollide(x[k],x[k+1],x[k+2],e,t,r,i)&&(!s||s(E))&&(!u||!me(c,E.overlapMode))){var T=x[k],S=x[k+1],C=x[k+2];if(a.push({key:E,x1:T-C,y1:S-C,x2:T+C,y2:S+C}),u)return!0}}}}catch(I){b.e(I)}finally{b.f()}}return!1}},{key:"_queryCellCircle",value:function(e,t,r,i,n,a,o,s){var l=o.circle,u=o.seenUids,c=o.overlapMode,h=this.boxCells[n];if(null!==h){var p,f=this.bboxes,d=K(h);try{for(d.s();!(p=d.n()).done;){var m=p.value;if(!u.box[m]){u.box[m]=!0;var v=4*m,y=this.boxKeys[m];if(this._circleAndRectCollide(l.x,l.y,l.radius,f[v+0],f[v+1],f[v+2],f[v+3])&&(!s||s(y))&&!me(c,y.overlapMode))return a.push(!0),!0}}}catch(T){d.e(T)}finally{d.f()}}var g=this.circleCells[n];if(null!==g){var _,x=this.circles,b=K(g);try{for(b.s();!(_=b.n()).done;){var w=_.value;if(!u.circle[w]){u.circle[w]=!0;var k=3*w,E=this.circleKeys[w];if(this._circlesCollide(x[k],x[k+1],x[k+2],l.x,l.y,l.radius)&&(!s||s(E))&&!me(c,E.overlapMode))return a.push(!0),!0}}}catch(T){b.e(T)}finally{b.f()}}}},{key:"_forEachCell",value:function(e,t,r,i,n,a,o,s){for(var l=this._convertToXCellCoord(e),u=this._convertToYCellCoord(t),c=this._convertToXCellCoord(r),h=this._convertToYCellCoord(i),p=l;p<=c;p++)for(var f=u;f<=h;f++)if(n.call(this,e,t,r,i,this.xCellCount*f+p,a,o,s))return}},{key:"_convertToXCellCoord",value:function(e){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(e*this.xScale)))}},{key:"_convertToYCellCoord",value:function(e){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(e*this.yScale)))}},{key:"_circlesCollide",value:function(e,t,r,i,n,a){var o=i-e,s=n-t,l=r+a;return l*l>o*o+s*s}},{key:"_circleAndRectCollide",value:function(e,t,r,i,n,a,o){var s=(a-i)/2,l=Math.abs(e-(i+s));if(l>s+r)return!1;var u=(o-n)/2,c=Math.abs(t-(n+u));if(c>u+r)return!1;if(l<=s||c<=u)return!0;var h=l-s,p=c-u;return h*h+p*p<=r*r}}]),e}();function ye(t,r,i,n,a){var o=e.create();return r?(e.scale(o,o,[1/a,1/a,1]),i||e.rotateZ(o,o,n.angle)):e.multiply(o,n.labelPlaneMatrix,t),o}function ge(t,r,i,n,a){if(r){var o=e.clone(t);return e.scale(o,o,[a,a,1]),i||e.rotateZ(o,o,-n.angle),o}return n.glCoordMatrix}function _e(t,r,i){var n;i?(n=[t.x,t.y,i(t.x,t.y),1],e.transformMat4(n,n,r)):Ae(n=[t.x,t.y,0,1],n,r);var a=n[3];return{point:new e.pointGeometry(n[0]/a,n[1]/a),signedDistanceFromCamera:a}}function xe(e,t){return.5+e/t*.5}function be(e,t){var r=e[0]/e[3],i=e[1]/e[3];return r>=-t[0]&&r<=t[0]&&i>=-t[1]&&i<=t[1]}function we(t,r,i,n,a,o,s,l,u,c){var h=n?t.textSizeData:t.iconSizeData,p=e.evaluateSizeForZoom(h,i.transform.zoom),f=[256/i.width*2+1,256/i.height*2+1],d=n?t.text.dynamicLayoutVertexArray:t.icon.dynamicLayoutVertexArray;d.clear();for(var m=t.lineVertexArray,v=n?t.text.placedSymbolArray:t.icon.placedSymbolArray,y=i.transform.width/i.transform.height,g=!1,_=0;_<v.length;_++){var x=v.get(_);if(x.hidden||x.writingMode===e.WritingMode.vertical&&!g)ze(x.numGlyphs,d);else{var b=void 0;if(g=!1,c?(b=[x.anchorX,x.anchorY,c(x.anchorX,x.anchorY),1],e.transformMat4(b,b,r)):Ae(b=[x.anchorX,x.anchorY,0,1],b,r),be(b,f)){var w=xe(i.transform.cameraToCenterDistance,b[3]),k=e.evaluateSizeForFeature(h,p,x),E=s?k/w:k*w,T=new e.pointGeometry(x.anchorX,x.anchorY),S=_e(T,a,c).point,C={},I=Te(x,E,!1,l,r,a,o,t.glyphOffsetArray,m,d,S,T,C,y,u,c);g=I.useVertical,(I.notEnoughRoom||g||I.needsFlipping&&Te(x,E,!0,l,r,a,o,t.glyphOffsetArray,m,d,S,T,C,y,u,c).notEnoughRoom)&&ze(x.numGlyphs,d)}else ze(x.numGlyphs,d)}}n?t.text.dynamicLayoutVertexBuffer.updateData(d):t.icon.dynamicLayoutVertexBuffer.updateData(d)}function ke(e,t,r,i,n,a,o,s,l,u,c,h,p){var f=s.glyphStartIndex+s.numGlyphs,d=s.lineStartIndex,m=s.lineStartIndex+s.lineLength,v=t.getoffsetX(s.glyphStartIndex),y=t.getoffsetX(f-1),g=Ce(e*v,r,i,n,a,o,s.segment,d,m,l,u,c,h,p);if(!g)return null;var _=Ce(e*y,r,i,n,a,o,s.segment,d,m,l,u,c,h,p);return _?{first:g,last:_}:null}function Ee(t,r,i,n){return t===e.WritingMode.horizontal&&Math.abs(i.y-r.y)>Math.abs(i.x-r.x)*n?{useVertical:!0}:(t===e.WritingMode.vertical?r.y<i.y:r.x>i.x)?{needsFlipping:!0}:null}function Te(t,r,i,n,a,o,s,l,u,c,h,p,f,d,m,v){var y,g=r/24,_=t.lineOffsetX*g,x=t.lineOffsetY*g;if(t.numGlyphs>1){var b=t.glyphStartIndex+t.numGlyphs,w=t.lineStartIndex,k=t.lineStartIndex+t.lineLength,E=ke(g,l,_,x,i,h,p,t,u,o,f,m,v);if(!E)return{notEnoughRoom:!0};var T=_e(E.first.point,s,v).point,S=_e(E.last.point,s,v).point;if(n&&!i){var C=Ee(t.writingMode,T,S,d);if(C)return C}y=[E.first];for(var I=t.glyphStartIndex+1;I<b-1;I++)y.push(Ce(g*l.getoffsetX(I),_,x,i,h,p,t.segment,w,k,u,o,f,m,v));y.push(E.last)}else{if(n&&!i){var z=_e(p,a,v).point,A=t.lineStartIndex+t.segment+1,M=new e.pointGeometry(u.getx(A),u.gety(A)),P=_e(M,a,v),D=P.signedDistanceFromCamera>0?P.point:Se(p,M,z,1,a,v),L=Ee(t.writingMode,z,D,d);if(L)return L}var R=Ce(g*l.getoffsetX(t.glyphStartIndex),_,x,i,h,p,t.segment,t.lineStartIndex,t.lineStartIndex+t.lineLength,u,o,f,m,v);if(!R)return{notEnoughRoom:!0};y=[R]}var B,F=K(y);try{for(F.s();!(B=F.n()).done;){var O=B.value;e.addDynamicAttributes(c,O.point,O.angle)}}catch(V){F.e(V)}finally{F.f()}return{}}function Se(e,t,r,i,n,a){var o=_e(e.add(e.sub(t)._unit()),n,a).point,s=r.sub(o);return r.add(s._mult(i/s.mag()))}function Ce(t,r,i,n,a,o,s,l,u,c,h,p,f,d){var m=n?t-r:t+r,v=m>0?1:-1,y=0;n&&(v*=-1,y=Math.PI),v<0&&(y+=Math.PI);for(var g=v>0?l+s:l+s+1,_=a,x=a,b=0,w=0,k=Math.abs(m),E=[];b+w<=k;){if((g+=v)<l||g>=u)return null;if(x=_,E.push(_),void 0===(_=p[g])){var T=new e.pointGeometry(c.getx(g),c.gety(g)),S=_e(T,h,d);if(S.signedDistanceFromCamera>0)_=p[g]=S.point;else{var C=g-v;_=Se(0===b?o:new e.pointGeometry(c.getx(C),c.gety(C)),T,x,k-b+1,h,d)}}b+=w,w=x.dist(_)}var I=(k-b)/w,z=_.sub(x),A=z.mult(I)._add(x);A._add(z._unit()._perp()._mult(i*v));var M=y+Math.atan2(_.y-x.y,_.x-x.x);return E.push(A),{point:A,angle:f?M:0,path:E}}var Ie=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ze(e,t){for(var r=0;r<e;r++){var i=t.length;t.resize(i+4),t.float32.set(Ie,3*i)}}function Ae(e,t,r){var i=t[0],n=t[1];return e[0]=r[0]*i+r[4]*n+r[12],e[1]=r[1]*i+r[5]*n+r[13],e[3]=r[3]*i+r[7]*n+r[15],e}var Me=100,Pe=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new ve(e.width+200,e.height+200,25),i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new ve(e.width+200,e.height+200,25);j(this,t),this.transform=e,this.grid=r,this.ignoredGrid=i,this.pitchfactor=Math.cos(e._pitch)*e.cameraToCenterDistance,this.screenRightBoundary=e.width+Me,this.screenBottomBoundary=e.height+Me,this.gridRightBoundary=e.width+200,this.gridBottomBoundary=e.height+200,this.perspectiveRatioCutoff=.6}return q(t,[{key:"placeCollisionBox",value:function(e,t,r,i,n,a){var o=this.projectAndGetPerspectiveRatio(i,e.anchorPointX,e.anchorPointY,a),s=r*o.perspectiveRatio,l=e.x1*s+o.point.x,u=e.y1*s+o.point.y,c=e.x2*s+o.point.x,h=e.y2*s+o.point.y;return!this.isInsideGrid(l,u,c,h)||"always"!==t&&this.grid.hitTest(l,u,c,h,t,n)||o.perspectiveRatio<this.perspectiveRatioCutoff?{box:[],offscreen:!1}:{box:[l,u,c,h],offscreen:this.isOffscreen(l,u,c,h)}}},{key:"placeCollisionCircles",value:function(t,r,i,n,a,o,s,l,u,c,h,p,f,d){var m=[],v=new e.pointGeometry(r.anchorX,r.anchorY),y=_e(v,o,d),g=xe(this.transform.cameraToCenterDistance,y.signedDistanceFromCamera),_=(c?a/g:a*g)/e.ONE_EM,x=_e(v,s,d).point,b=ke(_,n,r.lineOffsetX*_,r.lineOffsetY*_,!1,x,v,r,i,s,{},!1,d),w=!1,k=!1,E=!0;if(b){for(var T=.5*p*g+f,S=new e.pointGeometry(-100,-100),C=new e.pointGeometry(this.screenRightBoundary,this.screenBottomBoundary),I=new de,z=b.first,A=b.last,M=[],P=z.path.length-1;P>=1;P--)M.push(z.path[P]);for(var D=1;D<A.path.length;D++)M.push(A.path[D]);var L=2.5*T;if(l){var R=M.map((function(e){return _e(e,l,d)}));M=R.some((function(e){return e.signedDistanceFromCamera<=0}))?[]:R.map((function(e){return e.point}))}var B=[];if(M.length>0){for(var F=M[0].clone(),O=M[0].clone(),V=1;V<M.length;V++)F.x=Math.min(F.x,M[V].x),F.y=Math.min(F.y,M[V].y),O.x=Math.max(O.x,M[V].x),O.y=Math.max(O.y,M[V].y);B=F.x>=S.x&&O.x<=C.x&&F.y>=S.y&&O.y<=C.y?[M]:O.x<S.x||F.x>C.x||O.y<S.y||F.y>C.y?[]:e.clipLine([M],S.x,S.y,C.x,C.y)}var U,N=K(B);try{for(N.s();!(U=N.n()).done;){var j=U.value;I.reset(j,.25*T);var G=0;G=I.length<=.5*T?1:Math.ceil(I.paddedLength/L)+1;for(var q=0;q<G;q++){var Z=q/Math.max(G-1,1),X=I.lerp(Z),H=X.x+Me,W=X.y+Me;m.push(H,W,T,0);var J=H-T,Y=W-T,Q=H+T,$=W+T;if(E=E&&this.isOffscreen(J,Y,Q,$),k=k||this.isInsideGrid(J,Y,Q,$),"always"!==t&&this.grid.hitTestCircle(H,W,T,t,h)&&(w=!0,!u))return{circles:[],offscreen:!1,collisionDetected:w}}}}catch(ee){N.e(ee)}finally{N.f()}}return{circles:!u&&w||!k||g<this.perspectiveRatioCutoff?[]:m,offscreen:E,collisionDetected:w}}},{key:"queryRenderedSymbols",value:function(t){if(0===t.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};var r,i=[],n=1/0,a=1/0,o=-1/0,s=-1/0,l=K(t);try{for(l.s();!(r=l.n()).done;){var u=r.value,c=new e.pointGeometry(u.x+Me,u.y+Me);n=Math.min(n,c.x),a=Math.min(a,c.y),o=Math.max(o,c.x),s=Math.max(s,c.y),i.push(c)}}catch(g){l.e(g)}finally{l.f()}var h,p={},f={},d=K(this.grid.query(n,a,o,s).concat(this.ignoredGrid.query(n,a,o,s)));try{for(d.s();!(h=d.n()).done;){var m=h.value,v=m.key;if(void 0===p[v.bucketInstanceId]&&(p[v.bucketInstanceId]={}),!p[v.bucketInstanceId][v.featureIndex]){var y=[new e.pointGeometry(m.x1,m.y1),new e.pointGeometry(m.x2,m.y1),new e.pointGeometry(m.x2,m.y2),new e.pointGeometry(m.x1,m.y2)];e.polygonIntersectsPolygon(i,y)&&(p[v.bucketInstanceId][v.featureIndex]=!0,void 0===f[v.bucketInstanceId]&&(f[v.bucketInstanceId]=[]),f[v.bucketInstanceId].push(v.featureIndex))}}}catch(g){d.e(g)}finally{d.f()}return f}},{key:"insertCollisionBox",value:function(e,t,r,i,n,a){(r?this.ignoredGrid:this.grid).insert({bucketInstanceId:i,featureIndex:n,collisionGroupID:a,overlapMode:t},e[0],e[1],e[2],e[3])}},{key:"insertCollisionCircles",value:function(e,t,r,i,n,a){for(var o=r?this.ignoredGrid:this.grid,s={bucketInstanceId:i,featureIndex:n,collisionGroupID:a,overlapMode:t},l=0;l<e.length;l+=4)o.insertCircle(s,e[l],e[l+1],e[l+2])}},{key:"projectAndGetPerspectiveRatio",value:function(t,r,i,n){var a;return n?(a=[r,i,n(r,i),1],e.transformMat4(a,a,t)):Ae(a=[r,i,0,1],a,t),{point:new e.pointGeometry((a[0]/a[3]+1)/2*this.transform.width+Me,(-a[1]/a[3]+1)/2*this.transform.height+Me),perspectiveRatio:.5+this.transform.cameraToCenterDistance/a[3]*.5}}},{key:"isOffscreen",value:function(e,t,r,i){return r<Me||e>=this.screenRightBoundary||i<Me||t>this.screenBottomBoundary}},{key:"isInsideGrid",value:function(e,t,r,i){return r>=0&&e<this.gridRightBoundary&&i>=0&&t<this.gridBottomBoundary}},{key:"getViewportMatrix",value:function(){var t=e.identity([]);return e.translate(t,t,[-100,-100,0]),t}}]),t}();function De(t,r,i){return r*(e.EXTENT/(t.tileSize*Math.pow(2,i-t.tileID.overscaledZ)))}var Le=function(){function e(t,r,i,n){j(this,e),this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?r:-r))):n&&i?1:0,this.placed=i}return q(e,[{key:"isHidden",value:function(){return 0===this.opacity&&!this.placed}}]),e}(),Re=function(){function e(t,r,i,n,a){j(this,e),this.text=new Le(t?t.text:null,r,i,a),this.icon=new Le(t?t.icon:null,r,n,a)}return q(e,[{key:"isHidden",value:function(){return this.text.isHidden()&&this.icon.isHidden()}}]),e}(),Be=q((function e(t,r,i){j(this,e),this.text=t,this.icon=r,this.skipFade=i})),Fe=q((function t(){j(this,t),this.invProjMatrix=e.create(),this.viewportMatrix=e.create(),this.circles=[]})),Oe=q((function e(t,r,i,n,a){j(this,e),this.bucketInstanceId=t,this.featureIndex=r,this.sourceLayerIndex=i,this.bucketIndex=n,this.tileID=a})),Ve=function(){function e(t){j(this,e),this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}}return q(e,[{key:"get",value:function(e){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[e]){var t=++this.maxGroupID;this.collisionGroups[e]={ID:t,predicate:function(e){return e.collisionGroupID===t}}}return this.collisionGroups[e]}}]),e}();function Ue(t,r,i,n,a){var o=e.getAnchorAlignment(t),s=-(o.horizontalAlign-.5)*r,l=-(o.verticalAlign-.5)*i,u=e.evaluateVariableOffset(t,n);return new e.pointGeometry(s+u[0]*a,l+u[1]*a)}function Ne(t,r,i,n,a,o){var s=t.x1,l=t.x2,u=t.y1,c=t.y2,h=t.anchorPointX,p=t.anchorPointY,f=new e.pointGeometry(r,i);return n&&f._rotate(a?o:-o),{x1:s+f.x,y1:u+f.y,x2:l+f.x,y2:c+f.y,anchorPointX:h,anchorPointY:p}}var je=function(){function t(e,r,i,n,a){j(this,t),this.transform=e.clone(),this.terrain=r,this.collisionIndex=new Pe(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=i,this.retainedQueryData={},this.collisionGroups=new Ve(n),this.collisionCircleArrays={},this.prevPlacement=a,a&&(a.prevPlacement=void 0),this.placedOrientations={}}return q(t,[{key:"getBucketParts",value:function(t,r,i,n){var a=i.getBucket(r),o=i.latestFeatureIndex;if(a&&o&&r.id===a.layerIds[0]){var s=i.collisionBoxArray,l=a.layers[0].layout,u=Math.pow(2,this.transform.zoom-i.tileID.overscaledZ),c=i.tileSize/e.EXTENT,h=this.transform.calculatePosMatrix(i.tileID.toUnwrapped()),p="map"===l.get("text-pitch-alignment"),f="map"===l.get("text-rotation-alignment"),d=De(i,1,this.transform.zoom),m=ye(h,p,f,this.transform,d),v=null;if(p){var y=ge(h,p,f,this.transform,d);v=e.multiply([],this.transform.labelPlaneMatrix,y)}this.retainedQueryData[a.bucketInstanceId]=new Oe(a.bucketInstanceId,o,a.sourceLayerIndex,a.index,i.tileID);var g={bucket:a,layout:l,posMatrix:h,textLabelPlaneMatrix:m,labelToScreenMatrix:v,scale:u,textPixelRatio:c,holdingForFade:i.holdingForFade(),collisionBoxArray:s,partiallyEvaluatedTextSize:e.evaluateSizeForZoom(a.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(a.sourceID)};if(n){var _,x=K(a.sortKeyRanges);try{for(x.s();!(_=x.n()).done;){var b=_.value,w=b.sortKey,k=b.symbolInstanceStart,E=b.symbolInstanceEnd;t.push({sortKey:w,symbolInstanceStart:k,symbolInstanceEnd:E,parameters:g})}}catch(T){x.e(T)}finally{x.f()}}else t.push({symbolInstanceStart:0,symbolInstanceEnd:a.symbolInstances.length,parameters:g})}}},{key:"attemptAnchorPlacement",value:function(e,t,r,i,n,a,o,s,l,u,c,h,p,f,d,m){var v=[h.textOffset0,h.textOffset1],y=Ue(e,r,i,v,n),g=this.collisionIndex.placeCollisionBox(Ne(t,y.x,y.y,a,o,this.transform.angle),c,s,l,u.predicate,m);if((!d||0!==this.collisionIndex.placeCollisionBox(Ne(d,y.x,y.y,a,o,this.transform.angle),c,s,l,u.predicate,m).box.length)&&g.box.length>0){var _;if(this.prevPlacement&&this.prevPlacement.variableOffsets[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID].text&&(_=this.prevPlacement.variableOffsets[h.crossTileID].anchor),0===h.crossTileID)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[h.crossTileID]={textOffset:v,width:r,height:i,anchor:e,textBoxScale:n,prevAnchor:_},this.markUsedJustification(p,e,h,f),p.allowVerticalPlacement&&(this.markUsedOrientation(p,f,h),this.placedOrientations[h.crossTileID]=f),{shift:y,placedGlyphBoxes:g}}}},{key:"placeLayerBucketPart",value:function(t,r,i){var n=this,a=t.parameters,o=a.bucket,s=a.layout,l=a.posMatrix,u=a.textLabelPlaneMatrix,c=a.labelToScreenMatrix,h=a.textPixelRatio,p=a.holdingForFade,f=a.collisionBoxArray,d=a.partiallyEvaluatedTextSize,m=a.collisionGroup,v=s.get("text-optional"),y=s.get("icon-optional"),g=e.getOverlapMode(s,"text-overlap","text-allow-overlap"),_="always"===g,x=e.getOverlapMode(s,"icon-overlap","icon-allow-overlap"),b="always"===x,w="map"===s.get("text-rotation-alignment"),k="map"===s.get("text-pitch-alignment"),E="none"!==s.get("icon-text-fit"),T="viewport-y"===s.get("symbol-z-order"),S=_&&(b||!o.hasIconData()||y),C=b&&(_||!o.hasTextData()||v);!o.collisionArrays&&f&&o.deserializeCollisionBoxes(f);var I=function(t,a){if(!r[t.crossTileID])if(p)n.placements[t.crossTileID]=new Be(!1,!1,!1);else{var f=!1,b=!1,T=!0,I=null,z={box:null,offscreen:null},A={box:null,offscreen:null},M=null,P=null,D=null,L=0,R=0,B=0;a.textFeatureIndex?L=a.textFeatureIndex:t.useRuntimeCollisionCircles&&(L=t.featureIndex),a.verticalTextFeatureIndex&&(R=a.verticalTextFeatureIndex);for(var F=n.retainedQueryData[o.bucketInstanceId].tileID,O=n.terrain?function(e,t){return n.terrain.getElevation(F,e,t)}:null,V=0,U=["textBox","verticalTextBox","iconBox","verticalIconBox"];V<U.length;V++){var N=U[V],j=a[N];j&&(j.elevation=O?O(j.anchorPointX,j.anchorPointY):0)}var G=a.textBox;if(G){var q=function(r){var i=e.WritingMode.horizontal;if(o.allowVerticalPlacement&&!r&&n.prevPlacement){var a=n.prevPlacement.placedOrientations[t.crossTileID];a&&(n.placedOrientations[t.crossTileID]=a,i=a,n.markUsedOrientation(o,i,t))}return i},Z=function(r,i){if(o.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&a.verticalTextBox){var n,s=K(o.writingModes);try{for(s.s();!(n=s.n()).done&&(n.value===e.WritingMode.vertical?(z=i(),A=z):z=r(),!(z&&z.box&&z.box.length)););}catch(l){s.e(l)}finally{s.f()}}else z=r()};if(s.get("text-variable-anchor")){var X=s.get("text-variable-anchor");if(n.prevPlacement&&n.prevPlacement.variableOffsets[t.crossTileID]){var H=n.prevPlacement.variableOffsets[t.crossTileID];X.indexOf(H.anchor)>0&&(X=X.filter((function(e){return e!==H.anchor})),X.unshift(H.anchor))}var W=function(e,r,i){for(var a=e.x2-e.x1,s=e.y2-e.y1,u=t.textBoxScale,c=E&&"never"===x?r:null,p={box:[],offscreen:!1},d="never"!==g?2*X.length:X.length,v=0;v<d;++v){var y=n.attemptAnchorPlacement(X[v%X.length],e,a,s,u,w,k,h,l,m,v>=X.length?g:"never",t,o,i,c,O);if(y&&(p=y.placedGlyphBoxes)&&p.box&&p.box.length){f=!0,I=y.shift;break}}return p};Z((function(){return W(G,a.iconBox,e.WritingMode.horizontal)}),(function(){var r=a.verticalTextBox;return o.allowVerticalPlacement&&!(z&&z.box&&z.box.length)&&t.numVerticalGlyphVertices>0&&r?W(r,a.verticalIconBox,e.WritingMode.vertical):{box:null,offscreen:null}})),z&&(f=z.box,T=z.offscreen);var J=q(z&&z.box);if(!f&&n.prevPlacement){var Y=n.prevPlacement.variableOffsets[t.crossTileID];Y&&(n.variableOffsets[t.crossTileID]=Y,n.markUsedJustification(o,Y.anchor,t,J))}}else{var Q=function(e,r){var i=n.collisionIndex.placeCollisionBox(e,g,h,l,m.predicate,O);return i&&i.box&&i.box.length&&(n.markUsedOrientation(o,r,t),n.placedOrientations[t.crossTileID]=r),i};Z((function(){return Q(G,e.WritingMode.horizontal)}),(function(){var r=a.verticalTextBox;return o.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&r?Q(r,e.WritingMode.vertical):{box:null,offscreen:null}})),q(z&&z.box&&z.box.length)}}if(f=(M=z)&&M.box&&M.box.length>0,T=M&&M.offscreen,t.useRuntimeCollisionCircles){var $=o.text.placedSymbolArray.get(t.centerJustifiedTextSymbolIndex),ee=e.evaluateSizeForFeature(o.textSizeData,d,$),te=s.get("text-padding");(P=n.collisionIndex.placeCollisionCircles(g,$,o.lineVertexArray,o.glyphOffsetArray,ee,l,u,c,i,k,m.predicate,t.collisionCircleDiameter,te,O)).circles.length&&P.collisionDetected&&!i&&e.warnOnce("Collisions detected, but collision boxes are not shown"),f=_||P.circles.length>0&&!P.collisionDetected,T=T&&P.offscreen}if(a.iconFeatureIndex&&(B=a.iconFeatureIndex),a.iconBox){var re=function(e){var t=E&&I?Ne(e,I.x,I.y,w,k,n.transform.angle):e;return n.collisionIndex.placeCollisionBox(t,x,h,l,m.predicate,O)};b=A&&A.box&&A.box.length&&a.verticalIconBox?(D=re(a.verticalIconBox)).box.length>0:(D=re(a.iconBox)).box.length>0,T=T&&D.offscreen}var ie=v||0===t.numHorizontalGlyphVertices&&0===t.numVerticalGlyphVertices,ne=y||0===t.numIconVertices;if(ie||ne?ne?ie||(b=b&&f):f=b&&f:b=f=b&&f,f&&M&&M.box&&n.collisionIndex.insertCollisionBox(M.box,g,s.get("text-ignore-placement"),o.bucketInstanceId,A&&A.box&&R?R:L,m.ID),b&&D&&n.collisionIndex.insertCollisionBox(D.box,x,s.get("icon-ignore-placement"),o.bucketInstanceId,B,m.ID),P&&(f&&n.collisionIndex.insertCollisionCircles(P.circles,g,s.get("text-ignore-placement"),o.bucketInstanceId,L,m.ID),i)){var ae=o.bucketInstanceId,oe=n.collisionCircleArrays[ae];void 0===oe&&(oe=n.collisionCircleArrays[ae]=new Fe);for(var se=0;se<P.circles.length;se+=4)oe.circles.push(P.circles[se+0]),oe.circles.push(P.circles[se+1]),oe.circles.push(P.circles[se+2]),oe.circles.push(P.collisionDetected?1:0)}if(0===t.crossTileID)throw new Error("symbolInstance.crossTileID can't be 0");if(0===o.bucketInstanceId)throw new Error("bucket.bucketInstanceId can't be 0");n.placements[t.crossTileID]=new Be(f||S,b||C,T||o.justReloaded),r[t.crossTileID]=!0}};if(T){if(0!==t.symbolInstanceStart)throw new Error("bucket.bucketInstanceId should be 0");for(var z=o.getSortedSymbolIndexes(this.transform.angle),A=z.length-1;A>=0;--A){var M=z[A];I(o.symbolInstances.get(M),o.collisionArrays[M])}}else for(var P=t.symbolInstanceStart;P<t.symbolInstanceEnd;P++)I(o.symbolInstances.get(P),o.collisionArrays[P]);if(i&&o.bucketInstanceId in this.collisionCircleArrays){var D=this.collisionCircleArrays[o.bucketInstanceId];e.invert(D.invProjMatrix,l),D.viewportMatrix=this.collisionIndex.getViewportMatrix()}o.justReloaded=!1}},{key:"markUsedJustification",value:function(t,r,i,n){var a;a=n===e.WritingMode.vertical?i.verticalPlacedTextSymbolIndex:{left:i.leftJustifiedTextSymbolIndex,center:i.centerJustifiedTextSymbolIndex,right:i.rightJustifiedTextSymbolIndex}[e.getAnchorJustification(r)];for(var o=0,s=[i.leftJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.rightJustifiedTextSymbolIndex,i.verticalPlacedTextSymbolIndex];o<s.length;o++){var l=s[o];l>=0&&(t.text.placedSymbolArray.get(l).crossTileID=a>=0&&l!==a?0:i.crossTileID)}}},{key:"markUsedOrientation",value:function(t,r,i){for(var n=r===e.WritingMode.horizontal||r===e.WritingMode.horizontalOnly?r:0,a=r===e.WritingMode.vertical?r:0,o=0,s=[i.leftJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.rightJustifiedTextSymbolIndex];o<s.length;o++){var l=s[o];t.text.placedSymbolArray.get(l).placedOrientation=n}i.verticalPlacedTextSymbolIndex&&(t.text.placedSymbolArray.get(i.verticalPlacedTextSymbolIndex).placedOrientation=a)}},{key:"commit",value:function(e){this.commitTime=e,this.zoomAtLastRecencyCheck=this.transform.zoom;var t=this.prevPlacement,r=!1;this.prevZoomAdjustment=t?t.zoomAdjustment(this.transform.zoom):0;var i=t?t.symbolFadeChange(e):1,n=t?t.opacities:{},a=t?t.variableOffsets:{},o=t?t.placedOrientations:{};for(var s in this.placements){var l=this.placements[s],u=n[s];u?(this.opacities[s]=new Re(u,i,l.text,l.icon),r=r||l.text!==u.text.placed||l.icon!==u.icon.placed):(this.opacities[s]=new Re(null,i,l.text,l.icon,l.skipFade),r=r||l.text||l.icon)}for(var c in n){var h=n[c];if(!this.opacities[c]){var p=new Re(h,i,!1,!1);p.isHidden()||(this.opacities[c]=p,r=r||h.text.placed||h.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]);if(t&&void 0===t.lastPlacementChangeTime)throw new Error("Last placement time for previous placement is not defined");r?this.lastPlacementChangeTime=e:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=t?t.lastPlacementChangeTime:e)}},{key:"updateLayerOpacities",value:function(e,t){var r,i={},n=K(t);try{for(n.s();!(r=n.n()).done;){var a=r.value,o=a.getBucket(e);o&&a.latestFeatureIndex&&e.id===o.layerIds[0]&&this.updateBucketOpacities(o,i,a.collisionBoxArray)}}catch(s){n.e(s)}finally{n.f()}}},{key:"updateBucketOpacities",value:function(t,r,i){var n=this;t.hasTextData()&&t.text.opacityVertexArray.clear(),t.hasIconData()&&t.icon.opacityVertexArray.clear(),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexArray.clear(),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexArray.clear();var a=t.layers[0].layout,o=new Re(null,0,!1,!1,!0),s=a.get("text-allow-overlap"),l=a.get("icon-allow-overlap"),u=a.get("text-variable-anchor"),c="map"===a.get("text-rotation-alignment"),h="map"===a.get("text-pitch-alignment"),p="none"!==a.get("icon-text-fit"),f=new Re(null,0,s&&(l||!t.hasIconData()||a.get("icon-optional")),l&&(s||!t.hasTextData()||a.get("text-optional")),!0);!t.collisionArrays&&i&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(i);for(var d=function(e,t,r){for(var i=0;i<t/4;i++)e.opacityVertexArray.emplaceBack(r)},m=function(i){var a=t.symbolInstances.get(i),s=a.numHorizontalGlyphVertices,l=a.numVerticalGlyphVertices,m=a.crossTileID,v=n.opacities[m];r[m]?v=o:v||(v=f,n.opacities[m]=v),r[m]=!0;var y=a.numIconVertices>0,g=n.placedOrientations[a.crossTileID],_=g===e.WritingMode.vertical,x=g===e.WritingMode.horizontal||g===e.WritingMode.horizontalOnly;if(s>0||l>0){var b=Ye(v.text);d(t.text,s,_?Qe:b),d(t.text,l,x?Qe:b);var w=v.text.isHidden();[a.rightJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.leftJustifiedTextSymbolIndex].forEach((function(e){e>=0&&(t.text.placedSymbolArray.get(e).hidden=w||_?1:0)})),a.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(a.verticalPlacedTextSymbolIndex).hidden=w||x?1:0);var k=n.variableOffsets[a.crossTileID];k&&n.markUsedJustification(t,k.anchor,a,g);var E=n.placedOrientations[a.crossTileID];E&&(n.markUsedJustification(t,"left",a,E),n.markUsedOrientation(t,E,a))}if(y){var T=Ye(v.icon),S=!(p&&a.verticalPlacedIconSymbolIndex&&_);a.placedIconSymbolIndex>=0&&(d(t.icon,a.numIconVertices,S?T:Qe),t.icon.placedSymbolArray.get(a.placedIconSymbolIndex).hidden=v.icon.isHidden()),a.verticalPlacedIconSymbolIndex>=0&&(d(t.icon,a.numVerticalIconVertices,S?Qe:T),t.icon.placedSymbolArray.get(a.verticalPlacedIconSymbolIndex).hidden=v.icon.isHidden())}if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){var C=t.collisionArrays[i];if(C){var I=new e.pointGeometry(0,0);if(C.textBox||C.verticalTextBox){var z=!0;if(u){var A=n.variableOffsets[m];A?(I=Ue(A.anchor,A.width,A.height,A.textOffset,A.textBoxScale),c&&I._rotate(h?n.transform.angle:-n.transform.angle)):z=!1}C.textBox&&Ge(t.textCollisionBox.collisionVertexArray,v.text.placed,!z||_,I.x,I.y),C.verticalTextBox&&Ge(t.textCollisionBox.collisionVertexArray,v.text.placed,!z||x,I.x,I.y)}var M=Boolean(!x&&C.verticalIconBox);C.iconBox&&Ge(t.iconCollisionBox.collisionVertexArray,v.icon.placed,M,p?I.x:0,p?I.y:0),C.verticalIconBox&&Ge(t.iconCollisionBox.collisionVertexArray,v.icon.placed,!M,p?I.x:0,p?I.y:0)}}},v=0;v<t.symbolInstances.length;v++)m(v);if(t.sortFeatures(this.transform.angle),this.retainedQueryData[t.bucketInstanceId]&&(this.retainedQueryData[t.bucketInstanceId].featureSortOrder=t.featureSortOrder),t.hasTextData()&&t.text.opacityVertexBuffer&&t.text.opacityVertexBuffer.updateData(t.text.opacityVertexArray),t.hasIconData()&&t.icon.opacityVertexBuffer&&t.icon.opacityVertexBuffer.updateData(t.icon.opacityVertexArray),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexBuffer&&t.iconCollisionBox.collisionVertexBuffer.updateData(t.iconCollisionBox.collisionVertexArray),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexBuffer&&t.textCollisionBox.collisionVertexBuffer.updateData(t.textCollisionBox.collisionVertexArray),t.text.opacityVertexArray.length!==t.text.layoutVertexArray.length/4)throw new Error("bucket.text.opacityVertexArray.length (= ".concat(t.text.opacityVertexArray.length,") !== bucket.text.layoutVertexArray.length (= ").concat(t.text.layoutVertexArray.length,") / 4"));if(t.icon.opacityVertexArray.length!==t.icon.layoutVertexArray.length/4)throw new Error("bucket.icon.opacityVertexArray.length (= ".concat(t.icon.opacityVertexArray.length,") !== bucket.icon.layoutVertexArray.length (= ").concat(t.icon.layoutVertexArray.length,") / 4"));if(t.bucketInstanceId in this.collisionCircleArrays){var y=this.collisionCircleArrays[t.bucketInstanceId];t.placementInvProjMatrix=y.invProjMatrix,t.placementViewportMatrix=y.viewportMatrix,t.collisionCircleArray=y.circles,delete this.collisionCircleArrays[t.bucketInstanceId]}}},{key:"symbolFadeChange",value:function(e){return 0===this.fadeDuration?1:(e-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}},{key:"zoomAdjustment",value:function(e){return Math.max(0,(this.transform.zoom-e)/1.5)}},{key:"hasTransitions",value:function(e){return this.stale||e-this.lastPlacementChangeTime<this.fadeDuration}},{key:"stillRecent",value:function(e,t){var r=this.zoomAtLastRecencyCheck===t?1-this.zoomAdjustment(t):1;return this.zoomAtLastRecencyCheck=t,this.commitTime+this.fadeDuration*r>e}},{key:"setStale",value:function(){this.stale=!0}}]),t}();function Ge(e,t,r,i,n){e.emplaceBack(t?1:0,r?1:0,i||0,n||0),e.emplaceBack(t?1:0,r?1:0,i||0,n||0),e.emplaceBack(t?1:0,r?1:0,i||0,n||0),e.emplaceBack(t?1:0,r?1:0,i||0,n||0)}var qe=Math.pow(2,25),Ze=Math.pow(2,24),Xe=Math.pow(2,17),He=Math.pow(2,16),We=Math.pow(2,9),Ke=Math.pow(2,8),Je=Math.pow(2,1);function Ye(e){if(0===e.opacity&&!e.placed)return 0;if(1===e.opacity&&e.placed)return 4294967295;var t=e.placed?1:0,r=Math.floor(127*e.opacity);return r*qe+t*Ze+r*Xe+t*He+r*We+t*Ke+r*Je+t}var Qe=0,$e=function(){function e(t){j(this,e),this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&!t.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}return q(e,[{key:"continuePlacement",value:function(e,t,r,i,n){for(var a=this._bucketParts;this._currentTileIndex<e.length;)if(t.getBucketParts(a,i,e[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,n())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,a.sort((function(e,t){return e.sortKey-t.sortKey})));this._currentPartIndex<a.length;)if(t.placeLayerBucketPart(a[this._currentPartIndex],this._seenCrossTileIDs,r),this._currentPartIndex++,n())return!0;return!1}}]),e}(),et=function(){function t(e,r,i,n,a,o,s,l){j(this,t),this.placement=new je(e,r,o,s,l),this._currentPlacementIndex=i.length-1,this._forceFullPlacement=n,this._showCollisionBoxes=a,this._done=!1}return q(t,[{key:"isDone",value:function(){return this._done}},{key:"continuePlacement",value:function(t,r,i){for(var n=this,a=e.exported.now(),o=function(){var t=e.exported.now()-a;return!n._forceFullPlacement&&t>2};this._currentPlacementIndex>=0;){var s=r[t[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 $e(s)),this._inProgressLayer.continuePlacement(i[s.source],this.placement,this._showCollisionBoxes,s,o))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}},{key:"commit",value:function(e){return this.placement.commit(e),this.placement}}]),t}(),tt=512/e.EXTENT/2,rt=function(){function t(e,r,i){j(this,t),this.tileID=e,this.indexedSymbolInstances={},this.bucketInstanceId=i;for(var n=0;n<r.length;n++){var a=r.get(n),o=a.key;this.indexedSymbolInstances[o]||(this.indexedSymbolInstances[o]=[]),this.indexedSymbolInstances[o].push({crossTileID:a.crossTileID,coord:this.getScaledCoordinates(a,e)})}}return q(t,[{key:"getScaledCoordinates",value:function(t,r){var i=tt/Math.pow(2,r.canonical.z-this.tileID.canonical.z);return{x:Math.floor((r.canonical.x*e.EXTENT+t.anchorX)*i),y:Math.floor((r.canonical.y*e.EXTENT+t.anchorY)*i)}}},{key:"findMatches",value:function(e,t,r){for(var i=this.tileID.canonical.z<t.canonical.z?1:Math.pow(2,this.tileID.canonical.z-t.canonical.z),n=0;n<e.length;n++){var a=e.get(n);if(!a.crossTileID){var o=this.indexedSymbolInstances[a.key];if(o){var s,l=this.getScaledCoordinates(a,t),u=K(o);try{for(u.s();!(s=u.n()).done;){var c=s.value;if(Math.abs(c.coord.x-l.x)<=i&&Math.abs(c.coord.y-l.y)<=i&&!r[c.crossTileID]){r[c.crossTileID]=!0,a.crossTileID=c.crossTileID;break}}}catch(h){u.e(h)}finally{u.f()}}}}}}]),t}(),it=function(){function e(){j(this,e),this.maxCrossTileID=0}return q(e,[{key:"generate",value:function(){return++this.maxCrossTileID}}]),e}(),nt=function(){function e(){j(this,e),this.indexes={},this.usedCrossTileIDs={},this.lng=0}return q(e,[{key:"handleWrapJump",value:function(e){var t=Math.round((e-this.lng)/360);if(0!==t)for(var r in this.indexes){var i=this.indexes[r],n={};for(var a in i){var o=i[a];o.tileID=o.tileID.unwrapTo(o.tileID.wrap+t),n[o.tileID.key]=o}this.indexes[r]=n}this.lng=e}},{key:"addBucket",value:function(e,t,r){if(this.indexes[e.overscaledZ]&&this.indexes[e.overscaledZ][e.key]){if(this.indexes[e.overscaledZ][e.key].bucketInstanceId===t.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(e.overscaledZ,this.indexes[e.overscaledZ][e.key])}for(var i=0;i<t.symbolInstances.length;i++)t.symbolInstances.get(i).crossTileID=0;this.usedCrossTileIDs[e.overscaledZ]||(this.usedCrossTileIDs[e.overscaledZ]={});var n=this.usedCrossTileIDs[e.overscaledZ];for(var a in this.indexes){var o=this.indexes[a];if(Number(a)>e.overscaledZ)for(var s in o){var l=o[s];l.tileID.isChildOf(e)&&l.findMatches(t.symbolInstances,e,n)}else{var u=o[e.scaledTo(Number(a)).key];u&&u.findMatches(t.symbolInstances,e,n)}}for(var c=0;c<t.symbolInstances.length;c++){var h=t.symbolInstances.get(c);h.crossTileID||(h.crossTileID=r.generate(),n[h.crossTileID]=!0)}return void 0===this.indexes[e.overscaledZ]&&(this.indexes[e.overscaledZ]={}),this.indexes[e.overscaledZ][e.key]=new rt(e,t.symbolInstances,t.bucketInstanceId),!0}},{key:"removeBucketCrossTileIDs",value:function(e,t){for(var r in t.indexedSymbolInstances){var i,n=K(t.indexedSymbolInstances[r]);try{for(n.s();!(i=n.n()).done;){var a=i.value;delete this.usedCrossTileIDs[e][a.crossTileID]}}catch(o){n.e(o)}finally{n.f()}}}},{key:"removeStaleBuckets",value:function(e){var t=!1;for(var r in this.indexes){var i=this.indexes[r];for(var n in i)e[i[n].bucketInstanceId]||(this.removeBucketCrossTileIDs(r,i[n]),delete i[n],t=!0)}return t}}]),e}(),at=function(){function e(){j(this,e),this.layerIndexes={},this.crossTileIDs=new it,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}return q(e,[{key:"addLayer",value:function(e,t,r){var i=this.layerIndexes[e.id];void 0===i&&(i=this.layerIndexes[e.id]=new nt);var n=!1,a={};i.handleWrapJump(r);var o,s=K(t);try{for(s.s();!(o=s.n()).done;){var l=o.value,u=l.getBucket(e);u&&e.id===u.layerIds[0]&&(u.bucketInstanceId||(u.bucketInstanceId=++this.maxBucketInstanceId),i.addBucket(l.tileID,u,this.crossTileIDs)&&(n=!0),a[u.bucketInstanceId]=!0)}}catch(c){s.e(c)}finally{s.f()}return i.removeStaleBuckets(a)&&(n=!0),n}},{key:"pruneUnusedLayers",value:function(e){var t={};for(var r in e.forEach((function(e){t[e]=!0})),this.layerIndexes)t[r]||delete this.layerIndexes[r]}}]),e}(),ot=e.createLayout([{name:"a_pos",type:"Int16",components:2}]),st=function(t){A(i,t);var r=M(i);function i(e){var t;return j(this,i),(t=r.call(this)).sourceCache=e,t._tiles={},t._renderableTilesKeys=[],t._sourceTileCache={},t.renderHistory=[],t.minzoom=0,t.maxzoom=22,t.tileSize=512,t.deltaZoom=1,t.renderHistorySize=e._cache.max,e.usedForTerrain=!0,e.tileSize=t.tileSize*Math.pow(2,t.deltaZoom),t}return q(i,[{key:"destruct",value:function(){for(var e in this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null,this._tiles){var t=this._tiles[e];t.textures.forEach((function(e){return e.destroy()})),t.textures=[]}}},{key:"update",value:function(t,r){this.sourceCache.update(t,r),this._renderableTilesKeys=[];var i,n=K(t.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:r}));try{for(n.s();!(i=n.n()).done;){var a=i.value;this._renderableTilesKeys.push(a.key),this._tiles[a.key]||(a.posMatrix=new Float64Array(16),e.ortho(a.posMatrix,0,e.EXTENT,0,e.EXTENT,0,1),this._tiles[a.key]=new G(a,this.tileSize))}}catch(o){n.e(o)}finally{n.f()}}},{key:"removeOutdated",value:function(e){var t=this,r={};this.renderHistory=this.renderHistory.filter((function(e,r){return t.renderHistory.indexOf(e)===r})).slice(0,this.renderHistorySize);var i,n=K(this._renderableTilesKeys);try{for(n.s();!(i=n.n()).done;)r[i.value]=!0}catch(l){n.e(l)}finally{n.f()}var a,o=K(this.renderHistory);try{for(o.s();!(a=o.n()).done;)r[a.value]=!0}catch(l){o.e(l)}finally{o.f()}for(var s in this._tiles)r[s]||(this._tiles[s].clearTextures(e),delete this._tiles[s])}},{key:"getRenderableTiles",value:function(){var e=this;return this._renderableTilesKeys.map((function(t){return e.getTileByID(t)}))}},{key:"getTileByID",value:function(e){return this._tiles[e]}},{key:"getTerrainCoords",value:function(t){var r,i={},n=K(this._renderableTilesKeys);try{for(n.s();!(r=n.n()).done;){var a=r.value,o=this._tiles[a].tileID;if(o.canonical.equals(t.canonical)){var s=t.clone();s.posMatrix=new Float64Array(16),e.ortho(s.posMatrix,0,e.EXTENT,0,e.EXTENT,0,1),i[a]=s}else if(o.canonical.isChildOf(t.canonical)){var l=t.clone();l.posMatrix=new Float64Array(16);var u=o.canonical.z-t.canonical.z,c=o.canonical.x-(o.canonical.x>>u<<u),h=o.canonical.y-(o.canonical.y>>u<<u),p=e.EXTENT>>u;e.ortho(l.posMatrix,0,p,0,p,0,1),e.translate(l.posMatrix,l.posMatrix,[-c*p,-h*p,0]),i[a]=l}else if(t.canonical.isChildOf(o.canonical)){var f=t.clone();f.posMatrix=new Float64Array(16);var d=t.canonical.z-o.canonical.z,m=t.canonical.x-(t.canonical.x>>d<<d),v=t.canonical.y-(t.canonical.y>>d<<d),y=e.EXTENT>>d;e.ortho(f.posMatrix,0,e.EXTENT,0,e.EXTENT,0,1),e.translate(f.posMatrix,f.posMatrix,[m*y,v*y,0]),e.scale(f.posMatrix,f.posMatrix,[1/Math.pow(2,d),1/Math.pow(2,d),0]),i[a]=f}}}catch(g){n.e(g)}finally{n.f()}return i}},{key:"getSourceTile",value:function(e,t){var r=this.sourceCache._source,i=e.overscaledZ-this.deltaZoom;if(i>r.maxzoom&&(i=r.maxzoom),i<r.minzoom)return null;this._sourceTileCache[e.key]||(this._sourceTileCache[e.key]=e.scaledTo(i).key);var n=this.sourceCache.getTileByID(this._sourceTileCache[e.key]);if((!n||!n.dem)&&t)for(;i>=r.minzoom&&(!n||!n.dem);)n=this.sourceCache.getTileByID(e.scaledTo(i--).key);return n}},{key:"tilesAfterTime",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now();return Object.values(this._tiles).filter((function(t){return t.timeLoaded>=e}))}}]),i}(e.Evented),lt=function(){function t(e,r,i){j(this,t),this.style=e,this.sourceCache=new st(r),this.options=i,this.exaggeration="number"==typeof i.exaggeration?i.exaggeration:1,this.elevationOffset="number"==typeof i.elevationOffset?i.elevationOffset:450,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024,this.clearRerenderCache()}return q(t,[{key:"getDEMElevation",value:function(t,r,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.EXTENT;if(!(r>=0&&r<n&&i>=0&&i<n))return this.elevationOffset;var a=0,o=this.getTerrainData(t);if(o.tile&&o.tile.dem){var s=e.transformMat4$1([],[r/n*e.EXTENT,i/n*e.EXTENT],o.u_terrain_matrix),l=[s[0]*o.tile.dem.dim,s[1]*o.tile.dem.dim],u=[Math.floor(l[0]),Math.floor(l[1])],c=o.tile.dem.get(u[0],u[1]),h=o.tile.dem.get(u[0],u[1]+1),p=o.tile.dem.get(u[0]+1,u[1]),f=o.tile.dem.get(u[0]+1,u[1]+1);a=e.number(e.number(c,h,l[0]-u[0]),e.number(p,f,l[0]-u[0]),l[1]-u[1])}return a}},{key:"rememberForRerender",value:function(e,t){for(var r in this.sourceCache._tiles){var i=this.sourceCache._tiles[r];(i.tileID.equals(t)||i.tileID.isChildOf(t))&&(e===this.sourceCache.sourceCache.id&&(i.timeLoaded=Date.now()),this._rerender[e]=this._rerender[e]||{},this._rerender[e][i.tileID.key]=!0)}}},{key:"needsRerender",value:function(e,t){return this._rerender[e]&&this._rerender[e][t.key]}},{key:"clearRerenderCache",value:function(){this._rerender={}}},{key:"getElevation",value:function(t,r,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.EXTENT;return(this.getDEMElevation(t,r,i,n)+this.elevationOffset)*this.exaggeration}},{key:"getTerrainData",value:function(t){if(!this._emptyDemTexture){var r=this.style.map.painter.context,i=new e.RGBAImage({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new l(r,i,r.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new l(r,new e.RGBAImage({width:1,height:1}),r.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(r.gl.NEAREST,r.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=e.identity([])}var n=this.sourceCache.getSourceTile(t,!0);if(n&&n.dem&&(!n.demTexture||n.needsTerrainPrepare)){var a=this.style.map.painter.context;n.demTexture=this.style.map.painter.getTileTexture(n.dem.stride),n.demTexture?n.demTexture.update(n.dem.getPixels(),{premultiply:!1}):n.demTexture=new l(a,n.dem.getPixels(),a.gl.RGBA,{premultiply:!1}),n.demTexture.bind(a.gl.NEAREST,a.gl.CLAMP_TO_EDGE),n.needsTerrainPrepare=!1}var o=n&&n+n.tileID.key+t.key;if(o&&!this._demMatrixCache[o]){var s=this.sourceCache.sourceCache._source.maxzoom,u=t.canonical.z-n.tileID.canonical.z;t.overscaledZ>t.canonical.z&&(t.canonical.z>=s?u=t.canonical.z-s:e.warnOnce("cannot calculate elevation if elevation maxzoom > source.maxzoom"));var c=t.canonical.x-(t.canonical.x>>u<<u),h=t.canonical.y-(t.canonical.y>>u<<u),p=e.fromScaling(new Float64Array(16),[1/(e.EXTENT<<u),1/(e.EXTENT<<u),0]);e.translate(p,p,[c*e.EXTENT,h*e.EXTENT,0]),this._demMatrixCache[t.key]={matrix:p,coord:t}}return{u_depth:2,u_terrain:3,u_terrain_dim:n&&n.dem&&n.dem.dim||1,u_terrain_matrix:o?this._demMatrixCache[t.key].matrix:this._emptyDemMatrix,u_terrain_unpack:n&&n.dem&&n.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_offset:this.elevationOffset,u_terrain_exaggeration:this.exaggeration,texture:(n&&n.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:n}}},{key:"getRTTFramebuffer",value:function(){var e=this.style.map.painter;if(!this._rttFramebuffer){var t=this.sourceCache.tileSize*this.qualityFactor;this._rttFramebuffer=e.context.createFramebuffer(t,t,!0),this._rttFramebuffer.depthAttachment.set(e.context.createRenderbuffer(e.context.gl.DEPTH_COMPONENT16,t,t))}return this._rttFramebuffer}},{key:"getFramebuffer",value:function(e){var t=this.style.map.painter,r=t.width/devicePixelRatio,i=t.height/devicePixelRatio;return!this._fbo||this._fbo.width===r&&this._fbo.height===i||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new l(t.context,{width:r,height:i,data:null},t.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(t.context.gl.NEAREST,t.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new l(t.context,{width:r,height:i,data:null},t.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(t.context.gl.NEAREST,t.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=t.context.createFramebuffer(r,i,!0),this._fbo.depthAttachment.set(t.context.createRenderbuffer(t.context.gl.DEPTH_COMPONENT16,r,i))),this._fbo.colorAttachment.set("coords"===e?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}},{key:"getCoordsTexture",value:function(){var t=this.style.map.painter.context;if(this._coordsTexture)return this._coordsTexture;for(var r=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4),i=0,n=0;i<this._coordsTextureSize;i++)for(var a=0;a<this._coordsTextureSize;a++,n+=4)r[n+0]=255&a,r[n+1]=255&i,r[n+2]=a>>8<<4|i>>8,r[n+3]=0;var o=new e.RGBAImage({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(r.buffer)),s=new l(t,o,t.gl.RGBA,{premultiply:!1});return s.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._coordsTexture=s,s}},{key:"pointCoordinate",value:function(t){var r=new Uint8Array(4),i=this.style.map.painter,n=i.context,a=n.gl;n.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),a.readPixels(t.x,i.height/devicePixelRatio-t.y-1,1,1,a.RGBA,a.UNSIGNED_BYTE,r),n.bindFramebuffer.set(null);var o=r[0]+(r[2]>>4<<8),s=r[1]+((15&r[2])<<8),l=this.coordsIndex[255-r[3]],u=l&&this.sourceCache.getTileByID(l);if(!u)return null;var c=this._coordsTextureSize,h=(1<<u.tileID.canonical.z)*c;return new e.MercatorCoordinate((u.tileID.canonical.x*c+o)/h,(u.tileID.canonical.y*c+s)/h,this.getElevation(u.tileID,o,s,c))}},{key:"getTerrainMesh",value:function(){if(this._mesh)return this._mesh;for(var t=this.style.map.painter.context,r=new e.PosArray,i=new e.TriangleIndexArray,n=this.meshSize,a=e.EXTENT/n,o=n*n,s=0;s<=n;s++)for(var l=0;l<=n;l++)r.emplaceBack(l*a,s*a);for(var u=0;u<o;u+=n+1)for(var c=0;c<n;c++)i.emplaceBack(c+u,n+c+u+1,n+c+u+2),i.emplaceBack(c+u,n+c+u+2,c+u+1);return this._mesh={indexBuffer:t.createIndexBuffer(i),vertexBuffer:t.createVertexBuffer(r,ot.members),segments:e.SegmentVector.simpleSegment(0,0,r.length,i.length)},this._mesh}},{key:"getMinMaxElevation",value:function(e){var t=this.getTerrainData(e).tile,r={minElevation:null,maxElevation:null};return t&&t.dem&&(r.minElevation=(t.dem.min+this.elevationOffset)*this.exaggeration,r.maxElevation=(t.dem.max+this.elevationOffset)*this.exaggeration),r}}]),t}(),ut=function(t,r){return e.emitValidationErrors(t,r&&r.filter((function(e){return"source.canvas"!==e.identifier})))},ct=e.pick(oe,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),ht=e.pick(oe,["setCenter","setZoom","setBearing","setPitch"]),pt=function(){var t={},r=e.spec.$version;for(var i in e.spec.$root){var n=e.spec.$root[i];if(n.required){var a=null;null!=(a="version"===i?r:"array"===n.type?[]:{})&&(t[i]=a)}}return t}(),ft=function(t){A(i,t);var r=M(i);function i(t){var n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};j(this,i),(n=r.call(this)).map=t,n.dispatcher=new _(ie(),D(n)),n.imageManager=new c,n.imageManager.setEventedParent(D(n)),n.glyphManager=new d(t._requestManager,a.localIdeographFontFamily),n.lineAtlas=new g(256,512),n.crossTileSymbolIndex=new at,n._layers={},n._serializedLayers={},n._order=[],n.sourceCaches={},n.zoomHistory=new e.ZoomHistory,n._loaded=!1,n._availableImages=[],n._resetUpdates(),n.dispatcher.broadcast("setReferrer",e.getReferrer());var o=D(n);return n._rtlTextPluginCallback=i.registerForPluginStateChange((function(t){o.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:t.pluginStatus,pluginURL:t.pluginURL},(function(t,r){if(e.triggerPluginCompletionEvent(t),r&&r.every((function(e){return e})))for(var i in o.sourceCaches)o.sourceCaches[i].reload()}))})),n.on("data",(function(e){if("source"===e.dataType&&"metadata"===e.sourceDataType){var t=n.sourceCaches[e.sourceId];if(t){var r=t.getSource();if(r&&r.vectorLayerIds)for(var i in n._layers){var a=n._layers[i];a.source===r.id&&n._validateLayer(a)}}}})),n}return q(i,[{key:"loadURL",value:function(t){var r=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.fire(new e.Event("dataloading",{dataType:"style"}));var n="boolean"!=typeof i.validate||i.validate,a=this.map._requestManager.transformRequest(t,e.ResourceType.Style);this._request=e.getJSON(a,(function(t,i){r._request=null,t?r.fire(new e.ErrorEvent(t)):i&&r._load(i,n)}))}},{key:"loadJSON",value:function(t){var r=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.fire(new e.Event("dataloading",{dataType:"style"})),this._request=e.exported.frame((function(){r._request=null,r._load(t,!1!==i.validate)}))}},{key:"loadEmpty",value:function(){this.fire(new e.Event("dataloading",{dataType:"style"})),this._load(pt,!1)}},{key:"_load",value:function(t,r){if(!r||!ut(this,e.validateStyle(t))){for(var i in this._loaded=!0,this.stylesheet=t,t.sources)this.addSource(i,t.sources[i],{validate:!1});t.sprite?this._loadSprite(t.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(t.glyphs);var n=ae(this.stylesheet.layers);this._order=n.map((function(e){return e.id})),this._layers={},this._serializedLayers={};var a,o=K(n);try{for(o.s();!(a=o.n()).done;){var s=a.value;(s=e.createStyleLayer(s)).setEventedParent(this,{layer:{id:s.id}}),this._layers[s.id]=s,this._serializedLayers[s.id]=s.serialize()}}catch(l){o.e(l)}finally{o.f()}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new y(this.stylesheet.light),this.setTerrain(this.stylesheet.terrain),this.fire(new e.Event("data",{dataType:"style"})),this.fire(new e.Event("style.load"))}}},{key:"_loadSprite",value:function(t){var r=this;this._spriteRequest=function(t,r,i,n){var a,o,s,l=i>1?"@2x":"",u=e.getJSON(r.transformRequest(r.normalizeSpriteURL(t,l,".json"),e.ResourceType.SpriteJSON),(function(e,t){u=null,s||(s=e,a=t,h())})),c=e.getImage(r.transformRequest(r.normalizeSpriteURL(t,l,".png"),e.ResourceType.SpriteImage),(function(e,t){c=null,s||(s=e,o=t,h())}));function h(){if(s)n(s);else if(a&&o){var t=e.exported.getImageData(o),r={};for(var i in a){var l=a[i],u=l.width,c=l.height,h=l.x,p=l.y,f=l.sdf,d=l.pixelRatio,m=l.stretchX,v=l.stretchY,y=l.content,g=new e.RGBAImage({width:u,height:c});e.RGBAImage.copy(t,g,{x:h,y:p},{x:0,y:0},{width:u,height:c}),r[i]={data:g,pixelRatio:d,sdf:f,stretchX:m,stretchY:v,content:y}}n(null,r)}}return{cancel:function(){u&&(u.cancel(),u=null),c&&(c.cancel(),c=null)}}}(t,this.map._requestManager,this.map.getPixelRatio(),(function(t,i){if(r._spriteRequest=null,t)r.fire(new e.ErrorEvent(t));else if(i)for(var n in i)r.imageManager.addImage(n,i[n]);r.imageManager.setLoaded(!0),r._availableImages=r.imageManager.listImages(),r.dispatcher.broadcast("setImages",r._availableImages),r.fire(new e.Event("data",{dataType:"style"}))}))}},{key:"_validateLayer",value:function(t){var r=this.sourceCaches[t.source];if(r){var i=t.sourceLayer;if(i){var n=r.getSource();("geojson"===n.type||n.vectorLayerIds&&-1===n.vectorLayerIds.indexOf(i))&&this.fire(new e.ErrorEvent(new Error('Source layer "'.concat(i,'" does not exist on source "').concat(n.id,'" as specified by style layer "').concat(t.id,'".'))))}}}},{key:"loaded",value:function(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(var e in this.sourceCaches)if(!this.sourceCaches[e].loaded())return!1;return!!this.imageManager.isLoaded()}},{key:"_serializeLayers",value:function(e){var t,r=[],i=K(e);try{for(i.s();!(t=i.n()).done;){var n=t.value,a=this._layers[n];"custom"!==a.type&&r.push(a.serialize())}}catch(o){i.e(o)}finally{i.f()}return r}},{key:"hasTransitions",value:function(){if(this.light&&this.light.hasTransition())return!0;for(var e in this.sourceCaches)if(this.sourceCaches[e].hasTransition())return!0;for(var t in this._layers)if(this._layers[t].hasTransition())return!0;return!1}},{key:"_checkLoaded",value:function(){if(!this._loaded)throw new Error("Style is not done loading.")}},{key:"update",value:function(t){if(this._loaded){var r=this._changed;if(this._changed){var i=Object.keys(this._updatedLayers),n=Object.keys(this._removedLayers);for(var a in(i.length||n.length)&&this._updateWorkerLayers(i,n),this._updatedSources){var o=this._updatedSources[a];if("reload"===o)this._reloadSource(a);else{if("clear"!==o)throw new Error("Invalid action ".concat(o));this._clearSource(a)}}for(var s in this._updateTilesForChangedImages(),this._updatedPaintProps)this._layers[s].updateTransitions(t);this.light.updateTransitions(t),this._resetUpdates()}var l={};for(var u in this.sourceCaches){var c=this.sourceCaches[u];l[u]=c.used,c.used=!1}var h,p=K(this._order);try{for(p.s();!(h=p.n()).done;){var f=h.value,d=this._layers[f];d.recalculate(t,this._availableImages),!d.isHidden(t.zoom)&&d.source&&(this.sourceCaches[d.source].used=!0)}}catch(y){p.e(y)}finally{p.f()}for(var m in l){var v=this.sourceCaches[m];l[m]!==v.used&&v.fire(new e.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:m}))}this.light.recalculate(t),this.z=t.zoom,r&&this.fire(new e.Event("data",{dataType:"style"}))}}},{key:"_updateTilesForChangedImages",value:function(){var e=Object.keys(this._changedImages);if(e.length){for(var t in this.sourceCaches)this.sourceCaches[t].reloadTilesForDependencies(["icons","patterns"],e);this._changedImages={}}}},{key:"_updateWorkerLayers",value:function(e,t){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(e),removedIds:t})}},{key:"_resetUpdates",value:function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}}},{key:"setTerrain",value:function(t){var r=this;if(this._checkLoaded(),this._terrainDataCallback&&this.off("data",this._terrainDataCallback),this._terrainfreezeElevationCallback&&this.map.off("freezeElevation",this._terrainfreezeElevationCallback),t){var i=this.sourceCaches[t.source];if(!i)throw new Error("cannot load terrain, because there exists no source with ID: ".concat(t.source));this.terrain=new lt(this,i,t),this.map.transform.updateElevation(this.terrain),this._terrainfreezeElevationCallback=function(e){e.freeze?r.map.transform.freezeElevation=!0:(r.map.transform.freezeElevation=!1,r.map.transform.recalculateZoom(r.terrain))},this._terrainDataCallback=function(e){e.tile&&(e.sourceId===t.source?(r.map.transform.updateElevation(r.terrain),r.terrain.rememberForRerender(e.sourceId,e.tile.tileID)):"geojson"===e.source.type&&r.terrain.rememberForRerender(e.sourceId,e.tile.tileID))},this.on("data",this._terrainDataCallback),this.map.on("freezeElevation",this._terrainfreezeElevationCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.map.transform.updateElevation(this.terrain);this.map.fire(new e.Event("terrain",{terrain:t}))}},{key:"setState",value:function(t){var r=this;if(this._checkLoaded(),ut(this,e.validateStyle(t)))return!1;(t=e.clone$1(t)).layers=ae(t.layers);var i=function(e,t){if(!e)return[{command:oe.setStyle,args:[t]}];var r=[];try{if(!n(e.version,t.version))return[{command:oe.setStyle,args:[t]}];n(e.center,t.center)||r.push({command:oe.setCenter,args:[t.center]}),n(e.zoom,t.zoom)||r.push({command:oe.setZoom,args:[t.zoom]}),n(e.bearing,t.bearing)||r.push({command:oe.setBearing,args:[t.bearing]}),n(e.pitch,t.pitch)||r.push({command:oe.setPitch,args:[t.pitch]}),n(e.sprite,t.sprite)||r.push({command:oe.setSprite,args:[t.sprite]}),n(e.glyphs,t.glyphs)||r.push({command:oe.setGlyphs,args:[t.glyphs]}),n(e.transition,t.transition)||r.push({command:oe.setTransition,args:[t.transition]}),n(e.light,t.light)||r.push({command:oe.setLight,args:[t.light]});var i={},a=[];!function(e,t,r,i){var a;for(a in t=t||{},e=e||{})Object.prototype.hasOwnProperty.call(e,a)&&(Object.prototype.hasOwnProperty.call(t,a)||le(a,r,i));for(a in t)Object.prototype.hasOwnProperty.call(t,a)&&(Object.prototype.hasOwnProperty.call(e,a)?n(e[a],t[a])||("geojson"===e[a].type&&"geojson"===t[a].type&&ce(e,t,a)?r.push({command:oe.setGeoJSONSourceData,args:[a,t[a].data]}):ue(a,t,r,i)):se(a,t,r))}(e.sources,t.sources,a,i);var o=[];e.layers&&e.layers.forEach((function(e){i[e.source]?r.push({command:oe.removeLayer,args:[e.id]}):o.push(e)})),r=r.concat(a),function(e,t,r){t=t||[];var i,a,o,s,l,u,c,h=(e=e||[]).map(pe),p=t.map(pe),f=e.reduce(fe,{}),d=t.reduce(fe,{}),m=h.slice(),v=Object.create(null);for(i=0,a=0;i<h.length;i++)o=h[i],Object.prototype.hasOwnProperty.call(d,o)?a++:(r.push({command:oe.removeLayer,args:[o]}),m.splice(m.indexOf(o,a),1));for(i=0,a=0;i<p.length;i++)o=p[p.length-1-i],m[m.length-1-i]!==o&&(Object.prototype.hasOwnProperty.call(f,o)?(r.push({command:oe.removeLayer,args:[o]}),m.splice(m.lastIndexOf(o,m.length-a),1)):a++,u=m[m.length-i],r.push({command:oe.addLayer,args:[d[o],u]}),m.splice(m.length-i,0,o),v[o]=!0);for(i=0;i<p.length;i++)if(s=f[o=p[i]],l=d[o],!v[o]&&!n(s,l))if(n(s.source,l.source)&&n(s["source-layer"],l["source-layer"])&&n(s.type,l.type)){for(c in he(s.layout,l.layout,r,o,null,oe.setLayoutProperty),he(s.paint,l.paint,r,o,null,oe.setPaintProperty),n(s.filter,l.filter)||r.push({command:oe.setFilter,args:[o,l.filter]}),n(s.minzoom,l.minzoom)&&n(s.maxzoom,l.maxzoom)||r.push({command:oe.setLayerZoomRange,args:[o,l.minzoom,l.maxzoom]}),s)Object.prototype.hasOwnProperty.call(s,c)&&"layout"!==c&&"paint"!==c&&"filter"!==c&&"metadata"!==c&&"minzoom"!==c&&"maxzoom"!==c&&(0===c.indexOf("paint.")?he(s[c],l[c],r,o,c.slice(6),oe.setPaintProperty):n(s[c],l[c])||r.push({command:oe.setLayerProperty,args:[o,c,l[c]]}));for(c in l)Object.prototype.hasOwnProperty.call(l,c)&&!Object.prototype.hasOwnProperty.call(s,c)&&"layout"!==c&&"paint"!==c&&"filter"!==c&&"metadata"!==c&&"minzoom"!==c&&"maxzoom"!==c&&(0===c.indexOf("paint.")?he(s[c],l[c],r,o,c.slice(6),oe.setPaintProperty):n(s[c],l[c])||r.push({command:oe.setLayerProperty,args:[o,c,l[c]]}))}else r.push({command:oe.removeLayer,args:[o]}),u=m[m.lastIndexOf(o)+1],r.push({command:oe.addLayer,args:[l,u]})}(o,t.layers,r)}catch(e){console.warn("Unable to compute style diff:",e),r=[{command:oe.setStyle,args:[t]}]}return r}(this.serialize(),t).filter((function(e){return!(e.command in ht)}));if(0===i.length)return!1;var a=i.filter((function(e){return!(e.command in ct)}));if(a.length>0)throw new Error("Unimplemented: ".concat(a.map((function(e){return e.command})).join(", "),"."));return i.forEach((function(e){"setTransition"!==e.command&&r[e.command].apply(r,e.args)})),this.stylesheet=t,!0}},{key:"addImage",value:function(t,r){if(this.getImage(t))return this.fire(new e.ErrorEvent(new Error('An image named "'.concat(t,'" already exists.'))));this.imageManager.addImage(t,r),this._afterImageUpdated(t)}},{key:"updateImage",value:function(e,t){this.imageManager.updateImage(e,t)}},{key:"getImage",value:function(e){return this.imageManager.getImage(e)}},{key:"removeImage",value:function(t){if(!this.getImage(t))return this.fire(new e.ErrorEvent(new Error('An image named "'.concat(t,'" does not exist.'))));this.imageManager.removeImage(t),this._afterImageUpdated(t)}},{key:"_afterImageUpdated",value:function(t){this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new e.Event("data",{dataType:"style"}))}},{key:"listImages",value:function(){return this._checkLoaded(),this.imageManager.listImages()}},{key:"addSource",value:function(t,r){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this._checkLoaded(),void 0!==this.sourceCaches[t])throw new Error('Source "'.concat(t,'" already exists.'));if(!r.type)throw new Error("The type property must be defined, but only the following properties were given: ".concat(Object.keys(r).join(", "),"."));if(!(["vector","raster","geojson","video","image"].indexOf(r.type)>=0&&this._validate(e.validateStyle.source,"sources.".concat(t),r,null,n))){this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);var a=this.sourceCaches[t]=new J(t,r,this.dispatcher);a.style=this,a.setEventedParent(this,(function(){return{isSourceLoaded:i.loaded(),source:a.serialize(),sourceId:t}})),a.onAdd(this.map),this._changed=!0}}},{key:"removeSource",value:function(t){if(this._checkLoaded(),void 0===this.sourceCaches[t])throw new Error("There is no source with this ID");for(var r in this._layers)if(this._layers[r].source===t)return this.fire(new e.ErrorEvent(new Error('Source "'.concat(t,'" cannot be removed while layer "').concat(r,'" is using it.'))));var i=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],i.fire(new e.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),i.setEventedParent(null),i.onRemove(this.map),this._changed=!0}},{key:"setGeoJSONSourceData",value:function(e,t){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID=".concat(e));var r=this.sourceCaches[e].getSource();if("geojson"!==r.type)throw new Error("geojsonSource.type is ".concat(r.type,", which is !== 'geojson"));r.setData(t),this._changed=!0}},{key:"getSource",value:function(e){return this.sourceCaches[e]&&this.sourceCaches[e].getSource()}},{key:"addLayer",value:function(t,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this._checkLoaded();var n=t.id;if(this.getLayer(n))this.fire(new e.ErrorEvent(new Error('Layer "'.concat(n,'" already exists on this map.'))));else{var a;if("custom"===t.type){if(ut(this,e.validateCustomStyleLayer(t)))return;a=e.createStyleLayer(t)}else{if("object"==Z(t.source)&&(this.addSource(n,t.source),t=e.clone$1(t),t=e.extend(t,{source:n})),this._validate(e.validateStyle.layer,"layers.".concat(n),t,{arrayIndex:-1},i))return;a=e.createStyleLayer(t),this._validateLayer(a),a.setEventedParent(this,{layer:{id:n}}),this._serializedLayers[a.id]=a.serialize()}var o=r?this._order.indexOf(r):this._order.length;if(r&&-1===o)this.fire(new e.ErrorEvent(new Error('Cannot add layer "'.concat(n,'" before non-existing layer "').concat(r,'".'))));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)}}}},{key:"moveLayer",value:function(t,r){if(this._checkLoaded(),this._changed=!0,this._layers[t]){if(t!==r){var i=this._order.indexOf(t);this._order.splice(i,1);var n=r?this._order.indexOf(r):this._order.length;r&&-1===n?this.fire(new e.ErrorEvent(new Error('Cannot move layer "'.concat(t,'" before non-existing layer "').concat(r,'".')))):(this._order.splice(n,0,t),this._layerOrderChanged=!0)}}else this.fire(new e.ErrorEvent(new Error("The layer '".concat(t,"' does not exist in the map's style and cannot be moved."))))}},{key:"removeLayer",value:function(t){this._checkLoaded();var r=this._layers[t];if(r){r.setEventedParent(null);var i=this._order.indexOf(t);this._order.splice(i,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=r,delete this._layers[t],delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],r.onRemove&&r.onRemove(this.map)}else this.fire(new e.ErrorEvent(new Error('Cannot remove non-existing layer "'.concat(t,'".'))))}},{key:"getLayer",value:function(e){return this._layers[e]}},{key:"hasLayer",value:function(e){return e in this._layers}},{key:"setLayerZoomRange",value:function(t,r,i){this._checkLoaded();var n=this.getLayer(t);n?n.minzoom===r&&n.maxzoom===i||(null!=r&&(n.minzoom=r),null!=i&&(n.maxzoom=i),this._updateLayer(n)):this.fire(new e.ErrorEvent(new Error('Cannot set the zoom range of non-existing layer "'.concat(t,'".'))))}},{key:"setFilter",value:function(t,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this._checkLoaded();var a=this.getLayer(t);if(a){if(!n(a.filter,r))return null==r?(a.filter=void 0,void this._updateLayer(a)):void(this._validate(e.validateStyle.filter,"layers.".concat(a.id,".filter"),r,null,i)||(a.filter=e.clone$1(r),this._updateLayer(a)))}else this.fire(new e.ErrorEvent(new Error('Cannot filter non-existing layer "'.concat(t,'".'))))}},{key:"getFilter",value:function(t){return e.clone$1(this.getLayer(t).filter)}},{key:"setLayoutProperty",value:function(t,r,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};this._checkLoaded();var o=this.getLayer(t);o?n(o.getLayoutProperty(r),i)||(o.setLayoutProperty(r,i,a),this._updateLayer(o)):this.fire(new e.ErrorEvent(new Error('Cannot style non-existing layer "'.concat(t,'".'))))}},{key:"getLayoutProperty",value:function(t,r){var i=this.getLayer(t);if(i)return i.getLayoutProperty(r);this.fire(new e.ErrorEvent(new Error('Cannot get style of non-existing layer "'.concat(t,'".'))))}},{key:"setPaintProperty",value:function(t,r,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};this._checkLoaded();var o=this.getLayer(t);o?n(o.getPaintProperty(r),i)||(o.setPaintProperty(r,i,a)&&this._updateLayer(o),this._changed=!0,this._updatedPaintProps[t]=!0):this.fire(new e.ErrorEvent(new Error('Cannot style non-existing layer "'.concat(t,'".'))))}},{key:"getPaintProperty",value:function(e,t){return this.getLayer(e).getPaintProperty(t)}},{key:"setFeatureState",value:function(t,r){this._checkLoaded();var i=t.source,n=t.sourceLayer,a=this.sourceCaches[i];if(void 0!==a){var o=a.getSource().type;"geojson"===o&&n?this.fire(new e.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==o||n?(void 0===t.id&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),a.setFeatureState(n,t.id,r)):this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new e.ErrorEvent(new Error("The source '".concat(i,"' does not exist in the map's style."))))}},{key:"removeFeatureState",value:function(t,r){this._checkLoaded();var i=t.source,n=this.sourceCaches[i];if(void 0!==n){var a=n.getSource().type,o="vector"===a?t.sourceLayer:void 0;"vector"!==a||o?r&&"string"!=typeof t.id&&"number"!=typeof t.id?this.fire(new e.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):n.removeFeatureState(o,t.id,r):this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new e.ErrorEvent(new Error("The source '".concat(i,"' does not exist in the map's style."))))}},{key:"getFeatureState",value:function(t){this._checkLoaded();var r=t.source,i=t.sourceLayer,n=this.sourceCaches[r];if(void 0!==n)return"vector"!==n.getSource().type||i?(void 0===t.id&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),n.getFeatureState(i,t.id)):void this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new e.ErrorEvent(new Error("The source '".concat(r,"' does not exist in the map's style."))))}},{key:"getTransition",value:function(){return e.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}},{key:"serialize",value:function(){return e.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:e.mapObject(this.sourceCaches,(function(e){return e.serialize()})),layers:this._serializeLayers(this._order)},(function(e){return void 0!==e}))}},{key:"_updateLayer",value:function(e){this._updatedLayers[e.id]=!0,e.source&&!this._updatedSources[e.source]&&"raster"!==this.sourceCaches[e.source].getSource().type&&(this._updatedSources[e.source]="reload",this.sourceCaches[e.source].pause()),this._changed=!0}},{key:"_flattenAndSortRenderedFeatures",value:function(e){for(var t=this,r=function(e){return"fill-extrusion"===t._layers[e].type},i={},n=[],a=this._order.length-1;a>=0;a--){var o=this._order[a];if(r(o)){i[o]=a;var s,l=K(e);try{for(l.s();!(s=l.n()).done;){var u=s.value[o];if(u){var c,h=K(u);try{for(h.s();!(c=h.n()).done;){var p=c.value;n.push(p)}}catch(E){h.e(E)}finally{h.f()}}}}catch(E){l.e(E)}finally{l.f()}}}n.sort((function(e,t){return t.intersectionZ-e.intersectionZ}));for(var f=[],d=this._order.length-1;d>=0;d--){var m=this._order[d];if(r(m))for(var v=n.length-1;v>=0;v--){var y=n[v].feature;if(i[y.layer.id]<d)break;f.push(y),n.pop()}else{var g,_=K(e);try{for(_.s();!(g=_.n()).done;){var x=g.value[m];if(x){var b,w=K(x);try{for(w.s();!(b=w.n()).done;){var k=b.value;f.push(k.feature)}}catch(E){w.e(E)}finally{w.f()}}}}catch(E){_.e(E)}finally{_.f()}}}return f}},{key:"queryRenderedFeatures",value:function(t,r,i){r&&r.filter&&this._validate(e.validateStyle.filter,"queryRenderedFeatures.filter",r.filter,null,r);var n={};if(r&&r.layers){if(!Array.isArray(r.layers))return this.fire(new e.ErrorEvent(new Error("parameters.layers must be an Array."))),[];var a,o=K(r.layers);try{for(o.s();!(a=o.n()).done;){var s=a.value,l=this._layers[s];if(!l)return this.fire(new e.ErrorEvent(new Error("The layer '".concat(s,"' does not exist in the map's style and cannot be queried for features.")))),[];n[l.source]=!0}}catch(h){o.e(h)}finally{o.f()}}var u=[];for(var c in r.availableImages=this._availableImages,this.sourceCaches)r.layers&&!n[c]||u.push(U(this.sourceCaches[c],this._layers,this._serializedLayers,t,r,i));return this.placement&&u.push(function(e,t,r,i,n,a,o){var s,l={},u=a.queryRenderedSymbols(i),c=[],p=K(Object.keys(u).map(Number));try{for(p.s();!(s=p.n()).done;){var f=s.value;c.push(o[f])}}catch(h){p.e(h)}finally{p.f()}c.sort(N);for(var d=function(){var r=v[m],i=r.featureIndex.lookupSymbolFeatures(u[r.bucketInstanceId],t,r.bucketIndex,r.sourceLayerIndex,n.filter,n.layers,n.availableImages,e);for(var a in i){var o=l[a]=l[a]||[],s=i[a];s.sort((function(e,t){var i=r.featureSortOrder;if(i){var n=i.indexOf(e.featureIndex);return i.indexOf(t.featureIndex)-n}return t.featureIndex-e.featureIndex}));var c,p=K(s);try{for(p.s();!(c=p.n()).done;){var f=c.value;o.push(f)}}catch(h){p.e(h)}finally{p.f()}}},m=0,v=c;m<v.length;m++)d();var y=function(t){l[t].forEach((function(i){var n=i.feature,a=r[e[t].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 g in l)y(g);return l}(this._layers,this._serializedLayers,this.sourceCaches,t,r,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(u)}},{key:"querySourceFeatures",value:function(t,r){r&&r.filter&&this._validate(e.validateStyle.filter,"querySourceFeatures.filter",r.filter,null,r);var i=this.sourceCaches[t];return i?function(e,t){for(var r=e.getRenderableIds().map((function(t){return e.getTileByID(t)})),i=[],n={},a=0;a<r.length;a++){var o=r[a],s=o.tileID.canonical.key;n[s]||(n[s]=!0,o.querySourceFeatures(i,t))}return i}(i,r):[]}},{key:"addSourceType",value:function(e,t,r){return i.getSourceType(e)?r(new Error('A source type called "'.concat(e,'" already exists.'))):(i.setSourceType(e,t),t.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:e,url:t.workerSourceURL},r):r(null,null))}},{key:"getLight",value:function(){return this.light.getLight()}},{key:"setLight",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._checkLoaded();var i=this.light.getLight(),a=!1;for(var o in t)if(!n(t[o],i[o])){a=!0;break}if(a){var s={now:e.exported.now(),transition:e.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(t,r),this.light.updateTransitions(s)}}},{key:"_validate",value:function(t,r,i,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return(!a||!1!==a.validate)&&ut(this,t.call(e.validateStyle,e.extend({key:r,style:this.serialize(),value:i,styleSpec:e.spec},n)))}},{key:"_remove",value:function(){for(var t in this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),e.evented.off("pluginStateChange",this._rtlTextPluginCallback),this._layers)this._layers[t].setEventedParent(null);for(var r in this.sourceCaches){var i=this.sourceCaches[r];i.setEventedParent(null),i.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()}},{key:"_clearSource",value:function(e){this.sourceCaches[e].clearTiles()}},{key:"_reloadSource",value:function(e){this.sourceCaches[e].resume(),this.sourceCaches[e].reload()}},{key:"_updateSources",value:function(e){for(var t in this.sourceCaches)this.sourceCaches[t].update(e,this.terrain)}},{key:"_generateCollisionBoxes",value:function(){for(var e in this.sourceCaches)this._reloadSource(e)}},{key:"_updatePlacement",value:function(t,r,i,n){var a,o=this,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],l=!1,u=!1,c={},h=K(this._order);try{for(h.s();!(a=h.n()).done;){var p=a.value,f=this._layers[p];if("symbol"===f.type){c[f.source]||function(){var e=o.sourceCaches[f.source];c[f.source]=e.getRenderableIds(!0).map((function(t){return e.getTileByID(t)})).sort((function(e,t){return t.tileID.overscaledZ-e.tileID.overscaledZ||(e.tileID.isLessThan(t.tileID)?-1:1)}))}();var d=this.crossTileSymbolIndex.addLayer(f,c[f.source],t.center.lng);l=l||d}}}catch(_){h.e(_)}finally{h.f()}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((s=s||this._layerOrderChanged||0===i)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(e.exported.now(),t.zoom))&&(this.pauseablePlacement=new et(t,this.terrain,this._order,s,r,i,n,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,c),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(e.exported.now()),u=!0),l&&this.pauseablePlacement.placement.setStale()),u||l){var m,v=K(this._order);try{for(v.s();!(m=v.n()).done;){var y=m.value,g=this._layers[y];"symbol"===g.type&&this.placement.updateLayerOpacities(g,c[g.source])}}catch(_){v.e(_)}finally{v.f()}}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(e.exported.now())}},{key:"_releaseSymbolFadeTiles",value:function(){for(var e in this.sourceCaches)this.sourceCaches[e].releaseSymbolFadeTiles()}},{key:"getImages",value:function(e,t,r){this.imageManager.getImages(t.icons,r),this._updateTilesForChangedImages();var i=this.sourceCaches[t.source];i&&i.setDependencies(t.tileID.key,t.type,t.icons)}},{key:"getGlyphs",value:function(e,t,r){this.glyphManager.getGlyphs(t.stacks,r)}},{key:"getResource",value:function(t,r,i){return e.makeRequest(r,i)}}]),i}(e.Evented);ft.getSourceType=function(e){return B[e]},ft.setSourceType=function(e,t){B[e]=t},ft.registerForPluginStateChange=e.registerForPluginStateChange;var dt="attribute vec2 a_pos;uniform mat4 u_matrix;varying vec2 v_texture_pos;varying float v_depth;void main() {v_texture_pos=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos,get_elevation(a_pos),1.0);v_depth=gl_Position.z/gl_Position.w;}",mt={prelude:vt("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif","#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}\n#ifdef TERRAIN3D\nuniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_offset;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth;\n#endif\nconst highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) {\n#ifdef TERRAIN3D\nhighp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0));\n#else\nreturn 1.0;\n#endif\n}float calculate_visibility(vec4 pos) {\n#ifdef TERRAIN3D\nvec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0;\n#else\nreturn 1.0;\n#endif\n}float ele(vec2 pos) {\n#ifdef TERRAIN3D\nvec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;\n#else\nreturn 0.0;\n#endif\n}float get_elevation(vec2 pos) {\n#ifdef TERRAIN3D\nvec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return (elevation+u_terrain_offset)*u_terrain_exaggeration;\n#else\nreturn 0.0;\n#endif\n}"),background:vt("uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:vt("uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:vt("varying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}"),clippingMask:vt("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:vt("uniform highp float u_intensity;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}"),heatmapTexture:vt("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(0.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:vt("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,get_elevation(a_pos),1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:vt("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:vt("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,get_elevation(a_pos),1);}"),fill:vt("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),fillOutline:vt("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),fillOutlinePattern:vt("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),fillPattern:vt("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}"),fillExtrusion:vt("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;\n#ifdef TERRAIN3D\nattribute vec2 a_centroid;\n#endif\nvarying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;\n#ifdef TERRAIN3D\nfloat baseDelta=10.0;float ele=get_elevation(a_centroid);\n#else\nfloat baseDelta=0.0;float ele=0.0;\n#endif\nbase=max(0.0,ele+base-baseDelta);height=max(0.0,ele+height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}"),fillExtrusionPattern:vt("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;\n#ifdef TERRAIN3D\nattribute vec2 a_centroid;\n#endif\nvarying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\n#ifdef TERRAIN3D\nfloat baseDelta=10.0;float ele=get_elevation(a_centroid);\n#else\nfloat baseDelta=0.0;float ele=0.0;\n#endif\nbase=max(0.0,ele+base-baseDelta);height=max(0.0,ele+height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"),hillshadePrepare:vt("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:vt("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),line:vt("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_width2=vec2(outset,inset);}"),lineGradient:vt("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_width2=vec2(outset,inset);}"),linePattern:vt("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float 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;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),lineSDF:vt("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}"),raster:vt("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:vt("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),z,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}"),symbolSDF:vt("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),symbolTextAndIcon:vt("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}"),terrain:vt("uniform sampler2D u_texture;varying vec2 v_texture_pos;void main() {gl_FragColor=texture2D(u_texture,v_texture_pos);}",dt),terrainDepth:vt("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}",dt),terrainCoords:vt("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}",dt)};function vt(e,t){var r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,i=t.match(/attribute ([\w]+) ([\w]+)/g),n=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=a?a.concat(n):n,s={};return{fragmentSource:e=e.replace(r,(function(e,t,r,i,n){return s[n]=!0,"define"===t?"\n#ifndef HAS_UNIFORM_u_".concat(n,"\nvarying ").concat(r," ").concat(i," ").concat(n,";\n#else\nuniform ").concat(r," ").concat(i," u_").concat(n,";\n#endif\n"):"\n#ifdef HAS_UNIFORM_u_".concat(n,"\n ").concat(r," ").concat(i," ").concat(n," = u_").concat(n,";\n#endif\n")})),vertexSource:t=t.replace(r,(function(e,t,r,i,n){var a="float"===i?"vec2":"vec4",o=n.match(/color/)?"color":a;return s[n]?"define"===t?"\n#ifndef HAS_UNIFORM_u_".concat(n,"\nuniform lowp float u_").concat(n,"_t;\nattribute ").concat(r," ").concat(a," a_").concat(n,";\nvarying ").concat(r," ").concat(i," ").concat(n,";\n#else\nuniform ").concat(r," ").concat(i," u_").concat(n,";\n#endif\n"):"vec4"===o?"\n#ifndef HAS_UNIFORM_u_".concat(n,"\n ").concat(n," = a_").concat(n,";\n#else\n ").concat(r," ").concat(i," ").concat(n," = u_").concat(n,";\n#endif\n"):"\n#ifndef HAS_UNIFORM_u_".concat(n,"\n ").concat(n," = unpack_mix_").concat(o,"(a_").concat(n,", u_").concat(n,"_t);\n#else\n ").concat(r," ").concat(i," ").concat(n," = u_").concat(n,";\n#endif\n"):"define"===t?"\n#ifndef HAS_UNIFORM_u_".concat(n,"\nuniform lowp float u_").concat(n,"_t;\nattribute ").concat(r," ").concat(a," a_").concat(n,";\n#else\nuniform ").concat(r," ").concat(i," u_").concat(n,";\n#endif\n"):"vec4"===o?"\n#ifndef HAS_UNIFORM_u_".concat(n,"\n ").concat(r," ").concat(i," ").concat(n," = a_").concat(n,";\n#else\n ").concat(r," ").concat(i," ").concat(n," = u_").concat(n,";\n#endif\n"):"\n#ifndef HAS_UNIFORM_u_".concat(n,"\n ").concat(r," ").concat(i," ").concat(n," = unpack_mix_").concat(o,"(a_").concat(n,", u_").concat(n,"_t);\n#else\n ").concat(r," ").concat(i," ").concat(n," = u_").concat(n,";\n#endif\n")})),staticAttributes:i,staticUniforms:o}}var yt=function(){function e(){j(this,e),this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}return q(e,[{key:"bind",value:function(e,t,r,i,n,a,o,s,l){this.context=e;for(var u=this.boundPaintVertexBuffers.length!==i.length,c=0;!u&&c<i.length;c++)this.boundPaintVertexBuffers[c]!==i[c]&&(u=!0);e.extVertexArrayObject&&this.vao&&this.boundProgram===t&&this.boundLayoutVertexBuffer===r&&!u&&this.boundIndexBuffer===n&&this.boundVertexOffset===a&&this.boundDynamicVertexBuffer===o&&this.boundDynamicVertexBuffer2===s&&this.boundDynamicVertexBuffer3===l?(e.bindVertexArrayOES.set(this.vao),o&&o.bind(),n&&n.dynamicDraw&&n.bind(),s&&s.bind(),l&&l.bind()):this.freshBind(t,r,i,n,a,o,s,l)}},{key:"freshBind",value:function(e,t,r,i,n,a,o,s){var l,u=e.numAttributes,c=this.context,h=c.gl;if(c.extVertexArrayObject)this.vao&&this.destroy(),this.vao=c.extVertexArrayObject.createVertexArrayOES(),c.bindVertexArrayOES.set(this.vao),l=0,this.boundProgram=e,this.boundLayoutVertexBuffer=t,this.boundPaintVertexBuffers=r,this.boundIndexBuffer=i,this.boundVertexOffset=n,this.boundDynamicVertexBuffer=a,this.boundDynamicVertexBuffer2=o,this.boundDynamicVertexBuffer3=s;else{l=c.currentNumAttributes||0;for(var p=u;p<l;p++)h.disableVertexAttribArray(p)}t.enableAttributes(h,e);var f,d=K(r);try{for(d.s();!(f=d.n()).done;)f.value.enableAttributes(h,e)}catch(g){d.e(g)}finally{d.f()}a&&a.enableAttributes(h,e),o&&o.enableAttributes(h,e),s&&s.enableAttributes(h,e),t.bind(),t.setVertexAttribPointers(h,e,n);var m,v=K(r);try{for(v.s();!(m=v.n()).done;){var y=m.value;y.bind(),y.setVertexAttribPointers(h,e,n)}}catch(g){v.e(g)}finally{v.f()}a&&(a.bind(),a.setVertexAttribPointers(h,e,n)),i&&i.bind(),o&&(o.bind(),o.setVertexAttribPointers(h,e,n)),s&&(s.bind(),s.setVertexAttribPointers(h,e,n)),c.currentNumAttributes=u}},{key:"destroy",value:function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)}}]),e}();function gt(e){for(var t=[],r=0;r<e.length;r++)if(null!==e[r]){var i=e[r].split(" ");t.push(i.pop())}return t}var _t=function(){function t(r,i,n,a,o,s,l){j(this,t);var u=r.gl;this.program=u.createProgram();var c,h=gt(n.staticAttributes),p=a?a.getBinderAttributes():[],f=h.concat(p),d=mt.prelude.staticUniforms?gt(mt.prelude.staticUniforms):[],m=n.staticUniforms?gt(n.staticUniforms):[],v=a?a.getBinderUniforms():[],y=[],g=K(d.concat(m).concat(v));try{for(g.s();!(c=g.n()).done;){var _=c.value;y.indexOf(_)<0&&y.push(_)}}catch(A){g.e(A)}finally{g.f()}var x=a?a.defines():[];s&&x.push("#define OVERDRAW_INSPECTOR;"),l&&x.push("#define TERRAIN3D;");var b=x.concat(mt.prelude.fragmentSource,n.fragmentSource).join("\n"),w=x.concat(mt.prelude.vertexSource,n.vertexSource).join("\n"),k=u.createShader(u.FRAGMENT_SHADER);if(u.isContextLost())this.failedToCreate=!0;else{u.shaderSource(k,b),u.compileShader(k),u.attachShader(this.program,k);var E=u.createShader(u.VERTEX_SHADER);if(u.isContextLost())this.failedToCreate=!0;else{u.shaderSource(E,w),u.compileShader(E),u.attachShader(this.program,E),this.attributes={};var T={};this.numAttributes=f.length;for(var S=0;S<this.numAttributes;S++)f[S]&&(u.bindAttribLocation(this.program,S,f[S]),this.attributes[f[S]]=S);u.linkProgram(this.program),u.deleteShader(E),u.deleteShader(k);for(var C=0;C<y.length;C++){var I=y[C];if(I&&!T[I]){var z=u.getUniformLocation(this.program,I);z&&(T[I]=z)}}this.fixedUniforms=o(r,T),this.terrainUniforms=function(t,r){return{u_depth:new e.Uniform1i(t,r.u_depth),u_terrain:new e.Uniform1i(t,r.u_terrain),u_terrain_dim:new e.Uniform1f(t,r.u_terrain_dim),u_terrain_matrix:new e.UniformMatrix4f(t,r.u_terrain_matrix),u_terrain_unpack:new e.Uniform4f(t,r.u_terrain_unpack),u_terrain_offset:new e.Uniform1f(t,r.u_terrain_offset),u_terrain_exaggeration:new e.Uniform1f(t,r.u_terrain_exaggeration)}}(r,T),this.binderUniforms=a?a.getUniforms(r,T):[]}}}return q(t,[{key:"draw",value:function(e,t,r,i,n,a,o,s,l,u,c,h,p,f,d,m,v,y){var g=e.gl;if(!this.failedToCreate){if(e.program.set(this.program),e.setDepthMode(r),e.setStencilMode(i),e.setColorMode(n),e.setCullFace(a),s)for(var _ in e.activeTexture.set(g.TEXTURE2),g.bindTexture(g.TEXTURE_2D,s.depthTexture),e.activeTexture.set(g.TEXTURE3),g.bindTexture(g.TEXTURE_2D,s.texture),this.terrainUniforms)this.terrainUniforms[_].set(s[_]);for(var x in this.fixedUniforms)this.fixedUniforms[x].set(o[x]);d&&d.setUniforms(e,this.binderUniforms,p,{zoom:f});var b=0;switch(t){case g.LINES:b=2;break;case g.TRIANGLES:b=3;break;case g.LINE_STRIP:b=1}var w,k=K(h.get());try{for(k.s();!(w=k.n()).done;){var E=w.value,T=E.vaos||(E.vaos={});(T[l]||(T[l]=new yt)).bind(e,this,u,d?d.getPaintVertexBuffers():[],c,E.vertexOffset,m,v,y),g.drawElements(t,E.primitiveLength*b,g.UNSIGNED_SHORT,E.primitiveOffset*b*2)}}catch(S){k.e(S)}finally{k.f()}}}}]),t}();function xt(e,t,r){var i=1/De(r,1,t.transform.tileZoom),n=Math.pow(2,r.tileID.overscaledZ),a=r.tileSize*Math.pow(2,t.transform.tileZoom)/n,o=a*(r.tileID.canonical.x+r.tileID.wrap*n),s=a*r.tileID.canonical.y;return{u_image:0,u_texsize:r.imageAtlasTexture.size,u_scale:[i,e.fromScale,e.toScale],u_fade:e.t,u_pixel_coord_upper:[o>>16,s>>16],u_pixel_coord_lower:[65535&o,65535&s]}}var bt=function(t,r,i,n){var a=r.style.light,o=a.properties.get("position"),s=[o.x,o.y,o.z],l=e.create$1();"viewport"===a.properties.get("anchor")&&e.fromRotation(l,-r.transform.angle),e.transformMat3(s,s,l);var u=a.properties.get("color");return{u_matrix:t,u_lightpos:s,u_lightintensity:a.properties.get("intensity"),u_lightcolor:[u.r,u.g,u.b],u_vertical_gradient:+i,u_opacity:n}},wt=function(t,r,i,n,a,o,s){return e.extend(bt(t,r,i,n),xt(o,r,s),{u_height_factor:-Math.pow(2,a.overscaledZ)/s.tileSize/8})},kt=function(e){return{u_matrix:e}},Et=function(t,r,i,n){return e.extend(kt(t),xt(i,r,n))},Tt=function(e,t){return{u_matrix:e,u_world:t}},St=function(t,r,i,n,a){return e.extend(Et(t,r,i,n),{u_world:a})},Ct=function(e,t,r,i){var n,a,o=e.transform;if("map"===i.paint.get("circle-pitch-alignment")){var s=De(r,1,o.zoom);n=!0,a=[s,s]}else n=!1,a=o.pixelsToGLUnits;return{u_camera_to_center_distance:o.cameraToCenterDistance,u_scale_with_map:+("map"===i.paint.get("circle-pitch-scale")),u_matrix:e.translatePosMatrix(t.posMatrix,r,i.paint.get("circle-translate"),i.paint.get("circle-translate-anchor")),u_pitch_with_map:+n,u_device_pixel_ratio:e.pixelRatio,u_extrude_scale:a}},It=function(e,t,r){var i=De(r,1,t.zoom),n=Math.pow(2,t.zoom-r.tileID.overscaledZ),a=r.tileID.overscaleFactor();return{u_matrix:e,u_camera_to_center_distance:t.cameraToCenterDistance,u_pixels_to_tile_units:i,u_extrude_scale:[t.pixelsToGLUnits[0]/(i*n),t.pixelsToGLUnits[1]/(i*n)],u_overscale_factor:a}},zt=function(e,t){return{u_matrix:e,u_color:t,u_overlay:0,u_overlay_scale:arguments.length>2&&void 0!==arguments[2]?arguments[2]:1}},At=function(e){return{u_matrix:e}},Mt=function(e,t,r,i){return{u_matrix:e,u_extrude_scale:De(t,1,r),u_intensity:i}};function Pt(t,r){var i=Math.pow(2,r.canonical.z),n=r.canonical.y;return[new e.MercatorCoordinate(0,n/i).toLngLat().lat,new e.MercatorCoordinate(0,(n+1)/i).toLngLat().lat]}var Dt=function(e,t,r,i){var n=e.transform;return{u_matrix:Ot(e,t,r,i),u_ratio:1/De(t,1,n.zoom),u_device_pixel_ratio:e.pixelRatio,u_units_to_pixels:[1/n.pixelsToGLUnits[0],1/n.pixelsToGLUnits[1]]}},Lt=function(t,r,i,n,a){return e.extend(Dt(t,r,i,a),{u_image:0,u_image_height:n})},Rt=function(e,t,r,i,n){var a=e.transform,o=Ft(t,a);return{u_matrix:Ot(e,t,r,n),u_texsize:t.imageAtlasTexture.size,u_ratio:1/De(t,1,a.zoom),u_device_pixel_ratio:e.pixelRatio,u_image:0,u_scale:[o,i.fromScale,i.toScale],u_fade:i.t,u_units_to_pixels:[1/a.pixelsToGLUnits[0],1/a.pixelsToGLUnits[1]]}},Bt=function(t,r,i,n,a,o){var s=t.lineAtlas,l=Ft(r,t.transform),u="round"===i.layout.get("line-cap"),c=s.getDash(n.from,u),h=s.getDash(n.to,u),p=c.width*a.fromScale,f=h.width*a.toScale;return e.extend(Dt(t,r,i,o),{u_patternscale_a:[l/p,-c.height/2],u_patternscale_b:[l/f,-h.height/2],u_sdfgamma:s.width/(256*Math.min(p,f)*t.pixelRatio)/2,u_image:0,u_tex_y_a:c.y,u_tex_y_b:h.y,u_mix:a.t})};function Ft(e,t){return 1/De(e,1,t.tileZoom)}function Ot(e,t,r,i){return e.translatePosMatrix(i?i.posMatrix:t.tileID.posMatrix,t,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}var Vt=function(e,t,r,i,n){return{u_matrix:e,u_tl_parent:t,u_scale_parent:r,u_buffer_scale:1,u_fade_t:i.mix,u_opacity:i.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:Ut(n.paint.get("raster-hue-rotate"))};var a,o};function Ut(e){e*=Math.PI/180;var t=Math.sin(e),r=Math.cos(e);return[(2*r+1)/3,(-Math.sqrt(3)*t-r+1)/3,(Math.sqrt(3)*t-r+1)/3]}var Nt=function(e,t,r,i,n,a,o,s,l,u){var c=n.transform;return{u_is_size_zoom_constant:+("constant"===e||"source"===e),u_is_size_feature_constant:+("constant"===e||"camera"===e),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_camera_to_center_distance:c.cameraToCenterDistance,u_pitch:c.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:c.width/c.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:+i,u_texsize:u,u_texture:0}},jt=function(t,r,i,n,a,o,s,l,u,c,h){var p=a.transform;return e.extend(Nt(t,r,i,n,a,o,s,l,u,c),{u_gamma_scale:n?Math.cos(p._pitch)*p.cameraToCenterDistance:1,u_device_pixel_ratio:a.pixelRatio,u_is_halo:+h})},Gt=function(t,r,i,n,a,o,s,l,u,c){return e.extend(jt(t,r,i,n,a,o,s,l,!0,u,!0),{u_texsize_icon:c,u_texture_icon:1})},qt=function(e,t,r){return{u_matrix:e,u_opacity:t,u_color:r}},Zt=function(t,r,i,n,a,o){return e.extend(function(e,t,r,i){var n=r.imageManager.getPattern(e.from.toString()),a=r.imageManager.getPattern(e.to.toString()),o=r.imageManager.getPixelSize(),s=o.width,l=o.height,u=Math.pow(2,i.tileID.overscaledZ),c=i.tileSize*Math.pow(2,r.transform.tileZoom)/u,h=c*(i.tileID.canonical.x+i.tileID.wrap*u),p=c*i.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:t.t,u_pattern_size_a:n.displaySize,u_pattern_size_b:a.displaySize,u_scale_a:t.fromScale,u_scale_b:t.toScale,u_tile_units_to_pixels:1/De(i,1,r.transform.tileZoom),u_pixel_coord_upper:[h>>16,p>>16],u_pixel_coord_lower:[65535&h,65535&p]}}(n,o,i,a),{u_matrix:t,u_opacity:r})},Xt={fillExtrusion:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_lightpos:new e.Uniform3f(t,r.u_lightpos),u_lightintensity:new e.Uniform1f(t,r.u_lightintensity),u_lightcolor:new e.Uniform3f(t,r.u_lightcolor),u_vertical_gradient:new e.Uniform1f(t,r.u_vertical_gradient),u_opacity:new e.Uniform1f(t,r.u_opacity)}},fillExtrusionPattern:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_lightpos:new e.Uniform3f(t,r.u_lightpos),u_lightintensity:new e.Uniform1f(t,r.u_lightintensity),u_lightcolor:new e.Uniform3f(t,r.u_lightcolor),u_vertical_gradient:new e.Uniform1f(t,r.u_vertical_gradient),u_height_factor:new e.Uniform1f(t,r.u_height_factor),u_image:new e.Uniform1i(t,r.u_image),u_texsize:new e.Uniform2f(t,r.u_texsize),u_pixel_coord_upper:new e.Uniform2f(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,r.u_pixel_coord_lower),u_scale:new e.Uniform3f(t,r.u_scale),u_fade:new e.Uniform1f(t,r.u_fade),u_opacity:new e.Uniform1f(t,r.u_opacity)}},fill:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix)}},fillPattern:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_image:new e.Uniform1i(t,r.u_image),u_texsize:new e.Uniform2f(t,r.u_texsize),u_pixel_coord_upper:new e.Uniform2f(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,r.u_pixel_coord_lower),u_scale:new e.Uniform3f(t,r.u_scale),u_fade:new e.Uniform1f(t,r.u_fade)}},fillOutline:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_world:new e.Uniform2f(t,r.u_world)}},fillOutlinePattern:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_world:new e.Uniform2f(t,r.u_world),u_image:new e.Uniform1i(t,r.u_image),u_texsize:new e.Uniform2f(t,r.u_texsize),u_pixel_coord_upper:new e.Uniform2f(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,r.u_pixel_coord_lower),u_scale:new e.Uniform3f(t,r.u_scale),u_fade:new e.Uniform1f(t,r.u_fade)}},circle:function(t,r){return{u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_scale_with_map:new e.Uniform1i(t,r.u_scale_with_map),u_pitch_with_map:new e.Uniform1i(t,r.u_pitch_with_map),u_extrude_scale:new e.Uniform2f(t,r.u_extrude_scale),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_matrix:new e.UniformMatrix4f(t,r.u_matrix)}},collisionBox:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_pixels_to_tile_units:new e.Uniform1f(t,r.u_pixels_to_tile_units),u_extrude_scale:new e.Uniform2f(t,r.u_extrude_scale),u_overscale_factor:new e.Uniform1f(t,r.u_overscale_factor)}},collisionCircle:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_inv_matrix:new e.UniformMatrix4f(t,r.u_inv_matrix),u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_viewport_size:new e.Uniform2f(t,r.u_viewport_size)}},debug:function(t,r){return{u_color:new e.UniformColor(t,r.u_color),u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_overlay:new e.Uniform1i(t,r.u_overlay),u_overlay_scale:new e.Uniform1f(t,r.u_overlay_scale)}},clippingMask:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix)}},heatmap:function(t,r){return{u_extrude_scale:new e.Uniform1f(t,r.u_extrude_scale),u_intensity:new e.Uniform1f(t,r.u_intensity),u_matrix:new e.UniformMatrix4f(t,r.u_matrix)}},heatmapTexture:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_world:new e.Uniform2f(t,r.u_world),u_image:new e.Uniform1i(t,r.u_image),u_color_ramp:new e.Uniform1i(t,r.u_color_ramp),u_opacity:new e.Uniform1f(t,r.u_opacity)}},hillshade:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_image:new e.Uniform1i(t,r.u_image),u_latrange:new e.Uniform2f(t,r.u_latrange),u_light:new e.Uniform2f(t,r.u_light),u_shadow:new e.UniformColor(t,r.u_shadow),u_highlight:new e.UniformColor(t,r.u_highlight),u_accent:new e.UniformColor(t,r.u_accent)}},hillshadePrepare:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_image:new e.Uniform1i(t,r.u_image),u_dimension:new e.Uniform2f(t,r.u_dimension),u_zoom:new e.Uniform1f(t,r.u_zoom),u_unpack:new e.Uniform4f(t,r.u_unpack)}},line:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_ratio:new e.Uniform1f(t,r.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(t,r.u_units_to_pixels)}},lineGradient:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_ratio:new e.Uniform1f(t,r.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(t,r.u_units_to_pixels),u_image:new e.Uniform1i(t,r.u_image),u_image_height:new e.Uniform1f(t,r.u_image_height)}},linePattern:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_texsize:new e.Uniform2f(t,r.u_texsize),u_ratio:new e.Uniform1f(t,r.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_image:new e.Uniform1i(t,r.u_image),u_units_to_pixels:new e.Uniform2f(t,r.u_units_to_pixels),u_scale:new e.Uniform3f(t,r.u_scale),u_fade:new e.Uniform1f(t,r.u_fade)}},lineSDF:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_ratio:new e.Uniform1f(t,r.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(t,r.u_units_to_pixels),u_patternscale_a:new e.Uniform2f(t,r.u_patternscale_a),u_patternscale_b:new e.Uniform2f(t,r.u_patternscale_b),u_sdfgamma:new e.Uniform1f(t,r.u_sdfgamma),u_image:new e.Uniform1i(t,r.u_image),u_tex_y_a:new e.Uniform1f(t,r.u_tex_y_a),u_tex_y_b:new e.Uniform1f(t,r.u_tex_y_b),u_mix:new e.Uniform1f(t,r.u_mix)}},raster:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_tl_parent:new e.Uniform2f(t,r.u_tl_parent),u_scale_parent:new e.Uniform1f(t,r.u_scale_parent),u_buffer_scale:new e.Uniform1f(t,r.u_buffer_scale),u_fade_t:new e.Uniform1f(t,r.u_fade_t),u_opacity:new e.Uniform1f(t,r.u_opacity),u_image0:new e.Uniform1i(t,r.u_image0),u_image1:new e.Uniform1i(t,r.u_image1),u_brightness_low:new e.Uniform1f(t,r.u_brightness_low),u_brightness_high:new e.Uniform1f(t,r.u_brightness_high),u_saturation_factor:new e.Uniform1f(t,r.u_saturation_factor),u_contrast_factor:new e.Uniform1f(t,r.u_contrast_factor),u_spin_weights:new e.Uniform3f(t,r.u_spin_weights)}},symbolIcon:function(t,r){return{u_is_size_zoom_constant:new e.Uniform1i(t,r.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(t,r.u_is_size_feature_constant),u_size_t:new e.Uniform1f(t,r.u_size_t),u_size:new e.Uniform1f(t,r.u_size),u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_pitch:new e.Uniform1f(t,r.u_pitch),u_rotate_symbol:new e.Uniform1i(t,r.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(t,r.u_aspect_ratio),u_fade_change:new e.Uniform1f(t,r.u_fade_change),u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(t,r.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(t,r.u_coord_matrix),u_is_text:new e.Uniform1i(t,r.u_is_text),u_pitch_with_map:new e.Uniform1i(t,r.u_pitch_with_map),u_texsize:new e.Uniform2f(t,r.u_texsize),u_texture:new e.Uniform1i(t,r.u_texture)}},symbolSDF:function(t,r){return{u_is_size_zoom_constant:new e.Uniform1i(t,r.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(t,r.u_is_size_feature_constant),u_size_t:new e.Uniform1f(t,r.u_size_t),u_size:new e.Uniform1f(t,r.u_size),u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_pitch:new e.Uniform1f(t,r.u_pitch),u_rotate_symbol:new e.Uniform1i(t,r.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(t,r.u_aspect_ratio),u_fade_change:new e.Uniform1f(t,r.u_fade_change),u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(t,r.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(t,r.u_coord_matrix),u_is_text:new e.Uniform1i(t,r.u_is_text),u_pitch_with_map:new e.Uniform1i(t,r.u_pitch_with_map),u_texsize:new e.Uniform2f(t,r.u_texsize),u_texture:new e.Uniform1i(t,r.u_texture),u_gamma_scale:new e.Uniform1f(t,r.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(t,r.u_is_halo)}},symbolTextAndIcon:function(t,r){return{u_is_size_zoom_constant:new e.Uniform1i(t,r.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(t,r.u_is_size_feature_constant),u_size_t:new e.Uniform1f(t,r.u_size_t),u_size:new e.Uniform1f(t,r.u_size),u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_pitch:new e.Uniform1f(t,r.u_pitch),u_rotate_symbol:new e.Uniform1i(t,r.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(t,r.u_aspect_ratio),u_fade_change:new e.Uniform1f(t,r.u_fade_change),u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(t,r.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(t,r.u_coord_matrix),u_is_text:new e.Uniform1i(t,r.u_is_text),u_pitch_with_map:new e.Uniform1i(t,r.u_pitch_with_map),u_texsize:new e.Uniform2f(t,r.u_texsize),u_texsize_icon:new e.Uniform2f(t,r.u_texsize_icon),u_texture:new e.Uniform1i(t,r.u_texture),u_texture_icon:new e.Uniform1i(t,r.u_texture_icon),u_gamma_scale:new e.Uniform1f(t,r.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(t,r.u_is_halo)}},background:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_opacity:new e.Uniform1f(t,r.u_opacity),u_color:new e.UniformColor(t,r.u_color)}},backgroundPattern:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_opacity:new e.Uniform1f(t,r.u_opacity),u_image:new e.Uniform1i(t,r.u_image),u_pattern_tl_a:new e.Uniform2f(t,r.u_pattern_tl_a),u_pattern_br_a:new e.Uniform2f(t,r.u_pattern_br_a),u_pattern_tl_b:new e.Uniform2f(t,r.u_pattern_tl_b),u_pattern_br_b:new e.Uniform2f(t,r.u_pattern_br_b),u_texsize:new e.Uniform2f(t,r.u_texsize),u_mix:new e.Uniform1f(t,r.u_mix),u_pattern_size_a:new e.Uniform2f(t,r.u_pattern_size_a),u_pattern_size_b:new e.Uniform2f(t,r.u_pattern_size_b),u_scale_a:new e.Uniform1f(t,r.u_scale_a),u_scale_b:new e.Uniform1f(t,r.u_scale_b),u_pixel_coord_upper:new e.Uniform2f(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,r.u_pixel_coord_lower),u_tile_units_to_pixels:new e.Uniform1f(t,r.u_tile_units_to_pixels)}},terrain:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_texture:new e.Uniform1i(t,r.u_texture)}},terrainDepth:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix)}},terrainCoords:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_texture:new e.Uniform1i(t,r.u_texture),u_terrain_coords_id:new e.Uniform1f(t,r.u_terrain_coords_id)}}},Ht=function(){function e(t,r,i){j(this,e),this.context=t;var n=t.gl;this.buffer=n.createBuffer(),this.dynamicDraw=Boolean(i),this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),n.bufferData(n.ELEMENT_ARRAY_BUFFER,r.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||delete r.arrayBuffer}return q(e,[{key:"bind",value:function(){this.context.bindElementBuffer.set(this.buffer)}},{key:"updateData",value:function(e){var t=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),t.bufferSubData(t.ELEMENT_ARRAY_BUFFER,0,e.arrayBuffer)}},{key:"destroy",value:function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}]),e}(),Wt={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},Kt=function(){function e(t,r,i,n){j(this,e),this.length=r.length,this.attributes=i,this.itemSize=r.bytesPerElement,this.dynamicDraw=n,this.context=t;var a=t.gl;this.buffer=a.createBuffer(),t.bindVertexBuffer.set(this.buffer),a.bufferData(a.ARRAY_BUFFER,r.arrayBuffer,this.dynamicDraw?a.DYNAMIC_DRAW:a.STATIC_DRAW),this.dynamicDraw||delete r.arrayBuffer}return q(e,[{key:"bind",value:function(){this.context.bindVertexBuffer.set(this.buffer)}},{key:"updateData",value:function(e){if(e.length!==this.length)throw new Error("Length of new data is ".concat(e.length,", which doesn't match current length of ").concat(this.length));var t=this.context.gl;this.bind(),t.bufferSubData(t.ARRAY_BUFFER,0,e.arrayBuffer)}},{key:"enableAttributes",value:function(e,t){for(var r=0;r<this.attributes.length;r++){var i=t.attributes[this.attributes[r].name];void 0!==i&&e.enableVertexAttribArray(i)}}},{key:"setVertexAttribPointers",value:function(e,t,r){for(var i=0;i<this.attributes.length;i++){var n=this.attributes[i],a=t.attributes[n.name];void 0!==a&&e.vertexAttribPointer(a,n.components,e[Wt[n.type]],!1,this.itemSize,n.offset+this.itemSize*(r||0))}}},{key:"destroy",value:function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}]),e}(),Jt=function(){function e(t){j(this,e),this.gl=t.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}return q(e,[{key:"get",value:function(){return this.current}},{key:"set",value:function(e){}},{key:"getDefault",value:function(){return this.default}},{key:"setDefault",value:function(){this.set(this.default)}}]),e}(),Yt=function(t){A(i,t);var r=M(i);function i(){return j(this,i),r.apply(this,arguments)}return q(i,[{key:"getDefault",value:function(){return e.Color.transparent}},{key:"set",value:function(e){var t=this.current;(e.r!==t.r||e.g!==t.g||e.b!==t.b||e.a!==t.a||this.dirty)&&(this.gl.clearColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}]),i}(Jt),Qt=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"getDefault",value:function(){return 1}},{key:"set",value:function(e){(e!==this.current||this.dirty)&&(this.gl.clearDepth(e),this.current=e,this.dirty=!1)}}]),r}(Jt),$t=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"getDefault",value:function(){return 0}},{key:"set",value:function(e){(e!==this.current||this.dirty)&&(this.gl.clearStencil(e),this.current=e,this.dirty=!1)}}]),r}(Jt),er=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"getDefault",value:function(){return[!0,!0,!0,!0]}},{key:"set",value:function(e){var t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3]||this.dirty)&&(this.gl.colorMask(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}]),r}(Jt),tr=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"getDefault",value:function(){return!0}},{key:"set",value:function(e){(e!==this.current||this.dirty)&&(this.gl.depthMask(e),this.current=e,this.dirty=!1)}}]),r}(Jt),rr=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"getDefault",value:function(){return 255}},{key:"set",value:function(e){(e!==this.current||this.dirty)&&(this.gl.stencilMask(e),this.current=e,this.dirty=!1)}}]),r}(Jt),ir=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"getDefault",value:function(){return{func:this.gl.ALWAYS,ref:0,mask:255}}},{key:"set",value:function(e){var t=this.current;(e.func!==t.func||e.ref!==t.ref||e.mask!==t.mask||this.dirty)&&(this.gl.stencilFunc(e.func,e.ref,e.mask),this.current=e,this.dirty=!1)}}]),r}(Jt),nr=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"getDefault",value:function(){var e=this.gl;return[e.KEEP,e.KEEP,e.KEEP]}},{key:"set",value:function(e){var t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||this.dirty)&&(this.gl.stencilOp(e[0],e[1],e[2]),this.current=e,this.dirty=!1)}}]),r}(Jt),ar=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"getDefault",value:function(){return!1}},{key:"set",value:function(e){if(e!==this.current||this.dirty){var t=this.gl;e?t.enable(t.STENCIL_TEST):t.disable(t.STENCIL_TEST),this.current=e,this.dirty=!1}}}]),r}(Jt),or=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"getDefault",value:function(){return[0,1]}},{key:"set",value:function(e){var t=this.current;(e[0]!==t[0]||e[1]!==t[1]||this.dirty)&&(this.gl.depthRange(e[0],e[1]),this.current=e,this.dirty=!1)}}]),r}(Jt),sr=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"getDefault",value:function(){return!1}},{key:"set",value:function(e){if(e!==this.current||this.dirty){var t=this.gl;e?t.enable(t.DEPTH_TEST):t.disable(t.DEPTH_TEST),this.current=e,this.dirty=!1}}}]),r}(Jt),lr=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"getDefault",value:function(){return this.gl.LESS}},{key:"set",value:function(e){(e!==this.current||this.dirty)&&(this.gl.depthFunc(e),this.current=e,this.dirty=!1)}}]),r}(Jt),ur=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"getDefault",value:function(){return!1}},{key:"set",value:function(e){if(e!==this.current||this.dirty){var t=this.gl;e?t.enable(t.BLEND):t.disable(t.BLEND),this.current=e,this.dirty=!1}}}]),r}(Jt),cr=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"getDefault",value:function(){var e=this.gl;return[e.ONE,e.ZERO]}},{key:"set",value:function(e){var t=this.current;(e[0]!==t[0]||e[1]!==t[1]||this.dirty)&&(this.gl.blendFunc(e[0],e[1]),this.current=e,this.dirty=!1)}}]),r}(Jt),hr=function(t){A(i,t);var r=M(i);function i(){return j(this,i),r.apply(this,arguments)}return q(i,[{key:"getDefault",value:function(){return e.Color.transparent}},{key:"set",value:function(e){var t=this.current;(e.r!==t.r||e.g!==t.g||e.b!==t.b||e.a!==t.a||this.dirty)&&(this.gl.blendColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}]),i}(Jt),pr=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"getDefault",value:function(){return this.gl.FUNC_ADD}},{key:"set",value:function(e){(e!==this.current||this.dirty)&&(this.gl.blendEquation(e),this.current=e,this.dirty=!1)}}]),r}(Jt),fr=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"getDefault",value:function(){return!1}},{key:"set",value:function(e){if(e!==this.current||this.dirty){var t=this.gl;e?t.enable(t.CULL_FACE):t.disable(t.CULL_FACE),this.current=e,this.dirty=!1}}}]),r}(Jt),dr=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"getDefault",value:function(){return this.gl.BACK}},{key:"set",value:function(e){(e!==this.current||this.dirty)&&(this.gl.cullFace(e),this.current=e,this.dirty=!1)}}]),r}(Jt),mr=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"getDefault",value:function(){return this.gl.CCW}},{key:"set",value:function(e){(e!==this.current||this.dirty)&&(this.gl.frontFace(e),this.current=e,this.dirty=!1)}}]),r}(Jt),vr=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"getDefault",value:function(){return null}},{key:"set",value:function(e){(e!==this.current||this.dirty)&&(this.gl.useProgram(e),this.current=e,this.dirty=!1)}}]),r}(Jt),yr=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"getDefault",value:function(){return this.gl.TEXTURE0}},{key:"set",value:function(e){(e!==this.current||this.dirty)&&(this.gl.activeTexture(e),this.current=e,this.dirty=!1)}}]),r}(Jt),gr=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"getDefault",value:function(){var e=this.gl;return[0,0,e.drawingBufferWidth,e.drawingBufferHeight]}},{key:"set",value:function(e){var t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3]||this.dirty)&&(this.gl.viewport(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}]),r}(Jt),_r=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"getDefault",value:function(){return null}},{key:"set",value:function(e){if(e!==this.current||this.dirty){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,e),this.current=e,this.dirty=!1}}}]),r}(Jt),xr=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"getDefault",value:function(){return null}},{key:"set",value:function(e){if(e!==this.current||this.dirty){var t=this.gl;t.bindRenderbuffer(t.RENDERBUFFER,e),this.current=e,this.dirty=!1}}}]),r}(Jt),br=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"getDefault",value:function(){return null}},{key:"set",value:function(e){if(e!==this.current||this.dirty){var t=this.gl;t.bindTexture(t.TEXTURE_2D,e),this.current=e,this.dirty=!1}}}]),r}(Jt),wr=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"getDefault",value:function(){return null}},{key:"set",value:function(e){if(e!==this.current||this.dirty){var t=this.gl;t.bindBuffer(t.ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}}]),r}(Jt),kr=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"getDefault",value:function(){return null}},{key:"set",value:function(e){var t=this.gl;t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}]),r}(Jt),Er=function(e){A(r,e);var t=M(r);function r(e){var i;return j(this,r),(i=t.call(this,e)).vao=e.extVertexArrayObject,i}return q(r,[{key:"getDefault",value:function(){return null}},{key:"set",value:function(e){this.vao&&(e!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(e),this.current=e,this.dirty=!1)}}]),r}(Jt),Tr=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"getDefault",value:function(){return 4}},{key:"set",value:function(e){if(e!==this.current||this.dirty){var t=this.gl;t.pixelStorei(t.UNPACK_ALIGNMENT,e),this.current=e,this.dirty=!1}}}]),r}(Jt),Sr=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"getDefault",value:function(){return!1}},{key:"set",value:function(e){if(e!==this.current||this.dirty){var t=this.gl;t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e),this.current=e,this.dirty=!1}}}]),r}(Jt),Cr=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"getDefault",value:function(){return!1}},{key:"set",value:function(e){if(e!==this.current||this.dirty){var t=this.gl;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,e),this.current=e,this.dirty=!1}}}]),r}(Jt),Ir=function(e){A(r,e);var t=M(r);function r(e,i){var n;return j(this,r),(n=t.call(this,e)).context=e,n.parent=i,n}return q(r,[{key:"getDefault",value:function(){return null}}]),r}(Jt),zr=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"setDirty",value:function(){this.dirty=!0}},{key:"set",value:function(e){if(e!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var t=this.gl;t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,e,0),this.current=e,this.dirty=!1}}}]),r}(Ir),Ar=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"set",value:function(e){if(e!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var t=this.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,e),this.current=e,this.dirty=!1}}}]),r}(Ir),Mr=function(){function e(t,r,i,n){j(this,e),this.context=t,this.width=r,this.height=i;var a=t.gl,o=this.framebuffer=a.createFramebuffer();if(this.colorAttachment=new zr(t,o),n&&(this.depthAttachment=new Ar(t,o)),a.checkFramebufferStatus(a.FRAMEBUFFER)!==a.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer is not complete")}return q(e,[{key:"destroy",value:function(){var e=this.context.gl,t=this.colorAttachment.get();if(t&&e.deleteTexture(t),this.depthAttachment){var r=this.depthAttachment.get();r&&e.deleteRenderbuffer(r)}e.deleteFramebuffer(this.framebuffer)}}]),e}(),Pr=q((function e(t,r,i){j(this,e),this.blendFunction=t,this.blendColor=r,this.mask=i}));Pr.Replace=[1,0],Pr.disabled=new Pr(Pr.Replace,e.Color.transparent,[!1,!1,!1,!1]),Pr.unblended=new Pr(Pr.Replace,e.Color.transparent,[!0,!0,!0,!0]),Pr.alphaBlended=new Pr([1,771],e.Color.transparent,[!0,!0,!0,!0]);var Dr=function(){function e(t){j(this,e),this.gl=t,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new Yt(this),this.clearDepth=new Qt(this),this.clearStencil=new $t(this),this.colorMask=new er(this),this.depthMask=new tr(this),this.stencilMask=new rr(this),this.stencilFunc=new ir(this),this.stencilOp=new nr(this),this.stencilTest=new ar(this),this.depthRange=new or(this),this.depthTest=new sr(this),this.depthFunc=new lr(this),this.blend=new ur(this),this.blendFunc=new cr(this),this.blendColor=new hr(this),this.blendEquation=new pr(this),this.cullFace=new fr(this),this.cullFaceSide=new dr(this),this.frontFace=new mr(this),this.program=new vr(this),this.activeTexture=new yr(this),this.viewport=new gr(this),this.bindFramebuffer=new _r(this),this.bindRenderbuffer=new xr(this),this.bindTexture=new br(this),this.bindVertexBuffer=new wr(this),this.bindElementBuffer=new kr(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new Er(this),this.pixelStoreUnpack=new Tr(this),this.pixelStoreUnpackPremultiplyAlpha=new Sr(this),this.pixelStoreUnpackFlipY=new Cr(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.extRenderToTextureHalfFloat=t.getExtension("EXT_color_buffer_half_float")),this.extTimerQuery=t.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE)}return q(e,[{key:"setDefault",value: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()}},{key:"setDirty",value: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}},{key:"createIndexBuffer",value:function(e,t){return new Ht(this,e,t)}},{key:"createVertexBuffer",value:function(e,t,r){return new Kt(this,e,t,r)}},{key:"createRenderbuffer",value:function(e,t,r){var i=this.gl,n=i.createRenderbuffer();return this.bindRenderbuffer.set(n),i.renderbufferStorage(i.RENDERBUFFER,e,t,r),this.bindRenderbuffer.set(null),n}},{key:"createFramebuffer",value:function(e,t,r){return new Mr(this,e,t,r)}},{key:"clear",value:function(e){var t=e.color,r=e.depth,i=this.gl,n=0;t&&(n|=i.COLOR_BUFFER_BIT,this.clearColor.set(t),this.colorMask.set([!0,!0,!0,!0])),void 0!==r&&(n|=i.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(r),this.depthMask.set(!0)),i.clear(n)}},{key:"setCullFace",value:function(e){!1===e.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(e.mode),this.frontFace.set(e.frontFace))}},{key:"setDepthMode",value:function(e){e.func!==this.gl.ALWAYS||e.mask?(this.depthTest.set(!0),this.depthFunc.set(e.func),this.depthMask.set(e.mask),this.depthRange.set(e.range)):this.depthTest.set(!1)}},{key:"setStencilMode",value:function(e){e.test.func!==this.gl.ALWAYS||e.mask?(this.stencilTest.set(!0),this.stencilMask.set(e.mask),this.stencilOp.set([e.fail,e.depthFail,e.pass]),this.stencilFunc.set({func:e.test.func,ref:e.ref,mask:e.test.mask})):this.stencilTest.set(!1)}},{key:"setColorMode",value:function(e){n(e.blendFunction,Pr.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask)}},{key:"unbindVAO",value:function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)}}]),e}(),Lr=q((function e(t,r,i){j(this,e),this.func=t,this.mask=r,this.range=i}));Lr.ReadOnly=!1,Lr.ReadWrite=!0,Lr.disabled=new Lr(519,Lr.ReadOnly,[0,1]);var Rr=7680,Br=q((function e(t,r,i,n,a,o){j(this,e),this.test=t,this.ref=r,this.mask=i,this.fail=n,this.depthFail=a,this.pass=o}));Br.disabled=new Br({func:519,mask:0},0,0,Rr,Rr,Rr);var Fr,Or=q((function e(t,r,i){j(this,e),this.enable=t,this.mode=r,this.frontFace=i}));function Vr(t,r,i,n,a,o,s){for(var l=t.context,u=l.gl,c=t.useProgram("collisionBox"),h=[],p=0,f=0,d=0;d<n.length;d++){var m=n[d],v=r.getTile(m),y=v.getBucket(i);if(y){var g=m.posMatrix;0===a[0]&&0===a[1]||(g=t.translatePosMatrix(m.posMatrix,v,a,o));var _=s?y.textCollisionBox:y.iconCollisionBox,x=y.collisionCircleArray;if(x.length>0){var b=e.create(),w=g;e.mul(b,y.placementInvProjMatrix,t.transform.glCoordMatrix),e.mul(b,b,y.placementViewportMatrix),h.push({circleArray:x,circleOffset:f,transform:w,invTransform:b,coord:m}),f=p+=x.length/4}_&&c.draw(l,u.LINES,Lr.disabled,Br.disabled,t.colorModeForRenderPass(),Or.disabled,It(g,t.transform,v),t.style.terrain&&t.style.terrain.getTerrainData(m),i.id,_.layoutVertexBuffer,_.indexBuffer,_.segments,null,t.transform.zoom,null,null,_.collisionVertexBuffer)}}if(s&&h.length){var k=t.useProgram("collisionCircle"),E=new e.CollisionCircleLayoutArray;E.resize(4*p),E._trim();for(var T=0,S=0,C=h;S<C.length;S++)for(var I=C[S],z=0;z<I.circleArray.length/4;z++){var A=4*z,M=I.circleArray[A+0],P=I.circleArray[A+1],D=I.circleArray[A+2],L=I.circleArray[A+3];E.emplace(T++,M,P,D,L,0),E.emplace(T++,M,P,D,L,1),E.emplace(T++,M,P,D,L,2),E.emplace(T++,M,P,D,L,3)}(!Fr||Fr.length<2*p)&&(Fr=function(t){var r=2*t,i=new e.QuadTriangleArray;i.resize(r),i._trim();for(var n=0;n<r;n++){var a=6*n;i.uint16[a+0]=4*n+0,i.uint16[a+1]=4*n+1,i.uint16[a+2]=4*n+2,i.uint16[a+3]=4*n+2,i.uint16[a+4]=4*n+3,i.uint16[a+5]=4*n+0}return i}(p));for(var R,B=l.createIndexBuffer(Fr,!0),F=l.createVertexBuffer(E,e.collisionCircleLayout.members,!0),O=0,V=h;O<V.length;O++){var U=V[O],N={u_matrix:U.transform,u_inv_matrix:U.invTransform,u_camera_to_center_distance:(R=t.transform).cameraToCenterDistance,u_viewport_size:[R.width,R.height]};k.draw(l,u.TRIANGLES,Lr.disabled,Br.disabled,t.colorModeForRenderPass(),Or.disabled,N,t.style.terrain&&t.style.terrain.getTerrainData(U.coord),i.id,F,B,e.SegmentVector.simpleSegment(0,2*U.circleOffset,U.circleArray.length,U.circleArray.length/2),null,t.transform.zoom,null,null,null)}F.destroy(),B.destroy()}}Or.disabled=new Or(!1,1029,2305),Or.backCCW=new Or(!0,1029,2305);var Ur=e.identity(new Float32Array(16));function Nr(t,r,i,n,a,o){var s=e.getAnchorAlignment(t),l=-(s.horizontalAlign-.5)*r,u=-(s.verticalAlign-.5)*i,c=e.evaluateVariableOffset(t,n);return new e.pointGeometry((l/a+c[0])*o,(u/a+c[1])*o)}function jr(t,r,i,n,a,o,s,l,u,c,h){var p=t.text.placedSymbolArray,f=t.text.dynamicLayoutVertexArray,d=t.icon.dynamicLayoutVertexArray,m={};f.clear();for(var v=0;v<p.length;v++){var y=p.get(v),g=t.allowVerticalPlacement&&!y.placedOrientation,_=y.hidden||!y.crossTileID||g?null:n[y.crossTileID];if(_){var x=new e.pointGeometry(y.anchorX,y.anchorY),b=_e(x,i?s:o,h),w=xe(a.cameraToCenterDistance,b.signedDistanceFromCamera),k=e.evaluateSizeForFeature(t.textSizeData,u,y)*w/e.ONE_EM;i&&(k*=t.tilePixelRatio/l);for(var E=_.width,T=_.height,S=Nr(_.anchor,E,T,_.textOffset,_.textBoxScale,k),C=i?_e(x.add(S),o,h).point:b.point.add(r?S.rotate(-a.angle):S),I=t.allowVerticalPlacement&&y.placedOrientation===e.WritingMode.vertical?Math.PI/2:0,z=0;z<y.numGlyphs;z++)e.addDynamicAttributes(f,C,I);c&&y.associatedIconIndex>=0&&(m[y.associatedIconIndex]={shiftedAnchor:C,angle:I})}else ze(y.numGlyphs,f)}if(c){d.clear();for(var A=t.icon.placedSymbolArray,M=0;M<A.length;M++){var P=A.get(M);if(P.hidden)ze(P.numGlyphs,d);else{var D=m[M];if(D)for(var L=0;L<P.numGlyphs;L++)e.addDynamicAttributes(d,D.shiftedAnchor,D.angle);else ze(P.numGlyphs,d)}}t.icon.dynamicLayoutVertexBuffer.updateData(d)}t.text.dynamicLayoutVertexBuffer.updateData(f)}function Gr(e,t,r){return r.iconsInText&&t?"symbolTextAndIcon":e?"symbolSDF":"symbolIcon"}function qr(t,r,i,n,a,o,s,l,u,c,h,p){var f,d=t.context,m=d.gl,v=t.transform,y="map"===l,g="map"===u,_="viewport"!==l&&"point"!==i.layout.get("symbol-placement"),x=y&&!g&&!_,b=!i.layout.get("symbol-sort-key").isConstant(),w=!1,k=t.depthModeForSublayer(0,Lr.ReadOnly),E=i.layout.get("text-variable-anchor"),T=[],S=K(n);try{var C=function(){var n=f.value,l=r.getTile(n),u=l.getBucket(i);if(!u)return"continue";var h=a?u.text:u.icon;if(!h||!h.segments.get().length)return"continue";var p=h.programConfigurations.get(i.id),d=a||u.sdfIcons,k=a?u.textSizeData:u.iconSizeData,S=g||0!==v.pitch,C=t.useProgram(Gr(d,a,u),p),I=e.evaluateSizeForZoom(k,v.zoom),z=t.style.terrain&&t.style.terrain.getTerrainData(n),A=void 0,M=void 0,P=void 0,D=void 0,L=[0,0],R=null;if(a){if(M=l.glyphAtlasTexture,P=m.LINEAR,A=l.glyphAtlasTexture.size,u.iconsInText){L=l.imageAtlasTexture.size,R=l.imageAtlasTexture;var B="composite"===k.kind||"camera"===k.kind;D=S||t.options.rotating||t.options.zooming||B?m.LINEAR:m.NEAREST}}else{var F=1!==i.layout.get("icon-size").constantOr(0)||u.iconsNeedLinear;M=l.imageAtlasTexture,P=d||t.options.rotating||t.options.zooming||F||S?m.LINEAR:m.NEAREST,A=l.imageAtlasTexture.size}var O=De(l,1,t.transform.zoom),V=ye(n.posMatrix,g,y,t.transform,O),U=ge(n.posMatrix,g,y,t.transform,O),N=E&&u.hasTextData(),j="none"!==i.layout.get("icon-text-fit")&&N&&u.hasIconData();if(_){var G=t.style.terrain?function(e,r){return t.style.terrain.getElevation(n,e,r)}:null,q="map"===i.layout.get("text-rotation-alignment");we(u,n.posMatrix,t,a,V,U,g,c,q,G)}var Z=t.translatePosMatrix(n.posMatrix,l,o,s),X=_||a&&E||j?Ur:V,H=t.translatePosMatrix(U,l,o,s,!0),W=d&&0!==i.paint.get(a?"text-halo-width":"icon-halo-width").constantOr(1),J={program:C,buffers:h,uniformValues:d?u.iconsInText?Gt(k.kind,I,x,g,t,Z,X,H,A,L):jt(k.kind,I,x,g,t,Z,X,H,a,A,!0):Nt(k.kind,I,x,g,t,Z,X,H,a,A),atlasTexture:M,atlasTextureIcon:R,atlasInterpolation:P,atlasInterpolationIcon:D,isSDF:d,hasHalo:W};if(b&&u.canOverlap){w=!0;var Y,Q=K(h.segments.get());try{for(Q.s();!(Y=Q.n()).done;){var $=Y.value;T.push({segments:new e.SegmentVector([$]),sortKey:$.sortKey,state:J,terrainData:z})}}catch(ee){Q.e(ee)}finally{Q.f()}}else T.push({segments:h.segments,sortKey:0,state:J,terrainData:z})};for(S.s();!(f=S.n()).done;)C()}catch(D){S.e(D)}finally{S.f()}w&&T.sort((function(e,t){return e.sortKey-t.sortKey}));for(var I=0,z=T;I<z.length;I++){var A=z[I],M=A.state;if(d.activeTexture.set(m.TEXTURE0),M.atlasTexture.bind(M.atlasInterpolation,m.CLAMP_TO_EDGE),M.atlasTextureIcon&&(d.activeTexture.set(m.TEXTURE1),M.atlasTextureIcon&&M.atlasTextureIcon.bind(M.atlasInterpolationIcon,m.CLAMP_TO_EDGE)),M.isSDF){var P=M.uniformValues;M.hasHalo&&(P.u_is_halo=1,Zr(M.buffers,A.segments,i,t,M.program,k,h,p,P,A.terrainData)),P.u_is_halo=0}Zr(M.buffers,A.segments,i,t,M.program,k,h,p,M.uniformValues,A.terrainData)}}function Zr(e,t,r,i,n,a,o,s,l,u){var c=i.context;n.draw(c,c.gl.TRIANGLES,a,o,s,Or.disabled,l,u,r.id,e.layoutVertexBuffer,e.indexBuffer,t,r.paint,i.transform.zoom,e.programConfigurations.get(r.id),e.dynamicLayoutVertexBuffer,e.opacityVertexBuffer)}function Xr(e,t,r,i,n,a,o){var s,l,u,c,h,p=e.context.gl,f=r.paint.get("fill-pattern"),d=f&&f.constantOr(1),m=r.getCrossfadeParameters();o?(l=d&&!r.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",s=p.LINES):(l=d?"fillPattern":"fill",s=p.TRIANGLES);var v,y=K(i);try{for(y.s();!(v=y.n()).done;){var g=v.value,_=t.getTile(g);if(!d||_.patternsLoaded()){var x=_.getBucket(r);if(x){var b=x.programConfigurations.get(r.id),w=e.useProgram(l,b),k=e.style.terrain&&e.style.terrain.getTerrainData(g);d&&(e.context.activeTexture.set(p.TEXTURE0),_.imageAtlasTexture.bind(p.LINEAR,p.CLAMP_TO_EDGE),b.updatePaintBuffers(m));var E=f.constantOr(null);if(E&&_.imageAtlas){var T=_.imageAtlas,S=T.patternPositions[E.to.toString()],C=T.patternPositions[E.from.toString()];S&&C&&b.setConstantPatternPositions(S,C)}var I=k?g:null,z=e.translatePosMatrix(I?I.posMatrix:g.posMatrix,_,r.paint.get("fill-translate"),r.paint.get("fill-translate-anchor"));if(o){c=x.indexBuffer2,h=x.segments2;var A=[p.drawingBufferWidth,p.drawingBufferHeight];u="fillOutlinePattern"===l&&d?St(z,e,m,_,A):Tt(z,A)}else c=x.indexBuffer,h=x.segments,u=d?Et(z,e,m,_):kt(z);w.draw(e.context,s,n,e.stencilModeForClipping(g),a,Or.disabled,u,k,r.id,x.layoutVertexBuffer,c,h,r.paint,e.transform.zoom,b)}}}}catch(M){y.e(M)}finally{y.f()}}function Hr(e,t,r,i,n,a,o){var s,l=e.context,u=l.gl,c=r.paint.get("fill-extrusion-pattern"),h=c.constantOr(1),p=r.getCrossfadeParameters(),f=r.paint.get("fill-extrusion-opacity"),d=K(i);try{for(d.s();!(s=d.n()).done;){var m=s.value,v=t.getTile(m),y=v.getBucket(r);if(y){var g=e.style.terrain&&e.style.terrain.getTerrainData(m),_=y.programConfigurations.get(r.id),x=e.useProgram(h?"fillExtrusionPattern":"fillExtrusion",_);h&&(e.context.activeTexture.set(u.TEXTURE0),v.imageAtlasTexture.bind(u.LINEAR,u.CLAMP_TO_EDGE),_.updatePaintBuffers(p));var b=c.constantOr(null);if(b&&v.imageAtlas){var w=v.imageAtlas,k=w.patternPositions[b.to.toString()],E=w.patternPositions[b.from.toString()];k&&E&&_.setConstantPatternPositions(k,E)}var T=e.translatePosMatrix(m.posMatrix,v,r.paint.get("fill-extrusion-translate"),r.paint.get("fill-extrusion-translate-anchor")),S=r.paint.get("fill-extrusion-vertical-gradient"),C=h?wt(T,e,S,f,m,p,v):bt(T,e,S,f);x.draw(l,l.gl.TRIANGLES,n,a,o,Or.backCCW,C,g,r.id,y.layoutVertexBuffer,y.indexBuffer,y.segments,r.paint,e.transform.zoom,_,e.style.terrain&&y.centroidVertexBuffer)}}}catch(I){d.e(I)}finally{d.f()}}function Wr(e,t,r,i,n,a,o){var s=e.context,l=s.gl,u=r.fbo;if(u){var c=e.useProgram("hillshade"),h=e.style.terrain&&e.style.terrain.getTerrainData(t);s.activeTexture.set(l.TEXTURE0),l.bindTexture(l.TEXTURE_2D,u.colorAttachment.get()),c.draw(s,l.TRIANGLES,n,a,o,Or.disabled,function(e,t,r,i){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=!e.options.moving;return{u_matrix:i?i.posMatrix:e.transform.calculatePosMatrix(t.tileID.toUnwrapped(),l),u_image:0,u_latrange:Pt(0,t.tileID),u_light:[r.paint.get("hillshade-exaggeration"),s],u_shadow:n,u_highlight:a,u_accent:o}}(e,r,i,h?t:null),h,i.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments)}}function Kr(t,r,i,n,a,o){var s=t.context,u=s.gl,c=r.dem;if(c&&c.data){var h=c.dim,p=c.stride,f=c.getPixels();if(s.activeTexture.set(u.TEXTURE1),s.pixelStoreUnpackPremultiplyAlpha.set(!1),r.demTexture=r.demTexture||t.getTileTexture(p),r.demTexture){var d=r.demTexture;d.update(f,{premultiply:!1}),d.bind(u.NEAREST,u.CLAMP_TO_EDGE)}else r.demTexture=new l(s,f,u.RGBA,{premultiply:!1}),r.demTexture.bind(u.NEAREST,u.CLAMP_TO_EDGE);s.activeTexture.set(u.TEXTURE0);var m=r.fbo;if(!m){var v=new l(s,{width:h,height:h,data:null},u.RGBA);v.bind(u.LINEAR,u.CLAMP_TO_EDGE),(m=r.fbo=s.createFramebuffer(h,h,!0)).colorAttachment.set(v.texture)}s.bindFramebuffer.set(m.framebuffer),s.viewport.set([0,0,h,h]),t.useProgram("hillshadePrepare").draw(s,u.TRIANGLES,n,a,o,Or.disabled,function(t,r){var i=r.stride,n=e.create();return e.ortho(n,0,e.EXTENT,-e.EXTENT,0,0,1),e.translate(n,n,[0,-e.EXTENT,0]),{u_matrix:n,u_image:1,u_dimension:[i,i],u_zoom:t.overscaledZ,u_unpack:r.getUnpackVector()}}(r.tileID,c),null,i.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments),r.needsHillshadePrepare=!1}}function Jr(t,r,i,n,a,o){var s=n.paint.get("raster-fade-duration");if(!o&&s>0){var l=e.exported.now(),u=(l-t.timeAdded)/s,c=r?(l-r.timeAdded)/s:-1,h=i.getSource(),p=a.coveringZoomLevel({tileSize:h.tileSize,roundZoom:h.roundZoom}),f=!r||Math.abs(r.tileID.overscaledZ-p)>Math.abs(t.tileID.overscaledZ-p),d=f&&t.refreshedUponExpiration?1:e.clamp(f?u:1-c,0,1);return t.refreshedUponExpiration&&u>=1&&(t.refreshedUponExpiration=!1),r?{opacity:1,mix:1-d}:{opacity:d,mix:0}}return{opacity:1,mix:0}}var Yr=new e.Color(1,0,0,1),Qr=new e.Color(0,1,0,1),$r=new e.Color(0,0,1,1),ei=new e.Color(1,0,1,1),ti=new e.Color(0,1,1,1);function ri(e,t,r,i){ni(e,0,t+r/2,e.transform.width,r,i)}function ii(e,t,r,i){ni(e,t-r/2,0,r,e.transform.height,i)}function ni(e,t,r,i,n,a){var o=e.context,s=o.gl;s.enable(s.SCISSOR_TEST),s.scissor(t*e.pixelRatio,r*e.pixelRatio,i*e.pixelRatio,n*e.pixelRatio),o.clear({color:a}),s.disable(s.SCISSOR_TEST)}function ai(t,r,i){var n=t.context,a=n.gl,o=i.posMatrix,s=t.useProgram("debug"),l=Lr.disabled,u=Br.disabled,c=t.colorModeForRenderPass(),h="$debug",p=t.style.terrain&&t.style.terrain.getTerrainData(i);n.activeTexture.set(a.TEXTURE0),t.emptyTexture.bind(a.LINEAR,a.CLAMP_TO_EDGE);var f=r.getTileByID(i.key).latestRawTileData,d=Math.floor((f&&f.byteLength||0)/1024),m=r.getTile(i).tileSize,v=512/Math.min(m,512)*(i.overscaledZ/t.transform.zoom)*.5,y=i.canonical.toString();i.overscaledZ!==i.canonical.z&&(y+=" => ".concat(i.overscaledZ)),function(e,t){e.initDebugOverlayCanvas();var r=e.debugOverlayCanvas,i=e.context.gl,n=e.debugOverlayCanvas.getContext("2d");n.clearRect(0,0,r.width,r.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(t,5,5),n.strokeText(t,5,5),e.debugOverlayTexture.update(r),e.debugOverlayTexture.bind(i.LINEAR,i.CLAMP_TO_EDGE)}(t,"".concat(y," ").concat(d,"kB")),s.draw(n,a.TRIANGLES,l,u,Pr.alphaBlended,Or.disabled,zt(o,e.Color.transparent,v),null,h,t.debugBuffer,t.quadTriangleIndexBuffer,t.debugSegments),s.draw(n,a.LINE_STRIP,l,u,c,Or.disabled,zt(o,e.Color.red),p,h,t.debugBuffer,t.tileBorderIndexBuffer,t.debugSegments)}function oi(e,t,r){var i=e.context,n=i.gl,a=e.colorModeForRenderPass(),o=new Lr(n.LEQUAL,Lr.ReadWrite,e.depthRangeFor3D),s=e.useProgram("terrain"),l=t.getTerrainMesh(),u=t.getTerrainData(r.tileID);i.bindFramebuffer.set(null),i.viewport.set([0,0,e.width,e.height]),i.activeTexture.set(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,t.getRTTFramebuffer().colorAttachment.get());var c=e.transform.calculatePosMatrix(r.tileID.toUnwrapped());s.draw(i,n.TRIANGLES,o,Br.disabled,a,Or.backCCW,{u_matrix:c,u_texture:0},u,"terrain",l.vertexBuffer,l.indexBuffer,l.segments)}function si(e,t,r,i){var n=e.context,a=r.tileSize*t.qualityFactor;r.textures[i]||(r.textures[i]=e.getTileTexture(a)||new l(n,{width:a,height:a,data:null},n.gl.RGBA),r.textures[i].bind(n.gl.LINEAR,n.gl.CLAMP_TO_EDGE),0===i&&t.sourceCache.renderHistory.unshift(r.tileID.key));var o=t.getRTTFramebuffer();o.colorAttachment.set(r.textures[i].texture),n.bindFramebuffer.set(o.framebuffer),n.viewport.set([0,0,a,a])}var li=function(){function t(e){j(this,t),this._coordsDescendingInv={},this._coordsDescendingInvStr={},this.painter=e,this._renderToTexture={background:!0,fill:!0,line:!0,raster:!0},this._coordsDescendingInv={},this._coordsDescendingInvStr={},this._stacks=[],this._prevType=null,this._rerender={},this._renderableTiles=e.style.terrain.sourceCache.getRenderableTiles(),this._init()}return q(t,[{key:"_init",value:function(){var e=this,t=this.painter.style,r=t.terrain;for(var i in t.sourceCaches){this._coordsDescendingInv[i]={};var n,a=K(t.sourceCaches[i].getVisibleCoordinates());try{for(a.s();!(n=a.n()).done;){var o=n.value,s=r.sourceCache.getTerrainCoords(o);for(var l in s)this._coordsDescendingInv[i][l]||(this._coordsDescendingInv[i][l]=[]),this._coordsDescendingInv[i][l].push(s[l])}}catch(m){a.e(m)}finally{a.f()}}var u,c=K(t._order);try{for(c.s();!(u=c.n()).done;){var h=u.value,p=t._layers[h],f=p.source;if(this._renderToTexture[p.type]&&!this._coordsDescendingInvStr[f])for(var d in this._coordsDescendingInvStr[f]={},this._coordsDescendingInv[f])this._coordsDescendingInvStr[f][d]=this._coordsDescendingInv[f][d].map((function(e){return e.key})).sort().join()}}catch(m){c.e(m)}finally{c.f()}return this._renderableTiles.forEach((function(t){for(var i in e._coordsDescendingInvStr){var n=e._coordsDescendingInvStr[i][t.tileID.key];n&&n!==t.textureCoords[i]&&t.clearTextures(e.painter),r.needsRerender(i,t.tileID)&&t.clearTextures(e.painter)}e._rerender[t.tileID.key]=!t.textures.length})),r.clearRerenderCache(),r.sourceCache.removeOutdated(this.painter),this}},{key:"renderLayer",value:function(t){var r=t.type,i=this.painter,n=i.style._order,a=i.currentLayer,o=a+1===n.length;if(this._renderToTexture[r]&&(this._prevType&&this._renderToTexture[this._prevType]||this._stacks.push([]),this._prevType=r,this._stacks[this._stacks.length-1].push(n[a]),!o))return!0;if(this._renderToTexture[this._prevType]||"hillshade"===r||this._renderToTexture[r]&&o){this._prevType=r;var s,l=this._stacks.length-1,u=this._stacks[l]||[],c=K(this._renderableTiles);try{for(c.s();!(s=c.n()).done;){var h=s.value;if(si(i,i.style.terrain,h,l),this._rerender[h.tileID.key]){i.context.clear({color:e.Color.transparent});for(var p=0;p<u.length;p++){var f=i.style._layers[u[p]],d=f.source?this._coordsDescendingInv[f.source][h.tileID.key]:[h.tileID];i._renderTileClippingMasks(f,d),i.renderLayer(i,i.style.sourceCaches[f.source],f,d),f.source&&(h.textureCoords[f.source]=this._coordsDescendingInvStr[f.source][h.tileID.key])}}oi(i,i.style.terrain,h)}}catch(_){c.e(_)}finally{c.f()}if("hillshade"===r){this._stacks.push([n[a]]);var m,v=K(this._renderableTiles);try{for(v.s();!(m=v.n()).done;){var y=m.value,g=this._coordsDescendingInv[t.source][y.tileID.key];si(i,i.style.terrain,y,this._stacks.length-1),i.context.clear({color:e.Color.transparent}),i._renderTileClippingMasks(t,g),i.renderLayer(i,i.style.sourceCaches[t.source],t,g),oi(i,i.style.terrain,y)}}catch(_){v.e(_)}finally{v.f()}return!0}return this._renderToTexture[r]}return!1}}]),t}(),ui={symbol:function(t,r,i,n,a){if("translucent"===t.renderPass){var o=Br.disabled,s=t.colorModeForRenderPass();i.layout.get("text-variable-anchor")&&function(t,r,i,n,a,o,s){var l,u=r.transform,c="map"===a,h="map"===o,p=K(t);try{var f=function(){var t=l.value,a=n.getTile(t),o=a.getBucket(i);if(!o||!o.text||!o.text.segments.get().length)return"continue";var p=e.evaluateSizeForZoom(o.textSizeData,u.zoom),f=De(a,1,r.transform.zoom),d=ye(t.posMatrix,h,c,r.transform,f),m="none"!==i.layout.get("icon-text-fit")&&o.hasIconData();if(p){var v=Math.pow(2,u.zoom-a.tileID.overscaledZ);jr(o,c,h,s,u,d,t.posMatrix,v,p,m,r.style.terrain?function(e,i){return r.style.terrain.getElevation(t,e,i)}:null)}};for(p.s();!(l=p.n()).done;)f()}catch(d){p.e(d)}finally{p.f()}}(n,t,i,r,i.layout.get("text-rotation-alignment"),i.layout.get("text-pitch-alignment"),a),0!==i.paint.get("icon-opacity").constantOr(1)&&qr(t,r,i,n,!1,i.paint.get("icon-translate"),i.paint.get("icon-translate-anchor"),i.layout.get("icon-rotation-alignment"),i.layout.get("icon-pitch-alignment"),i.layout.get("icon-keep-upright"),o,s),0!==i.paint.get("text-opacity").constantOr(1)&&qr(t,r,i,n,!0,i.paint.get("text-translate"),i.paint.get("text-translate-anchor"),i.layout.get("text-rotation-alignment"),i.layout.get("text-pitch-alignment"),i.layout.get("text-keep-upright"),o,s),r.map.showCollisionBoxes&&(Vr(t,r,i,n,i.paint.get("text-translate"),i.paint.get("text-translate-anchor"),!0),Vr(t,r,i,n,i.paint.get("icon-translate"),i.paint.get("icon-translate-anchor"),!1))}},circle:function(t,r,i,n){if("translucent"===t.renderPass){var a=i.paint.get("circle-opacity"),o=i.paint.get("circle-stroke-width"),s=i.paint.get("circle-stroke-opacity"),l=!i.layout.get("circle-sort-key").isConstant();if(0!==a.constantOr(1)||0!==o.constantOr(1)&&0!==s.constantOr(1)){for(var u=t.context,c=u.gl,h=t.depthModeForSublayer(0,Lr.ReadOnly),p=Br.disabled,f=t.colorModeForRenderPass(),d=[],m=0;m<n.length;m++){var v=n[m],y=r.getTile(v),g=y.getBucket(i);if(g){var _=g.programConfigurations.get(i.id),x=t.useProgram("circle",_),b=g.layoutVertexBuffer,w=g.indexBuffer,k=t.style.terrain&&t.style.terrain.getTerrainData(v),E={programConfiguration:_,program:x,layoutVertexBuffer:b,indexBuffer:w,uniformValues:Ct(t,v,y,i),terrainData:k};if(l){var T,S=K(g.segments.get());try{for(S.s();!(T=S.n()).done;){var C=T.value;d.push({segments:new e.SegmentVector([C]),sortKey:C.sortKey,state:E})}}catch(O){S.e(O)}finally{S.f()}}else d.push({segments:g.segments,sortKey:0,state:E})}}l&&d.sort((function(e,t){return e.sortKey-t.sortKey}));for(var I=0,z=d;I<z.length;I++){var A=z[I],M=A.state,P=M.programConfiguration,D=M.program,L=M.layoutVertexBuffer,R=M.indexBuffer,B=M.uniformValues,F=M.terrainData;D.draw(u,c.TRIANGLES,h,p,f,Or.disabled,B,F,i.id,L,R,A.segments,i.paint,t.transform.zoom,P)}}}},heatmap:function(t,r,i,n){if(0!==i.paint.get("heatmap-opacity"))if("offscreen"===t.renderPass){var a=t.context,o=a.gl,s=Br.disabled,u=new Pr([o.ONE,o.ONE],e.Color.transparent,[!0,!0,!0,!0]);!function(e,t,r){var i=e.gl;e.activeTexture.set(i.TEXTURE1),e.viewport.set([0,0,t.width/4,t.height/4]);var n=r.heatmapFbo;if(n)i.bindTexture(i.TEXTURE_2D,n.colorAttachment.get()),e.bindFramebuffer.set(n.framebuffer);else{var a=i.createTexture();i.bindTexture(i.TEXTURE_2D,a),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),n=r.heatmapFbo=e.createFramebuffer(t.width/4,t.height/4,!1),function(e,t,r,i){var n=e.gl;n.texImage2D(n.TEXTURE_2D,0,n.RGBA,t.width/4,t.height/4,0,n.RGBA,e.extRenderToTextureHalfFloat?e.extTextureHalfFloat.HALF_FLOAT_OES:n.UNSIGNED_BYTE,null),i.colorAttachment.set(r)}(e,t,a,n)}}(a,t,i),a.clear({color:e.Color.transparent});for(var c=0;c<n.length;c++){var h=n[c];if(!r.hasRenderableParent(h)){var p=r.getTile(h),f=p.getBucket(i);if(f){var d=f.programConfigurations.get(i.id),m=t.useProgram("heatmap",d),v=t.transform.zoom;m.draw(a,o.TRIANGLES,Lr.disabled,s,u,Or.disabled,Mt(h.posMatrix,p,v,i.paint.get("heatmap-intensity")),null,i.id,f.layoutVertexBuffer,f.indexBuffer,f.segments,i.paint,t.transform.zoom,d)}}}a.viewport.set([0,0,t.width,t.height])}else"translucent"===t.renderPass&&(t.context.setColorMode(t.colorModeForRenderPass()),function(t,r){var i=t.context,n=i.gl,a=r.heatmapFbo;if(a){i.activeTexture.set(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,a.colorAttachment.get()),i.activeTexture.set(n.TEXTURE1);var o=r.colorRampTexture;o||(o=r.colorRampTexture=new l(i,r.colorRamp,n.RGBA)),o.bind(n.LINEAR,n.CLAMP_TO_EDGE),t.useProgram("heatmapTexture").draw(i,n.TRIANGLES,Lr.disabled,Br.disabled,t.colorModeForRenderPass(),Or.disabled,function(t,r,i,n){var a=e.create();e.ortho(a,0,t.width,t.height,0,0,1);var o=t.context.gl;return{u_matrix:a,u_world:[o.drawingBufferWidth,o.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:r.paint.get("heatmap-opacity")}}(t,r),null,r.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments,r.paint,t.transform.zoom)}}(t,i))},line:function(t,r,i,n){if("translucent"===t.renderPass){var a=i.paint.get("line-opacity"),o=i.paint.get("line-width");if(0!==a.constantOr(1)&&0!==o.constantOr(1)){var s,u=t.depthModeForSublayer(0,Lr.ReadOnly),c=t.colorModeForRenderPass(),h=i.paint.get("line-dasharray"),p=i.paint.get("line-pattern"),f=p.constantOr(1),d=i.paint.get("line-gradient"),m=i.getCrossfadeParameters(),v=f?"linePattern":h?"lineSDF":d?"lineGradient":"line",y=t.context,g=y.gl,_=!0,x=K(n);try{for(x.s();!(s=x.n()).done;){var b=s.value,w=r.getTile(b);if(!f||w.patternsLoaded()){var k=w.getBucket(i);if(k){var E=k.programConfigurations.get(i.id),T=t.context.program.get(),S=t.useProgram(v,E),C=_||S.program!==T,I=t.style.terrain&&t.style.terrain.getTerrainData(b),z=p.constantOr(null);if(z&&w.imageAtlas){var A=w.imageAtlas,M=A.patternPositions[z.to.toString()],P=A.patternPositions[z.from.toString()];M&&P&&E.setConstantPatternPositions(M,P)}var D=I?b:null,L=f?Rt(t,w,i,m,D):h?Bt(t,w,i,h,m,D):d?Lt(t,w,i,k.lineClipsArray.length,D):Dt(t,w,i,D);if(f)y.activeTexture.set(g.TEXTURE0),w.imageAtlasTexture.bind(g.LINEAR,g.CLAMP_TO_EDGE),E.updatePaintBuffers(m);else if(h&&(C||t.lineAtlas.dirty))y.activeTexture.set(g.TEXTURE0),t.lineAtlas.bind(y);else if(d){var R=k.gradients[i.id],B=R.texture;if(i.gradientVersion!==R.version){var F=256;if(i.stepInterpolant){var O=r.getSource().maxzoom,V=b.canonical.z===O?Math.ceil(1<<t.transform.maxZoom-b.canonical.z):1;F=e.clamp(e.nextPowerOfTwo(k.maxLineLength/e.EXTENT*1024*V),256,y.maxTextureSize)}R.gradient=e.renderColorRamp({expression:i.gradientExpression(),evaluationKey:"lineProgress",resolution:F,image:R.gradient||void 0,clips:k.lineClipsArray}),R.texture?R.texture.update(R.gradient):R.texture=new l(y,R.gradient,g.RGBA),R.version=i.gradientVersion,B=R.texture}y.activeTexture.set(g.TEXTURE0),B.bind(i.stepInterpolant?g.NEAREST:g.LINEAR,g.CLAMP_TO_EDGE)}S.draw(y,g.TRIANGLES,u,t.stencilModeForClipping(b),c,Or.disabled,L,I,i.id,k.layoutVertexBuffer,k.indexBuffer,k.segments,i.paint,t.transform.zoom,E,k.layoutVertexBuffer2),_=!1}}}}catch(U){x.e(U)}finally{x.f()}}}},fill:function(t,r,i,n){var a=i.paint.get("fill-color"),o=i.paint.get("fill-opacity");if(0!==o.constantOr(1)){var s=t.colorModeForRenderPass(),l=i.paint.get("fill-pattern"),u=t.opaquePassEnabledForLayer()&&!l.constantOr(1)&&1===a.constantOr(e.Color.transparent).a&&1===o.constantOr(0)?"opaque":"translucent";if(t.renderPass===u){var c=t.depthModeForSublayer(1,"opaque"===t.renderPass?Lr.ReadWrite:Lr.ReadOnly);Xr(t,r,i,n,c,s,!1)}if("translucent"===t.renderPass&&i.paint.get("fill-antialias")){var h=t.depthModeForSublayer(i.getPaintProperty("fill-outline-color")?2:0,Lr.ReadOnly);Xr(t,r,i,n,h,s,!0)}}},"fill-extrusion":function(e,t,r,i){var n=r.paint.get("fill-extrusion-opacity");if(0!==n&&"translucent"===e.renderPass){var a=new Lr(e.context.gl.LEQUAL,Lr.ReadWrite,e.depthRangeFor3D);if(1!==n||r.paint.get("fill-extrusion-pattern").constantOr(1))Hr(e,t,r,i,a,Br.disabled,Pr.disabled),Hr(e,t,r,i,a,e.stencilModeFor3D(),e.colorModeForRenderPass());else{var o=e.colorModeForRenderPass();Hr(e,t,r,i,a,Br.disabled,o)}}},hillshade:function(e,t,r,i){if("offscreen"===e.renderPass||"translucent"===e.renderPass){var n,a=e.context,o=e.depthModeForSublayer(0,Lr.ReadOnly),s=e.colorModeForRenderPass(),l=V("translucent"===e.renderPass?e.stencilConfigForOverlap(i):[{},i],2),u=l[0],c=K(l[1]);try{for(c.s();!(n=c.n()).done;){var h=n.value,p=t.getTile(h);void 0!==p.needsHillshadePrepare&&p.needsHillshadePrepare&&"offscreen"===e.renderPass?Kr(e,p,r,o,Br.disabled,s):"translucent"===e.renderPass&&Wr(e,h,p,r,o,u[h.overscaledZ],s)}}catch(f){c.e(f)}finally{c.f()}a.viewport.set([0,0,e.width,e.height])}},raster:function(e,t,r,i){if("translucent"===e.renderPass&&0!==r.paint.get("raster-opacity")&&i.length){var n,a=e.context,o=a.gl,s=t.getSource(),l=e.useProgram("raster"),u=e.colorModeForRenderPass(),c=V(s instanceof z?[{},i]:e.stencilConfigForOverlap(i),2),h=c[0],p=c[1],f=p[p.length-1].overscaledZ,d=!e.options.moving,m=K(p);try{for(m.s();!(n=m.n()).done;){var v=n.value,y=e.depthModeForSublayer(v.overscaledZ-f,1===r.paint.get("raster-opacity")?Lr.ReadWrite:Lr.ReadOnly,o.LESS),g=t.getTile(v);g.registerFadeDuration(r.paint.get("raster-fade-duration"));var _=t.findLoadedParent(v,0),x=Jr(g,_,t,r,e.transform,e.style.terrain),b=void 0,w=void 0,k="nearest"===r.paint.get("raster-resampling")?o.NEAREST:o.LINEAR;a.activeTexture.set(o.TEXTURE0),g.texture.bind(k,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST),a.activeTexture.set(o.TEXTURE1),_?(_.texture.bind(k,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST),b=Math.pow(2,_.tileID.overscaledZ-g.tileID.overscaledZ),w=[g.tileID.canonical.x*b%1,g.tileID.canonical.y*b%1]):g.texture.bind(k,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST);var E=e.style.terrain&&e.style.terrain.getTerrainData(v),T=E?v:null,S=T?T.posMatrix:e.transform.calculatePosMatrix(v.toUnwrapped(),d),C=Vt(S,w||[0,0],b||1,x,r);s instanceof z?l.draw(a,o.TRIANGLES,y,Br.disabled,u,Or.disabled,C,E,r.id,s.boundsBuffer,e.quadTriangleIndexBuffer,s.boundsSegments):l.draw(a,o.TRIANGLES,y,h[v.overscaledZ],u,Or.disabled,C,E,r.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments)}}catch(I){m.e(I)}finally{m.f()}}},background:function(e,t,r,i){var n=r.paint.get("background-color"),a=r.paint.get("background-opacity");if(0!==a){var o=e.context,s=o.gl,l=e.transform,u=l.tileSize,c=r.paint.get("background-pattern");if(!e.isPatternMissing(c)){var h=!c&&1===n.a&&1===a&&e.opaquePassEnabledForLayer()?"opaque":"translucent";if(e.renderPass===h){var p=Br.disabled,f=e.depthModeForSublayer(0,"opaque"===h?Lr.ReadWrite:Lr.ReadOnly),d=e.colorModeForRenderPass(),m=e.useProgram(c?"backgroundPattern":"background"),v=i||l.coveringTiles({tileSize:u,terrain:e.style.terrain});c&&(o.activeTexture.set(s.TEXTURE0),e.imageManager.bind(e.context));var y,g=r.getCrossfadeParameters(),_=K(v);try{for(_.s();!(y=_.n()).done;){var x=y.value,b=i?x.posMatrix:e.transform.calculatePosMatrix(x.toUnwrapped()),w=c?Zt(b,a,e,c,{tileID:x,tileSize:u},g):qt(b,a,n),k=e.style.terrain&&e.style.terrain.getTerrainData(x);m.draw(o,s.TRIANGLES,f,p,d,Or.disabled,w,k,r.id,e.tileExtentBuffer,e.quadTriangleIndexBuffer,e.tileExtentSegments)}}catch(E){_.e(E)}finally{_.f()}}}}},debug:function(e,t,r){for(var i=0;i<r.length;i++)ai(e,t,r[i])},custom:function(e,t,r){var i=e.context,n=r.implementation;if("offscreen"===e.renderPass){var a=n.prerender;a&&(e.setCustomLayerDefaults(),i.setColorMode(e.colorModeForRenderPass()),a.call(n,i.gl,e.transform.customLayerMatrix()),i.setDirty(),e.setBaseState())}else if("translucent"===e.renderPass){e.setCustomLayerDefaults(),i.setColorMode(e.colorModeForRenderPass()),i.setStencilMode(Br.disabled);var o="3d"===n.renderingMode?new Lr(e.context.gl.LEQUAL,Lr.ReadWrite,e.depthRangeFor3D):e.depthModeForSublayer(0,Lr.ReadOnly);i.setDepthMode(o),n.render(i.gl,e.transform.customLayerMatrix()),i.setDirty(),e.setBaseState(),i.bindFramebuffer.set(null)}}},ci=function(){function t(r,i){j(this,t),this.context=new Dr(r),this.transform=i,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:e.create(),renderTime:0},this.setup(),this.numSublayers=J.maxUnderzooming+J.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new at,this.gpuTimers={}}return q(t,[{key:"resize",value:function(e,t,r){if(this.width=e*r,this.height=t*r,this.pixelRatio=r,this.context.viewport.set([0,0,this.width,this.height]),this.style){var i,n=K(this.style._order);try{for(n.s();!(i=n.n()).done;){var a=i.value;this.style._layers[a].resize()}}catch(o){n.e(o)}finally{n.f()}}}},{key:"setup",value:function(){var t=this.context,r=new e.PosArray;r.emplaceBack(0,0),r.emplaceBack(e.EXTENT,0),r.emplaceBack(0,e.EXTENT),r.emplaceBack(e.EXTENT,e.EXTENT),this.tileExtentBuffer=t.createVertexBuffer(r,ot.members),this.tileExtentSegments=e.SegmentVector.simpleSegment(0,0,4,2);var i=new e.PosArray;i.emplaceBack(0,0),i.emplaceBack(e.EXTENT,0),i.emplaceBack(0,e.EXTENT),i.emplaceBack(e.EXTENT,e.EXTENT),this.debugBuffer=t.createVertexBuffer(i,ot.members),this.debugSegments=e.SegmentVector.simpleSegment(0,0,4,5);var n=new e.RasterBoundsArray;n.emplaceBack(0,0,0,0),n.emplaceBack(e.EXTENT,0,e.EXTENT,0),n.emplaceBack(0,e.EXTENT,0,e.EXTENT),n.emplaceBack(e.EXTENT,e.EXTENT,e.EXTENT,e.EXTENT),this.rasterBoundsBuffer=t.createVertexBuffer(n,I.members),this.rasterBoundsSegments=e.SegmentVector.simpleSegment(0,0,4,2);var a=new e.PosArray;a.emplaceBack(0,0),a.emplaceBack(1,0),a.emplaceBack(0,1),a.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(a,ot.members),this.viewportSegments=e.SegmentVector.simpleSegment(0,0,4,2);var o=new e.LineStripIndexArray;o.emplaceBack(0),o.emplaceBack(1),o.emplaceBack(3),o.emplaceBack(2),o.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(o);var s=new e.TriangleIndexArray;s.emplaceBack(0,1,2),s.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(s),this.emptyTexture=new l(t,{width:1,height:1,data:new Uint8Array([0,0,0,0])},t.gl.RGBA);var u=this.context.gl;this.stencilClearMode=new Br({func:u.ALWAYS,mask:0},0,255,u.ZERO,u.ZERO,u.ZERO)}},{key:"clearStencil",value:function(){var t=this.context,r=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var i=e.create();e.ortho(i,0,this.width,this.height,0,0,1),e.scale(i,i,[r.drawingBufferWidth,r.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(t,r.TRIANGLES,Lr.disabled,this.stencilClearMode,Pr.disabled,Or.disabled,At(i),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}},{key:"_renderTileClippingMasks",value:function(e,t){if(this.currentStencilSource!==e.source&&e.isTileClipped()&&t&&t.length){this.currentStencilSource=e.source;var r=this.context,i=r.gl;this.nextStencilID+t.length>256&&this.clearStencil(),r.setColorMode(Pr.disabled),r.setDepthMode(Lr.disabled);var n=this.useProgram("clippingMask");this._tileClippingMaskIDs={};var a,o=K(t);try{for(o.s();!(a=o.n()).done;){var s=a.value,l=this._tileClippingMaskIDs[s.key]=this.nextStencilID++,u=this.style.terrain&&this.style.terrain.getTerrainData(s);n.draw(r,i.TRIANGLES,Lr.disabled,new Br({func:i.ALWAYS,mask:0},l,255,i.KEEP,i.KEEP,i.REPLACE),Pr.disabled,Or.disabled,At(s.posMatrix),u,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}catch(c){o.e(c)}finally{o.f()}}}},{key:"stencilModeFor3D",value:function(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();var e=this.nextStencilID++,t=this.context.gl;return new Br({func:t.NOTEQUAL,mask:255},e,255,t.KEEP,t.KEEP,t.REPLACE)}},{key:"stencilModeForClipping",value:function(e){var t=this.context.gl;return new Br({func:t.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,t.KEEP,t.KEEP,t.REPLACE)}},{key:"stencilConfigForOverlap",value:function(e){var t=this.context.gl,r=e.sort((function(e,t){return t.overscaledZ-e.overscaledZ})),i=r[r.length-1].overscaledZ,n=r[0].overscaledZ-i+1;if(n>1){this.currentStencilSource=void 0,this.nextStencilID+n>256&&this.clearStencil();for(var a={},o=0;o<n;o++)a[o+i]=new Br({func:t.GEQUAL,mask:255},o+this.nextStencilID,255,t.KEEP,t.KEEP,t.REPLACE);return this.nextStencilID+=n,[a,r]}return[W({},i,Br.disabled),r]}},{key:"colorModeForRenderPass",value:function(){var t=this.context.gl;if(this._showOverdrawInspector){var r=1/8;return new Pr([t.CONSTANT_COLOR,t.ONE],new e.Color(r,r,r,0),[!0,!0,!0,!0])}return"opaque"===this.renderPass?Pr.unblended:Pr.alphaBlended}},{key:"depthModeForSublayer",value:function(e,t,r){if(!this.opaquePassEnabledForLayer())return Lr.disabled;var i=1-((1+this.currentLayer)*this.numSublayers+e)*this.depthEpsilon;return new Lr(r||this.context.gl.LEQUAL,t,[i,i])}},{key:"opaquePassEnabledForLayer",value:function(){return this.currentLayer<this.opaquePassCutoff}},{key:"render",value:function(t,r){var i=this;this.style=t,this.options=r,this.lineAtlas=t.lineAtlas,this.imageManager=t.imageManager,this.glyphManager=t.glyphManager,this.symbolFadeChange=t.placement.symbolFadeChange(e.exported.now()),this.imageManager.beginFrame();var n=this.style._order,a=this.style.sourceCaches,o=this.style.terrain&&new li(this);for(var s in a){var l=a[s];l.used&&l.prepare(this.context)}var u={},c={},h={};for(var p in a){var f=a[p];u[p]=f.getVisibleCoordinates(),c[p]=u[p].slice().reverse(),h[p]=f.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(var d=0;d<n.length;d++)if(this.style._layers[n[d]].is3D()){this.opaquePassCutoff=d;break}if(o){this.opaquePassCutoff=0;var m=this.style.terrain.sourceCache.tilesAfterTime(this.terrainFacilitator.renderTime);(this.terrainFacilitator.dirty||!e.equals(this.terrainFacilitator.matrix,this.transform.projMatrix)||m.length)&&(e.copy(this.terrainFacilitator.matrix,this.transform.projMatrix),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(t,r){var i=t.context,n=i.gl,a=Pr.unblended,o=new Lr(n.LEQUAL,Lr.ReadWrite,[0,1]),s=r.getTerrainMesh(),l=r.sourceCache.getRenderableTiles(),u=t.useProgram("terrainDepth");i.bindFramebuffer.set(r.getFramebuffer("depth").framebuffer),i.viewport.set([0,0,t.width/devicePixelRatio,t.height/devicePixelRatio]),i.clear({color:e.Color.transparent,depth:1});var c,h=K(l);try{for(h.s();!(c=h.n()).done;){var p=c.value,f=r.getTerrainData(p.tileID),d=t.transform.calculatePosMatrix(p.tileID.toUnwrapped());u.draw(i,n.TRIANGLES,o,Br.disabled,a,Or.backCCW,{u_matrix:d},f,"terrain",s.vertexBuffer,s.indexBuffer,s.segments)}}catch(m){h.e(m)}finally{h.f()}i.bindFramebuffer.set(null),i.viewport.set([0,0,t.width,t.height])}(this,this.style.terrain),function(t,r){var i=t.context,n=i.gl,a=Pr.unblended,o=new Lr(n.LEQUAL,Lr.ReadWrite,[0,1]),s=r.getTerrainMesh(),l=r.getCoordsTexture(),u=r.sourceCache.getRenderableTiles(),c=t.useProgram("terrainCoords");i.bindFramebuffer.set(r.getFramebuffer("coords").framebuffer),i.viewport.set([0,0,t.width/devicePixelRatio,t.height/devicePixelRatio]),i.clear({color:e.Color.transparent,depth:1}),r.coordsIndex=[];var h,p=K(u);try{for(p.s();!(h=p.n()).done;){var f=h.value,d=r.getTerrainData(f.tileID);i.activeTexture.set(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,l.texture);var m=t.transform.calculatePosMatrix(f.tileID.toUnwrapped());c.draw(i,n.TRIANGLES,o,Br.disabled,a,Or.backCCW,{u_matrix:m,u_terrain_coords_id:(255-r.coordsIndex.length)/255,u_texture:0},d,"terrain",s.vertexBuffer,s.indexBuffer,s.segments),r.coordsIndex.push(f.tileID.key)}}catch(v){p.e(v)}finally{p.f()}i.bindFramebuffer.set(null),i.viewport.set([0,0,t.width,t.height])}(this,this.style.terrain))}this.renderPass="offscreen";var v,y,g,_=K(n);try{for(_.s();!(v=_.n()).done;){var x=v.value,b=this.style._layers[x];if(b.hasOffscreenPass()&&!b.isHidden(this.transform.zoom)){var w=c[b.source];("custom"===b.type||w.length)&&this.renderLayer(this,a[b.source],b,w)}}}catch(z){_.e(z)}finally{_.f()}if(this.context.bindFramebuffer.set(null),this.context.clear({color:r.showOverdrawInspector?e.Color.black:e.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=r.showOverdrawInspector,this.depthRangeFor3D=[0,1-(t._order.length+2)*this.numSublayers*this.depthEpsilon],!o)for(this.renderPass="opaque",this.currentLayer=n.length-1;this.currentLayer>=0;this.currentLayer--){var k=this.style._layers[n[this.currentLayer]],E=a[k.source],T=u[k.source];this._renderTileClippingMasks(k,T),this.renderLayer(this,E,k,T)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<n.length;this.currentLayer++){var S=this.style._layers[n[this.currentLayer]],C=a[S.source];if(!o||!o.renderLayer(S)){var I=("symbol"===S.type?h:c)[S.source];this._renderTileClippingMasks(S,u[S.source]),this.renderLayer(this,C,S,I)}}this.options.showTileBoundaries&&(Object.values(this.style._layers).forEach((function(e){e.source&&!e.isHidden(i.transform.zoom)&&(e.source!==(g&&g.id)&&(g=i.style.sourceCaches[e.source]),(!y||y.getSource().maxzoom<g.getSource().maxzoom)&&(y=g))})),y&&ui.debug(this,y,y.getVisibleCoordinates())),this.options.showPadding&&function(e){var t=e.transform.padding;ri(e,e.transform.height-(t.top||0),3,Yr),ri(e,t.bottom||0,3,Qr),ii(e,t.left||0,3,$r),ii(e,e.transform.width-(t.right||0),3,ei);var r=e.transform.centerPoint;!function(e,t,r,i){ni(e,t-1,r-10,2,20,i),ni(e,t-10,r-1,20,2,i)}(e,r.x,e.transform.height-r.y,ti)}(this),this.context.setDefault()}},{key:"renderLayer",value:function(e,t,r,i){r.isHidden(this.transform.zoom)||("background"===r.type||"custom"===r.type||(i||[]).length)&&(this.id=r.id,this.gpuTimingStart(r),ui[r.type](e,t,r,i,this.style.placement.variableOffsets),this.gpuTimingEnd())}},{key:"gpuTimingStart",value:function(e){if(this.options.gpuTiming){var t=this.context.extTimerQuery,r=this.gpuTimers[e.id];r||(r=this.gpuTimers[e.id]={calls:0,cpuTime:0,query:t.createQueryEXT()}),r.calls++,t.beginQueryEXT(t.TIME_ELAPSED_EXT,r.query)}}},{key:"gpuTimingEnd",value:function(){if(this.options.gpuTiming){var e=this.context.extTimerQuery;e.endQueryEXT(e.TIME_ELAPSED_EXT)}}},{key:"collectGpuTimers",value:function(){var e=this.gpuTimers;return this.gpuTimers={},e}},{key:"queryGpuTimers",value:function(e){var t={};for(var r in e){var i=e[r],n=this.context.extTimerQuery,a=n.getQueryObjectEXT(i.query,n.QUERY_RESULT_EXT)/1e6;n.deleteQueryEXT(i.query),t[r]=a}return t}},{key:"translatePosMatrix",value:function(t,r,i,n,a){if(!i[0]&&!i[1])return t;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);i=[i[0]*l-i[1]*s,i[0]*s+i[1]*l]}var u=[a?i[0]:De(r,i[0],this.transform.zoom),a?i[1]:De(r,i[1],this.transform.zoom),0],c=new Float32Array(16);return e.translate(c,t,u),c}},{key:"saveTileTexture",value:function(e){var t=this._tileTextures[e.size[0]];t?t.push(e):this._tileTextures[e.size[0]]=[e]}},{key:"getTileTexture",value:function(e){var t=this._tileTextures[e];return t&&t.length>0?t.pop():null}},{key:"isPatternMissing",value:function(e){if(!e)return!1;if(!e.from||!e.to)return!0;var t=this.imageManager.getPattern(e.from.toString()),r=this.imageManager.getPattern(e.to.toString());return!t||!r}},{key:"useProgram",value:function(e,t){this.cache=this.cache||{};var r=e+(t?t.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.terrain?"/terrain":"");return this.cache[r]||(this.cache[r]=new _t(this.context,e,mt[e],t,Xt[e],this._showOverdrawInspector,this.style.terrain)),this.cache[r]}},{key:"setCustomLayerDefaults",value:function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}},{key:"setBaseState",value:function(){var e=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(e.FUNC_ADD)}},{key:"initDebugOverlayCanvas",value:function(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new l(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}},{key:"destroy",value:function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}}]),t}(),hi=function(){function t(e,r){j(this,t),this.points=e,this.planes=r}return q(t,null,[{key:"fromInvProjectionMatrix",value:function(r,i,n){var a=Math.pow(2,n),o=[[-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(t){var n=1/(t=e.transformMat4([],t,r))[3]/i*a;return e.mul$1(t,t,[n,n,1/t[3],n])})),s=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(t){var r=e.sub([],o[t[0]],o[t[1]]),i=e.sub([],o[t[2]],o[t[1]]),n=e.normalize([],e.cross([],r,i)),a=-e.dot(n,o[t[1]]);return n.concat(a)}));return new t(o,s)}}]),t}(),pi=function(){function t(r,i){j(this,t),this.min=r,this.max=i,this.center=e.scale$1([],e.add([],this.min,this.max),.5)}return q(t,[{key:"quadrant",value:function(r){for(var i=[r%2==0,r<2],n=e.clone$2(this.min),a=e.clone$2(this.max),o=0;o<i.length;o++)n[o]=i[o]?this.min[o]:this.center[o],a[o]=i[o]?this.center[o]:this.max[o];return a[2]=this.max[2],new t(n,a)}},{key:"distanceX",value:function(e){return Math.max(Math.min(this.max[0],e[0]),this.min[0])-e[0]}},{key:"distanceY",value:function(e){return Math.max(Math.min(this.max[1],e[1]),this.min[1])-e[1]}},{key:"intersects",value:function(t){for(var r=[[this.min[0],this.min[1],this.min[2],1],[this.max[0],this.min[1],this.min[2],1],[this.max[0],this.max[1],this.min[2],1],[this.min[0],this.max[1],this.min[2],1],[this.min[0],this.min[1],this.max[2],1],[this.max[0],this.min[1],this.max[2],1],[this.max[0],this.max[1],this.max[2],1],[this.min[0],this.max[1],this.max[2],1]],i=!0,n=0;n<t.planes.length;n++){for(var a=t.planes[n],o=0,s=0;s<r.length;s++)e.dot$1(a,r[s])>=0&&o++;if(0===o)return 0;o!==r.length&&(i=!1)}if(i)return 2;for(var l=0;l<3;l++){for(var u=Number.MAX_VALUE,c=-Number.MAX_VALUE,h=0;h<t.points.length;h++){var p=t.points[h][l]-this.min[l];u=Math.min(u,p),c=Math.max(c,p)}if(c<0||u>this.max[l]-this.min[l])return 0}return 1}}]),t}(),fi=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(j(this,t),isNaN(e)||e<0||isNaN(r)||r<0||isNaN(i)||i<0||isNaN(n)||n<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=e,this.bottom=r,this.left=i,this.right=n}return q(t,[{key:"interpolate",value:function(t,r,i){return null!=r.top&&null!=t.top&&(this.top=e.number(t.top,r.top,i)),null!=r.bottom&&null!=t.bottom&&(this.bottom=e.number(t.bottom,r.bottom,i)),null!=r.left&&null!=t.left&&(this.left=e.number(t.left,r.left,i)),null!=r.right&&null!=t.right&&(this.right=e.number(t.right,r.right,i)),this}},{key:"getCenter",value:function(t,r){var i=e.clamp((this.left+t-this.right)/2,0,t),n=e.clamp((this.top+r-this.bottom)/2,0,r);return new e.pointGeometry(i,n)}},{key:"equals",value:function(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right}},{key:"clone",value:function(){return new t(this.top,this.bottom,this.left,this.right)}},{key:"toJSON",value:function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}]),t}(),di=function(){function t(r,i,n,a,o){j(this,t),this.tileSize=512,this.maxValidLatitude=85.051129,this.freezeElevation=!1,this._renderWorldCopies=void 0===o||!!o,this._minZoom=r||0,this._maxZoom=i||22,this._minPitch=null==n?0:n,this._maxPitch=null==a?60:a,this.setMaxBounds(),this.width=0,this.height=0,this._center=new e.LngLat(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new fi,this._posMatrixCache={},this._alignedPosMatrixCache={}}return q(t,[{key:"clone",value:function(){var e=new t(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return e.tileSize=this.tileSize,e.latRange=this.latRange,e.width=this.width,e.height=this.height,e._center=this._center,e._elevation=this._elevation,e.zoom=this.zoom,e.angle=this.angle,e._fov=this._fov,e._pitch=this._pitch,e._unmodified=this._unmodified,e._edgeInsets=this._edgeInsets.clone(),e._calcMatrices(),e}},{key:"minZoom",get:function(){return this._minZoom},set:function(e){this._minZoom!==e&&(this._minZoom=e,this.zoom=Math.max(this.zoom,e))}},{key:"maxZoom",get:function(){return this._maxZoom},set:function(e){this._maxZoom!==e&&(this._maxZoom=e,this.zoom=Math.min(this.zoom,e))}},{key:"minPitch",get:function(){return this._minPitch},set:function(e){this._minPitch!==e&&(this._minPitch=e,this.pitch=Math.max(this.pitch,e))}},{key:"maxPitch",get:function(){return this._maxPitch},set:function(e){this._maxPitch!==e&&(this._maxPitch=e,this.pitch=Math.min(this.pitch,e))}},{key:"renderWorldCopies",get:function(){return this._renderWorldCopies},set:function(e){void 0===e?e=!0:null===e&&(e=!1),this._renderWorldCopies=e}},{key:"worldSize",get:function(){return this.tileSize*this.scale}},{key:"centerOffset",get:function(){return this.centerPoint._sub(this.size._div(2))}},{key:"size",get:function(){return new e.pointGeometry(this.width,this.height)}},{key:"bearing",get:function(){return-this.angle/Math.PI*180},set:function(t){var r,i=-e.wrap(t,-180,180)*Math.PI/180;this.angle!==i&&(this._unmodified=!1,this.angle=i,this._calcMatrices(),this.rotationMatrix=(r=new e.ARRAY_TYPE(4),e.ARRAY_TYPE!=Float32Array&&(r[1]=0,r[2]=0),r[0]=1,r[3]=1,r),function(e,t,r){var i=t[0],n=t[1],a=t[2],o=t[3],s=Math.sin(r),l=Math.cos(r);e[0]=i*l+a*s,e[1]=n*l+o*s,e[2]=i*-s+a*l,e[3]=n*-s+o*l}(this.rotationMatrix,this.rotationMatrix,this.angle))}},{key:"pitch",get:function(){return this._pitch/Math.PI*180},set:function(t){var r=e.clamp(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices())}},{key:"fov",get:function(){return this._fov/Math.PI*180},set:function(e){e=Math.max(.01,Math.min(60,e)),this._fov!==e&&(this._unmodified=!1,this._fov=e/180*Math.PI,this._calcMatrices())}},{key:"zoom",get:function(){return this._zoom},set:function(e){var t=Math.min(Math.max(e,this.minZoom),this.maxZoom);this._zoom!==t&&(this._unmodified=!1,this._zoom=t,this.scale=this.zoomScale(t),this.tileZoom=Math.floor(t),this.zoomFraction=t-this.tileZoom,this._constrain(),this._calcMatrices())}},{key:"center",get:function(){return this._center},set:function(e){e.lat===this._center.lat&&e.lng===this._center.lng||(this._unmodified=!1,this._center=e,this._constrain(),this._calcMatrices())}},{key:"elevation",get:function(){return this._elevation},set:function(e){e!==this._elevation&&(this._elevation=e,this._constrain(),this._calcMatrices())}},{key:"padding",get:function(){return this._edgeInsets.toJSON()},set:function(e){this._edgeInsets.equals(e)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,e,1),this._calcMatrices())}},{key:"centerPoint",get:function(){return this._edgeInsets.getCenter(this.width,this.height)}},{key:"isPaddingEqual",value:function(e){return this._edgeInsets.equals(e)}},{key:"interpolatePadding",value:function(e,t,r){this._unmodified=!1,this._edgeInsets.interpolate(e,t,r),this._constrain(),this._calcMatrices()}},{key:"coveringZoomLevel",value:function(e){var t=(e.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/e.tileSize));return Math.max(0,t)}},{key:"getVisibleUnwrappedCoordinates",value:function(t){var r=[new e.UnwrappedTileID(0,t)];if(this._renderWorldCopies)for(var i=this.pointCoordinate(new e.pointGeometry(0,0)),n=this.pointCoordinate(new e.pointGeometry(this.width,0)),a=this.pointCoordinate(new e.pointGeometry(this.width,this.height)),o=this.pointCoordinate(new e.pointGeometry(0,this.height)),s=Math.floor(Math.min(i.x,n.x,a.x,o.x)),l=Math.floor(Math.max(i.x,n.x,a.x,o.x)),u=1,c=s-u;c<=l+u;c++)0!==c&&r.push(new e.UnwrappedTileID(c,t));return r}},{key:"coveringTiles",value:function(t){var r,i,n=this.coveringZoomLevel(t),a=n;if(void 0!==t.minzoom&&n<t.minzoom)return[];void 0!==t.maxzoom&&n>t.maxzoom&&(n=t.maxzoom);var o=this.pointCoordinate(this.getCameraPoint()),s=e.MercatorCoordinate.fromLngLat(this.center),l=Math.pow(2,n),u=[l*o.x,l*o.y,0],c=[l*s.x,l*s.y,0],h=hi.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,n),p=t.minzoom||0;!t.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(p=n);var f=t.terrain?2/Math.min(this.tileSize,t.tileSize)*this.tileSize:3,d=function(e){return{aabb:new pi([e*l,0,0],[(e+1)*l,l,0]),zoom:0,x:0,y:0,wrap:e,fullyVisible:!1}},m=[],v=[],y=n,g=t.reparseOverscaled?a:n;if(this._renderWorldCopies)for(var _=1;_<=3;_++)m.push(d(-_)),m.push(d(_));for(m.push(d(0));m.length>0;){var x=m.pop(),b=x.x,w=x.y,k=x.fullyVisible;if(!k){var E=x.aabb.intersects(h);if(0===E)continue;k=2===E}var T=t.terrain?u:c,S=x.aabb.distanceX(T),C=x.aabb.distanceY(T),I=Math.max(Math.abs(S),Math.abs(C)),z=f+(1<<y-x.zoom)-2;if(x.zoom===y||I>z&&x.zoom>=p){var A=y-x.zoom,M=u[0]-.5-(b<<A),P=u[1]-.5-(w<<A);v.push({tileID:new e.OverscaledTileID(x.zoom===y?g:x.zoom,x.wrap,x.zoom,b,w),distanceSq:e.sqrLen([c[0]-.5-b,c[1]-.5-w]),tileDistanceToCamera:Math.sqrt(M*M+P*P)})}else for(var D=0;D<4;D++){var L=(b<<1)+D%2,R=(w<<1)+(D>>1),B=x.zoom+1,F=x.aabb.quadrant(D);if(t.terrain){var O=new e.OverscaledTileID(B,x.wrap,B,L,R),V=t.terrain.getMinMaxElevation(O),U=null!==(r=V.minElevation)&&void 0!==r?r:this.elevation,N=null!==(i=V.maxElevation)&&void 0!==i?i:this.elevation;F=new pi([F.min[0],F.min[1],U],[F.max[0],F.max[1],N])}m.push({aabb:F,zoom:B,x:L,y:R,wrap:x.wrap,fullyVisible:k})}}return v.sort((function(e,t){return e.distanceSq-t.distanceSq})).map((function(e){return e.tileID}))}},{key:"resize",value:function(e,t){this.width=e,this.height=t,this.pixelsToGLUnits=[2/e,-2/t],this._constrain(),this._calcMatrices()}},{key:"unmodified",get:function(){return this._unmodified}},{key:"zoomScale",value:function(e){return Math.pow(2,e)}},{key:"scaleZoom",value:function(e){return Math.log(e)/Math.LN2}},{key:"project",value:function(t){var r=e.clamp(t.lat,-this.maxValidLatitude,this.maxValidLatitude);return new e.pointGeometry(e.mercatorXfromLng(t.lng)*this.worldSize,e.mercatorYfromLat(r)*this.worldSize)}},{key:"unproject",value:function(t){return new e.MercatorCoordinate(t.x/this.worldSize,t.y/this.worldSize).toLngLat()}},{key:"point",get:function(){return this.project(this.center)}},{key:"updateElevation",value:function(e){this.freezeElevation||(this.elevation=e?this.getElevation(this._center,e):0)}},{key:"getElevation",value:function(t,r){var i=e.MercatorCoordinate.fromLngLat(t),n=(1<<this.tileZoom)*e.EXTENT,a=i.x*n,o=i.y*n,s=Math.floor(a/e.EXTENT),l=Math.floor(o/e.EXTENT),u=new e.OverscaledTileID(this.tileZoom,0,this.tileZoom,s,l);return r.getElevation(u,a%e.EXTENT,o%e.EXTENT,e.EXTENT)}},{key:"getCameraPosition",value:function(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}},{key:"recalculateZoom",value:function(t){var r=this.pointLocation(this.centerPoint,t),i=this.getElevation(r,t);if(this.elevation-i){var n=this.getCameraPosition(),a=e.MercatorCoordinate.fromLngLat(n.lngLat,n.altitude),o=e.MercatorCoordinate.fromLngLat(r,i),s=a.x-o.x,l=a.y-o.y,u=a.z-o.z,c=Math.sqrt(s*s+l*l+u*u),h=this.scaleZoom(this.cameraToCenterDistance/c/this.tileSize);this._elevation=i,this._center=r,this.zoom=h}}},{key:"setLocationAtPoint",value:function(t,r){var i=this.pointCoordinate(r),n=this.pointCoordinate(this.centerPoint),a=this.locationCoordinate(t),o=new e.MercatorCoordinate(a.x-(i.x-n.x),a.y-(i.y-n.y));this.center=this.coordinateLocation(o),this._renderWorldCopies&&(this.center=this.center.wrap())}},{key:"locationPoint",value:function(e,t){return t?this.coordinatePoint(this.locationCoordinate(e),this.getElevation(e,t),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(e))}},{key:"pointLocation",value:function(e,t){return this.coordinateLocation(this.pointCoordinate(e,t))}},{key:"locationCoordinate",value:function(t){return e.MercatorCoordinate.fromLngLat(t)}},{key:"coordinateLocation",value:function(e){return e&&e.toLngLat()}},{key:"pointCoordinate",value:function(t,r){if(r){var i=r.pointCoordinate(t);if(null!=i)return i}var n=[t.x,t.y,0,1],a=[t.x,t.y,1,1];e.transformMat4(n,n,this.pixelMatrixInverse),e.transformMat4(a,a,this.pixelMatrixInverse);var o=n[3],s=a[3],l=n[1]/o,u=a[1]/s,c=n[2]/o,h=a[2]/s,p=c===h?0:(0-c)/(h-c);return new e.MercatorCoordinate(e.number(n[0]/o,a[0]/s,p)/this.worldSize,e.number(l,u,p)/this.worldSize)}},{key:"coordinatePoint",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.pixelMatrix,n=[t.x*this.worldSize,t.y*this.worldSize,r,1];return e.transformMat4(n,n,i),new e.pointGeometry(n[0]/n[3],n[1]/n[3])}},{key:"getBounds",value:function(){var t=Math.max(0,this.height/2-this.getHorizon());return(new e.LngLatBounds).extend(this.pointLocation(new e.pointGeometry(0,t))).extend(this.pointLocation(new e.pointGeometry(this.width,t))).extend(this.pointLocation(new e.pointGeometry(this.width,this.height))).extend(this.pointLocation(new e.pointGeometry(0,this.height)))}},{key:"getMaxBounds",value:function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new e.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}},{key:"getHorizon",value:function(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}},{key:"setMaxBounds",value:function(e){e?(this.lngRange=[e.getWest(),e.getEast()],this.latRange=[e.getSouth(),e.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])}},{key:"calculatePosMatrix",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=t.key,n=r?this._alignedPosMatrixCache:this._posMatrixCache;if(n[i])return n[i];var a=t.canonical,o=this.worldSize/this.zoomScale(a.z),s=a.x+Math.pow(2,a.z)*t.wrap,l=e.identity(new Float64Array(16));return e.translate(l,l,[s*o,a.y*o,0]),e.scale(l,l,[o/e.EXTENT,o/e.EXTENT,1]),e.multiply(l,r?this.alignedProjMatrix:this.projMatrix,l),n[i]=new Float32Array(l),n[i]}},{key:"customLayerMatrix",value:function(){return this.mercatorMatrix.slice()}},{key:"_constrain",value:function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var t,r,i,n,a=-90,o=90,s=-180,l=180,u=this.size,c=this._unmodified;if(this.latRange){var h=this.latRange;a=e.mercatorYfromLat(h[1])*this.worldSize,t=(o=e.mercatorYfromLat(h[0])*this.worldSize)-a<u.y?u.y/(o-a):0}if(this.lngRange){var p=this.lngRange;s=e.wrap(e.mercatorXfromLng(p[0])*this.worldSize,0,this.worldSize),(l=e.wrap(e.mercatorXfromLng(p[1])*this.worldSize,0,this.worldSize))<s&&(l+=this.worldSize),r=l-s<u.x?u.x/(l-s):0}var f=this.point,d=Math.max(r||0,t||0);if(d)return this.center=this.unproject(new e.pointGeometry(r?(l+s)/2:f.x,t?(o+a)/2:f.y)),this.zoom+=this.scaleZoom(d),this._unmodified=c,void(this._constraining=!1);if(this.latRange){var m=f.y,v=u.y/2;m-v<a&&(n=a+v),m+v>o&&(n=o-v)}if(this.lngRange){var y=(s+l)/2,g=e.wrap(f.x,y-this.worldSize/2,y+this.worldSize/2),_=u.x/2;g-_<s&&(i=s+_),g+_>l&&(i=l-_)}void 0===i&&void 0===n||(this.center=this.unproject(new e.pointGeometry(void 0!==i?i:f.x,void 0!==n?n:f.y)).wrap()),this._unmodified=c,this._constraining=!1}}},{key:"_calcMatrices",value:function(){if(this.height){var t=this.centerOffset,r=this.point.x,i=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=e.mercatorZfromAltitude(1,this.center.lat)*this.worldSize;var n=e.identity(new Float64Array(16));e.scale(n,n,[this.width/2,-this.height/2,1]),e.translate(n,n,[1,-1,0]),this.labelPlaneMatrix=n,n=e.identity(new Float64Array(16)),e.scale(n,n,[1,-1,1]),e.translate(n,n,[-1,-1,0]),e.scale(n,n,[2/this.width,2/this.height,1]),this.glCoordMatrix=n,this.cameraToSeaLevelDistance=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch);var a=Math.PI/2+this._pitch,o=this._fov*(.5+t.y/this.height),s=Math.sin(o)*this.cameraToSeaLevelDistance/Math.sin(e.clamp(Math.PI-a-o,.01,Math.PI-.01)),l=this.getHorizon(),u=2*Math.atan(l/this.cameraToCenterDistance)*(.5+t.y/(2*l)),c=Math.sin(u)*this.cameraToSeaLevelDistance/Math.sin(e.clamp(Math.PI-a-u,.01,Math.PI-.01)),h=Math.cos(Math.PI/2-this._pitch)*s+this.cameraToSeaLevelDistance,p=Math.cos(Math.PI/2-this._pitch)*c+this.cameraToSeaLevelDistance,f=1.01*Math.min(h,p),d=this.height/50;n=new Float64Array(16),e.perspective(n,this._fov,this.width/this.height,d,f),n[8]=2*-t.x/this.width,n[9]=2*t.y/this.height,e.scale(n,n,[1,-1,1]),e.translate(n,n,[0,0,-this.cameraToCenterDistance]),e.rotateX(n,n,this._pitch),e.rotateZ(n,n,this.angle),e.translate(n,n,[-r,-i,0]),this.mercatorMatrix=e.scale([],n,[this.worldSize,this.worldSize,this.worldSize]),e.scale(n,n,[1,1,this._pixelPerMeter]),this.pixelMatrix=e.multiply(new Float64Array(16),this.labelPlaneMatrix,n),e.translate(n,n,[0,0,-this.elevation]),this.projMatrix=n,this.invProjMatrix=e.invert([],n),this.pixelMatrix3D=e.multiply(new Float64Array(16),this.labelPlaneMatrix,n);var m=this.width%2/2,v=this.height%2/2,y=Math.cos(this.angle),g=Math.sin(this.angle),_=r-Math.round(r)+y*m+g*v,x=i-Math.round(i)+y*v+g*m,b=new Float64Array(n);if(e.translate(b,b,[_>.5?_-1:_,x>.5?x-1:x,0]),this.alignedProjMatrix=b,!(n=e.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=n,this._posMatrixCache={},this._alignedPosMatrixCache={}}}},{key:"maxPitchScaleFactor",value:function(){if(!this.pixelMatrixInverse)return 1;var t=this.pointCoordinate(new e.pointGeometry(0,0)),r=[t.x*this.worldSize,t.y*this.worldSize,0,1];return e.transformMat4(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance}},{key:"getCameraPoint",value:function(){var t=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.pointGeometry(0,t))}},{key:"getCameraQueryGeometry",value:function(t){var r=this.getCameraPoint();if(1===t.length)return[t[0],r];var i,n=r.x,a=r.y,o=r.x,s=r.y,l=K(t);try{for(l.s();!(i=l.n()).done;){var u=i.value;n=Math.min(n,u.x),a=Math.min(a,u.y),o=Math.max(o,u.x),s=Math.max(s,u.y)}}catch(c){l.e(c)}finally{l.f()}return[new e.pointGeometry(n,a),new e.pointGeometry(o,a),new e.pointGeometry(o,s),new e.pointGeometry(n,s),new e.pointGeometry(n,a)]}}]),t}(),mi=function(){function t(r){j(this,t),this._hashName=r&&encodeURIComponent(r),e.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=function(e,t){var r=!1,i=null,n=function t(){i=null,r&&(e(),i=setTimeout(t,300),r=!1)};return function(){return r=!0,i||n(),i}}(this._updateHashUnthrottled.bind(this))}return q(t,[{key:"addTo",value:function(e){return this._map=e,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}},{key:"remove",value:function(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this}},{key:"getHashString",value:function(e){var t=this._map.getCenter(),r=Math.round(100*this._map.getZoom())/100,i=Math.ceil((r*Math.LN2+Math.log(512/360/.5))/Math.LN10),n=Math.pow(10,i),a=Math.round(t.lng*n)/n,o=Math.round(t.lat*n)/n,s=this._map.getBearing(),l=this._map.getPitch(),u="";if(u+=e?"/".concat(a,"/").concat(o,"/").concat(r):"".concat(r,"/").concat(o,"/").concat(a),(s||l)&&(u+="/"+Math.round(10*s)/10),l&&(u+="/".concat(Math.round(l))),this._hashName){var c=this._hashName,h=!1,p=window.location.hash.slice(1).split("&").map((function(e){var t=e.split("=")[0];return t===c?(h=!0,"".concat(t,"=").concat(u)):e})).filter((function(e){return e}));return h||p.push("".concat(c,"=").concat(u)),"#".concat(p.join("&"))}return"#".concat(u)}},{key:"_getCurrentHash",value:function(){var e,t=this,r=window.location.hash.replace("#","");return this._hashName?(r.split("&").map((function(e){return e.split("=")})).forEach((function(r){r[0]===t._hashName&&(e=r)})),(e&&e[1]||"").split("/")):r.split("/")}},{key:"_onHashChange",value:function(){var e=this._getCurrentHash();if(e.length>=3&&!e.some((function(e){return isNaN(e)}))){var t=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(e[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+e[2],+e[1]],zoom:+e[0],bearing:t,pitch:+(e[4]||0)}),!0}return!1}},{key:"_updateHashUnthrottled",value:function(){var e=window.location.href.replace(/(#.+)?$/,this.getHashString());try{window.history.replaceState(window.history.state,null,e)}catch(e){}}}]),t}(),vi={linearity:.3,easing:e.bezier(0,0,.3,1)},yi=e.extend({deceleration:2500,maxSpeed:1400},vi),gi=e.extend({deceleration:20,maxSpeed:1400},vi),_i=e.extend({deceleration:1e3,maxSpeed:360},vi),xi=e.extend({deceleration:1e3,maxSpeed:90},vi),bi=function(){function t(e){j(this,t),this._map=e,this.clear()}return q(t,[{key:"clear",value:function(){this._inertiaBuffer=[]}},{key:"record",value:function(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:e.exported.now(),settings:t})}},{key:"_drainInertiaBuffer",value:function(){for(var t=this._inertiaBuffer,r=e.exported.now();t.length>0&&r-t[0].time>160;)t.shift()}},{key:"_onMoveEnd",value:function(t){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){var r,i={zoom:0,bearing:0,pitch:0,pan:new e.pointGeometry(0,0),pinchAround:void 0,around:void 0},n=K(this._inertiaBuffer);try{for(n.s();!(r=n.n()).done;){var a=r.value.settings;i.zoom+=a.zoomDelta||0,i.bearing+=a.bearingDelta||0,i.pitch+=a.pitchDelta||0,a.panDelta&&i.pan._add(a.panDelta),a.around&&(i.around=a.around),a.pinchAround&&(i.pinchAround=a.pinchAround)}}catch(f){n.e(f)}finally{n.f()}var o=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,s={};if(i.pan.mag()){var l=ki(i.pan.mag(),o,e.extend({},yi,t||{}));s.offset=i.pan.mult(l.amount/i.pan.mag()),s.center=this._map.transform.center,wi(s,l)}if(i.zoom){var u=ki(i.zoom,o,gi);s.zoom=this._map.transform.zoom+u.amount,wi(s,u)}if(i.bearing){var c=ki(i.bearing,o,_i);s.bearing=this._map.transform.bearing+e.clamp(c.amount,-179,179),wi(s,c)}if(i.pitch){var h=ki(i.pitch,o,xi);s.pitch=this._map.transform.pitch+h.amount,wi(s,h)}if(s.zoom||s.bearing){var p=void 0===i.pinchAround?i.around:i.pinchAround;s.around=p?this._map.unproject(p):this._map.getCenter()}return this.clear(),e.extend(s,{noMoveStart:!0})}}}]),t}();function wi(e,t){(!e.duration||e.duration<t.duration)&&(e.duration=t.duration,e.easing=t.easing)}function ki(t,r,i){var n=i.maxSpeed,a=i.linearity,o=i.deceleration,s=e.clamp(t*a/(r/1e3),-n,n),l=Math.abs(s)/(o*a);return{easing:i.easing,duration:1e3*l,amount:s*(l/2)}}var Ei=function(t){A(i,t);var r=M(i);function i(t,n,o){var s,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};j(this,i);var u=a.mousePos(n.getCanvasContainer(),o),c=n.unproject(u);return(s=r.call(this,t,e.extend({point:u,lngLat:c,originalEvent:o},l)))._defaultPrevented=!1,s.target=n,s}return q(i,[{key:"preventDefault",value:function(){this._defaultPrevented=!0}},{key:"defaultPrevented",get:function(){return this._defaultPrevented}}]),i}(e.Event),Ti=function(t){A(i,t);var r=M(i);function i(t,n,o){var s;j(this,i);var l="touchend"===t?o.changedTouches:o.touches,u=a.touchPos(n.getCanvasContainer(),l),c=u.map((function(e){return n.unproject(e)})),h=u.reduce((function(e,t,r,i){return e.add(t.div(i.length))}),new e.pointGeometry(0,0));return(s=r.call(this,t,{points:u,point:h,lngLats:c,lngLat:n.unproject(h),originalEvent:o}))._defaultPrevented=!1,s}return q(i,[{key:"preventDefault",value:function(){this._defaultPrevented=!0}},{key:"defaultPrevented",get:function(){return this._defaultPrevented}}]),i}(e.Event),Si=function(e){A(r,e);var t=M(r);function r(e,i,n){var a;return j(this,r),(a=t.call(this,e,{originalEvent:n}))._defaultPrevented=!1,a}return q(r,[{key:"preventDefault",value:function(){this._defaultPrevented=!0}},{key:"defaultPrevented",get:function(){return this._defaultPrevented}}]),r}(e.Event),Ci=function(){function e(t,r){j(this,e),this._map=t,this._clickTolerance=r.clickTolerance}return q(e,[{key:"reset",value:function(){delete this._mousedownPos}},{key:"wheel",value:function(e){return this._firePreventable(new Si(e.type,this._map,e))}},{key:"mousedown",value:function(e,t){return this._mousedownPos=t,this._firePreventable(new Ei(e.type,this._map,e))}},{key:"mouseup",value:function(e){this._map.fire(new Ei(e.type,this._map,e))}},{key:"click",value:function(e,t){this._mousedownPos&&this._mousedownPos.dist(t)>=this._clickTolerance||this._map.fire(new Ei(e.type,this._map,e))}},{key:"dblclick",value:function(e){return this._firePreventable(new Ei(e.type,this._map,e))}},{key:"mouseover",value:function(e){this._map.fire(new Ei(e.type,this._map,e))}},{key:"mouseout",value:function(e){this._map.fire(new Ei(e.type,this._map,e))}},{key:"touchstart",value:function(e){return this._firePreventable(new Ti(e.type,this._map,e))}},{key:"touchmove",value:function(e){this._map.fire(new Ti(e.type,this._map,e))}},{key:"touchend",value:function(e){this._map.fire(new Ti(e.type,this._map,e))}},{key:"touchcancel",value:function(e){this._map.fire(new Ti(e.type,this._map,e))}},{key:"_firePreventable",value:function(e){if(this._map.fire(e),e.defaultPrevented)return{}}},{key:"isEnabled",value:function(){return!0}},{key:"isActive",value:function(){return!1}},{key:"enable",value:function(){}},{key:"disable",value:function(){}}]),e}(),Ii=function(){function e(t){j(this,e),this._map=t}return q(e,[{key:"reset",value:function(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}},{key:"mousemove",value:function(e){this._map.fire(new Ei(e.type,this._map,e))}},{key:"mousedown",value:function(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}},{key:"mouseup",value:function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Ei("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}},{key:"contextmenu",value:function(e){this._delayContextMenu?this._contextMenuEvent=e:this._ignoreContextMenu||this._map.fire(new Ei(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault()}},{key:"isEnabled",value:function(){return!0}},{key:"isActive",value:function(){return!1}},{key:"enable",value:function(){}},{key:"disable",value:function(){}}]),e}(),zi=function(){function t(e,r){j(this,t),this._map=e,this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=r.clickTolerance||1}return q(t,[{key:"isEnabled",value:function(){return!!this._enabled}},{key:"isActive",value:function(){return!!this._active}},{key:"enable",value:function(){this.isEnabled()||(this._enabled=!0)}},{key:"disable",value:function(){this.isEnabled()&&(this._enabled=!1)}},{key:"mousedown",value:function(e,t){this.isEnabled()&&e.shiftKey&&0===e.button&&(a.disableDrag(),this._startPos=this._lastPos=t,this._active=!0)}},{key:"mousemoveWindow",value:function(e,t){if(this._active){var r=t;if(!(this._lastPos.equals(r)||!this._box&&r.dist(this._startPos)<this._clickTolerance)){var i=this._startPos;this._lastPos=r,this._box||(this._box=a.create("div","maplibregl-boxzoom mapboxgl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair","mapboxgl-crosshair"),this._fireEvent("boxzoomstart",e));var n=Math.min(i.x,r.x),o=Math.max(i.x,r.x),s=Math.min(i.y,r.y),l=Math.max(i.y,r.y);a.setTransform(this._box,"translate(".concat(n,"px,").concat(s,"px)")),this._box.style.width=o-n+"px",this._box.style.height=l-s+"px"}}}},{key:"mouseupWindow",value:function(t,r){var i=this;if(this._active&&0===t.button){var n=this._startPos,o=r;if(this.reset(),a.suppressClick(),n.x!==o.x||n.y!==o.y)return this._map.fire(new e.Event("boxzoomend",{originalEvent:t})),{cameraAnimation:function(e){return e.fitScreenCoordinates(n,o,i._map.getBearing(),{linear:!0})}};this._fireEvent("boxzoomcancel",t)}}},{key:"keydown",value:function(e){this._active&&27===e.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",e))}},{key:"reset",value:function(){this._active=!1,this._container.classList.remove("maplibregl-crosshair","mapboxgl-crosshair"),this._box&&(a.remove(this._box),this._box=null),a.enableDrag(),delete this._startPos,delete this._lastPos}},{key:"_fireEvent",value:function(t,r){return this._map.fire(new e.Event(t,{originalEvent:r}))}}]),t}();function Ai(e,t){if(e.length!==t.length)throw new Error("The number of touches and points are not equal - touches ".concat(e.length,", points ").concat(t.length));for(var r={},i=0;i<e.length;i++)r[e[i].identifier]=t[i];return r}var Mi=function(){function t(e){j(this,t),this.reset(),this.numTouches=e.numTouches}return q(t,[{key:"reset",value:function(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}},{key:"touchstart",value:function(t,r,i){(this.centroid||i.length>this.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=t.timeStamp),i.length===this.numTouches&&(this.centroid=function(t){var r,i=new e.pointGeometry(0,0),n=K(t);try{for(n.s();!(r=n.n()).done;){var a=r.value;i._add(a)}}catch(o){n.e(o)}finally{n.f()}return i.div(t.length)}(r),this.touches=Ai(i,r)))}},{key:"touchmove",value:function(e,t,r){if(!this.aborted&&this.centroid){var i=Ai(r,t);for(var n in this.touches){var a=this.touches[n],o=i[n];(!o||o.dist(a)>30)&&(this.aborted=!0)}}}},{key:"touchend",value:function(e,t,r){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),0===r.length){var i=!this.aborted&&this.centroid;if(this.reset(),i)return i}}}]),t}(),Pi=function(){function e(t){j(this,e),this.singleTap=new Mi(t),this.numTaps=t.numTaps,this.reset()}return q(e,[{key:"reset",value:function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}},{key:"touchstart",value:function(e,t,r){this.singleTap.touchstart(e,t,r)}},{key:"touchmove",value:function(e,t,r){this.singleTap.touchmove(e,t,r)}},{key:"touchend",value:function(e,t,r){var i=this.singleTap.touchend(e,t,r);if(i){var n=e.timeStamp-this.lastTime<500,a=!this.lastTap||this.lastTap.dist(i)<30;if(n&&a||this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=i,this.count===this.numTaps)return this.reset(),i}}}]),e}(),Di=function(){function e(){j(this,e),this._zoomIn=new Pi({numTouches:1,numTaps:2}),this._zoomOut=new Pi({numTouches:2,numTaps:1}),this.reset()}return q(e,[{key:"reset",value:function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}},{key:"touchstart",value:function(e,t,r){this._zoomIn.touchstart(e,t,r),this._zoomOut.touchstart(e,t,r)}},{key:"touchmove",value:function(e,t,r){this._zoomIn.touchmove(e,t,r),this._zoomOut.touchmove(e,t,r)}},{key:"touchend",value:function(e,t,r){var i=this,n=this._zoomIn.touchend(e,t,r),a=this._zoomOut.touchend(e,t,r);return n?(this._active=!0,e.preventDefault(),setTimeout((function(){return i.reset()}),0),{cameraAnimation:function(t){return t.easeTo({duration:300,zoom:t.getZoom()+1,around:t.unproject(n)},{originalEvent:e})}}):a?(this._active=!0,e.preventDefault(),setTimeout((function(){return i.reset()}),0),{cameraAnimation:function(t){return t.easeTo({duration:300,zoom:t.getZoom()-1,around:t.unproject(a)},{originalEvent:e})}}):void 0}},{key:"touchcancel",value:function(){this.reset()}},{key:"enable",value:function(){this._enabled=!0}},{key:"disable",value:function(){this._enabled=!1,this.reset()}},{key:"isEnabled",value:function(){return this._enabled}},{key:"isActive",value:function(){return this._active}}]),e}(),Li={0:1,2:2},Ri=function(){function e(t){j(this,e),this.reset(),this._clickTolerance=t.clickTolerance||1}return q(e,[{key:"reset",value:function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton}},{key:"_correctButton",value:function(e,t){return!1}},{key:"_move",value:function(e,t){return{}}},{key:"mousedown",value:function(e,t){if(!this._lastPoint){var r=a.mouseButton(e);this._correctButton(e,r)&&(this._lastPoint=t,this._eventButton=r)}}},{key:"mousemoveWindow",value:function(e,t){var r=this._lastPoint;if(r)if(e.preventDefault(),function(e,t){var r=Li[t];return void 0===e.buttons||(e.buttons&r)!==r}(e,this._eventButton))this.reset();else if(this._moved||!(t.dist(r)<this._clickTolerance))return this._moved=!0,this._lastPoint=t,this._move(r,t)}},{key:"mouseupWindow",value:function(e){this._lastPoint&&a.mouseButton(e)===this._eventButton&&(this._moved&&a.suppressClick(),this.reset())}},{key:"enable",value:function(){this._enabled=!0}},{key:"disable",value:function(){this._enabled=!1,this.reset()}},{key:"isEnabled",value:function(){return this._enabled}},{key:"isActive",value:function(){return this._active}}]),e}(),Bi=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"mousedown",value:function(e,t){S(O(r.prototype),"mousedown",this).call(this,e,t),this._lastPoint&&(this._active=!0)}},{key:"_correctButton",value:function(e,t){return 0===t&&!e.ctrlKey}},{key:"_move",value:function(e,t){return{around:t,panDelta:t.sub(e)}}}]),r}(Ri),Fi=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"_correctButton",value:function(e,t){return 0===t&&e.ctrlKey||2===t}},{key:"_move",value:function(e,t){var r=.8*(t.x-e.x);if(r)return this._active=!0,{bearingDelta:r}}},{key:"contextmenu",value:function(e){e.preventDefault()}}]),r}(Ri),Oi=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"_correctButton",value:function(e,t){return 0===t&&e.ctrlKey||2===t}},{key:"_move",value:function(e,t){var r=-.5*(t.y-e.y);if(r)return this._active=!0,{pitchDelta:r}}},{key:"contextmenu",value:function(e){e.preventDefault()}}]),r}(Ri),Vi=function(){function t(e,r){j(this,t),this._minTouches=e.cooperativeGestures?2:1,this._clickTolerance=e.clickTolerance||1,this._map=r,this.reset()}return q(t,[{key:"reset",value:function(){var t=this;this._active=!1,this._touches={},this._sum=new e.pointGeometry(0,0),setTimeout((function(){t._cancelCooperativeMessage=!1}),200)}},{key:"touchstart",value:function(e,t,r){return this._calculateTransform(e,t,r)}},{key:"touchmove",value:function(e,t,r){if(this._map._cooperativeGestures&&(2===this._minTouches&&r.length<2&&!this._cancelCooperativeMessage?this._map._onCooperativeGesture(e,!1,r.length):this._cancelCooperativeMessage||(this._cancelCooperativeMessage=!0)),this._active&&!(r.length<this._minTouches))return e.preventDefault(),this._calculateTransform(e,t,r)}},{key:"touchend",value:function(e,t,r){this._calculateTransform(e,t,r),this._active&&r.length<this._minTouches&&this.reset()}},{key:"touchcancel",value:function(){this.reset()}},{key:"_calculateTransform",value:function(t,r,i){i.length>0&&(this._active=!0);var n=Ai(i,r),a=new e.pointGeometry(0,0),o=new e.pointGeometry(0,0),s=0;for(var l in n){var u=n[l],c=this._touches[l];c&&(a._add(u),o._add(u.sub(c)),s++,n[l]=u)}if(this._touches=n,!(s<this._minTouches)&&o.mag()){var h=o.div(s);return this._sum._add(h),this._sum.mag()<this._clickTolerance?void 0:{around:a.div(s),panDelta:h}}}},{key:"enable",value:function(){this._enabled=!0}},{key:"disable",value:function(){this._enabled=!1,this.reset()}},{key:"isEnabled",value:function(){return this._enabled}},{key:"isActive",value:function(){return this._active}}]),t}(),Ui=function(){function e(){j(this,e),this.reset()}return q(e,[{key:"reset",value:function(){this._active=!1,delete this._firstTwoTouches}},{key:"_start",value:function(e){}},{key:"_move",value:function(e,t,r){return{}}},{key:"touchstart",value:function(e,t,r){this._firstTwoTouches||r.length<2||(this._firstTwoTouches=[r[0].identifier,r[1].identifier],this._start([t[0],t[1]]))}},{key:"touchmove",value:function(e,t,r){if(this._firstTwoTouches){e.preventDefault();var i=V(this._firstTwoTouches,2),n=i[0],a=i[1],o=Ni(r,t,n),s=Ni(r,t,a);if(o&&s){var l=this._aroundCenter?null:o.add(s).div(2);return this._move([o,s],l,e)}}}},{key:"touchend",value:function(e,t,r){if(this._firstTwoTouches){var i=V(this._firstTwoTouches,2),n=i[0],o=i[1],s=Ni(r,t,n),l=Ni(r,t,o);s&&l||(this._active&&a.suppressClick(),this.reset())}}},{key:"touchcancel",value:function(){this.reset()}},{key:"enable",value:function(e){this._enabled=!0,this._aroundCenter=!!e&&"center"===e.around}},{key:"disable",value:function(){this._enabled=!1,this.reset()}},{key:"isEnabled",value:function(){return this._enabled}},{key:"isActive",value:function(){return this._active}}]),e}();function Ni(e,t,r){for(var i=0;i<e.length;i++)if(e[i].identifier===r)return t[i]}function ji(e,t){return Math.log(e/t)/Math.LN2}var Gi=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"reset",value:function(){S(O(r.prototype),"reset",this).call(this),delete this._distance,delete this._startDistance}},{key:"_start",value:function(e){this._startDistance=this._distance=e[0].dist(e[1])}},{key:"_move",value:function(e,t){var r=this._distance;if(this._distance=e[0].dist(e[1]),this._active||!(Math.abs(ji(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:ji(this._distance,r),pinchAround:t}}}]),r}(Ui);function qi(e,t){return 180*e.angleWith(t)/Math.PI}var Zi=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r,[{key:"reset",value:function(){S(O(r.prototype),"reset",this).call(this),delete this._minDiameter,delete this._startVector,delete this._vector}},{key:"_start",value:function(e){this._startVector=this._vector=e[0].sub(e[1]),this._minDiameter=e[0].dist(e[1])}},{key:"_move",value:function(e,t){var r=this._vector;if(this._vector=e[0].sub(e[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:qi(this._vector,r),pinchAround:t}}},{key:"_isBelowThreshold",value:function(e){this._minDiameter=Math.min(this._minDiameter,e.mag());var t=25/(Math.PI*this._minDiameter)*360,r=qi(e,this._startVector);return Math.abs(r)<t}}]),r}(Ui);function Xi(e){return Math.abs(e.y)>Math.abs(e.x)}var Hi=function(e){A(r,e);var t=M(r);function r(e){var i;return j(this,r),(i=t.call(this))._map=e,i}return q(r,[{key:"reset",value:function(){S(O(r.prototype),"reset",this).call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints}},{key:"touchstart",value:function(e,t,i){S(O(r.prototype),"touchstart",this).call(this,e,t,i),this._currentTouchCount=i.length}},{key:"_start",value:function(e){this._lastPoints=e,Xi(e[0].sub(e[1]))&&(this._valid=!1)}},{key:"_move",value:function(e,t,r){if(!(this._map._cooperativeGestures&&this._currentTouchCount<3)){var i=e[0].sub(this._lastPoints[0]),n=e[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(i,n,r.timeStamp),this._valid?(this._lastPoints=e,this._active=!0,{pitchDelta:(i.y+n.y)/2*-.5}):void 0}}},{key:"gestureBeginsVertically",value:function(e,t,r){if(void 0!==this._valid)return this._valid;var i=e.mag()>=2,n=t.mag()>=2;if(i||n){if(!i||!n)return void 0===this._firstMove&&(this._firstMove=r),r-this._firstMove<100&&void 0;var a=e.y>0==t.y>0;return Xi(e)&&Xi(t)&&a}}}]),r}(Ui),Wi={panStep:100,bearingStep:15,pitchStep:10},Ki=function(){function e(){j(this,e);var t=Wi;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep,this._rotationDisabled=!1}return q(e,[{key:"reset",value:function(){this._active=!1}},{key:"keydown",value:function(e){var t=this;if(!(e.altKey||e.ctrlKey||e.metaKey)){var r=0,i=0,n=0,a=0,o=0;switch(e.keyCode){case 61:case 107:case 171:case 187:r=1;break;case 189:case 109:case 173:r=-1;break;case 37:e.shiftKey?i=-1:(e.preventDefault(),a=-1);break;case 39:e.shiftKey?i=1:(e.preventDefault(),a=1);break;case 38:e.shiftKey?n=1:(e.preventDefault(),o=-1);break;case 40:e.shiftKey?n=-1:(e.preventDefault(),o=1);break;default:return}return this._rotationDisabled&&(i=0,n=0),{cameraAnimation:function(s){var l=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:Ji,zoom:r?Math.round(l)+r*(e.shiftKey?2:1):l,bearing:s.getBearing()+i*t._bearingStep,pitch:s.getPitch()+n*t._pitchStep,offset:[-a*t._panStep,-o*t._panStep],center:s.getCenter()},{originalEvent:e})}}}}},{key:"enable",value:function(){this._enabled=!0}},{key:"disable",value:function(){this._enabled=!1,this.reset()}},{key:"isEnabled",value:function(){return this._enabled}},{key:"isActive",value:function(){return this._active}},{key:"disableRotation",value:function(){this._rotationDisabled=!0}},{key:"enableRotation",value:function(){this._rotationDisabled=!1}}]),e}();function Ji(e){return e*(2-e)}var Yi=4.000244140625,Qi=function(){function t(r,i){j(this,t),this._map=r,this._el=r.getCanvasContainer(),this._handler=i,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222,e.bindAll(["_onTimeout"],this)}return q(t,[{key:"setZoomRate",value:function(e){this._defaultZoomRate=e}},{key:"setWheelZoomRate",value:function(e){this._wheelZoomRate=e}},{key:"isEnabled",value:function(){return!!this._enabled}},{key:"isActive",value:function(){return!!this._active||void 0!==this._finishTimeout}},{key:"isZooming",value:function(){return!!this._zooming}},{key:"enable",value:function(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=e&&"center"===e.around)}},{key:"disable",value:function(){this.isEnabled()&&(this._enabled=!1)}},{key:"wheel",value:function(t){if(this.isEnabled()){if(this._map._cooperativeGestures){if(!this._map._metaPress)return;t.preventDefault()}var r=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY,i=e.exported.now(),n=i-(this._lastWheelEventTime||0);this._lastWheelEventTime=i,0!==r&&r%Yi==0?this._type="wheel":0!==r&&Math.abs(r)<4?this._type="trackpad":n>400?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(n*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),t.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=t,this._delta-=r,this._active||this._start(t)),t.preventDefault()}}},{key:"_onTimeout",value:function(e){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(e)}},{key:"_start",value:function(t){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var r=a.mousePos(this._el,t);this._around=e.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(r)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}}},{key:"renderFrame",value:function(){var t=this;if(this._frameId&&(this._frameId=null,this.isActive())){var r=this._map.transform;if(0!==this._delta){var i="wheel"===this._type&&Math.abs(this._delta)>Yi?this._wheelZoomRate:this._defaultZoomRate,n=2/(1+Math.exp(-Math.abs(this._delta*i)));this._delta<0&&0!==n&&(n=1/n);var a="number"==typeof this._targetZoom?r.zoomScale(this._targetZoom):r.scale;this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(a*n))),"wheel"===this._type&&(this._startZoom=r.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var o,s="number"==typeof this._targetZoom?this._targetZoom:r.zoom,l=this._startZoom,u=this._easing,c=!1;if("wheel"===this._type&&l&&u){var h=Math.min((e.exported.now()-this._lastWheelEventTime)/200,1),p=u(h);o=e.number(l,s,p),h<1?this._frameId||(this._frameId=!0):c=!0}else o=s,c=!0;return this._active=!0,c&&(this._active=!1,this._finishTimeout=setTimeout((function(){t._zooming=!1,t._handler._triggerRenderFrame(),delete t._targetZoom,delete t._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!c,zoomDelta:o-r.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}}},{key:"_smoothOutEasing",value:function(t){var r=e.ease;if(this._prevEase){var i=this._prevEase,n=(e.exported.now()-i.start)/i.duration,a=i.easing(n+.01)-i.easing(n),o=.27/Math.sqrt(a*a+1e-4)*.01,s=Math.sqrt(.0729-o*o);r=e.bezier(o,s,.25,1)}return this._prevEase={start:e.exported.now(),duration:t,easing:r},r}},{key:"reset",value:function(){this._active=!1}}]),t}(),$i=function(){function e(t,r){j(this,e),this._clickZoom=t,this._tapZoom=r}return q(e,[{key:"enable",value:function(){this._clickZoom.enable(),this._tapZoom.enable()}},{key:"disable",value:function(){this._clickZoom.disable(),this._tapZoom.disable()}},{key:"isEnabled",value:function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}},{key:"isActive",value:function(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}]),e}(),en=function(){function e(){j(this,e),this.reset()}return q(e,[{key:"reset",value:function(){this._active=!1}},{key:"dblclick",value:function(e,t){return e.preventDefault(),{cameraAnimation:function(r){r.easeTo({duration:300,zoom:r.getZoom()+(e.shiftKey?-1:1),around:r.unproject(t)},{originalEvent:e})}}}},{key:"enable",value:function(){this._enabled=!0}},{key:"disable",value:function(){this._enabled=!1,this.reset()}},{key:"isEnabled",value:function(){return this._enabled}},{key:"isActive",value:function(){return this._active}}]),e}(),tn=function(){function e(){j(this,e),this._tap=new Pi({numTouches:1,numTaps:1}),this.reset()}return q(e,[{key:"reset",value:function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()}},{key:"touchstart",value:function(e,t,r){this._swipePoint||(this._tapTime&&e.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?r.length>0&&(this._swipePoint=t[0],this._swipeTouch=r[0].identifier):this._tap.touchstart(e,t,r))}},{key:"touchmove",value:function(e,t,r){if(this._tapTime){if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;var i=t[0],n=i.y-this._swipePoint.y;return this._swipePoint=i,e.preventDefault(),this._active=!0,{zoomDelta:n/128}}}else this._tap.touchmove(e,t,r)}},{key:"touchend",value:function(e,t,r){this._tapTime?this._swipePoint&&0===r.length&&this.reset():this._tap.touchend(e,t,r)&&(this._tapTime=e.timeStamp)}},{key:"touchcancel",value:function(){this.reset()}},{key:"enable",value:function(){this._enabled=!0}},{key:"disable",value:function(){this._enabled=!1,this.reset()}},{key:"isEnabled",value:function(){return this._enabled}},{key:"isActive",value:function(){return this._active}}]),e}(),rn=function(){function e(t,r,i){j(this,e),this._el=t,this._mousePan=r,this._touchPan=i}return q(e,[{key:"enable",value:function(e){this._inertiaOptions=e||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan","mapboxgl-touch-drag-pan")}},{key:"disable",value:function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan","mapboxgl-touch-drag-pan")}},{key:"isEnabled",value:function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}},{key:"isActive",value:function(){return this._mousePan.isActive()||this._touchPan.isActive()}}]),e}(),nn=function(){function e(t,r,i){j(this,e),this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=r,this._mousePitch=i}return q(e,[{key:"enable",value:function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}},{key:"disable",value:function(){this._mouseRotate.disable(),this._mousePitch.disable()}},{key:"isEnabled",value:function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}},{key:"isActive",value:function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}]),e}(),an=function(){function e(t,r,i,n){j(this,e),this._el=t,this._touchZoom=r,this._touchRotate=i,this._tapDragZoom=n,this._rotationDisabled=!1,this._enabled=!0}return q(e,[{key:"enable",value:function(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate","mapboxgl-touch-zoom-rotate")}},{key:"disable",value:function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate","mapboxgl-touch-zoom-rotate")}},{key:"isEnabled",value:function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}},{key:"isActive",value:function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}},{key:"disableRotation",value:function(){this._rotationDisabled=!0,this._touchRotate.disable()}},{key:"enableRotation",value:function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}]),e}(),on=function(e){return e.zoom||e.drag||e.pitch||e.rotate},sn=function(e){A(r,e);var t=M(r);function r(){return j(this,r),t.apply(this,arguments)}return q(r)}(e.Event);function ln(e){return e.panDelta&&e.panDelta.mag()||e.zoomDelta||e.bearingDelta||e.pitchDelta}var un=function(){function t(r,i){j(this,t),this._map=r,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new bi(r),this._bearingSnap=i.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(i),e.bindAll(["handleEvent","handleWindowEvent"],this);var n=this._el;this._listeners=[[n,"touchstart",{passive:!0}],[n,"touchmove",{passive:!1}],[n,"touchend",void 0],[n,"touchcancel",void 0],[n,"mousedown",void 0],[n,"mousemove",void 0],[n,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[n,"mouseover",void 0],[n,"mouseout",void 0],[n,"dblclick",void 0],[n,"click",void 0],[n,"keydown",{capture:!1}],[n,"keyup",void 0],[n,"wheel",{passive:!1}],[n,"contextmenu",void 0],[window,"blur",void 0]];var o,s=K(this._listeners);try{for(s.s();!(o=s.n()).done;){var l=V(o.value,3),u=l[0],c=l[1],h=l[2];a.addEventListener(u,c,u===document?this.handleWindowEvent:this.handleEvent,h)}}catch(p){s.e(p)}finally{s.f()}}return q(t,[{key:"destroy",value:function(){var e,t=K(this._listeners);try{for(t.s();!(e=t.n()).done;){var r=V(e.value,3),i=r[0],n=r[1],o=r[2];a.removeEventListener(i,n,i===document?this.handleWindowEvent:this.handleEvent,o)}}catch(s){t.e(s)}finally{t.f()}}},{key:"_addDefaultHandlers",value:function(e){var t=this._map,r=t.getCanvasContainer();this._add("mapEvent",new Ci(t,e));var i=t.boxZoom=new zi(t,e);this._add("boxZoom",i);var n=new Di,a=new en;t.doubleClickZoom=new $i(a,n),this._add("tapZoom",n),this._add("clickZoom",a);var o=new tn;this._add("tapDragZoom",o);var s=t.touchPitch=new Hi(t);this._add("touchPitch",s);var l=new Fi(e),u=new Oi(e);t.dragRotate=new nn(e,l,u),this._add("mouseRotate",l,["mousePitch"]),this._add("mousePitch",u,["mouseRotate"]);var c=new Bi(e),h=new Vi(e,t);t.dragPan=new rn(r,c,h),this._add("mousePan",c),this._add("touchPan",h,["touchZoom","touchRotate"]);var p=new Zi,f=new Gi;t.touchZoomRotate=new an(r,f,p,o),this._add("touchRotate",p,["touchPan","touchZoom"]),this._add("touchZoom",f,["touchPan","touchRotate"]);var d=t.scrollZoom=new Qi(t,this);this._add("scrollZoom",d,["mousePan"]);var m=t.keyboard=new Ki;this._add("keyboard",m),this._add("blockableMapEvent",new Ii(t));for(var v=0,y=["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"];v<y.length;v++){var g=y[v];e.interactive&&e[g]&&t[g].enable(e[g])}}},{key:"_add",value:function(e,t,r){this._handlers.push({handlerName:e,handler:t,allowed:r}),this._handlersById[e]=t}},{key:"stop",value:function(e){if(!this._updatingCamera){var t,r=K(this._handlers);try{for(r.s();!(t=r.n()).done;)t.value.handler.reset()}catch(i){r.e(i)}finally{r.f()}this._inertia.clear(),this._fireEvents({},{},e),this._changes=[]}}},{key:"isActive",value:function(){var e,t=K(this._handlers);try{for(t.s();!(e=t.n()).done;)if(e.value.handler.isActive())return!0}catch(r){t.e(r)}finally{t.f()}return!1}},{key:"isZooming",value:function(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}},{key:"isRotating",value:function(){return!!this._eventsInProgress.rotate}},{key:"isMoving",value:function(){return Boolean(on(this._eventsInProgress))||this.isZooming()}},{key:"_blockedByActive",value:function(e,t,r){for(var i in e)if(i!==r&&(!t||t.indexOf(i)<0))return!0;return!1}},{key:"handleWindowEvent",value:function(e){this.handleEvent(e,"".concat(e.type,"Window"))}},{key:"_getMapTouches",value:function(e){var t,r=[],i=K(e);try{for(i.s();!(t=i.n()).done;){var n=t.value;this._el.contains(n.target)&&r.push(n)}}catch(a){i.e(a)}finally{i.f()}return r}},{key:"handleEvent",value:function(e,t){if("blur"!==e.type){this._updatingCamera=!0;var r,i="renderFrame"===e.type?void 0:e,n={needsRenderFrame:!1},o={},s={},l=e.touches,u=l?this._getMapTouches(l):void 0,c=u?a.touchPos(this._el,u):a.mousePos(this._el,e),h=K(this._handlers);try{for(h.s();!(r=h.n()).done;){var p=r.value,f=p.handlerName,d=p.handler,m=p.allowed;if(d.isEnabled()){var v=void 0;this._blockedByActive(s,m,f)?d.reset():d[t||e.type]&&(v=d[t||e.type](e,c,u),this.mergeHandlerResult(n,o,v,f,i),v&&v.needsRenderFrame&&this._triggerRenderFrame()),(v||d.isActive())&&(s[f]=d)}}}catch(x){h.e(x)}finally{h.f()}var y={};for(var g in this._previousActiveHandlers)s[g]||(y[g]=i);this._previousActiveHandlers=s,(Object.keys(y).length||ln(n))&&(this._changes.push([n,o,y]),this._triggerRenderFrame()),(Object.keys(s).length||ln(n))&&this._map._stop(!0),this._updatingCamera=!1;var _=n.cameraAnimation;_&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],_(this._map))}else this.stop(!0)}},{key:"mergeHandlerResult",value:function(t,r,i,n,a){if(i){e.extend(t,i);var o={handlerName:n,originalEvent:i.originalEvent||a};void 0!==i.zoomDelta&&(r.zoom=o),void 0!==i.panDelta&&(r.drag=o),void 0!==i.pitchDelta&&(r.pitch=o),void 0!==i.bearingDelta&&(r.rotate=o)}}},{key:"_applyChanges",value:function(){var t,r={},i={},n={},a=K(this._changes);try{for(a.s();!(t=a.n()).done;){var o=V(t.value,3),s=o[0],l=o[1],u=o[2];s.panDelta&&(r.panDelta=(r.panDelta||new e.pointGeometry(0,0))._add(s.panDelta)),s.zoomDelta&&(r.zoomDelta=(r.zoomDelta||0)+s.zoomDelta),s.bearingDelta&&(r.bearingDelta=(r.bearingDelta||0)+s.bearingDelta),s.pitchDelta&&(r.pitchDelta=(r.pitchDelta||0)+s.pitchDelta),void 0!==s.around&&(r.around=s.around),void 0!==s.pinchAround&&(r.pinchAround=s.pinchAround),s.noInertia&&(r.noInertia=s.noInertia),e.extend(i,l),e.extend(n,u)}}catch(c){a.e(c)}finally{a.f()}this._updateMapTransform(r,i,n),this._changes=[]}},{key:"_updateMapTransform",value:function(t,r,i){var n=this._map,a=n.transform,o=n.style&&n.style.terrain;if(!(ln(t)||o&&this._drag))return this._fireEvents(r,i,!0);var s=t.panDelta,l=t.zoomDelta,u=t.bearingDelta,c=t.pitchDelta,h=t.around,p=t.pinchAround;void 0!==p&&(h=p),n._stop(!0),h=h||n.transform.centerPoint;var f=a.pointLocation(s?h.sub(s):h);u&&(a.bearing+=u),c&&(a.pitch+=c),l&&(a.zoom+=l),o?r.drag&&!this._drag?(this._drag={center:a.centerPoint,lngLat:a.pointLocation(h),point:h,handlerName:r.drag.handlerName},n.fire(new e.Event("freezeElevation",{freeze:!0}))):this._drag&&i[this._drag.handlerName]?(n.fire(new e.Event("freezeElevation",{freeze:!1})),this._drag=null):r.drag&&this._drag&&(a.center=a.pointLocation(a.centerPoint.sub(s))):a.setLocationAtPoint(f,h),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(r,i,!0)}},{key:"_fireEvents",value:function(t,r,i){var n=this,a=on(this._eventsInProgress),o=on(t),s={};for(var l in t){var u=t[l].originalEvent;this._eventsInProgress[l]||(s["".concat(l,"start")]=u),this._eventsInProgress[l]=t[l]}for(var c in!a&&o&&this._fireEvent("movestart",o.originalEvent),s)this._fireEvent(c,s[c]);for(var h in o&&this._fireEvent("move",o.originalEvent),t){var p=t[h].originalEvent;this._fireEvent(h,p)}var f,d={};for(var m in this._eventsInProgress){var v=this._eventsInProgress[m],y=v.handlerName,g=v.originalEvent;this._handlersById[y].isActive()||(delete this._eventsInProgress[m],f=r[y]||g,d["".concat(m,"end")]=f)}for(var _ in d)this._fireEvent(_,d[_]);var x=on(this._eventsInProgress);if(i&&(a||o)&&!x){this._updatingCamera=!0;var b=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),w=function(e){return 0!==e&&-n._bearingSnap<e&&e<n._bearingSnap};b?(w(b.bearing||this._map.getBearing())&&(b.bearing=0),this._map.easeTo(b,{originalEvent:f})):(this._map.fire(new e.Event("moveend",{originalEvent:f})),w(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}}},{key:"_fireEvent",value:function(t,r){this._map.fire(new e.Event(t,r?{originalEvent:r}:{}))}},{key:"_requestFrame",value:function(){var e=this;return this._map.triggerRepaint(),this._map._renderTaskQueue.add((function(t){delete e._frameId,e.handleEvent(new sn("renderFrame",{timeStamp:t})),e._applyChanges()}))}},{key:"_triggerRenderFrame",value:function(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}]),t}(),cn={extend:function(t){for(var r=arguments.length,i=new Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];return e.extend.apply(e,[t].concat(i))},run:function(e){e()},logToElement:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"log",i=window.document.getElementById(r);i&&(t&&(i.innerHTML=""),i.innerHTML+="<br>".concat(e))}},hn=function(t){A(i,t);var r=M(i);function i(t,n){var a;return j(this,i),(a=r.call(this))._moving=!1,a._zooming=!1,a.transform=t,a._bearingSnap=n.bearingSnap,e.bindAll(["_renderFrameCallback"],D(a)),a}return q(i,[{key:"getCenter",value:function(){return new e.LngLat(this.transform.center.lng,this.transform.center.lat)}},{key:"setCenter",value:function(e,t){return this.jumpTo({center:e},t)}},{key:"panBy",value:function(t,r,i){return t=e.pointGeometry.convert(t).mult(-1),this.panTo(this.transform.center,e.extend({offset:t},r),i)}},{key:"panTo",value:function(t,r,i){return this.easeTo(e.extend({center:t},r),i)}},{key:"getZoom",value:function(){return this.transform.zoom}},{key:"setZoom",value:function(e,t){return this.jumpTo({zoom:e},t),this}},{key:"zoomTo",value:function(t,r,i){return this.easeTo(e.extend({zoom:t},r),i)}},{key:"zoomIn",value:function(e,t){return this.zoomTo(this.getZoom()+1,e,t),this}},{key:"zoomOut",value:function(e,t){return this.zoomTo(this.getZoom()-1,e,t),this}},{key:"getBearing",value:function(){return this.transform.bearing}},{key:"setBearing",value:function(e,t){return this.jumpTo({bearing:e},t),this}},{key:"getPadding",value:function(){return this.transform.padding}},{key:"setPadding",value:function(e,t){return this.jumpTo({padding:e},t),this}},{key:"rotateTo",value:function(t,r,i){return this.easeTo(e.extend({bearing:t},r),i)}},{key:"resetNorth",value:function(t,r){return this.rotateTo(0,e.extend({duration:1e3},t),r),this}},{key:"resetNorthPitch",value:function(t,r){return this.easeTo(e.extend({bearing:0,pitch:0,duration:1e3},t),r),this}},{key:"snapToNorth",value:function(e,t){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(e,t):this}},{key:"getPitch",value:function(){return this.transform.pitch}},{key:"setPitch",value:function(e,t){return this.jumpTo({pitch:e},t),this}},{key:"cameraForBounds",value:function(t,r){t=e.LngLatBounds.convert(t);var i=r&&r.bearing||0;return this._cameraForBoxAndBearing(t.getNorthWest(),t.getSouthEast(),i,r)}},{key:"_cameraForBoxAndBearing",value:function(t,r,i,n){var a={top:0,bottom:0,right:0,left:0};if("number"==typeof(n=e.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=e.extend(a,n.padding);var s=this.transform,l=s.padding,u=s.project(e.LngLat.convert(t)),c=s.project(e.LngLat.convert(r)),h=u.rotate(-i*Math.PI/180),p=c.rotate(-i*Math.PI/180),f=new e.pointGeometry(Math.max(h.x,p.x),Math.max(h.y,p.y)),d=new e.pointGeometry(Math.min(h.x,p.x),Math.min(h.y,p.y)),m=f.sub(d),v=(s.width-(l.left+l.right+n.padding.left+n.padding.right))/m.x,y=(s.height-(l.top+l.bottom+n.padding.top+n.padding.bottom))/m.y;if(!(y<0||v<0)){var g=Math.min(s.scaleZoom(s.scale*Math.min(v,y)),n.maxZoom),_=e.pointGeometry.convert(n.offset),x=new e.pointGeometry((n.padding.left-n.padding.right)/2,(n.padding.top-n.padding.bottom)/2).rotate(i*Math.PI/180),b=_.add(x).mult(s.scale/s.zoomScale(g));return{center:s.unproject(u.add(c).div(2).sub(b)),zoom:g,bearing:i}}e.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.")}},{key:"fitBounds",value:function(e,t,r){return this._fitInternal(this.cameraForBounds(e,t),t,r)}},{key:"fitScreenCoordinates",value:function(t,r,i,n,a){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(e.pointGeometry.convert(t)),this.transform.pointLocation(e.pointGeometry.convert(r)),i,n),n,a)}},{key:"_fitInternal",value:function(t,r,i){return t?(delete(r=e.extend(t,r)).padding,r.linear?this.easeTo(r,i):this.flyTo(r,i)):this}},{key:"jumpTo",value:function(t,r){this.stop();var i=this.transform,n=!1,a=!1,o=!1;return"zoom"in t&&i.zoom!==+t.zoom&&(n=!0,i.zoom=+t.zoom),void 0!==t.center&&(i.center=e.LngLat.convert(t.center)),"bearing"in t&&i.bearing!==+t.bearing&&(a=!0,i.bearing=+t.bearing),"pitch"in t&&i.pitch!==+t.pitch&&(o=!0,i.pitch=+t.pitch),null==t.padding||i.isPaddingEqual(t.padding)||(i.padding=t.padding),this.fire(new e.Event("movestart",r)).fire(new e.Event("move",r)),n&&this.fire(new e.Event("zoomstart",r)).fire(new e.Event("zoom",r)).fire(new e.Event("zoomend",r)),a&&this.fire(new e.Event("rotatestart",r)).fire(new e.Event("rotate",r)).fire(new e.Event("rotateend",r)),o&&this.fire(new e.Event("pitchstart",r)).fire(new e.Event("pitch",r)).fire(new e.Event("pitchend",r)),this.fire(new e.Event("moveend",r))}},{key:"calculateCameraOptionsFromTo",value:function(t,r,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=e.MercatorCoordinate.fromLngLat(t,r),o=e.MercatorCoordinate.fromLngLat(i,n),s=o.x-a.x,l=o.y-a.y,u=o.z-a.z,c=Math.hypot(s,l,u);if(0===c)throw new Error("Can't calculate camera options with same From and To");var h=Math.hypot(s,l),p=this.transform.scaleZoom(this.transform.cameraToCenterDistance/c/this.transform.tileSize),f=180*Math.atan2(s,-l)/Math.PI,d=180*Math.acos(h/c)/Math.PI;return d=u<0?90-d:90+d,{center:o.toLngLat(),zoom:p,pitch:d,bearing:f}}},{key:"easeTo",value:function(t,r){var i=this;this._stop(!1,t.easeId),(!1===(t=e.extend({offset:[0,0],duration:500,easing:e.ease},t)).animate||!t.essential&&e.exported.prefersReducedMotion)&&(t.duration=0);var n=this.transform,a=this.getZoom(),o=this.getBearing(),s=this.getPitch(),l=this.getPadding(),u="zoom"in t?+t.zoom:a,c="bearing"in t?this._normalizeBearing(t.bearing,o):o,h="pitch"in t?+t.pitch:s,p="padding"in t?t.padding:n.padding,f=e.pointGeometry.convert(t.offset),d=n.centerPoint.add(f),m=n.pointLocation(d),v=e.LngLat.convert(t.center||m);this._normalizeCenter(v);var y,g,_=n.project(m),x=n.project(v).sub(_),b=n.zoomScale(u-a);t.around&&(y=e.LngLat.convert(t.around),g=n.locationPoint(y));var w={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||u!==a,this._rotating=this._rotating||o!==c,this._pitching=this._pitching||h!==s,this._padding=!n.isPaddingEqual(p),this._easeId=t.easeId,this._prepareEase(r,t.noMoveStart,w),this._ease((function(t){if(i._zooming&&(n.zoom=e.number(a,u,t)),i._rotating&&(n.bearing=e.number(o,c,t)),i._pitching&&(n.pitch=e.number(s,h,t)),i._padding&&(n.interpolatePadding(l,p,t),d=n.centerPoint.add(f)),y)n.setLocationAtPoint(y,g);else{var m=n.zoomScale(n.zoom-a),v=u>a?Math.min(2,b):Math.max(.5,b),w=Math.pow(v,1-t),k=n.unproject(_.add(x.mult(t*w)).mult(m));n.setLocationAtPoint(n.renderWorldCopies?k.wrap():k,d)}i._fireMoveEvents(r)}),(function(e){i._afterEase(r,e)}),t),this}},{key:"_prepareEase",value:function(t,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this._moving=!0,this.fire(new e.Event("freezeElevation",{freeze:!0})),r||i.moving||this.fire(new e.Event("movestart",t)),this._zooming&&!i.zooming&&this.fire(new e.Event("zoomstart",t)),this._rotating&&!i.rotating&&this.fire(new e.Event("rotatestart",t)),this._pitching&&!i.pitching&&this.fire(new e.Event("pitchstart",t))}},{key:"_fireMoveEvents",value:function(t){this.fire(new e.Event("move",t)),this._zooming&&this.fire(new e.Event("zoom",t)),this._rotating&&this.fire(new e.Event("rotate",t)),this._pitching&&this.fire(new e.Event("pitch",t))}},{key:"_afterEase",value:function(t,r){if(!this._easeId||!r||this._easeId!==r){delete this._easeId,this.fire(new e.Event("freezeElevation",{freeze:!1}));var i=this._zooming,n=this._rotating,a=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,i&&this.fire(new e.Event("zoomend",t)),n&&this.fire(new e.Event("rotateend",t)),a&&this.fire(new e.Event("pitchend",t)),this.fire(new e.Event("moveend",t))}}},{key:"flyTo",value:function(t,r){var i=this;if(!t.essential&&e.exported.prefersReducedMotion){var n=e.pick(t,["center","zoom","bearing","pitch","around"]);return this.jumpTo(n,r)}this.stop(),t=e.extend({offset:[0,0],speed:1.2,curve:1.42,easing:e.ease},t);var a=this.transform,o=this.getZoom(),s=this.getBearing(),l=this.getPitch(),u=this.getPadding(),c="zoom"in t?e.clamp(+t.zoom,a.minZoom,a.maxZoom):o,h="bearing"in t?this._normalizeBearing(t.bearing,s):s,p="pitch"in t?+t.pitch:l,f="padding"in t?t.padding:a.padding,d=a.zoomScale(c-o),m=e.pointGeometry.convert(t.offset),v=a.centerPoint.add(m),y=a.pointLocation(v),g=e.LngLat.convert(t.center||y);this._normalizeCenter(g);var _=a.project(y),x=a.project(g).sub(_),b=t.curve,w=Math.max(a.width,a.height),k=w/d,E=x.mag();if("minZoom"in t){var T=e.clamp(Math.min(t.minZoom,o,c),a.minZoom,a.maxZoom),S=w/a.zoomScale(T-o);b=Math.sqrt(S/E*2)}var C=b*b;function I(e){var t=(k*k-w*w+(e?-1:1)*C*C*E*E)/(2*(e?k:w)*C*E);return Math.log(Math.sqrt(t*t+1)-t)}function z(e){return(Math.exp(e)-Math.exp(-e))/2}function A(e){return(Math.exp(e)+Math.exp(-e))/2}var M=I(0),P=function(e){return A(M)/A(M+b*e)},D=function(e){return w*((A(M)*(z(t=M+b*e)/A(t))-z(M))/C)/E;var t},L=(I(1)-M)/b;if(Math.abs(E)<1e-6||!isFinite(L)){if(Math.abs(w-k)<1e-6)return this.easeTo(t,r);var R=k<w?-1:1;L=Math.abs(Math.log(k/w))/b,D=function(){return 0},P=function(e){return Math.exp(R*b*e)}}return t.duration="duration"in t?+t.duration:1e3*L/("screenSpeed"in t?+t.screenSpeed/b:+t.speed),t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=s!==h,this._pitching=p!==l,this._padding=!a.isPaddingEqual(f),this._prepareEase(r,!1),this._ease((function(t){var n=t*L,d=1/P(n);a.zoom=1===t?c:o+a.scaleZoom(d),i._rotating&&(a.bearing=e.number(s,h,t)),i._pitching&&(a.pitch=e.number(l,p,t)),i._padding&&(a.interpolatePadding(u,f,t),v=a.centerPoint.add(m));var y=1===t?g:a.unproject(_.add(x.mult(D(n))).mult(d));a.setLocationAtPoint(a.renderWorldCopies?y.wrap():y,v),i._fireMoveEvents(r)}),(function(){return i._afterEase(r)}),t),this}},{key:"isEasing",value:function(){return!!this._easeFrameId}},{key:"stop",value:function(){return this._stop()}},{key:"_stop",value:function(e,t){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var r=this._onEaseEnd;delete this._onEaseEnd,r.call(this,t)}if(!e){var i=this.handlers;i&&i.stop(!1)}return this}},{key:"_ease",value:function(t,r,i){!1===i.animate||0===i.duration?(t(1),r()):(this._easeStart=e.exported.now(),this._easeOptions=i,this._onEaseFrame=t,this._onEaseEnd=r,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}},{key:"_renderFrameCallback",value:function(){var t=Math.min((e.exported.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(t)),t<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}},{key:"_normalizeBearing",value:function(t,r){t=e.wrap(t,-180,180);var i=Math.abs(t-r);return Math.abs(t-360-r)<i&&(t-=360),Math.abs(t+360-r)<i&&(t+=360),t}},{key:"_normalizeCenter",value:function(e){var t=this.transform;if(t.renderWorldCopies&&!t.lngRange){var r=e.lng-t.center.lng;e.lng+=r>180?-360:r<-180?360:0}}}]),i}(e.Evented),pn=function(){function t(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};j(this,t),this.options=r,e.bindAll(["_toggleAttribution","_updateData","_updateCompact","_updateCompactMinimize"],this)}return q(t,[{key:"getDefaultPosition",value:function(){return"bottom-right"}},{key:"onAdd",value:function(e){return this._map=e,this._compact=this.options&&this.options.compact,this._container=a.create("details","maplibregl-ctrl maplibregl-ctrl-attrib mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=a.create("summary","maplibregl-ctrl-attrib-button mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=a.create("div","maplibregl-ctrl-attrib-inner mapboxgl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}},{key:"onRemove",value:function(){a.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}},{key:"_setElementTitle",value:function(e,t){var r=this._map._getUIString("AttributionControl.".concat(t));e.title=r,e.setAttribute("aria-label",r)}},{key:"_toggleAttribution",value:function(){this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show","mapboxgl-compact-show")):(this._container.classList.add("maplibregl-compact-show","mapboxgl-compact-show"),this._container.removeAttribute("open")))}},{key:"_updateData",value:function(e){!e||"metadata"!==e.sourceDataType&&"visibility"!==e.sourceDataType&&"style"!==e.dataType&&"terrain"!==e.type||this._updateAttributions()}},{key:"_updateAttributions",value:function(){if(this._map.style){var e=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?e=e.concat(this.options.customAttribution.map((function(e){return"string"!=typeof e?"":e}))):"string"==typeof this.options.customAttribution&&e.push(this.options.customAttribution)),this._map.style.stylesheet){var t=this._map.style.stylesheet;this.styleOwner=t.owner,this.styleId=t.id}var r=this._map.style.sourceCaches;for(var i in r){var n=r[i];if(n.used||n.usedForTerrain){var a=n.getSource();a.attribution&&e.indexOf(a.attribution)<0&&e.push(a.attribution)}}(e=e.filter((function(e){return String(e).trim()}))).sort((function(e,t){return e.length-t.length})),e=e.filter((function(t,r){for(var i=r+1;i<e.length;i++)if(e[i].indexOf(t)>=0)return!1;return!0}));var o=e.join(" | ");o!==this._attribHTML&&(this._attribHTML=o,e.length?(this._innerContainer.innerHTML=o,this._container.classList.remove("maplibregl-attrib-empty","mapboxgl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty","mapboxgl-attrib-empty"),this._updateCompact(),this._editLink=null)}}},{key:"_updateCompact",value:function(){this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1===this._compact?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","mapboxgl-compact","maplibregl-compact-show","mapboxgl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show","mapboxgl-compact","mapboxgl-compact-show"))}},{key:"_updateCompactMinimize",value:function(){this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show","mapboxgl-compact-show")}}]),t}(),fn=function(){function t(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};j(this,t),this.options=r,e.bindAll(["_updateCompact"],this)}return q(t,[{key:"getDefaultPosition",value:function(){return"bottom-left"}},{key:"onAdd",value:function(e){this._map=e,this._compact=this.options&&this.options.compact,this._container=a.create("div","maplibregl-ctrl mapboxgl-ctrl");var t=a.create("a","maplibregl-ctrl-logo mapboxgl-ctrl-logo");return t.target="_blank",t.rel="noopener nofollow",t.href="https://maplibre.org/",t.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),t.setAttribute("rel","noopener nofollow"),this._container.appendChild(t),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}},{key:"onRemove",value:function(){a.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}},{key:"_updateCompact",value:function(){var e=this._container.children;if(e.length){var t=e[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1!==this._compact&&t.classList.add("maplibregl-compact","mapboxgl-compact"):t.classList.remove("maplibregl-compact","mapboxgl-compact")}}}]),t}(),dn=function(){function e(){j(this,e),this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}return q(e,[{key:"add",value:function(e){var t=++this._id;return this._queue.push({callback:e,id:t,cancelled:!1}),t}},{key:"remove",value:function(e){var t,r=this._currentlyRunning,i=K(r?this._queue.concat(r):this._queue);try{for(i.s();!(t=i.n()).done;){var n=t.value;if(n.id===e)return void(n.cancelled=!0)}}catch(a){i.e(a)}finally{i.f()}}},{key:"run",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");var t=this._currentlyRunning=this._queue;this._queue=[];var r,i=K(t);try{for(i.s();!(r=i.n()).done;){var n=r.value;if(!n.cancelled&&(n.callback(e),this._cleared))break}}catch(a){i.e(a)}finally{i.f()}this._cleared=!1,this._currentlyRunning=!1}},{key:"clear",value:function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}]),e}(),mn={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","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","TerrainControl.enableTerrain":"Enable terrain","TerrainControl.disableTerrain":"Disable terrain"},vn={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,touchPitch:!0,cooperativeGestures:void 0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,maplibreLogo:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",transformRequest:null,fadeDuration:300,crossSourceCollisions:!0},yn={showCompass:!0,showZoom:!0,visualizePitch:!1},gn=function(){function t(r,i){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];j(this,t),this._clickTolerance=10,this.element=i,this.mouseRotate=new Fi({clickTolerance:r.dragRotate._mouseRotate._clickTolerance}),this.map=r,n&&(this.mousePitch=new Oi({clickTolerance:r.dragRotate._mousePitch._clickTolerance})),e.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),a.addEventListener(i,"mousedown",this.mousedown),a.addEventListener(i,"touchstart",this.touchstart,{passive:!1}),a.addEventListener(i,"touchmove",this.touchmove),a.addEventListener(i,"touchend",this.touchend),a.addEventListener(i,"touchcancel",this.reset)}return q(t,[{key:"down",value:function(e,t){this.mouseRotate.mousedown(e,t),this.mousePitch&&this.mousePitch.mousedown(e,t),a.disableDrag()}},{key:"move",value:function(e,t){var r=this.map,i=this.mouseRotate.mousemoveWindow(e,t);if(i&&i.bearingDelta&&r.setBearing(r.getBearing()+i.bearingDelta),this.mousePitch){var n=this.mousePitch.mousemoveWindow(e,t);n&&n.pitchDelta&&r.setPitch(r.getPitch()+n.pitchDelta)}}},{key:"off",value:function(){var e=this.element;a.removeEventListener(e,"mousedown",this.mousedown),a.removeEventListener(e,"touchstart",this.touchstart,{passive:!1}),a.removeEventListener(e,"touchmove",this.touchmove),a.removeEventListener(e,"touchend",this.touchend),a.removeEventListener(e,"touchcancel",this.reset),this.offTemp()}},{key:"offTemp",value:function(){a.enableDrag(),a.removeEventListener(window,"mousemove",this.mousemove),a.removeEventListener(window,"mouseup",this.mouseup)}},{key:"mousedown",value:function(t){this.down(e.extend({},t,{ctrlKey:!0,preventDefault:function(){return t.preventDefault()}}),a.mousePos(this.element,t)),a.addEventListener(window,"mousemove",this.mousemove),a.addEventListener(window,"mouseup",this.mouseup)}},{key:"mousemove",value:function(e){this.move(e,a.mousePos(this.element,e))}},{key:"mouseup",value:function(e){this.mouseRotate.mouseupWindow(e),this.mousePitch&&this.mousePitch.mouseupWindow(e),this.offTemp()}},{key:"touchstart",value:function(e){1!==e.targetTouches.length?this.reset():(this._startPos=this._lastPos=a.touchPos(this.element,e.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return e.preventDefault()}},this._startPos))}},{key:"touchmove",value:function(e){1!==e.targetTouches.length?this.reset():(this._lastPos=a.touchPos(this.element,e.targetTouches)[0],this.move({preventDefault:function(){return e.preventDefault()}},this._lastPos))}},{key:"touchend",value:function(e){0===e.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()}},{key:"reset",value:function(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()}}]),t}();function _n(t,r,i){if(t=new e.LngLat(t.lng,t.lat),r){var n=new e.LngLat(t.lng-360,t.lat),a=new e.LngLat(t.lng+360,t.lat),o=i.locationPoint(t).distSqr(r);i.locationPoint(n).distSqr(r)<o?t=n:i.locationPoint(a).distSqr(r)<o&&(t=a)}for(;Math.abs(t.lng-i.center.lng)>180;){var s=i.locationPoint(t);if(s.x>=0&&s.y>=0&&s.x<=i.width&&s.y<=i.height)break;t.lng>i.center.lng?t.lng-=360:t.lng+=360}return t}var xn={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 bn(e,t,r){var i=e.classList;for(var n in xn)i.remove("maplibregl-".concat(r,"-anchor-").concat(n),"mapboxgl-".concat(r,"-anchor-").concat(n));i.add("maplibregl-".concat(r,"-anchor-").concat(t),"mapboxgl-".concat(r,"-anchor-").concat(t))}var wn,kn=function(t){A(i,t);var r=M(i);function i(t,n){var o;if(j(this,i),o=r.call(this),(t instanceof HTMLElement||n)&&(t=e.extend({element:t},n)),e.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],D(o)),o._anchor=t&&t.anchor||"center",o._color=t&&t.color||"#3FB1CE",o._scale=t&&t.scale||1,o._draggable=t&&t.draggable||!1,o._clickTolerance=t&&t.clickTolerance||0,o._isDragging=!1,o._state="inactive",o._rotation=t&&t.rotation||0,o._rotationAlignment=t&&t.rotationAlignment||"auto",o._pitchAlignment=t&&t.pitchAlignment&&"auto"!==t.pitchAlignment?t.pitchAlignment:o._rotationAlignment,t&&t.element)o._element=t.element,o._offset=e.pointGeometry.convert(t&&t.offset||[0,0]);else{o._defaultMarker=!0,o._element=a.create("div"),o._element.setAttribute("aria-label","Map marker");var s=a.createNS("http://www.w3.org/2000/svg","svg"),l=41,u=27;s.setAttributeNS(null,"display","block"),s.setAttributeNS(null,"height","".concat(l,"px")),s.setAttributeNS(null,"width","".concat(u,"px")),s.setAttributeNS(null,"viewBox","0 0 ".concat(u," ").concat(l));var c=a.createNS("http://www.w3.org/2000/svg","g");c.setAttributeNS(null,"stroke","none"),c.setAttributeNS(null,"stroke-width","1"),c.setAttributeNS(null,"fill","none"),c.setAttributeNS(null,"fill-rule","evenodd");var h=a.createNS("http://www.w3.org/2000/svg","g");h.setAttributeNS(null,"fill-rule","nonzero");var p=a.createNS("http://www.w3.org/2000/svg","g");p.setAttributeNS(null,"transform","translate(3.0, 29.0)"),p.setAttributeNS(null,"fill","#000000");for(var f=0,d=[{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"}];f<d.length;f++){var m=d[f],v=a.createNS("http://www.w3.org/2000/svg","ellipse");v.setAttributeNS(null,"opacity","0.04"),v.setAttributeNS(null,"cx","10.5"),v.setAttributeNS(null,"cy","5.80029008"),v.setAttributeNS(null,"rx",m.rx),v.setAttributeNS(null,"ry",m.ry),p.appendChild(v)}var y=a.createNS("http://www.w3.org/2000/svg","g");y.setAttributeNS(null,"fill",o._color);var g=a.createNS("http://www.w3.org/2000/svg","path");g.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"),y.appendChild(g);var _=a.createNS("http://www.w3.org/2000/svg","g");_.setAttributeNS(null,"opacity","0.25"),_.setAttributeNS(null,"fill","#000000");var x=a.createNS("http://www.w3.org/2000/svg","path");x.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"),_.appendChild(x);var b=a.createNS("http://www.w3.org/2000/svg","g");b.setAttributeNS(null,"transform","translate(6.0, 7.0)"),b.setAttributeNS(null,"fill","#FFFFFF");var w=a.createNS("http://www.w3.org/2000/svg","g");w.setAttributeNS(null,"transform","translate(8.0, 8.0)");var k=a.createNS("http://www.w3.org/2000/svg","circle");k.setAttributeNS(null,"fill","#000000"),k.setAttributeNS(null,"opacity","0.25"),k.setAttributeNS(null,"cx","5.5"),k.setAttributeNS(null,"cy","5.5"),k.setAttributeNS(null,"r","5.4999962");var E=a.createNS("http://www.w3.org/2000/svg","circle");E.setAttributeNS(null,"fill","#FFFFFF"),E.setAttributeNS(null,"cx","5.5"),E.setAttributeNS(null,"cy","5.5"),E.setAttributeNS(null,"r","5.4999962"),w.appendChild(k),w.appendChild(E),h.appendChild(p),h.appendChild(y),h.appendChild(_),h.appendChild(b),h.appendChild(w),s.appendChild(h),s.setAttributeNS(null,"height",l*o._scale+"px"),s.setAttributeNS(null,"width",u*o._scale+"px"),o._element.appendChild(s),o._offset=e.pointGeometry.convert(t&&t.offset||[0,-14])}return o._element.classList.add("maplibregl-marker","mapboxgl-marker"),o._element.addEventListener("dragstart",(function(e){e.preventDefault()})),o._element.addEventListener("mousedown",(function(e){e.preventDefault()})),bn(o._element,o._anchor,"marker"),o._popup=null,P(o)}return q(i,[{key:"addTo",value:function(e){return this.remove(),this._map=e,e.getCanvasContainer().appendChild(this._element),e.on("move",this._update),e.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}},{key:"remove",value:function(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),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),a.remove(this._element),this._popup&&this._popup.remove(),this}},{key:"getLngLat",value:function(){return this._lngLat}},{key:"setLngLat",value:function(t){return this._lngLat=e.LngLat.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}},{key:"getElement",value:function(){return this._element}},{key:"setPopup",value:function(e){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),e){if(!("offset"in e.options)){var t=38.1,r=13.5,i=Math.sqrt(Math.pow(r,2)/2);e.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-t],"bottom-left":[i,-1*(t-r+i)],"bottom-right":[-i,-1*(t-r+i)],left:[r,-1*(t-r)],right:[-r,-1*(t-r)]}:this._offset}this._popup=e,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}},{key:"_onKeyPress",value:function(e){var t=e.code,r=e.charCode||e.keyCode;"Space"!==t&&"Enter"!==t&&32!==r&&13!==r||this.togglePopup()}},{key:"_onMapClick",value:function(e){var t=e.originalEvent.target,r=this._element;this._popup&&(t===r||r.contains(t))&&this.togglePopup()}},{key:"getPopup",value:function(){return this._popup}},{key:"togglePopup",value:function(){var e=this._popup;return e?(e.isOpen()?e.remove():e.addTo(this._map),this):this}},{key:"_update",value:function(e){var t=this;if(this._map){this._map.transform.renderWorldCopies&&(this._lngLat=_n(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);var r="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?r="rotateZ(".concat(this._rotation,"deg)"):"map"===this._rotationAlignment&&(r="rotateZ(".concat(this._rotation-this._map.getBearing(),"deg)"));var i="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?i="rotateX(0deg)":"map"===this._pitchAlignment&&(i="rotateX(".concat(this._map.getPitch(),"deg)")),e&&"moveend"!==e.type||(this._pos=this._pos.round()),a.setTransform(this._element,"".concat(xn[this._anchor]," translate(").concat(this._pos.x,"px, ").concat(this._pos.y,"px) ").concat(i," ").concat(r)),this._map.style&&this._map.style.terrain&&!this._opacityTimeout&&(this._opacityTimeout=setTimeout((function(){var e=t._map.unproject(t._pos),r=40075016.686*Math.abs(Math.cos(t._lngLat.lat*Math.PI/180))/Math.pow(2,t._map.transform.tileZoom+8);t._element.style.opacity=e.distanceTo(t._lngLat)>20*r?"0.2":"1.0",t._opacityTimeout=null}),100))}}},{key:"getOffset",value:function(){return this._offset}},{key:"setOffset",value:function(t){return this._offset=e.pointGeometry.convert(t),this._update(),this}},{key:"_onMove",value:function(t){if(!this._isDragging){var r=this._clickTolerance||this._map._clickTolerance;this._isDragging=t.point.dist(this._pointerdownPos)>=r}this._isDragging&&(this._pos=t.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 e.Event("dragstart"))),this.fire(new e.Event("drag")))}},{key:"_onUp",value:function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new e.Event("dragend")),this._state="inactive"}},{key:"_addDragHandler",value:function(e){this._element.contains(e.originalEvent.target)&&(e.preventDefault(),this._positionDelta=e.point.sub(this._pos).add(this._offset),this._pointerdownPos=e.point,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))}},{key:"setDraggable",value:function(e){return this._draggable=!!e,this._map&&(e?(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}},{key:"isDraggable",value:function(){return this._draggable}},{key:"setRotation",value:function(e){return this._rotation=e||0,this._update(),this}},{key:"getRotation",value:function(){return this._rotation}},{key:"setRotationAlignment",value:function(e){return this._rotationAlignment=e||"auto",this._update(),this}},{key:"getRotationAlignment",value:function(){return this._rotationAlignment}},{key:"setPitchAlignment",value:function(e){return this._pitchAlignment=e&&"auto"!==e?e:this._rotationAlignment,this._update(),this}},{key:"getPitchAlignment",value:function(){return this._pitchAlignment}}]),i}(e.Evented),En={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Tn=0,Sn=!1,Cn={maxWidth:100,unit:"metric"};function In(e,t,r){var i=r&&r.maxWidth||100,n=e._container.clientHeight/2,a=e.unproject([0,n]),o=e.unproject([i,n]),s=a.distanceTo(o);if(r&&"imperial"===r.unit){var l=3.2808*s;l>5280?zn(t,i,l/5280,e._getUIString("ScaleControl.Miles")):zn(t,i,l,e._getUIString("ScaleControl.Feet"))}else r&&"nautical"===r.unit?zn(t,i,s/1852,e._getUIString("ScaleControl.NauticalMiles")):s>=1e3?zn(t,i,s/1e3,e._getUIString("ScaleControl.Kilometers")):zn(t,i,s,e._getUIString("ScaleControl.Meters"))}function zn(e,t,r,i){var n=function(e){var t=Math.pow(10,"".concat(Math.floor(e)).length-1),r=e/t;return r=r>=10?10:r>=5?5:r>=3?3:r>=2?2:r>=1?1:function(e){var t=Math.pow(10,Math.ceil(-Math.log(e)/Math.LN10));return Math.round(e*t)/t}(r),t*r}(r);e.style.width=t*(n/r)+"px",e.innerHTML="".concat(n," ").concat(i)}var An={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Mn=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function Pn(t){if(t){if("number"==typeof t){var r=Math.round(Math.sqrt(.5*Math.pow(t,2)));return{center:new e.pointGeometry(0,0),top:new e.pointGeometry(0,t),"top-left":new e.pointGeometry(r,r),"top-right":new e.pointGeometry(-r,r),bottom:new e.pointGeometry(0,-t),"bottom-left":new e.pointGeometry(r,-r),"bottom-right":new e.pointGeometry(-r,-r),left:new e.pointGeometry(t,0),right:new e.pointGeometry(-t,0)}}if(t instanceof e.pointGeometry||Array.isArray(t)){var i=e.pointGeometry.convert(t);return{center:i,top:i,"top-left":i,"top-right":i,bottom:i,"bottom-left":i,"bottom-right":i,left:i,right:i}}return{center:e.pointGeometry.convert(t.center||[0,0]),top:e.pointGeometry.convert(t.top||[0,0]),"top-left":e.pointGeometry.convert(t["top-left"]||[0,0]),"top-right":e.pointGeometry.convert(t["top-right"]||[0,0]),bottom:e.pointGeometry.convert(t.bottom||[0,0]),"bottom-left":e.pointGeometry.convert(t["bottom-left"]||[0,0]),"bottom-right":e.pointGeometry.convert(t["bottom-right"]||[0,0]),left:e.pointGeometry.convert(t.left||[0,0]),right:e.pointGeometry.convert(t.right||[0,0])}}return Pn(new e.pointGeometry(0,0))}var Dn={supported:t,setRTLTextPlugin:e.setRTLTextPlugin,getRTLTextPluginStatus:e.getRTLTextPluginStatus,Map:function(r){A(s,r);var n=M(s);function s(t){var r,i;if(j(this,s),e.PerformanceUtils.mark(e.PerformanceMarkers.create),null!=(t=e.extend({},vn,t)).minZoom&&null!=t.maxZoom&&t.minZoom>t.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=t.minPitch&&null!=t.maxPitch&&t.minPitch>t.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=t.minPitch&&t.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=t.maxPitch&&t.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if((r=n.call(this,new di(t.minZoom,t.maxZoom,t.minPitch,t.maxPitch,t.renderWorldCopies),{bearingSnap:t.bearingSnap}))._interactive=t.interactive,r._cooperativeGestures=t.cooperativeGestures,r._maxTileCacheSize=t.maxTileCacheSize,r._failIfMajorPerformanceCaveat=t.failIfMajorPerformanceCaveat,r._preserveDrawingBuffer=t.preserveDrawingBuffer,r._antialias=t.antialias,r._trackResize=t.trackResize,r._bearingSnap=t.bearingSnap,r._refreshExpiredTiles=t.refreshExpiredTiles,r._fadeDuration=t.fadeDuration,r._crossSourceCollisions=t.crossSourceCollisions,r._crossFadingFactor=1,r._collectResourceTiming=t.collectResourceTiming,r._renderTaskQueue=new dn,r._controls=[],r._mapId=e.uniqueId(),r._locale=e.extend({},mn,t.locale),r._clickTolerance=t.clickTolerance,r._pixelRatio=null!==(i=t.pixelRatio)&&void 0!==i?i:devicePixelRatio,r._requestManager=new o(t.transformRequest),"string"==typeof t.container){if(r._container=document.getElementById(t.container),!r._container)throw new Error("Container '".concat(t.container,"' not found."))}else{if(!(t.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");r._container=t.container}if(t.maxBounds&&r.setMaxBounds(t.maxBounds),e.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],D(r)),r._setupContainer(),r._setupPainter(),void 0===r.painter)throw new Error("Failed to initialize WebGL.");return r.on("move",(function(){return r._update(!1)})),r.on("moveend",(function(){return r._update(!1)})),r.on("zoom",(function(){return r._update(!0)})),r.on("terrain",(function(){r.painter.terrainFacilitator.dirty=!0,r._update(!0)})),"undefined"!=typeof window&&(addEventListener("online",r._onWindowOnline,!1),addEventListener("resize",r._onWindowResize,!1),addEventListener("orientationchange",r._onWindowResize,!1)),r.handlers=new un(D(r),t),r._cooperativeGestures&&r._setupCooperativeGestures(),r._hash=t.hash&&new mi("string"==typeof t.hash&&t.hash||void 0).addTo(D(r)),r._hash&&r._hash._onHashChange()||(r.jumpTo({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch}),t.bounds&&(r.resize(),r.fitBounds(t.bounds,e.extend({},t.fitBoundsOptions,{duration:0})))),r.resize(),r._localIdeographFontFamily=t.localIdeographFontFamily,t.style&&r.setStyle(t.style,{localIdeographFontFamily:t.localIdeographFontFamily}),t.attributionControl&&r.addControl(new pn({customAttribution:t.customAttribution})),t.maplibreLogo&&r.addControl(new fn,t.logoPosition),r.on("style.load",(function(){r.transform.unmodified&&r.jumpTo(r.style.stylesheet)})),r.on("data",(function(t){r._update("style"===t.dataType),r.fire(new e.Event("".concat(t.dataType,"data"),t))})),r.on("dataloading",(function(t){r.fire(new e.Event("".concat(t.dataType,"dataloading"),t))})),r.on("dataabort",(function(t){r.fire(new e.Event("sourcedataabort",t))})),P(r)}return q(s,[{key:"_getMapId",value:function(){return this._mapId}},{key:"addControl",value:function(t,r){if(void 0===r&&(r=t.getDefaultPosition?t.getDefaultPosition():"top-right"),!t||!t.onAdd)return this.fire(new e.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var i=t.onAdd(this);this._controls.push(t);var n=this._controlPositions[r];return-1!==r.indexOf("bottom")?n.insertBefore(i,n.firstChild):n.appendChild(i),this}},{key:"removeControl",value:function(t){if(!t||!t.onRemove)return this.fire(new e.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var r=this._controls.indexOf(t);return r>-1&&this._controls.splice(r,1),t.onRemove(this),this}},{key:"hasControl",value:function(e){return this._controls.indexOf(e)>-1}},{key:"calculateCameraOptionsFromTo",value:function(e,t,r,i){return null==i&&this.style.terrain&&(i=this.transform.getElevation(r,this.style.terrain)),S(O(s.prototype),"calculateCameraOptionsFromTo",this).call(this,e,t,r,i)}},{key:"resize",value:function(t){var r=this._containerDimensions(),i=r[0],n=r[1];this._resizeCanvas(i,n,this.getPixelRatio()),this.transform.resize(i,n),this.painter.resize(i,n,this.getPixelRatio());var a=!this._moving;return a&&(this.stop(),this.fire(new e.Event("movestart",t)).fire(new e.Event("move",t))),this.fire(new e.Event("resize",t)),a&&this.fire(new e.Event("moveend",t)),this}},{key:"getPixelRatio",value:function(){return this._pixelRatio}},{key:"setPixelRatio",value:function(e){var t=V(this._containerDimensions(),2),r=t[0],i=t[1];this._pixelRatio=e,this._resizeCanvas(r,i,e),this.painter.resize(r,i,e)}},{key:"getBounds",value:function(){return this.transform.getBounds()}},{key:"getMaxBounds",value:function(){return this.transform.getMaxBounds()}},{key:"setMaxBounds",value:function(t){return this.transform.setMaxBounds(e.LngLatBounds.convert(t)),this._update()}},{key:"setMinZoom",value:function(e){if((e=null==e?-2:e)>=-2&&e<=this.transform.maxZoom)return this.transform.minZoom=e,this._update(),this.getZoom()<e&&this.setZoom(e),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}},{key:"getMinZoom",value:function(){return this.transform.minZoom}},{key:"setMaxZoom",value:function(e){if((e=null==e?22:e)>=this.transform.minZoom)return this.transform.maxZoom=e,this._update(),this.getZoom()>e&&this.setZoom(e),this;throw new Error("maxZoom must be greater than the current minZoom")}},{key:"getMaxZoom",value:function(){return this.transform.maxZoom}},{key:"setMinPitch",value:function(e){if((e=null==e?0:e)<0)throw new Error("minPitch must be greater than or equal to 0");if(e>=0&&e<=this.transform.maxPitch)return this.transform.minPitch=e,this._update(),this.getPitch()<e&&this.setPitch(e),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}},{key:"getMinPitch",value:function(){return this.transform.minPitch}},{key:"setMaxPitch",value:function(e){if((e=null==e?60:e)>85)throw new Error("maxPitch must be less than or equal to 85");if(e>=this.transform.minPitch)return this.transform.maxPitch=e,this._update(),this.getPitch()>e&&this.setPitch(e),this;throw new Error("maxPitch must be greater than the current minPitch")}},{key:"getMaxPitch",value:function(){return this.transform.maxPitch}},{key:"getRenderWorldCopies",value:function(){return this.transform.renderWorldCopies}},{key:"setRenderWorldCopies",value:function(e){return this.transform.renderWorldCopies=e,this._update()}},{key:"project",value:function(t){return this.transform.locationPoint(e.LngLat.convert(t),this.style&&this.style.terrain)}},{key:"unproject",value:function(t){return this.transform.pointLocation(e.pointGeometry.convert(t),this.style&&this.style.terrain)}},{key:"isMoving",value:function(){return this._moving||this.handlers.isMoving()}},{key:"isZooming",value:function(){return this._zooming||this.handlers.isZooming()}},{key:"isRotating",value:function(){return this._rotating||this.handlers.isRotating()}},{key:"_createDelegatedListener",value:function(e,t,r){var i=this;if("mouseenter"===e||"mouseover"===e){var n=!1,a=function(a){var o=i.getLayer(t)?i.queryRenderedFeatures(a.point,{layers:[t]}):[];o.length?n||(n=!0,r.call(i,new Ei(e,i,a.originalEvent,{features:o}))):n=!1};return{layer:t,listener:r,delegates:{mousemove:a,mouseout:function(){n=!1}}}}if("mouseleave"===e||"mouseout"===e){var o=!1,s=function(n){(i.getLayer(t)?i.queryRenderedFeatures(n.point,{layers:[t]}):[]).length?o=!0:o&&(o=!1,r.call(i,new Ei(e,i,n.originalEvent)))},l=function(t){o&&(o=!1,r.call(i,new Ei(e,i,t.originalEvent)))};return{layer:t,listener:r,delegates:{mousemove:s,mouseout:l}}}var u=function(e){var n=i.getLayer(t)?i.queryRenderedFeatures(e.point,{layers:[t]}):[];n.length&&(e.features=n,r.call(i,e),delete e.features)};return{layer:t,listener:r,delegates:W({},e,u)}}},{key:"on",value:function(e,t,r){if(void 0===r)return S(O(s.prototype),"on",this).call(this,e,t);var i=this._createDelegatedListener(e,t,r);for(var n in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[e]=this._delegatedListeners[e]||[],this._delegatedListeners[e].push(i),i.delegates)this.on(n,i.delegates[n]);return this}},{key:"once",value:function(e,t,r){if(void 0===r)return S(O(s.prototype),"once",this).call(this,e,t);var i=this._createDelegatedListener(e,t,r);for(var n in i.delegates)this.once(n,i.delegates[n]);return this}},{key:"off",value:function(e,t,r){var i=this;return void 0===r?S(O(s.prototype),"off",this).call(this,e,t):(this._delegatedListeners&&this._delegatedListeners[e]&&function(n){for(var a=i._delegatedListeners[e],o=0;o<a.length;o++){var s=a[o];if(s.layer===t&&s.listener===r){for(var l in s.delegates)i.off(l,s.delegates[l]);return a.splice(o,1),i}}}(),this)}},{key:"queryRenderedFeatures",value:function(t,r){if(!this.style)return[];var i;if(void 0!==r||void 0===t||t instanceof e.pointGeometry||Array.isArray(t)||(r=t,t=void 0),r=r||{},(t=t||[[0,0],[this.transform.width,this.transform.height]])instanceof e.pointGeometry||"number"==typeof t[0])i=[e.pointGeometry.convert(t)];else{var n=e.pointGeometry.convert(t[0]),a=e.pointGeometry.convert(t[1]);i=[n,new e.pointGeometry(a.x,n.y),a,new e.pointGeometry(n.x,a.y),n]}return this.style.queryRenderedFeatures(i,r,this.transform)}},{key:"querySourceFeatures",value:function(e,t){return this.style.querySourceFeatures(e,t)}},{key:"setStyle",value:function(t,r){return!1!==(r=e.extend({},{localIdeographFontFamily:this._localIdeographFontFamily},r)).diff&&r.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&t?(this._diffStyle(t,r),this):(this._localIdeographFontFamily=r.localIdeographFontFamily,this._updateStyle(t,r))}},{key:"setTransformRequest",value:function(e){return this._requestManager.setTransformRequest(e),this}},{key:"_getUIString",value:function(e){var t=this._locale[e];if(null==t)throw new Error("Missing UI string '".concat(e,"'"));return t}},{key:"_updateStyle",value:function(e,t){return this.style&&(this.style.setEventedParent(null),this.style._remove()),e?(this.style=new ft(this,t||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof e?this.style.loadURL(e):this.style.loadJSON(e),this):(delete this.style,this)}},{key:"_lazyInitEmptyStyle",value:function(){this.style||(this.style=new ft(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}},{key:"_diffStyle",value:function(t,r){var i=this;if("string"==typeof t){var n=this._requestManager.transformRequest(t,e.ResourceType.Style);e.getJSON(n,(function(t,n){t?i.fire(new e.ErrorEvent(t)):n&&i._updateDiff(n,r)}))}else"object"==Z(t)&&this._updateDiff(t,r)}},{key:"_updateDiff",value:function(t,r){try{this.style.setState(t)&&this._update(!0)}catch(i){e.warnOnce("Unable to perform style diff: ".concat(i.message||i.error||i,". Rebuilding the style from scratch.")),this._updateStyle(t,r)}}},{key:"getStyle",value:function(){if(this.style)return this.style.serialize()}},{key:"isStyleLoaded",value:function(){return this.style?this.style.loaded():e.warnOnce("There is no style added to the map.")}},{key:"addSource",value:function(e,t){return this._lazyInitEmptyStyle(),this.style.addSource(e,t),this._update(!0)}},{key:"isSourceLoaded",value:function(t){var r=this.style&&this.style.sourceCaches[t];if(void 0!==r)return r.loaded();this.fire(new e.ErrorEvent(new Error("There is no source with ID '".concat(t,"'"))))}},{key:"setTerrain",value:function(e){return this.style.setTerrain(e),this}},{key:"getTerrain",value:function(){return this.style.terrain&&this.style.terrain.options}},{key:"areTilesLoaded",value:function(){var e=this.style&&this.style.sourceCaches;for(var t in e){var r=e[t]._tiles;for(var i in r){var n=r[i];if("loaded"!==n.state&&"errored"!==n.state)return!1}}return!0}},{key:"addSourceType",value:function(e,t,r){return this._lazyInitEmptyStyle(),this.style.addSourceType(e,t,r)}},{key:"removeSource",value:function(e){return this.style.removeSource(e),this._update(!0)}},{key:"getSource",value:function(e){return this.style.getSource(e)}},{key:"addImage",value:function(t,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=i.pixelRatio,a=void 0===n?1:n,o=i.sdf,s=void 0!==o&&o,l=i.stretchX,u=i.stretchY,c=i.content;if(this._lazyInitEmptyStyle(),r instanceof HTMLImageElement||e.isImageBitmap(r)){var h=e.exported.getImageData(r),p=h.width,f=h.height,d=h.data;this.style.addImage(t,{data:new e.RGBAImage({width:p,height:f},d),pixelRatio:a,stretchX:l,stretchY:u,content:c,sdf:s,version:0})}else{if(void 0===r.width||void 0===r.height)return this.fire(new e.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 m=r.width,v=r.height,y=r.data,g=r;this.style.addImage(t,{data:new e.RGBAImage({width:m,height:v},new Uint8Array(y)),pixelRatio:a,stretchX:l,stretchY:u,content:c,sdf:s,version:0,userImage:g}),g.onAdd&&g.onAdd(this,t)}}},{key:"updateImage",value:function(t,r){var i=this.style.getImage(t);if(!i)return this.fire(new e.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));var n=r instanceof HTMLImageElement||e.isImageBitmap(r)?e.exported.getImageData(r):r,a=n.width,o=n.height,s=n.data;if(void 0===a||void 0===o)return this.fire(new e.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`")));if(a!==i.data.width||o!==i.data.height)return this.fire(new e.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image")));var l=!(r instanceof HTMLImageElement||e.isImageBitmap(r));i.data.replace(s,l),this.style.updateImage(t,i)}},{key:"hasImage",value:function(t){return t?!!this.style.getImage(t):(this.fire(new e.ErrorEvent(new Error("Missing required image id"))),!1)}},{key:"removeImage",value:function(e){this.style.removeImage(e)}},{key:"loadImage",value:function(t,r){e.getImage(this._requestManager.transformRequest(t,e.ResourceType.Image),r)}},{key:"listImages",value:function(){return this.style.listImages()}},{key:"addLayer",value:function(e,t){return this._lazyInitEmptyStyle(),this.style.addLayer(e,t),this._update(!0)}},{key:"moveLayer",value:function(e,t){return this.style.moveLayer(e,t),this._update(!0)}},{key:"removeLayer",value:function(e){return this.style.removeLayer(e),this._update(!0)}},{key:"getLayer",value:function(e){return this.style.getLayer(e)}},{key:"setLayerZoomRange",value:function(e,t,r){return this.style.setLayerZoomRange(e,t,r),this._update(!0)}},{key:"setFilter",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.style.setFilter(e,t,r),this._update(!0)}},{key:"getFilter",value:function(e){return this.style.getFilter(e)}},{key:"setPaintProperty",value:function(e,t,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.style.setPaintProperty(e,t,r,i),this._update(!0)}},{key:"getPaintProperty",value:function(e,t){return this.style.getPaintProperty(e,t)}},{key:"setLayoutProperty",value:function(e,t,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.style.setLayoutProperty(e,t,r,i),this._update(!0)}},{key:"getLayoutProperty",value:function(e,t){return this.style.getLayoutProperty(e,t)}},{key:"setLight",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._lazyInitEmptyStyle(),this.style.setLight(e,t),this._update(!0)}},{key:"getLight",value:function(){return this.style.getLight()}},{key:"setFeatureState",value:function(e,t){return this.style.setFeatureState(e,t),this._update()}},{key:"removeFeatureState",value:function(e,t){return this.style.removeFeatureState(e,t),this._update()}},{key:"getFeatureState",value:function(e){return this.style.getFeatureState(e)}},{key:"getContainer",value:function(){return this._container}},{key:"getCanvasContainer",value:function(){return this._canvasContainer}},{key:"getCanvas",value:function(){return this._canvas}},{key:"_containerDimensions",value:function(){var e=0,t=0;return this._container&&(e=this._container.clientWidth||400,t=this._container.clientHeight||300),[e,t]}},{key:"_setupContainer",value:function(){var e=this._container;e.classList.add("maplibregl-map","mapboxgl-map");var t=this._canvasContainer=a.create("div","maplibregl-canvas-container mapboxgl-canvas-container",e);this._interactive&&t.classList.add("maplibregl-interactive","mapboxgl-interactive"),this._canvas=a.create("canvas","maplibregl-canvas mapboxgl-canvas",t),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"),this._canvas.setAttribute("role","region");var r=this._containerDimensions();this._resizeCanvas(r[0],r[1],this.getPixelRatio());var i=this._controlContainer=a.create("div","maplibregl-control-container mapboxgl-control-container",e),n=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((function(e){n[e]=a.create("div","maplibregl-ctrl-".concat(e," mapboxgl-ctrl-").concat(e),i)})),this._container.addEventListener("scroll",this._onMapScroll,!1)}},{key:"_setupCooperativeGestures",value:function(){var e=this,t=this._container;this._metaPress=!1,this._cooperativeGesturesScreen=a.create("div","maplibregl-cooperative-gesture-screen",t);var r="Control",i="boolean"!=typeof this._cooperativeGestures&&this._cooperativeGestures.windowsHelpText?this._cooperativeGestures.windowsHelpText:"Use Ctrl + scroll to zoom the map";0===navigator.platform.indexOf("Mac")&&(i="boolean"!=typeof this._cooperativeGestures&&this._cooperativeGestures.macHelpText?this._cooperativeGestures.macHelpText:"Use ⌘ + scroll to zoom the map",r="Meta"),this._cooperativeGesturesScreen.innerHTML='\n <div class="maplibregl-desktop-message">'.concat(i,'</div>\n <div class="maplibregl-mobile-message">').concat("boolean"!=typeof this._cooperativeGestures&&this._cooperativeGestures.mobileHelpText?this._cooperativeGestures.mobileHelpText:"Use two fingers to move the map","</div>\n "),document.addEventListener("keydown",(function(t){t.key===r&&(e._metaPress=!0)})),document.addEventListener("keyup",(function(t){t.key===r&&(e._metaPress=!1)})),this._canvasContainer.addEventListener("wheel",(function(t){e._onCooperativeGesture(t,e._metaPress,1)}),!1),this._canvasContainer.classList.remove("mapboxgl-touch-drag-pan","maplibregl-touch-drag-pan")}},{key:"_resizeCanvas",value:function(e,t,r){this._canvas.width=r*e,this._canvas.height=r*t,this._canvas.style.width="".concat(e,"px"),this._canvas.style.height="".concat(t,"px")}},{key:"_setupPainter",value:function(){var r=e.extend({},t.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),i=this._canvas.getContext("webgl",r)||this._canvas.getContext("experimental-webgl",r);i?(this.painter=new ci(i,this.transform),e.exported$1.testSupport(i)):this.fire(new e.ErrorEvent(new Error("Failed to initialize WebGL")))}},{key:"_contextLost",value:function(t){t.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new e.Event("webglcontextlost",{originalEvent:t}))}},{key:"_contextRestored",value:function(t){this._setupPainter(),this.resize(),this._update(),this.fire(new e.Event("webglcontextrestored",{originalEvent:t}))}},{key:"_onMapScroll",value:function(e){if(e.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}},{key:"_onCooperativeGesture",value:function(e,t,r){var i=this;return!t&&r<2&&(this._cooperativeGesturesScreen.classList.add("maplibregl-show"),setTimeout((function(){i._cooperativeGesturesScreen.classList.remove("maplibregl-show")}),100)),!1}},{key:"loaded",value:function(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}},{key:"_update",value:function(e){return this.style?(this._styleDirty=this._styleDirty||e,this._sourcesDirty=!0,this.triggerRepaint(),this):this}},{key:"_requestRenderFrame",value:function(e){return this._update(),this._renderTaskQueue.add(e)}},{key:"_cancelRenderFrame",value:function(e){this._renderTaskQueue.remove(e)}},{key:"_render",value:function(t){var r,i=this,n=0,a=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(r=a.createQueryEXT(),a.beginQueryEXT(a.TIME_ELAPSED_EXT,r),n=e.exported.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(t),!this._removed){var o=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var s=this.transform.zoom,l=e.exported.now();this.style.zoomHistory.update(s,l);var u=new e.EvaluationParameters(s,{now:l,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),c=u.crossFadingFactor();1===c&&c===this._crossFadingFactor||(o=!0,this._crossFadingFactor=c),this.style.update(u)}if(this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.style.terrain&&this.style.terrain.sourceCache.update(this.transform,this.style.terrain),this.transform.updateElevation(this.style.terrain),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 e.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,e.PerformanceUtils.mark(e.PerformanceMarkers.load),this.fire(new e.Event("load"))),this.style&&(this.style.hasTransitions()||o)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){var h=e.exported.now()-n;a.endQueryEXT(a.TIME_ELAPSED_EXT,r),setTimeout((function(){var t=a.getQueryObjectEXT(r,a.QUERY_RESULT_EXT)/1e6;a.deleteQueryEXT(r),i.fire(new e.Event("gpu-timing-frame",{cpuTime:h,gpuTime:t}))}),50)}if(this.listens("gpu-timing-layer")){var p=this.painter.collectGpuTimers();setTimeout((function(){var t=i.painter.queryGpuTimers(p);i.fire(new e.Event("gpu-timing-layer",{layerTimes:t}))}),50)}var f=this._sourcesDirty||this._styleDirty||this._placementDirty;return f||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new e.Event("idle")),!this._loaded||this._fullyLoaded||f||(this._fullyLoaded=!0,e.PerformanceUtils.mark(e.PerformanceMarkers.fullLoad)),this}}},{key:"redraw",value:function(){return this.style&&(this._frame&&(this._frame.cancel(),this._frame=null),this._render(0)),this}},{key:"remove",value:function(){this._hash&&this._hash.remove();var t,r=K(this._controls);try{for(r.s();!(t=r.n()).done;)t.value.onRemove(this)}catch(n){r.e(n)}finally{r.f()}this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),"undefined"!=typeof window&&(removeEventListener("resize",this._onWindowResize,!1),removeEventListener("orientationchange",this._onWindowResize,!1),removeEventListener("online",this._onWindowOnline,!1));var i=this.painter.context.gl.getExtension("WEBGL_lose_context");i&&i.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),a.remove(this._canvasContainer),a.remove(this._controlContainer),this._cooperativeGestures&&a.remove(this._cooperativeGesturesScreen),this._container.classList.remove("maplibregl-map","mapboxgl-map"),e.PerformanceUtils.clearMetrics(),this._removed=!0,this.fire(new e.Event("remove"))}},{key:"triggerRepaint",value:function(){var t=this;this.style&&!this._frame&&(this._frame=e.exported.frame((function(r){e.PerformanceUtils.frame(r),t._frame=null,t._render(r)})))}},{key:"_onWindowOnline",value:function(){this._update()}},{key:"_onWindowResize",value:function(e){this._trackResize&&this.resize({originalEvent:e})._update()}},{key:"showTileBoundaries",get:function(){return!!this._showTileBoundaries},set:function(e){this._showTileBoundaries!==e&&(this._showTileBoundaries=e,this._update())}},{key:"showPadding",get:function(){return!!this._showPadding},set:function(e){this._showPadding!==e&&(this._showPadding=e,this._update())}},{key:"showCollisionBoxes",get:function(){return!!this._showCollisionBoxes},set:function(e){this._showCollisionBoxes!==e&&(this._showCollisionBoxes=e,e?this.style._generateCollisionBoxes():this._update())}},{key:"showOverdrawInspector",get:function(){return!!this._showOverdrawInspector},set:function(e){this._showOverdrawInspector!==e&&(this._showOverdrawInspector=e,this._update())}},{key:"repaint",get:function(){return!!this._repaint},set:function(e){this._repaint!==e&&(this._repaint=e,this.triggerRepaint())}},{key:"vertices",get:function(){return!!this._vertices},set:function(e){this._vertices=e,this._update()}},{key:"_setCacheLimits",value:function(t,r){e.setCacheLimits(t,r)}},{key:"version",get:function(){return"2.4.0"}}]),s}(hn),NavigationControl:function(){function t(r){var i=this;j(this,t),this.options=e.extend({},yn,r),this._container=a.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",(function(e){return e.preventDefault()})),this.options.showZoom&&(e.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in mapboxgl-ctrl-zoom-in",(function(e){return i._map.zoomIn({},{originalEvent:e})})),a.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out mapboxgl-ctrl-zoom-out",(function(e){return i._map.zoomOut({},{originalEvent:e})})),a.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(e.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("maplibregl-ctrl-compass mapboxgl-ctrl-compass",(function(e){i.options.visualizePitch?i._map.resetNorthPitch({},{originalEvent:e}):i._map.resetNorth({},{originalEvent:e})})),this._compassIcon=a.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}return q(t,[{key:"_updateZoomButtons",value:function(){var e=this._map.getZoom(),t=e===this._map.getMaxZoom(),r=e===this._map.getMinZoom();this._zoomInButton.disabled=t,this._zoomOutButton.disabled=r,this._zoomInButton.setAttribute("aria-disabled",t.toString()),this._zoomOutButton.setAttribute("aria-disabled",r.toString())}},{key:"_rotateCompassArrow",value:function(){var e=this.options.visualizePitch?"scale(".concat(1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5),") rotateX(").concat(this._map.transform.pitch,"deg) rotateZ(").concat(this._map.transform.angle*(180/Math.PI),"deg)"):"rotate(".concat(this._map.transform.angle*(180/Math.PI),"deg)");this._compassIcon.style.transform=e}},{key:"onAdd",value:function(e){return this._map=e,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 gn(this._map,this._compass,this.options.visualizePitch)),this._container}},{key:"onRemove",value:function(){a.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),this._handler.off(),delete this._handler),delete this._map}},{key:"_createButton",value:function(e,t){var r=a.create("button",e,this._container);return r.type="button",r.addEventListener("click",t),r}},{key:"_setButtonTitle",value:function(e,t){var r=this._map._getUIString("NavigationControl.".concat(t));e.title=r,e.setAttribute("aria-label",r)}}]),t}(),GeolocateControl:function(t){A(i,t);var r=M(i);function i(t){var n;return j(this,i),(n=r.call(this)).options=e.extend({},En,t),e.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],D(n)),n}return q(i,[{key:"onAdd",value:function(e){var t;return this._map=e,this._container=a.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),t=this._setupUI,void 0!==wn?t(wn):void 0!==window.navigator.permissions?window.navigator.permissions.query({name:"geolocation"}).then((function(e){wn="denied"!==e.state,t(wn)})):(wn=!!window.navigator.geolocation,t(wn)),this._container}},{key:"onRemove",value:function(){void 0!==this._geolocationWatchID&&(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(),a.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Tn=0,Sn=!1}},{key:"_isOutOfMapMaxBounds",value:function(e){var t=this._map.getMaxBounds(),r=e.coords;return t&&(r.longitude<t.getWest()||r.longitude>t.getEast()||r.latitude<t.getSouth()||r.latitude>t.getNorth())}},{key:"_setErrorState",value:function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error("Unexpected watchState ".concat(this._watchState))}}},{key:"_onSuccess",value:function(t){if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new e.Event("outofmaxbounds",t)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background");break;default:throw new Error("Unexpected watchState ".concat(this._watchState))}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(t),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale","mapboxgl-user-location-dot-stale"),this.fire(new e.Event("geolocate",t)),this._finish()}}},{key:"_updateCamera",value:function(t){var r=new e.LngLat(t.coords.longitude,t.coords.latitude),i=t.coords.accuracy,n=this._map.getBearing(),a=e.extend({bearing:n},this.options.fitBoundsOptions);this._map.fitBounds(r.toBounds(i),a,{geolocateSource:!0})}},{key:"_updateMarker",value:function(t){if(t){var r=new e.LngLat(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=t.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}},{key:"_updateCircleRadius",value:function(){var e=this._map._container.clientHeight/2,t=this._map.unproject([0,e]),r=this._map.unproject([1,e]),i=t.distanceTo(r),n=Math.ceil(2*this._accuracy/i);this._circleElement.style.width="".concat(n,"px"),this._circleElement.style.height="".concat(n,"px")}},{key:"_onZoom",value:function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}},{key:"_onError",value:function(t){if(this._map){if(this.options.trackUserLocation)if(1===t.code){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===t.code&&Sn)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale","mapboxgl-user-location-dot-stale"),this.fire(new e.Event("error",t)),this._finish()}}},{key:"_finish",value:function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}},{key:"_setupUI",value:function(t){var r=this;if(this._container.addEventListener("contextmenu",(function(e){return e.preventDefault()})),this._geolocateButton=a.create("button","maplibregl-ctrl-geolocate mapboxgl-ctrl-geolocate",this._container),a.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",!1===t){e.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i)}else{var n=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=a.create("div","maplibregl-user-location-dot mapboxgl-user-location-dot"),this._userLocationDotMarker=new kn(this._dotElement),this._circleElement=a.create("div","maplibregl-user-location-accuracy-circle mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new kn({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(t){t.geolocateSource||"ACTIVE_LOCK"!==r._watchState||t.originalEvent&&"resize"===t.originalEvent.type||(r._watchState="BACKGROUND",r._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),r._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),r.fire(new e.Event("trackuserlocationend")))}))}},{key:"trigger",value:function(){if(!this._setup)return e.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 e.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Tn--,Sn=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this.fire(new e.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new e.Event("trackuserlocationstart"));break;default:throw new Error("Unexpected watchState ".concat(this._watchState))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error("Unexpected watchState ".concat(this._watchState))}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){var t;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++Tn>1?(t={maximumAge:6e5,timeout:0},Sn=!0):(t=this.options.positionOptions,Sn=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,t)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}},{key:"_clearWatch",value:function(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}}]),i}(e.Evented),AttributionControl:pn,LogoControl:fn,ScaleControl:function(){function t(r){j(this,t),this.options=e.extend({},Cn,r),e.bindAll(["_onMove","setUnit"],this)}return q(t,[{key:"getDefaultPosition",value:function(){return"bottom-left"}},{key:"_onMove",value:function(){In(this._map,this._container,this.options)}},{key:"onAdd",value:function(e){return this._map=e,this._container=a.create("div","maplibregl-ctrl maplibregl-ctrl-scale mapboxgl-ctrl mapboxgl-ctrl-scale",e.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}},{key:"onRemove",value:function(){a.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},{key:"setUnit",value:function(e){this.options.unit=e,In(this._map,this._container,this.options)}}]),t}(),FullscreenControl:function(){function t(r){j(this,t),this._fullscreen=!1,r&&r.container&&(r.container instanceof HTMLElement?this._container=r.container:e.warnOnce("Full screen control 'container' must be a DOM element.")),e.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}return q(t,[{key:"onAdd",value:function(t){return this._map=t,this._container||(this._container=this._map.getContainer()),this._controlContainer=a.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",e.warnOnce("This device does not support fullscreen mode.")),this._controlContainer}},{key:"onRemove",value:function(){a.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._changeIcon)}},{key:"_checkFullscreenSupport",value:function(){return!!(document.fullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled||document.webkitFullscreenEnabled)}},{key:"_setupUI",value:function(){var e=this._fullscreenButton=a.create("button","maplibregl-ctrl-fullscreen mapboxgl-ctrl-fullscreen",this._controlContainer);a.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",e).setAttribute("aria-hidden","true"),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._changeIcon)}},{key:"_updateTitle",value:function(){var e=this._getTitle();this._fullscreenButton.setAttribute("aria-label",e),this._fullscreenButton.title=e}},{key:"_getTitle",value:function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}},{key:"_isFullscreen",value:function(){return this._fullscreen}},{key:"_changeIcon",value:function(){(window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}},{key:"_onClickFullscreen",value:function(){this._isFullscreen()?window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen&&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()}}]),t}(),TerrainControl:function(){function t(r){j(this,t),this.options=r,e.bindAll(["_toggleTerrain","_updateTerrainIcon"],this)}return q(t,[{key:"onAdd",value:function(e){return this._map=e,this._container=a.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),this._terrainButton=a.create("button","maplibregl-ctrl-terrain mapboxgl-ctrl-terrain",this._container),a.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}},{key:"onRemove",value:function(){a.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},{key:"_toggleTerrain",value:function(){this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()}},{key:"_updateTerrainIcon",value:function(){this._terrainButton.classList.remove("maplibregl-ctrl-terrain","mapboxgl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled","mapboxgl-ctrl-terrain-enabled"),this._map.style.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled","mapboxgl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.disableTerrain")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain","mapboxgl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.enableTerrain"))}}]),t}(),Popup:function(t){A(i,t);var r=M(i);function i(t){var n;return j(this,i),(n=r.call(this)).options=e.extend(Object.create(An),t),e.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],D(n)),n}return q(i,[{key:"addTo",value:function(t){return this._map&&this.remove(),this._map=t,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._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer","mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer","mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new e.Event("open")),this}},{key:"isOpen",value:function(){return!!this._map}},{key:"remove",value:function(){return this._content&&a.remove(this._content),this._container&&(a.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",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new e.Event("close")),this}},{key:"getLngLat",value:function(){return this._lngLat}},{key:"setLngLat",value:function(t){return this._lngLat=e.LngLat.convert(t),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer","mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer","mapboxgl-track-pointer")),this}},{key:"trackPointer",value:function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer","mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer","mapboxgl-track-pointer")),this}},{key:"getElement",value:function(){return this._container}},{key:"setText",value:function(e){return this.setDOMContent(document.createTextNode(e))}},{key:"setHTML",value:function(e){var t,r=document.createDocumentFragment(),i=document.createElement("body");for(i.innerHTML=e;t=i.firstChild;)r.appendChild(t);return this.setDOMContent(r)}},{key:"getMaxWidth",value:function(){return this._container&&this._container.style.maxWidth}},{key:"setMaxWidth",value:function(e){return this.options.maxWidth=e,this._update(),this}},{key:"setDOMContent",value:function(e){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=a.create("div","maplibregl-popup-content mapboxgl-popup-content",this._container);return this._content.appendChild(e),this._createCloseButton(),this._update(),this._focusFirstElement(),this}},{key:"addClassName",value:function(e){this._container&&this._container.classList.add(e)}},{key:"removeClassName",value:function(e){this._container&&this._container.classList.remove(e)}},{key:"setOffset",value:function(e){return this.options.offset=e,this._update(),this}},{key:"toggleClassName",value:function(e){if(this._container)return this._container.classList.toggle(e)}},{key:"_createCloseButton",value:function(){this.options.closeButton&&(this._closeButton=a.create("button","maplibregl-popup-close-button mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}},{key:"_onMouseUp",value:function(e){this._update(e.point)}},{key:"_onMouseMove",value:function(e){this._update(e.point)}},{key:"_onDrag",value:function(e){this._update(e.point)}},{key:"_update",value:function(e){var t=this;if(this._map&&(this._lngLat||this._trackPointer)&&this._content&&(this._container||(this._container=a.create("div","maplibregl-popup mapboxgl-popup",this._map.getContainer()),this._tip=a.create("div","maplibregl-popup-tip mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(e){return t._container.classList.add(e)})),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer","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=_n(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||e)){var r=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat),i=this.options.anchor,n=Pn(this.options.offset);if(!i){var o,s=this._container.offsetWidth,l=this._container.offsetHeight;o=r.y+n.bottom.y<l?["top"]:r.y>this._map.transform.height-l?["bottom"]:[],r.x<s/2?o.push("left"):r.x>this._map.transform.width-s/2&&o.push("right"),i=0===o.length?"bottom":o.join("-")}var u=r.add(n[i]).round();a.setTransform(this._container,"".concat(xn[i]," translate(").concat(u.x,"px,").concat(u.y,"px)")),bn(this._container,i,"popup")}}},{key:"_focusFirstElement",value:function(){if(this.options.focusAfterOpen&&this._container){var e=this._container.querySelector(Mn);e&&e.focus()}}},{key:"_onClose",value:function(){this.remove()}}]),i}(e.Evented),Marker:kn,Style:ft,LngLat:e.LngLat,LngLatBounds:e.LngLatBounds,Point:e.pointGeometry,MercatorCoordinate:e.MercatorCoordinate,Evented:e.Evented,AJAXError:e.AJAXError,config:e.config,CanvasSource:R,GeoJSONSource:C,ImageSource:z,RasterDEMTileSource:T,RasterTileSource:E,VectorTileSource:k,VideoSource:L,prewarm:function(){ie().acquire(ee)},clearPrewarmedResources:function(){var e=$;e&&(e.isPreloaded()&&1===e.numActive()?(e.release(ee),$=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get version(){return"2.4.0"},get workerCount(){return te.workerCount},set workerCount(e){te.workerCount=e},get maxParallelImageRequests(){return e.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(t){e.config.MAX_PARALLEL_IMAGE_REQUESTS=t},clearStorage:function(t){e.clearTileCache(t)},workerUrl:"",addProtocol:function(t,r){e.config.REGISTERED_PROTOCOLS[t]=r},removeProtocol:function(t){delete e.config.REGISTERED_PROTOCOLS[t]}};return cn.extend(Dn,{isSafari:e.isSafari,getPerformanceMetrics:e.PerformanceUtils.getPerformanceMetrics}),Dn})),r}()}(Ve);C("m",Ve.exports);var Ue={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0},Ne=C("u",(function(){var e=V(F.exports.useState(null),2),t=e[0],r=e[1],i=V(F.exports.useState(Ue),2),n=i[0],a=i[1],o=F.exports.useMemo((function(){return new window.ResizeObserver((function(e){if(e[0]){var t=e[0].contentRect,r=t.x,i=t.y,n=t.width,o=t.height,s=t.top,l=t.left,u=t.bottom,c=t.right;a({x:r,y:i,width:n,height:o,top:s,left:l,bottom:u,right:c})}}))}),[]);return F.exports.useLayoutEffect((function(){if(t)return o.observe(t),function(){o.disconnect()}}),[t]),[r,n,t]}));function je(){return je=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},je.apply(this,arguments)}function Ge(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=[];function i(t,i){var n=F.exports.createContext(i),a=r.length;function o(t){var r=t.scope,i=t.children,o=T(t,s),l=(null==r?void 0:r[e][a])||n,u=F.exports.useMemo((function(){return o}),Object.values(o));return F.exports.createElement(l.Provider,{value:u},i)}return r=[].concat(I(r),[i]),o.displayName=t+"Provider",[o,function(r,o){var s=(null==o?void 0:o[e][a])||n,l=F.exports.useContext(s);if(l)return l;if(void 0!==i)return i;throw new Error("`".concat(r,"` must be used within `").concat(t,"`"))}]}var n=function(){var t=r.map((function(e){return F.exports.createContext(e)}));return function(r){var i=(null==r?void 0:r[e])||t;return F.exports.useMemo((function(){return W({},"__scope".concat(e),H(H({},r),{},W({},e,i)))}),[r,i])}};return n.scopeName=e,[i,qe.apply(void 0,[n].concat(I(t)))]}function qe(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var i=t[0];if(1===t.length)return i;var n=function(){var e=t.map((function(e){return{useScope:e(),scopeName:e.scopeName}}));return function(t){var r=e.reduce((function(e,r){var i=r.useScope,n=r.scopeName,a=i(t)["__scope".concat(n)];return H(H({},e),a)}),{});return F.exports.useMemo((function(){return W({},"__scope".concat(i.scopeName),r)}),[r])}};return n.scopeName=i.scopeName,n}function Ze(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}function Xe(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){return t.forEach((function(t){return Ze(t,e)}))}}function He(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return F.exports.useCallback(Xe.apply(void 0,t),t)}C("P",Q.memo((function(e){var t=e.marker;return X(Le,{latitude:t.lat,longitude:t.lng,style:{zIndex:1},children:X($.Root,{options:{style:t.icon||"house"}})})}))).displayName="Pin";var We=F.exports.forwardRef((function(e,t){var r=e.children,i=T(e,l),n=F.exports.Children.toArray(r),a=n.find(Ye);if(a){var o=a.props.children,s=n.map((function(e){return e===a?F.exports.Children.count(o)>1?F.exports.Children.only(null):F.exports.isValidElement(o)?o.props.children:null:e}));return F.exports.createElement(Ke,je({},i,{ref:t}),F.exports.isValidElement(o)?F.exports.cloneElement(o,void 0,s):null)}return F.exports.createElement(Ke,je({},i,{ref:t}),r)}));We.displayName="Slot";var Ke=F.exports.forwardRef((function(e,t){var r=e.children,i=T(e,u);return F.exports.isValidElement(r)?F.exports.cloneElement(r,H(H({},function(e,t){var r=H({},t),i=function(i){var n=e[i],a=t[i];/^on[A-Z]/.test(i)?r[i]=function(){null==a||a.apply(void 0,arguments),null==n||n.apply(void 0,arguments)}:"style"===i?r[i]=H(H({},n),a):"className"===i&&(r[i]=[n,a].filter(Boolean).join(" "))};for(var n in t)i(n);return H(H({},e),r)}(i,r.props)),{},{ref:Xe(t,r.ref)})):F.exports.Children.count(r)>1?F.exports.Children.only(null):null}));Ke.displayName="SlotClone";var Je=function(e){var t=e.children;return F.exports.createElement(F.exports.Fragment,null,t)};function Ye(e){return F.exports.isValidElement(e)&&e.type===Je}function Qe(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=r.checkForDefaultPrevented,n=void 0===i||i;return function(r){if(null==e||e(r),!1===n||!r.defaultPrevented)return null==t?void 0:t(r)}}function $e(e){var t=F.exports.useRef(e);return F.exports.useEffect((function(){t.current=e})),F.exports.useMemo((function(){return function(){for(var e,r,i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];return null===(r=t.current)||void 0===r?void 0:(e=r).call.apply(e,[t].concat(n))}}),[])}function et(e){var t=e.prop,r=e.defaultProp,i=e.onChange,n=void 0===i?function(){}:i,a=function(e){var t=e.defaultProp,r=e.onChange,i=F.exports.useState(t),n=V(i,1)[0],a=F.exports.useRef(n),o=$e(r);return F.exports.useEffect((function(){a.current!==n&&(o(n),a.current=n)}),[n,a,o]),i}({defaultProp:r,onChange:n}),o=V(a,2),s=o[0],l=o[1],u=void 0!==t,c=u?t:s,h=$e(n);return[c,F.exports.useCallback((function(e){if(u){var r="function"==typeof e?e(t):e;r!==t&&h(r)}else l(e)}),[u,t,l,h])]}var tt=["a","button","div","h2","h3","img","li","nav","ol","p","span","svg","ul"].reduce((function(e,t){var r=F.exports.forwardRef((function(e,r){var i=e.asChild,n=T(e,h),a=i?We:t;return F.exports.useEffect((function(){window[Symbol.for("radix-ui")]=!0}),[]),F.exports.createElement(a,je({},n,{ref:r}))}));return r.displayName="Primitive.".concat(t),H(H({},e),{},W({},t,r))}),{}),rt=Boolean(null===globalThis||void 0===globalThis?void 0:globalThis.document)?F.exports.useLayoutEffect:function(){};var it=function(e){var t=e.present,r=e.children,i=function(e){var t=V(F.exports.useState(),2),r=t[0],i=t[1],n=F.exports.useRef({}),a=F.exports.useRef(e),o=F.exports.useRef("none"),s=V(function(e,t){return F.exports.useReducer((function(e,r){var i=t[e][r];return null!=i?i:e}),e)}(e?"mounted":"unmounted",{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}}),2),l=s[0],u=s[1];return F.exports.useEffect((function(){var e=nt(n.current);o.current="mounted"===l?e:"none"}),[l]),rt((function(){var t=n.current,r=a.current;if(r!==e){var i=o.current,s=nt(t);if(e)u("MOUNT");else if("none"===s||"none"===(null==t?void 0:t.display))u("UNMOUNT");else{u(r&&i!==s?"ANIMATION_OUT":"UNMOUNT")}a.current=e}}),[e,u]),rt((function(){if(r){var e=function(e){var t=nt(n.current).includes(e.animationName);e.target===r&&t&&Y.exports.flushSync((function(){return u("ANIMATION_END")}))},t=function(e){e.target===r&&(o.current=nt(n.current))};return r.addEventListener("animationstart",t),r.addEventListener("animationcancel",e),r.addEventListener("animationend",e),function(){r.removeEventListener("animationstart",t),r.removeEventListener("animationcancel",e),r.removeEventListener("animationend",e)}}u("ANIMATION_END")}),[r,u]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:F.exports.useCallback((function(e){e&&(n.current=getComputedStyle(e)),i(e)}),[])}}(t),n="function"==typeof r?r({present:i.isPresent}):F.exports.Children.only(r),a=He(i.ref,n.ref);return"function"==typeof r||i.isPresent?F.exports.cloneElement(n,{ref:a}):null};function nt(e){return(null==e?void 0:e.animationName)||"none"}it.displayName="Presence";var at=ee["useId".toString()]||function(){},ot=0;function st(e){var t=V(F.exports.useState(at()),2),r=t[0],i=t[1];return rt((function(){e||i((function(e){return null!=e?e:String(ot++)}))}),[e]),e||(r?"radix-".concat(r):"")}var lt="Collapsible",ut=V(Ge(lt),2),ct=ut[0],ht=ut[1],pt=V(ct(lt),2),ft=pt[0],dt=pt[1],mt=F.exports.forwardRef((function(e,t){var r=e.__scopeCollapsible,i=e.open,n=e.defaultOpen,a=e.disabled,o=e.onOpenChange,s=T(e,p),l=V(et({prop:i,defaultProp:n,onChange:o}),2),u=l[0],c=void 0!==u&&u,h=l[1];return F.exports.createElement(ft,{scope:r,disabled:a,contentId:st(),open:c,onOpenToggle:F.exports.useCallback((function(){return h((function(e){return!e}))}),[h])},F.exports.createElement(tt.div,je({"data-state":xt(c),"data-disabled":a?"":void 0},s,{ref:t})))})),vt=F.exports.forwardRef((function(e,t){var r=e.__scopeCollapsible,i=T(e,f),n=dt("CollapsibleTrigger",r);return F.exports.createElement(tt.button,je({type:"button","aria-controls":n.contentId,"aria-expanded":n.open||!1,"data-state":xt(n.open),"data-disabled":n.disabled?"":void 0,disabled:n.disabled},i,{ref:t,onClick:Qe(e.onClick,n.onOpenToggle)}))})),yt="CollapsibleContent",gt=F.exports.forwardRef((function(e,t){var r=e.forceMount,i=T(e,d),n=dt(yt,e.__scopeCollapsible);return F.exports.createElement(it,{present:r||n.open},(function(e){var r=e.present;return F.exports.createElement(_t,je({},i,{ref:t,present:r}))}))})),_t=F.exports.forwardRef((function(e,t){var r,i=e.__scopeCollapsible,n=e.present,a=e.children,o=T(e,m),s=dt(yt,i),l=V(F.exports.useState(n),2),u=l[0],c=l[1],h=F.exports.useRef(null),p=He(t,h),f=F.exports.useRef(0),d=f.current,v=F.exports.useRef(0),y=v.current,g=s.open||u,_=F.exports.useRef(g),x=F.exports.useRef();return F.exports.useEffect((function(){var e=requestAnimationFrame((function(){return _.current=!1}));return function(){return cancelAnimationFrame(e)}}),[]),rt((function(){var e=h.current;if(e){x.current=x.current||{transitionDuration:e.style.transitionDuration,animationDuration:e.style.animationDuration,animationFillMode:e.style.animationFillMode},e.style.transitionDuration="0s",e.style.animationDuration="0s",e.style.animationFillMode="none";var t=e.getBoundingClientRect();f.current=t.height,v.current=t.width,_.current||(e.style.transitionDuration=x.current.transitionDuration,e.style.animationDuration=x.current.animationDuration,e.style.animationFillMode=x.current.animationFillMode),c(n)}}),[s.open,n]),F.exports.createElement(tt.div,je({"data-state":xt(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!g},o,{ref:p,style:H((r={},W(r,"--radix-collapsible-content-height",d?"".concat(d,"px"):void 0),W(r,"--radix-collapsible-content-width",y?"".concat(y,"px"):void 0),r),e.style)}),g&&a)}));function xt(e){return e?"open":"closed"}var bt,wt,kt,Et,Tt,St,Ct,It,zt,At,Mt,Pt=mt,Dt=vt,Lt=gt,Rt="Accordion",Bt=["Home","End","ArrowDown","ArrowUp"],Ft=(kt=V(Ge(wt=(bt=Rt)+"CollectionProvider"),2),Et=kt[0],Tt=kt[1],St=V(Et(wt,{collectionRef:{current:null},itemMap:new Map}),2),Ct=St[0],It=St[1],zt=bt+"CollectionSlot",At=bt+"CollectionItemSlot",Mt="data-radix-collection-item",[{Provider:function(e){var t=e.scope,r=e.children,i=Q.useRef(null),n=Q.useRef(new Map).current;return Q.createElement(Ct,{scope:t,itemMap:n,collectionRef:i},r)},Slot:Q.forwardRef((function(e,t){var r=e.scope,i=e.children,n=He(t,It(zt,r).collectionRef);return Q.createElement(We,{ref:n},i)})),ItemSlot:Q.forwardRef((function(e,t){var r,i=e.scope,n=e.children,a=T(e,c),o=Q.useRef(null),s=He(t,o),l=It(At,i);return Q.useEffect((function(){return l.itemMap.set(o,H({ref:o},a)),function(){l.itemMap.delete(o)}})),Q.createElement(We,(W(r={},Mt,""),W(r,"ref",s),r),n)}))},function(e){var t=It(bt+"CollectionConsumer",e);return Q.useCallback((function(){var e=t.collectionRef.current;if(!e)return[];var r=Array.from(e.querySelectorAll("[".concat(Mt,"]")));return Array.from(t.itemMap.values()).sort((function(e,t){return r.indexOf(e.ref.current)-r.indexOf(t.ref.current)}))}),[t.collectionRef,t.itemMap])},Tt]),Ot=V(Ft,3),Vt=Ot[0],Ut=Ot[1],Nt=V(Ge(Rt,[Ot[2],ht]),2),jt=Nt[0],Gt=(Nt[1],ht()),qt=Q.forwardRef((function(e,t){var r=e.type,i=T(e,v),n=i,a=i;return Q.createElement(Vt.Provider,{scope:e.__scopeAccordion},"multiple"===r?Q.createElement(Qt,je({},a,{ref:t})):Q.createElement(Yt,je({},n,{ref:t})))}));qt.propTypes={type:function(e){var t=e.value||e.defaultValue;return e.type&&!["single","multiple"].includes(e.type)?new Error("Invalid prop `type` supplied to `Accordion`. Expected one of `single | multiple`."):"multiple"===e.type&&"string"==typeof t?new Error("Invalid prop `type` supplied to `Accordion`. Expected `single` when `defaultValue` or `value` is type `string`."):"single"===e.type&&Array.isArray(t)?new Error("Invalid prop `type` supplied to `Accordion`. Expected `multiple` when `defaultValue` or `value` is type `string[]`."):null}};var Zt=V(jt(Rt),2),Xt=Zt[0],Ht=Zt[1],Wt=V(jt(Rt,{collapsible:!1}),2),Kt=Wt[0],Jt=Wt[1],Yt=Q.forwardRef((function(e,t){var r=e.value,i=e.defaultValue,n=e.onValueChange,a=void 0===n?function(){}:n,o=e.collapsible,s=void 0!==o&&o,l=T(e,y),u=V(et({prop:r,defaultProp:i,onChange:a}),2),c=u[0],h=u[1];return Q.createElement(Xt,{scope:e.__scopeAccordion,value:c?[c]:[],onItemOpen:h,onItemClose:Q.useCallback((function(){return s&&h("")}),[s,h])},Q.createElement(Kt,{scope:e.__scopeAccordion,collapsible:s},Q.createElement(rr,je({},l,{ref:t}))))})),Qt=Q.forwardRef((function(e,t){var r=e.value,i=e.defaultValue,n=e.onValueChange,a=void 0===n?function(){}:n,o=T(e,g),s=V(et({prop:r,defaultProp:i,onChange:a}),2),l=s[0],u=void 0===l?[]:l,c=s[1],h=Q.useCallback((function(e){return c((function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return[].concat(I(t),[e])}))}),[c]),p=Q.useCallback((function(e){return c((function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return t.filter((function(t){return t!==e}))}))}),[c]);return Q.createElement(Xt,{scope:e.__scopeAccordion,value:u,onItemOpen:h,onItemClose:p},Q.createElement(Kt,{scope:e.__scopeAccordion,collapsible:!0},Q.createElement(rr,je({},o,{ref:t}))))})),$t=V(jt(Rt),2),er=$t[0],tr=$t[1],rr=Q.forwardRef((function(e,t){var r=e.__scopeAccordion,i=e.disabled,n=T(e,_),a=He(Q.useRef(null),t),o=Ut(r),s=Qe(e.onKeyDown,(function(e){var t;if(Bt.includes(e.key)){var r=e.target,i=o().filter((function(e){var t;return!(null!==(t=e.ref.current)&&void 0!==t&&t.disabled)})),n=i.findIndex((function(e){return e.ref.current===r})),a=i.length;if(-1!==n){e.preventDefault();var s=n;switch(e.key){case"Home":s=0;break;case"End":s=a-1;break;case"ArrowDown":s=n+1;break;case"ArrowUp":(s=n-1)<0&&(s=a-1)}null===(t=i[s%a].ref.current)||void 0===t||t.focus()}}}));return Q.createElement(er,{scope:r,disabled:i},Q.createElement(Vt.Slot,{scope:r},Q.createElement(tt.div,je({},n,{ref:a,onKeyDown:i?void 0:s}))))})),ir="AccordionItem",nr=V(jt(ir),2),ar=nr[0],or=nr[1],sr=Q.forwardRef((function(e,t){var r=e.__scopeAccordion,i=e.value,n=T(e,x),a=tr(ir,r),o=Ht(ir,r),s=Gt(r),l=st(),u=i&&o.value.includes(i)||!1,c=a.disabled||e.disabled;return Q.createElement(ar,{scope:r,open:u,disabled:c,triggerId:l},Q.createElement(Pt,je({"data-state":u?"open":"closed"},s,n,{ref:t,disabled:c,open:u,onOpenChange:function(e){e?o.onItemOpen(i):o.onItemClose(i)}})))})),lr=Q.forwardRef((function(e,t){var r,i=e.__scopeAccordion,n=T(e,b),a=or("AccordionHeader",i);return Q.createElement(tt.h3,je({"data-state":(r=a.open,r?"open":"closed"),"data-disabled":a.disabled?"":void 0},n,{ref:t}))})),ur="AccordionTrigger",cr=Q.forwardRef((function(e,t){var r=e.__scopeAccordion,i=T(e,w),n=or(ur,r),a=Jt(ur,r),o=Gt(r);return Q.createElement(Vt.ItemSlot,{scope:r},Q.createElement(Dt,je({"aria-disabled":n.open&&!a.collapsible||void 0,id:n.triggerId},o,i,{ref:t})))})),hr=C("k",Q.forwardRef((function(e,t){var r,i=e.__scopeAccordion,n=T(e,k),a=or("AccordionContent",i),o=Gt(i);return Q.createElement(Lt,je({role:"region","aria-labelledby":a.triggerId},o,n,{ref:t,style:H((r={},W(r,"--radix-accordion-content-height","var(--radix-collapsible-content-height)"),W(r,"--radix-accordion-content-width","var(--radix-collapsible-content-width)"),r),e.style)}))})));C("f",qt),C("e",sr),C("$",lr),C("b",cr),C("c",hr),C("S",(function(e){return F.exports.createElement("svg",H({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),F.exports.createElement("path",{d:"M9.99984 6L8.58984 7.41L13.1698 12L8.58984 16.59L9.99984 18L15.9998 12L9.99984 6Z"}))}));var pr=te(re.div)(e||(e=E(["\n overflow: hidden;\n"]))),fr=C("A",(function(e){var t=e.transitionOpacity,r=void 0===t||t,i=e.defaultHeight,n=void 0===i?0:i,a=e.open,o=e.children,s=V(Ne(),2),l=s[0],u={open:{height:s[1].height,opacity:1},closed:{height:n,opacity:r?0:1}};return X(pr,{variants:u,initial:a?"open":"closed",animate:a?"open":"closed",transition:{ease:"easeInOut"},children:X("div",{ref:l,children:o})})})),dr={all:function(){return["geocodes"]},list:function(e){return[].concat(I(dr.all()),[e])}};var mr={all:function(){return["suggestions"]},list:function(e){return[].concat(I(mr.all()),[e])}};var vr=C("g",te.div(t||(t=E(["\n position: relative;\n"])))),yr=te.div(r||(r=E(["\n position: absolute;\n top: calc(100% + 6px);\n width: 100%;\n box-shadow: 0px 5px 8px -4px rgba(0, 0, 0, 0.5);\n transform: translateY(-3px);\n background-color: ",";\n border-radius: ",";\n z-index: 3;\n\n ","\n"])),ie["--ll-color-background"],ie["--ll-border-radius-small"],(function(e){var t=e.renderListAbove,r=e.renderListAbovePosition;return t&&ne(i||(i=E(["\n top: inherit;\n bottom: ","px;\n "])),r)})),gr=te.button(n||(n=E(["\n width: 100%;\n border: none;\n cursor: pointer;\n text-align: left;\n padding: "," ",";\n background-color: var(--color-white);\n margin: 0;\n\n &:focus {\n transform: translate3d(0, 0, 0);\n }\n"])),ie["--ll-spacing-medium"],ie["--ll-spacing-small"]),_r=te.ul(a||(a=E(["\n list-style-type: none;\n padding: 0;\n margin: 0;\n"]))),xr=te.li(o||(o=E(["\n &:last-child {\n "," {\n overflow: hidden;\n border-radius: 0 0 ","\n ",";\n }\n }\n\n &:hover {\n background-color: ",";\n }\n"])),gr,ie["--ll-border-radius-small"],ie["--ll-border-radius-small"],ie["--ll-color-surface"]);C("h",(function(e){var t,r,i=e.label,n=e.onSearch,a=e.onSelect,o=e.placeholder,s=e.renderListAbove,l=void 0===s||s,u=e.renderListAbovePosition,c=void 0===u?0:u,h=V(F.exports.useState(""),2),p=h[0],f=h[1],d=V(F.exports.useState(""),2),m=d[0],v=d[1],y=(r={locationid:t=m,country:"CAN,USA",apiKey:"KDL0aAzsbOcv7p53P2ovno2izfDOe93hyzZRrayktbE"},ce(dr.list(r),(function(){return fetch("https://geocoder.ls.hereapi.com/6.2/geocode.json?"+new URLSearchParams(r)).then((function(e){return e.json()})).then((function(e){return e.Response.View[0].Result[0]}))}),{enabled:!!t})),g=y.data,_=y.isLoading,x=ae(p,300),b=V(F.exports.useState(!0),2),w=b[0],k=b[1],E=function(e,t){var r={query:e,country:"CAN,USA",apiKey:"KDL0aAzsbOcv7p53P2ovno2izfDOe93hyzZRrayktbE",prox:"".concat(t,",2500")};return ce(mr.list(r),(function(){return fetch("https://autocomplete.geocoder.ls.hereapi.com/6.2/suggest.json?"+new URLSearchParams(r)).then((function(e){return e.json()}))}),{enabled:!!e.length})}(x,"".concat(null==g?void 0:g.Location.DisplayPosition.Latitude,",").concat(null==g?void 0:g.Location.DisplayPosition.Longitude)),T=E.data,S=F.exports.useMemo((function(){return p?(null==T?void 0:T.suggestions)||[]:oe.getSuggestionHistory()}),[p,null==T?void 0:T.suggestions]);F.exports.useEffect((function(){g&&!_&&(n({longitude:g.Location.DisplayPosition.Longitude,latitude:g.Location.DisplayPosition.Latitude}),k(!1))}),[g]);return se(vr,{onSelect:a,children:[X(le,{autofocus:!0,value:p,label:i,placeholder:o,onFocus:function(){return k(!0)},onBlur:function(){return k(!1)},onChange:function(e){f(e.currentTarget.value),k(!0)}}),X(yr,{renderListAbove:l,renderListAbovePosition:c,children:X(fr,{open:w&&!!S.length,children:X(_r,{children:S.map((function(e,t){return X(xr,{children:X(gr,{onClick:function(){return r=(t=e).locationId,i=t.address,void(r&&i&&(v(r),f(ue.formatAddress(i)),oe.push({locationId:r,address:i})));var t,r,i},children:X(re.div,{animate:{y:[10,0],opacity:[0,1]},transition:{delay:.03*(t+1),type:"spring",duration:.4},children:(r=e.address,i=p,ue.formatAddress(r).split(new RegExp("(".concat(i,")"),"gi")).map((function(e,t){return e.toLowerCase()===i.toLowerCase()?X("strong",{children:e},t):X("span",{children:e},t)})))})})},e.locationId);var r,i}))})})})]})}))}}}))}();
|