vendor: 22,325 bytes, line 1
1!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).maplibregl=e()}(this,(function(){"use strict";var t,e,r;function i(i,o){if(t)if(e){var n="var sharedChunk = {}; ("+t+")(sharedChunk); ("+e+")(sharedChunk);",a={};t(a);r=o(a);"undefined"!=typeof window&&(r.workerUrl=window.URL.createObjectURL(new Blob([n],{type:"text/javascript"})))}else e=o;else t=o}i(0,(function(t){function e(t,e){return t(e={exports:{}},e.exports),e.exports}var r=i;function i(t,e,r,i){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(i-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=i,this.p2x=r,this.p2y=i}i.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},i.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},i.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},i.prototype.solveCurveX=function(t,e){var r,i,o,n,a;for(void 0===e&&(e=1e-6),o=t,a=0;a<8;a++){if(n=this.sampleCurveX(o)-t,Math.abs(n)<e)return o;var s=this.sampleCurveDerivativeX(o);if(Math.abs(s)<1e-6)break;o-=n/s}if((o=t)<(r=0))return r;if(o>(i=1))return i;for(;r<i;){if(n=this.sampleCurveX(o),Math.abs(n-t)<e)return o;t>n?r=o:i=o,o=.5*(i-r)+r}return o},i.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var o=n;function n(t,e){this.x=t,this.y=e}n.prototype={clone:function(){return new n(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=e,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),i=r*this.x+e*this.y;return this.x=e*this.x-r*this.y,this.y=i,this},_rotateAround:function(t,e){var r=Math.cos(t),i=Math.sin(t),o=e.y+i*(this.x-e.x)+r*(this.y-e.y);return this.x=e.x+r*(this.x-e.x)-i*(this.y-e.y),this.y=o,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},n.convert=function(t){return t instanceof n?t:Array.isArray(t)?new n(t[0],t[1]):t};var a="undefined"!=typeof self?self:{},s=Math.pow(2,53)-1;function l(t,e,i,o){var n=new r(t,e,i,o);return function(t){return n.solve(t)}}var p=l(.25,.1,.25,1);function c(t,e,r){return Math.min(r,Math.max(e,t))}function u(t,e,r){var i=r-e,o=((t-e)%i+i)%i+e;return o===e?r:o}function h(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var i=0,o=e;i<o.length;i+=1){var n=o[i];for(var a in n)t[a]=n[a]}return t}var d=1;function f(){return d++}function m(){return function t(e){return e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function _(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function y(t,e){t.forEach((function(t){e[t]&&(e[t]=e[t].bind(e))}))}function g(t,e){return-1!==t.indexOf(e,t.length-e.length)}function v(t,e,r){var i={};for(var o in t)i[o]=e.call(r||this,t[o],o,t);return i}function x(t,e,r){var i={};for(var o in t)e.call(r||this,t[o],o,t)&&(i[o]=t[o]);return i}function b(t){return Array.isArray(t)?t.map(b):"object"==typeof t&&t?v(t,b):t}var w={};function C(t){w[t]||("undefined"!=typeof console&&console.warn(t),w[t]=!0)}function k(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function S(t){for(var e=0,r=0,i=t.length,o=i-1,n=void 0,a=void 0;r<i;o=r++)e+=((a=t[o]).x-(n=t[r]).x)*(n.y+a.y);return e}function M(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}function E(t){var e={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(t,r,i,o){var n=i||o;return e[r]=!n||n.toLowerCase(),""})),e["max-age"]){var r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e}var T=null;function A(t){if(null==T){var e=t.navigator?t.navigator.userAgent:null;T=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return T}function I(t){try{var e=a[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var P,L,z,R,D=a.performance&&a.performance.now?a.performance.now.bind(a.performance):Date.now.bind(Date),O=a.requestAnimationFrame||a.mozRequestAnimationFrame||a.webkitRequestAnimationFrame||a.msRequestAnimationFrame,F=a.cancelAnimationFrame||a.mozCancelAnimationFrame||a.webkitCancelAnimationFrame||a.msCancelAnimationFrame,B={now:D,frame:function(t){var e=O(t);return{cancel:function(){return F(e)}}},getImageData:function(t,e){void 0===e&&(e=0);var r=a.document.createElement("canvas"),i=r.getContext("2d");if(!i)throw new Error("failed to create canvas 2d context");return r.width=t.width,r.height=t.height,i.drawImage(t,0,0,t.width,t.height),i.getImageData(-e,-e,t.width+2*e,t.height+2*e)},resolveURL:function(t){return P||(P=a.document.createElement("a")),P.href=t,P.href},hardwareConcurrency:a.navigator&&a.navigator.hardwareConcurrency||4,get devicePixelRatio(){return a.devicePixelRatio},get prefersReducedMotion(){return!!a.matchMedia&&(null==L&&(L=a.matchMedia("(prefers-reduced-motion: reduce)")),L.matches)}},j={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16,REGISTERED_PROTOCOLS:{}},N={supported:!1,testSupport:function(t){!U&&R&&(V?q(t):z=t)}},U=!1,V=!1;function q(t){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,R),t.isContextLost())return;N.supported=!0}catch(t){}t.deleteTexture(e),U=!0}a.document&&((R=a.document.createElement("img")).onload=function(){z&&q(z),z=null,V=!0},R.onerror=function(){U=!0,z=null},R.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var $="01",H=function(t,e){this._transformRequestFn=t,this._customAccessToken=e,this._createSkuToken()};function Z(t){return 0===t.indexOf("mapbox:")}H.prototype._createSkuToken=function(){var t=function(){for(var t="",e=0;e<10;e++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",$,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt},H.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},H.prototype.transformRequest=function(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}},H.prototype.normalizeStyleURL=function(t,e){if(!Z(t))return t;var r=W(t);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},H.prototype.normalizeGlyphsURL=function(t,e){if(!Z(t))return t;var r=W(t);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},H.prototype.normalizeSourceURL=function(t,e){if(!Z(t))return t;var r=W(t);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||e)},H.prototype.normalizeSpriteURL=function(t,e,r,i){var o=W(t);return Z(t)?(o.path="/styles/v1"+o.path+"/sprite"+e+r,this._makeAPIURL(o,this._customAccessToken||i)):(o.path+=""+e+r,K(o))},H.prototype.normalizeTileURL=function(t,e){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!Z(t))return t;var r=W(t);r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,(B.devicePixelRatio>=2||512===e?"@2x":"")+(N.supported?".webp":"$1")),r.path=r.path.replace(/^.+\/v4\//,"/"),r.path="/v4"+r.path;var i=this._customAccessToken||function(t){for(var e=0,r=t;e<r.length;e+=1){var i=r[e].match(/^access_token=(.*)$/);if(i)return i[1]}return null}(r.params)||j.ACCESS_TOKEN;return j.REQUIRE_ACCESS_TOKEN&&i&&this._skuToken&&r.params.push("sku="+this._skuToken),this._makeAPIURL(r,i)},H.prototype.canonicalizeTileURL=function(t,e){var r=W(t);if(!r.path.match(/(^\/v4\/)/)||!r.path.match(/\.[\w]+$/))return t;var i="mapbox://tiles/";i+=r.path.replace("/v4/","");var o=r.params;return e&&(o=o.filter((function(t){return!t.match(/^access_token=/)}))),o.length&&(i+="?"+o.join("&")),i},H.prototype.canonicalizeTileset=function(t,e){for(var r=!!e&&Z(e),i=[],o=0,n=t.tiles||[];o<n.length;o+=1){var a=n[o];Q(a)?i.push(this.canonicalizeTileURL(a,r)):i.push(a)}return i},H.prototype._makeAPIURL=function(t,e){var r="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",i=W(j.API_URL);if(t.protocol=i.protocol,t.authority=i.authority,"http"===t.protocol){var o=t.params.indexOf("secure");o>=0&&t.params.splice(o,1)}if("/"!==i.path&&(t.path=""+i.path+t.path),!j.REQUIRE_ACCESS_TOKEN)return K(t);if(!(e=e||j.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+r);if("s"===e[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+r);return t.params=t.params.filter((function(t){return-1===t.indexOf("access_token")})),t.params.push("access_token="+e),K(t)},H.prototype.setTransformRequest=function(t){this._transformRequestFn=t};var G=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function Q(t){return G.test(t)}var X=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function W(t){var e=t.match(X);if(!e)throw new Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}function K(t){var e=t.params.length?"?"+t.params.join("&"):"";return t.protocol+"://"+t.authority+t.path+e}function J(t){if(!t)return null;var e=t.split(".");if(!e||3!==e.length)return null;try{return JSON.parse(decodeURIComponent(a.atob(e[1]).split("").map((function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)})).join("")))}catch(t){return null}}var Y=function(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};Y.prototype.getStorageKey=function(t){var e,r=J(j.ACCESS_TOKEN);return e=r&&r.u?a.btoa(encodeURIComponent(r.u).replace(/%([0-9A-F]{2})/g,(function(t,e){return String.fromCharCode(Number("0x"+e))}))):j.ACCESS_TOKEN||"",t?"mapbox.eventData."+t+":"+e:"mapbox.eventData:"+e},Y.prototype.fetchEventData=function(){var t=I("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{var i=a.localStorage.getItem(e);i&&(this.eventData=JSON.parse(i));var o=a.localStorage.getItem(r);o&&(this.anonId=o)}catch(t){C("Unable to read from LocalStorage")}},Y.prototype.saveEventData=function(){var t=I("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{a.localStorage.setItem(r,this.anonId),Object.keys(this.eventData).length>=1&&a.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){C("Unable to write to LocalStorage")}},Y.prototype.processRequests=function(t){},Y.prototype.postEvent=function(t,e,r,i){var o=this;if(j.EVENTS_URL){var n=W(j.EVENTS_URL);n.params.push("access_token="+(i||j.ACCESS_TOKEN||""));var a={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.15.2",skuId:$,userId:this.anonId},s=e?h(a,e):a,l={url:K(n),headers:{"Content-Type":"text/plain"},body:JSON.stringify([s])};this.pendingRequest=wt(l,(function(t){o.pendingRequest=null,r(t),o.saveEventData(),o.processRequests(i)}))}},Y.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e)};var tt,et,rt=function(t){function e(){t.call(this,"map.load"),this.success={},this.skuToken=""}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.postMapLoadEvent=function(t,e,r,i){this.skuToken=r,(j.EVENTS_URL&&i||j.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return Z(t)||Q(t)})))&&this.queueRequest({id:e,timestamp:Date.now()},i)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){var r=this.queue.shift(),i=r.id,o=r.timestamp;i&&this.success[i]||(this.anonId||this.fetchEventData(),_(this.anonId)||(this.anonId=m()),this.postEvent(o,{skuToken:this.skuToken},(function(t){t||i&&(e.success[i]=!0)}),t))}},e}(Y),it=new(function(t){function e(e){t.call(this,"appUserTurnstile"),this._customAccessToken=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.postTurnstileEvent=function(t,e){j.EVENTS_URL&&j.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return Z(t)||Q(t)}))&&this.queueRequest(Date.now(),e)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var r=J(j.ACCESS_TOKEN),i=r?r.u:j.ACCESS_TOKEN,o=i!==this.eventData.tokenU;_(this.anonId)||(this.anonId=m(),o=!0);var n=this.queue.shift();if(this.eventData.lastSuccess){var a=new Date(this.eventData.lastSuccess),s=new Date(n),l=(n-this.eventData.lastSuccess)/864e5;o=o||l>=1||l<-1||a.getDate()!==s.getDate()}else o=!0;if(!o)return this.processRequests();this.postEvent(n,{"enabled.telemetry":!1},(function(t){t||(e.eventData.lastSuccess=n,e.eventData.tokenU=i)}),t)}},e}(Y)),ot=it.postTurnstileEvent.bind(it),nt=new rt,at=nt.postMapLoadEvent.bind(nt),st=500,lt=50;function pt(){a.caches&&!tt&&(tt=a.caches.open("mapbox-tiles"))}function ct(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}var ut,ht=1/0;function dt(){return null==ut&&(ut=a.OffscreenCanvas&&new a.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof a.createImageBitmap),ut}var ft={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(ft);var mt=function(t){function e(e,r,i){401===r&&Q(i)&&(e+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),t.call(this,e),this.status=r,this.url=i,this.name=this.constructor.name,this.message=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},e}(Error),_t=M()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===a.location.protocol?a.parent:a).location.href};function yt(t,e){var r,i=new a.AbortController,o=new a.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:_t(),signal:i.signal}),n=!1,s=!1,l=(r=o.url).indexOf("sku=")>0&&Q(r);"json"===t.type&&o.headers.set("Accept","application/json");var p=function(r,i,n){if(!s){if(r&&"SecurityError"!==r.message&&C(r),i&&n)return c(i);var p=Date.now();a.fetch(o).then((function(r){if(r.ok){var i=l?r.clone():null;return c(r,i,p)}return e(new mt(r.statusText,r.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message))}))}},c=function(r,i,l){("arrayBuffer"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text()).then((function(t){s||(i&&l&&function(t,e,r){if(pt(),tt){var i={status:e.status,statusText:e.statusText,headers:new a.Headers};e.headers.forEach((function(t,e){return i.headers.set(e,t)}));var o=E(e.headers.get("Cache-Control")||"");o["no-store"]||(o["max-age"]&&i.headers.set("Expires",new Date(r+1e3*o["max-age"]).toUTCString()),new Date(i.headers.get("Expires")).getTime()-r<42e4||function(t,e){if(void 0===et)try{new Response(new ReadableStream),et=!0}catch(t){et=!1}et?e(t.body):t.blob().then(e)}(e,(function(e){var r=new a.Response(e,i);pt(),tt&&tt.then((function(e){return e.put(ct(t.url),r)})).catch((function(t){return C(t.message)}))})))}}(o,i,l),n=!0,e(null,t,r.headers.get("Cache-Control"),r.headers.get("Expires")))})).catch((function(t){s||e(new Error(t.message))}))};return l?function(t,e){if(pt(),!tt)return e(null);var r=ct(t.url);tt.then((function(t){t.match(r).then((function(i){var o=function(t){if(!t)return!1;var e=new Date(t.headers.get("Expires")||0),r=E(t.headers.get("Cache-Control")||"");return e>Date.now()&&!r["no-cache"]}(i);t.delete(r),o&&t.put(r,i.clone()),e(null,i,o)})).catch(e)})).catch(e)}(o,p):p(null,null),{cancel:function(){s=!0,n||i.abort()}}}var gt,vt,xt=function(t,e){if(/:\/\//.test(t.url)&&!/^https?:|^file:/.test(t.url)){if(M()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e);if(!M()){var r=t.url.substring(0,t.url.indexOf("://"));return(j.REGISTERED_PROTOCOLS[r]||yt)(t,e)}}if(!(/^file:/.test(i=t.url)||/^file:/.test(_t())&&!/^\w+:/.test(i))){if(a.fetch&&a.Request&&a.AbortController&&a.Request.prototype.hasOwnProperty("signal"))return yt(t,e);if(M()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}var i;return function(t,e){var r=new a.XMLHttpRequest;for(var i in r.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(r.responseType="arraybuffer"),t.headers)r.setRequestHeader(i,t.headers[i]);return"json"===t.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===t.credentials,r.onerror=function(){e(new Error(r.statusText))},r.onload=function(){if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){var i=r.response;if("json"===t.type)try{i=JSON.parse(r.response)}catch(t){return e(t)}e(null,i,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else e(new mt(r.statusText,r.status,t.url))},r.send(t.body),{cancel:function(){return r.abort()}}}(t,e)},bt=function(t,e){return xt(h(t,{type:"arrayBuffer"}),e)},wt=function(t,e){return xt(h(t,{method:"POST"}),e)},Ct="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";gt=[],vt=0;var kt=function(t,e){if(N.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),vt>=j.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:t,callback:e,cancelled:!1,cancel:function(){this.cancelled=!0}};return gt.push(r),r}vt++;var i=!1,o=function(){if(!i)for(i=!0,vt--;gt.length&&vt<j.MAX_PARALLEL_IMAGE_REQUESTS;){var t=gt.shift();t.cancelled||(t.cancel=kt(t.requestParameters,t.callback).cancel)}},n=bt(t,(function(t,r,i,n){o(),t?e(t):r&&(dt()?function(t,e){var r=new a.Blob([new Uint8Array(t)],{type:"image/png"});a.createImageBitmap(r).then((function(t){e(null,t)})).catch((function(t){e(new Error("Could not load image because of "+t.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))}))}(r,e):function(t,e,r,i){var o=new a.Image,n=a.URL;o.onload=function(){e(null,o),n.revokeObjectURL(o.src),o.onload=null,a.requestAnimationFrame((function(){o.src=Ct}))},o.onerror=function(){return e(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))};var s=new a.Blob([new Uint8Array(t)],{type:"image/png"});o.cacheControl=r,o.expires=i,o.src=t.byteLength?n.createObjectURL(s):Ct}(r,e,i,n))}));return{cancel:function(){n.cancel(),o()}}};function St(t,e,r){r[t]&&-1!==r[t].indexOf(e)||(r[t]=r[t]||[],r[t].push(e))}function Mt(t,e,r){if(r&&r[t]){var i=r[t].indexOf(e);-1!==i&&r[t].splice(i,1)}}var Et=function(t,e){void 0===e&&(e={}),h(this,e),this.type=t},Tt=function(t){function e(e,r){void 0===r&&(r={}),t.call(this,"error",h({error:e},r))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(Et),At=function(){};At.prototype.on=function(t,e){return this._listeners=this._listeners||{},St(t,e,this._listeners),this},At.prototype.off=function(t,e){return Mt(t,e,this._listeners),Mt(t,e,this._oneTimeListeners),this},At.prototype.once=function(t,e){return this._oneTimeListeners=this._oneTimeListeners||{},St(t,e,this._oneTimeListeners),this},At.prototype.fire=function(t,e){"string"==typeof t&&(t=new Et(t,e||{}));var r=t.type;if(this.listens(r)){t.target=this;for(var i=0,o=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];i<o.length;i+=1)o[i].call(this,t);for(var n=0,a=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];n<a.length;n+=1){var s=a[n];Mt(r,s,this._oneTimeListeners),s.call(this,t)}var l=this._eventedParent;l&&(h(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),l.fire(t))}else t instanceof Tt&&console.error(t.error);return this},At.prototype.listens=function(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},At.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var I
vendor: 19,006 bytes, line 1
1t={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},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"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},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}},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"}
vendor: 9,823 bytes, line 1
1,"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"}}}
vendor: 30,037 bytes, line 1
1,Pt=function(t,e,r,i){this.message=(t?t+": ":"")+r,i&&(this.identifier=i),null!=e&&e.__line__&&(this.line=e.__line__)};function Lt(t){var e=t.value;return e?[new Pt(t.key,e,"constants have been deprecated as of v8")]:[]}function zt(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var i=0,o=e;i<o.length;i+=1){var n=o[i];for(var a in n)t[a]=n[a]}return t}function Rt(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function Dt(t){if(Array.isArray(t))return t.map(Dt);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){var e={};for(var r in t)e[r]=Dt(t[r]);return e}return Rt(t)}var Ot=function(t){function e(e,r){t.call(this,r),this.message=r,this.key=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(Error),Ft=function(t,e){void 0===e&&(e=[]),this.parent=t,this.bindings={};for(var r=0,i=e;r<i.length;r+=1){var o=i[r];this.bindings[o[0]]=o[1]}};Ft.prototype.concat=function(t){return new Ft(this,t)},Ft.prototype.get=function(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(t+" not found in scope.")},Ft.prototype.has=function(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)};var Bt={kind:"null"},jt={kind:"number"},Nt={kind:"string"},Ut={kind:"boolean"},Vt={kind:"color"},qt={kind:"object"},$t={kind:"value"},Ht={kind:"collator"},Zt={kind:"formatted"},Gt={kind:"resolvedImage"};function Qt(t,e){return{kind:"array",itemType:t,N:e}}function Xt(t){if("array"===t.kind){var e=Xt(t.itemType);return"number"==typeof t.N?"array<"+e+", "+t.N+">":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var Wt=[Bt,jt,Nt,Ut,Vt,Zt,qt,Qt($t),Gt];function Kt(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Kt(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var r=0,i=Wt;r<i.length;r+=1)if(!Kt(i[r],e))return null}return"Expected "+Xt(t)+" but found "+Xt(e)+" instead."}function Jt(t,e){return e.some((function(e){return e.kind===t.kind}))}function Yt(t,e){return e.some((function(e){return"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"==typeof t:e===typeof t}))}var te=e((function(t,e){var r={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function i(t){return(t=Math.round(t))<0?0:t>255?255:t}function o(t){return i("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function n(t){return(e="%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))<0?0:e>1?1:e;var e}function a(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}try{e.parseCSSColor=function(t){var e,s=t.replace(/ /g,"").toLowerCase();if(s in r)return r[s].slice();if("#"===s[0])return 4===s.length?(e=parseInt(s.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===s.length&&(e=parseInt(s.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var l=s.indexOf("("),p=s.indexOf(")");if(-1!==l&&p+1===s.length){var c=s.substr(0,l),u=s.substr(l+1,p-(l+1)).split(","),h=1;switch(c){case"rgba":if(4!==u.length)return null;h=n(u.pop());case"rgb":return 3!==u.length?null:[o(u[0]),o(u[1]),o(u[2]),h];case"hsla":if(4!==u.length)return null;h=n(u.pop());case"hsl":if(3!==u.length)return null;var d=(parseFloat(u[0])%360+360)%360/360,f=n(u[1]),m=n(u[2]),_=m<=.5?m*(f+1):m+f-m*f,y=2*m-_;return[i(255*a(y,_,d+1/3)),i(255*a(y,_,d)),i(255*a(y,_,d-1/3)),h];default:return null}}return null}}catch(t){}})).parseCSSColor,ee=function(t,e,r,i){void 0===i&&(i=1),this.r=t,this.g=e,this.b=r,this.a=i};ee.parse=function(t){if(t){if(t instanceof ee)return t;if("string"==typeof t){var e=te(t);if(e)return new ee(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},ee.prototype.toString=function(){var t=this.toArray(),e=t[1],r=t[2],i=t[3];return"rgba("+Math.round(t[0])+","+Math.round(e)+","+Math.round(r)+","+i+")"},ee.prototype.toArray=function(){var t=this.a;return 0===t?[0,0,0,0]:[255*this.r/t,255*this.g/t,255*this.b/t,t]},ee.black=new ee(0,0,0,1),ee.white=new ee(1,1,1,1),ee.transparent=new ee(0,0,0,0),ee.red=new ee(1,0,0,1);var re=function(t,e,r){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};re.prototype.compare=function(t,e){return this.collator.compare(t,e)},re.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var ie=function(t,e,r,i,o){this.text=t,this.image=e,this.scale=r,this.fontStack=i,this.textColor=o},oe=function(t){this.sections=t};oe.fromString=function(t){return new oe([new ie(t,null,null,null,null)])},oe.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(t){return 0!==t.text.length||t.image&&0!==t.image.name.length}))},oe.factory=function(t){return t instanceof oe?t:oe.fromString(t)},oe.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},oe.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e<r.length;e+=1){var i=r[e];if(i.image)t.push(["image",i.image.name]);else{t.push(i.text);var o={};i.fontStack&&(o["text-font"]=["literal",i.fontStack.split(",")]),i.scale&&(o["font-scale"]=i.scale),i.textColor&&(o["text-color"]=["rgba"].concat(i.textColor.toArray())),t.push(o)}}return t};var ne=function(t){this.name=t.name,this.available=t.available};function ae(t,e,r,i){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===i||"number"==typeof i&&i>=0&&i<=1?null:"Invalid rgba value ["+[t,e,r,i].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof i?[t,e,r,i]:[t,e,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function se(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof ee)return!0;if(t instanceof re)return!0;if(t instanceof oe)return!0;if(t instanceof ne)return!0;if(Array.isArray(t)){for(var e=0,r=t;e<r.length;e+=1)if(!se(r[e]))return!1;return!0}if("object"==typeof t){for(var i in t)if(!se(t[i]))return!1;return!0}return!1}function le(t){if(null===t)return Bt;if("string"==typeof t)return Nt;if("boolean"==typeof t)return Ut;if("number"==typeof t)return jt;if(t instanceof ee)return Vt;if(t instanceof re)return Ht;if(t instanceof oe)return Zt;if(t instanceof ne)return Gt;if(Array.isArray(t)){for(var e,r=t.length,i=0,o=t;i<o.length;i+=1){var n=le(o[i]);if(e){if(e===n)continue;e=$t;break}e=n}return Qt(e||$t,r)}return qt}function pe(t){var e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof ee||t instanceof oe||t instanceof ne?t.toString():JSON.stringify(t)}ne.prototype.toString=function(){return this.name},ne.fromString=function(t){return t?new ne({name:t,available:!1}):null},ne.prototype.serialize=function(){return["image",this.name]};var ce=function(t,e){this.type=t,this.value=e};ce.parse=function(t,e){if(2!==t.length)return e.error("'literal' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(!se(t[1]))return e.error("invalid value");var r=t[1],i=le(r),o=e.expectedType;return"array"!==i.kind||0!==i.N||!o||"array"!==o.kind||"number"==typeof o.N&&0!==o.N||(i=o),new ce(i,r)},ce.prototype.evaluate=function(){return this.value},ce.prototype.eachChild=function(){},ce.prototype.outputDefined=function(){return!0},ce.prototype.serialize=function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof ee?["rgba"].concat(this.value.toArray()):this.value instanceof oe?this.value.serialize():this.value};var ue=function(t){this.name="ExpressionEvaluationError",this.message=t};ue.prototype.toJSON=function(){return this.message};var he={string:Nt,number:jt,boolean:Ut,object:qt},de=function(t,e){this.type=t,this.args=e};de.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r,i=1,o=t[0];if("array"===o){var n,a;if(t.length>2){var s=t[1];if("string"!=typeof s||!(s in he)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);n=he[s],i++}else n=$t;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);a=t[2],i++}r=Qt(n,a)}else r=he[o];for(var l=[];i<t.length;i++){var p=e.parse(t[i],i,$t);if(!p)return null;l.push(p)}return new de(r,l)},de.prototype.evaluate=function(t){for(var e=0;e<this.args.length;e++){var r=this.args[e].evaluate(t);if(!Kt(this.type,le(r)))return r;if(e===this.args.length-1)throw new ue("Expected value to be of type "+Xt(this.type)+", but found "+Xt(le(r))+" instead.")}return null},de.prototype.eachChild=function(t){this.args.forEach(t)},de.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},de.prototype.serialize=function(){var t=this.type,e=[t.kind];if("array"===t.kind){var r=t.itemType;if("string"===r.kind||"number"===r.kind||"boolean"===r.kind){e.push(r.kind);var i=t.N;("number"==typeof i||this.args.length>1)&&e.push(i)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var fe=function(t){this.type=Zt,this.sections=t};fe.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");for(var i=[],o=!1,n=1;n<=t.length-1;++n){var a=t[n];if(o&&"object"==typeof a&&!Array.isArray(a)){o=!1;var s=null;if(a["font-scale"]&&!(s=e.parse(a["font-scale"],1,jt)))return null;var l=null;if(a["text-font"]&&!(l=e.parse(a["text-font"],1,Qt(Nt))))return null;var p=null;if(a["text-color"]&&!(p=e.parse(a["text-color"],1,Vt)))return null;var c=i[i.length-1];c.scale=s,c.font=l,c.textColor=p}else{var u=e.parse(t[n],1,$t);if(!u)return null;var h=u.type.kind;if("string"!==h&&"value"!==h&&"null"!==h&&"resolvedImage"!==h)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");o=!0,i.push({content:u,scale:null,font:null,textColor:null})}}return new fe(i)},fe.prototype.evaluate=function(t){return new oe(this.sections.map((function(e){var r=e.content.evaluate(t);return le(r)===Gt?new ie("",r,null,null,null):new ie(pe(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},fe.prototype.eachChild=function(t){for(var e=0,r=this.sections;e<r.length;e+=1){var i=r[e];t(i.content),i.scale&&t(i.scale),i.font&&t(i.font),i.textColor&&t(i.textColor)}},fe.prototype.outputDefined=function(){return!1},fe.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e<r.length;e+=1){var i=r[e];t.push(i.content.serialize());var o={};i.scale&&(o["font-scale"]=i.scale.serialize()),i.font&&(o["text-font"]=i.font.serialize()),i.textColor&&(o["text-color"]=i.textColor.serialize()),t.push(o)}return t};var me=function(t){this.type=Gt,this.input=t};me.parse=function(t,e){if(2!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Nt);return r?new me(r):e.error("No image name provided.")},me.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=ne.fromString(e);return r&&t.availableImages&&(r.available=t.availableImages.indexOf(e)>-1),r},me.prototype.eachChild=function(t){t(this.input)},me.prototype.outputDefined=function(){return!1},me.prototype.serialize=function(){return["image",this.input.serialize()]};var _e={"to-boolean":Ut,"to-color":Vt,"to-number":jt,"to-string":Nt},ye=function(t,e){this.type=t,this.args=e};ye.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[0];if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");for(var i=_e[r],o=[],n=1;n<t.length;n++){var a=e.parse(t[n],n,$t);if(!a)return null;o.push(a)}return new ye(i,o)},ye.prototype.evaluate=function(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){for(var e,r,i=0,o=this.args;i<o.length;i+=1){if(r=null,(e=o[i].evaluate(t))instanceof ee)return e;if("string"==typeof e){var n=t.parseColor(e);if(n)return n}else if(Array.isArray(e)&&!(r=e.length<3||e.length>4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":ae(e[0],e[1],e[2],e[3])))return new ee(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new ue(r||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var a=null,s=0,l=this.args;s<l.length;s+=1){if(null===(a=l[s].evaluate(t)))return 0;var p=Number(a);if(!isNaN(p))return p}throw new ue("Could not convert "+JSON.stringify(a)+" to number.")}return"formatted"===this.type.kind?oe.fromString(pe(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?ne.fromString(pe(this.args[0].evaluate(t))):pe(this.args[0].evaluate(t))},ye.prototype.eachChild=function(t){this.args.forEach(t)},ye.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},ye.prototype.serialize=function(){if("formatted"===this.type.kind)return new fe([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new me(this.args[0]).serialize();var t=["to-"+this.type.kind];return this.eachChild((function(e){t.push(e.serialize())})),t};var ge=["Unknown","Point","LineString","Polygon"],ve=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};ve.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},ve.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?ge[this.feature.type]:this.feature.type:null},ve.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},ve.prototype.canonicalID=function(){return this.canonical},ve.prototype.properties=function(){return this.feature&&this.feature.properties||{}},ve.prototype.parseColor=function(t){var e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=ee.parse(t)),e};var xe=function(t,e,r,i){this.name=t,this.type=e,this._evaluate=r,this.args=i};xe.prototype.evaluate=function(t){return this._evaluate(t,this.args)},xe.prototype.eachChild=function(t){this.args.forEach(t)},xe.prototype.outputDefined=function(){return!1},xe.prototype.serialize=function(){return[this.name].concat(this.args.map((function(t){return t.serialize()})))},xe.parse=function(t,e){var r,i=t[0],o=xe.definitions[i];if(!o)return e.error('Unknown expression "'+i+'". If you wanted a literal array, use ["literal", [...]].',0);for(var n=Array.isArray(o)?o[0]:o.type,a=Array.isArray(o)?[[o[1],o[2]]]:o.overloads,s=a.filter((function(e){var r=e[0];return!Array.isArray(r)||r.length===t.length-1})),l=null,p=0,c=s;p<c.length;p+=1){var u=c[p],h=u[0],d=u[1];l=new Ve(e.registry,e.path,null,e.scope);for(var f=[],m=!1,_=1;_<t.length;_++){var y=t[_],g=Array.isArray(h)?h[_-1]:h.type,v=l.parse(y,1+f.length,g);if(!v){m=!0;break}f.push(v)}if(!m)if(Array.isArray(h)&&h.length!==f.length)l.error("Expected "+h.length+" arguments, but found "+f.length+" instead.");else{for(var x=0;x<f.length;x++){var b=Array.isArray(h)?h[x]:h.type,w=f[x];l.concat(x+1).checkSubtype(b,w.type)}if(0===l.errors.length)return new xe(i,n,d,f)}}if(1===s.length)(r=e.errors).push.apply(r,l.errors);else{for(var C=(s.length?s:a).map((function(t){var e;return e=t[0],Array.isArray(e)?"("+e.map(Xt).join(", ")+")":"("+Xt(e.type)+"...)"})).join(" | "),k=[],S=1;S<t.length;S++){var M=e.parse(t[S],1+k.length);if(!M)return null;k.push(Xt(M.type))}e.error("Expected arguments of type "+C+", but found ("+k.join(", ")+") instead.")}return null},xe.register=function(t,e){for(var r in xe.definitions=e,e)t[r]=xe};var be=function(t,e,r){this.type=Ht,this.locale=r,this.caseSensitive=t,this.diacriticSensitive=e};function we(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function Ce(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function ke(t,e){var r=(180+t[0])/360,i=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,o=Math.pow(2,e.z);return[Math.round(r*o*8192),Math.round(i*o*8192)]}function Se(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}function Me(t,e){for(var r,i,o,n,a,s,l,p=!1,c=0,u=e.length;c<u;c++)for(var h=e[c],d=0,f=h.length;d<f-1;d++){if((n=(r=t)[0]-(i=h[d])[0])*(l=r[1]-(o=h[d+1])[1])-(s=r[0]-o[0])*(a=r[1]-i[1])==0&&n*s<=0&&a*l<=0)return!1;Se(t,h[d],h[d+1])&&(p=!p)}return p}function Ee(t,e){for(var r=0;r<e.length;r++)if(Me(t,e[r]))return!0;return!1}function Te(t,e,r,i){var o=i[0]-r[0],n=i[1]-r[1],a=(t[0]-r[0])*n-o*(t[1]-r[1]),s=(e[0]-r[0])*n-o*(e[1]-r[1]);return a>0&&s<0||a<0&&s>0}function Ae(t,e,r){for(var i=0,o=r;i<o.length;i+=1)for(var n=o[i],a=0;a<n.length-1;++a)if(0!=(u=[(c=n[a+1])[0]-(p=n[a])[0],c[1]-p[1]])[0]*(h=[(l=e)[0]-(s=t)[0],l[1]-s[1]])[1]-u[1]*h[0]&&Te(s,l,p,c)&&Te(p,c,s,l))return!0;var s,l,p,c,u,h;return!1}function Ie(t,e){for(var r=0;r<t.length;++r)if(!Me(t[r],e))return!1;for(var i=0;i<t.length-1;++i)if(Ae(t[i],t[i+1],e))return!1;return!0}function Pe(t,e){for(var r=0;r<e.length;r++)if(Ie(t,e[r]))return!0;return!1}function Le(t,e,r){for(var i=[],o=0;o<t.length;o++){for(var n=[],a=0;a<t[o].length;a++){var s=ke(t[o][a],r);we(e,s),n.push(s)}i.push(n)}return i}function ze(t,e,r){for(var i=[],o=0;o<t.length;o++){var n=Le(t[o],e,r);i.push(n)}return i}function Re(t,e,r,i){if(t[0]<r[0]||t[0]>r[2]){var o=.5*i,n=t[0]-r[0]>o?-i:r[0]-t[0]>o?i:0;0===n&&(n=t[0]-r[2]>o?-i:r[2]-t[0]>o?i:0),t[0]+=n}we(e,t)}function De(t,e,r,i){for(var o=8192*Math.pow(2,i.z),n=[8192*i.x,8192*i.y],a=[],s=0,l=t;s<l.length;s+=1)for(var p=0,c=l[s];p<c.length;p+=1){var u=c[p],h=[u.x+n[0],u.y+n[1]];Re(h,e,r,o),a.push(h)}return a}function Oe(t,e,r,i){for(var o,n=8192*Math.pow(2,i.z),a=[8192*i.x,8192*i.y],s=[],l=0,p=t;l<p.length;l+=1){for(var c=[],u=0,h=p[l];u<h.length;u+=1){var d=h[u],f=[d.x+a[0],d.y+a[1]];we(e,f),c.push(f)}s.push(c)}if(e[2]-e[0]<=n/2){(o=e)[0]=o[1]=1/0,o[2]=o[3]=-1/0;for(var m=0,_=s;m<_.length;m+=1)for(var y=0,g=_[m];y<g.length;y+=1)Re(g[y],e,r,n)}return s}be.parse=function(t,e){if(2!==t.length)return e.error("Expected one argument.");var r=t[1];if("object"!=typeof r||Array.isArray(r))return e.error("Collator options argument must be an object.");var i=e.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,Ut);if(!i)return null;var o=e.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,Ut);if(!o)return null;var n=null;return r.locale&&!(n=e.parse(r.locale,1,Nt))?null:new be(i,o,n)},be.prototype.evaluate=function(t){return new re(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},be.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)},be.prototype.outputDefined=function(){return!1},be.prototype.serialize=function(){var t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]};var Fe=function(t,e){this.type=Ut,this.geojson=t,this.geometries=e};function Be(t){if(t instanceof xe){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof Fe)return!1;var e=!0;return t.eachChild((function(t){e&&!Be(t)&&(e=!1)})),e}function je(t){if(t instanceof xe&&"feature-state"===t.name)return!1;var e=!0;return t.eachChild((function(t){e&&!je(t)&&(e=!1)})),e}function Ne(t,e){if(t instanceof xe&&e.indexOf(t.name)>=0)return!1;var r=!0;return t.eachChild((function(t){r&&!Ne(t,e)&&(r=!1)})),r}Fe.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(se(t[1])){var r=t[1];if("FeatureCollection"===r.type)for(var i=0;i<r.features.length;++i){var o=r.features[i].geometry.type;if("Polygon"===o||"MultiPolygon"===o)return new Fe(r,r.features[i].geometry)}else if("Feature"===r.type){var n=r.geometry.type;if("Polygon"===n||"MultiPolygon"===n)return new Fe(r,r.geometry)}else if("Polygon"===r.type||"MultiPolygon"===r.type)return new Fe(r,r)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")},Fe.prototype.evaluate=function(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){var r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],o=t.canonicalID();if("Polygon"===e.type){var n=Le(e.coordinates,i,o),a=De(t.geometry(),r,i,o);if(!Ce(r,i))return!1;for(var s=0,l=a;s<l.length;s+=1)if(!Me(l[s],n))return!1}if("MultiPolygon"===e.type){var p=ze(e.coordinates,i,o),c=De(t.geometry(),r,i,o);if(!Ce(r,i))return!1;for(var u=0,h=c;u<h.length;u+=1)if(!Ee(h[u],p))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){var r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],o=t.canonicalID();if("Polygon"===e.type){var n=Le(e.coordinates,i,o),a=Oe(t.geometry(),r,i,o);if(!Ce(r,i))return!1;for(var s=0,l=a;s<l.length;s+=1)if(!Ie(l[s],n))return!1}if("MultiPolygon"===e.type){var p=ze(e.coordinates,i,o),c=Oe(t.geometry(),r,i,o);if(!Ce(r,i))return!1;for(var u=0,h=c;u<h.length;u+=1)if(!Pe(h[u],p))return!1}return!0}(t,this.geometries)}return!1},Fe.prototype.eachChild=function(){},Fe.prototype.outputDefined=function(){return!0},Fe.prototype.serialize=function(){return["within",this.geojson]};var Ue=function(t,e){this.type=e.type,this.name=t,this.boundExpression=e};Ue.parse=function(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");var r=t[1];return e.scope.has(r)?new Ue(r,e.scope.get(r)):e.error('Unknown variable "'+r+'". Make sure "'+r+'" has been bound in an enclosing "let" expression before using it.',1)},Ue.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},Ue.prototype.eachChild=function(){},Ue.prototype.outputDefined=function(){return!1},Ue.prototype.serialize=function(){return["var",this.name]};var Ve=function(t,e,r,i,o){void 0===e&&(e=[]),void 0===i&&(i=new Ft),void 0===o&&(o=[]),this.registry=t,this.path=e,this.key=e.map((function(t){return"["+t+"]"})).join(""),this.scope=i,this.errors=o,this.expectedType=r};function qe(t,e){for(var r,i=t.length-1,o=0,n=i,a=0;o<=n;)if((r=t[a=Math.floor((o+n)/2)])<=e){if(a===i||e<t[a+1])return a;o=a+1}else{if(!(r>e))throw new ue("Input is not a number.");n=a-1}return 0}Ve.prototype.parse=function(t,e,r,i,o){return void 0===o&&(o={}),e?this.concat(e,r,i)._parse(t,o):this._parse(t,o)},Ve.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new de(e,[t]):"coerce"===r?new ye(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var i=t[0];if("string"!=typeof i)return this.error("Expression name must be a string, but found "+typeof i+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var o=this.registry[i];if(o){var n=o.parse(t,this);if(!n)return null;if(this.expectedType){var a=this.expectedType,s=n.type;if("string"!==a.kind&&"number"!==a.kind&&"boolean"!==a.kind&&"object"!==a.kind&&"array"!==a.kind||"value"!==s.kind)if("color"!==a.kind&&"formatted"!==a.kind&&"resolvedImage"!==a.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(a,s))return null}else n=r(n,a,e.typeAnnotation||"coerce");else n=r(n,a,e.typeAnnotation||"assert")}if(!(n instanceof ce)&&"resolvedImage"!==n.type.kind&&function t(e){if(e instanceof Ue)return t(e.boundExpression);if(e instanceof xe&&"error"===e.name)return!1;if(e instanceof be)return!1;if(e instanceof Fe)return!1;var r=e instanceof ye||e instanceof de,i=!0;return e.eachChild((function(e){i=r?i&&t(e):i&&e instanceof ce})),!!i&&Be(e)&&Ne(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(n)){var l=new ve;try{n=new ce(n.type,n.evaluate(l))}catch(t){return this.error(t.message),null}}return n}return this.error('Unknown expression "'+i+'". If you wanted a literal array, use ["literal", [...]].',0)}return this.error(void 0===t?"'undefined' value invalid. Use null instead.":"object"==typeof t?'Bare objects invalid. Use ["literal", {...}] instead.':"Expected an array, but found "+typeof t+" instead.")},Ve.prototype.concat=function(t,e,r){var i="number"==typeof t?this.path.concat(t):this.path,o=r?this.scope.concat(r):this.scope;return new Ve(this.registry,i,e||null,o,this.errors)},Ve.prototype.error=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];var i=""+this.key+e.map((function(t){return"["+t+"]"})).join("");this.errors.push(new Ot(i,t))},Ve.prototype.checkSubtype=function(t,e){var r=Kt(t,e);return r&&this.error(r),r};var $e=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var i=0,o=r;i<o.length;i+=1){var n=o[i],a=n[1];this.labels.push(n[0]),this.outputs.push(a)}};function He(t,e,r){return t*(1-r)+e*r}$e.parse=function(t,e){if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");var r=e.parse(t[1],1,jt);if(!r)return null;var i=[],o=null;e.expectedType&&"value"!==e.expectedType.kind&&(o=e.expectedType);for(var n=1;n<t.length;n+=2){var a=1===n?-1/0:t[n],s=t[n+1],l=n,p=n+1;if("number"!=typeof a)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not c
1omputed expressions) for the input values.',l);if(i.length&&i[i.length-1][0]>=a)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var c=e.parse(s,p,o);if(!c)return null;o=o||c.type,i.push([a,c])}return new $e(o,r,i)},$e.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var i=this.input.evaluate(t);if(i<=e[0])return r[0].evaluate(t);var o=e.length;return i>=e[o-1]?r[o-1].evaluate(t):r[qe(e,i)].evaluate(t)},$e.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1)t(r[e])},$e.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},$e.prototype.serialize=function(){for(var t=["step",this.input.serialize()],e=0;e<this.labels.length;e++)e>0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var Ze=Object.freeze({__proto__:null,number:He,color:function(t,e,r){return new ee(He(t.r,e.r,r),He(t.g,e.g,r),He(t.b,e.b,r),He(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,i){return He(t,e[i],r)}))}}),Ge=6/29*3*(6/29),Qe=Math.PI/180,Xe=180/Math.PI;function We(t){return t>.008856451679035631?Math.pow(t,1/3):t/Ge+4/29}function Ke(t){return t>6/29?t*t*t:Ge*(t-4/29)}
vendor: 189,606 bytes, line 1
1function Je(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Ye(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function tr(t){var e=Ye(t.r),r=Ye(t.g),i=Ye(t.b),o=We((.4124564*e+.3575761*r+.1804375*i)/.95047),n=We((.2126729*e+.7151522*r+.072175*i)/1);return{l:116*n-16,a:500*(o-n),b:200*(n-We((.0193339*e+.119192*r+.9503041*i)/1.08883)),alpha:t.a}}function er(t){var e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,i=isNaN(t.b)?e:e-t.b/200;return e=1*Ke(e),r=.95047*Ke(r),i=1.08883*Ke(i),new ee(Je(3.2404542*r-1.5371385*e-.4985314*i),Je(-.969266*r+1.8760108*e+.041556*i),Je(.0556434*r-.2040259*e+1.0572252*i),t.alpha)}function rr(t,e,r){var i=e-t;return t+r*(i>180||i<-180?i-360*Math.round(i/360):i)}var ir={forward:tr,reverse:er,interpolate:function(t,e,r){return{l:He(t.l,e.l,r),a:He(t.a,e.a,r),b:He(t.b,e.b,r),alpha:He(t.alpha,e.alpha,r)}}},or={forward:function(t){var e=tr(t),r=e.l,i=e.a,o=e.b,n=Math.atan2(o,i)*Xe;return{h:n<0?n+360:n,c:Math.sqrt(i*i+o*o),l:r,alpha:t.a}},reverse:function(t){var e=t.h*Qe,r=t.c;return er({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:rr(t.h,e.h,r),c:He(t.c,e.c,r),l:He(t.l,e.l,r),alpha:He(t.alpha,e.alpha,r)}}},nr=Object.freeze({__proto__:null,lab:ir,hcl:or}),ar=function(t,e,r,i,o){this.type=t,this.operator=e,this.interpolation=r,this.input=i,this.labels=[],this.outputs=[];for(var n=0,a=o;n<a.length;n+=1){var s=a[n],l=s[1];this.labels.push(s[0]),this.outputs.push(l)}};function sr(t,e,r,i){var o=i-r,n=t-r;return 0===o?0:1===e?n/o:(Math.pow(e,n)-1)/(Math.pow(e,o)-1)}ar.interpolationFactor=function(t,e,i,o){var n=0;if("exponential"===t.name)n=sr(e,t.base,i,o);else if("linear"===t.name)n=sr(e,1,i,o);else if("cubic-bezier"===t.name){var a=t.controlPoints;n=new r(a[0],a[1],a[2],a[3]).solve(sr(e,1,i,o))}return n},ar.parse=function(t,e){var r=t[0],i=t[1],o=t[2],n=t.slice(3);if(!Array.isArray(i)||0===i.length)return e.error("Expected an interpolation type expression.",1);if("linear"===i[0])i={name:"linear"};else if("exponential"===i[0]){var a=i[1];if("number"!=typeof a)return e.error("Exponential interpolation requires a numeric base.",1,1);i={name:"exponential",base:a}}else{if("cubic-bezier"!==i[0])return e.error("Unknown interpolation type "+String(i[0]),1,0);var s=i.slice(1);if(4!==s.length||s.some((function(t){return"number"!=typeof t||t<0||t>1})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);i={name:"cubic-bezier",controlPoints:s}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(o=e.parse(o,2,jt)))return null;var l=[],p=null;"interpolate-hcl"===r||"interpolate-lab"===r?p=Vt:e.expectedType&&"value"!==e.expectedType.kind&&(p=e.expectedType);for(var c=0;c<n.length;c+=2){var u=n[c],h=n[c+1],d=c+3,f=c+4;if("number"!=typeof u)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',d);if(l.length&&l[l.length-1][0]>=u)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',d);var m=e.parse(h,f,p);if(!m)return null;p=p||m.type,l.push([u,m])}return"number"===p.kind||"color"===p.kind||"array"===p.kind&&"number"===p.itemType.kind&&"number"==typeof p.N?new ar(p,r,i,o,l):e.error("Type "+Xt(p)+" is not interpolatable.")},ar.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var i=this.input.evaluate(t);if(i<=e[0])return r[0].evaluate(t);var o=e.length;if(i>=e[o-1])return r[o-1].evaluate(t);var n=qe(e,i),a=ar.interpolationFactor(this.interpolation,i,e[n],e[n+1]),s=r[n].evaluate(t),l=r[n+1].evaluate(t);return"interpolate"===this.operator?Ze[this.type.kind.toLowerCase()](s,l,a):"interpolate-hcl"===this.operator?or.reverse(or.interpolate(or.forward(s),or.forward(l),a)):ir.reverse(ir.interpolate(ir.forward(s),ir.forward(l),a))},ar.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1)t(r[e])},ar.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},ar.prototype.serialize=function(){var t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var e=[this.operator,t,this.input.serialize()],r=0;r<this.labels.length;r++)e.push(this.labels[r],this.outputs[r].serialize());return e};var lr=function(t,e){this.type=t,this.args=e};lr.parse=function(t,e){if(t.length<2)return e.error("Expectected at least one argument.");var r=null,i=e.expectedType;i&&"value"!==i.kind&&(r=i);for(var o=[],n=0,a=t.slice(1);n<a.length;n+=1){var s=e.parse(a[n],1+o.length,r,void 0,{typeAnnotation:"omit"});if(!s)return null;r=r||s.type,o.push(s)}var l=i&&o.some((function(t){return Kt(i,t.type)}));return new lr(l?$t:r,o)},lr.prototype.evaluate=function(t){for(var e,r=null,i=0,o=0,n=this.args;o<n.length&&(i++,(r=n[o].evaluate(t))&&r instanceof ne&&!r.available&&(e||(e=r.name),r=null,i===this.args.length&&(r=e)),null===r);o+=1);return r},lr.prototype.eachChild=function(t){this.args.forEach(t)},lr.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},lr.prototype.serialize=function(){var t=["coalesce"];return this.eachChild((function(e){t.push(e.serialize())})),t};var pr=function(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e};pr.prototype.evaluate=function(t){return this.result.evaluate(t)},pr.prototype.eachChild=function(t){for(var e=0,r=this.bindings;e<r.length;e+=1)t(r[e][1]);t(this.result)},pr.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found "+(t.length-1)+" instead.");for(var r=[],i=1;i<t.length-1;i+=2){var o=t[i];if("string"!=typeof o)return e.error("Expected string, but found "+typeof o+" instead.",i);if(/[^a-zA-Z0-9_]/.test(o))return e.error("Variable names must contain only alphanumeric characters or '_'.",i);var n=e.parse(t[i+1],i+1);if(!n)return null;r.push([o,n])}var a=e.parse(t[t.length-1],t.length-1,e.expectedType,r);return a?new pr(r,a):null},pr.prototype.outputDefined=function(){return this.result.outputDefined()},pr.prototype.serialize=function(){for(var t=["let"],e=0,r=this.bindings;e<r.length;e+=1){var i=r[e];t.push(i[0],i[1].serialize())}return t.push(this.result.serialize()),t};var cr=function(t,e,r){this.type=t,this.index=e,this.input=r};cr.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,jt),i=e.parse(t[2],2,Qt(e.expectedType||$t));return r&&i?new cr(i.type.itemType,r,i):null},cr.prototype.evaluate=function(t){var e=this.index.evaluate(t),r=this.input.evaluate(t);if(e<0)throw new ue("Array index out of bounds: "+e+" < 0.");if(e>=r.length)throw new ue("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new ue("Array index must be an integer, but found "+e+" instead.");return r[e]},cr.prototype.eachChild=function(t){t(this.index),t(this.input)},cr.prototype.outputDefined=function(){return!1},cr.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var ur=function(t,e){this.type=Ut,this.needle=t,this.haystack=e};ur.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,$t),i=e.parse(t[2],2,$t);return r&&i?Jt(r.type,[Ut,Nt,jt,Bt,$t])?new ur(r,i):e.error("Expected first argument to be of type boolean, string, number or null, but found "+Xt(r.type)+" instead"):null},ur.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!r)return!1;if(!Yt(e,["boolean","string","number","null"]))throw new ue("Expected first argument to be of type boolean, string, number or null, but found "+Xt(le(e))+" instead.");if(!Yt(r,["string","array"]))throw new ue("Expected second argument to be of type array or string, but found "+Xt(le(r))+" instead.");return r.indexOf(e)>=0},ur.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},ur.prototype.outputDefined=function(){return!0},ur.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var hr=function(t,e,r){this.type=jt,this.needle=t,this.haystack=e,this.fromIndex=r};hr.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,$t),i=e.parse(t[2],2,$t);if(!r||!i)return null;if(!Jt(r.type,[Ut,Nt,jt,Bt,$t]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+Xt(r.type)+" instead");if(4===t.length){var o=e.parse(t[3],3,jt);return o?new hr(r,i,o):null}return new hr(r,i)},hr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!Yt(e,["boolean","string","number","null"]))throw new ue("Expected first argument to be of type boolean, string, number or null, but found "+Xt(le(e))+" instead.");if(!Yt(r,["string","array"]))throw new ue("Expected second argument to be of type array or string, but found "+Xt(le(r))+" instead.");if(this.fromIndex){var i=this.fromIndex.evaluate(t);return r.indexOf(e,i)}return r.indexOf(e)},hr.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},hr.prototype.outputDefined=function(){return!1},hr.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var dr=function(t,e,r,i,o,n){this.inputType=t,this.type=e,this.input=r,this.cases=i,this.outputs=o,this.otherwise=n};dr.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var r,i;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);for(var o={},n=[],a=2;a<t.length-1;a+=2){var s=t[a],l=t[a+1];Array.isArray(s)||(s=[s]);var p=e.concat(a);if(0===s.length)return p.error("Expected at least one branch label.");for(var c=0,u=s;c<u.length;c+=1){var h=u[c];if("number"!=typeof h&&"string"!=typeof h)return p.error("Branch labels must be numbers or strings.");if("number"==typeof h&&Math.abs(h)>Number.MAX_SAFE_INTEGER)return p.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof h&&Math.floor(h)!==h)return p.error("Numeric branch labels must be integer values.");if(r){if(p.checkSubtype(r,le(h)))return null}else r=le(h);if(void 0!==o[String(h)])return p.error("Branch labels must be unique.");o[String(h)]=n.length}var d=e.parse(l,a,i);if(!d)return null;i=i||d.type,n.push(d)}var f=e.parse(t[1],1,$t);if(!f)return null;var m=e.parse(t[t.length-1],t.length-1,i);return m?"value"!==f.type.kind&&e.concat(1).checkSubtype(r,f.type)?null:new dr(r,i,f,o,n,m):null},dr.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(le(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},dr.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},dr.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},dr.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],i={},o=0,n=Object.keys(this.cases).sort();o<n.length;o+=1){var a=n[o];void 0===(u=i[this.cases[a]])?(i[this.cases[a]]=r.length,r.push([this.cases[a],[a]])):r[u][1].push(a)}for(var s=function(e){return"number"===t.inputType.kind?Number(e):e},l=0,p=r;l<p.length;l+=1){var c=p[l],u=c[0],h=c[1];e.push(1===h.length?s(h[0]):h.map(s)),e.push(this.outputs[outputIndex$1].serialize())}return e.push(this.otherwise.serialize()),e};var fr=function(t,e,r){this.type=t,this.branches=e,this.otherwise=r};fr.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found only "+(t.length-1)+".");if(t.length%2!=0)return e.error("Expected an odd number of arguments.");var r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(var i=[],o=1;o<t.length-1;o+=2){var n=e.parse(t[o],o,Ut);if(!n)return null;var a=e.parse(t[o+1],o+1,r);if(!a)return null;i.push([n,a]),r=r||a.type}var s=e.parse(t[t.length-1],t.length-1,r);return s?new fr(r,i,s):null},fr.prototype.evaluate=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var i=r[e],o=i[1];if(i[0].evaluate(t))return o.evaluate(t)}return this.otherwise.evaluate(t)},fr.prototype.eachChild=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var i=r[e],o=i[1];t(i[0]),t(o)}t(this.otherwise)},fr.prototype.outputDefined=function(){return this.branches.every((function(t){return t[1].outputDefined()}))&&this.otherwise.outputDefined()},fr.prototype.serialize=function(){var t=["case"];return this.eachChild((function(e){t.push(e.serialize())})),t};var mr=function(t,e,r,i){this.type=t,this.input=e,this.beginIndex=r,this.endIndex=i};function _r(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function yr(t,e,r,i){return 0===i.compare(e,r)}function gr(t,e,r){var i="=="!==t&&"!="!==t;return function(){function o(t,e,r){this.type=Ut,this.lhs=t,this.rhs=e,this.collator=r,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}return o.parse=function(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");var r=t[0],n=e.parse(t[1],1,$t);if(!n)return null;if(!_r(r,n.type))return e.concat(1).error('"'+r+"\" comparisons are not supported for type '"+Xt(n.type)+"'.");var a=e.parse(t[2],2,$t);if(!a)return null;if(!_r(r,a.type))return e.concat(2).error('"'+r+"\" comparisons are not supported for type '"+Xt(a.type)+"'.");if(n.type.kind!==a.type.kind&&"value"!==n.type.kind&&"value"!==a.type.kind)return e.error("Cannot compare types '"+Xt(n.type)+"' and '"+Xt(a.type)+"'.");i&&("value"===n.type.kind&&"value"!==a.type.kind?n=new de(a.type,[n]):"value"!==n.type.kind&&"value"===a.type.kind&&(a=new de(n.type,[a])));var s=null;if(4===t.length){if("string"!==n.type.kind&&"string"!==a.type.kind&&"value"!==n.type.kind&&"value"!==a.type.kind)return e.error("Cannot use collator to compare non-string types.");if(!(s=e.parse(t[3],3,Ht)))return null}return new o(n,a,s)},o.prototype.evaluate=function(o){var n=this.lhs.evaluate(o),a=this.rhs.evaluate(o);if(i&&this.hasUntypedArgument){var s=le(n),l=le(a);if(s.kind!==l.kind||"string"!==s.kind&&"number"!==s.kind)throw new ue('Expected arguments for "'+t+'" to be (string, string) or (number, number), but found ('+s.kind+", "+l.kind+") instead.")}if(this.collator&&!i&&this.hasUntypedArgument){var p=le(n),c=le(a);if("string"!==p.kind||"string"!==c.kind)return e(o,n,a)}return this.collator?r(o,n,a,this.collator.evaluate(o)):e(o,n,a)},o.prototype.eachChild=function(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)},o.prototype.outputDefined=function(){return!0},o.prototype.serialize=function(){var e=[t];return this.eachChild((function(t){e.push(t.serialize())})),e},o}()}mr.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,$t),i=e.parse(t[2],2,jt);if(!r||!i)return null;if(!Jt(r.type,[Qt($t),Nt,$t]))return e.error("Expected first argument to be of type array or string, but found "+Xt(r.type)+" instead");if(4===t.length){var o=e.parse(t[3],3,jt);return o?new mr(r.type,r,i,o):null}return new mr(r.type,r,i)},mr.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(!Yt(e,["string","array"]))throw new ue("Expected first argument to be of type array or string, but found "+Xt(le(e))+" instead.");if(this.endIndex){var i=this.endIndex.evaluate(t);return e.slice(r,i)}return e.slice(r)},mr.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},mr.prototype.outputDefined=function(){return!1},mr.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var vr=gr("==",(function(t,e,r){return e===r}),yr),xr=gr("!=",(function(t,e,r){return e!==r}),(function(t,e,r,i){return!yr(0,e,r,i)})),br=gr("<",(function(t,e,r){return e<r}),(function(t,e,r,i){return i.compare(e,r)<0})),wr=gr(">",(function(t,e,r){return e>r}),(function(t,e,r,i){return i.compare(e,r)>0})),Cr=gr("<=",(function(t,e,r){return e<=r}),(function(t,e,r,i){return i.compare(e,r)<=0})),kr=gr(">=",(function(t,e,r){return e>=r}),(function(t,e,r,i){return i.compare(e,r)>=0})),Sr=function(t,e,r,i,o){this.type=Nt,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=i,this.maxFractionDigits=o};Sr.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,jt);if(!r)return null;var i=t[2];if("object"!=typeof i||Array.isArray(i))return e.error("NumberFormat options argument must be an object.");var o=null;if(i.locale&&!(o=e.parse(i.locale,1,Nt)))return null;var n=null;if(i.currency&&!(n=e.parse(i.currency,1,Nt)))return null;var a=null;if(i["min-fraction-digits"]&&!(a=e.parse(i["min-fraction-digits"],1,jt)))return null;var s=null;return i["max-fraction-digits"]&&!(s=e.parse(i["max-fraction-digits"],1,jt))?null:new Sr(r,o,n,a,s)},Sr.prototype.evaluate=function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))},Sr.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)},Sr.prototype.outputDefined=function(){return!1},Sr.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var Mr=function(t){this.type=jt,this.input=t};Mr.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?e.error("Expected argument of type string or array, but found "+Xt(r.type)+" instead."):new Mr(r):null},Mr.prototype.evaluate=function(t){var e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new ue("Expected value to be of type string or array, but found "+Xt(le(e))+" instead.")},Mr.prototype.eachChild=function(t){t(this.input)},Mr.prototype.outputDefined=function(){return!1},Mr.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Er={"==":vr,"!=":xr,">":wr,"<":br,">=":kr,"<=":Cr,array:de,at:cr,boolean:de,case:fr,coalesce:lr,collator:be,format:fe,image:me,in:ur,"index-of":hr,interpolate:ar,"interpolate-hcl":ar,"interpolate-lab":ar,length:Mr,let:pr,literal:ce,match:dr,number:de,"number-format":Sr,object:de,slice:mr,step:$e,string:de,"to-boolean":ye,"to-color":ye,"to-number":ye,"to-string":ye,var:Ue,within:Fe};function Tr(t,e){var r=e[0],i=e[1],o=e[2],n=e[3];r=r.evaluate(t),i=i.evaluate(t),o=o.evaluate(t);var a=n?n.evaluate(t):1,s=ae(r,i,o,a);if(s)throw new ue(s);return new ee(r/255*a,i/255*a,o/255*a,a)}function Ar(t,e){return t in e}function Ir(t,e){var r=e[t];return void 0===r?null:r}function Pr(t){return{type:t}}function Lr(t){return{result:"success",value:t}}function zr(t){return{result:"error",value:t}}function Rr(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Dr(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function Or(t){return!!t.expression&&t.expression.interpolated}function Fr(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function Br(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function jr(t){return t}function Nr(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function Ur(t,e,r,i,o){return Nr(typeof r===o?i[r]:void 0,t.default,e.default)}function Vr(t,e,r){if("number"!==Fr(r))return Nr(t.default,e.default);var i=t.stops.length;if(1===i)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];var o=qe(t.stops.map((function(t){return t[0]})),r);return t.stops[o][1]}function qr(t,e,r){var i=void 0!==t.base?t.base:1;if("number"!==Fr(r))return Nr(t.default,e.default);var o=t.stops.length;if(1===o)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[o-1][0])return t.stops[o-1][1];var n=qe(t.stops.map((function(t){return t[0]})),r),a=function(t,e,r,i){var o=i-r,n=t-r;return 0===o?0:1===e?n/o:(Math.pow(e,n)-1)/(Math.pow(e,o)-1)}(r,i,t.stops[n][0],t.stops[n+1][0]),s=t.stops[n][1],l=t.stops[n+1][1],p=Ze[e.type]||jr;if(t.colorSpace&&"rgb"!==t.colorSpace){var c=nr[t.colorSpace];p=function(t,e){return c.reverse(c.interpolate(c.forward(t),c.forward(e),a))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=s.evaluate.apply(void 0,t),i=l.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==i)return p(r,i,a)}}:p(s,l,a)}function $r(t,e,r){return"color"===e.type?r=ee.parse(r):"formatted"===e.type?r=oe.fromString(r.toString()):"resolvedImage"===e.type?r=ne.fromString(r.toString()):Fr(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),Nr(r,t.default,e.default)}xe.register(Er,{error:[{kind:"error"},[Nt],function(t,e){throw new ue(e[0].evaluate(t))}],typeof:[Nt,[$t],function(t,e){return Xt(le(e[0].evaluate(t)))}],"to-rgba":[Qt(jt,4),[Vt],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[Vt,[jt,jt,jt],Tr],rgba:[Vt,[jt,jt,jt,jt],Tr],has:{type:Ut,overloads:[[[Nt],function(t,e){return Ar(e[0].evaluate(t),t.properties())}],[[Nt,qt],function(t,e){var r=e[1];return Ar(e[0].evaluate(t),r.evaluate(t))}]]},get:{type:$t,overloads:[[[Nt],function(t,e){return Ir(e[0].evaluate(t),t.properties())}],[[Nt,qt],function(t,e){var r=e[1];return Ir(e[0].evaluate(t),r.evaluate(t))}]]},"feature-state":[$t,[Nt],function(t,e){return Ir(e[0].evaluate(t),t.featureState||{})}],properties:[qt,[],function(t){return t.properties()}],"geometry-type":[Nt,[],function(t){return t.geometryType()}],id:[$t,[],function(t){return t.id()}],zoom:[jt,[],function(t){return t.globals.zoom}],"heatmap-density":[jt,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[jt,[],function(t){return t.globals.lineProgress||0}],accumulated:[$t,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[jt,Pr(jt),function(t,e){for(var r=0,i=0,o=e;i<o.length;i+=1)r+=o[i].evaluate(t);return r}],"*":[jt,Pr(jt),function(t,e){for(var r=1,i=0,o=e;i<o.length;i+=1)r*=o[i].evaluate(t);return r}],"-":{type:jt,overloads:[[[jt,jt],function(t,e){var r=e[1];return e[0].evaluate(t)-r.evaluate(t)}],[[jt],function(t,e){return-e[0].evaluate(t)}]]},"/":[jt,[jt,jt],function(t,e){var r=e[1];return e[0].evaluate(t)/r.evaluate(t)}],"%":[jt,[jt,jt],function(t,e){var r=e[1];return e[0].evaluate(t)%r.evaluate(t)}],ln2:[jt,[],function(){return Math.LN2}],pi:[jt,[],function(){return Math.PI}],e:[jt,[],function(){return Math.E}],"^":[jt,[jt,jt],function(t,e){var r=e[1];return Math.pow(e[0].evaluate(t),r.evaluate(t))}],sqrt:[jt,[jt],function(t,e){return Math.sqrt(e[0].evaluate(t))}],log10:[jt,[jt],function(t,e){return Math.log(e[0].evaluate(t))/Math.LN10}],ln:[jt,[jt],function(t,e){return Math.log(e[0].evaluate(t))}],log2:[jt,[jt],function(t,e){return Math.log(e[0].evaluate(t))/Math.LN2}],sin:[jt,[jt],function(t,e){return Math.sin(e[0].evaluate(t))}],cos:[jt,[jt],function(t,e){return Math.cos(e[0].evaluate(t))}],tan:[jt,[jt],function(t,e){return Math.tan(e[0].evaluate(t))}],asin:[jt,[jt],function(t,e){return Math.asin(e[0].evaluate(t))}],acos:[jt,[jt],function(t,e){return Math.acos(e[0].evaluate(t))}],atan:[jt,[jt],function(t,e){return Math.atan(e[0].evaluate(t))}],min:[jt,Pr(jt),function(t,e){return Math.min.apply(Math,e.map((function(e){return e.evaluate(t)})))}],max:[jt,Pr(jt),function(t,e){return Math.max.apply(Math,e.map((function(e){return e.evaluate(t)})))}],abs:[jt,[jt],function(t,e){return Math.abs(e[0].evaluate(t))}],round:[jt,[jt],function(t,e){var r=e[0].evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[jt,[jt],function(t,e){return Math.floor(e[0].evaluate(t))}],ceil:[jt,[jt],function(t,e){return Math.ceil(e[0].evaluate(t))}],"filter-==":[Ut,[Nt,$t],function(t,e){var r=e[0],i=e[1];return t.properties()[r.value]===i.value}],"filter-id-==":[Ut,[$t],function(t,e){var r=e[0];return t.id()===r.value}],"filter-type-==":[Ut,[Nt],function(t,e){var r=e[0];return t.geometryType()===r.value}],"filter-<":[Ut,[Nt,$t],function(t,e){var r=e[0],i=e[1],o=t.properties()[r.value],n=i.value;return typeof o==typeof n&&o<n}],"filter-id-<":[Ut,[$t],function(t,e){var r=e[0],i=t.id(),o=r.value;return typeof i==typeof o&&i<o}],"filter->":[Ut,[Nt,$t],function(t,e){var r=e[0],i=e[1],o=t.properties()[r.value],n=i.value;return typeof o==typeof n&&o>n}],"filter-id->":[Ut,[$t],function(t,e){var r=e[0],i=t.id(),o=r.value;return typeof i==typeof o&&i>o}],"filter-<=":[Ut,[Nt,$t],function(t,e){var r=e[0],i=e[1],o=t.properties()[r.value],n=i.value;return typeof o==typeof n&&o<=n}],"filter-id-<=":[Ut,[$t],function(t,e){var r=e[0],i=t.id(),o=r.value;return typeof i==typeof o&&i<=o}],"filter->=":[Ut,[Nt,$t],function(t,e){var r=e[0],i=e[1],o=t.properties()[r.value],n=i.value;return typeof o==typeof n&&o>=n}],"filter-id->=":[Ut,[$t],function(t,e){var r=e[0],i=t.id(),o=r.value;return typeof i==typeof o&&i>=o}],"filter-has":[Ut,[$t],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[Ut,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[Ut,[Qt(Nt)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[Ut,[Qt($t)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[Ut,[Nt,Qt($t)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[Ut,[Nt,Qt($t)],function(t,e){var r=e[0],i=e[1];return function(t,e,r,i){for(;r<=i;){var o=r+i>>1;if(e[o]===t)return!0;e[o]>t?i=o-1:r=o+1}return!1}(t.properties()[r.value],i.value,0,i.value.length-1)}],all:{type:Ut,overloads:[[[Ut,Ut],function(t,e){var r=e[1];return e[0].evaluate(t)&&r.evaluate(t)}],[Pr(Ut),function(t,e){for(var r=0,i=e;r<i.length;r+=1)if(!i[r].evaluate(t))return!1;return!0}]]},any:{type:Ut,overloads:[[[Ut,Ut],function(t,e){var r=e[1];return e[0].evaluate(t)||r.evaluate(t)}],[Pr(Ut),function(t,e){for(var r=0,i=e;r<i.length;r+=1)if(i[r].evaluate(t))return!0;return!1}]]},"!":[Ut,[Ut],function(t,e){return!e[0].evaluate(t)}],"is-supported-script":[Ut,[Nt],function(t,e){var r=t.globals&&t.globals.isSupportedScript;return!r||r(e[0].evaluate(t))}],upcase:[Nt,[Nt],function(t,e){return e[0].evaluate(t).toUpperCase()}],downcase:[Nt,[Nt],function(t,e){return e[0].evaluate(t).toLowerCase()}],concat:[Nt,Pr($t),function(t,e){return e.map((function(e){return pe(e.evaluate(t))})).join("")}],"resolved-locale":[Nt,[Ht],function(t,e){return e[0].evaluate(t).resolvedLocale()}]});var Hr=function(t,e){this.expression=t,this._warningHistory={},this._evaluator=new ve,this._defaultValue=e?function(t){return"color"===t.type&&Br(t.default)?new ee(0,0,0,0):"color"===t.type?ee.parse(t.default)||null:void 0===t.default?null:t.default}(e):null,this._enumValues=e&&"enum"===e.type?e.values:null};function Zr(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in Er}function Gr(t,e){var r=new Ve(Er,[],e?function(t){var e={color:Vt,string:Nt,number:jt,enum:Nt,boolean:Ut,formatted:Zt,resolvedImage:Gt};return"array"===t.type?Qt(e[t.value]||$t,t.length):e[t.type]}(e):void 0),i=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return i?Lr(new Hr(i,e)):zr(r.errors)}Hr.prototype.evaluateWithoutErrorHandling=function(t,e,r,i,o,n){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=i,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=n,this.expression.evaluate(this._evaluator)},Hr.prototype.evaluate=function(t,e,r,i,o,n){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=i,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=n||null;try{var a=this.expression.evaluate(this._evaluator);if(null==a||"number"==typeof a&&a!=a)return this._defaultValue;if(this._enumValues&&!(a in this._enumValues))throw new ue("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(a)+" instead.");return a}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var Qr=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!je(e.expression)};Qr.prototype.evaluateWithoutErrorHandling=function(t,e,r,i,o,n){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,i,o,n)},Qr.prototype.evaluate=function(t,e,r,i,o,n){return this._styleExpression.evaluate(t,e,r,i,o,n)};var Xr=function(t,e,r,i){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!je(e.expression),this.interpolationType=i};function Wr(t,e){if("error"===(t=Gr(t,e)).result)return t;var r=t.value.expression,i=Be(r);if(!i&&!Rr(e))return zr([new Ot("","data expressions not supported")]);var o=Ne(r,["zoom"]);if(!o&&!Dr(e))return zr([new Ot("","zoom expressions not supported")]);var n=function t(e){var r=null;if(e instanceof pr)r=t(e.result);else if(e instanceof lr)for(var i=0,o=e.args;i<o.length&&!(r=t(o[i]));i+=1);else(e instanceof $e||e instanceof ar)&&e.input instanceof xe&&"zoom"===e.input.name&&(r=e);return r instanceof Ot||e.eachChild((function(e){var i=t(e);i instanceof Ot?r=i:!r&&i?r=new Ot("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):r&&i&&r!==i&&(r=new Ot("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),r}(r);return n||o?n instanceof Ot?zr([n]):n instanceof ar&&!Or(e)?zr([new Ot("",'"interpolate" expressions cannot be used with this property')]):Lr(n?new Xr(i?"camera":"composite",t.value,n.labels,n instanceof ar?n.interpolation:void 0):new Qr(i?"constant":"source",t.value)):zr([new Ot("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}Xr.prototype.evaluateWithoutErrorHandling=function(t,e,r,i,o,n){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,i,o,n)},Xr.prototype.evaluate=function(t,e,r,i,o,n){return this._styleExpression.evaluate(t,e,r,i,o,n)},Xr.prototype.interpolationFactor=function(t,e,r){return this.interpolationType?ar.interpolationFactor(this.interpolationType,t,e,r):0};var Kr=function(t,e){this._parameters=t,this._specification=e,zt(this,function t(e,r){var i,o,n,a="color"===r.type,s=e.stops&&"object"==typeof e.stops[0][0],l=s||!(s||void 0!==e.property),p=e.type||(Or(r)?"exponential":"interval");if(a&&((e=zt({},e)).stops&&(e.stops=e.stops.map((function(t){return[t[0],ee.parse(t[1])]}))),e.default=ee.parse(e.default?e.default:r.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!nr[e.colorSpace])throw new Error("Unknown color space: "+e.colorSpace);if("exponential"===p)i=qr;else if("interval"===p)i=Vr;else if("categorical"===p){i=Ur,o=Object.create(null);for(var c=0,u=e.stops;c<u.length;c+=1){var h=u[c];o[h[0]]=h[1]}n=typeof e.stops[0][0]}else{if("identity"!==p)throw new Error('Unknown function type "'+p+'"');i=$r}if(s){for(var d={},f=[],m=0;m<e.stops.length;m++){var _=e.stops[m],y=_[0].zoom;void 0===d[y]&&(d[y]={zoom:y,type:e.type,property:e.property,default:e.default,stops:[]},f.push(y)),d[y].stops.push([_[0].value,_[1]])}for(var g=[],v=0,x=f;v<x.length;v+=1){var b=x[v];g.push([d[b].zoom,t(d[b],r)])}var w={name:"linear"};return{kind:"composite",interpolationType:w,interpolationFactor:ar.interpolationFactor.bind(void 0,w),zoomStops:g.map((function(t){return t[0]})),evaluate:function(t,i){var o=t.zoom;return qr({stops:g,base:e.base},r,o).evaluate(o,i)}}}if(l){var C="exponential"===p?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:C,interpolationFactor:ar.interpolationFactor.bind(void 0,C),zoomStops:e.stops.map((function(t){return t[0]})),evaluate:function(t){return i(e,r,t.zoom,o,n)}}}return{kind:"source",evaluate:function(t,a){var s=a&&a.properties?a.properties[e.property]:void 0;return void 0===s?Nr(e.default,r.default):i(e,r,s,o,n)}}}(this._parameters,this._specification))};function Jr(t){var e=t.key,r=t.value,i=t.valueSpec||{},o=t.objectElementValidators||{},n=t.style,a=t.styleSpec,s=[],l=Fr(r);if("object"!==l)return[new Pt(e,r,"object expected, "+l+" found")];for(var p in r){var c=p.split(".")[0],u=i[c]||i["*"],h=void 0;if(o[c])h=o[c];else if(i[c])h=Ci;else if(o["*"])h=o["*"];else{if(!i["*"]){s.push(new Pt(e,r[p],'unknown property "'+p+'"'));continue}h=Ci}s=s.concat(h({key:(e?e+".":e)+p,value:r[p],valueSpec:u,style:n,styleSpec:a,object:r,objectKey:p},r))}for(var d in i)o[d]||i[d].required&&void 0===i[d].default&&void 0===r[d]&&s.push(new Pt(e,r,'missing required property "'+d+'"'));return s}function Yr(t){var e=t.value,r=t.valueSpec,i=t.style,o=t.styleSpec,n=t.key,a=t.arrayElementValidator||Ci;if("array"!==Fr(e))return[new Pt(n,e,"array expected, "+Fr(e)+" found")];if(r.length&&e.length!==r.length)return[new Pt(n,e,"array length "+r.length+" expected, length "+e.length+" found")];if(r["min-length"]&&e.length<r["min-length"])return[new Pt(n,e,"array length at least "+r["min-length"]+" expected, length "+e.length+" found")];var s={type:r.value,values:r.values};o.$version<7&&(s.function=r.function),"object"===Fr(r.value)&&(s=r.value);for(var l=[],p=0;p<e.length;p++)l=l.concat(a({array:e,arrayIndex:p,value:e[p],valueSpec:s,style:i,styleSpec:o,key:n+"["+p+"]"}));return l}function ti(t){var e=t.key,r=t.value,i=t.valueSpec,o=Fr(r);return"number"===o&&r!=r&&(o="NaN"),"number"!==o?[new Pt(e,r,"number expected, "+o+" found")]:"minimum"in i&&r<i.minimum?[new Pt(e,r,r+" is less than the minimum value "+i.minimum)]:"maximum"in i&&r>i.maximum?[new Pt(e,r,r+" is greater than the maximum value "+i.maximum)]:[]}function ei(t){var e,r,i,o=t.valueSpec,n=Rt(t.value.type),a={},s="categorical"!==n&&void 0===t.value.property,l=!s,p="array"===Fr(t.value.stops)&&"array"===Fr(t.value.stops[0])&&"object"===Fr(t.value.stops[0][0]),c=Jr({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===n)return[new Pt(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;return e=e.concat(Yr({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:u})),"array"===Fr(r)&&0===r.length&&e.push(new Pt(t.key,r,"array must have at least one stop")),e},default:function(t){return Ci({key:t.key,value:t.value,valueSpec:o,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===n&&s&&c.push(new Pt(t.key,t.value,'missing required property "property"')),"identity"===n||t.value.stops||c.push(new Pt(t.key,t.value,'missing required property "stops"')),"exponential"===n&&t.valueSpec.expression&&!Or(t.valueSpec)&&c.push(new Pt(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!Rr(t.valueSpec)?c.push(new Pt(t.key,t.value,"property functions not supported")):s&&!Dr(t.valueSpec)&&c.push(new Pt(t.key,t.value,"zoom functions not supported"))),"categorical"!==n&&!p||void 0!==t.value.property||c.push(new Pt(t.key,t.value,'"property" property is required')),c;function u(t){var e=[],n=t.value,s=t.key;if("array"!==Fr(n))return[new Pt(s,n,"array expected, "+Fr(n)+" found")];if(2!==n.length)return[new Pt(s,n,"array length 2 expected, length "+n.length+" found")];if(p){if("object"!==Fr(n[0]))return[new Pt(s,n,"object expected, "+Fr(n[0])+" found")];if(void 0===n[0].zoom)return[new Pt(s,n,"object stop key must have zoom")];if(void 0===n[0].value)return[new Pt(s,n,"object stop key must have value")];if(i&&i>Rt(n[0].zoom))return[new Pt(s,n[0].zoom,"stop zoom values must appear in ascending order")];Rt(n[0].zoom)!==i&&(i=Rt(n[0].zoom),r=void 0,a={}),e=e.concat(Jr({key:s+"[0]",value:n[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:ti,value:h}}))}else e=e.concat(h({key:s+"[0]",value:n[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},n));return Zr(Dt(n[1]))?e.concat([new Pt(s+"[1]",n[1],"expressions are not allowed in function stops.")]):e.concat(Ci({key:s+"[1]",value:n[1],valueSpec:o,style:t.style,styleSpec:t.styleSpec}))}function h(t,i){var s=Fr(t.value),l=Rt(t.value),p=null!==t.value?t.value:i;if(e){if(s!==e)return[new Pt(t.key,p,s+" stop domain type must match previous stop domain type "+e)]}else e=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new Pt(t.key,p,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==n){var c="number expected, "+s+" found";return Rr(o)&&void 0===n&&(c+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Pt(t.key,p,c)]}return"categorical"!==n||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==n&&"number"===s&&void 0!==r&&l<r?[new Pt(t.key,p,"stop domain values must appear in ascending order")]:(r=l,"categorical"===n&&l in a?[new Pt(t.key,p,"stop domain values must be unique")]:(a[l]=!0,[])):[new Pt(t.key,p,"integer expected, found "+l)]}}function ri(t){var e=("property"===t.expressionContext?Wr:Gr)(Dt(t.value),t.valueSpec);if("error"===e.result)return e.value.map((function(e){return new Pt(""+t.key+e.key,t.value,e.message)}));var r=e.value.expression||e.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&!r.outputDefined())return[new Pt(t.key,t.value,'Invalid data expression for "'+t.propertyKey+'". Output values must be contained as literals within the expression.')];if("property"===t.expressionContext&&"layout"===t.propertyType&&!je(r))return[new Pt(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext&&!je(r))return[new Pt(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!Ne(r,["zoom","feature-state"]))return[new Pt(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!Be(r))return[new Pt(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function ii(t){var e=t.key,r=t.value,i=t.valueSpec,o=[];return Array.isArray(i.values)?-1===i.values.indexOf(Rt(r))&&o.push(new Pt(e,r,"expected one of ["+i.values.join(", ")+"], "+JSON.stringify(r)+" found")):-1===Object.keys(i.values).indexOf(Rt(r))&&o.push(new Pt(e,r,"expected one of ["+Object.keys(i.values).join(", ")+"], "+JSON.stringify(r)+" found")),o}function oi(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var e=0,r=t.slice(1);e<r.length;e+=1){var i=r[e];if(!oi(i)&&"boolean"!=typeof i)return!1}return!0;default:return!0}}Kr.deserialize=function(t){return new Kr(t._parameters,t._specification)},Kr.serialize=function(t){return{_parameters:t._parameters,_specification:t._specification}};var ni={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function ai(t){if(null==t)return{filter:function(){return!0},needGeometry:!1};oi(t)||(t=li(t));var e=Gr(t,ni);if("error"===e.result)throw new Error(e.value.map((function(t){return t.key+": "+t.message})).join(", "));return{filter:function(t,r,i){return e.value.evaluate(t,r,{},i)},needGeometry:function t(e){if(!Array.isArray(e))return!1;if("within"===e[0])return!0;for(var r=1;r<e.length;r++)if(t(e[r]))return!0;return!1}(t)}}function si(t,e){return t<e?-1:t>e?1:0}function li(t){if(!t)return!0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?pi(t[1],t[2],"=="):"!="===r?hi(pi(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?pi(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(li))):"all"===r?["all"].concat(t.slice(1).map(li)):"none"===r?["all"].concat(t.slice(1).map(li).map(hi)):"in"===r?ci(t[1],t.slice(2)):"!in"===r?hi(ci(t[1],t.slice(2))):"has"===r?ui(t[1]):"!has"===r?hi(ui(t[1])):"within"!==r||t}function pi(t,e,r){switch(t){case"$type":return["filter-type-"+r,e];case"$id":return["filter-id-"+r,e];default:return["filter-"+r,t,e]}}function ci(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((function(t){return typeof t!=typeof e[0]}))?["filter-in-large",t,["literal",e.sort(si)]]:["filter-in-small",t,["literal",e]]}}function ui(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function hi(t){return["!",t]}function di(t){return oi(Dt(t.value))?ri(zt({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var r=e.value,i=e.key;if("array"!==Fr(r))return[new Pt(i,r,"array expected, "+Fr(r)+" found")];var o,n=e.styleSpec,a=[];if(r.length<1)return[new Pt(i,r,"filter array must have at least 1 element")];switch(a=a.concat(ii({key:i+"[0]",value:r[0],valueSpec:n.filter_operator,style:e.style,styleSpec:e.styleSpec})),Rt(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===Rt(r[1])&&a.push(new Pt(i,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&a.push(new Pt(i,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":r.length>=2&&"string"!==(o=Fr(r[1]))&&a.push(new Pt(i+"[1]",r[1],"string expected, "+o+" found"));for(var s=2;s<r.length;s++)o=Fr(r[s]),"$type"===Rt(r[1])?a=a.concat(ii({key:i+"["+s+"]",value:r[s],valueSpec:n.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"!==o&&"number"!==o&&"boolean"!==o&&a.push(new Pt(i+"["+s+"]",r[s],"string, number, or boolean expected, "+o+" found"));break;case"any":case"all":case"none":for(var l=1;l<r.length;l++)a=a.concat(t({key:i+"["+l+"]",value:r[l],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":o=Fr(r[1]),2!==r.length?a.push(new Pt(i,r,'filter array for "'+r[0]+'" operator must have 2 elements')):"string"!==o&&a.push(new Pt(i+"[1]",r[1],"string expected, "+o+" found"));break;case"within":o=Fr(r[1]),2!==r.length?a.push(new Pt(i,r,'filter array for "'+r[0]+'" operator must have 2 elements')):"object"!==o&&a.push(new Pt(i+"[1]",r[1],"object expected, "+o+" found"))}return a}(t)}function fi(t,e){var r=t.key,i=t.style,o=t.styleSpec,n=t.value,a=t.objectKey,s=o[e+"_"+t.layerType];if(!s)return[];var l=a.match(/^(.*)-transition$/);if("paint"===e&&l&&s[l[1]]&&s[l[1]].transition)return Ci({key:r,value:n,valueSpec:o.transition,style:i,styleSpec:o});var p,c=t.valueSpec||s[a];if(!c)return[new Pt(r,n,'unknown property "'+a+'"')];if("string"===Fr(n)&&Rr(c)&&!c.tokens&&(p=/^{([^}]+)}$/.exec(n)))return[new Pt(r,n,'"'+a+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(p[1])+" }`.")];var u=[];return"symbol"===t.layerType&&("text-field"===a&&i&&!i.glyphs&&u.push(new Pt(r,n,'use of "text-field" requires a style "glyphs" property')),"text-font"===a&&Br(Dt(n))&&"identity"===Rt(n.type)&&u.push(new Pt(r,n,'"text-font" does not support identity functions'))),u.concat(Ci({key:t.key,value:n,valueSpec:c,style:i,styleSpec:o,expressionContext:"property",propertyType:e,propertyKey:a}))}function mi(t){return fi(t,"paint")}function _i(t){return fi(t,"layout")}function yi(t){var e=[],r=t.value,i=t.key,o=t.style,n=t.styleSpec;r.type||r.ref||e.push(new Pt(i,r,'either "type" or "ref" is required'));var a,s=Rt(r.type),l=Rt(r.ref);if(r.id)for(var p=Rt(r.id),c=0;c<t.arrayIndex;c++){var u=o.layers[c];Rt(u.id)===p&&e.push(new Pt(i,r.id,'duplicate layer id "'+r.id+'", previously used at line '+u.id.__line__))}if("ref"in r)["type","source","source-layer","filter","layout"].forEach((function(t){t in r&&e.push(new Pt(i,r[t],'"'+t+'" is prohibited for ref layers'))})),o.layers.forEach((function(t){Rt(t.id)===l&&(a=t)})),a?a.ref?e.push(new Pt(i,r.ref,"ref cannot reference another ref layer")):s=Rt(a.type):e.push(new Pt(i,r.ref,'ref layer "'+l+'" not found'));else if("background"!==s)if(r.source){var h=o.sources&&o.sources[r.source],d=h&&Rt(h.type);h?"vector"===d&&"raster"===s?e.push(new Pt(i,r.source,'layer "'+r.id+'" requires a raster source')):"raster"===d&&"raster"!==s?e.push(new Pt(i,r.source,'layer "'+r.id+'" requires a vector source')):"vector"!==d||r["source-layer"]?"raster-dem"===d&&"hillshade"!==s?e.push(new Pt(i,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==s||!r.paint||!r.paint["line-gradient"]||"geojson"===d&&h.lineMetrics||e.push(new Pt(i,r,'layer "'+r.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):e.push(new Pt(i,r,'layer "'+r.id+'" must specify a "source-layer"')):e.push(new Pt(i,r.source,'source "'+r.source+'" not found'))}else e.push(new Pt(i,r,'missing required property "source"'));return e=e.concat(Jr({key:i,value:r,valueSpec:n.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return Ci({key:i+".type",value:r.type,valueSpec:n.layer.type,style:t.style,styleSpec:t.styleSpec,object:r,objectKey:"type"})},filter:di,layout:function(t){return Jr({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return _i(zt({layerType:s},t))}}})},paint:function(t){return Jr({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return mi(zt({layerType:s},t))}}})}}}))}function gi(t){var e=t.value,r=t.key,i=Fr(e);return"string"!==i?[new Pt(r,e,"string expected, "+i+" found")]:[]}var vi={promoteId:function(t){var e=t.key,r=t.value;if("string"===Fr(r))return gi({key:e,value:r});var i=[];for(var o in r)i.push.apply(i,gi({key:e+"."+o,value:r[o]}));return i}};function xi(t){var e=t.value,r=t.key,i=t.styleSpec,o=t.style;if(!e.type)return[new Pt(r,e,'"type" is required')];var n,a=Rt(e.type);switch(a){case"vector":case"raster":case"raster-dem":return Jr({key:r,value:e,valueSpec:i["source_"+a.replace("-","_")],style:t.style,styleSpec:i,objectElementValidators:vi});case"geojson":if(n=Jr({key:r,value:e,valueSpec:i.source_geojson,style:o,styleSpec:i,objectElementValidators:vi}),e.cluster)for(var s in e.clusterProperties){var l=e.clusterProperties[s],p=l[0],c="string"==typeof p?[p,["accumulated"],["get",s]]:p;n.push.apply(n,ri({key:r+"."+s+".map",value:l[1],expressionContext:"cluster-map"})),n.push.apply(n,ri({key:r+"."+s+".reduce",value:c,expressionContext:"cluster-reduce"}))}return n;case"video":return Jr({key:r,value:e,valueSpec:i.source_video,style:o,styleSpec:i});case"image":return Jr({key:r,value:e,valueSpec:i.source_image,style:o,styleSpec:i});case"canvas":return[new Pt(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return ii({key:r+".type",value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:o,styleSpec:i})}}function bi(t){var e=t.value,r=t.styleSpec,i=r.light,o=t.style,n=[],a=Fr(e);if(void 0===e)return n;if("object"!==a)return n.concat([new Pt("light",e,"object expected, "+a+" found")]);for(var s in e){var l=s.match(/^(.*)-transition$/);n=n.concat(l&&i[l[1]]&&i[l[1]].transition?Ci({key:s,value:e[s],valueSpec:r.transition,style:o,styleSpec:r}):i[s]?Ci({key:s,value:e[s],valueSpec:i[s],style:o,styleSpec:r}):[new Pt(s,e[s],'unknown property "'+s+'"')])}return n}var wi={"*":function(){return[]},array:Yr,boolean:function(t){var e=t.value,r=t.key,i=Fr(e);return"boolean"!==i?[new Pt(r,e,"boolean expected, "+i+" found")]:[]},number:ti,color:function(t){var e=t.key,r=t.value,i=Fr(r);return"string"!==i?[new Pt(e,r,"color expected, "+i+" found")]:null===te(r)?[new Pt(e,r,'color expected, "'+r+'" found')]:[]},constants:Lt,enum:ii,filter:di,function:ei,layer:yi,object:Jr,source:xi,light:bi,string:gi,formatted:function(t){return 0===gi(t).length?[]:ri(t)},resolvedImage:function(t){return 0===gi(t).length?[]:ri(t)}};function Ci(t){var e=t.value,r=t.valueSpec,i=t.styleSpec;return r.expression&&Br(Rt(e))?ei(t):r.expression&&Zr(Dt(e))?ri(t):r.type&&wi[r.type]?wi[r.type](t):Jr(zt({},t,{valueSpec:r.type?i[r.type]:r}))}function ki(t){var e=t.value,r=t.key,i=gi(t);return i.length||(-1===e.indexOf("{fontstack}")&&i.push(new Pt(r,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&i.push(new Pt(r,e,'"glyphs" url must include a "{range}" token'))),i}function Si(t,e){void 0===e&&(e=It);var r=[];return r=r.concat(Ci({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:ki,"*":function(){return[]}}})),t.constants&&(r=r.concat(Lt({key:"constants",value:t.constants,style:t,styleSpec:e}))),Mi(r)}function Mi(t){return[].concat(t).sort((function(t,e){return t.line-e.line}))}function Ei(t){return function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return Mi(t.apply(this,e))}}Si.source=Ei(xi),Si.light=Ei(bi),Si.layer=Ei(yi),Si.filter=Ei(di),Si.paintProperty=Ei(mi),Si.layoutProperty=Ei(_i);var Ti=Si,Ai=Ti.light,Ii=Ti.paintProperty,Pi=Ti.layoutProperty;function Li(t,e){var r=!1;if(e&&e.length)for(var i=0,o=e;i<o.length;i+=1)t.fire(new Tt(new Error(o[i].message))),r=!0;return r}var zi=Ri;function Ri(t,e,r){var i=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var o=new Int32Array(this.arrayBuffer);t=o[0],this.d=(e=o[1])+2*(r=o[2]);for(var n=0;n<this.d*this.d;n++){var a=o[3+n],s=o[3+n+1];i.push(a===s?null:o.subarray(a,s))}var l=o[3+i.length+1];this.keys=o.subarray(o[3+i.length],l),this.bboxes=o.subarray(l),this.insert=this._insertReadonly}else{this.d=e+2*r;for(var p=0;p<this.d*this.d;p++)i.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=r,this.scale=e/t,this.uid=0;var c=r/e*t;this.min=-c,this.max=t+c}Ri.prototype.insert=function(t,e,r,i,o){this._forEachCell(e,r,i,o,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(i),this.bboxes.push(o)},Ri.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},Ri.prototype._insertCell=function(t,e,r,i,o,n){this.cells[o].push(n)},Ri.prototype.query=function(t,e,r,i,o){var n=this.min,a=this.max;if(t<=n&&e<=n&&a<=r&&a<=i&&!o)return Array.prototype.slice.call(this.keys);var s=[];return this._forEachCell(t,e,r,i,this._queryCell,s,{},o),s},Ri.prototype._queryCell=function(t,e,r,i,o,n,a,s){var l=this.cells[o];if(null!==l)for(var p=this.keys,c=this.bboxes,u=0;u<l.length;u++){var h=l[u];if(void 0===a[h]){var d=4*h;(s?s(c[d+0],c[d+1],c[d+2],c[d+3]):t<=c[d+2]&&e<=c[d+3]&&r>=c[d+0]&&i>=c[d+1])?(a[h]=!0,n.push(p[h])):a[h]=!1}}},Ri.prototype._forEachCell=function(t,e,r,i,o,n,a,s){for(var l=this._convertToCellCoord(t),p=this._convertToCellCoord(e),c=this._convertToCellCoord(r),u=this._convertToCellCoord(i),h=l;h<=c;h++)for(var d=p;d<=u;d++){var f=this.d*d+h;if((!s||s(this._convertFromCellCoord(h),this._convertFromCellCoord(d),this._convertFromCellCoord(h+1),this._convertFromCellCoord(d+1)))&&o.call(this,t,e,r,i,f,n,a,s))return}},Ri.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},Ri.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},Ri.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=3+this.cells.length+1+1,r=0,i=0;i<this.cells.length;i++)r+=this.cells[i].length;var o=new Int32Array(e+r+this.keys.length+this.bboxes.length);o[0]=this.extent,o[1]=this.n,o[2]=this.padding;for(var n=e,a=0;a<t.length;a++){var s=t[a];o[3+a]=n,o.set(s,n),n+=s.length}return o[3+t.length]=n,o.set(this.keys,n),o[3+t.length+1]=n+=this.keys.length,o.set(this.bboxes,n),n+=this.bboxes.length,o.buffer};var Di=a.ImageData,Oi=a.ImageBitmap,Fi={};function Bi(t,e,r){void 0===r&&(r={}),Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),Fi[t]={klass:e,omit:r.omit||[],shallow:r.shallow||[]}}for(var ji in Bi("Object",Object),zi.serialize=function(t,e){var r=t.toArrayBuffer();return e&&e.push(r),{buffer:r}},zi.deserialize=function(t){return new zi(t.buffer)},Bi("Grid",zi),Bi("Color",ee),Bi("Error",Error),Bi("ResolvedImage",ne),Bi("StylePropertyFunction",Kr),Bi("StyleExpression",Hr,{omit:["_evaluator"]}),Bi("ZoomDependentExpression",Xr),Bi("ZoomConstantExpression",Qr),Bi("CompoundExpression",xe,{omit:["_evaluate"]}),Er)Er[ji]._classRegistryKey||Bi("Expression_"+ji,Er[ji]);function Ni(t){return t&&"undefined"!=typeof ArrayBuffer&&(t instanceof ArrayBuffer||t.constructor&&"ArrayBuffer"===t.constructor.name)}function Ui(t){return Oi&&t instanceof Oi}function Vi(t,e){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp)return t;if(Ni(t)||Ui(t))return e&&e.push(t),t;if(ArrayBuffer.isView(t)){var r=t;return e&&e.push(r.buffer),r}if(t instanceof Di)return e&&e.push(t.data.buffer),t;if(Array.isArray(t)){for(var i=[],o=0,n=t;o<n.length;o+=1)i.push(Vi(n[o],e));return i}if("object"==typeof t){var a=t.constructor,s=a._classRegistryKey;if(!s)throw new Error("can't serialize object of unregistered class");var l=a.serialize?a.serialize(t,e):{};if(!a.serialize){for(var p in t)if(t.hasOwnProperty(p)&&!(Fi[s].omit.indexOf(p)>=0)){var c=t[p];l[p]=Fi[s].shallow.indexOf(p)>=0?c:Vi(c,e)}t instanceof Error&&(l.message=t.message)}if(l.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==s&&(l.$name=s),l}throw new Error("can't serialize object of type "+typeof t)}function qi(t){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||Ni(t)||Ui(t)||ArrayBuffer.isView(t)||t instanceof Di)return t;if(Array.isArray(t))return t.map(qi);if("object"==typeof t){var e=t.$name||"Object",r=Fi[e].klass;if(!r)throw new Error("can't deserialize unregistered class "+e);if(r.deserialize)return r.deserialize(t);for(var i=Object.create(r.prototype),o=0,n=Object.keys(t);o<n.length;o+=1){var a=n[o];if("$name"!==a){var s=t[a];i[a]=Fi[e].shallow.indexOf(a)>=0?s:qi(s)}}return i}throw new Error("can't deserialize object of type "+typeof t)}var $i=function(){this.first=!0};$i.prototype.update=function(t,e){var r=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoom<r&&(this.lastIntegerZoom=r,this.lastIntegerZoomTime=e),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=r,!0))};var Hi={"Latin-1 Supplement":function(t){return t>=128&&t<=255},Arabic:function(t){return t>=1536&&t<=1791},"Arabic Supplement":function(t){return t>=1872&&t<=1919},"Arabic Extended-A":function(t){return t>=2208&&t<=2303},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},Khmer:function(t){return t>=6016&&t<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Arabic Presentation Forms-A":function(t){return t>=64336&&t<=65023},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Arabic Presentation Forms-B":function(t){return t>=65136&&t<=65279},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}};function Zi(t){for(var e=0,r=t;e<r.length;e+=1)if(Gi(r[e].charCodeAt(0)))return!0;return!1}function Gi(t){return!(746!==t&&747!==t&&(t<4352||!(Hi["Bopomofo Extended"](t)||Hi.Bopomofo(t)||Hi["CJK Compatibility Forms"](t)&&!(t>=65097&&t<=65103)||Hi["CJK Compatibility Ideographs"](t)||Hi["CJK Compatibility"](t)||Hi["CJK Radicals Supplement"](t)||Hi["CJK Strokes"](t)||!(!Hi["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||Hi["CJK Unified Ideographs Extension A"](t)||Hi["CJK Unified Ideographs"](t)||Hi["Enclosed CJK Letters and Months"](t)||Hi["Hangul Compatibility Jamo"](t)||Hi["Hangul Jamo Extended-A"](t)||Hi["Hangul Jamo Extended-B"](t)||Hi["Hangul Jamo"](t)||Hi["Hangul Syllables"](t)||Hi.Hiragana(t)||Hi["Ideographic Description Characters"](t)||Hi.Kanbun(t)||Hi["Kangxi Radicals"](t)||Hi["Katakana Phonetic Extensions"](t)||Hi.Katakana(t)&&12540!==t||!(!Hi["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!Hi["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||Hi["Unified Canadian Aboriginal Syllabics"](t)||Hi["Unified Canadian Aboriginal Syllabics Extended"](t)||Hi["Vertical Forms"](t)||Hi["Yijing Hexagram Symbols"](t)||Hi["Yi Syllables"](t)||Hi["Yi Radicals"](t))))}function Qi(t){return!(Gi(t)||function(t){return!!(Hi["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||Hi["General Punctuation"](t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||Hi["Letterlike Symbols"](t)||Hi["Number Forms"](t)||Hi["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||Hi["Control Pictures"](t)&&9251!==t||Hi["Optical Character Recognition"](t)||Hi["Enclosed Alphanumerics"](t)||Hi["Geometric Shapes"](t)||Hi["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||Hi["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Hi["CJK Symbols and Punctuation"](t)||Hi.Katakana(t)||Hi["Private Use Area"](t)||Hi["CJK Compatibility Forms"](t)||Hi["Small Form Variants"](t)||Hi["Halfwidth and Fullwidth Forms"](t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}function Xi(t){return t>=1424&&t<=2303||Hi["Arabic Presentation Forms-A"](t)||Hi["Arabic Presentation Forms-B"](t)}function Wi(t,e){return!(!e&&Xi(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||Hi.Khmer(t))}function Ki(t){for(var e=0,r=t;e<r.length;e+=1)if(Xi(r[e].charCodeAt(0)))return!0;return!1}var Ji=null,Yi="unavailable",to=null,eo=function(t){t&&"string"==typeof t&&t.indexOf("NetworkError")>-1&&(Yi="error"),Ji&&Ji(t)};function ro(){io.fire(new Et("pluginStateChange",{pluginStatus:Yi,pluginURL:to}))}var io=new At,oo=function(){return Yi},no=function(){if("deferred"!==Yi||!to)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Yi="loading",ro(),to&&bt({url:to},(function(t){t?eo(t):(Yi="loaded",ro())}))},ao={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return"loaded"===Yi||null!=ao.applyArabicShaping},isLoading:function(){return"loading"===Yi},setState:function(t){Yi=t.pluginStatus,to=t.pluginURL},isParsed:function(){return null!=ao.applyArabicShaping&&null!=ao.processBidirectionalText&&null!=ao.processStyledBidirectionalText},getPluginURL:function(){return to}},so=function(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new $i,this.transition={})};so.prototype.isSupportedScript=function(t){return function(t,e){for(var r=0,i=t;r<i.length;r+=1)if(!Wi(i[r].charCodeAt(0),e))return!1;return!0}(t,ao.isLoaded())},so.prototype.crossFadingFactor=function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},so.prototype.getCrossfadeParameters=function(){var t=this.zoom,e=t-Math.floor(t),r=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}};var lo=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(Br(t))return new Kr(t,e);if(Zr(t)){var r=Wr(t,e);if("error"===r.result)throw new Error(r.value.map((function(t){return t.key+": "+t.message})).join(", "));return r.value}var i=t;return"string"==typeof t&&"color"===e.type&&(i=ee.parse(t)),{kind:"constant",evaluate:function(){return i}}}(void 0===e?t.specification.default:e,t.specification)};lo.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},lo.prototype.possiblyEvaluate=function(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)};var po=function(t){this.property=t,this.value=new lo(t,void 0)};po.prototype.transitioned=function(t,e){return new uo(this.property,this.value,e,h({},t.transition,this.transition),t.now)},po.prototype.untransitioned=function(){return new uo(this.property,this.value,null,{},0)};var co=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};co.prototype.getValue=function(t){return b(this._values[t].value.value)},co.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new po(this._values[t].property)),this._values[t].value=new lo(this._values[t].property,null===e?void 0:b(e))},co.prototype.getTransition=function(t){return b(this._values[t].transition)},co.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new po(this._values[t].property)),this._values[t].transition=b(e)||void 0},co.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);e<r.length;e+=1){var i=r[e],o=this.getValue(i);void 0!==o&&(t[i]=o);var n=this.getTransition(i);void 0!==n&&(t[i+"-transition"]=n)}return t},co.prototype.transitioned=function(t,e){for(var r=new ho(this._properties),i=0,o=Object.keys(this._values);i<o.length;i+=1){var n=o[i];r._values[n]=this._values[n].transitioned(t,e._values[n])}return r},co.prototype.untransitioned=function(){for(var t=new ho(this._properties),e=0,r=Object.keys(this._values);e<r.length;e+=1){var i=r[e];t._values[i]=this._values[i].untransitioned()}return t};var uo=function(t,e,r,i,o){this.property=t,this.value=e,this.begin=o+i.delay||0,this.end=this.begin+i.duration||0,t.specification.transition&&(i.delay||i.duration)&&(this.prior=r)};uo.prototype.possiblyEvaluate=function(t,e,r){var i=t.now||0,o=this.value.possiblyEvaluate(t,e,r),n=this.prior;if(n){if(i>this.end)return this.prior=null,o;if(this.value.isDataDriven())return this.prior=null,o;if(i<this.begin)return n.possiblyEvaluate(t,e,r);var a=(i-this.begin)/(this.end-this.begin);return this.property.interpolate(n.possiblyEvaluate(t,e,r),o,function(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}(a))}return o};var ho=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};ho.prototype.possiblyEvaluate=function(t,e,r){for(var i=new _o(this._properties),o=0,n=Object.keys(this._values);o<n.length;o+=1){var a=n[o];i._values[a]=this._values[a].possiblyEvaluate(t,e,r)}return i},ho.prototype.hasTransition=function(){for(var t=0,e=Object.keys(this._values);t<e.length;t+=1)if(this._values[e[t]].prior)return!0;return!1};var fo=function(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)};fo.prototype.getValue=function(t){return b(this._values[t].value)},fo.prototype.setValue=function(t,e){this._values[t]=new lo(this._values[t].property,null===e?void 0:b(e))},fo.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);e<r.length;e+=1){var i=r[e],o=this.getValue(i);void 0!==o&&(t[i]=o)}return t},fo.prototype.possiblyEvaluate=function(t,e,r){for(var i=new _o(this._properties),o=0,n=Object.keys(this._values);o<n.length;o+=1){var a=n[o];i._values[a]=this._values[a].possiblyEvaluate(t,e,r)}return i};var mo=function(t,e,r){this.property=t,this.value=e,this.parameters=r};mo.prototype.isConstant=function(){return"constant"===this.value.kind},mo.prototype.constantOr=function(t){return"constant"===this.value.kind?this.value.value:t},mo.prototype.evaluate=function(t,e,r,i){return this.property.evaluate(this.value,this.parameters,t,e,r,i)};var _o=function(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)};_o.prototype.get=function(t){return this._values[t]};var yo=function(t){this.specification=t};yo.prototype.possiblyEvaluate=function(t,e){return t.expression.evaluate(e)},yo.prototype.interpolate=function(t,e,r){var i=Ze[this.specification.type];return i?i(t,e,r):t};var go=function(t,e){this.specification=t,this.overrides=e};go.prototype.possiblyEvaluate=function(t,e,r,i){return new mo(this,"constant"===t.expression.kind||"camera"===t.expression.kind?{kind:"constant",value:t.expression.evaluate(e,null,{},r,i)}:t.expression,e)},go.prototype.interpolate=function(t,e,r){if("constant"!==t.value.kind||"constant"!==e.value.kind)return t;if(void 0===t.value.value||void 0===e.value.value)return new mo(this,{kind:"constant",value:void 0},t.parameters);var i=Ze[this.specification.type];return i?new mo(this,{kind:"constant",value:i(t.value.value,e.value.value,r)},t.parameters):t},go.prototype.evaluate=function(t,e,r,i,o,n){return"constant"===t.kind?t.value:t.evaluate(e,r,i,o,n)};var vo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.possiblyEvaluate=function(t,e,r,i){if(void 0===t.value)return new mo(this,{kind:"constant",value:void 0},e);if("constant"===t.expression.kind){var o=t.expression.evaluate(e,null,{},r,i),n="resolvedImage"===t.property.specification.type&&"string"!=typeof o?o.name:o,a=this._calculate(n,n,n,e);return new mo(this,{kind:"constant",value:a},e)}if("camera"===t.expression.kind){var s=this._calculate(t.expression.evaluate({zoom:e.zoom-1}),t.expression.evaluate({zoom:e.zoom}),t.expression.evaluate({zoom:e.zoom+1}),e);return new mo(this,{kind:"constant",value:s},e)}return new mo(this,t.expression,e)},e.prototype.evaluate=function(t,e,r,i,o,n){if("source"===t.kind){var a=t.evaluate(e,r,i,o,n);return this._calculate(a,a,a,e)}return"composite"===t.kind?this._calculate(t.evaluate({zoom:Math.floor(e.zoom)-1},r,i),t.evaluate({zoom:Math.floor(e.zoom)},r,i),t.evaluate({zoom:Math.floor(e.zoom)+1},r,i),e):t.value},e.prototype._calculate=function(t,e,r,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},e.prototype.interpolate=function(t){return t},e}(go),xo=function(t){this.specification=t};xo.prototype.possiblyEvaluate=function(t,e,r,i){if(void 0!==t.value){if("constant"===t.expression.kind){var o=t.expression.evaluate(e,null,{},r,i);return this._calculate(o,o,o,e)}return this._calculate(t.expression.evaluate(new so(Math.floor(e.zoom-1),e)),t.expression.evaluate(new so(Math.floor(e.zoom),e)),t.expression.evaluate(new so(Math.floor(e.zoom+1),e)),e)}},xo.prototype._calculate=function(t,e,r,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},xo.prototype.interpolate=function(t){return t};var bo=function(t){this.specification=t};bo.prototype.possiblyEvaluate=function(t,e,r,i){return!!t.expression.evaluate(e,null,{},r,i)},bo.prototype.interpolate=function(){return!1};var wo=function(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],t){var r=t[e];r.specification.overridable&&this.overridableProperties.push(e);var i=this.defaultPropertyValues[e]=new lo(r,void 0),o=this.defaultTransitionablePropertyValues[e]=new po(r);this.defaultTransitioningPropertyValues[e]=o.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=i.possiblyEvaluate({})}};Bi("DataDrivenProperty",go),Bi("DataConstantProperty",yo),Bi("CrossFadedDataDrivenProperty",vo),Bi("CrossFadedProperty",xo),Bi("ColorRampProperty",bo);var Co=function(t){function e(e,r){if(t.call(this),this.id=e.id,this.type=e.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},"custom"!==e.type&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),r.layout&&(this._unevaluatedLayout=new fo(r.layout)),r.paint)){for(var i in this._transitionablePaint=new co(r.paint),e.paint)this.setPaintProperty(i,e.paint[i],{validate:!1});for(var o in e.layout)this.setLayoutProperty(o,e.layout[o],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new _o(r.paint)}}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},e.prototype.getLayoutProperty=function(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)},e.prototype.setLayoutProperty=function(t,e,r){void 0===r&&(r={}),null!=e&&this._validate(Pi,"layers."+this.id+".layout."+t,t,e,r)||("visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e)},e.prototype.getPaintProperty=function(t){return g(t,"-transition")?this._transitionablePaint.getTransition(t.slice(0,-11)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e&&this._validate(Ii,"layers."+this.id+".paint."+t,t,e,r))return!1;if(g(t,"-transition"))return this._transitionablePaint.setTransition(t.slice(0,-11),e||void 0),!1;var i=this._transitionablePaint._values[t],o="cross-faded-data-driven"===i.property.specification["property-type"],n=i.value.isDataDriven(),a=i.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var s=this._transitionablePaint._values[t].value;return s.isDataDriven()||n||o||this._handleOverridablePaintPropertyUpdate(t,a,s)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype._handleOverridablePaintPropertyUpdate=function(t,e,r){return!1},e.prototype.isHidden=function(t){return!!(this.minzoom&&t<this.minzoom)||!!(this.maxzoom&&t>=this.maxzoom)||"none"===this.visibility},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)},e.prototype.serialize=function(){var t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),x(t,(function(t,e){return!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)}))},e.prototype._validate=function(t,e,r,i,o){return void 0===o&&(o={}),(!o||!1!==o.validate)&&Li(this,t.call(Ti,{key:e,layerType:this.type,objectKey:r,value:i,styleSpec:It,style:{glyphs:!0,sprite:!0}}))},e.prototype.is3D=function(){return!1},e.prototype.isTileClipped=function(){return!1},e.prototype.hasOffscreenPass=function(){return!1},e.prototype.resize=function(){},e.prototype.isStateDependent=function(){for(var t in this.paint._values){var e=this.paint.get(t);if(e instanceof mo&&Rr(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1},e}(At),ko={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},So=function(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},Mo=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function Eo(t,e){void 0===e&&(e=1);var r=0,i=0;return{members:t.map((function(t){var o=ko[t.type].BYTES_PER_ELEMENT,n=r=To(r,Math.max(e,o)),a=t.components||1;return i=Math.max(i,o),r+=o*a,{name:t.name,type:t.type,components:a,offset:n}})),size:To(r,Math.max(i,e)),alignment:e}}function To(t,e){return Math.ceil(t/e)*e}Mo.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},Mo.deserialize=function(t){var e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e},Mo.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Mo.prototype.clear=function(){this.length=0},Mo.prototype.resize=function(t){this.reserve(t),this.length=t},Mo.prototype.reserve=function(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},Mo.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var Ao=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var i=2*t;return this.int16[i+0]=e,this.int16[i+1]=r,t},e}(Mo);Ao.prototype.bytesPerElement=4,Bi("StructArrayLayout2i4",Ao);var Io=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,i){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,i)},e.prototype.emplace=function(t,e,r,i,o){var n=4*t;return this.int16[n+0]=e,this.int16[n+1]=r,this.int16[n+2]=i,this.int16[n+3]=o,t},e}(Mo);Io.prototype.bytesPerElement=8,Bi("StructArrayLayout4i8",Io);var Po=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,i,o,n){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,i,o,n)},e.prototype.emplace=function(t,e,r,i,o,n,a){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=i,this.int16[s+3]=o,this.int16[s+4]=n,this.int16[s+5]=a,t},e}(Mo);Po.prototype.bytesPerElement=12,Bi("StructArrayLayout2i4i12",Po);var Lo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,i,o,n){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,i,o,n)},e.prototype.emplace=function(t,e,r,i,o,n,a){var s=4*t,l=8*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.uint8[l+4]=i,this.uint8[l+5]=o,this.uint8[l+6]=n,this.uint8[l+7]=a,t},e}(Mo);Lo.prototype.bytesPerElement=8,Bi("StructArrayLayout2i4ub8",Lo);var zo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var i=2*t;return this.float32[i+0]=e,this.float32[i+1]=r,t},e}(Mo);zo.prototype.bytesPerElement=8,Bi("StructArrayLayout2f8",zo);var Ro=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,i,o,n,a,s,l,p){var c=this.length;return this.resize(c+1),this.emplace(c,t,e,r,i,o,n,a,s,l,p)},e.prototype.emplace=function(t,e,r,i,o,n,a,s,l,p,c){var u=10*t;return this.uint16[u+0]=e,this.uint16[u+1]=r,this.uint16[u+2]=i,this.uint16[u+3]=o,this.uint16[u+4]=n,this.uint16[u+5]=a,this.uint16[u+6]=s,this.uint16[u+7]=l,this.uint16[u+8]=p,this.uint16[u+9]=c,t},e}(Mo);Ro.prototype.bytesPerElement=20,Bi("StructArrayLayout10ui20",Ro);var Do=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,i,o,n,a,s,l,p,c,u){var h=this.length;return this.resize(h+1),this.emplace(h,t,e,r,i,o,n,a,s,l,p,c,u)},e.prototype.emplace=function(t,e,r,i,o,n,a,s,l,p,c,u,h){var d=12*t;return this.int16[d+0]=e,this.int16[d+1]=r,this.int16[d+2]=i,this.int16[d+3]=o,this.uint16[d+4]=n,this.uint16[d+5]=a,this.uint16[d+6]=s,this.uint16[d+7]=l,this.int16[d+8]=p,this.int16[d+9]=c,this.int16[d+10]=u,this.int16[d+11]=h,t},e}(Mo);Do.prototype.bytesPerElement=24,Bi("StructArrayLayout4i4ui4i24",Do);var Oo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)},e.prototype.emplace=function(t,e,r,i){var o=3*t;return this.float32[o+0]=e,this.float32[o+1]=r,this.float32[o+2]=i,t},e}(Mo);Oo.prototype.bytesPerElement=12,Bi("StructArrayLayout3f12",Oo);var Fo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.uint32[1*t+0]=e,t},e}(Mo);Fo.prototype.bytesPerElement=4,Bi("StructArrayLayout1ul4",Fo);var Bo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,i,o,n,a,s,l){var p=this.length;return this.resize(p+1),this.emplace(p,t,e,r,i,o,n,a,s,l)},e.prototype.emplace=function(t,e,r,i,o,n,a,s,l,p){var c=10*t,u=5*t;return this.int16[c+0]=e,this.int16[c+1]=r,this.int16[c+2]=i,this.int16[c+3]=o,this.int16[c+4]=n,this.int16[c+5]=a,this.uint32[u+3]=s,this.uint16[c+8]=l,this.uint16[c+9]=p,t},e}(Mo);Bo.prototype.bytesPerElement=20,Bi("StructArrayLayout6i1ul2ui20",Bo);var jo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,i,o,n){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,i,o,n)},e.prototype.emplace=function(t,e,r,i,o,n,a){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=i,this.int16[s+3]=o,this.int16[s+4]=n,this.int16[s+5]=a,t},e}(Mo);jo.prototype.bytesPerElement=12,Bi("StructArrayLayout2i2i2i12",jo);var No=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,i,o){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r,i,o)},e.prototype.emplace=function(t,e,r,i,o,n){var a=4*t,s=8*t;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=i,this.int16[s+6]=o,this.int16[s+7]=n,t},e}(Mo);No.prototype.bytesPerElement=16,Bi("StructArrayLayout2f1f2i16",No);var Uo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,i){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,i)},e.prototype.emplace=function(t,e,r,i,o){var n=12*t,a=3*t;return this.uint8[n+0]=e,this.uint8[n+1]=r,this.float32[a+1]=i,this.float32[a+2]=o,t},e}(Mo);Uo.prototype.bytesPerElement=12,Bi("StructArrayLayout2ub2f12",Uo);var Vo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)},e.prototype.emplace=function(t,e,r,i){var o=3*t;return this.uint16[o+0]=e,this.uint16[o+1]=r,this.uint16[o+2]=i,t},e}(Mo);Vo.prototype.bytesPerElement=6,Bi("StructArrayLayout3ui6",Vo);var qo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,i,o,n,a,s,l,p,c,u,h,d,f,m,_){var y=this.length;return this.resize(y+1),this.emplace(y,t,e,r,i,o,n,a,s,l,p,c,u,h,d,f,m,_)},e.prototype.emplace=function(t,e,r,i,o,n,a,s,l,p,c,u,h,d,f,m,_,y){var g=24*t,v=12*t,x=48*t;return this.int16[g+0]=e,this.int16[g+1]=r,this.uint16[g+2]=i,this.uint16[g+3]=o,this.uint32[v+2]=n,this.uint32[v+3]=a,this.uint32[v+4]=s,this.uint16[g+10]=l,this.uint16[g+11]=p,this.uint16[g+12]=c,this.float32[v+7]=u,this.float32[v+8]=h,this.uint8[x+36]=d,this.uint8[x+37]=f,this.uint8[x+38]=m,this.uint32[v+10]=_,this.int16[g+22]=y,t},e}(Mo);qo.prototype.bytesPerElement=48,Bi("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",qo);var $o=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,i,o,n,a,s,l,p,c,u,h,d,f,m,_,y,g,v,x,b,w,C,k,S,M,E){var T=this.length;return this.resize(T+1),this.emplace(T,t,e,r,i,o,n,a,s,l,p,c,u,h,d,f,m,_,y,g,v,x,b,w,C,k,S,M,E)},e.prototype.emplace=function(t,e,r,i,o,n,a,s,l,p,c,u,h,d,f,m,_,y,g,v,x,b,w,C,k,S,M,E,T){var A=34*t,I=17*t;return this.int16[A+0]=e,this.int16[A+1]=r,this.int16[A+2]=i,this.int16[A+3]=o,this.int16[A+4]=n,this.int16[A+5]=a,this.int16[A+6]=s,this.int16[A+7]=l,this.uint16[A+8]=p,this.uint16[A+9]=c,this.uint16[A+10]=u,this.uint16[A+11]=h,this.uint16[A+12]=d,this.uint16[A+13]=f,this.uint16[A+14]=m,this.uint16[A+15]=_,this.uint16[A+16]=y,this.uint16[A+17]=g,this.uint16[A+18]=v,this.uint16[A+19]=x,this.uint16[A+20]=b,this.uint16[A+21]=w,this.uint16[A+22]=C,this.uint32[I+12]=k,this.float32[I+13]=S,this.float32[I+14]=M,this.float32[I+15]=E,this.float32[I+16]=T,t},e}(Mo);$o.prototype.bytesPerElement=68,Bi("StructArrayLayout8i15ui1ul4f68",$o);var Ho=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.float32[1*t+0]=e,t},e}(Mo);Ho.prototype.bytesPerElement=4,Bi("StructArrayLayout1f4",Ho);var Zo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)},e.prototype.emplace=function(t,e,r,i){var o=3*t;return this.int16[o+0]=e,this.int16[o+1]=r,this.int16[o+2]=i,t},e}(Mo);Zo.prototype.bytesPerElement=6,Bi("StructArrayLayout3i6",Zo);var Go=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)},e.prototype.emplace=function(t,e,r,i){var o=4*t;return this.uint32[2*t+0]=e,this.uint16[o+2]=r,this.uint16[o+3]=i,t},e}(Mo);Go.prototype.bytesPerElement=8,Bi("StructArrayLayout1ul2ui8",Go);var Qo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var i=2*t;return this.uint16[i+0]=e,this.uint16[i+1]=r,t},e}(Mo);Qo.prototype.bytesPerElement=4,Bi("StructArrayLayout2ui4",Qo);var Xo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.uint16[1*t+0]=e,t},e}(Mo);Xo.prototype.bytesPerElement=2,Bi("StructArrayLayout1ui2",Xo);var Wo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,i){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,i)},e.prototype.emplace=function(t,e,r,i,o){var n=4*t;return this.float32[n+0]=e,this.float32[n+1]=r,this.float32[n+2]=i,this.float32[n+3]=o,t},e}(Mo);Wo.prototype.bytesPerElement=16,Bi("StructArrayLayout4f16",Wo);var Ko=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.anchorPoint.get=function(){return new o(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,r),e}(So);Ko.prototype.size=20;var Jo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new Ko(this,t)},e}(Bo);Bi("CollisionBoxArray",Jo);var Yo=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},r.placedOrientation.set=function(t){this._structArray.uint8[this._pos1+37]=t},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(t){this._structArray.uint8[this._pos1+38]=t},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+10]=t},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(e.prototype,r),e}(So);Yo.prototype.size=48;var tn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new Yo(this,t)},e}(qo);Bi("PlacedSymbolArray",tn);var en=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},r.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},r.key.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},r.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},r.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},r.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},r.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+12]=t},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},r.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(e.prototype,r),e}(So);en.prototype.size=68;var rn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new en(this,t)},e}($o);Bi("SymbolInstanceArray",rn);var on=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e}(Ho);Bi("GlyphOffsetArray",on);var nn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getx=function(t){return this.int16[3*t+0]},e.prototype.gety=function(t){return this.int16[3*t+1]},e.prototype.gettileUnitDistanceFromAnchor=function(t){return this.int16[3*t+2]},e}(Zo);Bi("SymbolLineVertexArray",nn);var an=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(e.prototype,r),e}(So);an.prototype.size=8;var sn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new an(this,t)},e}(Go);Bi("FeatureIndexArray",sn);var ln=Eo([{name:"a_pos",components:2,type:"Int16"}],4).members,pn=function(t){void 0===t&&(t=[]),this.segments=t};function cn(t,e){return 256*(t=c(Math.floor(t),0,255))+c(Math.floor(e),0,255)}pn.prototype.prepareSegment=function(t,e,r,i){var o=this.segments[this.segments.length-1];return t>pn.MAX_VERTEX_ARRAY_LENGTH&&C("Max vertices per segment is "+pn.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!o||o.vertexLength+t>pn.MAX_VERTEX_ARRAY_LENGTH||o.sortKey!==i)&&(o={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==i&&(o.sortKey=i),this.segments.push(o)),o},pn.prototype.get=function(){return this.segments},pn.prototype.destroy=function(){for(var t=0,e=this.segments;t<e.length;t+=1){var r=e[t];for(var i in r.vaos)r.vaos[i].destroy()}},pn.simpleSegment=function(t,e,r,i){return new pn([{vertexOffset:t,primitiveOffset:e,vertexLength:r,primitiveLength:i,vaos:{},sortKey:0}])},pn.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Bi("SegmentVector",pn);var un=Eo([{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"}]),hn=e((function(t){t.exports=function(t,e){var r,i,o,n,a,s,l,p;for(i=t.length-(r=3&t.length),o=e,a=3432918353,s=461845907,p=0;p<i;)l=255&t.charCodeAt(p)|(255&t.charCodeAt(++p))<<8|(255&t.charCodeAt(++p))<<16|(255&t.charCodeAt(++p))<<24,++p,o=27492+(65535&(n=5*(65535&(o=(o^=l=(65535&(l=(l=(65535&l)*a+(((l>>>16)*a&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|o>>>19))+((5*(o>>>16)&65535)<<16)&4294967295))+((58964+(n>>>16)&65535)<<16);switch(l=0,r){case 3:l^=(255&t.charCodeAt(p+2))<<16;case 2:l^=(255&t.charCodeAt(p+1))<<8;case 1:o^=l=(65535&(l=(l=(65535&(l^=255&t.charCodeAt(p)))*a+(((l>>>16)*a&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return o^=t.length,o=2246822507*(65535&(o^=o>>>16))+((2246822507*(o>>>16)&65535)<<16)&4294967295,o=3266489909*(65535&(o^=o>>>13))+((3266489909*(o>>>16)&65535)<<16)&4294967295,(o^=o>>>16)>>>0}})),dn=e((function(t){t.exports=function(t,e){for(var r,i=t.length,o=e^i,n=0;i>=4;)r=1540483477*(65535&(r=255&t.charCodeAt(n)|(255&t.charCodeAt(++n))<<8|(255&t.charCodeAt(++n))<<16|(255&t.charCodeAt(++n))<<24))+((1540483477*(r>>>16)&65535)<<16),o=1540483477*(65535&o)+((1540483477*(o>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),i-=4,++n;switch(i){case 3:o^=(255&t.charCodeAt(n+2))<<16;case 2:o^=(255&t.charCodeAt(n+1))<<8;case 1:o=1540483477*(65535&(o^=255&t.charCodeAt(n)))+((1540483477*(o>>>16)&65535)<<16)}return o=1540483477*(65535&(o^=o>>>13))+((1540483477*(o>>>16)&65535)<<16),(o^=o>>>15)>>>0}})),fn=hn,mn=dn;fn.murmur3=hn,fn.murmur2=mn;var _n=function(){this.ids=[],this.positions=[],this.indexed=!1};_n.prototype.add=function(t,e,r,i){this.ids.push(gn(t)),this.positions.push(e,r,i)},_n.prototype.getPositions=function(t){for(var e=gn(t),r=0,i=this.ids.length-1;r<i;){var o=r+i>>1;this.ids[o]>=e?i=o:r=o+1}for(var n=[];this.ids[r]===e;)n.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return n},_n.serialize=function(t,e){var r=new Float64Array(t.ids),i=new Uint32Array(t.positions);return function t(e,r,i,o){for(;i<o;){for(var n=e[i+o>>1],a=i-1,s=o+1;;){do{a++}while(e[a]<n);do{s--}while(e[s]>n);if(a>=s)break;vn(e,a,s),vn(r,3*a,3*s),vn(r,3*a+1,3*s+1),vn(r,3*a+2,3*s+2)}s-i<o-s?(t(e,r,i,s),i=s+1):(t(e,r,s+1,o),o=s)}}(r,i,0,r.length-1),e&&e.push(r.buffer,i.buffer),{ids:r,positions:i}},_n.deserialize=function(t){var e=new _n;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e};var yn=Math.pow(2,53)-1;function gn(t){var e=+t;return!isNaN(e)&&e<=yn?e:fn(String(t))}function vn(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}Bi("FeaturePositionMap",_n);var xn=function(t,e){this.gl=t.gl,this.location=e},bn=function(t){function e(e,r){t.call(this,e,r),this.current=0}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1i(this.location,t))},e}(xn),wn=function(t){function e(e,r){t.call(this,e,r),this.current=0}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))},e}(xn),Cn=function(t){function e(e,r){t.call(this,e,r),this.current=[0,0]}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]||(this.current=t,this.gl.uniform2f(this.location,t[0],t[1]))},e}(xn),kn=function(t){function e(e,r){t.call(this,e,r),this.current=[0,0,0]}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]||(this.current=t,this.gl.uniform3f(this.location,t[0],t[1],t[2]))},e}(xn),Sn=function(t){function e(e,r){t.call(this,e,r),this.current=[0,0,0,0]}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]&&t[3]===this.current[3]||(this.current=t,this.gl.uniform4f(this.location,t[0],t[1],t[2],t[3]))},e}(xn),Mn=function(t){function e(e,r){t.call(this,e,r),this.current=ee.transparent}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){t.r===this.current.r&&t.g===this.current.g&&t.b===this.current.b&&t.a===this.current.a||(this.current=t,this.gl.uniform4f(this.location,t.r,t.g,t.b,t.a))},e}(xn),En=new Float32Array(16),Tn=function(t){function e(e,r){t.call(this,e,r),this.current=En}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){if(t[12]!==this.current[12]||t[0]!==this.current[0])return this.current=t,void this.gl.uniformMatrix4fv(this.location,!1,t);for(var e=1;e<16;e++)if(t[e]!==this.current[e]){this.current=t,this.gl.uniformMatrix4fv(this.location,!1,t);break}},e}(xn);function An(t){return[cn(255*t.r,255*t.g),cn(255*t.b,255*t.a)]}var In=function(t,e,r){this.value=t,this.uniformNames=e.map((function(t){return"u_"+t})),this.type=r};In.prototype.setUniform=function(t,e,r){t.set(r.constantOr(this.value))},In.prototype.getBinding=function(t,e,r){return"color"===this.type?new Mn(t,e):new wn(t,e)};var Pn=function(t,e){this.uniformNames=e.map((function(t){return"u_"+t})),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1};Pn.prototype.setConstantPatternPositions=function(t,e){this.pixelRatioFrom=e.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=e.tlbr,this.patternTo=t.tlbr},Pn.prototype.setUniform=function(t,e,r,i){var o="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;o&&t.set(o)},Pn.prototype.getBinding=function(t,e,r){return"u_pattern"===r.substr(0,9)?new Sn(t,e):new wn(t,e)};var Ln=function(t,e,r,i){this.expression=t,this.type=r,this.maxValue=0,this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Float32",components:"color"===r?2:1,offset:0}})),this.paintVertexArray=new i};Ln.prototype.populatePaintArray=function(t,e,r,i,o){var n=this.paintVertexArray.length,a=this.expression.evaluate(new so(0),e,{},i,[],o);this.paintVertexArray.resize(t),this._setPaintValue(n,t,a)},Ln.prototype.updatePaintArray=function(t,e,r,i){var o=this.expression.evaluate({zoom:0},r,i);this._setPaintValue(t,e,o)},Ln.prototype._setPaintValue=function(t,e,r){if("color"===this.type)for(var i=An(r),o=t;o<e;o++)this.paintVertexArray.emplace(o,i[0],i[1]);else{for(var n=t;n<e;n++)this.paintVertexArray.emplace(n,r);this.maxValue=Math.max(this.maxValue,Math.abs(r))}},Ln.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Ln.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()};var zn=function(t,e,r,i,o,n){this.expression=t,this.uniformNames=e.map((function(t){return"u_"+t+"_t"})),this.type=r,this.useIntegerZoom=i,this.zoom=o,this.maxValue=0,this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Float32",components:"color"===r?4:2,offset:0}})),this.paintVertexArray=new n};zn.prototype.populatePaintArray=function(t,e,r,i,o){var n=this.expression.evaluate(new so(this.zoom),e,{},i,[],o),a=this.expression.evaluate(new so(this.zoom+1),e,{},i,[],o),s=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(s,t,n,a)},zn.prototype.updatePaintArray=function(t,e,r,i){var o=this.expression.evaluate({zoom:this.zoom},r,i),n=this.expression.evaluate({zoom:this.zoom+1},r,i);this._setPaintValue(t,e,o,n)},zn.prototype._setPaintValue=function(t,e,r,i){if("color"===this.type)for(var o=An(r),n=An(i),a=t;a<e;a++)this.paintVertexArray.emplace(a,o[0],o[1],n[0],n[1]);else{for(var s=t;s<e;s++)this.paintVertexArray.emplace(s,r,i);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(i))}},zn.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},zn.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},zn.prototype.setUniform=function(t,e){var r=this.useIntegerZoom?Math.floor(e.zoom):e.zoom,i=c(this.expression.interpolationFactor(r,this.zoom,this.zoom+1),0,1);t.set(i)},zn.prototype.getBinding=function(t,e,r){return new wn(t,e)};var Rn=function(t,e,r,i,o,n){this.expression=t,this.type=e,this.useIntegerZoom=r,this.zoom=i,this.layerId=n,this.zoomInPaintVertexArray=new o,this.zoomOutPaintVertexArray=new o};Rn.prototype.populatePaintArray=function(t,e,r){var i=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(t),this.zoomOutPaintVertexArray.resize(t),this._setPaintValues(i,t,e.patterns&&e.patterns[this.layerId],r)},Rn.prototype.updatePaintArray=function(t,e,r,i,o){this._setPaintValues(t,e,r.patterns&&r.patterns[this.layerId],o)},Rn.prototype._setPaintValues=function(t,e,r,i){if(i&&r){var o=i[r.min],n=i[r.mid],a=i[r.max];if(o&&n&&a)for(var s=t;s<e;s++)this.zoomInPaintVertexArray.emplace(s,n.tl[0],n.tl[1],n.br[0],n.br[1],o.tl[0],o.tl[1],o.br[0],o.br[1],n.pixelRatio,o.pixelRatio),this.zoomOutPaintVertexArray.emplace(s,n.tl[0],n.tl[1],n.br[0],n.br[1],a.tl[0],a.tl[1],a.br[0],a.br[1],n.pixelRatio,a.pixelRatio)}},Rn.prototype.upload=function(t){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,un.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,un.members,this.expression.isStateDependent))},Rn.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()};var Dn=function(t,e,r){this.binders={},this._buffers=[];var i=[];for(var o in t.paint._values)if(r(o)){var n=t.paint.get(o);if(n instanceof mo&&Rr(n.property.specification)){var a=Fn(o,t.type),s=n.value,l=n.property.specification.type,p=n.property.useIntegerZoom,c=n.property.specification["property-type"],u="cross-faded"===c||"cross-faded-data-driven"===c;if("constant"===s.kind)this.binders[o]=u?new Pn(s.value,a):new In(s.value,a,l),i.push("/u_"+o);else if("source"===s.kind||u){var h=Bn(o,l,"source");this.binders[o]=u?new Rn(s,l,p,e,h,t.id):new Ln(s,a,l,h),i.push("/a_"+o)}else{var d=Bn(o,l,"composite");this.binders[o]=new zn(s,a,l,p,e,d),i.push("/z_"+o)}}}this.cacheKey=i.sort().join("")};Dn.prototype.getMaxValue=function(t){var e=this.binders[t];return e instanceof Ln||e instanceof zn?e.maxValue:0},Dn.prototype.populatePaintArrays=function(t,e,r,i,o){for(var n in this.binders){var a=this.binders[n];(a instanceof Ln||a instanceof zn||a instanceof Rn)&&a.populatePaintArray(t,e,r,i,o)}},Dn.prototype.setConstantPatternPositions=function(t,e){for(var r in this.binders){var i=this.binders[r];i instanceof Pn&&i.setConstantPatternPositions(t,e)}},Dn.prototype.updatePaintArrays=function(t,e,r,i,o){var n=!1;for(var a in t)for(var s=0,l=e.getPositions(a);s<l.length;s+=1){var p=l[s],c=r.feature(p.index);for(var u in this.binders){var h=this.binders[u];if((h instanceof Ln||h instanceof zn||h instanceof Rn)&&!0===h.expression.isStateDependent){var d=i.paint.get(u);h.expression=d.value,h.updatePaintArray(p.start,p.end,c,t[a],o),n=!0}}}return n},Dn.prototype.defines=function(){var t=[];for(var e in this.binders){var r=this.binders[e];(r instanceof In||r instanceof Pn)&&t.push.apply(t,r.uniformNames.map((function(t){return"#define HAS_UNIFORM_"+t})))}return t},Dn.prototype.getBinderAttributes=function(){var t=[];for(var e in this.binders){var r=this.binders[e];if(r instanceof Ln||r instanceof zn)for(var i=0;i<r.paintVertexAttributes.length;i++)t.push(r.paintVertexAttributes[i].name);else if(r instanceof Rn)for(var o=0;o<un.members.length;o++)t.push(un.members[o].name)}return t},Dn.prototype.getBinderUniforms=function(){var t=[];for(var e in this.binders){var r=this.binders[e];if(r instanceof In||r instanceof Pn||r instanceof zn)for(var i=0,o=r.uniformNames;i<o.length;i+=1)t.push(o[i])}return t},Dn.prototype.getPaintVertexBuffers=function(){return this._buffers},Dn.prototype.getUniforms=function(t,e){var r=[];for(var i in this.binders){var o=this.binders[i];if(o instanceof In||o instanceof Pn||o instanceof zn)for(var n=0,a=o.uniformNames;n<a.length;n+=1){var s=a[n];if(e[s]){var l=o.getBinding(t,e[s],s);r.push({name:s,property:i,binding:l})}}}return r},Dn.prototype.setUniforms=function(t,e,r,i){for(var o=0,n=e;o<n.length;o+=1){var a=n[o],s=a.name,l=a.property;this.binders[l].setUniform(a.binding,i,r.get(l),s)}},Dn.prototype.updatePaintBuffers=function(t){for(var e in this._buffers=[],this.binders){var r=this.binders[e];if(t&&r instanceof Rn){var i=2===t.fromScale?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;i&&this._buffers.push(i)}else(r instanceof Ln||r instanceof zn)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}},Dn.prototype.upload=function(t){for(var e in this.binders){var r=this.binders[e];(r instanceof Ln||r instanceof zn||r instanceof Rn)&&r.upload(t)}this.updatePaintBuffers()},Dn.prototype.destroy=function(){for(var t in this.binders){var e=this.binders[t];(e instanceof Ln||e instanceof zn||e instanceof Rn)&&e.destroy()}};var On=function(t,e,r){void 0===r&&(r=function(){return!0}),this.programConfigurations={};for(var i=0,o=t;i<o.length;i+=1){var n=o[i];this.programConfigurations[n.id]=new Dn(n,e,r)}this.needsUpload=!1,this._featureMap=new _n,this._bufferOffset=0};function Fn(t,e){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[t]||[t.replace(e+"-","").replace(/-/g,"_")]}function Bn(t,e,r){var i={color:{source:zo,composite:Wo},number:{source:Ho,composite:zo}},o=function(t){return{"line-pattern":{source:Ro,composite:Ro},"fill-pattern":{source:Ro,composite:Ro},"fill-extrusion-pattern":{source:Ro,composite:Ro}}[t]}(t);return o&&o[r]||i[e][r]}On.prototype.populatePaintArrays=function(t,e,r,i,o,n){for(var a in this.programConfigurations)this.programConfigurations[a].populatePaintArrays(t,e,i,o,n);void 0!==e.id&&this._featureMap.add(e.id,r,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0},On.prototype.updatePaintArrays=function(t,e,r,i){for(var o=0,n=r;o<n.length;o+=1){var a=n[o];this.needsUpload=this.programConfigurations[a.id].updatePaintArrays(t,this._featureMap,e,a,i)||this.needsUpload}},On.prototype.get=function(t){return this.programConfigurations[t]},On.prototype.upload=function(t){if(this.needsUpload){for(var e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}},On.prototype.destroy=function(){for(var t in this.programConfigurations)this.programConfigurations[t].destroy()},Bi("ConstantBinder",In),Bi("CrossFadedConstantBinder",Pn),Bi("SourceExpressionBinder",Ln),Bi("CrossFadedCompositeBinder",Rn),Bi("CompositeExpressionBinder",zn),Bi("ProgramConfiguration",Dn,{omit:["_buffers"]}),Bi("ProgramConfigurationSet",On);var jn=Math.pow(2,14)-1,Nn=-jn-1;function Un(t){for(var e=8192/t.extent,r=t.loadGeometry(),i=0;i<r.length;i++)for(var o=r[i],n=0;n<o.length;n++){var a=o[n],s=Math.round(a.x*e),l=Math.round(a.y*e);a.x=c(s,Nn,jn),a.y=c(l,Nn,jn),(s<a.x||s>a.x+1||l<a.y||l>a.y+1)&&C("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function Vn(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?Un(t):[]}}function qn(t,e,r,i,o){t.emplaceBack(2*e+(i+1)/2,2*r+(o+1)/2)}var $n=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Ao,this.indexArray=new Vo,this.segments=new pn,this.programConfigurations=new On(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Hn(t,e){for(var r=0;r<t.length;r++)if(ta(e,t[r]))return!0;for(var i=0;i<e.length;i++)if(ta(t,e[i]))return!0;return!!Xn(t,e)}function Zn(t,e,r){return!!ta(t,e)||!!Kn(e,t,r)}function Gn(t,e){if(1===t.length)return Yn(e,t[0]);for(var r=0;r<e.length;r++)for(var i=e[r],o=0;o<i.length;o++)if(ta(t,i[o]))return!0;for(var n=0;n<t.length;n++)if(Yn(e,t[n]))return!0;for(var a=0;a<e.length;a++)if(Xn(t,e[a]))return!0;return!1}function Qn(t,e,r){if(t.length>1){if(Xn(t,e))return!0;for(var i=0;i<e.length;i++)if(Kn(e[i],t,r))return!0}for(var o=0;o<t.length;o++)if(Kn(t[o],e,r))return!0;return!1}function Xn(t,e){if(0===t.length||0===e.length)return!1;for(var r=0;r<t.length-1;r++)for(var i=t[r],o=t[r+1],n=0;n<e.length-1;n++)if(Wn(i,o,e[n],e[n+1]))return!0;return!1}function Wn(t,e,r,i){return k(t,r,i)!==k(e,r,i)&&k(t,e,r)!==k(t,e,i)}function Kn(t,e,r){var i=r*r;if(1===e.length)return t.distSqr(e[0])<i;for(var o=1;o<e.length;o++)if(Jn(t,e[o-1],e[o])<i)return!0;return!1}function Jn(t,e,r){var i=e.distSqr(r);if(0===i)return t.distSqr(e);var o=((t.x-e.x)*(r.x-e.x)+(t.y-e.y)*(r.y-e.y))/i;return t.distSqr(o<0?e:o>1?r:r.sub(e)._mult(o)._add(e))}function Yn(t,e){for(var r,i,o,n=!1,a=0;a<t.length;a++)for(var s=0,l=(r=t[a]).length-1;s<r.length;l=s++)(i=r[s]).y>e.y!=(o=r[l]).y>e.y&&e.x<(o.x-i.x)*(e.y-i.y)/(o.y-i.y)+i.x&&(n=!n);return n}function ta(t,e){for(var r=!1,i=0,o=t.length-1;i<t.length;o=i++){var n=t[i],a=t[o];n.y>e.y!=a.y>e.y&&e.x<(a.x-n.x)*(e.y-n.y)/(a.y-n.y)+n.x&&(r=!r)}return r}function ea(t,e,r){var i=r[0],o=r[2];if(t.x<i.x&&e.x<i.x||t.x>o.x&&e.x>o.x||t.y<i.y&&e.y<i.y||t.y>o.y&&e.y>o.y)return!1;var n=k(t,e,r[0]);return n!==k(t,e,r[1])||n!==k(t,e,r[2])||n!==k(t,e,r[3])}function ra(t,e,r){var i=e.paint.get(t).value;return"constant"===i.kind?i.value:r.programConfigurations.get(e.id).getMaxValue(t)}function ia(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function oa(t,e,r,i,n){if(!e[0]&&!e[1])return t;var a=o.convert(e)._mult(n);"viewport"===r&&a._rotate(-i);for(var s=[],l=0;l<t.length;l++)s.push(t[l].sub(a));return s}$n.prototype.populate=function(t,e,r){var i=this.layers[0],o=[],n=null,a=!1;"circle"===i.type&&(a=!(n=i.layout.get("circle-sort-key")).isConstant());for(var s=0,l=t;s<l.length;s+=1){var p=l[s],c=p.feature,u=p.id,h=p.index,d=p.sourceLayerIndex,f=this.layers[0]._featureFilter.needGeometry,m=Vn(c,f);if(this.layers[0]._featureFilter.filter(new so(this.zoom),m,r)){var _=a?n.evaluate(m,{},r):void 0,y={id:u,properties:c.properties,type:c.type,sourceLayerIndex:d,index:h,geometry:f?m.geometry:Un(c),patterns:{},sortKey:_};o.push(y)}}a&&o.sort((function(t,e){return t.sortKey-e.sortKey}));for(var g=0,v=o;g<v.length;g+=1){var x=v[g],b=x.geometry,w=x.index,C=x.sourceLayerIndex,k=t[w].feature;this.addFeature(x,b,w,r),e.featureIndex.insert(k,b,w,C,this.index)}},$n.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},$n.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},$n.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},$n.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ln),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},$n.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},$n.prototype.addFeature=function(t,e,r,i){for(var o=0,n=e;o<n.length;o+=1)for(var a=0,s=n[o];a<s.length;a+=1){var l=s[a],p=l.x,c=l.y;if(!(p<0||p>=8192||c<0||c>=8192)){var u=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),h=u.vertexLength;qn(this.layoutVertexArray,p,c,-1,-1),qn(this.layoutVertexArray,p,c,1,-1),qn(this.layoutVertexArray,p,c,1,1),qn(this.layoutVertexArray,p,c,-1,1),this.indexArray.emplaceBack(h,h+1,h+2),this.indexArray.emplaceBack(h,h+3,h+2),u.vertexLength+=4,u.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{},i)},Bi("CircleBucket",$n,{omit:["layers"]});var na=new wo({"circle-sort-key":new go(It.layout_circle["circle-sort-key"])}),aa={paint:new wo({"circle-radius":new go(It.paint_circle["circle-radius"]),"circle-color":new go(It.paint_circle["circle-color"]),"circle-blur":new go(It.paint_circle["circle-blur"]),"circle-opacity":new go(It.paint_circle["circle-opacity"]),"circle-translate":new yo(It.paint_circle["circle-translate"]),"circle-translate-anchor":new yo(It.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new yo(It.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new yo(It.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new go(It.paint_circle["circle-stroke-width"]),"circle-stroke-color":new go(It.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new go(It.paint_circle["circle-stroke-opacity"])}),layout:na},sa="undefined"!=typeof Float32Array?Float32Array:Array;function la(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function pa(t,e,r){var i=e[0],o=e[1],n=e[2],a=e[3],s=e[4],l=e[5],p=e[6],c=e[7],u=e[8],h=e[9],d=e[10],f=e[11],m=e[12],_=e[13],y=e[14],g=e[15],v=r[0],x=r[1],b=r[2],w=r[3];return t[0]=v*i+x*s+b*u+w*m,t[1]=v*o+x*l+b*h+w*_,t[2]=v*n+x*p+b*d+w*y,t[3]=v*a+x*c+b*f+w*g,t[4]=(v=r[4])*i+(x=r[5])*s+(b=r[6])*u+(w=r[7])*m,t[5]=v*o+x*l+b*h+w*_,t[6]=v*n+x*p+b*d+w*y,t[7]=v*a+x*c+b*f+w*g,t[8]=(v=r[8])*i+(x=r[9])*s+(b=r[10])*u+(w=r[11])*m,t[9]=v*o+x*l+b*h+w*_,t[10]=v*n+x*p+b*d+w*y,t[11]=v*a+x*c+b*f+w*g,t[12]=(v=r[12])*i+(x=r[13])*s+(b=r[14])*u+(w=r[15])*m,t[13]=v*o+x*l+b*h+w*_,t[14]=v*n+x*p+b*d+w*y,t[15]=v*a+x*c+b*f+w*g,t}Math.hypot||(Math.hypot=function(){for(var t=arguments,e=0,r=arguments.length;r--;)e+=t[r]*t[r];return Math.sqrt(e)});var ca,ua=pa;function ha(t,e,r){var i=e[0],o=e[1],n=e[2],a=e[3];return t[0]=r[0]*i+r[4]*o+r[8]*n+r[12]*a,t[1]=r[1]*i+r[5]*o+r[9]*n+r[13]*a,t[2]=r[2]*i+r[6]*o+r[10]*n+r[14]*a,t[3]=r[3]*i+r[7]*o+r[11]*n+r[15]*a,t}ca=new sa(3),sa!=Float32Array&&(ca[0]=0,ca[1]=0,ca[2]=0),function(){var t=new sa(4);sa!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0)}();var da=(function(){var t=new sa(2);sa!=Float32Array&&(t[0]=0,t[1]=0)}(),function(t){function e(e){t.call(this,e,aa)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new $n(t)},e.prototype.queryRadius=function(t){var e=t;return ra("circle-radius",this,e)+ra("circle-stroke-width",this,e)+ia(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,i,o,n,a,s){for(var l=oa(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),n.angle,a),p=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),c="map"===this.paint.get("circle-pitch-alignment"),u=c?l:function(t,e){return t.map((function(t){return fa(t,e)}))}(l,s),h=c?p*a:p,d=0,f=i;d<f.length;d+=1)for(var m=0,_=f[d];m<_.length;m+=1){var y=_[m],g=c?y:fa(y,s),v=h,x=ha([],[y.x,y.y,0,1],s);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?v*=x[3]/n.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(v*=n.cameraToCenterDistance/x[3]),Zn(u,g,v))return!0}return!1},e}(Co));function fa(t,e){var r=ha([],[t.x,t.y,0,1],e);return new o(r[0]/r[3],r[1]/r[3])}var ma=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}($n);function _a(t,e,r,i){var o=e.width,n=e.height;if(i){if(i instanceof Uint8ClampedArray)i=new Uint8Array(i.buffer);else if(i.length!==o*n*r)throw new RangeError("mismatched image size")}else i=new Uint8Array(o*n*r);return t.width=o,t.height=n,t.data=i,t}function ya(t,e,r){var i=e.width,o=e.height;if(i!==t.width||o!==t.height){var n=_a({},{width:i,height:o},r);ga(t,n,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,i),height:Math.min(t.height,o)},r),t.width=i,t.height=o,t.data=n.data}}function ga(t,e,r,i,o,n){if(0===o.width||0===o.height)return e;if(o.width>t.width||o.height>t.height||r.x>t.width-o.width||r.y>t.height-o.height)throw new RangeError("out of range source coordinates for image copy");if(o.width>e.width||o.height>e.height||i.x>e.width-o.width||i.y>e.height-o.height)throw new RangeError("out of range destination coordinates for image copy");for(var a=t.data,s=e.data,l=0;l<o.height;l++)for(var p=((r.y+l)*t.width+r.x)*n,c=((i.y+l)*e.width+i.x)*n,u=0;u<o.width*n;u++)s[c+u]=a[p+u];return e}Bi("HeatmapBucket",ma,{omit:["layers"]});var va=function(t,e){_a(this,t,1,e)};va.prototype.resize=function(t){ya(this,t,1)},va.prototype.clone=function(){return new va({width:this.width,height:this.height},new Uint8Array(this.data))},va.copy=function(t,e,r,i,o){ga(t,e,r,i,o,1)};var xa=function(t,e){_a(this,t,4,e)};xa.prototype.resize=function(t){ya(this,t,4)},xa.prototype.replace=function(t,e){e?this.data.set(t):this.data=t instanceof Uint8ClampedArray?new Uint8Array(t.buffer):t},xa.prototype.clone=function(){return new xa({width:this.width,height:this.height},new Uint8Array(this.data))},xa.copy=function(t,e,r,i,o){ga(t,e,r,i,o,4)},Bi("AlphaImage",va),Bi("RGBAImage",xa);var ba={paint:new wo({"heatmap-radius":new go(It.paint_heatmap["heatmap-radius"]),"heatmap-weight":new go(It.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new yo(It.paint_heatmap["heatmap-intensity"]),"heatmap-color":new bo(It.paint_heatmap["heatmap-color"]),"heatmap-opacity":new yo(It.paint_heatmap["heatmap-opacity"])})};function wa(t){var e={},r=t.resolution||256,i=t.clips?t.clips.length:1,o=t.image||new xa({width:r,height:i}),n=function(r,i,n){e[t.evaluationKey]=n;var a=t.expression.evaluate(e);o.data[r+i+0]=Math.floor(255*a.r/a.a),o.data[r+i+1]=Math.floor(255*a.g/a.a),o.data[r+i+2]=Math.floor(255*a.b/a.a),o.data[r+i+3]=Math.floor(255*a.a)};if(t.clips)for(var a=0,s=0;a<i;++a,s+=4*r)for(var l=0,p=0;l<r;l++,p+=4){var c=l/(r-1),u=t.clips[a];n(s,p,u.start*(1-c)+u.end*c)}else for(var h=0,d=0;h<r;h++,d+=4)n(0,d,h/(r-1));return o}var Ca=function(t){function e(e){t.call(this,e,ba),this._updateColorRamp()}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new ma(t)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){"heatmap-color"===t&&this._updateColorRamp()},e.prototype._updateColorRamp=function(){this.colorRamp=wa({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null},e.prototype.resize=function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return!1},e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility},e}(Co),ka={paint:new wo({"hillshade-illumination-direction":new yo(It.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new yo(It.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new yo(It.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new yo(It.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new yo(It.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new yo(It.paint_hillshade["hillshade-accent-color"])})},Sa=function(t){function e(e){t.call(this,e,ka)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility},e}(Co),Ma=Eo([{name:"a_pos",components:2,type:"Int16"}],4).members,Ea=Aa,Ta=Aa;function Aa(t,e,r){r=r||2;var i,o,n,a,s,l,p,c=e&&e.length,u=c?e[0]*r:t.length,h=Ia(t,0,u,r,!0),d=[];if(!h||h.next===h.prev)return d;if(c&&(h=function(t,e,r,i){var o,n,a,s=[];for(o=0,n=e.length;o<n;o++)(a=Ia(t,e[o]*i,o<n-1?e[o+1]*i:t.length,i,!1))===a.next&&(a.steiner=!0),s.push(Ua(a));for(s.sort(Fa),o=0;o<s.length;o++)Ba(s[o],r),r=Pa(r,r.next);return r}(t,e,h,r)),t.length>80*r){i=n=t[0],o=a=t[1];for(var f=r;f<u;f+=r)(s=t[f])<i&&(i=s),(l=t[f+1])<o&&(o=l),s>n&&(n=s),l>a&&(a=l);p=0!==(p=Math.max(n-i,a-o))?1/p:0}return La(h,d,r,i,o,p),d}function Ia(t,e,r,i,o){var n,a;if(o===ts(t,e,r,i)>0)for(n=e;n<r;n+=i)a=Ka(n,t[n],t[n+1],a);else for(n=r-i;n>=e;n-=i)a=Ka(n,t[n],t[n+1],a);return a&&Ha(a,a.next)&&(Ja(a),a=a.next),a}function Pa(t,e){if(!t)return t;e||(e=t);var r,i=t;do{if(r=!1,i.steiner||!Ha(i,i.next)&&0!==$a(i.prev,i,i.next))i=i.next;else{if(Ja(i),(i=e=i.prev)===i.next)break;r=!0}}while(r||i!==e);return e}function La(t,e,r,i,o,n,a){if(t){!a&&n&&function(t,e,r,i){var o=t;do{null===o.z&&(o.z=Na(o.x,o.y,e,r,i)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next}while(o!==t);o.prevZ.nextZ=null,o.prevZ=null,function(t){var e,r,i,o,n,a,s,l,p=1;do{for(r=t,t=null,n=null,a=0;r;){for(a++,i=r,s=0,e=0;e<p&&(s++,i=i.nextZ);e++);for(l=p;s>0||l>0&&i;)0!==s&&(0===l||!i||r.z<=i.z)?(o=r,r=r.nextZ,s--):(o=i,i=i.nextZ,l--),n?n.nextZ=o:t=o,o.prevZ=n,n=o;r=i}n.nextZ=null,p*=2}while(a>1)}(o)}(t,i,o,n);for(var s,l,p=t;t.prev!==t.next;)if(s=t.prev,l=t.next,n?Ra(t,i,o,n):za(t))e.push(s.i/r),e.push(t.i/r),e.push(l.i/r),Ja(t),t=l.next,p=l.next;else if((t=l)===p){a?1===a?La(t=Da(Pa(t),e,r),e,r,i,o,n,2):2===a&&Oa(t,e,r,i,o,n):La(Pa(t),e,r,i,o,n,1);break}}}function za(t){var e=t.prev,r=t,i=t.next;if($a(e,r,i)>=0)return!1;for(var o=t.next.next;o!==t.prev;){if(Va(e.x,e.y,r.x,r.y,i.x,i.y,o.x,o.y)&&$a(o.prev,o,o.next)>=0)return!1;o=o.next}return!0}function Ra(t,e,r,i){var o=t.prev,n=t,a=t.next;if($a(o,n,a)>=0)return!1;for(var s=o.x>n.x?o.x>a.x?o.x:a.x:n.x>a.x?n.x:a.x,l=o.y>n.y?o.y>a.y?o.y:a.y:n.y>a.y?n.y:a.y,p=Na(o.x<n.x?o.x<a.x?o.x:a.x:n.x<a.x?n.x:a.x,o.y<n.y?o.y<a.y?o.y:a.y:n.y<a.y?n.y:a.y,e,r,i),c=Na(s,l,e,r,i),u=t.prevZ,h=t.nextZ;u&&u.z>=p&&h&&h.z<=c;){if(u!==t.prev&&u!==t.next&&Va(o.x,o.y,n.x,n.y,a.x,a.y,u.x,u.y)&&$a(u.prev,u,u.next)>=0)return!1;if(u=u.prevZ,h!==t.prev&&h!==t.next&&Va(o.x,o.y,n.x,n.y,a.x,a.y,h.x,h.y)&&$a(h.prev,h,h.next)>=0)return!1;h=h.nextZ}for(;u&&u.z>=p;){if(u!==t.prev&&u!==t.next&&Va(o.x,o.y,n.x,n.y,a.x,a.y,u.x,u.y)&&$a(u.prev,u,u.next)>=0)return!1;u=u.prevZ}for(;h&&h.z<=c;){if(h!==t.prev&&h!==t.next&&Va(o.x,o.y,n.x,n.y,a.x,a.y,h.x,h.y)&&$a(h.prev,h,h.next)>=0)return!1;h=h.nextZ}return!0}function Da(t,e,r){var i=t;do{var o=i.prev,n=i.next.next;!Ha(o,n)&&Za(o,i,i.next,n)&&Xa(o,n)&&Xa(n,o)&&(e.push(o.i/r),e.push(i.i/r),e.push(n.i/r),Ja(i),Ja(i.next),i=t=n),i=i.next}while(i!==t);return Pa(i)}function Oa(t,e,r,i,o,n){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&qa(a,s)){var l=Wa(a,s);return a=Pa(a,a.next),l=Pa(l,l.next),La(a,e,r,i,o,n),void La(l,e,r,i,o,n)}s=s.next}a=a.next}while(a!==t)}function Fa(t,e){return t.x-e.x}function Ba(t,e){if(e=function(t,e){var r,i=e,o=t.x,n=t.y,a=-1/0;do{if(n<=i.y&&n>=i.next.y&&i.next.y!==i.y){var s=i.x+(n-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=o&&s>a){if(a=s,s===o){if(n===i.y)return i;if(n===i.next.y)return i.next}r=i.x<i.next.x?i:i.next}}i=i.next}while(i!==e);if(!r)return null;if(o===a)return r;var l,p=r,c=r.x,u=r.y,h=1/0;i=r;do{o>=i.x&&i.x>=c&&o!==i.x&&Va(n<u?o:a,n,c,u,n<u?a:o,n,i.x,i.y)&&(l=Math.abs(n-i.y)/(o-i.x),Xa(i,t)&&(l<h||l===h&&(i.x>r.x||i.x===r.x&&ja(r,i)))&&(r=i,h=l)),i=i.next}while(i!==p);return r}(t,e)){var r=Wa(e,t);Pa(e,e.next),Pa(r,r.next)}}function ja(t,e){return $a(t.prev,t,e.prev)<0&&$a(e.next,t,t.next)<0}function Na(t,e,r,i,o){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*o)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*o)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Ua(t){var e=t,r=t;do{(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next}while(e!==t);return r}function Va(t,e,r,i,o,n,a,s){return(o-a)*(e-s)-(t-a)*(n-s)>=0&&(t-a)*(i-s)-(r-a)*(e-s)>=0&&(r-a)*(n-s)-(o-a)*(i-s)>=0}function qa(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&Za(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(Xa(t,e)&&Xa(e,t)&&function(t,e){var r=t,i=!1,o=(t.x+e.x)/2,n=(t.y+e.y)/2;do{r.y>n!=r.next.y>n&&r.next.y!==r.y&&o<(r.next.x-r.x)*(n-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next}while(r!==t);return i}(t,e)&&($a(t.prev,t,e.prev)||$a(t,e.prev,e))||Ha(t,e)&&$a(t.prev,t,t.next)>0&&$a(e.prev,e,e.next)>0)}function $a(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Ha(t,e){return t.x===e.x&&t.y===e.y}function Za(t,e,r,i){var o=Qa($a(t,e,r)),n=Qa($a(t,e,i)),a=Qa($a(r,i,t)),s=Qa($a(r,i,e));return o!==n&&a!==s||!(0!==o||!Ga(t,r,e))||!(0!==n||!Ga(t,i,e))||!(0!==a||!Ga(r,t,i))||!(0!==s||!Ga(r,e,i))}function Ga(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function Qa(t){return t>0?1:t<0?-1:0}function Xa(t,e){return $a(t.prev,t,t.next)<0?$a(t,e,t.next)>=0&&$a(t,t.prev,e)>=0:$a(t,e,t.prev)<0||$a(t,t.next,e)<0}function Wa(t,e){var r=new Ya(t.i,t.x,t.y),i=new Ya(e.i,e.x,e.y),o=t.next,n=e.prev;return t.next=e,e.prev=t,r.next=o,o.prev=r,i.next=r,r.prev=i,n.next=i,i.prev=n,i}function Ka(t,e,r,i){var o=new Ya(t,e,r);return i?(o.next=i.next,o.prev=i,i.next.prev=o,i.next=o):(o.prev=o,o.next=o),o}function Ja(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Ya(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function ts(t,e,r,i){for(var o=0,n=e,a=r-i;n<r;n+=i)o+=(t[a]-t[n])*(t[n+1]+t[a+1]),a=n;return o}function es(t,e,r,i,o){!function t(e,r,i,o,n){for(;o>i;){if(o-i>600){var a=o-i+1,s=r-i+1,l=Math.log(a),p=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*p*(a-p)/a)*(s-a/2<0?-1:1);t(e,r,Math.max(i,Math.floor(r-s*p/a+c)),Math.min(o,Math.floor(r+(a-s)*p/a+c)),n)}var u=e[r],h=i,d=o;for(rs(e,i,r),n(e[o],u)>0&&rs(e,i,o);h<d;){for(rs(e,h,d),h++,d--;n(e[h],u)<0;)h++;for(;n(e[d],u)>0;)d--}0===n(e[i],u)?rs(e,i,d):rs(e,++d,o),d<=r&&(i=d+1),r<=d&&(o=d-1)}}(t,e,r||0,i||t.length-1,o||is)}function rs(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function is(t,e){return t<e?-1:t>e?1:0}function os(t,e){var r=t.length;if(r<=1)return[t];for(var i,o,n=[],a=0;a<r;a++){var s=S(t[a]);0!==s&&(t[a].area=Math.abs(s),void 0===o&&(o=s<0),o===s<0?(i&&n.push(i),i=[t[a]]):i.push(t[a]))}if(i&&n.push(i),e>1)for(var l=0;l<n.length;l++)n[l].length<=e||(es(n[l],e,1,n[l].length-1,ns),n[l]=n[l].slice(0,e));return n}function ns(t,e){return e.area-t.area}function as(t,e,r){for(var i=r.patternDependencies,o=!1,n=0,a=e;n<a.length;n+=1){var s=a[n].paint.get(t+"-pattern");s.isConstant()||(o=!0);var l=s.constantOr(null);l&&(o=!0,i[l.to]=!0,i[l.from]=!0)}return o}function ss(t,e,r,i,o){for(var n=o.patternDependencies,a=0,s=e;a<s.length;a+=1){var l=s[a],p=l.paint.get(t+"-pattern").value;if("constant"!==p.kind){var c=p.evaluate({zoom:i-1},r,{},o.availableImages),u=p.evaluate({zoom:i},r,{},o.availableImages),h=p.evaluate({zoom:i+1},r,{},o.availableImages);u=u&&u.name?u.name:u,h=h&&h.name?h.name:h,n[c=c&&c.name?c.name:c]=!0,n[u]=!0,n[h]=!0,r.patterns[l.id]={min:c,mid:u,max:h}}}return r}Aa.deviation=function(t,e,r,i){var o=e&&e.length,n=Math.abs(ts(t,0,o?e[0]*r:t.length,r));if(o)for(var a=0,s=e.length;a<s;a++)n-=Math.abs(ts(t,e[a]*r,a<s-1?e[a+1]*r:t.length,r));var l=0;for(a=0;a<i.length;a+=3){var p=i[a]*r,c=i[a+1]*r,u=i[a+2]*r;l+=Math.abs((t[p]-t[u])*(t[c+1]-t[p+1])-(t[p]-t[c])*(t[u+1]-t[p+1]))}return 0===n&&0===l?0:Math.abs((l-n)/n)},Aa.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},i=0,o=0;o<t.length;o++){for(var n=0;n<t[o].length;n++)for(var a=0;a<e;a++)r.vertices.push(t[o][n][a]);o>0&&r.holes.push(i+=t[o-1].length)}return r},Ea.default=Ta;var ls=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Ao,this.indexArray=new Vo,this.indexArray2=new Qo,this.programConfigurations=new On(t.layers,t.zoom),this.segments=new pn,this.segments2=new pn,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};ls.prototype.populate=function(t,e,r){this.hasPattern=as("fill",this.layers,e);for(var i=this.layers[0].layout.get("fill-sort-key"),o=!i.isConstant(),n=[],a=0,s=t;a<s.length;a+=1){var l=s[a],p=l.feature,c=l.id,u=l.index,h=l.sourceLayerIndex,d=this.layers[0]._featureFilter.needGeometry,f=Vn(p,d);if(this.layers[0]._featureFilter.filter(new so(this.zoom),f,r)){var m=o?i.evaluate(f,{},r,e.availableImages):void 0,_={id:c,properties:p.properties,type:p.type,sourceLayerIndex:h,index:u,geometry:d?f.geometry:Un(p),patterns:{},sortKey:m};n.push(_)}}o&&n.sort((function(t,e){return t.sortKey-e.sortKey}));for(var y=0,g=n;y<g.length;y+=1){var v=g[y],x=v.geometry,b=v.index,w=v.sourceLayerIndex;if(this.hasPattern){var C=ss("fill",this.layers,v,this.zoom,e);this.patternFeatures.push(C)}else this.addFeature(v,x,b,r,{});e.featureIndex.insert(t[b].feature,x,b,w,this.index)}},ls.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},ls.prototype.addFeatures=function(t,e,r){for(var i=0,o=this.patternFeatures;i<o.length;i+=1){var n=o[i];this.addFeature(n,n.geometry,n.index,e,r)}},ls.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},ls.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},ls.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ma),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0},ls.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},ls.prototype.addFeature=function(t,e,r,i,o){for(var n=0,a=os(e,500);n<a.length;n+=1){for(var s=a[n],l=0,p=0,c=s;p<c.length;p+=1)l+=c[p].length;for(var u=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray),h=u.vertexLength,d=[],f=[],m=0,_=s;m<_.length;m+=1){var y=_[m];if(0!==y.length){y!==s[0]&&f.push(d.length/2);var g=this.segments2.prepareSegment(y.length,this.layoutVertexArray,this.indexArray2),v=g.vertexLength;this.layoutVertexArray.emplaceBack(y[0].x,y[0].y),this.indexArray2.emplaceBack(v+y.length-1,v),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(v+x-1,v+x),d.push(y[x].x),d.push(y[x].y);g.vertexLength+=y.length,g.primitiveLength+=y.length}}for(var b=Ea(d,f),w=0;w<b.length;w+=3)this.indexArray.emplaceBack(h+b[w],h+b[w+1],h+b[w+2]);u.vertexLength+=l,u.primitiveLength+=b.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,o,i)},Bi("FillBucket",ls,{omit:["layers","patternFeatures"]});var ps=new wo({"fill-sort-key":new go(It.layout_fill["fill-sort-key"])}),cs={paint:new wo({"fill-antialias":new yo(It.paint_fill["fill-antialias"]),"fill-opacity":new go(It.paint_fill["fill-opacity"]),"fill-color":new go(It.paint_fill["fill-color"]),"fill-outline-color":new go(It.paint_fill["fill-outline-color"]),"fill-translate":new yo(It.paint_fill["fill-translate"]),"fill-translate-anchor":new yo(It.paint_fill["fill-translate-anchor"]),"fill-pattern":new vo(It.paint_fill["fill-pattern"])}),layout:ps},us=function(t){function e(e){t.call(this,e,cs)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r);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"])},e.prototype.createBucket=function(t){return new ls(t)},e.prototype.queryRadius=function(){return ia(this.paint.get("fill-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,i,o,n,a){return Gn(oa(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),n.angle,a),i)},e.prototype.isTileClipped=function(){return!0},e}(Co),hs=Eo([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,ds=fs;function fs(t,e,r,i,o){this.properties={},this.extent=r,this.type=0,this._pbf=t,this._geometry=-1,this._keys=i,this._values=o,t.readFields(ms,this,e)}function ms(t,e,r){1==t?e.id=r.readVarint():2==t?function(t,e){for(var r=t.readVarint()+t.pos;t.pos<r;){var i=e._keys[t.readVarint()],o=e._values[t.readVarint()];e.properties[i]=o}}(r,e):3==t?e.type=r.readVarint():4==t&&(e._geometry=r.pos)}function _s(t){for(var e,r,i=0,o=0,n=t.length,a=n-1;o<n;a=o++)i+=((r=t[a]).x-(e=t[o]).x)*(e.y+r.y);return i}fs.types=["Unknown","Point","LineString","Polygon"],fs.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,r=t.readVarint()+t.pos,i=1,n=0,a=0,s=0,l=[];t.pos<r;){if(n<=0){var p=t.readVarint();i=7&p,n=p>>3}if(n--,1===i||2===i)a+=t.readSVarint(),s+=t.readSVarint(),1===i&&(e&&l.push(e),e=[]),e.push(new o(a,s));else{if(7!==i)throw new Error("unknown command "+i);e&&e.push(e[0].clone())}}return e&&l.push(e),l},fs.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,i=0,o=0,n=0,a=1/0,s=-1/0,l=1/0,p=-1/0;t.pos<e;){if(i<=0){var c=t.readVarint();r=7&c,i=c>>3}if(i--,1===r||2===r)(o+=t.readSVarint())<a&&(a=o),o>s&&(s=o),(n+=t.readSVarint())<l&&(l=n),n>p&&(p=n);else if(7!==r)throw new Error("unknown command "+r)}return[a,l,s,p]},fs.prototype.toGeoJSON=function(t,e,r){var i,o,n=this.extent*Math.pow(2,r),a=this.extent*t,s=this.extent*e,l=this.loadGeometry(),p=fs.types[this.type];function c(t){for(var e=0;e<t.length;e++){var r=t[e];t[e]=[360*(r.x+a)/n-180,360/Math.PI*Math.atan(Math.exp((180-360*(r.y+s)/n)*Math.PI/180))-90]}}switch(this.type){case 1:var u=[];for(i=0;i<l.length;i++)u[i]=l[i][0];c(l=u);break;case 2:for(i=0;i<l.length;i++)c(l[i]);break;case 3:for(l=function(t){var e=t.length;if(e<=1)return[t];for(var r,i,o=[],n=0;n<e;n++){var a=_s(t[n]);0!==a&&(void 0===i&&(i=a<0),i===a<0?(r&&o.push(r),r=[t[n]]):r.push(t[n]))}return r&&o.push(r),o}(l),i=0;i<l.length;i++)for(o=0;o<l[i].length;o++)c(l[i][o])}1===l.length?l=l[0]:p="Multi"+p;var h={type:"Feature",geometry:{type:p,coordinates:l},properties:this.properties};return"id"in this&&(h.id=this.id),h};var ys=gs;function gs(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(vs,this,e),this.length=this._features.length}function vs(t,e,r){15===t?e.version=r.readVarint():1===t?e.name=r.readString():5===t?e.extent=r.readVarint():2===t?e._features.push(r.pos):3===t?e._keys.push(r.readString()):4===t&&e._values.push(function(t){for(var e=null,r=t.readVarint()+t.pos;t.pos<r;){var i=t.readVarint()>>3;e=1===i?t.readString():2===i?t.readFloat():3===i?t.readDouble():4===i?t.readVarint64():5===i?t.readVarint():6===i?t.readSVarint():7===i?t.readBoolean():null}return e}(r))}function xs(t,e,r){if(3===t){var i=new ys(r,r.readVarint()+r.pos);i.length&&(e[i.name]=i)}}gs.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new ds(this._pbf,e,this.extent,this._keys,this._values)};var bs={VectorTile:function(t,e){this.layers=t.readFields(xs,{},e)},VectorTileFeature:ds,VectorTileLayer:ys},ws=bs.VectorTileFeature.types,Cs=Math.pow(2,13);function ks(t,e,r,i,o,n,a,s){t.emplaceBack(e,r,2*Math.floor(i*Cs)+a,o*Cs*2,n*Cs*2,Math.round(s))}var Ss=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Po,this.indexArray=new Vo,this.programConfigurations=new On(t.layers,t.zoom),this.segments=new pn,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Ms(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}Ss.prototype.populate=function(t,e,r){this.features=[],this.hasPattern=as("fill-extrusion",this.layers,e);for(var i=0,o=t;i<o.length;i+=1){var n=o[i],a=n.feature,s=n.id,l=n.index,p=n.sourceLayerIndex,c=this.layers[0]._featureFilter.needGeometry,u=Vn(a,c);if(this.layers[0]._featureFilter.filter(new so(this.zoom),u,r)){var h={id:s,sourceLayerIndex:p,index:l,geometry:c?u.geometry:Un(a),properties:a.properties,type:a.type,patterns:{}};this.hasPattern?this.features.push(ss("fill-extrusion",this.layers,h,this.zoom,e)):this.addFeature(h,h.geometry,l,r,{}),e.featureIndex.insert(a,h.geometry,l,p,this.index,!0)}}},Ss.prototype.addFeatures=function(t,e,r){for(var i=0,o=this.features;i<o.length;i+=1){var n=o[i];this.addFeature(n,n.geometry,n.index,e,r)}},Ss.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},Ss.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Ss.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Ss.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,hs),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},Ss.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Ss.prototype.addFeature=function(t,e,r,i,o){for(var n=0,a=os(e,500);n<a.length;n+=1){for(var s=a[n],l=0,p=0,c=s;p<c.length;p+=1)l+=c[p].length;for(var u=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),h=0,d=s;h<d.length;h+=1){var f=d[h];if(0!==f.length&&!((L=f).every((function(t){return t.x<0}))||L.every((function(t){return t.x>8192}))||L.every((function(t){return t.y<0}))||L.every((function(t){return t.y>8192}))))for(var m=0,_=0;_<f.length;_++){var y=f[_];if(_>=1){var g=f[_-1];if(!Ms(y,g)){u.vertexLength+4>pn.MAX_VERTEX_ARRAY_LENGTH&&(u=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var v=y.sub(g)._perp()._unit(),x=g.dist(y);m+x>32768&&(m=0),ks(this.layoutVertexArray,y.x,y.y,v.x,v.y,0,0,m),ks(this.layoutVertexArray,y.x,y.y,v.x,v.y,0,1,m),ks(this.layoutVertexArray,g.x,g.y,v.x,v.y,0,0,m+=x),ks(this.layoutVertexArray,g.x,g.y,v.x,v.y,0,1,m);var b=u.vertexLength;this.indexArray.emplaceBack(b,b+2,b+1),this.indexArray.emplaceBack(b+1,b+2,b+3),u.vertexLength+=4,u.primitiveLength+=2}}}}if(u.vertexLength+l>pn.MAX_VERTEX_ARRAY_LENGTH&&(u=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray)),"Polygon"===ws[t.type]){for(var w=[],C=[],k=u.vertexLength,S=0,M=s;S<M.length;S+=1){var E=M[S];if(0!==E.length){E!==s[0]&&C.push(w.length/2);for(var T=0;T<E.length;T++){var A=E[T];ks(this.layoutVertexArray,A.x,A.y,0,0,1,1,0),w.push(A.x),w.push(A.y)}}}for(var I=Ea(w,C),P=0;P<I.length;P+=3)this.indexArray.emplaceBack(k+I[P],k+I[P+2],k+I[P+1]);u.primitiveLength+=I.length/3,u.vertexLength+=l}}var L;this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,o,i)},Bi("FillExtrusionBucket",Ss,{omit:["layers","features"]});var Es={paint:new wo({"fill-extrusion-opacity":new yo(It["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new go(It["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new yo(It["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new yo(It["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new vo(It["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new go(It["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new go(It["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new yo(It["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})},Ts=function(t){function e(e){t.call(this,e,Es)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new Ss(t)},e.prototype.queryRadius=function(){return ia(this.paint.get("fill-extrusion-translate"))},e.prototype.is3D=function(){return!0},e.prototype.queryIntersectsFeature=function(t,e,r,i,n,a,s,l){var p=oa(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),a.angle,s),c=this.paint.get("fill-extrusion-height").evaluate(e,r),u=this.paint.get("fill-extrusion-base").evaluate(e,r),h=function(t,e,r,i){for(var n=[],a=0,s=t;a<s.length;a+=1){var l=s[a],p=[l.x,l.y,0,1];ha(p,p,e),n.push(new o(p[0]/p[3],p[1]/p[3]))}return n}(p,l),d=function(t,e,r,i){for(var n=[],a=[],s=i[8]*e,l=i[9]*e,p=i[10]*e,c=i[11]*e,u=i[8]*r,h=i[9]*r,d=i[10]*r,f=i[11]*r,m=0,_=t;m<_.length;m+=1){for(var y=[],g=[],v=0,x=_[m];v<x.length;v+=1){var b=x[v],w=b.x,C=b.y,k=i[0]*w+i[4]*C+i[12],S=i[1]*w+i[5]*C+i[13],M=i[2]*w+i[6]*C+i[14],E=i[3]*w+i[7]*C+i[15],T=M+p,A=E+c,I=k+u,P=S+h,L=M+d,z=E+f,R=new o((k+s)/A,(S+l)/A);R.z=T/A,y.push(R);var D=new o(I/z,P/z);D.z=L/z,g.push(D)}n.push(y),a.push(g)}return[n,a]}(i,u,c,l);return function(t,e,r){var i=1/0;Gn(r,e)&&(i=Is(r,e[0]));for(var o=0;o<e.length;o++)for(var n=e[o],a=t[o],s=0;s<n.length-1;s++){var l=n[s],p=[l,n[s+1],a[s+1],a[s],l];Hn(r,p)&&(i=Math.min(i,Is(r,p)))}return i!==1/0&&i}(d[0],d[1],h)},e}(Co);function As(t,e){return t.x*e.x+t.y*e.y}function Is(t,e){if(1===t.length){for(var r,i=0,o=e[i++];!r||o.equals(r);)if(!(r=e[i++]))return 1/0;for(;i<e.length;i++){var n=e[i],a=t[0],s=r.sub(o),l=n.sub(o),p=a.sub(o),c=As(s,s),u=As(s,l),h=As(l,l),d=As(p,s),f=As(p,l),m=c*h-u*u,_=(h*d-u*f)/m,y=(c*f-u*d)/m,g=o.z*(1-_-y)+r.z*_+n.z*y;if(isFinite(g))return g}return 1/0}for(var v=1/0,x=0,b=e;x<b.length;x+=1)v=Math.min(v,b[x].z);return v}var Ps=Eo([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,Ls=Eo([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]).members,zs=bs.VectorTileFeature.types,Rs=Math.cos(Math.PI/180*37.5),Ds=Math.pow(2,14)/.5,Os=function(t){var e=this;this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((function(t){e.gradients[t.id]={}})),this.layoutVertexArray=new Lo,this.layoutVertexArray2=new zo,this.indexArray=new Vo,this.programConfigurations=new On(t.layers,t.zoom),this.segments=new pn,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};Os.prototype.populate=function(t,e,r){this.hasPattern=as("line",this.layers,e);for(var i=this.layers[0].layout.get("line-sort-key"),o=!i.isConstant(),n=[],a=0,s=t;a<s.length;a+=1){var l=s[a],p=l.feature,c=l.id,u=l.index,h=l.sourceLayerIndex,d=this.layers[0]._featureFilter.needGeometry,f=Vn(p,d);if(this.layers[0]._featureFilter.filter(new so(this.zoom),f,r)){var m=o?i.evaluate(f,{},r):void 0,_={id:c,properties:p.properties,type:p.type,sourceLayerIndex:h,index:u,geometry:d?f.geometry:Un(p),patterns:{},sortKey:m};n.push(_)}}o&&n.sort((function(t,e){return t.sortKey-e.sortKey}));for(var y=0,g=n;y<g.length;y+=1){var v=g[y],x=v.geometry,b=v.index,w=v.sourceLayerIndex;if(this.hasPattern){var C=ss("line",this.layers,v,this.zoom,e);this.patternFeatures.push(C)}else this.addFeature(v,x,b,r,{});e.featureIndex.insert(t[b].feature,x,b,w,this.index)}},Os.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},Os.prototype.addFeatures=function(t,e,r){for(var i=0,o=this.patternFeatures;i<o.length;i+=1){var n=o[i];this.addFeature(n,n.geometry,n.index,e,r)}},Os.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Os.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Os.prototype.upload=function(t){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,Ls)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ps),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},Os.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Os.prototype.lineFeatureClips=function(t){if(t.properties&&t.properties.hasOwnProperty("mapbox_clip_start")&&t.properties.hasOwnProperty("mapbox_clip_end"))return{start:+t.properties.mapbox_clip_start,end:+t.properties.mapbox_clip_end}},Os.prototype.addFeature=function(t,e,r,i,o){var n=this.layers[0].layout,a=n.get("line-join").evaluate(t,{}),s=n.get("line-cap"),l=n.get("line-miter-limit"),p=n.get("line-round-limit");this.lineClips=this.lineFeatureClips(t);for(var c=0,u=e;c<u.length;c+=1)this.addLine(u[c],t,a,s,l,p);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,o,i)},Os.prototype.addLine=function(t,e,r,i,o,n){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(var a=0;a<t.length-1;a++)this.totalDistance+=t[a].dist(t[a+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}for(var s="Polygon"===zs[e.type],l=t.length;l>=2&&t[l-1].equals(t[l-2]);)l--;for(var p=0;p<l-1&&t[p].equals(t[p+1]);)p++;if(!(l<(s?3:2))){"bevel"===r&&(o=1.05);var c,u=this.overscaling<=16?122880/(512*this.overscaling):0,h=this.segments.prepareSegment(10*l,this.layoutVertexArray,this.indexArray),d=void 0,f=void 0,m=void 0,_=void 0;this.e1=this.e2=-1,s&&(_=t[p].sub(c=t[l-2])._unit()._perp());for(var y=p;y<l;y++)if(!(f=y===l-1?s?t[p+1]:void 0:t[y+1])||!t[y].equals(f)){_&&(m=_),c&&(d=c),c=t[y],_=f?f.sub(c)._unit()._perp():m;var g=(m=m||_).add(_);0===g.x&&0===g.y||g._unit();var v=m.x*_.x+m.y*_.y,x=g.x*_.x+g.y*_.y,b=0!==x?1/x:1/0,w=2*Math.sqrt(2-2*x),C=x<Rs&&d&&f,k=m.x*_.y-m.y*_.x>0;if(C&&y>p){var S=c.dist(d);if(S>2*u){var M=c.sub(c.sub(d)._mult(u/S)._round());this.updateDistance(d,M),this.addCurrentVertex(M,m,0,0,h),d=M}}var E=d&&f,T=E?r:s?"butt":i;if(E&&"round"===T&&(b<n?T="miter":b<=2&&(T="fakeround")),"miter"===T&&b>o&&(T="bevel"),"bevel"===T&&(b>2&&(T="flipbevel"),b<o&&(T="miter")),d&&this.updateDistance(d,c),"miter"===T)g._mult(b),this.addCurrentVertex(c,g,0,0,h);else if("flipbevel"===T){if(b>100)g=_.mult(-1);else{var A=b*m.add(_).mag()/m.sub(_).mag();g._perp()._mult(A*(k?-1:1))}this.addCurrentVertex(c,g,0,0,h),this.addCurrentVertex(c,g.mult(-1),0,0,h)}else if("bevel"===T||"fakeround"===T){var I=-Math.sqrt(b*b-1),P=k?I:0,L=k?0:I;if(d&&this.addCurrentVertex(c,m,P,L,h),"fakeround"===T)for(var z=Math.round(180*w/Math.PI/20),R=1;R<z;R++){var D=R/z;if(.5!==D){var O=D-.5;D+=D*O*(D-1)*((1.0904+v*(v*(3.55645-1.43519*v)-3.2452))*O*O+(.848013+v*(.215638*v-1.06021)))}var F=_.sub(m)._mult(D)._add(m)._unit()._mult(k?-1:1);this.addHalfVertex(c,F.x,F.y,!1,k,0,h)}f&&this.addCurrentVertex(c,_,-P,-L,h)}else if("butt"===T)this.addCurrentVertex(c,g,0,0,h);else if("square"===T){var B=d?1:-1;this.addCurrentVertex(c,g,B,B,h)}else"round"===T&&(d&&(this.addCurrentVertex(c,m,0,0,h),this.addCurrentVertex(c,m,1,1,h,!0)),f&&(this.addCurrentVertex(c,_,-1,-1,h,!0),this.addCurrentVertex(c,_,0,0,h)));if(C&&y<l-1){var j=c.dist(f);if(j>2*u){var N=c.add(f.sub(c)._mult(u/j)._round());this.updateDistance(c,N),this.addCurrentVertex(N,_,0,0,h),c=N}}}}},Os.prototype.addCurrentVertex=function(t,e,r,i,o,n){void 0===n&&(n=!1);var a=e.y*i-e.x,s=-e.y-e.x*i;this.addHalfVertex(t,e.x+e.y*r,e.y-e.x*r,n,!1,r,o),this.addHalfVertex(t,a,s,n,!0,-i,o),this.distance>Ds/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,r,i,o,n))},Os.prototype.addHalfVertex=function(t,e,r,i,o,n,a){var s=.5*(this.lineClips?this.scaledDistance*(Ds-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((t.x<<1)+(i?1:0),(t.y<<1)+(o?1:0),Math.round(63*e)+128,Math.round(63*r)+128,1+(0===n?0:n<0?-1:1)|(63&s)<<2,s>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);var l=a.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,l),a.primitiveLength++),o?this.e2=l:this.e1=l},Os.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},Os.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.updateScaledDistance()},Bi("LineBucket",Os,{omit:["layers","patternFeatures"]});var Fs=new wo({"line-cap":new yo(It.layout_line["line-cap"]),"line-join":new go(It.layout_line["line-join"]),"line-miter-limit":new yo(It.layout_line["line-miter-limit"]),"line-round-limit":new yo(It.layout_line["line-round-limit"]),"line-sort-key":new go(It.layout_line["line-sort-key"])}),Bs={paint:new wo({"line-opacity":new go(It.paint_line["line-opacity"]),"line-color":new go(It.paint_line["line-color"]),"line-translate":new yo(It.paint_line["line-translate"]),"line-translate-anchor":new yo(It.paint_line["line-translate-anchor"]),"line-width":new go(It.paint_line["line-width"]),"line-gap-width":new go(It.paint_line["line-gap-width"]),"line-offset":new go(It.paint_line["line-offset"]),"line-blur":new go(It.paint_line["line-blur"]),"line-dasharray":new xo(It.paint_line["line-dasharray"]),"line-pattern":new vo(It.paint_line["line-pattern"]),"line-gradient":new bo(It.paint_line["line-gradient"])}),layout:Fs},js=new(function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.possiblyEvaluate=function(e,r){return r=new so(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),t.prototype.possiblyEvaluate.call(this,e,r)},e.prototype.evaluate=function(e,r,i,o){return r=h({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,i,o)},e}(go))(Bs.paint.properties["line-width"].specification);js.useIntegerZoom=!0;var Ns=function(t){function e(e){t.call(this,e,Bs),this.gradientVersion=0}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof $e,this.gradientVersion=(this.gradientVersion+1)%s)},e.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r),this.paint._values["line-floorwidth"]=js.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new Os(t)},e.prototype.queryRadius=function(t){var e=t,r=Us(ra("line-width",this,e),ra("line-gap-width",this,e)),i=ra("line-offset",this,e);return r/2+Math.abs(i)+ia(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,i,n,a,s){var l=oa(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,s),p=s/2*Us(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),c=this.paint.get("line-offset").evaluate(e,r);return c&&(i=function(t,e){for(var r=[],i=new o(0,0),n=0;n<t.length;n++){for(var a=t[n],s=[],l=0;l<a.length;l++){var p=a[l],c=a[l+1],u=0===l?i:p.sub(a[l-1])._unit()._perp(),h=l===a.length-1?i:c.sub(p)._unit()._perp(),d=u._add(h)._unit();d._mult(1/(d.x*h.x+d.y*h.y)),s.push(d._mult(e)._add(p))}r.push(s)}return r}(i,c*s)),function(t,e,r){for(var i=0;i<e.length;i++){var o=e[i];if(t.length>=3)for(var n=0;n<o.length;n++)if(ta(t,o[n]))return!0;if(Qn(t,o,r))return!0}return!1}(l,i,p)},e.prototype.isTileClipped=function(){return!0},e}(Co);function Us(t,e){return e>0?e+2*t:t}var Vs=Eo([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),qs=Eo([{name:"a_projected_pos",components:3,type:"Float32"}],4),$s=(Eo([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Eo([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Hs=(Eo([{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"}]),Eo([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),Zs=Eo([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Gs(t,e,r){return t.sections.forEach((function(t){t.text=function(t,e,r){var i=e.layout.get("text-transform").evaluate(r,{});return"uppercase"===i?t=t.toLocaleUpperCase():"lowercase"===i&&(t=t.toLocaleLowerCase()),ao.applyArabicShaping&&(t=ao.applyArabicShaping(t)),t}(t.text,e,r)})),t}Eo([{name:"triangle",components:3,type:"Uint16"}]),Eo([{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"}]),Eo([{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"}]),Eo([{type:"Float32",name:"offsetX"}]),Eo([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Qs={"!":"ï¸","#":"ï¼",$:"ï¼","%":"ï¼
","&":"ï¼","(":"︵",")":"︶","*":"ï¼","+":"ï¼",",":"ï¸","-":"︲",".":"ã»","/":"ï¼",":":"ï¸",";":"ï¸","<":"︿","=":"ï¼",">":"ï¹","?":"ï¸","@":"ï¼ ","[":"ï¹","\\":"ï¼¼","]":"ï¹","^":"ï¼¾",_:"︳","`":"ï½","{":"︷","|":"â","}":"︸","~":"ï½","¢":"ï¿ ","£":"ï¿¡","Â¥":"ï¿¥","¦":"¦","¬":"ï¿¢","¯":"ï¿£","â":"︲","â":"︱","â":"ï¹","â":"ï¹","â":"ï¹","â":"ï¹","â¦":"ï¸","â§":"ã»","â©":"₩","ã":"ï¸","ã":"ï¸","ã":"︿","ã":"ï¹","ã":"︽","ã":"︾","ã":"ï¹","ã":"ï¹","ã":"ï¹","ã":"ï¹","ã":"︻","ã":"︼","ã":"︹","ã":"︺","ã":"ï¸","ã":"ï¸","ï¼":"ï¸","ï¼":"︵","ï¼":"︶","ï¼":"ï¸","ï¼":"︲","ï¼":"ã»","ï¼":"ï¸","ï¼":"ï¸","ï¼":"︿","ï¼":"ï¹","ï¼":"ï¸","ï¼»":"ï¹","ï¼½":"ï¹","_":"︳","ï½":"︷","ï½":"â","ï½":"︸","ï½":"︵","ï½ ":"︶","。":"ï¸","ï½¢":"ï¹","ï½£":"ï¹"},Xs=function(t,e,r,i,o){var n,a,s=8*o-i-1,l=(1<<s)-1,p=l>>1,c=-7,u=r?o-1:0,h=r?-1:1,d=t[e+u];for(u+=h,n=d&(1<<-c)-1,d>>=-c,c+=s;c>0;n=256*n+t[e+u],u+=h,c-=8);for(a=n&(1<<-c)-1,n>>=-c,c+=i;c>0;a=256*a+t[e+u],u+=h,c-=8);if(0===n)n=1-p;else{if(n===l)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,i),n-=p}return(d?-1:1)*a*Math.pow(2,n-i)},Ws=function(t,e,r,i,o,n){var a,s,l,p=8*n-o-1,c=(1<<p)-1,u=c>>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:n-1,f=i?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),(e+=a+u>=1?h/l:h*Math.pow(2,1-u))*l>=2&&(a++,l/=2),a+u>=c?(s=0,a=c):a+u>=1?(s=(e*l-1)*Math.pow(2,o),a+=u):(s=e*Math.pow(2,u-1)*Math.pow(2,o),a=0));o>=8;t[r+d]=255&s,d+=f,s/=256,o-=8);for(a=a<<o|s,p+=o;p>0;t[r+d]=255&a,d+=f,a/=256,p-=8);t[r+d-f]|=128*m},Ks=Js;function Js(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Js.Varint=0,Js.Fixed64=1,Js.Bytes=2,Js.Fixed32=5;var Ys="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function tl(t){return t.type===Js.Bytes?t.readVarint()+t.pos:t.pos+1}function el(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function rl(t,e,r){var i=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(i);for(var o=r.pos-1;o>=t;o--)r.buf[o+i]=r.buf[o]}function il(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function ol(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function nl(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function al(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function sl(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function ll(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function pl(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function cl(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function ul(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}function hl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function dl(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function fl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function ml(t,e,r){1===t&&r.readMessage(_l,e)}function _l(t,e,r){if(3===t){var i=r.readMessage(yl,{}),o=i.width,n=i.height,a=i.left,s=i.top,l=i.advance;e.push({id:i.id,bitmap:new va({width:o+6,height:n+6},i.bitmap),metrics:{width:o,height:n,left:a,top:s,advance:l}})}}function yl(t,e,r){1===t?e.id=r.readVarint():2===t?e.bitmap=r.readBytes():3===t?e.width=r.readVarint():4===t?e.height=r.readVarint():5===t?e.left=r.readSVarint():6===t?e.top=r.readSVarint():7===t&&(e.advance=r.readVarint())}function gl(t){for(var e=0,r=0,i=0,o=t;i<o.length;i+=1){var n=o[i];e+=n.w*n.h,r=Math.max(r,n.w)}t.sort((function(t,e){return e.h-t.h}));for(var a=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}],s=0,l=0,p=0,c=t;p<c.length;p+=1)for(var u=c[p],h=a.length-1;h>=0;h--){var d=a[h];if(!(u.w>d.w||u.h>d.h)){if(u.x=d.x,u.y=d.y,l=Math.max(l,u.y+u.h),s=Math.max(s,u.x+u.w),u.w===d.w&&u.h===d.h){var f=a.pop();h<a.length&&(a[h]=f)}else u.h===d.h?(d.x+=u.w,d.w-=u.w):u.w===d.w?(d.y+=u.h,d.h-=u.h):(a.push({x:d.x+u.w,y:d.y,w:d.w-u.w,h:u.h}),d.y+=u.h,d.h-=u.h);break}}return{w:s,h:l,fill:e/(s*l)||0}}Js.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var i=this.readVarint(),o=i>>3,n=this.pos;this.type=7&i,t(o,e,this),this.pos===n&&this.skip(i)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=hl(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=fl(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=hl(this.buf,this.pos)+4294967296*hl(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=hl(this.buf,this.pos)+4294967296*fl(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=Xs(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Xs(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,i=this.buf;return e=127&(r=i[this.pos++]),r<128?e:(e|=(127&(r=i[this.pos++]))<<7,r<128?e:(e|=(127&(r=i[this.pos++]))<<14,r<128?e:(e|=(127&(r=i[this.pos++]))<<21,r<128?e:function(t,e,r){var i,o,n=r.buf;if(i=(112&(o=n[r.pos++]))>>4,o<128)return el(t,i,e);if(i|=(127&(o=n[r.pos++]))<<3,o<128)return el(t,i,e);if(i|=(127&(o=n[r.pos++]))<<10,o<128)return el(t,i,e);if(i|=(127&(o=n[r.pos++]))<<17,o<128)return el(t,i,e);if(i|=(127&(o=n[r.pos++]))<<24,o<128)return el(t,i,e);if(i|=(1&(o=n[r.pos++]))<<31,o<128)return el(t,i,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=i[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&Ys?function(t,e,r){return Ys.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){for(var i="",o=e;o<r;){var n,a,s,l=t[o],p=null,c=l>239?4:l>223?3:l>191?2:1;if(o+c>r)break;1===c?l<128&&(p=l):2===c?128==(192&(n=t[o+1]))&&(p=(31&l)<<6|63&n)<=127&&(p=null):3===c?(a=t[o+2],128==(192&(n=t[o+1]))&&128==(192&a)&&((p=(15&l)<<12|(63&n)<<6|63&a)<=2047||p>=55296&&p<=57343)&&(p=null)):4===c&&(a=t[o+2],s=t[o+3],128==(192&(n=t[o+1]))&&128==(192&a)&&128==(192&s)&&((p=(15&l)<<18|(63&n)<<12|(63&a)<<6|63&s)<=65535||p>=1114112)&&(p=null)),null===p?(p=65533,c=1):p>65535&&(p-=65536,i+=String.fromCharCode(p>>>10&1023|55296),p=56320|1023&p),i+=String.fromCharCode(p),o+=c}return i}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==Js.Bytes)return t.push(this.readVarint(e));var r=tl(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==Js.Bytes)return t.push(this.readSVarint());var e=tl(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==Js.Bytes)return t.push(this.readBoolean());var e=tl(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==Js.Bytes)return t.push(this.readFloat());var e=tl(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==Js.Bytes)return t.push(this.readDouble());var e=tl(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==Js.Bytes)return t.push(this.readFixed32());var e=tl(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==Js.Bytes)return t.push(this.readSFixed32());var e=tl(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==Js.Bytes)return t.push(this.readFixed64());var e=tl(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==Js.Bytes)return t.push(this.readSFixed64());var e=tl(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===Js.Varint)for(;this.buf[this.pos++]>127;);else if(e===Js.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Js.Fixed32)this.pos+=4;else{if(e!==Js.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var r=new Uint8Array(e);r.set(this.buf),this.buf=r,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),dl(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),dl(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),dl(this.buf,-1&t,this.pos),dl(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),dl(this.buf,-1&t,this.pos),dl(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var r,i;if(t>=0?(r=t%4294967296|0,i=t/4294967296|0):(i=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,i=i+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,r.buf[r.pos]=127&(t>>>=7)}(r,0,e),function(t,e){var r=(7&t)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(i,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var i,o,n=0;n<e.length;n++){if((i=e.charCodeAt(n))>55295&&i<57344){if(!o){i>56319||n+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):o=i;continue}if(i<56320){t[r++]=239,t[r++]=191,t[r++]=189,o=i;continue}i=o-55296<<10|i-56320|65536,o=null}else o&&(t[r++]=239,t[r++]=191,t[r++]=189,o=null);i<128?t[r++]=i:(i<2048?t[r++]=i>>6|192:(i<65536?t[r++]=i>>12|224:(t[r++]=i>>18|240,t[r++]=i>>12&63|128),t[r++]=i>>6&63|128),t[r++]=63&i|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&rl(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),Ws(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Ws(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r<e;r++)this.buf[this.pos++]=t[r]},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this);var i=this.pos-r;i>=128&&rl(r,i,this),this.pos=r-1,this.writeVarint(i),this.pos+=i},writeMessage:function(t,e,r){this.writeTag(t,Js.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,il,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,ol,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,sl,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,nl,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,al,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,ll,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,pl,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,cl,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,ul,e)},writeBytesField:function(t,e){this.writeTag(t,Js.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Js.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Js.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Js.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Js.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Js.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Js.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Js.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Js.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Js.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var vl=function(t,e){var r=e.pixelRatio,i=e.version,o=e.stretchX,n=e.stretchY,a=e.content;this.paddedRect=t,this.pixelRatio=r,this.stretchX=o,this.stretchY=n,this.content=a,this.version=i},xl={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};xl.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},xl.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},xl.tlbr.get=function(){return this.tl.concat(this.br)},xl.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(vl.prototype,xl);var bl=function(t,e){var r={},i={};this.haveRenderCallbacks=[];var o=[];this.addImages(t,r,o),this.addImages(e,i,o);var n=gl(o),a=new xa({width:n.w||1,height:n.h||1});for(var s in t){var l=t[s],p=r[s].paddedRect;xa.copy(l.data,a,{x:0,y:0},{x:p.x+1,y:p.y+1},l.data)}for(var c in e){var u=e[c],h=i[c].paddedRect,d=h.x+1,f=h.y+1,m=u.data.width,_=u.data.height;xa.copy(u.data,a,{x:0,y:0},{x:d,y:f},u.data),xa.copy(u.data,a,{x:0,y:_-1},{x:d,y:f-1},{width:m,height:1}),xa.copy(u.data,a,{x:0,y:0},{x:d,y:f+_},{width:m,height:1}),xa.copy(u.data,a,{x:m-1,y:0},{x:d-1,y:f},{width:1,height:_}),xa.copy(u.data,a,{x:0,y:0},{x:d+m,y:f},{width:1,height:_})}this.image=a,this.iconPositions=r,this.patternPositions=i};bl.prototype.addImages=function(t,e,r){for(var i in t){var o=t[i],n={x:0,y:0,w:o.data.width+2,h:o.data.height+2};r.push(n),e[i]=new vl(n,o),o.hasRenderCallback&&this.haveRenderCallbacks.push(i)}},bl.prototype.patchUpdatedImages=function(t,e){for(var r in t.dispatchRenderCallbacks(this.haveRenderCallbacks),t.updatedImages)this.patchUpdatedImage(this.iconPositions[r],t.getImage(r),e),this.patchUpdatedImage(this.patternPositions[r],t.getImage(r),e)},bl.prototype.patchUpdatedImage=function(t,e,r){if(t&&e&&t.version!==e.version){t.version=e.version;var i=t.tl;r.update(e.data,void 0,{x:i[0],y:i[1]})}},Bi("ImagePosition",vl),Bi("ImageAtlas",bl);var wl={horizontal:1,vertical:2,horizontalOnly:3},Cl=function(){this.scale=1,this.fontStack="",this.imageName=null};Cl.forText=function(t,e){var r=new Cl;return r.scale=t||1,r.fontStack=e,r},Cl.forImage=function(t){var e=new Cl;return e.imageName=t,e};var kl=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function Sl(t,e,r,i,o,n,a,s,l,p,c,u,h,d,f,m){var _,y=kl.fromFeature(t,o);u===wl.vertical&&y.verticalizePunctuation();var g=ao.processBidirectionalText,v=ao.processStyledBidirectionalText;if(g&&1===y.sections.length){_=[];for(var x=0,b=g(y.toString(),Ll(y,p,n,e,i,d,f));x<b.length;x+=1){var w=b[x],C=new kl;C.text=w,C.sections=y.sections;for(var k=0;k<w.length;k++)C.sectionIndex.push(0);_.push(C)}}else if(v){_=[];for(var S=0,M=v(y.text,y.sectionIndex,Ll(y,p,n,e,i,d,f));S<M.length;S+=1){var E=M[S],T=new kl;T.text=E[0],T.sectionIndex=E[1],T.sections=y.sections,_.push(T)}}else _=function(t,e){for(var r=[],i=t.text,o=0,n=0,a=e;n<a.length;n+=1){var s=a[n];r.push(t.substring(o,s)),o=s}return o<i.length&&r.push(t.substring(o,i.length)),r}(y,Ll(y,p,n,e,i,d,f));var A=[],I={positionedLines:A,text:y.toString(),top:c[1],bottom:c[1],left:c[0],right:c[0],writingMode:u,iconsInText:!1,verticalizable:!1};return function(t,e,r,i,o,n,a,s,l,p,c,u){for(var h=0,d=-17,f=0,m=0,_="right"===s?1:"left"===s?0:.5,y=0,g=0,v=o;g<v.length;g+=1){var x=v[g];x.trim();var b=x.getMaxScale(),w=24*(b-1),C={positionedGlyphs:[],lineOffset:0};t.positionedLines[y]=C;var k=C.positionedGlyphs,S=0;if(x.length()){for(var M=0;M<x.length();M++){var E=x.getSection(M),T=x.getSectionIndex(M),A=x.getCharCode(M),I=0,P=null,L=null,z=null,R=24,D=!(l===wl.horizontal||!c&&!Gi(A)||c&&(Ml[A]||($=A,Hi.Arabic($)||Hi["Arabic Supplement"]($)||Hi["Arabic Extended-A"]($)||Hi["Arabic Presentation Forms-A"]($)||Hi["Arabic Presentation Forms-B"]($))));if(E.imageName){var O=i[E.imageName];if(!O)continue;z=E.imageName,t.iconsInText=t.iconsInText||!0,L=O.paddedRect;var F=O.displaySize;E.scale=24*E.scale/u,I=w+(24-F[1]*E.scale),R=(P={width:F[0],height:F[1],left:1,top:-3,advance:D?F[1]:F[0]}).advance;var B=D?F[0]*E.scale-24*b:F[1]*E.scale-24*b;B>0&&B>S&&(S=B)}else{var j=r[E.fontStack],N=j&&j[A];if(N&&N.rect)L=N.rect,P=N.metrics;else{var U=e[E.fontStack],V=U&&U[A];if(!V)continue;P=V.metrics}I=24*(b-E.scale)}D?(t.verticalizable=!0,k.push({glyph:A,imageName:z,x:h,y:d+I,vertical:D,scale:E.scale,fontStack:E.fontStack,sectionIndex:T,metrics:P,rect:L}),h+=R*E.scale+p):(k.push({glyph:A,imageName:z,x:h,y:d+I,vertical:D,scale:E.scale,fontStack:E.fontStack,sectionIndex:T,metrics:P,rect:L}),h+=P.advance*E.scale+p)}0!==k.length&&(f=Math.max(h-p,f),Rl(k,0,k.length-1,_,S)),h=0;var q=n*b+S;C.lineOffset=Math.max(S,w),d+=q,m=Math.max(q,m),++y}else d+=n,++y}var $,H=d- -17,Z=zl(a),G=Z.horizontalAlign,Q=Z.verticalAlign;(function(t,e,r,i,o,n,a,s,l){var p,c=(e-r)*o;p=n!==a?-s*i- -17:(-i*l+.5)*a;for(var u=0,h=t;u<h.length;u+=1)for(var d=0,f=h[u].positionedGlyphs;d<f.length;d+=1){var m=f[d];m.x+=c,m.y+=p}})(t.positionedLines,_,G,Q,f,m,n,H,o.length),t.top+=-Q*H,t.bottom=t.top+H,t.left+=-G*f,t.right=t.left+f}(I,e,r,i,_,a,s,l,u,p,h,m),!function(t){for(var e=0,r=t;e<r.length;e+=1)if(0!==r[e].positionedGlyphs.length)return!1;return!0}(A)&&I}kl.fromFeature=function(t,e){for(var r=new kl,i=0;i<t.sections.length;i++){var o=t.sections[i];o.image?r.addImageSection(o):r.addTextSection(o,e)}return r},kl.prototype.length=function(){return this.text.length},kl.prototype.getSection=function(t){return this.sections[this.sectionIndex[t]]},kl.prototype.getSectionIndex=function(t){return this.sectionIndex[t]},kl.prototype.getCharCode=function(t){return this.text.charCodeAt(t)},kl.prototype.verticalizePunctuation=function(){this.text=function(t){for(var e="",r=0;r<t.length;r++){var i=t.charCodeAt(r+1)||null,o=t.charCodeAt(r-1)||null;e+=i&&Qi(i)&&!Qs[t[r+1]]||o&&Qi(o)&&!Qs[t[r-1]]||!Qs[t[r]]?t[r]:Qs[t[r]]}return e}(this.text)},kl.prototype.trim=function(){for(var t=0,e=0;e<this.text.length&&Ml[this.text.charCodeAt(e)];e++)t++;for(var r=this.text.length,i=this.text.length-1;i>=0&&i>=t&&Ml[this.text.charCodeAt(i)];i--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)},kl.prototype.substring=function(t,e){var r=new kl;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},kl.prototype.toString=function(){return this.text},kl.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,r){return Math.max(e,t.sections[r].scale)}),0)},kl.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(Cl.forText(t.scale,t.fontStack||e));for(var r=this.sections.length-1,i=0;i<t.text.length;++i)this.sectionIndex.push(r)},kl.prototype.addImageSection=function(t){var e=t.image?t.image.name:"";if(0!==e.length){var r=this.getNextImageSectionCharCode();r?(this.text+=String.fromCharCode(r),this.sections.push(Cl.forImage(e)),this.sectionIndex.push(this.sections.length-1)):C("Reached maximum number of images 6401")}else C("Can't add FormattedSection with an empty image.")},kl.prototype.getNextImageSectionCharCode=function(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var Ml={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},El={};function Tl(t,e,r,i,o,n){if(e.imageName){var a=i[e.imageName];return a?a.displaySize[0]*e.scale*24/n+o:0}var s=r[e.fontStack],l=s&&s[t];return l?l.metrics.advance*e.scale+o:0}function Al(t,e,r,i){var o=Math.pow(t-e,2);return i?t<e?o/2:2*o:o+Math.abs(r)*r}function Il(t,e,r){var i=0;return 10===t&&(i-=1e4),r&&(i+=150),40!==t&&65288!==t||(i+=50),41!==e&&65289!==e||(i+=50),i}function Pl(t,e,r,i,o,n){for(var a=null,s=Al(e,r,o,n),l=0,p=i;l<p.length;l+=1){var c=p[l],u=Al(e-c.x,r,o,n)+c.badness;u<=s&&(a=c,s=u)}return{index:t,x:e,priorBreak:a,badness:s}}function Ll(t,e,r,i,o,n,a){if("point"!==n)return[];if(!t)return[];for(var s,l=[],p=function(t,e,r,i,o,n){for(var a=0,s=0;s<t.length();s++){var l=t.getSection(s);a+=Tl(t.getCharCode(s),l,i,o,e,n)}return a/Math.max(1,Math.ceil(a/r))}(t,e,r,i,o,a),c=t.text.indexOf("â")>=0,u=0,h=0;h<t.length();h++){var d=t.getSection(h),f=t.getCharCode(h);if(Ml[f]||(u+=Tl(f,d,i,o,e,a)),h<t.length()-1){var m=!((s=f)<11904||!(Hi["Bopomofo Extended"](s)||Hi.Bopomofo(s)||Hi["CJK Compatibility Forms"](s)||Hi["CJK Compatibility Ideographs"](s)||Hi["CJK Compatibility"](s)||Hi["CJK Radicals Supplement"](s)||Hi["CJK Strokes"](s)||Hi["CJK Symbols and Punctuation"](s)||Hi["CJK Unified Ideographs Extension A"](s)||Hi["CJK Unified Ideographs"](s)||Hi["Enclosed CJK Letters and Months"](s)||Hi["Halfwidth and Fullwidth Forms"](s)||Hi.Hiragana(s)||Hi["Ideographic Description Characters"](s)||Hi["Kangxi Radicals"](s)||Hi["Katakana Phonet
1ic Extensions"](s)||Hi.Katakana(s)||Hi["Vertical Forms"](s)||Hi["Yi Radicals"](s)||Hi["Yi Syllables"](s)));(El[f]||m||d.imageName)&&l.push(Pl(h+1,u,p,l,Il(f,t.getCharCode(h+1),m&&c),!1))}}return function t(e){return e?t(e.priorBreak).concat(e.index):[]}(Pl(t.length(),u,p,l,0,!0))}function zl(t){var e=.5,r=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(t){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:e,verticalAlign:r}}function Rl(t,e,r,i,o){if(i||o)for(var n=t[r],a=(t[r].x+n.metrics.advance*n.scale)*i,s=e;s<=r;s++)t[s].x-=a,t[s].y+=o}function Dl(t,e,r,i,o,n){var a,s=t.image;if(s.content){var l=s.content,p=s.pixelRatio||1;a=[l[0]/p,l[1]/p,s.displaySize[0]-l[2]/p,s.displaySize[1]-l[3]/p]}var c,u,h,d,f=e.left*n,m=e.right*n;"width"===r||"both"===r?(d=o[0]+f-i[3],u=o[0]+m+i[1]):u=(d=o[0]+(f+m-s.displaySize[0])/2)+s.displaySize[0];var _=e.top*n,y=e.bottom*n;return"height"===r||"both"===r?(c=o[1]+_-i[0],h=o[1]+y+i[2]):h=(c=o[1]+(_+y-s.displaySize[1])/2)+s.displaySize[1],{image:s,top:c,right:u,bottom:h,left:d,collisionPadding:a}}El[10]=!0,El[32]=!0,El[38]=!0,El[40]=!0,El[41]=!0,El[43]=!0,El[45]=!0,El[47]=!0,El[173]=!0,El[183]=!0,El[8203]=!0,El[8208]=!0,El[8211]=!0,El[8231]=!0;var Ol=function(t){function e(e,r,i,o){t.call(this,e,r),this.angle=i,void 0!==o&&(this.segment=o)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.clone=function(){return new e(this.x,this.y,this.angle,this.segment)},e}(o);function Fl(t,e){var r=e.expression;if("constant"===r.kind)return{kind:"constant",layoutSize:r.evaluate(new so(t+1))};if("source"===r.kind)return{kind:"source"};for(var i=r.zoomStops,o=r.interpolationType,n=0;n<i.length&&i[n]<=t;)n++;for(var a=n=Math.max(0,n-1);a<i.length&&i[a]<t+1;)a++;a=Math.min(i.length-1,a);var s=i[n],l=i[a];return"composite"===r.kind?{kind:"composite",minZoom:s,maxZoom:l,interpolationType:o}:{kind:"camera",minZoom:s,maxZoom:l,minSize:r.evaluate(new so(s)),maxSize:r.evaluate(new so(l)),interpolationType:o}}function Bl(t,e,r){var i=e.uSize,o=r.lowerSize;return"source"===t.kind?o/128:"composite"===t.kind?He(o/128,r.upperSize/128,e.uSizeT):i}function jl(t,e){var r=0,i=0;if("constant"===t.kind)i=t.layoutSize;else if("source"!==t.kind){var o=t.interpolationType,n=o?c(ar.interpolationFactor(o,e,t.minZoom,t.maxZoom),0,1):0;"camera"===t.kind?i=He(t.minSize,t.maxSize,n):r=n}return{uSizeT:r,uSize:i}}Bi("Anchor",Ol);var Nl=Object.freeze({__proto__:null,getSizeData:Fl,evaluateSizeForFeature:Bl,evaluateSizeForZoom:jl,SIZE_PACK_FACTOR:128});function Ul(t,e,r,i,o){if(void 0===e.segment)return!0;for(var n=e,a=e.segment+1,s=0;s>-r/2;){if(--a<0)return!1;s-=t[a].dist(n),n=t[a]}s+=t[a].dist(t[a+1]),a++;for(var l=[],p=0;s<r/2;){var c=t[a],u=t[a+1];if(!u)return!1;var h=t[a-1].angleTo(c)-c.angleTo(u);for(h=Math.abs((h+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:s,angleDelta:h}),p+=h;s-l[0].distance>i;)p-=l.shift().angleDelta;if(p>o)return!1;a++,s+=c.dist(u)}return!0}function Vl(t){for(var e=0,r=0;r<t.length-1;r++)e+=t[r].dist(t[r+1]);return e}function ql(t,e,r){return t?.6*e*r:0}function $l(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function Hl(t,e,r,i,o,n){for(var a=ql(r,o,n),s=$l(r,i)*n,l=0,p=Vl(t)/2,c=0;c<t.length-1;c++){var u=t[c],h=t[c+1],d=u.dist(h);if(l+d>p){var f=(p-l)/d,m=He(u.x,h.x,f),_=He(u.y,h.y,f),y=new Ol(m,_,h.angleTo(u),c);return y._round(),!a||Ul(t,y,s,a,e)?y:void 0}l+=d}}function Zl(t,e,r,i,o,n,a,s,l){var p=ql(i,n,a),c=$l(i,o),u=c*a,h=0===t[0].x||t[0].x===l||0===t[0].y||t[0].y===l;return e-u<e/4&&(e=u+e/4),function t(e,r,i,o,n,a,s,l,p){for(var c=a/2,u=Vl(e),h=0,d=r-i,f=[],m=0;m<e.length-1;m++){for(var _=e[m],y=e[m+1],g=_.dist(y),v=y.angleTo(_);d+i<h+g;){var x=((d+=i)-h)/g,b=He(_.x,y.x,x),w=He(_.y,y.y,x);if(b>=0&&b<p&&w>=0&&w<p&&d-c>=0&&d+c<=u){var C=new Ol(b,w,v,m);C._round(),o&&!Ul(e,C,a,o,n)||f.push(C)}}h+=g}return l||f.length||s||(f=t(e,h/2,i,o,n,a,s,!0,p)),f}(t,h?e/2*s%e:(c/2+2*n)*a*s%e,e,p,r,u,h,!1,l)}function Gl(t,e,r,i,n){for(var a=[],s=0;s<t.length;s++)for(var l=t[s],p=void 0,c=0;c<l.length-1;c++){var u=l[c],h=l[c+1];u.x<e&&h.x<e||(u.x<e?u=new o(e,u.y+(e-u.x)/(h.x-u.x)*(h.y-u.y))._round():h.x<e&&(h=new o(e,u.y+(e-u.x)/(h.x-u.x)*(h.y-u.y))._round()),u.y<r&&h.y<r||(u.y<r?u=new o(u.x+(r-u.y)/(h.y-u.y)*(h.x-u.x),r)._round():h.y<r&&(h=new o(u.x+(r-u.y)/(h.y-u.y)*(h.x-u.x),r)._round()),u.x>=i&&h.x>=i||(u.x>=i?u=new o(i,u.y+(i-u.x)/(h.x-u.x)*(h.y-u.y))._round():h.x>=i&&(h=new o(i,u.y+(i-u.x)/(h.x-u.x)*(h.y-u.y))._round()),u.y>=n&&h.y>=n||(u.y>=n?u=new o(u.x+(n-u.y)/(h.y-u.y)*(h.x-u.x),n)._round():h.y>=n&&(h=new o(u.x+(n-u.y)/(h.y-u.y)*(h.x-u.x),n)._round()),p&&u.equals(p[p.length-1])||a.push(p=[u]),p.push(h)))))}return a}function Ql(t,e,r,i){var n=[],a=t.image,s=a.pixelRatio,l=a.paddedRect.w-2,p=a.paddedRect.h-2,c=t.right-t.left,u=t.bottom-t.top,h=a.stretchX||[[0,l]],d=a.stretchY||[[0,p]],f=function(t,e){return t+e[1]-e[0]},m=h.reduce(f,0),_=d.reduce(f,0),y=l-m,g=p-_,v=0,x=m,b=0,w=_,C=0,k=y,S=0,M=g;if(a.content&&i){var E=a.content;v=Xl(h,0,E[0]),b=Xl(d,0,E[1]),x=Xl(h,E[0],E[2]),w=Xl(d,E[1],E[3]),C=E[0]-v,S=E[1]-b,k=E[2]-E[0]-x,M=E[3]-E[1]-w}var T=function(i,n,l,p){var h=Kl(i.stretch-v,x,c,t.left),d=Jl(i.fixed-C,k,i.stretch,m),f=Kl(n.stretch-b,w,u,t.top),y=Jl(n.fixed-S,M,n.stretch,_),g=Kl(l.stretch-v,x,c,t.left),E=Jl(l.fixed-C,k,l.stretch,m),T=Kl(p.stretch-b,w,u,t.top),A=Jl(p.fixed-S,M,p.stretch,_),I=new o(h,f),P=new o(g,f),L=new o(g,T),z=new o(h,T),R=new o(d/s,y/s),D=new o(E/s,A/s),O=e*Math.PI/180;if(O){var F=Math.sin(O),B=Math.cos(O),j=[B,-F,F,B];I._matMult(j),P._matMult(j),z._matMult(j),L._matMult(j)}var N=i.stretch+i.fixed,U=n.stretch+n.fixed;return{tl:I,tr:P,bl:z,br:L,tex:{x:a.paddedRect.x+1+N,y:a.paddedRect.y+1+U,w:l.stretch+l.fixed-N,h:p.stretch+p.fixed-U},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:R,pixelOffsetBR:D,minFontScaleX:k/s/c,minFontScaleY:M/s/u,isSDF:r}};if(i&&(a.stretchX||a.stretchY))for(var A=Wl(h,y,m),I=Wl(d,g,_),P=0;P<A.length-1;P++)for(var L=A[P],z=A[P+1],R=0;R<I.length-1;R++)n.push(T(L,I[R],z,I[R+1]));else n.push(T({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:l+1},{fixed:0,stretch:p+1}));return n}function Xl(t,e,r){for(var i=0,o=0,n=t;o<n.length;o+=1){var a=n[o];i+=Math.max(e,Math.min(r,a[1]))-Math.max(e,Math.min(r,a[0]))}return i}function Wl(t,e,r){for(var i=[{fixed:-1,stretch:0}],o=0,n=t;o<n.length;o+=1){var a=n[o],s=a[0],l=a[1],p=i[i.length-1];
vendor: 90,104 bytes, line 1
1i.push({fixed:s-p.stretch,stretch:p.stretch}),i.push({fixed:s-p.stretch,stretch:p.stretch+(l-s)})}return i.push({fixed:e+1,stretch:r}),i}function Kl(t,e,r,i){return t/e*r+i}function Jl(t,e,r,i){return t-e*r/i}var Yl=function(t,e,r,i,n,a,s,l,p,c){if(this.boxStartIndex=t.length,p){var u=a.top,h=a.bottom,d=a.collisionPadding;d&&(u-=d[1],h+=d[3]);var f=h-u;f>0&&(f=Math.max(10,f),this.circleDiameter=f)}else{var m=a.top*s-l,_=a.bottom*s+l,y=a.left*s-l,g=a.right*s+l,v=a.collisionPadding;if(v&&(y-=v[0]*s,m-=v[1]*s,g+=v[2]*s,_+=v[3]*s),c){var x=new o(y,m),b=new o(g,m),w=new o(y,_),C=new o(g,_),k=c*Math.PI/180;x._rotate(k),b._rotate(k),w._rotate(k),C._rotate(k),y=Math.min(x.x,b.x,w.x,C.x),g=Math.max(x.x,b.x,w.x,C.x),m=Math.min(x.y,b.y,w.y,C.y),_=Math.max(x.y,b.y,w.y,C.y)}t.emplaceBack(e.x,e.y,y,m,g,_,r,i,n)}this.boxEndIndex=t.length},tp=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=ep),this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)};function ep(t,e){return t<e?-1:t>e?1:0}function rp(t,e,r){void 0===e&&(e=1),void 0===r&&(r=!1);for(var i=1/0,n=1/0,a=-1/0,s=-1/0,l=t[0],p=0;p<l.length;p++){var c=l[p];(!p||c.x<i)&&(i=c.x),(!p||c.y<n)&&(n=c.y),(!p||c.x>a)&&(a=c.x),(!p||c.y>s)&&(s=c.y)}var u=Math.min(a-i,s-n),h=u/2,d=new tp([],ip);if(0===u)return new o(i,n);for(var f=i;f<a;f+=u)for(var m=n;m<s;m+=u)d.push(new op(f+h,m+h,h,t));for(var _=function(t){for(var e=0,r=0,i=0,o=t[0],n=0,a=o.length,s=a-1;n<a;s=n++){var l=o[n],p=o[s],c=l.x*p.y-p.x*l.y;r+=(l.x+p.x)*c,i+=(l.y+p.y)*c,e+=3*c}return new op(r/e,i/e,0,t)}(t),y=d.length;d.length;){var g=d.pop();(g.d>_.d||!_.d)&&(_=g,r&&console.log("found best %d after %d probes",Math.round(1e4*g.d)/1e4,y)),g.max-_.d<=e||(d.push(new op(g.p.x-(h=g.h/2),g.p.y-h,h,t)),d.push(new op(g.p.x+h,g.p.y-h,h,t)),d.push(new op(g.p.x-h,g.p.y+h,h,t)),d.push(new op(g.p.x+h,g.p.y+h,h,t)),y+=4)}return r&&(console.log("num probes: "+y),console.log("best distance: "+_.d)),_.p}function ip(t,e){return e.max-t.max}function op(t,e,r,i){this.p=new o(t,e),this.h=r,this.d=function(t,e){for(var r=!1,i=1/0,o=0;o<e.length;o++)for(var n=e[o],a=0,s=n.length,l=s-1;a<s;l=a++){var p=n[a],c=n[l];p.y>t.y!=c.y>t.y&&t.x<(c.x-p.x)*(t.y-p.y)/(c.y-p.y)+p.x&&(r=!r),i=Math.min(i,Jn(t,p,c))}return(r?1:-1)*Math.sqrt(i)}(this.p,i),this.max=this.d+this.h*Math.SQRT2}tp.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},tp.prototype.pop=function(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}},tp.prototype.peek=function(){return this.data[0]},tp.prototype._up=function(t){for(var e=this.data,r=this.compare,i=e[t];t>0;){var o=t-1>>1,n=e[o];if(r(i,n)>=0)break;e[t]=n,t=o}e[t]=i},tp.prototype._down=function(t){for(var e=this.data,r=this.compare,i=this.length>>1,o=e[t];t<i;){var n=1+(t<<1),a=e[n],s=n+1;if(s<this.length&&r(e[s],a)<0&&(n=s,a=e[s]),r(a,o)>=0)break;e[t]=a,t=n}e[t]=o};var np=Number.POSITIVE_INFINITY;function ap(t,e){return e[1]!==np?function(t,e,r){var i=0,o=0;switch(e=Math.abs(e),r=Math.abs(r),t){case"top-right":case"top-left":case"top":o=r-7;break;case"bottom-right":case"bottom-left":case"bottom":o=7-r}switch(t){case"top-right":case"bottom-right":case"right":i=-e;break;case"top-left":case"bottom-left":case"left":i=e}return[i,o]}(t,e[0],e[1]):function(t,e){var r=0,i=0;e<0&&(e=0);var o=e/Math.sqrt(2);switch(t){case"top-right":case"top-left":i=o-7;break;case"bottom-right":case"bottom-left":i=7-o;break;case"bottom":i=7-e;break;case"top":i=e-7}switch(t){case"top-right":case"bottom-right":r=-o;break;case"top-left":case"bottom-left":r=o;break;case"left":r=e;break;case"right":r=-e}return[r,i]}(t,e[0])}function sp(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function lp(t,e,r,i,n,a,s,l,p,c,u,h,d,f,m){var _=function(t,e,r,i,n,a,s,l){for(var p=i.layout.get("text-rotate").evaluate(a,{})*Math.PI/180,c=[],u=0,h=e.positionedLines;u<h.length;u+=1)for(var d=h[u],f=0,m=d.positionedGlyphs;f<m.length;f+=1){var _=m[f];if(_.rect){var y=_.rect||{},g=4,v=!0,x=1,b=0,w=(n||l)&&_.vertical,C=_.metrics.advance*_.scale/2;if(l&&e.verticalizable&&(b=d.lineOffset/2-(_.imageName?-(24-_.metrics.width*_.scale)/2:24*(_.scale-1))),_.imageName){var k=s[_.imageName];v=k.sdf,g=1/(x=k.pixelRatio)}var S=n?[_.x+C,_.y]:[0,0],M=n?[0,0]:[_.x+C+r[0],_.y+r[1]-b],E=[0,0];w&&(E=M,M=[0,0]);var T=(_.metrics.left-g)*_.scale-C+M[0],A=(-_.metrics.top-g)*_.scale+M[1],I=T+y.w*_.scale/x,P=A+y.h*_.scale/x,L=new o(T,A),z=new o(I,A),R=new o(T,P),D=new o(I,P);if(w){var O=new o(-C,C- -17),F=-Math.PI/2,B=12-C,j=new o(22-B,-(_.imageName?B:0)),N=new(Function.prototype.bind.apply(o,[null].concat(E)));L._rotateAround(F,O)._add(j)._add(N),z._rotateAround(F,O)._add(j)._add(N),R._rotateAround(F,O)._add(j)._add(N),D._rotateAround(F,O)._add(j)._add(N)}if(p){var U=Math.sin(p),V=Math.cos(p),q=[V,-U,U,V];L._matMult(q),z._matMult(q),R._matMult(q),D._matMult(q)}var $=new o(0,0),H=new o(0,0);c.push({tl:L,tr:z,bl:R,br:D,tex:y,writingMode:e.writingMode,glyphOffset:S,sectionIndex:_.sectionIndex,isSDF:v,pixelOffsetTL:$,pixelOffsetBR:H,minFontScaleX:0,minFontScaleY:0})}}return c}(0,r,l,n,a,s,i,t.allowVerticalPlacement),y=t.textSizeData,g=null;"source"===y.kind?(g=[128*n.layout.get("text-size").evaluate(s,{})])[0]>32640&&C(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):"composite"===y.kind&&((g=[128*f.compositeTextSizes[0].evaluate(s,{},m),128*f.compositeTextSizes[1].evaluate(s,{},m)])[0]>32640||g[1]>32640)&&C(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),t.addSymbols(t.text,_,g,l,a,s,c,e,p.lineStartIndex,p.lineLength,d,m);for(var v=0,x=u;v<x.length;v+=1)h[x[v]]=t.text.placedSymbolArray.length-1;return 4*_.length}function pp(t){for(var e in t)return t[e];return null}function cp(t,e,r,i){var o=t.compareText;if(e in o){for(var n=o[e],a=n.length-1;a>=0;a--)if(i.dist(n[a])<r)return!0}else o[e]=[];return o[e].push(i),!1}var up=bs.VectorTileFeature.types,hp=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function dp(t,e,r,i,o,n,a,s,l,p,c,u,h){var d=s?Math.min(32640,Math.round(s[0])):0,f=s?Math.min(32640,Math.round(s[1])):0;t.emplaceBack(e,r,Math.round(32*i),Math.round(32*o),n,a,(d<<1)+(l?1:0),f,16*p,16*c,256*u,256*h)}function fp(t,e,r){t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r)}function mp(t){for(var e=0,r=t.sections;e<r.length;e+=1)if(Ki(r[e].text))return!0;return!1}var _p=function(t){this.layoutVertexArray=new Do,this.indexArray=new Vo,this.programConfigurations=t,this.segments=new pn,this.dynamicLayoutVertexArray=new Oo,this.opacityVertexArray=new Fo,this.placedSymbolArray=new tn};_p.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length},_p.prototype.upload=function(t,e,r,i){this.isEmpty()||(r&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Vs.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,qs.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,hp,!0),this.opacityVertexBuffer.itemSize=1),(r||i)&&this.programConfigurations.upload(t))},_p.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},Bi("SymbolBuffers",_p);var yp=function(t,e,r){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new r,this.segments=new pn,this.collisionVertexArray=new Uo};yp.prototype.upload=function(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,$s.members,!0)},yp.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},Bi("CollisionBuffers",yp);var gp=function(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=la([]),this.placementViewportMatrix=la([]);var e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Fl(this.zoom,e["text-size"]),this.iconSizeData=Fl(this.zoom,e["icon-size"]);var r=this.layers[0].layout,i=r.get("symbol-sort-key"),o=r.get("symbol-z-order");this.canOverlap=r.get("text-allow-overlap")||r.get("icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==o&&!i.isConstant(),this.sortFeaturesByY=("viewport-y"===o||"auto"===o&&!this.sortFeaturesByKey)&&this.canOverlap,"point"===r.get("symbol-placement")&&(this.writingModes=r.get("text-writing-mode").map((function(t){return wl[t]}))),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id})),this.sourceID=t.sourceID};gp.prototype.createArrays=function(){this.text=new _p(new On(this.layers,this.zoom,(function(t){return/^text/.test(t)}))),this.icon=new _p(new On(this.layers,this.zoom,(function(t){return/^icon/.test(t)}))),this.glyphOffsetArray=new on,this.lineVertexArray=new nn,this.symbolInstances=new rn},gp.prototype.calculateGlyphDependencies=function(t,e,r,i,o){for(var n=0;n<t.length;n++)if(e[t.charCodeAt(n)]=!0,(r||i)&&o){var a=Qs[t.charAt(n)];a&&(e[a.charCodeAt(0)]=!0)}},gp.prototype.populate=function(t,e,r){var i=this.layers[0],o=i.layout,n=o.get("text-font"),a=o.get("text-field"),s=o.get("icon-image"),l=("constant"!==a.value.kind||a.value.value instanceof oe&&!a.value.value.isEmpty()||a.value.value.toString().length>0)&&("constant"!==n.value.kind||n.value.value.length>0),p="constant"!==s.value.kind||!!s.value.value||Object.keys(s.parameters).length>0,c=o.get("symbol-sort-key");if(this.features=[],l||p){for(var u=e.iconDependencies,h=e.glyphDependencies,d=e.availableImages,f=new so(this.zoom),m=0,_=t;m<_.length;m+=1){var y=_[m],g=y.feature,v=y.id,x=y.index,b=y.sourceLayerIndex,w=i._featureFilter.needGeometry,C=Vn(g,w);if(i._featureFilter.filter(f,C,r)){w||(C.geometry=Un(g));var k=void 0;if(l){var S=i.getValueAndResolveTokens("text-field",C,r,d),M=oe.factory(S);mp(M)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===oo()||this.hasRTLText&&ao.isParsed())&&(k=Gs(M,i,C))}var E=void 0;if(p){var T=i.getValueAndResolveTokens("icon-image",C,r,d);E=T instanceof ne?T:ne.fromString(T)}if(k||E){var A=this.sortFeaturesByKey?c.evaluate(C,{},r):void 0;if(this.features.push({id:v,text:k,icon:E,index:x,sourceLayerIndex:b,geometry:C.geometry,properties:g.properties,type:up[g.type],sortKey:A}),E&&(u[E.name]=!0),k){var I=n.evaluate(C,{},r).join(","),P="map"===o.get("text-rotation-alignment")&&"point"!==o.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(wl.vertical)>=0;for(var L=0,z=k.sections;L<z.length;L+=1){var R=z[L];if(R.image)u[R.image.name]=!0;else{var D=Zi(k.toString()),O=R.fontStack||I,F=h[O]=h[O]||{};this.calculateGlyphDependencies(R.text,F,P,this.allowVerticalPlacement,D)}}}}}}"line"===o.get("symbol-placement")&&(this.features=function(t){var e={},r={},i=[],o=0;function n(e){i.push(t[e]),o++}function a(t,e,o){var n=r[t];return delete r[t],r[e]=n,i[n].geometry[0].pop(),i[n].geometry[0]=i[n].geometry[0].concat(o[0]),n}function s(t,r,o){var n=e[r];return delete e[r],e[t]=n,i[n].geometry[0].shift(),i[n].geometry[0]=o[0].concat(i[n].geometry[0]),n}function l(t,e,r){var i=r?e[0][e[0].length-1]:e[0][0];return t+":"+i.x+":"+i.y}for(var p=0;p<t.length;p++){var c=t[p],u=c.geometry,h=c.text?c.text.toString():null;if(h){var d=l(h,u),f=l(h,u,!0);if(d in r&&f in e&&r[d]!==e[f]){var m=s(d,f,u),_=a(d,f,i[m].geometry);delete e[d],delete r[f],r[l(h,i[_].geometry,!0)]=_,i[m].geometry=null}else d in r?a(d,f,u):f in e?s(d,f,u):(n(p),e[d]=o-1,r[f]=o-1)}else n(p)}return i.filter((function(t){return t.geometry}))}(this.features)),this.sortFeaturesByKey&&this.features.sort((function(t,e){return t.sortKey-e.sortKey}))}},gp.prototype.update=function(t,e,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,r),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,r))},gp.prototype.isEmpty=function(){return 0===this.symbolInstances.length&&!this.hasRTLText},gp.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},gp.prototype.upload=function(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0},gp.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()},gp.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()},gp.prototype.addToLineVertexArray=function(t,e){var r=this.lineVertexArray.length;if(void 0!==t.segment){for(var i=t.dist(e[t.segment+1]),o=t.dist(e[t.segment]),n={},a=t.segment+1;a<e.length;a++)n[a]={x:e[a].x,y:e[a].y,tileUnitDistanceFromAnchor:i},a<e.length-1&&(i+=e[a+1].dist(e[a]));for(var s=t.segment||0;s>=0;s--)n[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:o},s>0&&(o+=e[s-1].dist(e[s]));for(var l=0;l<e.length;l++){var p=n[l];this.lineVertexArray.emplaceBack(p.x,p.y,p.tileUnitDistanceFromAnchor)}}return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}},gp.prototype.addSymbols=function(t,e,r,i,o,n,a,s,l,p,c,u){for(var h=t.indexArray,d=t.layoutVertexArray,f=t.segments.prepareSegment(4*e.length,d,h,this.canOverlap?n.sortKey:void 0),m=this.glyphOffsetArray.length,_=f.vertexLength,y=this.allowVerticalPlacement&&a===wl.vertical?Math.PI/2:0,g=n.text&&n.text.sections,v=0;v<e.length;v++){var x=e[v],b=x.tl,w=x.tr,C=x.bl,k=x.br,S=x.tex,M=x.pixelOffsetTL,E=x.pixelOffsetBR,T=x.minFontScaleX,A=x.minFontScaleY,I=x.glyphOffset,P=x.isSDF,L=x.sectionIndex,z=f.vertexLength,R=I[1];dp(d,s.x,s.y,b.x,R+b.y,S.x,S.y,r,P,M.x,M.y,T,A),dp(d,s.x,s.y,w.x,R+w.y,S.x+S.w,S.y,r,P,E.x,M.y,T,A),dp(d,s.x,s.y,C.x,R+C.y,S.x,S.y+S.h,r,P,M.x,E.y,T,A),dp(d,s.x,s.y,k.x,R+k.y,S.x+S.w,S.y+S.h,r,P,E.x,E.y,T,A),fp(t.dynamicLayoutVertexArray,s,y),h.emplaceBack(z,z+1,z+2),h.emplaceBack(z+1,z+2,z+3),f.vertexLength+=4,f.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(I[0]),v!==e.length-1&&L===e[v+1].sectionIndex||t.programConfigurations.populatePaintArrays(d.length,n,n.index,{},u,g&&g[L])}t.placedSymbolArray.emplaceBack(s.x,s.y,m,this.glyphOffsetArray.length-m,_,l,p,s.segment,r?r[0]:0,r?r[1]:0,i[0],i[1],a,0,!1,0,c)},gp.prototype._addCollisionDebugVertex=function(t,e,r,i,o,n){return e.emplaceBack(0,0),t.emplaceBack(r.x,r.y,i,o,Math.round(n.x),Math.round(n.y))},gp.prototype.addCollisionDebugVertices=function(t,e,r,i,n,a,s){var l=n.segments.prepareSegment(4,n.layoutVertexArray,n.indexArray),p=l.vertexLength,c=n.layoutVertexArray,u=n.collisionVertexArray,h=s.anchorX,d=s.anchorY;this._addCollisionDebugVertex(c,u,a,h,d,new o(t,e)),this._addCollisionDebugVertex(c,u,a,h,d,new o(r,e)),this._addCollisionDebugVertex(c,u,a,h,d,new o(r,i)),this._addCollisionDebugVertex(c,u,a,h,d,new o(t,i)),l.vertexLength+=4;var f=n.indexArray;f.emplaceBack(p,p+1),f.emplaceBack(p+1,p+2),f.emplaceBack(p+2,p+3),f.emplaceBack(p+3,p),l.primitiveLength+=4},gp.prototype.addDebugCollisionBoxes=function(t,e,r,i){for(var o=t;o<e;o++){var n=this.collisionBoxArray.get(o);this.addCollisionDebugVertices(n.x1,n.y1,n.x2,n.y2,i?this.textCollisionBox:this.iconCollisionBox,n.anchorPoint,r)}},gp.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new yp(jo,Hs.members,Qo),this.iconCollisionBox=new yp(jo,Hs.members,Qo);for(var t=0;t<this.symbolInstances.length;t++){var e=this.symbolInstances.get(t);this.addDebugCollisionBoxes(e.textBoxStartIndex,e.textBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.verticalTextBoxStartIndex,e.verticalTextBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.iconBoxStartIndex,e.iconBoxEndIndex,e,!1),this.addDebugCollisionBoxes(e.verticalIconBoxStartIndex,e.verticalIconBoxEndIndex,e,!1)}},gp.prototype._deserializeCollisionBoxesForSymbol=function(t,e,r,i,o,n,a,s,l){for(var p={},c=e;c<r;c++){var u=t.get(c);p.textBox={x1:u.x1,y1:u.y1,x2:u.x2,y2:u.y2,anchorPointX:u.anchorPointX,anchorPointY:u.anchorPointY},p.textFeatureIndex=u.featureIndex;break}for(var h=i;h<o;h++){var d=t.get(h);p.verticalTextBox={x1:d.x1,y1:d.y1,x2:d.x2,y2:d.y2,anchorPointX:d.anchorPointX,anchorPointY:d.anchorPointY},p.verticalTextFeatureIndex=d.featureIndex;break}for(var f=n;f<a;f++){var m=t.get(f);p.iconBox={x1:m.x1,y1:m.y1,x2:m.x2,y2:m.y2,anchorPointX:m.anchorPointX,anchorPointY:m.anchorPointY},p.iconFeatureIndex=m.featureIndex;break}for(var _=s;_<l;_++){var y=t.get(_);p.verticalIconBox={x1:y.x1,y1:y.y1,x2:y.x2,y2:y.y2,anchorPointX:y.anchorPointX,anchorPointY:y.anchorPointY},p.verticalIconFeatureIndex=y.featureIndex;break}return p},gp.prototype.deserializeCollisionBoxes=function(t){this.collisionArrays=[];for(var e=0;e<this.symbolInstances.length;e++){var r=this.symbolInstances.get(e);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex))}},gp.prototype.hasTextData=function(){return this.text.segments.get().length>0},gp.prototype.hasIconData=function(){return this.icon.segments.get().length>0},gp.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},gp.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},gp.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},gp.prototype.addIndicesForPlacedSymbol=function(t,e){for(var r=t.placedSymbolArray.get(e),i=r.vertexStartIndex+4*r.numGlyphs,o=r.vertexStartIndex;o<i;o+=4)t.indexArray.emplaceBack(o,o+1,o+2),t.indexArray.emplaceBack(o+1,o+2,o+3)},gp.prototype.getSortedSymbolIndexes=function(t){if(this.sortedAngle===t&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;for(var e=Math.sin(t),r=Math.cos(t),i=[],o=[],n=[],a=0;a<this.symbolInstances.length;++a){n.push(a);var s=this.symbolInstances.get(a);i.push(0|Math.round(e*s.anchorX+r*s.anchorY)),o.push(s.featureIndex)}return n.sort((function(t,e){return i[t]-i[e]||o[e]-o[t]})),n},gp.prototype.addToSortKeyRanges=function(t,e){var r=this.sortKeyRanges[this.sortKeyRanges.length-1];r&&r.sortKey===e?r.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:e,symbolInstanceStart:t,symbolInstanceEnd:t+1})},gp.prototype.sortFeatures=function(t){var e=this;if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var r=0,i=this.symbolInstanceIndexes;r<i.length;r+=1){var o=this.symbolInstances.get(i[r]);this.featureSortOrder.push(o.featureIndex),[o.rightJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.leftJustifiedTextSymbolIndex].forEach((function(t,r,i){t>=0&&i.indexOf(t)===r&&e.addIndicesForPlacedSymbol(e.text,t)})),o.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,o.verticalPlacedTextSymbolIndex),o.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,o.placedIconSymbolIndex),o.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,o.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},Bi("SymbolBucket",gp,{omit:["layers","collisionBoxArray","features","compareText"]}),gp.MAX_GLYPHS=65535,gp.addDynamicAttributes=fp;var vp=new wo({"symbol-placement":new yo(It.layout_symbol["symbol-placement"]),"symbol-spacing":new yo(It.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new yo(It.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new go(It.layout_symbol["symbol-sort-key"]),"symbol-z-order":new yo(It.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new yo(It.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new yo(It.layout_symbol["icon-ignore-placement"]),"icon-optional":new yo(It.layout_symbol["icon-optional"]),"icon-rotation-alignment":new yo(It.layout_symbol["icon-rotation-alignment"]),"icon-size":new go(It.layout_symbol["icon-size"]),"icon-text-fit":new yo(It.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new yo(It.layout_symbol["icon-text-fit-padding"]),"icon-image":new go(It.layout_symbol["icon-image"]),"icon-rotate":new go(It.layout_symbol["icon-rotate"]),"icon-padding":new yo(It.layout_symbol["icon-padding"]),"icon-keep-upright":new yo(It.layout_symbol["icon-keep-upright"]),"icon-offset":new go(It.layout_symbol["icon-offset"]),"icon-anchor":new go(It.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new yo(It.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new yo(It.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new yo(It.layout_symbol["text-rotation-alignment"]),"text-field":new go(It.layout_symbol["text-field"]),"text-font":new go(It.layout_symbol["text-font"]),"text-size":new go(It.layout_symbol["text-size"]),"text-max-width":new go(It.layout_symbol["text-max-width"]),"text-line-height":new yo(It.layout_symbol["text-line-height"]),"text-letter-spacing":new go(It.layout_symbol["text-letter-spacing"]),"text-justify":new go(It.layout_symbol["text-justify"]),"text-radial-offset":new go(It.layout_symbol["text-radial-offset"]),"text-variable-anchor":new yo(It.layout_symbol["text-variable-anchor"]),"text-anchor":new go(It.layout_symbol["text-anchor"]),"text-max-angle":new yo(It.layout_symbol["text-max-angle"]),"text-writing-mode":new yo(It.layout_symbol["text-writing-mode"]),"text-rotate":new go(It.layout_symbol["text-rotate"]),"text-padding":new yo(It.layout_symbol["text-padding"]),"text-keep-upright":new yo(It.layout_symbol["text-keep-upright"]),"text-transform":new go(It.layout_symbol["text-transform"]),"text-offset":new go(It.layout_symbol["text-offset"]),"text-allow-overlap":new yo(It.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new yo(It.layout_symbol["text-ignore-placement"]),"text-optional":new yo(It.layout_symbol["text-optional"])}),xp={paint:new wo({"icon-opacity":new go(It.paint_symbol["icon-opacity"]),"icon-color":new go(It.paint_symbol["icon-color"]),"icon-halo-color":new go(It.paint_symbol["icon-halo-color"]),"icon-halo-width":new go(It.paint_symbol["icon-halo-width"]),"icon-halo-blur":new go(It.paint_symbol["icon-halo-blur"]),"icon-translate":new yo(It.paint_symbol["icon-translate"]),"icon-translate-anchor":new yo(It.paint_symbol["icon-translate-anchor"]),"text-opacity":new go(It.paint_symbol["text-opacity"]),"text-color":new go(It.paint_symbol["text-color"],{runtimeType:Vt,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new go(It.paint_symbol["text-halo-color"]),"text-halo-width":new go(It.paint_symbol["text-halo-width"]),"text-halo-blur":new go(It.paint_symbol["text-halo-blur"]),"text-translate":new yo(It.paint_symbol["text-translate"]),"text-translate-anchor":new yo(It.paint_symbol["text-translate-anchor"])}),layout:vp},bp=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:Bt,this.defaultValue=t};bp.prototype.evaluate=function(t){if(t.formattedSection){var e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default},bp.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},bp.prototype.outputDefined=function(){return!1},bp.prototype.serialize=function(){return null},Bi("FormatSectionOverride",bp,{omit:["defaultValue"]});var wp=function(t){function e(e){t.call(this,e,xp)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.recalculate=function(e,r){if(t.prototype.recalculate.call(this,e,r),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){var i=this.layout.get("text-writing-mode");if(i){for(var o=[],n=0,a=i;n<a.length;n+=1){var s=a[n];o.indexOf(s)<0&&o.push(s)}this.layout._values["text-writing-mode"]=o}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()},e.prototype.getValueAndResolveTokens=function(t,e,r,i){var o=this.layout.get(t).evaluate(e,{},r,i),n=this._unevaluatedLayout._values[t];return n.isDataDriven()||Zr(n.value)||!o?o:function(t,e){return e.replace(/{([^{}]+)}/g,(function(e,r){return r in t?String(t[r]):""}))}(e.properties,o)},e.prototype.createBucket=function(t){return new gp(t)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return!1},e.prototype._setPaintOverrides=function(){for(var t=0,r=xp.paint.overridableProperties;t<r.length;t+=1){var i=r[t];if(e.hasPaintOverride(this.layout,i)){var o,n=this.paint.get(i),a=new bp(n),s=new Hr(a,n.property.specification);o="constant"===n.value.kind||"source"===n.value.kind?new Qr("source",s):new Xr("composite",s,n.value.zoomStops,n.value._interpolationType),this.paint._values[i]=new mo(n.property,o,n.parameters)}}},e.prototype._handleOverridablePaintPropertyUpdate=function(t,r,i){return!(!this.layout||r.isDataDriven()||i.isDataDriven())&&e.hasPaintOverride(this.layout,t)},e.hasPaintOverride=function(t,e){var r=t.get("text-field"),i=xp.paint.properties[e],o=!1,n=function(t){for(var e=0,r=t;e<r.length;e+=1)if(i.overrides&&i.overrides.hasOverride(r[e]))return void(o=!0)};if("constant"===r.value.kind&&r.value.value instanceof oe)n(r.value.value.sections);else if("source"===r.value.kind){var a=function(t){o||(t instanceof ce&&le(t.value)===Zt?n(t.value.sections):t instanceof fe?n(t.sections):t.eachChild(a))},s=r.value;s._styleExpression&&a(s._styleExpression.expression)}return o},e}(Co),Cp={paint:new wo({"background-color":new yo(It.paint_background["background-color"]),"background-pattern":new xo(It.paint_background["background-pattern"]),"background-opacity":new yo(It.paint_background["background-opacity"])})},kp=function(t){function e(e){t.call(this,e,Cp)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(Co),Sp={paint:new wo({"raster-opacity":new yo(It.paint_raster["raster-opacity"]),"raster-hue-rotate":new yo(It.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new yo(It.paint_raster["raster-brightness-min"]),"raster-brightness-max":new yo(It.paint_raster["raster-brightness-max"]),"raster-saturation":new yo(It.paint_raster["raster-saturation"]),"raster-contrast":new yo(It.paint_raster["raster-contrast"]),"raster-resampling":new yo(It.paint_raster["raster-resampling"]),"raster-fade-duration":new yo(It.paint_raster["raster-fade-duration"])})},Mp=function(t){function e(e){t.call(this,e,Sp)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(Co),Ep=function(t){function e(e){t.call(this,e,{}),this.implementation=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.is3D=function(){return"3d"===this.implementation.renderingMode},e.prototype.hasOffscreenPass=function(){return void 0!==this.implementation.prerender},e.prototype.recalculate=function(){},e.prototype.updateTransitions=function(){},e.prototype.hasTransition=function(){},e.prototype.serialize=function(){},e.prototype.onAdd=function(t){this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl)},e.prototype.onRemove=function(t){this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl)},e}(Co),Tp={circle:da,heatmap:Ca,hillshade:Sa,fill:us,"fill-extrusion":Ts,line:Ns,symbol:wp,background:kp,raster:Mp},Ap=a.HTMLImageElement,Ip=a.HTMLCanvasElement,Pp=a.HTMLVideoElement,Lp=a.ImageData,zp=a.ImageBitmap,Rp=function(t,e,r,i){this.context=t,this.format=r,this.texture=t.gl.createTexture(),this.update(e,i)};Rp.prototype.update=function(t,e,r){var i=t.width,o=t.height,n=!(this.size&&this.size[0]===i&&this.size[1]===o||r),a=this.context,s=a.gl;if(this.useMipmap=Boolean(e&&e.useMipmap),s.bindTexture(s.TEXTURE_2D,this.texture),a.pixelStoreUnpackFlipY.set(!1),a.pixelStoreUnpack.set(1),a.pixelStoreUnpackPremultiplyAlpha.set(this.format===s.RGBA&&(!e||!1!==e.premultiply)),n)this.size=[i,o],t instanceof Ap||t instanceof Ip||t instanceof Pp||t instanceof Lp||zp&&t instanceof zp?s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,s.UNSIGNED_BYTE,t):s.texImage2D(s.TEXTURE_2D,0,this.format,i,o,0,this.format,s.UNSIGNED_BYTE,t.data);else{var l=r||{x:0,y:0},p=l.x,c=l.y;t instanceof Ap||t instanceof Ip||t instanceof Pp||t instanceof Lp||zp&&t instanceof zp?s.texSubImage2D(s.TEXTURE_2D,0,p,c,s.RGBA,s.UNSIGNED_BYTE,t):s.texSubImage2D(s.TEXTURE_2D,0,p,c,i,o,s.RGBA,s.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&s.generateMipmap(s.TEXTURE_2D)},Rp.prototype.bind=function(t,e,r){var i=this.context.gl;i.bindTexture(i.TEXTURE_2D,this.texture),r!==i.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(r=i.LINEAR),t!==this.filter&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,r||t),this.filter=t),e!==this.wrap&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,e),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,e),this.wrap=e)},Rp.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},Rp.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null};var Dp=function(t){var e=this;this._callback=t,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){e._triggered=!1,e._callback()})};Dp.prototype.trigger=function(){var t=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((function(){t._triggered=!1,t._callback()}),0))},Dp.prototype.remove=function(){delete this._channel,this._callback=function(){}};var Op=function(t,e,r){this.target=t,this.parent=e,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},y(["receive","process"],this),this.invoker=new Dp(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=M()?t:a};function Fp(t,e,r){var i=2*Math.PI*6378137/256/Math.pow(2,r);return[t*i-2*Math.PI*6378137/2,e*i-2*Math.PI*6378137/2]}Op.prototype.send=function(t,e,r,i,o){var n=this;void 0===o&&(o=!1);var a=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[a]=r);var s=A(this.globalScope)?void 0:[];return this.target.postMessage({id:a,type:t,hasCallback:!!r,targetMapId:i,mustQueue:o,sourceMapId:this.mapId,data:Vi(e,s)},s),{cancel:function(){r&&delete n.callbacks[a],n.target.postMessage({id:a,type:"<cancel>",targetMapId:i,sourceMapId:n.mapId})}}},Op.prototype.receive=function(t){var e=t.data,r=e.id;if(r&&(!e.targetMapId||this.mapId===e.targetMapId))if("<cancel>"===e.type){delete this.tasks[r];var i=this.cancelCallbacks[r];delete this.cancelCallbacks[r],i&&i()}else M()||e.mustQueue?(this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,e)},Op.prototype.process=function(){if(this.taskQueue.length){var t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),e&&this.processTask(t,e)}},Op.prototype.processTask=function(t,e){var r=this;if("<response>"===e.type){var i=this.callbacks[t];delete this.callbacks[t],i&&(e.error?i(qi(e.error)):i(null,qi(e.data)))}else{var o=!1,n=A(this.globalScope)?void 0:[],a=e.hasCallback?function(e,i){o=!0,delete r.cancelCallbacks[t],r.target.postMessage({id:t,type:"<response>",sourceMapId:r.mapId,error:e?Vi(e):null,data:Vi(i,n)},n)}:function(t){o=!0},s=null,l=qi(e.data);if(this.parent[e.type])s=this.parent[e.type](e.sourceMapId,l,a);else if(this.parent.getWorkerSource){var p=e.type.split(".");s=this.parent.getWorkerSource(e.sourceMapId,p[0],l.source)[p[1]](l,a)}else a(new Error("Could not find function "+e.type));!o&&s&&s.cancel&&(this.cancelCallbacks[t]=s.cancel)}},Op.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var Bp=function(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))};Bp.prototype.setNorthEast=function(t){return this._ne=t instanceof jp?new jp(t.lng,t.lat):jp.convert(t),this},Bp.prototype.setSouthWest=function(t){return this._sw=t instanceof jp?new jp(t.lng,t.lat):jp.convert(t),this},Bp.prototype.extend=function(t){var e,r,i=this._sw,o=this._ne;if(t instanceof jp)e=t,r=t;else{if(!(t instanceof Bp))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(Bp.convert(t)):this.extend(jp.convert(t)):this;if(r=t._ne,!(e=t._sw)||!r)return this}return i||o?(i.lng=Math.min(e.lng,i.lng),i.lat=Math.min(e.lat,i.lat),o.lng=Math.max(r.lng,o.lng),o.lat=Math.max(r.lat,o.lat)):(this._sw=new jp(e.lng,e.lat),this._ne=new jp(r.lng,r.lat)),this},Bp.prototype.getCenter=function(){return new jp((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Bp.prototype.getSouthWest=function(){return this._sw},Bp.prototype.getNorthEast=function(){return this._ne},Bp.prototype.getNorthWest=function(){return new jp(this.getWest(),this.getNorth())},Bp.prototype.getSouthEast=function(){return new jp(this.getEast(),this.getSouth())},Bp.prototype.getWest=function(){return this._sw.lng},Bp.prototype.getSouth=function(){return this._sw.lat},Bp.prototype.getEast=function(){return this._ne.lng},Bp.prototype.getNorth=function(){return this._ne.lat},Bp.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Bp.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Bp.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Bp.prototype.contains=function(t){var e=jp.convert(t),r=e.lng,i=e.lat,o=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(o=this._sw.lng>=r&&r>=this._ne.lng),this._sw.lat<=i&&i<=this._ne.lat&&o},Bp.convert=function(t){return!t||t instanceof Bp?t:new Bp(t)};var jp=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};jp.prototype.wrap=function(){return new jp(u(this.lng,-180,180),this.lat)},jp.prototype.toArray=function(){return[this.lng,this.lat]},jp.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},jp.prototype.distanceTo=function(t){var e=Math.PI/180,r=this.lat*e,i=t.lat*e,o=Math.sin(r)*Math.sin(i)+Math.cos(r)*Math.cos(i)*Math.cos((t.lng-this.lng)*e);return 6371008.8*Math.acos(Math.min(o,1))},jp.prototype.toBounds=function(t){void 0===t&&(t=0);var e=360*t/40075017,r=e/Math.cos(Math.PI/180*this.lat);return new Bp(new jp(this.lng-r,this.lat-e),new jp(this.lng+r,this.lat+e))},jp.convert=function(t){if(t instanceof jp)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new jp(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new jp(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")};var Np=2*Math.PI*6371008.8;function Up(t){return Np*Math.cos(t*Math.PI/180)}function Vp(t){return(180+t)/360}function qp(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function $p(t,e){return t/Up(e)}function Hp(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}var Zp=function(t,e,r){void 0===r&&(r=0),this.x=+t,this.y=+e,this.z=+r};Zp.fromLngLat=function(t,e){void 0===e&&(e=0);var r=jp.convert(t);return new Zp(Vp(r.lng),qp(r.lat),$p(e,r.lat))},Zp.prototype.toLngLat=function(){return new jp(360*this.x-180,Hp(this.y))},Zp.prototype.toAltitude=function(){return this.z*Up(Hp(this.y))},Zp.prototype.meterInMercatorCoordinateUnits=function(){return 1/Np*(t=Hp(this.y),1/Math.cos(t*Math.PI/180));var t};var Gp=function(t,e,r){this.z=t,this.x=e,this.y=r,this.key=Wp(0,t,t,e,r)};Gp.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},Gp.prototype.url=function(t,e){var r,i,o,n,a,s=(i=this.y,o=this.z,n=Fp(256*(r=this.x),256*(i=Math.pow(2,o)-i-1),o),a=Fp(256*(r+1),256*(i+1),o),n[0]+","+n[1]+","+a[0]+","+a[1]),l=function(t,e,r){for(var i,o="",n=t;n>0;n--)o+=(e&(i=1<<n-1)?1:0)+(r&i?2:0);return o}(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String("tms"===e?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",l).replace("{bbox-epsg-3857}",s)},Gp.prototype.getTilePoint=function(t){var e=Math.pow(2,this.z);return new o(8192*(t.x*e-this.x),8192*(t.y*e-this.y))},Gp.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var Qp=function(t,e){this.wrap=t,this.canonical=e,this.key=Wp(t,e.z,e.z,e.x,e.y)},Xp=function(t,e,r,i,o){this.overscaledZ=t,this.wrap=e,this.canonical=new Gp(r,+i,+o),this.key=Wp(e,t,r,i,o)};function Wp(t,e,r,i,o){(t*=2)<0&&(t=-1*t-1);var n=1<<r;return(n*n*t+n*o+i).toString(36)+r.toString(36)+e.toString(36)}Xp.prototype.equals=function(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)},Xp.prototype.scaledTo=function(t){var e=this.canonical.z-t;return t>this.canonical.z?new Xp(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Xp(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},Xp.prototype.calculateScaledKey=function(t,e){var r=this.canonical.z-t;return t>this.canonical.z?Wp(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):Wp(this.wrap*+e,t,t,this.canonical.x>>r,this.canonical.y>>r)},Xp.prototype.isChildOf=function(t){if(t.wrap!==this.wrap)return!1;var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ<this.overscaledZ&&t.canonical.x===this.canonical.x>>e&&t.canonical.y===this.canonical.y>>e},Xp.prototype.children=function(t){if(this.overscaledZ>=t)return[new Xp(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,r=2*this.canonical.x,i=2*this.canonical.y;return[new Xp(e,this.wrap,e,r,i),new Xp(e,this.wrap,e,r+1,i),new Xp(e,this.wrap,e,r,i+1),new Xp(e,this.wrap,e,r+1,i+1)]},Xp.prototype.isLessThan=function(t){return this.wrap<t.wrap||!(this.wrap>t.wrap)&&(this.overscaledZ<t.overscaledZ||!(this.overscaledZ>t.overscaledZ)&&(this.canonical.x<t.canonical.x||!(this.canonical.x>t.canonical.x)&&this.canonical.y<t.canonical.y))},Xp.prototype.wrapped=function(){return new Xp(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},Xp.prototype.unwrapTo=function(t){return new Xp(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)},Xp.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},Xp.prototype.toUnwrapped=function(){return new Qp(this.wrap,this.canonical)},Xp.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},Xp.prototype.getTilePoint=function(t){return this.canonical.getTilePoint(new Zp(t.x-this.wrap,t.y))},Bi("CanonicalTileID",Gp),Bi("OverscaledTileID",Xp,{omit:["posMatrix"]});var Kp=function(t,e,r){if(this.uid=t,e.height!==e.width)throw new RangeError("DEM tiles must be square");if(r&&"mapbox"!==r&&"terrarium"!==r)return C('"'+r+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');this.stride=e.height;var i=this.dim=e.height-2;this.data=new Uint32Array(e.data.buffer),this.encoding=r||"mapbox";for(var o=0;o<i;o++)this.data[this._idx(-1,o)]=this.data[this._idx(0,o)],this.data[this._idx(i,o)]=this.data[this._idx(i-1,o)],this.data[this._idx(o,-1)]=this.data[this._idx(o,0)],this.data[this._idx(o,i)]=this.data[this._idx(o,i-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(i,-1)]=this.data[this._idx(i-1,0)],this.data[this._idx(-1,i)]=this.data[this._idx(0,i-1)],this.data[this._idx(i,i)]=this.data[this._idx(i-1,i-1)]};Kp.prototype.get=function(t,e){var r=new Uint8Array(this.data.buffer),i=4*this._idx(t,e);return("terrarium"===this.encoding?this._unpackTerrarium:this._unpackMapbox)(r[i],r[i+1],r[i+2])},Kp.prototype.getUnpackVector=function(){return"terrarium"===this.encoding?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},Kp.prototype._idx=function(t,e){if(t<-1||t>=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)},Kp.prototype._unpackMapbox=function(t,e,r){return(256*t*256+256*e+r)/10-1e4},Kp.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},Kp.prototype.getPixels=function(){return new xa({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Kp.prototype.backfillBorder=function(t,e,r){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var i=e*this.dim,o=e*this.dim+this.dim,n=r*this.dim,a=r*this.dim+this.dim;switch(e){case-1:i=o-1;break;case 1:o=i+1}switch(r){case-1:n=a-1;break;case 1:a=n+1}for(var s=-e*this.dim,l=-r*this.dim,p=n;p<a;p++)for(var c=i;c<o;c++)this.data[this._idx(c,p)]=t.data[this._idx(c+s,p+l)]},Bi("DEMData",Kp);var Jp=function(t){this._stringToNumber={},this._numberToString=[];for(var e=0;e<t.length;e++){var r=t[e];this._stringToNumber[r]=e,this._numberToString[e]=r}};Jp.prototype.encode=function(t){return this._stringToNumber[t]},Jp.prototype.decode=function(t){return this._numberToString[t]};var Yp=function(t,e,r,i,o){this.type="Feature",this._vectorTileFeature=t,t._z=e,t._x=r,t._y=i,this.properties=t.properties,this.id=o},tc={geometry:{configurable:!0}};tc.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},tc.geometry.set=function(t){this._geometry=t},Yp.prototype.toJSON=function(){var t={geometry:this.geometry};for(var e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&(t[e]=this[e]);return t},Object.defineProperties(Yp.prototype,tc);var ec=function(){this.state={},this.stateChanges={},this.deletedStates={}};ec.prototype.updateState=function(t,e,r){var i=String(e);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][i]=this.stateChanges[t][i]||{},h(this.stateChanges[t][i],r),null===this.deletedStates[t])for(var o in this.deletedStates[t]={},this.state[t])o!==i&&(this.deletedStates[t][o]=null);else if(this.deletedStates[t]&&null===this.deletedStates[t][i])for(var n in this.deletedStates[t][i]={},this.state[t][i])r[n]||(this.deletedStates[t][i][n]=null);else for(var a in r)this.deletedStates[t]&&this.deletedStates[t][i]&&null===this.deletedStates[t][i][a]&&delete this.deletedStates[t][i][a]},ec.prototype.removeFeatureState=function(t,e,r){if(null!==this.deletedStates[t]){var i=String(e);if(this.deletedStates[t]=this.deletedStates[t]||{},r&&void 0!==e)null!==this.deletedStates[t][i]&&(this.deletedStates[t][i]=this.deletedStates[t][i]||{},this.deletedStates[t][i][r]=null);else if(void 0!==e)if(this.stateChanges[t]&&this.stateChanges[t][i])for(r in this.deletedStates[t][i]={},this.stateChanges[t][i])this.deletedStates[t][i][r]=null;else this.deletedStates[t][i]=null;else this.deletedStates[t]=null}},ec.prototype.getState=function(t,e){var r=String(e),i=h({},(this.state[t]||{})[r],(this.stateChanges[t]||{})[r]);if(null===this.deletedStates[t])return{};if(this.deletedStates[t]){var o=this.deletedStates[t][e];if(null===o)return{};for(var n in o)delete i[n]}return i},ec.prototype.initializeTileState=function(t,e){t.setFeatureState(this.state,e)},ec.prototype.coalesceChanges=function(t,e){var r={};for(var i in this.stateChanges){this.state[i]=this.state[i]||{};var o={};for(var n in this.stateChanges[i])this.state[i][n]||(this.state[i][n]={}),h(this.state[i][n],this.stateChanges[i][n]),o[n]=this.state[i][n];r[i]=o}for(var a in this.deletedStates){this.state[a]=this.state[a]||{};var s={};if(null===this.deletedStates[a])for(var l in this.state[a])s[l]={},this.state[a][l]={};else for(var p in this.deletedStates[a]){if(null===this.deletedStates[a][p])this.state[a][p]={};else for(var c=0,u=Object.keys(this.deletedStates[a][p]);c<u.length;c+=1)delete this.state[a][p][u[c]];s[p]=this.state[a][p]}r[a]=r[a]||{},h(r[a],s)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(r).length)for(var d in t)t[d].setFeatureState(r,e)};var rc=function(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new zi(8192,16,0),this.grid3D=new zi(8192,16,0),this.featureIndexArray=new sn,this.promoteId=e};function ic(t,e,r,i,o){return v(t,(function(t,n){var a=e instanceof _o?e.get(n):null;return a&&a.evaluate?a.evaluate(r,i,o):a}))}function oc(t){for(var e=1/0,r=1/0,i=-1/0,o=-1/0,n=0,a=t;n<a.length;n+=1){var s=a[n];e=Math.min(e,s.x),r=Math.min(r,s.y),i=Math.max(i,s.x),o=Math.max(o,s.y)}return{minX:e,minY:r,maxX:i,maxY:o}}function nc(t,e){return e-t}rc.prototype.insert=function(t,e,r,i,o,n){var a=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,i,o);for(var s=n?this.grid3D:this.grid,l=0;l<e.length;l++){for(var p=e[l],c=[1/0,1/0,-1/0,-1/0],u=0;u<p.length;u++){var h=p[u];c[0]=Math.min(c[0],h.x),c[1]=Math.min(c[1],h.y),c[2]=Math.max(c[2],h.x),c[3]=Math.max(c[3],h.y)}c[0]<8192&&c[1]<8192&&c[2]>=0&&c[3]>=0&&s.insert(a,c[0],c[1],c[2],c[3])}},rc.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new bs.VectorTile(new Ks(this.rawTileData)).layers,this.sourceLayerCoder=new Jp(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},rc.prototype.query=function(t,e,r,i){var n=this;this.loadVTLayers();for(var a=t.params||{},s=8192/t.tileSize/t.scale,l=ai(a.filter),p=t.queryGeometry,c=t.queryPadding*s,u=oc(p),h=this.grid.query(u.minX-c,u.minY-c,u.maxX+c,u.maxY+c),d=oc(t.cameraQueryGeometry),f=this.grid3D.query(d.minX-c,d.minY-c,d.maxX+c,d.maxY+c,(function(e,r,i,n){return function(t,e,r,i,n){for(var a=0,s=t;a<s.length;a+=1){var l=s[a];if(e<=l.x&&r<=l.y&&i>=l.x&&n>=l.y)return!0}var p=[new o(e,r),new o(e,n),new o(i,n),new o(i,r)];if(t.length>2)for(var c=0,u=p;c<u.length;c+=1)if(ta(t,u[c]))return!0;for(var h=0;h<t.length-1;h++)if(ea(t[h],t[h+1],p))return!0;return!1}(t.cameraQueryGeometry,e-c,r-c,i+c,n+c)})),m=0,_=f;m<_.length;m+=1)h.push(_[m]);h.sort(nc);for(var y,g={},v=function(o){var c=h[o];if(c!==y){y=c;var u=n.featureIndexArray.get(c),d=null;n.loadMatchingFeature(g,u.bucketIndex,u.sourceLayerIndex,u.featureIndex,l,a.layers,a.availableImages,e,r,i,(function(e,r,i){return d||(d=Un(e)),r.queryIntersectsFeature(p,e,i,d,n.z,t.transform,s,t.pixelPosMatrix)}))}},x=0;x<h.length;x++)v(x);return g},rc.prototype.loadMatchingFeature=function(t,e,r,i,o,n,a,s,l,p,c){var u=this.bucketLayerIDs[e];if(!n||function(t,e){for(var r=0;r<t.length;r++)if(e.indexOf(t[r])>=0)return!0;return!1}(n,u)){var d=this.sourceLayerCoder.decode(r),f=this.vtLayers[d].feature(i);if(o.needGeometry){var m=Vn(f,!0);if(!o.filter(new so(this.tileID.overscaledZ),m,this.tileID.canonical))return}else if(!o.filter(new so(this.tileID.overscaledZ),f))return;for(var _=this.getId(f,d),y=0;y<u.length;y++){var g=u[y];if(!(n&&n.indexOf(g)<0)){var v=s[g];if(v){var x={};void 0!==_&&p&&(x=p.getState(v.sourceLayer||"_geojsonTileLayer",_));var b=h({},l[g]);b.paint=ic(b.paint,v.paint,f,x,a),b.layout=ic(b.layout,v.layout,f,x,a);var w=!c||c(f,v,x);if(w){var C=new Yp(f,this.z,this.x,this.y,_);C.layer=b;var k=t[g];void 0===k&&(k=t[g]=[]),k.push({featureIndex:i,feature:C,intersectionZ:w})}}}}}},rc.prototype.lookupSymbolFeatures=function(t,e,r,i,o,n,a,s){var l={};this.loadVTLayers();for(var p=ai(o),c=0,u=t;c<u.length;c+=1)this.loadMatchingFeature(l,r,i,u[c],p,n,a,s,e);return l},rc.prototype.hasLayer=function(t){for(var e=0,r=this.bucketLayerIDs;e<r.length;e+=1)for(var i=0,o=r[e];i<o.length;i+=1)if(t===o[i])return!0;return!1},rc.prototype.getId=function(t,e){var r=t.id;return this.promoteId&&"boolean"==typeof(r=t.properties["string"==typeof this.promoteId?this.promoteId:this.promoteId[e]])&&(r=Number(r)),r},Bi("FeatureIndex",rc,{omit:["rawTileData","sourceLayerCoder"]});var ac=function(t,e){this.tileID=t,this.uid=f(),this.uses=0,this.tileSize=e,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.expiredRequestCount=0,this.state="loading"};ac.prototype.registerFadeDuration=function(t){var e=t+this.timeAdded;e<B.now()||this.fadeEndTime&&e<this.fadeEndTime||(this.fadeEndTime=e)},ac.prototype.wasRequested=function(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state},ac.prototype.loadVectorData=function(t,e,r){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){for(var i in t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestFeatureIndex.rawTileData=t.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=function(t,e){var r={};if(!e)return r;for(var i=function(){var t=n[o],i=t.layerIds.map((function(t){return e.getLayer(t)})).filter(Boolean);if(0!==i.length){t.layers=i,t.stateDependentLayerIds&&(t.stateDependentLayers=t.stateDependentLayerIds.map((function(t){return i.filter((function(e){return e.id===t}))[0]})));for(var a=0,s=i;a<s.length;a+=1)r[s[a].id]=t}},o=0,n=t;o<n.length;o+=1)i();return r}(t.buckets,e.style),this.hasSymbolBuckets=!1,this.buckets){var o=this.buckets[i];if(o instanceof gp){if(this.hasSymbolBuckets=!0,!r)break;o.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(var n in this.buckets){var a=this.buckets[n];if(a instanceof gp&&a.hasRTLText){this.hasRTLText=!0,ao.isLoading()||ao.isLoaded()||"deferred"!==oo()||no();break}}for(var s in this.queryPadding=0,this.buckets){var l=this.buckets[s];this.queryPadding=Math.max(this.queryPadding,e.style.getLayer(s).queryRadius(l))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new Jo},ac.prototype.unloadVectorData=function(){for(var t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"},ac.prototype.getBucket=function(t){return this.buckets[t.id]},ac.prototype.upload=function(t){for(var e in this.buckets){var r=this.buckets[e];r.uploadPending()&&r.upload(t)}var i=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Rp(t,this.imageAtlas.image,i.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Rp(t,this.glyphAtlasImage,i.ALPHA),this.glyphAtlasImage=null)},ac.prototype.prepare=function(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)},ac.prototype.queryRenderedFeatures=function(t,e,r,i,o,n,a,s,l,p){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:i,cameraQueryGeometry:o,scale:n,tileSize:this.tileSize,pixelPosMatrix:p,transform:s,params:a,queryPadding:this.queryPadding*l},t,e,r):{}},ac.prototype.querySourceFeatures=function(t,e){var r=this.latestFeatureIndex;if(r&&r.rawTileData){var i=r.loadVTLayers(),o=e?e.sourceLayer:"",n=i._geojsonTileLayer||i[o];if(n)for(var a=ai(e&&e.filter),s=this.tileID.canonical,l=s.z,p=s.x,c=s.y,u={z:l,x:p,y:c},h=0;h<n.length;h++){var d=n.feature(h);if(a.needGeometry){var f=Vn(d,!0);if(!a.filter(new so(this.tileID.overscaledZ),f,this.tileID.canonical))continue}else if(!a.filter(new so(this.tileID.overscaledZ),d))continue;var m=r.getId(d,o),_=new Yp(d,l,p,c,m);_.tile=u,t.push(_)}}},ac.prototype.hasData=function(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state},ac.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},ac.prototype.setExpiryData=function(t){var e=this.expirationTime;if(t.cacheControl){var r=E(t.cacheControl);r["max-age"]&&(this.expirationTime=Date.now()+1e3*r["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){var i=Date.now(),o=!1;if(this.expirationTime>i)o=!1;else if(e)if(this.expirationTime<e)o=!0;else{var n=this.expirationTime-e;n?this.expirationTime=i+Math.max(n,3e4):o=!0}else o=!0;o?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}},ac.prototype.getExpiryTimeout=function(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-(new Date).getTime(),Math.pow(2,31)-1)},ac.prototype.setFeatureState=function(t,e){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData&&0!==Object.keys(t).length){var r=this.latestFeatureIndex.loadVTLayers();for(var i in this.buckets)if(e.style.hasLayer(i)){var o=this.buckets[i],n=o.layers[0].sourceLayer||"_geojsonTileLayer",a=r[n],s=t[n];if(a&&s&&0!==Object.keys(s).length){o.update(s,a,this.imageAtlas&&this.imageAtlas.patternPositions||{});var l=e&&e.style&&e.style.getLayer(i);l&&(this.queryPadding=Math.max(this.queryPadding,l.queryRadius(o)))}}}},ac.prototype.holdingForFade=function(){return void 0!==this.symbolFadeHoldUntil},ac.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<B.now()},ac.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},ac.prototype.setHoldDuration=function(t){this.symbolFadeHoldUntil=B.now()+t},ac.prototype.setDependencies=function(t,e){for(var r={},i=0,o=e;i<o.length;i+=1)r[o[i]]=!0;this.dependencies[t]=r},ac.prototype.hasDependency=function(t,e){for(var r=0,i=t;r<i.length;r+=1){var o=this.dependencies[i[r]];if(o)for(var n=0,a=e;n<a.length;n+=1)if(o[a[n]])return!0}return!1};var sc=a.performance,lc=function(t){this._marks={start:[t.url,"start"].join("#"),end:[t.url,"end"].join("#"),measure:t.url.toString()},sc.mark(this._marks.start)};lc.prototype.finish=function(){sc.mark(this._marks.end);var t=sc.getEntriesByName(this._marks.measure);return 0===t.length&&(sc.measure(this._marks.measure,this._marks.start,this._marks.end),t=sc.getEntriesByName(this._marks.measure),sc.clearMarks(this._marks.start),sc.clearMarks(this._marks.end),sc.clearMeasures(this._marks.measure)),t},t.Actor=Op,t.AlphaImage=va,t.CanonicalTileID=Gp,t.CollisionBoxArray=Jo,t.Color=ee,t.DEMData=Kp,t.DataConstantProperty=yo,t.DictionaryCoder=Jp,t.EXTENT=8192,t.ErrorEvent=Tt,t.EvaluationParameters=so,t.Event=Et,t.Evented=At,t.FeatureIndex=rc,t.FillBucket=ls,t.FillExtrusionBucket=Ss,t.ImageAtlas=bl,t.ImagePosition=vl,t.LineBucket=Os,t.LngLat=jp,t.LngLatBounds=Bp,t.MercatorCoordinate=Zp,t.ONE_EM=24,t.OverscaledTileID=Xp,t.Point=o,t.Point$1=o,t.Properties=wo,t.Protobuf=Ks,t.RGBAImage=xa,t.RequestManager=H,t.RequestPerformance=lc,t.ResourceType=ft,t.SegmentVector=pn,t.SourceFeatureState=ec,t.StructArrayLayout1ui2=Xo,t.StructArrayLayout2f1f2i16=No,t.StructArrayLayout2i4=Ao,t.StructArrayLayout3ui6=Vo,t.StructArrayLayout4i8=Io,t.SymbolBucket=gp,t.Texture=Rp,t.Tile=ac,t.Transitionable=co,t.Uniform1f=wn,t.Uniform1i=bn,t.Uniform2f=Cn,t.Uniform3f=kn,t.Uniform4f=Sn,t.UniformColor=Mn,t.UniformMatrix4f=Tn,t.UnwrappedTileID=Qp,t.ValidationError=Pt,t.WritingMode=wl,t.ZoomHistory=$i,t.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t},t.addDynamicAttributes=fp,t.asyncAll=function(t,e,r){if(!t.length)return r(null,[]);var i=t.length,o=new Array(t.length),n=null;t.forEach((function(t,a){e(t,(function(t,e){t&&(n=t),o[a]=e,0==--i&&r(n,o)}))}))},t.bezier=l,t.bindAll=y,t.browser=B,t.cacheEntryPossiblyAdded=function(t){++ht>lt&&(t.getActor().send("enforceCacheSizeLimit",st),ht=0)},t.clamp=c,t.clearTileCache=function(t){var e=a.caches.delete("mapbox-tiles");t&&e.catch(t).then((function(){return t()}))},t.clipLine=Gl,t.clone=function(t){var e=new sa(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},t.clone$1=b,t.clone$2=function(t){var e=new sa(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},t.collisionCircleLayout=Zs,t.config=j,t.create=function(){var t=new sa(16);return sa!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.create$1=function(){var t=new sa(9);return sa!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t},t.create$2=function(){var t=new sa(4);return sa!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},t.createCommonjsModule=e,t.createExpression=Gr,t.createLayout=Eo,t.createStyleLayer=function(t){return"custom"===t.type?new Ep(t):new Tp[t.type](t)},t.cross=function(t,e,r){var i=e[0],o=e[1],n=e[2],a=r[0],s=r[1],l=r[2];return t[0]=o*l-n*s,t[1]=n*a-i*l,t[2]=i*s-o*a,t},t.deepEqual=function t(e,r){if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(var i=0;i<e.length;i++)if(!t(e[i],r[i]))return!1;return!0}if("object"==typeof e&&null!==e&&null!==r){if("object"!=typeof r)return!1;if(Object.keys(e).length!==Object.keys(r).length)return!1;for(var o in e)if(!t(e[o],r[o]))return!1;return!0}return e===r},t.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]},t.dot$1=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},t.ease=p,t.emitValidationErrors=Li,t.endsWith=g,t.enforceCacheSizeLimit=function(t){pt(),tt&&tt.then((function(e){e.keys().then((function(r){for(var i=0;i<r.length-t;i++)e.delete(r[i])}))}))},t.evaluateSizeForFeature=Bl,t.evaluateSizeForZoom=jl,t.evaluateVariableOffset=ap,t.evented=io,t.extend=h,t.featureFilter=ai,t.filterObject=x,t.fromRotation=function(t,e){var r=Math.sin(e),i=Math.cos(e);return t[0]=i,t[1]=r,t[2]=0,t[3]=-r,t[4]=i,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},t.getAnchorAlignment=zl,t.getAnchorJustification=sp,t.getArrayBuffer=bt,t.getImage=kt,t.getJSON=function(t,e){return xt(h(t,{type:"json"}),e)},t.getRTLTextPluginStatus=oo,t.getReferrer=_t,t.getVideo=function(t,e){var r,i,o=a.document.createElement("video");o.muted=!0,o.onloadstart=function(){e(null,o)};for(var n=0;n<t.length;n++){var s=a.document.createElement("source");r=t[n],i=void 0,(i=a.document.createElement("a")).href=r,(i.protocol!==a.document.location.protocol||i.host!==a.document.location.host)&&(o.crossOrigin="Anonymous"),s.src=t[n],o.appendChild(s)}return{cancel:function(){}}},t.identity=la,t.invert=function(t,e){var r=e[0],i=e[1],o=e[2],n=e[3],a=e[4],s=e[5],l=e[6],p=e[7],c=e[8],u=e[9],h=e[10],d=e[11],f=e[12],m=e[13],_=e[14],y=e[15],g=r*s-i*a,v=r*l-o*a,x=r*p-n*a,b=i*l-o*s,w=i*p-n*s,C=o*p-n*l,k=c*m-u*f,S=c*_-h*f,M=c*y-d*f,E=u*_-h*m,T=u*y-d*m,A=h*y-d*_,I=g*A-v*T+x*E+b*M-w*S+C*k;return I?(t[0]=(s*A-l*T+p*E)*(I=1/I),t[1]=(o*T-i*A-n*E)*I,t[2]=(m*C-_*w+y*b)*I,t[3]=(h*w-u*C-d*b)*I,t[4]=(l*M-a*A-p*S)*I,t[5]=(r*A-o*M+n*S)*I,t[6]=(_*x-f*C-y*v)*I,t[7]=(c*C-h*x+d*v)*I,t[8]=(a*T-s*M+p*k)*I,t[9]=(i*M-r*T-n*k)*I,t[10]=(f*w-m*x+y*g)*I,t[11]=(u*x-c*w-d*g)*I,t[12]=(s*S-a*E-l*k)*I,t[13]=(r*E-i*S+o*k)*I,t[14]=(m*v-f*b-_*g)*I,t[15]=(c*b-u*v+h*g)*I,t):null},t.isChar=Hi,t.isMapboxURL=Z,t.keysDifference=function(t,e){var r=[];for(var i in t)i in e||r.push(i);return r},t.makeRequest=xt,t.mapObject=v,t.mercatorXfromLng=Vp,t.mercatorYfromLat=qp,t.mercatorZfromAltitude=$p,t.mul=ua,t.multiply=pa,t.mvt=bs,t.nextPowerOfTwo=function(t){return t<=1?1:Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},t.normalize=function(t,e){var r=e[0],i=e[1],o=e[2],n=r*r+i*i+o*o;return n>0&&(n=1/Math.sqrt(n)),t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t},t.number=He,t.offscreenCanvasSupported=dt,t.ortho=function(t,e,r,i,o,n,a){var s=1/(e-r),l=1/(i-o),p=1/(n-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*p,t[11]=0,t[12]=(e+r)*s,t[13]=(o+i)*l,t[14]=(a+n)*p,t[15]=1,t},t.parseGlyphPBF=function(t){return new Ks(t).readFields(ml,[])},t.pbf=Ks,t.performSymbolLayout=function(t,e,r,i,o,n,a){t.createArrays(),t.tilePixelRatio=8192/(512*t.overscaling),t.compareText={},t.iconsNeedLinear=!1;var s=t.layers[0].layout,l=t.layers[0]._unevaluatedLayout._values,p={};if("composite"===t.textSizeData.kind){var c=t.textSizeData,u=c.maxZoom;p.compositeTextSizes=[l["text-size"].possiblyEvaluate(new so(c.minZoom),a),l["text-size"].possiblyEvaluate(new so(u),a)]}if("composite"===t.iconSizeData.kind){var h=t.iconSizeData,d=h.maxZoom;p.compositeIconSizes=[l["icon-size"].possiblyEvaluate(new so(h.minZoom),a),l["icon-size"].possiblyEvaluate(new so(d),a)]}p.layoutTextSize=l["text-size"].possiblyEvaluate(new so(t.zoom+1),a),p.layoutIconSize=l["icon-size"].possiblyEvaluate(new so(t.zoom+1),a),p.textMaxSize=l["text-size"].possiblyEvaluate(new so(18));for(var f=24*s.get("text-line-height"),m="map"===s.get("text-rotation-alignment")&&"point"!==s.get("symbol-placement"),_=s.get("text-keep-upright"),y=s.get("text-size"),g=function(){var n=x[v],l=s.get("text-font").evaluate(n,{},a).join(","),c=y.evaluate(n,{},a),u=p.layoutTextSize.evaluate(n,{},a),h=p.layoutIconSize.evaluate(n,{},a),d={horizontal:{},vertical:void 0},g=n.text,b=[0,0];if(g){var w=g.toString(),k=24*s.get("text-letter-spacing").evaluate(n,{},a),S=function(t){for(var e=0,r=t;e<r.length;e+=1)if(i=r[e].charCodeAt(0),Hi.Arabic(i)||Hi["Arabic Supplement"](i)||Hi["Arabic Extended-A"](i)||Hi["Arabic Presentation Forms-A"](i)||Hi["Arabic Presentation Forms-B"](i))return!1;var i;return!0}(w)?k:0,M=s.get("text-anchor").evaluate(n,{},a),E=s.get("text-variable-anchor");if(!E){var T=s.get("text-radial-offset").evaluate(n,{},a);b=T?ap(M,[24*T,np]):s.get("text-offset").evaluate(n,{},a).map((function(t){return 24*t}))}var A=m?"center":s.get("text-justify").evaluate(n,{},a),I=s.get("symbol-placement"),P="point"===I?24*s.get("text-max-width").evaluate(n,{},a):0,L=function(){t.allowVerticalPlacement&&Zi(w)&&(d.vertical=Sl(g,e,r,o,l,P,f,M,"left",S,b,wl.vertical,!0,I,u,c))};if(!m&&E){for(var z="auto"===A?E.map((function(t){return sp(t)})):[A],R=!1,D=0;D<z.length;D++){var O=z[D];if(!d.horizontal[O])if(R)d.horizontal[O]=d.horizontal[0];else{var F=Sl(g,e,r,o,l,P,f,"center",O,S,b,wl.horizontal,!1,I,u,c);F&&(d.horizontal[O]=F,R=1===F.positionedLines.length)}}L()}else{"auto"===A&&(A=sp(M));var B=Sl(g,e,r,o,l,P,f,M,A,S,b,wl.horizontal,!1,I,u,c);B&&(d.horizontal[A]=B),L(),Zi(w)&&m&&_&&(d.vertical=Sl(g,e,r,o,l,P,f,M,A,S,b,wl.vertical,!1,I,u,c))}}var j=void 0,N=!1;if(n.icon&&n.icon.name){var U=i[n.icon.name];U&&(j=function(t,e,r){var i=zl(r),o=e[0]-t.displaySize[0]*i.horizontalAlign,n=e[1]-t.displaySize[1]*i.verticalAlign;return{image:t,top:n,bottom:n+t.displaySize[1],left:o,right:o+t.displaySize[0]}}(o[n.icon.name],s.get("icon-offset").evaluate(n,{},a),s.get("icon-anchor").evaluate(n,{},a)),N=U.sdf,void 0===t.sdfIcons?t.sdfIcons=U.sdf:t.sdfIcons!==U.sdf&&C("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(U.pixelRatio!==t.pixelRatio||0!==s.get("icon-rotate").constantOr(1))&&(t.iconsNeedLinear=!0))}var V=pp(d.horizontal)||d.vertical;t.iconsInText=!!V&&V.iconsInText,(V||j)&&function(t,e,r,i,o,n,a,s,l,p,c){var u=n.textMaxSize.evaluate(e,{});void 0===u&&(u=a);var h,d=t.layers[0].layout,f=d.get("icon-offset").evaluate(e,{},c),m=pp(r.horizontal),_=a/24,y=t.tilePixelRatio*_,g=t.tilePixelRatio*u/24,v=t.tilePixelRatio*s,x=t.tilePixelRatio*d.get("symbol-spacing"),b=d.get("text-padding")*t.tilePixelRatio,w=d.get("icon-padding")*t.tilePixelRatio,k=d.get("text-max-angle")/180*Math.PI,S="map"===d.get("text-rotation-alignment")&&"point"!==d.get("symbol-placement"),M="map"===d.get("icon-rotation-alignment")&&"point"!==d.get("symbol-placement"),E=d.get("symbol-placement"),T=x/2,A=d.get("icon-text-fit");i&&"none"!==A&&(t.allowVerticalPlacement&&r.vertical&&(h=Dl(i,r.vertical,A,d.get("icon-text-fit-padding"),f,_)),m&&(i=Dl(i,m,A,d.get("icon-text-fit-padding"),f,_)));var I=function(s,u){u.x<0||u.x>=8192||u.y<0||u.y>=8192||function(t,e,r,i,o,n,a,s,l,p,c,u,h,d,f,m,_,y,g,v,x,b,w,k,S){var M,E,T,A,I,P=t.addToLineVertexArray(e,r),L=0,z=0,R=0,D=0,O=-1,F=-1,B={},j=fn(""),N=0,U=0;if(void 0===s._unevaluatedLayout.getValue("text-radial-offset")?(N=(M=s.layout.get("text-offset").evaluate(x,{},k).map((function(t){return 24*t})))[0],U=M[1]):(N=24*s.layout.get("text-radial-offset").evaluate(x,{},k),U=np),t.allowVerticalPlacement&&i.vertical){var V=s.layout.get("text-rotate").evaluate(x,{},k)+90;A=new Yl(l,e,p,c,u,i.vertical,h,d,f,V),a&&(I=new Yl(l,e,p,c,u,a,_,y,f,V))}if(o){var q=s.layout.get("icon-rotate").evaluate(x,{}),$="none"!==s.layout.get("icon-text-fit"),H=Ql(o,q,w,$),Z=a?Ql(a,q,w,$):void 0;T=new Yl(l,e,p,c,u,o,_,y,!1,q),L=4*H.length;var G=t.iconSizeData,Q=null;"source"===G.kind?(Q=[128*s.layout.get("icon-size").evaluate(x,{})])[0]>32640&&C(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):"composite"===G.kind&&((Q=[128*b.compositeIconSizes[0].evaluate(x,{},k),128*b.compositeIconSizes[1].evaluate(x,{},k)])[0]>32640||Q[1]>32640)&&C(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),t.addSymbols(t.icon,H,Q,v,g,x,!1,e,P.lineStartIndex,P.lineLength,-1,k),O=t.icon.placedSymbolArray.length-1,Z&&(z=4*Z.length,t.addSymbols(t.icon,Z,Q,v,g,x,wl.vertical,e,P.lineStartIndex,P.lineLength,-1,k),F=t.icon.placedSymbolArray.length-1)}for(var X in i.horizontal){var W=i.horizontal[X];if(!E){j=fn(W.text);var K=s.layout.get("text-rotate").evaluate(x,{},k);E=new Yl(l,e,p,c,u,W,h,d,f,K)}var J=1===W.positionedLines.length;if(R+=lp(t,e,W,n,s,f,x,m,P,i.vertical?wl.horizontal:wl.horizontalOnly,J?Object.keys(i.horizontal):[X],B,O,b,k),J)break}i.vertical&&(D+=lp(t,e,i.vertical,n,s,f,x,m,P,wl.vertical,["vertical"],B,F,b,k));var Y=E?E.boxStartIndex:t.collisionBoxArray.length,tt=E?E.boxEndIndex:t.collisionBoxArray.length,et=A?A.boxStartIndex:t.collisionBoxArray.length,rt=A?A.boxEndIndex:t.collisionBoxArray.length,it=T?T.boxStartIndex:t.collisionBoxArray.length,ot=T?T.boxEndIndex:t.collisionBoxArray.length,nt=I?I.boxStartIndex:t.collisionBoxArray.length,at=I?I.boxEndIndex:t.collisionBoxArray.length,st=-1,lt=function(t,e){return t&&t.circleDiameter?Math.max(t.circleDiameter,e):e};st=lt(E,st),st=lt(A,st),st=lt(T,st);var pt=(st=lt(I,st))>-1?1:0;pt&&(st*=S/24),t.glyphOffsetArray.length>=gp.MAX_GLYPHS&&C("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==x.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,x.sortKey),t.symbolInstances.emplaceBack(e.x,e.y,B.right>=0?B.right:-1,B.center>=0?B.center:-1,B.left>=0?B.left:-1,B.vertical||-1,O,F,j,Y,tt,et,rt,it,ot,nt,at,p,R,D,L,z,pt,0,h,N,U,st)}(t,u,s,r,i,o,h,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,y,b,S,l,v,w,M,f,e,n,p,c,a)};if("line"===E)for(var P=0,L=Gl(e.geometry,0,0,8192,8192);P<L.length;P+=1)for(var z=L[P],R=0,D=Zl(z,x,k,r.vertical||m,i,24,g,t.overscaling,8192);R<D.length;R+=1){var O=D[R];m&&cp(t,m.text,T,O)||I(z,O)}else if("line-center"===E)for(var F=0,B=e.geometry;F<B.length;F+=1){var j=B[F];if(j.length>1){var N=Hl(j,k,r.vertical||m,i,24,g);N&&I(j,N)}}else if("Polygon"===e.type)for(var U=0,V=os(e.geometry,0);U<V.length;U+=1){var q=V[U],$=rp(q,16);I(q[0],new Ol($.x,$.y,0))}else if("LineString"===e.type)for(var H=0,Z=e.geometry;H<Z.length;H+=1){var G=Z[H];I(G,new Ol(G[0].x,G[0].y,0))}else if("Point"===e.type)for(var Q=0,X=e.geometry;Q<X.length;Q+=1)for(var W=0,K=X[Q];W<K.length;W+=1){var J=K[W];I([J],new Ol(J.x,J.y,0))}}(t,n,d,j,i,p,u,h,b,N,a)},v=0,x=t.features;v<x.length;v+=1)g();n&&t.generateCollisionDebugBuffers()},t.perspective=function(t,e,r,i,o){var n,a=1/Math.tan(e/2);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=o&&o!==1/0?(t[10]=(o+i)*(n=1/(i-o)),t[14]=2*o*i*n):(t[10]=-1,t[14]=-2*i),t},t.pick=function(t,e){for(var r={},i=0;i<e.length;i++){var o=e[i];o in t&&(r[o]=t[o])}return r},t.plugin=ao,t.polygonIntersectsPolygon=Hn,t.postMapLoadEvent=at,t.postTurnstileEvent=ot,t.potpack=gl,t.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],t.register=Bi,t.registerForPluginStateChange=function(t){return t({pluginStatus:Yi,pluginURL:to}),io.on("pluginStateChange",t),t},t.renderColorRamp=wa,t.rotate=function(t,e,r){var i=e[0],o=e[1],n=e[2],a=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=i*l+n*s,t[1]=o*l+a*s,t[2]=i*-s+n*l,t[3]=o*-s+a*l,t},t.rotateX=function(t,e,r){var i=Math.sin(r),o=Math.cos(r),n=e[4],a=e[5],s=e[6],l=e[7],p=e[8],c=e[9],u=e[10],h=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=n*o+p*i,t[5]=a*o+c*i,t[6]=s*o+u*i,t[7]=l*o+h*i,t[8]=p*o-n*i,t[9]=c*o-a*i,t[10]=u*o-s*i,t[11]=h*o-l*i,t},t.rotateZ=function(t,e,r){var i=Math.sin(r),o=Math.cos(r),n=e[0],a=e[1],s=e[2],l=e[3],p=e[4],c=e[5],u=e[6],h=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=n*o+p*i,t[1]=a*o+c*i,t[2]=s*o+u*i,t[3]=l*o+h*i,t[4]=p*o-n*i,t[5]=c*o-a*i,t[6]=u*o-s*i,t[7]=h*o-l*i,t},t.scale=function(t,e,r){var i=r[0],o=r[1],n=r[2];return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*o,t[5]=e[5]*o,t[6]=e[6]*o,t[7]=e[7]*o,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},t.scale$1=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t},t.scale$2=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t},t.setCacheLimits=function(t,e){st=t,lt=e},t.setRTLTextPlugin=function(t,e,r){if(void 0===r&&(r=!1),"deferred"===Yi||"loading"===Yi||"loaded"===Yi)throw new Error("setRTLTextPlugin cannot be called multiple times.");to=B.resolveURL(t),Yi="deferred",Ji=e,ro(),r||no()},t.sphericalToCartesian=function(t){var e=t[0],r=t[1],i=t[2];return r+=90,r*=Math.PI/180,i*=Math.PI/180,{x:e*Math.cos(r)*Math.sin(i),y:e*Math.sin(r)*Math.sin(i),z:e*Math.cos(i)}},t.sqrLen=function(t){var e=t[0],r=t[1];return e*e+r*r},t.styleSpec=It,t.sub=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t},t.symbolSize=Nl,t.transformMat3=function(t,e,r){var i=e[0],o=e[1],n=e[2];return t[0]=i*r[0]+o*r[3]+n*r[6],t[1]=i*r[1]+o*r[4]+n*r[7],t[2]=i*r[2]+o*r[5]+n*r[8],t},t.transformMat4=ha,t.translate=function(t,e,r){var i,o,n,a,s,l,p,c,u,h,d,f,m=r[0],_=r[1],y=r[2];return e===t?(t[12]=e[0]*m+e[4]*_+e[8]*y+e[12],t[13]=e[1]*m+e[5]*_+e[9]*y+e[13],t[14]=e[2]*m+e[6]*_+e[10]*y+e[14],t[15]=e[3]*m+e[7]*_+e[11]*y+e[15]):(o=e[1],n=e[2],a=e[3],s=e[4],l=e[5],p=e[6],c=e[7],u=e[8],h=e[9],d=e[10],f=e[11],t[0]=i=e[0],t[1]=o,t[2]=n,t[3]=a,t[4]=s,t[5]=l,t[6]=p,t[7]=c,t[8]=u,t[9]=h,t[10]=d,t[11]=f,t[12]=i*m+s*_+u*y+e[12],t[13]=o*m+l*_+h*y+e[13],t[14]=n*m+p*_+d*y+e[14],t[15]=a*m+c*_+f*y+e[15]),t},t.triggerPluginCompletionEvent=eo,t.uniqueId=f,t.validateCustomStyleLayer=function(t){var e=[],r=t.id;return void 0===r&&e.push({message:"layers."+r+': missing required property "id"'}),void 0===t.render&&e.push({message:"layers."+r+': missing required method "render"'}),t.renderingMode&&"2d"!==t.renderingMode&&"3d"!==t.renderingMode&&e.push({message:"layers."+r+': property "renderingMode" must be either "2d" or "3d"'}),e},t.validateLight=Ai,t.validateStyle=Ti,t.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},t.vectorTile=bs,t.version="1.15.2",t.warnOnce=C,t.webpSupported=N,t.window=a,t.wrap=u}));i(0,(function(t){function e(t){var r=typeof t;if("number"===r||"boolean"===r||"string"===r||null==t)return JSON.stringify(t);if(Array.isArray(t)){for(var i="[",o=0,n=t;o<n.length;o+=1)i+=e(n[o])+",";return i+"]"}for(var a=Object.keys(t).sort(),s="{",l=0;l<a.length;l++)s+=JSON.stringify(a[l])+":"+e(t[a[l]])+",";return s+"}"}function r(r){for(var i="",o=0,n=t.refProperties;o<n.length;o+=1)i+="/"+e(r[n[o]]);return i}var i=function(t){this.keyCache={},t&&this.replace(t)};i.prototype.replace=function(t){this._layerConfigs={},this._layers={},this.update(t,[])},i.prototype.update=function(e,i){for(var o=this,n=0,a=e;n<a.length;n+=1){var s=a[n];this._layerConfigs[s.id]=s;var l=this._layers[s.id]=t.createStyleLayer(s);l._featureFilter=t.featureFilter(l.filter),this.keyCache[s.id]&&delete this.keyCache[s.id]}for(var p=0,c=i;p<c.length;p+=1){var u=c[p];delete this.keyCache[u],delete this._layerConfigs[u],delete this._layers[u]}this.familiesBySource={};for(var h=0,d=function(t,e){for(var i={},o=0;o<t.length;o++){var n=e&&e[t[o].id]||r(t[o]);e&&(e[t[o].id]=n);var a=i[n];a||(a=i[n]=[]),a.push(t[o])}var s=[];for(var l in i)s.push(i[l]);return s}(t.values(this._layerConfigs),this.keyCache);h<d.length;h+=1){var f=d[h].map((function(t){return o._layers[t.id]})),m=f[0];if("none"!==m.visibility){var _=m.source||"",y=this.familiesBySource[_];y||(y=this.familiesBySource[_]={});var g=m.sourceLayer||"_geojsonTileLayer",v=y[g];v||(v=y[g]=[]),v.push(f)}}};var o=function(e){var r={},i=[];for(var o in e){var n=e[o],a=r[o]={};for(var s in n){var l=n[+s];if(l&&0!==l.bitmap.width&&0!==l.bitmap.height){var p={x:0,y:0,w:l.bitmap.width+2,h:l.bitmap.height+2};i.push(p),a[s]={rect:p,metrics:l.metrics}}}}var c=t.potpack(i),u=new t.AlphaImage({width:c.w||1,height:c.h||1});for(var h in e){var d=e[h];for(var f in d){var m=d[+f];if(m&&0!==m.bitmap.width&&0!==m.bitmap.height){var _=r[h][f].rect;t.AlphaImage.copy(m.bitmap,u,{x:0,y:0},{x:_.x+1,y:_.y+1},m.bitmap)}}}this.image=u,this.positions=r};t.register("GlyphAtlas",o);var n=function(e){this.tileID=new t.OverscaledTileID(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.uid=e.uid,this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=e.showCollisionBoxes,this.collectResourceTiming=!!e.collectResourceTiming,this.returnDependencies=!!e.returnDependencies,this.promoteId=e.promoteId};function a(e,r,i){for(var o=new t.EvaluationParameters(r),n=0,a=e;n<a.length;n+=1)a[n].recalculate(o,i)}function s(e,r){var i=t.getArrayBuffer(e.request,(function(e,i,o,n){e?r(e):i&&r(null,{vectorTile:new t.vectorTile.VectorTile(new t.pbf(i)),rawData:i,cacheControl:o,expires:n})}));return function(){i.cancel(),r()}}n.prototype.parse=function(e,r,i,n,s){var l=this;this.status="parsing",this.data=e,this.collisionBoxArray=new t.CollisionBoxArray;var p=new t.DictionaryCoder(Object.keys(e.layers).sort()),c=new t.FeatureIndex(this.tileID,this.promoteId);c.bucketLayerIDs=[];var u,h,d,f,m={},_={featureIndex:c,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:i},y=r.familiesBySource[this.source];for(var g in y){var v=e.layers[g];if(v){1===v.version&&t.warnOnce('Vector tile source "'+this.source+'" layer "'+g+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var x=p.encode(g),b=[],w=0;w<v.length;w++){var C=v.feature(w),k=c.getId(C,g);b.push({feature:C,id:k,index:w,sourceLayerIndex:x})}for(var S=0,M=y[g];S<M.length;S+=1){var E=M[S],T=E[0];T.minzoom&&this.zoom<Math.floor(T.minzoom)||T.maxzoom&&this.zoom>=T.maxzoom||"none"!==T.visibility&&(a(E,this.zoom,i),(m[T.id]=T.createBucket({index:c.bucketLayerIDs.length,layers:E,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:x,sourceID:this.source})).populate(b,_,this.tileID.canonical),c.bucketLayerIDs.push(E.map((function(t){return t.id}))))}}}var A=t.mapObject(_.glyphDependencies,(function(t){return Object.keys(t).map(Number)}));Object.keys(A).length?n.send("getGlyphs",{uid:this.uid,stacks:A},(function(t,e){u||(u=t,h=e,L.call(l))})):h={};var I=Object.keys(_.iconDependencies);I.length?n.send("getImages",{icons:I,source:this.source,tileID:this.tileID,type:"icons"},(function(t,e){u||(u=t,d=e,L.call(l))})):d={};var P=Object.keys(_.patternDependencies);function L(){if(u)return s(u);if(h&&d&&f){var e=new o(h),r=new t.ImageAtlas(d,f);for(var n in m){var l=m[n];l instanceof t.SymbolBucket?(a(l.layers,this.zoom,i),t.performSymbolLayout(l,h,e.positions,d,r.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):l.hasPattern&&(l instanceof t.LineBucket||l instanceof t.FillBucket||l instanceof t.FillExtrusionBucket)&&(a(l.layers,this.zoom,i),l.addFeatures(_,this.tileID.canonical,r.patternPositions))}this.status="done",s(null,{buckets:t.values(m).filter((function(t){return!t.isEmpty()})),featureIndex:c,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:e.image,imageAtlas:r,glyphMap:this.returnDependencies?h:null,iconMap:this.returnDependencies?d:null,glyphPositions:this.returnDependencies?e.positions:null})}}P.length?n.send("getImages",{icons:P,source:this.source,tileID:this.tileID,type:"patterns"},(function(t,e){u||(u=t,f=e,L.call(l))})):f={},L.call(this)};var l=function(t,e,r,i){this.actor=t,this.layerIndex=e,this.availableImages=r,this.loadVectorData=i||s,this.loading={},this.loaded={}};l.prototype.loadTile=function(e,r){var i=this,o=e.uid;this.loading||(this.loading={});var a=!!(e&&e.request&&e.request.collectResourceTiming)&&new t.RequestPerformance(e.request),s=this.loading[o]=new n(e);s.abort=this.loadVectorData(e,(function(e,n){if(delete i.loading[o],e||!n)return s.status="done",i.loaded[o]=s,r(e);var l=n.rawData,p={};n.expires&&(p.expires=n.expires),n.cacheControl&&(p.cacheControl=n.cacheControl);var c={};if(a){var u=a.finish();u&&(c.resourceTiming=JSON.parse(JSON.stringify(u)))}s.vectorTile=n.vectorTile,s.parse(n.vectorTile,i.layerIndex,i.availableImages,i.actor,(function(e,i){if(e||!i)return r(e);r(null,t.extend({rawTileData:l.slice(0)},i,p,c))})),i.loaded=i.loaded||{},i.loaded[o]=s}))},l.prototype.reloadTile=function(t,e){var r=this,i=this.loaded,o=t.uid,n=this;if(i&&i[o]){var a=i[o];a.showCollisionBoxes=t.showCollisionBoxes;var s=function(t,i){var o=a.reloadCallback;o&&(delete a.reloadCallback,a.parse(a.vectorTile,n.layerIndex,r.availableImages,n.actor,o)),e(t,i)};"parsing"===a.status?a.reloadCallback=s:"done"===a.status&&(a.vectorTile?a.parse(a.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s())}},l.prototype.abortTile=function(t,e){var r=this.loading,i=t.uid;r&&r[i]&&r[i].abort&&(r[i].abort(),delete r[i]),e()},l.prototype.removeTile=function(t,e){var r=this.loaded,i=t.uid;r&&r[i]&&delete r[i],e()};var p=t.window.ImageBitmap,c=function(){this.loaded={}};function u(t,e){if(0!==t.length){h(t[0],e);for(var r=1;r<t.length;r++)h(t[r],!e)}}function h(t,e){for(var r=0,i=0,o=t.length,n=o-1;i<o;n=i++)r+=(t[i][0]-t[n][0])*(t[n][1]+t[i][1]);r>=0!=!!e&&t.reverse()}c.prototype.loadTile=function(e,r){var i=e.uid,o=e.encoding,n=e.rawImageData,a=p&&n instanceof p?this.getImageData(n):n,s=new t.DEMData(i,a,o);this.loaded=this.loaded||{},this.loaded[i]=s,r(null,s)},c.prototype.getImageData=function(e){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(e.width,e.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=e.width,this.offscreenCanvas.height=e.height,this.offscreenCanvasContext.drawImage(e,0,0,e.width,e.height);var r=this.offscreenCanvasContext.getImageData(-1,-1,e.width+2,e.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new t.RGBAImage({width:r.width,height:r.height},r.data)},c.prototype.removeTile=function(t){var e=this.loaded,r=t.uid;e&&e[r]&&delete e[r]};var d=t.vectorTile.VectorTileFeature.prototype.toGeoJSON,f=function(e){this._feature=e,this.extent=t.EXTENT,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))};f.prototype.loadGeometry=function(){if(1===this._feature.type){for(var e=[],r=0,i=this._feature.geometry;r<i.length;r+=1){var o=i[r];e.push([new t.Point$1(o[0],o[1])])}return e}for(var n=[],a=0,s=this._feature.geometry;a<s.length;a+=1){for(var l=[],p=0,c=s[a];p<c.length;p+=1){var u=c[p];l.push(new t.Point$1(u[0],u[1]))}n.push(l)}return n},f.prototype.toGeoJSON=function(t,e,r){return d.call(this,t,e,r)};var m=function(e){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=t.EXTENT,this.length=e.length,this._features=e};m.prototype.feature=function(t){return new f(this._features[t])};var _=t.vectorTile.VectorTileFeature,y=g;function g(t,e){this.options=e||{},this.features=t,this.length=t.length}function v(t,e){this.id="number"==typeof t.id?t.id:void 0,this.type=t.type,this.rawGeometry=1===t.type?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=e||4096}g.prototype.feature=function(t){return new v(this.features[t],this.options.extent)},v.prototype.loadGeometry=function(){var e=this.rawGeometry;this.geometry=[];for(var r=0;r<e.length;r++){for(var i=e[r],o=[],n=0;n<i.length;n++)o.push(new t.Point$1(i[n][0],i[n][1]));this.geometry.push(o)}return this.geometry},v.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var t=this.geometry,e=1/0,r=-1/0,i=1/0,o=-1/0,n=0;n<t.length;n++)for(var a=t[n],s=0;s<a.length;s++){var l=a[s];e=Math.min(e,l.x),r=Math.max(r,l.x),i=Math.min(i,l.y),o=Math.max(o,l.y)}return[e,i,r,o]},v.prototype.toGeoJSON=_.prototype.toGeoJSON;var x=w,b=y;function w(e){var r=new t.pbf;return function(t,e){for(var r in t.layers)e.writeMessage(3,C,t.layers[r])}(e,r),r.finish()}function C(t,e){var r;e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||""),e.writeVarintField(5,t.extent||4096);var i={keys:[],values:[],keycache:{},valuecache:{}};for(r=0;r<t.length;r++)i.feature=t.feature(r),e.writeMessage(2,k,i);var o=i.keys;for(r=0;r<o.length;r++)e.writeStringField(3,o[r]);var n=i.values;for(r=0;r<n.length;r++)e.writeMessage(4,A,n[r])}function k(t,e){var r=t.feature;void 0!==r.id&&e.writeVarintField(1,r.id),e.writeMessage(2,S,t),e.writeVarintField(3,r.type),e.writeMessage(4,T,r)}function S(t,e){var r=t.feature,i=t.keys,o=t.values,n=t.keycache,a=t.valuecache;for(var s in r.properties){var l=n[s];void 0===l&&(i.push(s),n[s]=l=i.length-1),e.writeVarint(l);var p=r.properties[s],c=typeof p;"string"!==c&&"boolean"!==c&&"number"!==c&&(p=JSON.stringify(p));var u=c+":"+p,h=a[u];void 0===h&&(o.push(p),a[u]=h=o.length-1),e.writeVarint(h)}}function M(t,e){return(e<<3)+(7&t)}function E(t){return t<<1^t>>31}function T(t,e){for(var r=t.loadGeometry(),i=t.type,o=0,n=0,a=r.length,s=0;s<a;s++){var l=r[s],p=1;1===i&&(p=l.length),e.writeVarint(M(1,p));for(var c=3===i?l.length-1:l.length,u=0;u<c;u++){1===u&&1!==i&&e.writeVarint(M(2,c-1));var h=l[u].x-o,d=l[u].y-n;e.writeVarint(E(h)),e.writeVarint(E(d)),o+=h,n+=d}3===i&&e.writeVarint(M(7,1))}}function A(t,e){var r=typeof t;"string"===r?e.writeStringField(1,t):"boolean"===r?e.writeBooleanField(7,t):"number"===r&&(t%1!=0?e.writeDoubleField(3,t):t<0?e.writeSVarintField(6,t):e.writeVarintField(5,t))}function I(t,e,r,i){P(t,r,i),P(e,2*r,2*i),P(e,2*r+1,2*i+1)}function P(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function L(t,e,r,i){var o=t-r,n=e-i;return o*o+n*n}x.fromVectorTileJs=w,x.fromGeojsonVt=function(t,e){e=e||{};var r={};for(var i in t)r[i]=new y(t[i].features,e),r[i].name=i,r[i].version=e.version,r[i].extent=e.extent;return w({layers:r})},x.GeoJSONWrapper=b;var z=function(t){return t[0]},R=function(t){return t[1]},D=function(t,e,r,i,o){void 0===e&&(e=z),void 0===r&&(r=R),void 0===i&&(i=64),void 0===o&&(o=Float64Array),this.nodeSize=i,this.points=t;for(var n=t.length<65536?Uint16Array:Uint32Array,a=this.ids=new n(t.length),s=this.coords=new o(2*t.length),l=0;l<t.length;l++)a[l]=l,s[2*l]=e(t[l]),s[2*l+1]=r(t[l]);!function t(e,r,i,o,n,a){if(!(n-o<=i)){var s=o+n>>1;!function t(e,r,i,o,n,a){for(;n>o;){if(n-o>600){var s=n-o+1,l=i-o+1,p=Math.log(s),c=.5*Math.exp(2*p/3),u=.5*Math.sqrt(p*c*(s-c)/s)*(l-s/2<0?-1:1);t(e,r,i,Math.max(o,Math.floor(i-l*c/s+u)),Math.min(n,Math.floor(i+(s-l)*c/s+u)),a)}var h=r[2*i+a],d=o,f=n;for(I(e,r,o,i),r[2*n+a]>h&&I(e,r,o,n);d<f;){for(I(e,r,d,f),d++,f--;r[2*d+a]<h;)d++;for(;r[2*f+a]>h;)f--}r[2*o+a]===h?I(e,r,o,f):I(e,r,++f,n),f<=i&&(o=f+1),i<=f&&(n=f-1)}}(e,r,s,o,n,a%2),t(e,r,i,o,s-1,a+1),t(e,r,i,s+1,n,a+1)}}(a,s,i,0,a.length-1,0)};D.prototype.range=function(t,e,r,i){return function(t,e,r,i,o,n,a){for(var s,l,p=[0,t.length-1,0],c=[];p.length;){var u=p.pop(),h=p.pop(),d=p.pop();if(h-d<=a)for(var f=d;f<=h;f++)l=e[2*f+1],(s=e[2*f])>=r&&s<=o&&l>=i&&l<=n&&c.push(t[f]);else{var m=Math.floor((d+h)/2);l=e[2*m+1],(s=e[2*m])>=r&&s<=o&&l>=i&&l<=n&&c.push(t[m]);var _=(u+1)%2;(0===u?r<=s:i<=l)&&(p.push(d),p.push(m-1),p.push(_)),(0===u?o>=s:n>=l)&&(p.push(m+1),p.push(h),p.push(_))}}return c}(this.ids,this.coords,t,e,r,i,this.nodeSize)},D.prototype.within=function(t,e,r){return function(t,e,r,i,o,n){for(var a=[0,t.length-1,0],s=[],l=o*o;a.length;){var p=a.pop(),c=a.pop(),u=a.pop();if(c-u<=n)for(var h=u;h<=c;h++)L(e[2*h],e[2*h+1],r,i)<=l&&s.push(t[h]);else{var d=Math.floor((u+c)/2),f=e[2*d],m=e[2*d+1];L(f,m,r,i)<=l&&s.push(t[d]);var _=(p+1)%2;(0===p?r-o<=f:i-o<=m)&&(a.push(u),a.push(d-1),a.push(_)),(0===p?r+o>=f:i+o>=m)&&(a.push(d+1),a.push(c),a.push(_))}}return s}(this.ids,this.coords,t,e,r,this.nodeSize)};var O={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(t){return t}},F=function(t){this.options=$(Object.create(O),t),this.trees=new Array(this.options.maxZoom+1)};function B(t,e,r,i,o){return{x:t,y:e,zoom:1/0,id:r,parentId:-1,numPoints:i,properties:o}}function j(t,e){var r=t.geometry.coordinates,i=r[1];return{x:V(r[0]),y:q(i),zoom:1/0,index:e,parentId:-1}}function N(t){return{type:"Feature",id:t.id,properties:U(t),geometry:{type:"Point",coordinates:[(i=t.x,360*(i-.5)),(e=t.y,r=(180-360*e)*Math.PI/180,360*Math.atan(Math.exp(r))/Math.PI-90)]}};var e,r,i}function U(t){var e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return $($({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function V(t){return t/360+.5}function q(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function $(t,e){for(var r in e)t[r]=e[r];return t}function H(t){return t.x}function Z(t){return t.y}function G(t,e,r,i,o,n){var a=o-r,s=n-i;if(0!==a||0!==s){var l=((t-r)*a+(e-i)*s)/(a*a+s*s);l>1?(r=o,i=n):l>0&&(r+=a*l,i+=s*l)}return(a=t-r)*a+(s=e-i)*s}function Q(t,e,r,i){var o={id:void 0===t?null:t,type:e,geometry:r,tags:i,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,r=t.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)X(t,e);else if("Polygon"===r||"MultiLineString"===r)for(var i=0;i<e.length;i++)X(t,e[i]);else if("MultiPolygon"===r)for(i=0;i<e.length;i++)for(var o=0;o<e[i].length;o++)X(t,e[i][o])}(o),o}function X(t,e){for(var r=0;r<e.length;r+=3)t.minX=Math.min(t.minX,e[r]),t.minY=Math.min(t.minY,e[r+1]),t.maxX=Math.max(t.maxX,e[r]),t.maxY=Math.max(t.maxY,e[r+1])}function W(t,e,r,i){if(e.geometry){var o=e.geometry.coordinates,n=e.geometry.type,a=Math.pow(r.tolerance/((1<<r.maxZoom)*r.extent),2),s=[],l=e.id;if(r.promoteId?l=e.properties[r.promoteId]:r.generateId&&(l=i||0),"Point"===n)K(o,s);else if("MultiPoint"===n)for(var p=0;p<o.length;p++)K(o[p],s);else if("LineString"===n)J(o,s,a,!1);else if("MultiLineString"===n){if(r.lineMetrics){for(p=0;p<o.length;p++)J(o[p],s=[],a,!1),t.push(Q(l,"LineString",s,e.properties));return}Y(o,s,a,!1)}else if("Polygon"===n)Y(o,s,a,!0);else{if("MultiPolygon"!==n){if("GeometryCollection"===n){for(p=0;p<e.geometry.geometries.length;p++)W(t,{id:l,geometry:e.geometry.geometries[p],properties:e.properties},r,i);return}throw new Error("Input data is not a valid GeoJSON object.")}for(p=0;p<o.length;p++){var c=[];Y(o[p],c,a,!0),s.push(c)}}t.push(Q(l,n,s,e.properties))}}function K(t,e){e.push(tt(t[0])),e.push(et(t[1])),e.push(0)}function J(t,e,r,i){for(var o,n,a=0,s=0;s<t.length;s++){var l=tt(t[s][0]),p=et(t[s][1]);e.push(l),e.push(p),e.push(0),s>0&&(a+=i?(o*p-l*n)/2:Math.sqrt(Math.pow(l-o,2)+Math.pow(p-n,2))),o=l,n=p}var c=e.length-3;e[2]=1,function t(e,r,i,o){for(var n,a=o,s=i-r>>
vendor: 4,374 bytes, line 1
11,l=i-r,p=e[r],c=e[r+1],u=e[i],h=e[i+1],d=r+3;d<i;d+=3){var f=G(e[d],e[d+1],p,c,u,h);if(f>a)n=d,a=f;else if(f===a){var m=Math.abs(d-s);m<l&&(n=d,l=m)}}a>o&&(n-r>3&&t(e,r,n,o),e[n+2]=a,i-n>3&&t(e,n,i,o))}(e,0,c,r),e[c+2]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}function Y(t,e,r,i){for(var o=0;o<t.length;o++){var n=[];J(t[o],n,r,i),e.push(n)}}function tt(t){return t/360+.5}function et(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function rt(t,e,r,i,o,n,a,s){if(i/=e,n>=(r/=e)&&a<i)return t;if(a<r||n>=i)return null;for(var l=[],p=0;p<t.length;p++){var c=t[p],u=c.geometry,h=c.type,d=0===o?c.minX:c.minY,f=0===o?c.maxX:c.maxY;if(d>=r&&f<i)l.push(c);else if(!(f<r||d>=i)){var m=[];if("Point"===h||"MultiPoint"===h)it(u,m,r,i,o);else if("LineString"===h)ot(u,m,r,i,o,!1,s.lineMetrics);else if("MultiLineString"===h)at(u,m,r,i,o,!1);else if("Polygon"===h)at(u,m,r,i,o,!0);else if("MultiPolygon"===h)for(var _=0;_<u.length;_++){var y=[];at(u[_],y,r,i,o,!0),y.length&&m.push(y)}if(m.length){if(s.lineMetrics&&"LineString"===h){for(_=0;_<m.length;_++)l.push(Q(c.id,h,m[_],c.tags));continue}"LineString"!==h&&"MultiLineString"!==h||(1===m.length?(h="LineString",m=m[0]):h="MultiLineString"),"Point"!==h&&"MultiPoint"!==h||(h=3===m.length?"Point":"MultiPoint"),l.push(Q(c.id,h,m,c.tags))}}}return l.length?l:null}function it(t,e,r,i,o){for(var n=0;n<t.length;n+=3){var a=t[n+o];a>=r&&a<=i&&(e.push(t[n]),e.push(t[n+1]),e.push(t[n+2]))}}function ot(t,e,r,i,o,n,a){for(var s,l,p=nt(t),c=0===o?lt:pt,u=t.start,h=0;h<t.length-3;h+=3){var d=t[h],f=t[h+1],m=t[h+2],_=t[h+3],y=t[h+4],g=0===o?d:f,v=0===o?_:y,x=!1;a&&(s=Math.sqrt(Math.pow(d-_,2)+Math.pow(f-y,2))),g<r?v>r&&(l=c(p,d,f,_,y,r),a&&(p.start=u+s*l)):g>i?v<i&&(l=c(p,d,f,_,y,i),a&&(p.start=u+s*l)):st(p,d,f,m),v<r&&g>=r&&(l=c(p,d,f,_,y,r),x=!0),v>i&&g<=i&&(l=c(p,d,f,_,y,i),x=!0),!n&&x&&(a&&(p.end=u+s*l),e.push(p),p=nt(t)),a&&(u+=s)}var b=t.length-3;d=t[b],f=t[b+1],m=t[b+2],(g=0===o?d:f)>=r&&g<=i&&st(p,d,f,m),b=p.length-3,n&&b>=3&&(p[b]!==p[0]||p[b+1]!==p[1])&&st(p,p[0],p[1],p[2]),p.length&&e.push(p)}function nt(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function at(t,e,r,i,o,n){for(var a=0;a<t.length;a++)ot(t[a],e,r,i,o,n,!1)}function st(t,e,r,i){t.push(e),t.push(r),t.push(i)}function lt(t,e,r,i,o,n){var a=(n-e)/(i-e);return t.push(n),t.push(r+(o-r)*a),t.push(1),a}function pt(t,e,r,i,o,n){var a=(n-r)/(o-r);return t.push(e+(i-e)*a),t.push(n),t.push(1),a}function ct(t,e){for(var r=[],i=0;i<t.length;i++){var o,n=t[i],a=n.type;if("Point"===a||"MultiPoint"===a||"LineString"===a)o=ut(n.geometry,e);else if("MultiLineString"===a||"Polygon"===a){o=[];for(var s=0;s<n.geometry.length;s++)o.push(ut(n.geometry[s],e))}else if("MultiPolygon"===a)for(o=[],s=0;s<n.geometry.length;s++){for(var l=[],p=0;p<n.geometry[s].length;p++)l.push(ut(n.geometry[s][p],e));o.push(l)}r.push(Q(n.id,a,o,n.tags))}return r}function ut(t,e){var r=[];r.size=t.size,void 0!==t.start&&(r.start=t.start,r.end=t.end);for(var i=0;i<t.length;i+=3)r.push(t[i]+e,t[i+1],t[i+2]);return r}function ht(t,e){if(t.transformed)return t;var r,i,o,n=1<<t.z,a=t.x,s=t.y;for(r=0;r<t.features.length;r++){var l=t.features[r],p=l.geometry,c=l.type;if(l.geometry=[],1===c)for(i=0;i<p.length;i+=2)l.geometry.push(dt(p[i],p[i+1],e,n,a,s));else for(i=0;i<p.length;i++){var u=[];for(o=0;o<p[i].length;o+=2)u.push(dt(p[i][o],p[i][o+1],e,n,a,s));l.geometry.push(u)}}return t.transformed=!0,t}function dt(t,e,r,i,o,n){return[Math.round(r*(t*i-o)),Math.round(r*(e*i-n))]}function ft(t,e,r,i,o){for(var n=e===o.maxZoom?0:o.tolerance/((1<<e)*o.extent),a={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:i,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},s=0;s<t.length;s++){a.numFeatures++,mt(a,t[s],n,o);var l=t[s].minX,p=t[s].minY,c=t[s].maxX,u=t[s].maxY;l<a.minX&&(a.minX=l),p<a.minY&&(a.minY=p),c>a.maxX&&(a.maxX=c),u>a.maxY&&(a.maxY=u)}return a}function mt(t,e,r,i){var o=e.geometry,n=e.type,a=[];if("Point"===n||"MultiPoint"===n)for(var s=0;s<o.length;s+=3)a.push(o[s]),a.push(o[s+1]),t.numPoints++,t.numSimplified++;else if("LineString"===n)_t(a,o,t,r,!1,!1);else if("MultiLineString"===n||"Polygon"===n)for(s=0;s<o.length;s++)_t(a,o[s],t,r,"Polygon"===n,0===s);else if("MultiPolygon"===n)for(var l=0;l<o.length;l++){var p=o[l];for(s=0;s<p.length;s++)_t(a,p[s],t,r,!0,0===s)}
vendor: 17,334 bytes, line 1
1if(a.length){var c=e.tags||null;if("LineString"===n&&i.lineMetrics){for(var u in c={},e.tags)c[u]=e.tags[u];c.mapbox_clip_start=o.start/o.size,c.mapbox_clip_end=o.end/o.size}var h={geometry:a,type:"Polygon"===n||"MultiPolygon"===n?3:"LineString"===n||"MultiLineString"===n?2:1,tags:c};null!==e.id&&(h.id=e.id),t.features.push(h)}}function _t(t,e,r,i,o,n){var a=i*i;if(i>0&&e.size<(o?a:i))r.numPoints+=e.length/3;else{for(var s=[],l=0;l<e.length;l+=3)(0===i||e[l+2]>a)&&(r.numSimplified++,s.push(e[l]),s.push(e[l+1])),r.numPoints++;o&&function(t,e){for(var r=0,i=0,o=t.length,n=o-2;i<o;n=i,i+=2)r+=(t[i]-t[n])*(t[i+1]+t[n+1]);if(r>0===e)for(i=0,o=t.length;i<o/2;i+=2){var a=t[i],s=t[i+1];t[i]=t[o-2-i],t[i+1]=t[o-1-i],t[o-2-i]=a,t[o-1-i]=s}}(s,n),t.push(s)}}function yt(t,e){var r=(e=this.options=function(t,e){for(var r in e)t[r]=e[r];return t}(Object.create(this.options),e)).debug;if(r&&console.time("preprocess data"),e.maxZoom<0||e.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var i=function(t,e){var r=[];if("FeatureCollection"===t.type)for(var i=0;i<t.features.length;i++)W(r,t.features[i],e,i);else W(r,"Feature"===t.type?t:{geometry:t},e);return r}(t,e);this.tiles={},this.tileCoords=[],r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(i=function(t,e){var r=e.buffer/e.extent,i=t,o=rt(t,1,-1-r,r,0,-1,2,e),n=rt(t,1,1-r,2+r,0,-1,2,e);return(o||n)&&(i=rt(t,1,-r,1+r,0,-1,2,e)||[],o&&(i=ct(o,1).concat(i)),n&&(i=i.concat(ct(n,-1)))),i}(i,e)).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 gt(t,e,r){return 32*((1<<t)*r+e)+t}function vt(t,e){var r=t.tileID.canonical;if(!this._geoJSONIndex)return e(null,null);var i=this._geoJSONIndex.getTile(r.z,r.x,r.y);if(!i)return e(null,null);var o=new m(i.features),n=x(o);0===n.byteOffset&&n.byteLength===n.buffer.byteLength||(n=new Uint8Array(n)),e(null,{vectorTile:o,rawData:n.buffer})}F.prototype.load=function(t){var e=this.options,r=e.log,i=e.minZoom,o=e.maxZoom,n=e.nodeSize;r&&console.time("total time");var a="prepare "+t.length+" points";r&&console.time(a),this.points=t;for(var s=[],l=0;l<t.length;l++)t[l].geometry&&s.push(j(t[l],l));this.trees[o+1]=new D(s,H,Z,n,Float32Array),r&&console.timeEnd(a);for(var p=o;p>=i;p--){var c=+Date.now();s=this._cluster(s,p),this.trees[p]=new D(s,H,Z,n,Float32Array),r&&console.log("z%d: %d clusters in %dms",p,s.length,+Date.now()-c)}return r&&console.timeEnd("total time"),this},F.prototype.getClusters=function(t,e){var r=((t[0]+180)%360+360)%360-180,i=Math.max(-90,Math.min(90,t[1])),o=180===t[2]?180:((t[2]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,o=180;else if(r>o){var a=this.getClusters([r,i,180,n],e),s=this.getClusters([-180,i,o,n],e);return a.concat(s)}for(var l=this.trees[this._limitZoom(e)],p=[],c=0,u=l.range(V(r),q(n),V(o),q(i));c<u.length;c+=1){var h=l.points[u[c]];p.push(h.numPoints?N(h):this.points[h.index])}return p},F.prototype.getChildren=function(t){var e=this._getOriginId(t),r=this._getOriginZoom(t),i="No cluster with the specified id.",o=this.trees[r];if(!o)throw new Error(i);var n=o.points[e];if(!n)throw new Error(i);for(var a=this.options.radius/(this.options.extent*Math.pow(2,r-1)),s=[],l=0,p=o.within(n.x,n.y,a);l<p.length;l+=1){var c=o.points[p[l]];c.parentId===t&&s.push(c.numPoints?N(c):this.points[c.index])}if(0===s.length)throw new Error(i);return s},F.prototype.getLeaves=function(t,e,r){var i=[];return this._appendLeaves(i,t,e=e||10,r=r||0,0),i},F.prototype.getTile=function(t,e,r){var i=this.trees[this._limitZoom(t)],o=Math.pow(2,t),n=this.options,a=n.radius/n.extent,s=(r-a)/o,l=(r+1+a)/o,p={features:[]};return this._addTileFeatures(i.range((e-a)/o,s,(e+1+a)/o,l),i.points,e,r,o,p),0===e&&this._addTileFeatures(i.range(1-a/o,s,1,l),i.points,o,r,o,p),e===o-1&&this._addTileFeatures(i.range(0,s,a/o,l),i.points,-1,r,o,p),p.features.length?p:null},F.prototype.getClusterExpansionZoom=function(t){for(var e=this._getOriginZoom(t)-1;e<=this.options.maxZoom;){var r=this.getChildren(t);if(e++,1!==r.length)break;t=r[0].properties.cluster_id}return e},F.prototype._appendLeaves=function(t,e,r,i,o){for(var n=0,a=this.getChildren(e);n<a.length;n+=1){var s=a[n],l=s.properties;if(l&&l.cluster?o+l.point_count<=i?o+=l.point_count:o=this._appendLeaves(t,l.cluster_id,r,i,o):o<i?o++:t.push(s),t.length===r)break}return o},F.prototype._addTileFeatures=function(t,e,r,i,o,n){for(var a=0,s=t;a<s.length;a+=1){var l=e[s[a]],p=l.numPoints,c={type:1,geometry:[[Math.round(this.options.extent*(l.x*o-r)),Math.round(this.options.extent*(l.y*o-i))]],tags:p?U(l):this.points[l.index].properties},u=void 0;p?u=l.id:this.options.generateId?u=l.index:this.points[l.index].id&&(u=this.points[l.index].id),void 0!==u&&(c.id=u),n.features.push(c)}},F.prototype._limitZoom=function(t){return Math.max(this.options.minZoom,Math.min(+t,this.options.maxZoom+1))},F.prototype._cluster=function(t,e){for(var r=[],i=this.options,o=i.reduce,n=i.minPoints,a=i.radius/(i.extent*Math.pow(2,e)),s=0;s<t.length;s++){var l=t[s];if(!(l.zoom<=e)){l.zoom=e;for(var p=this.trees[e+1],c=p.within(l.x,l.y,a),u=l.numPoints||1,h=u,d=0,f=c;d<f.length;d+=1){var m=p.points[f[d]];m.zoom>e&&(h+=m.numPoints||1)}if(h>=n){for(var _=l.x*u,y=l.y*u,g=o&&u>1?this._map(l,!0):null,v=(s<<5)+(e+1)+this.points.length,x=0,b=c;x<b.length;x+=1){var w=p.points[b[x]];if(!(w.zoom<=e)){w.zoom=e;var C=w.numPoints||1;_+=w.x*C,y+=w.y*C,w.parentId=v,o&&(g||(g=this._map(l,!0)),o(g,this._map(w)))}}l.parentId=v,r.push(B(_/h,y/h,v,h,g))}else if(r.push(l),h>1)for(var k=0,S=c;k<S.length;k+=1){var M=p.points[S[k]];M.zoom<=e||(M.zoom=e,r.push(M))}}}return r},F.prototype._getOriginId=function(t){return t-this.points.length>>5},F.prototype._getOriginZoom=function(t){return(t-this.points.length)%32},F.prototype._map=function(t,e){if(t.numPoints)return e?$({},t.properties):t.properties;var r=this.points[t.index].properties,i=this.options.map(r);return e&&i===r?$({},i):i},yt.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},yt.prototype.splitTile=function(t,e,r,i,o,n,a){for(var s=[t,e,r,i],l=this.options,p=l.debug;s.length;){i=s.pop(),r=s.pop(),e=s.pop(),t=s.pop();var c=1<<e,u=gt(e,r,i),h=this.tiles[u];if(!h&&(p>1&&console.time("creation"),h=this.tiles[u]=ft(t,e,r,i,l),this.tileCoords.push({z:e,x:r,y:i}),p)){p>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,i,h.numFeatures,h.numPoints,h.numSimplified),console.timeEnd("creation"));var d="z"+e;this.stats[d]=(this.stats[d]||0)+1,this.total++}if(h.source=t,o){if(e===l.maxZoom||e===o)continue;var f=1<<o-e;if(r!==Math.floor(n/f)||i!==Math.floor(a/f))continue}else if(e===l.indexMaxZoom||h.numPoints<=l.indexMaxPoints)continue;if(h.source=null,0!==t.length){p>1&&console.time("clipping");var m,_,y,g,v,x,b=.5*l.buffer/l.extent,w=.5-b,C=.5+b,k=1+b;m=_=y=g=null,v=rt(t,c,r-b,r+C,0,h.minX,h.maxX,l),x=rt(t,c,r+w,r+k,0,h.minX,h.maxX,l),t=null,v&&(m=rt(v,c,i-b,i+C,1,h.minY,h.maxY,l),_=rt(v,c,i+w,i+k,1,h.minY,h.maxY,l),v=null),x&&(y=rt(x,c,i-b,i+C,1,h.minY,h.maxY,l),g=rt(x,c,i+w,i+k,1,h.minY,h.maxY,l),x=null),p>1&&console.timeEnd("clipping"),s.push(m||[],e+1,2*r,2*i),s.push(_||[],e+1,2*r,2*i+1),s.push(y||[],e+1,2*r+1,2*i),s.push(g||[],e+1,2*r+1,2*i+1)}}},yt.prototype.getTile=function(t,e,r){var i=this.options,o=i.extent,n=i.debug;if(t<0||t>24)return null;var a=1<<t,s=gt(t,e=(e%a+a)%a,r);if(this.tiles[s])return ht(this.tiles[s],o);n>1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var l,p=t,c=e,u=r;!l&&p>0;)p--,c=Math.floor(c/2),u=Math.floor(u/2),l=this.tiles[gt(p,c,u)];return l&&l.source?(n>1&&console.log("found parent tile z%d-%d-%d",p,c,u),n>1&&console.time("drilling down"),this.splitTile(l.source,p,c,u,t,e,r),n>1&&console.timeEnd("drilling down"),this.tiles[s]?ht(this.tiles[s],o):null):null};var xt=function(e){function r(t,r,i,o){e.call(this,t,r,i,vt),o&&(this.loadGeoJSON=o)}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.loadData=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=e,this._pendingLoadDataParams=t,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},r.prototype._loadData=function(){var e=this;if(this._pendingCallback&&this._pendingLoadDataParams){var r=this._pendingCallback,i=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var o=!!(i&&i.request&&i.request.collectResourceTiming)&&new t.RequestPerformance(i.request);this.loadGeoJSON(i,(function(n,a){if(n||!a)return r(n);if("object"!=typeof a)return r(new Error("Input data given to '"+i.source+"' is not a valid GeoJSON object."));!function t(e,r){var i,o=e&&e.type;if("FeatureCollection"===o)for(i=0;i<e.features.length;i++)t(e.features[i],r);else if("GeometryCollection"===o)for(i=0;i<e.geometries.length;i++)t(e.geometries[i],r);else if("Feature"===o)t(e.geometry,r);else if("Polygon"===o)u(e.coordinates,r);else if("MultiPolygon"===o)for(i=0;i<e.coordinates.length;i++)u(e.coordinates[i],r);return e}(a,!0);try{if(i.filter){var s=t.createExpression(i.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===s.result)throw new Error(s.value.map((function(t){return t.key+": "+t.message})).join(", "));var l=a.features.filter((function(t){return s.value.evaluate({zoom:0},t)}));a={type:"FeatureCollection",features:l}}e._geoJSONIndex=i.cluster?new F(function(e){var r=e.superclusterOptions,i=e.clusterProperties;if(!i||!r)return r;for(var o={},n={},a={accumulated:null,zoom:0},s={properties:null},l=Object.keys(i),p=0,c=l;p<c.length;p+=1){var u=c[p],h=i[u],d=h[0],f=t.createExpression(h[1]),m=t.createExpression("string"==typeof d?[d,["accumulated"],["get",u]]:d);o[u]=f.value,n[u]=m.value}return r.map=function(t){s.properties=t;for(var e={},r=0,i=l;r<i.length;r+=1){var n=i[r];e[n]=o[n].evaluate(a,s)}return e},r.reduce=function(t,e){s.properties=e;for(var r=0,i=l;r<i.length;r+=1){var o=i[r];a.accumulated=t[o],t[o]=n[o].evaluate(a,s)}},r}(i)).load(a.features):function(t,e){return new yt(t,e)}(a,i.geojsonVtOptions)}catch(n){return r(n)}e.loaded={};var p={};if(o){var c=o.finish();c&&(p.resourceTiming={},p.resourceTiming[i.source]=JSON.parse(JSON.stringify(c)))}r(null,p)}))}},r.prototype.coalesce=function(){"Coalescing"===this._state?this._state="Idle":"NeedsLoadData"===this._state&&(this._state="Coalescing",this._loadData())},r.prototype.reloadTile=function(t,r){var i=this.loaded;return i&&i[t.uid]?e.prototype.reloadTile.call(this,t,r):this.loadTile(t,r)},r.prototype.loadGeoJSON=function(e,r){if(e.request)t.getJSON(e.request,r);else{if("string"!=typeof e.data)return r(new Error("Input data given to '"+e.source+"' is not a valid GeoJSON object."));try{return r(null,JSON.parse(e.data))}catch(t){return r(new Error("Input data given to '"+e.source+"' is not a valid GeoJSON object."))}}},r.prototype.removeSource=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),e()},r.prototype.getClusterExpansionZoom=function(t,e){try{e(null,this._geoJSONIndex.getClusterExpansionZoom(t.clusterId))}catch(t){e(t)}},r.prototype.getClusterChildren=function(t,e){try{e(null,this._geoJSONIndex.getChildren(t.clusterId))}catch(t){e(t)}},r.prototype.getClusterLeaves=function(t,e){try{e(null,this._geoJSONIndex.getLeaves(t.clusterId,t.limit,t.offset))}catch(t){e(t)}},r}(l),bt=function(e){var r=this;this.self=e,this.actor=new t.Actor(e,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:l,geojson:xt},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(t,e){if(r.workerSourceTypes[t])throw new Error('Worker source with name "'+t+'" already registered.');r.workerSourceTypes[t]=e},this.self.registerRTLTextPlugin=function(e){if(t.plugin.isParsed())throw new Error("RTL text plugin already registered.");t.plugin.applyArabicShaping=e.applyArabicShaping,t.plugin.processBidirectionalText=e.processBidirectionalText,t.plugin.processStyledBidirectionalText=e.processStyledBidirectionalText}};return bt.prototype.setReferrer=function(t,e){this.referrer=e},bt.prototype.setImages=function(t,e,r){for(var i in this.availableImages[t]=e,this.workerSources[t]){var o=this.workerSources[t][i];for(var n in o)o[n].availableImages=e}r()},bt.prototype.setLayers=function(t,e,r){this.getLayerIndex(t).replace(e),r()},bt.prototype.updateLayers=function(t,e,r){this.getLayerIndex(t).update(e.layers,e.removedIds),r()},bt.prototype.loadTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).loadTile(e,r)},bt.prototype.loadDEMTile=function(t,e,r){this.getDEMWorkerSource(t,e.source).loadTile(e,r)},bt.prototype.reloadTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).reloadTile(e,r)},bt.prototype.abortTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).abortTile(e,r)},bt.prototype.removeTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).removeTile(e,r)},bt.prototype.removeDEMTile=function(t,e){this.getDEMWorkerSource(t,e.source).removeTile(e)},bt.prototype.removeSource=function(t,e,r){if(this.workerSources[t]&&this.workerSources[t][e.type]&&this.workerSources[t][e.type][e.source]){var i=this.workerSources[t][e.type][e.source];delete this.workerSources[t][e.type][e.source],void 0!==i.removeSource?i.removeSource(e,r):r()}},bt.prototype.loadWorkerSource=function(t,e,r){try{this.self.importScripts(e.url),r()}catch(t){r(t.toString())}},bt.prototype.syncRTLPluginState=function(e,r,i){try{t.plugin.setState(r);var o=t.plugin.getPluginURL();if(t.plugin.isLoaded()&&!t.plugin.isParsed()&&null!=o){this.self.importScripts(o);var n=t.plugin.isParsed();i(n?void 0:new Error("RTL Text Plugin failed to import scripts from "+o),n)}}catch(t){i(t.toString())}},bt.prototype.getAvailableImages=function(t){var e=this.availableImages[t];return e||(e=[]),e},bt.prototype.getLayerIndex=function(t){var e=this.layerIndexes[t];return e||(e=this.layerIndexes[t]=new i),e},bt.prototype.getWorkerSource=function(t,e,r){var i=this;return this.workerSources[t]||(this.workerSources[t]={}),this.workerSources[t][e]||(this.workerSources[t][e]={}),this.workerSources[t][e][r]||(this.workerSources[t][e][r]=new this.workerSourceTypes[e]({send:function(e,r,o){i.actor.send(e,r,o,t)}},this.getLayerIndex(t),this.getAvailableImages(t))),this.workerSources[t][e][r]},bt.prototype.getDEMWorkerSource=function(t,e){return this.demWorkerSources[t]||(this.demWorkerSources[t]={}),this.demWorkerSources[t][e]||(this.demWorkerSources[t][e]=new c),this.demWorkerSources[t][e]},bt.prototype.enforceCacheSizeLimit=function(e,r){t.enforceCacheSizeLimit(r)},"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope&&(self.worker=new bt(self)),bt}));i(0,(function(t){var e=t.createCommonjsModule((function(t){function e(t){return!r(t)}function r(t){return"undefined"==typeof window||"undefined"==typeof document?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var t,e,r=new Blob([""],{type:"text/javascript"}),i=URL.createObjectURL(r);try{e=new Worker(i),t=!0}catch(e){t=!1}return e&&e.terminate(),URL.revokeObjectURL(i),t}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var t=document.createElement("canvas");t.width=t.height=1;var e=t.getContext("2d");if(!e)return!1;var r=e.getImageData(0,0,1,1);return r&&r.width===t.width}()?(void 0===i[r=t&&t.failIfMajorPerformanceCaveat]&&(i[r]=function(t){var r=function(t){var r=document.createElement("canvas"),i=Object.create(e.webGLContextAttributes);return i.failIfMajorPerformanceCaveat=t,r.probablySupportsContext?r.probablySupportsContext("webgl",i)||r.probablySupportsContext("experimental-webgl",i):r.supportsContext?r.supportsContext("webgl",i)||r.supportsContext("experimental-webgl",i):r.getContext("webgl",i)||r.getContext("experimental-webgl",i)}(t);if(!r)return!1;var i=r.createShader(r.VERTEX_SHADER);return!(!i||r.isContextLost())&&(r.shaderSource(i,"void main() {}"),r.compileShader(i),!0===r.getShaderParameter(i,r.COMPILE_STATUS))}(r)),i[r]?void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray supp
1ort":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var r}t.exports?t.exports=e:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=e,window.mapboxgl.notSupportedReason=r);var i={};e.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}})),r={create:function(e,r,i){var o=t.window.document.createElement(e);return void 0!==r&&(o.className=r),i&&i.appendChild(o),o},createNS:function(e,r){return t.window.document.createElementNS(e,r)}},i=t.window.document&&t.window.document.documentElement.style;function o(t){if(!i)return t[0];for(var e=0;e<t.length;e++)if(t[e]in i)return t[e];return t[0]}var n,a=o(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);r.disableDrag=function(){i&&a&&(n=i[a],i[a]="none")},r.enableDrag=function(){i&&a&&(i[a]=n)};var s=o(["transform","WebkitTransform"]);r.setTransform=function(t,e){t.style[s]=e};var l=!1;try{var p=Object.defineProperty({},"passive",{get:function(){l=!0}});t.window.addEventListener("test",p,p),t.window.removeEventListener("test",p,p)}catch(t){l=!1}r.addEventListener=function(t,e,r,i){void 0===i&&(i={}),t.addEventListener(e,r,"passive"in i&&l?i:i.capture)},r.removeEventListener=function(t,e,r,i){void 0===i&&(i={}),t.removeEventListener(e,r,"passive"in i&&l?i:i.capture)};var c=function(e){e.preventDefault(),e.stopPropagation(),t.window.removeEventListener("click",c,!0)};function u(t){var e=t.userImage;return!!(e&&e.render&&e.render())&&(t.data.replace(new Uint8Array(e.data.buffer)),!0)}r.suppressClick=function(){t.window.addEventListener("click",c,!0),t.window.setTimeout((function(){t.window.removeEventListener("click",c,!0)}),0)},r.mousePos=function(e,r){var i=e.getBoundingClientRect();return new t.Point(r.clientX-i.left-e.clientLeft,r.clientY-i.top-e.clientTop)},r.touchPos=function(e,r){for(var i=e.getBoundingClientRect(),o=[],n=0;n<r.length;n++)o.push(new t.Point(r[n].clientX-i.left-e.clientLeft,r[n].clientY-i.top-e.clientTop));return o},r.mouseButton=function(e){return void 0!==t.window.InstallTrigger&&2===e.button&&e.ctrlKey&&t.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:e.button},r.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)};var h=function(e){function r(){e.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.RGBAImage({width:1,height:1}),this.dirty=!0}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.isLoaded=function(){return this.loaded},r.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t,t)){for(var e=0,r=this.requestors;e<r.length;e+=1){var i=r[e];this._notify(i.ids,i.callback)}this.requestors=[]}},r.prototype.getImage=function(t){return this.images[t]},r.prototype.addImage=function(t,e){this._validate(t,e)&&(this.images[t]=e)},r.prototype._validate=function(e,r){var i=!0;return this._validateStretch(r.stretchX,r.data&&r.data.width)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "stretchX" value'))),i=!1),this._validateStretch(r.stretchY,r.data&&r.data.height)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "stretchY" value'))),i=!1),this._validateContent(r.content,r)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "content" value'))),i=!1),i},r.prototype._validateStretch=function(t,e){if(!t)return!0;for(var r=0,i=0,o=t;i<o.length;i+=1){var n=o[i];if(n[0]<r||n[1]<n[0]||e<n[1])return!1;r=n[1]}return!0},r.prototype._validateContent=function(t,e){return!(t&&(4!==t.length||t[0]<0||e.data.width<t[0]||t[1]<0||e.data.height<t[1]||t[2]<0||e.data.width<t[2]||t[3]<0||e.data.height<t[3]||t[2]<t[0]||t[3]<t[1]))},r.prototype.updateImage=function(t,e){e.version=this.images[t].version+1,this.images[t]=e,this.updatedImages[t]=!0},r.prototype.removeImage=function(t){var e=this.images[t];delete this.images[t],delete this.patterns[t],e.userImage&&e.userImage.onRemove&&e.userImage.onRemove()},r.prototype.listImages=function(){return Object.keys(this.images)},r.prototype.getImages=function(t,e){var r=!0;if(!this.isLoaded())for(var i=0,o=t;i<o.length;i+=1)this.images[o[i]]||(r=!1);this.isLoaded()||r?this._notify(t,e):this.requestors.push({ids:t,callback:e})},r.prototype._notify=function(e,r){for(var i={},o=0,n=e;o<n.length;o+=1){var a=n[o];this.images[a]||this.fire(new t.Event("styleimagemissing",{id:a}));var s=this.images[a];s?i[a]={data:s.data.clone(),pixelRatio:s.pixelRatio,sdf:s.sdf,ver
vendor: 105,522 bytes, line 1
1sion:s.version,stretchX:s.stretchX,stretchY:s.stretchY,content:s.content,hasRenderCallback:Boolean(s.userImage&&s.userImage.render)}:t.warnOnce('Image "'+a+'" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.')}r(null,i)},r.prototype.getPixelSize=function(){var t=this.atlasImage;return{width:t.width,height:t.height}},r.prototype.getPattern=function(e){var r=this.patterns[e],i=this.getImage(e);if(!i)return null;if(r&&r.position.version===i.version)return r.position;if(r)r.position.version=i.version;else{var o={w:i.data.width+2,h:i.data.height+2,x:0,y:0},n=new t.ImagePosition(o,i);this.patterns[e]={bin:o,position:n}}return this._updatePatternAtlas(),this.patterns[e].position},r.prototype.bind=function(e){var r=e.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new t.Texture(e,this.atlasImage,r.RGBA),this.atlasTexture.bind(r.LINEAR,r.CLAMP_TO_EDGE)},r.prototype._updatePatternAtlas=function(){var e=[];for(var r in this.patterns)e.push(this.patterns[r].bin);var i=t.potpack(e),o=i.w,n=i.h,a=this.atlasImage;for(var s in a.resize({width:o||1,height:n||1}),this.patterns){var l=this.patterns[s].bin,p=l.x+1,c=l.y+1,u=this.images[s].data,h=u.width,d=u.height;t.RGBAImage.copy(u,a,{x:0,y:0},{x:p,y:c},{width:h,height:d}),t.RGBAImage.copy(u,a,{x:0,y:d-1},{x:p,y:c-1},{width:h,height:1}),t.RGBAImage.copy(u,a,{x:0,y:0},{x:p,y:c+d},{width:h,height:1}),t.RGBAImage.copy(u,a,{x:h-1,y:0},{x:p-1,y:c},{width:1,height:d}),t.RGBAImage.copy(u,a,{x:0,y:0},{x:p+h,y:c},{width:1,height:d})}this.dirty=!0},r.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={}},r.prototype.dispatchRenderCallbacks=function(t){for(var e=0,r=t;e<r.length;e+=1){var i=r[e];if(!this.callbackDispatchedThisFrame[i]){this.callbackDispatchedThisFrame[i]=!0;var o=this.images[i];u(o)&&this.updateImage(i,o)}}},r}(t.Evented),d=_,f=_,m=1e20;function _(t,e,r,i,o,n){this.fontSize=t||24,this.buffer=void 0===e?3:e,this.cutoff=i||.25,this.fontFamily=o||"sans-serif",this.fontWeight=n||"normal",this.radius=r||8;var a=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=a,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(a*a),this.gridInner=new Float64Array(a*a),this.f=new Float64Array(a),this.d=new Float64Array(a),this.z=new Float64Array(a+1),this.v=new Int16Array(a),this.middle=Math.round(a/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function y(t,e,r,i,o,n,a){for(var s=0;s<e;s++){for(var l=0;l<r;l++)i[l]=t[l*e+s];for(g(i,o,n,a,r),l=0;l<r;l++)t[l*e+s]=o[l]}for(l=0;l<r;l++){for(s=0;s<e;s++)i[s]=t[l*e+s];for(g(i,o,n,a,e),s=0;s<e;s++)t[l*e+s]=Math.sqrt(o[s])}}function g(t,e,r,i,o){r[0]=0,i[0]=-m,i[1]=+m;for(var n=1,a=0;n<o;n++){for(var s=(t[n]+n*n-(t[r[a]]+r[a]*r[a]))/(2*n-2*r[a]);s<=i[a];)a--,s=(t[n]+n*n-(t[r[a]]+r[a]*r[a]))/(2*n-2*r[a]);r[++a]=n,i[a]=s,i[a+1]=+m}for(n=0,a=0;n<o;n++){for(;i[a+1]<n;)a++;e[n]=(n-r[a])*(n-r[a])+t[r[a]]}}_.prototype.draw=function(t){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(t,this.buffer,this.middle);for(var e=this.ctx.getImageData(0,0,this.size,this.size),r=new Uint8ClampedArray(this.size*this.size),i=0;i<this.size*this.size;i++){var o=e.data[4*i+3]/255;this.gridOuter[i]=1===o?0:0===o?m:Math.pow(Math.max(0,.5-o),2),this.gridInner[i]=1===o?m:0===o?0:Math.pow(Math.max(0,o-.5),2)}for(y(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),y(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),i=0;i<this.size*this.size;i++)r[i]=Math.max(0,Math.min(255,Math.round(255-255*((this.gridOuter[i]-this.gridInner[i])/this.radius+this.cutoff))));return r},d.default=f;var v=function(t,e){this.requestManager=t,this.localIdeographFontFamily=e,this.entries={}};v.prototype.setURL=function(t){this.url=t},v.prototype.getGlyphs=function(e,r){var i=this,o=[];for(var n in e)for(var a=0,s=e[n];a<s.length;a+=1)o.push({stack:n,id:s[a]});t.asyncAll(o,(function(t,e){var r=t.stack,o=t.id,n=i.entries[r];n||(n=i.entries[r]={glyphs:{},requests:{},ranges:{}});var a=n.glyphs[o];if(void 0===a){if(a=i._tinySDF(n,r,o))return n.glyphs[o]=a,void e(null,{stack:r,id:o,glyph:a});var s=Math.floor(o/256);if(256*s>65535)e(new Error("glyphs > 65535 not supported"));else if(n.ranges[s])e(null,{stack:r,id:o,glyph:a});else{var l=n.requests[s];l||(l=n.requests[s]=[],v.loadGlyphRange(r,s,i.url,i.requestManager,(function(t,e){if(e){for(var r in e)i._doesCharSupportLocalGlyph(+r)||(n.glyphs[+r]=e[+r]);n.ranges[s]=!0}for(var o=0,a=l;o<a.length;o+=1)(0,a[o])(t,e);delete n.requests[s]}))),l.push((function(t,i){t?e(t):i&&e(null,{stack:r,id:o,glyph:i[o]||null})}))}}else e(null,{stack:r,id:o,glyph:a})}),(function(t,e){if(t)r(t);else if(e){for(var i={},o=0,n=e;o<n.length;o+=1){var a=n[o],s=a.stack,l=a.id,p=a.glyph;(i[s]||(i[s]={}))[l]=p&&{id:p.id,bitmap:p.bitmap.clone(),metrics:p.metrics}}r(null,i)}}))},v.prototype._doesCharSupportLocalGlyph=function(e){return!!this.localIdeographFontFamily&&(t.isChar["CJK Unified Ideographs"](e)||t.isChar["Hangul Syllables"](e)||t.isChar.Hiragana(e)||t.isChar.Katakana(e))},v.prototype._tinySDF=function(e,r,i){var o=this.localIdeographFontFamily;if(o&&this._doesCharSupportLocalGlyph(i)){var n=e.tinySDF;if(!n){var a="400";/bold/i.test(r)?a="900":/medium/i.test(r)?a="500":/light/i.test(r)&&(a="200"),n=e.tinySDF=new v.TinySDF(24,3,8,.25,o,a)}return{id:i,bitmap:new t.AlphaImage({width:30,height:30},n.draw(String.fromCharCode(i))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},v.loadGlyphRange=function(e,r,i,o,n){var a=256*r,s=a+255,l=o.transformRequest(o.normalizeGlyphsURL(i).replace("{fontstack}",e).replace("{range}",a+"-"+s),t.ResourceType.Glyphs);t.getArrayBuffer(l,(function(e,r){if(e)n(e);else if(r){for(var i={},o=0,a=t.parseGlyphPBF(r);o<a.length;o+=1){var s=a[o];i[s.id]=s}n(null,i)}}))},v.TinySDF=d;var x=function(){this.specification=t.styleSpec.light.position};x.prototype.possiblyEvaluate=function(e,r){return t.sphericalToCartesian(e.expression.evaluate(r))},x.prototype.interpolate=function(e,r,i){return{x:t.number(e.x,r.x,i),y:t.number(e.y,r.y,i),z:t.number(e.z,r.z,i)}};var b=new t.Properties({anchor:new t.DataConstantProperty(t.styleSpec.light.anchor),position:new x,color:new t.DataConstantProperty(t.styleSpec.light.color),intensity:new t.DataConstantProperty(t.styleSpec.light.intensity)}),w=function(e){function r(r){e.call(this),this._transitionable=new t.Transitionable(b),this.setLight(r),this._transitioning=this._transitionable.untransitioned()}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.getLight=function(){return this._transitionable.serialize()},r.prototype.setLight=function(e,r){if(void 0===r&&(r={}),!this._validate(t.validateLight,e,r))for(var i in e){var o=e[i];t.endsWith(i,"-transition")?this._transitionable.setTransition(i.slice(0,-11),o):this._transitionable.setValue(i,o)}},r.prototype.updateTransitions=function(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)},r.prototype.hasTransition=function(){return this._transitioning.hasTransition()},r.prototype.recalculate=function(t){this.properties=this._transitioning.possiblyEvaluate(t)},r.prototype._validate=function(e,r,i){return(!i||!1!==i.validate)&&t.emitValidationErrors(this,e.call(t.validateStyle,t.extend({value:r,style:{glyphs:!0,sprite:!0},styleSpec:t.styleSpec})))},r}(t.Evented),C=function(t,e){this.width=t,this.height=e,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}};C.prototype.getDash=function(t,e){var r=t.join(",")+String(e);return this.dashEntry[r]||(this.dashEntry[r]=this.addDash(t,e)),this.dashEntry[r]},C.prototype.getDashRanges=function(t,e,r){var i=[],o=t.length%2==1?-t[t.length-1]*r:0,n=t[0]*r,a=!0;i.push({left:o,right:n,isDash:a,zeroLength:0===t[0]});for(var s=t[0],l=1;l<t.length;l++){var p=t[l];i.push({left:o=s*r,right:n=(s+=p)*r,isDash:a=!a,zeroLength:0===p})}return i},C.prototype.addRoundDash=function(t,e,r){for(var i=e/2,o=-r;o<=r;o++)for(var n=this.width*(this.nextRow+r+o),a=0,s=t[a],l=0;l<this.width;l++){l/s.right>1&&(s=t[++a]);var p=Math.abs(l-s.left),c=Math.abs(l-s.right),u=Math.min(p,c),h=void 0,d=o/r*(i+1);if(s.isDash){var f=i-Math.abs(d);h=Math.sqrt(u*u+f*f)}else h=i-Math.sqrt(u*u+d*d);this.data[n+l]=Math.max(0,Math.min(255,h+128))}},C.prototype.addRegularDash=function(t){for(var e=t.length-1;e>=0;--e){var r=t[e],i=t[e+1];r.zeroLength?t.splice(e,1):i&&i.isDash===r.isDash&&(i.left=r.left,t.splice(e,1))}var o=t[0],n=t[t.length-1];o.isDash===n.isDash&&(o.left=n.left-this.width,n.right=o.right+this.width);for(var a=this.width*this.nextRow,s=0,l=t[s],p=0;p<this.width;p++){p/l.right>1&&(l=t[++s]);var c=Math.abs(p-l.left),u=Math.abs(p-l.right),h=Math.min(c,u);this.data[a+p]=Math.max(0,Math.min(255,(l.isDash?h:-h)+128))}},C.prototype.addDash=function(e,r){var i=r?7:0,o=2*i+1;if(this.nextRow+o>this.height)return t.warnOnce("LineAtlas out of space"),null;for(var n=0,a=0;a<e.length;a++)n+=e[a];if(0!==n){var s=this.width/n,l=this.getDashRanges(e,this.width,s);r?this.addRoundDash(l,s,i):this.addRegularDash(l)}var p={y:(this.nextRow+i+.5)/this.height,height:2*i/this.height,width:n};return this.nextRow+=o,this.dirty=!0,p},C.prototype.bind=function(t){var e=t.gl;this.texture?(e.bindTexture(e.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,e.texSubImage2D(e.TEXTURE_2D,0,0,0,this.width,this.height,e.ALPHA,e.UNSIGNED_BYTE,this.data))):(this.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texImage2D(e.TEXTURE_2D,0,e.ALPHA,this.width,this.height,0,e.ALPHA,e.UNSIGNED_BYTE,this.data))};var k=function e(r,i){this.workerPool=r,this.actors=[],this.currentActor=0,this.id=t.uniqueId();for(var o=this.workerPool.acquire(this.id),n=0;n<o.length;n++){var a=new e.Actor(o[n],i,this.id);a.name="Worker "+n,this.actors.push(a)}};function S(e,r,i){var o=function(o,n){if(o)return i(o);if(n){var a=t.pick(t.extend(n,e),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);n.vector_layers&&(a.vectorLayers=n.vector_layers,a.vectorLayerIds=a.vectorLayers.map((function(t){return t.id}))),a.tiles=r.canonicalizeTileset(a,e.url),i(null,a)}};return e.url?t.getJSON(r.transformRequest(r.normalizeSourceURL(e.url),t.ResourceType.Source),o):t.browser.frame((function(){return o(null,e)}))}k.prototype.broadcast=function(e,r,i){t.asyncAll(this.actors,(function(t,i){t.send(e,r,i)}),i=i||function(){})},k.prototype.getActor=function(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]},k.prototype.remove=function(){this.actors.forEach((function(t){t.remove()})),this.actors=[],this.workerPool.release(this.id)},k.Actor=t.Actor;var M=function(e,r,i){this.bounds=t.LngLatBounds.convert(this.validateBounds(e)),this.minzoom=r||0,this.maxzoom=i||24};M.prototype.validateBounds=function(t){return Array.isArray(t)&&4===t.length?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]},M.prototype.contains=function(e){var r=Math.pow(2,e.z),i=Math.floor(t.mercatorXfromLng(this.bounds.getWest())*r),o=Math.floor(t.mercatorYfromLat(this.bounds.getNorth())*r),n=Math.ceil(t.mercatorXfromLng(this.bounds.getEast())*r),a=Math.ceil(t.mercatorYfromLat(this.bounds.getSouth())*r);return e.x>=i&&e.x<n&&e.y>=o&&e.y<a};var E=function(e){function r(r,i,o,n){if(e.call(this),this.id=r,this.dispatcher=o,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,t.extend(this,t.pick(i,["url","scheme","tileSize","promoteId"])),this._options=t.extend({type:"vector"},i),this._collectResourceTiming=i.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(n)}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.load=function(){var e=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=S(this._options,this.map._requestManager,(function(r,i){e._tileJSONRequest=null,e._loaded=!0,r?e.fire(new t.ErrorEvent(r)):i&&(t.extend(e,i),i.bounds&&(e.tileBounds=new M(i.bounds,e.minzoom,e.maxzoom)),t.postTurnstileEvent(i.tiles,e.map._requestManager._customAccessToken),t.postMapLoadEvent(i.tiles,e.map._getMapId(),e.map._requestManager._skuToken,e.map._requestManager._customAccessToken),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})))}))},r.prototype.loaded=function(){return this._loaded},r.prototype.hasTile=function(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setSourceProperty=function(t){this._tileJSONRequest&&this._tileJSONRequest.cancel(),t(),this.map.style.sourceCaches[this.id].clearTiles(),this.load()},r.prototype.setTiles=function(t){var e=this;return this.setSourceProperty((function(){e._options.tiles=t})),this},r.prototype.setUrl=function(t){var e=this;return this.setSourceProperty((function(){e.url=t,e._options.url=t})),this},r.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},r.prototype.serialize=function(){return t.extend({},this._options)},r.prototype.loadTile=function(e,r){var i=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme)),o={request:this.map._requestManager.transformRequest(i,t.ResourceType.Tile),uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function n(i,o){return delete e.request,e.aborted?r(null):i&&404!==i.status?r(i):(o&&o.resourceTiming&&(e.resourceTiming=o.resourceTiming),this.map._refreshExpiredTiles&&o&&e.setExpiryData(o),e.loadVectorData(o,this.map.painter),t.cacheEntryPossiblyAdded(this.dispatcher),r(null),void(e.reloadCallback&&(this.loadTile(e,e.reloadCallback),e.reloadCallback=null)))}o.request.collectResourceTiming=this._collectResourceTiming,e.actor&&"expired"!==e.state?"loading"===e.state?e.reloadCallback=r:e.request=e.actor.send("reloadTile",o,n.bind(this)):(e.actor=this.dispatcher.getActor(),e.request=e.actor.send("loadTile",o,n.bind(this)))},r.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.actor&&t.actor.send("abortTile",{uid:t.uid,type:this.type,source:this.id},void 0)},r.prototype.unloadTile=function(t){t.unloadVectorData(),t.actor&&t.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id},void 0)},r.prototype.hasTransition=function(){return!1},r}(t.Evented),T=function(e){function r(r,i,o,n){e.call(this),this.id=r,this.dispatcher=o,this.setEventedParent(n),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=t.extend({type:"raster"},i),t.extend(this,t.pick(i,["url","scheme","tileSize"]))}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.load=function(){var e=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=S(this._options,this.map._requestManager,(function(r,i){e._tileJSONRequest=null,e._loaded=!0,r?e.fire(new t.ErrorEvent(r)):i&&(t.extend(e,i),i.bounds&&(e.tileBounds=new M(i.bounds,e.minzoom,e.maxzoom)),t.postTurnstileEvent(i.tiles),t.postMapLoadEvent(i.tiles,e.map._getMapId(),e.map._requestManager._skuToken),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})))}))},r.prototype.loaded=function(){return this._loaded},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},r.prototype.serialize=function(){return t.extend({},this._options)},r.prototype.hasTile=function(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)},r.prototype.loadTile=function(e,r){var i=this,o=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);e.request=t.getImage(this.map._requestManager.transformRequest(o,t.ResourceType.Tile),(function(o,n){if(delete e.request,e.aborted)e.state="unloaded",r(null);else if(o)e.state="errored",r(o);else if(n){i.map._refreshExpiredTiles&&e.setExpiryData(n),delete n.cacheControl,delete n.expires;var a=i.map.painter.context,s=a.gl;e.texture=i.map.painter.getTileTexture(n.width),e.texture?e.texture.update(n,{useMipmap:!0}):(e.texture=new t.Texture(a,n,s.RGBA,{useMipmap:!0}),e.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE,s.LINEAR_MIPMAP_NEAREST),a.extTextureFilterAnisotropic&&s.texParameterf(s.TEXTURE_2D,a.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,a.extTextureFilterAnisotropicMax)),e.state="loaded",t.cacheEntryPossiblyAdded(i.dispatcher),r(null)}}))},r.prototype.abortTile=function(t,e){t.request&&(t.request.cancel(),delete t.request),e()},r.prototype.unloadTile=function(t,e){t.texture&&this.map.painter.saveTileTexture(t.texture),e()},r.prototype.hasTransition=function(){return!1},r}(t.Evented),A=function(e){function r(r,i,o,n){e.call(this,r,i,o,n),this.type="raster-dem",this.maxzoom=22,this._options=t.extend({type:"raster-dem"},i),this.encoding=i.encoding||"mapbox"}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.serialize=function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},r.prototype.loadTile=function(e,r){var i=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);function o(t,i){t&&(e.state="errored",r(t)),i&&(e.dem=i,e.needsHillshadePrepare=!0,e.state="loaded",r(null))}e.request=t.getImage(this.map._requestManager.transformRequest(i,t.ResourceType.Tile),function(i,n){if(delete e.request,e.aborted)e.state="unloaded",r(null);else if(i)e.state="errored",r(i);else if(n){this.map._refreshExpiredTiles&&e.setExpiryData(n),delete n.cacheControl,delete n.expires;var a=t.window.ImageBitmap&&n instanceof t.window.ImageBitmap&&t.offscreenCanvasSupported()?n:t.browser.getImageData(n,1),s={uid:e.uid,coord:e.tileID,source:this.id,rawImageData:a,encoding:this.encoding};e.actor&&"expired"!==e.state||(e.actor=this.dispatcher.getActor(),e.actor.send("loadDEMTile",s,o.bind(this)))}}.bind(this)),e.neighboringTiles=this._getNeighboringTiles(e.tileID)},r.prototype._getNeighboringTiles=function(e){var r=e.canonical,i=Math.pow(2,r.z),o=(r.x-1+i)%i,n=0===r.x?e.wrap-1:e.wrap,a=(r.x+1+i)%i,s=r.x+1===i?e.wrap+1:e.wrap,l={};return l[new t.OverscaledTileID(e.overscaledZ,n,r.z,o,r.y).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,r.z,a,r.y).key]={backfilled:!1},r.y>0&&(l[new t.OverscaledTileID(e.overscaledZ,n,r.z,o,r.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,r.z,a,r.y-1).key]={backfilled:!1}),r.y+1<i&&(l[new t.OverscaledTileID(e.overscaledZ,n,r.z,o,r.y+1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,r.z,r.x,r.y+1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,r.z,a,r.y+1).key]={backfilled:!1}),l},r.prototype.unloadTile=function(t){t.demTexture&&this.map.painter.saveTileTexture(t.demTexture),t.fbo&&(t.fbo.destroy(),delete t.fbo),t.dem&&delete t.dem,delete t.neighboringTiles,t.state="unloaded",t.actor&&t.actor.send("removeDEMTile",{uid:t.uid,source:this.id})},r}(T),I=function(e){function r(r,i,o,n){e.call(this),this.id=r,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._loaded=!1,this.actor=o.getActor(),this.setEventedParent(n),this._data=i.data,this._options=t.extend({},i),this._collectResourceTiming=i.collectResourceTiming,this._resourceTiming=[],void 0!==i.maxzoom&&(this.maxzoom=i.maxzoom),i.type&&(this.type=i.type),i.attribution&&(this.attribution=i.attribution),this.promoteId=i.promoteId;var a=t.EXTENT/this.tileSize;this.workerOptions=t.extend({source:this.id,cluster:i.cluster||!1,geojsonVtOptions:{buffer:(void 0!==i.buffer?i.buffer:128)*a,tolerance:(void 0!==i.tolerance?i.tolerance:.375)*a,extent:t.EXTENT,maxZoom:this.maxzoom,lineMetrics:i.lineMetrics||!1,generateId:i.generateId||!1},superclusterOptions:{maxZoom:void 0!==i.clusterMaxZoom?Math.min(i.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,minPoints:Math.max(2,i.clusterMinPoints||2),extent:t.EXTENT,radius:(i.clusterRadius||50)*a,log:!1,generateId:i.generateId||!1},clusterProperties:i.clusterProperties,filter:i.filter},i.workerOptions)}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.load=function(){var e=this;this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(r){if(r)e.fire(new t.ErrorEvent(r));else{var i={dataType:"source",sourceDataType:"metadata"};e._collectResourceTiming&&e._resourceTiming&&e._resourceTiming.length>0&&(i.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new t.Event("data",i))}}))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setData=function(e){var r=this;return this._data=e,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(e){if(e)r.fire(new t.ErrorEvent(e));else{var i={dataType:"source",sourceDataType:"content"};r._collectResourceTiming&&r._resourceTiming&&r._resourceTiming.length>0&&(i.resourceTiming=r._resourceTiming,r._resourceTiming=[]),r.fire(new t.Event("data",i))}})),this},r.prototype.getClusterExpansionZoom=function(t,e){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},e),this},r.prototype.getClusterChildren=function(t,e){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},e),this},r.prototype.getClusterLeaves=function(t,e,r,i){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:r},i),this},r.prototype._updateWorkerData=function(e){var r=this;this._loaded=!1;var i=t.extend({},this.workerOptions),o=this._data;"string"==typeof o?(i.request=this.map._requestManager.transformRequest(t.browser.resolveURL(o),t.ResourceType.Source),i.request.collectResourceTiming=this._collectResourceTiming):i.data=JSON.stringify(o),this.actor.send(this.type+".loadData",i,(function(t,o){r._removed||o&&o.abandoned||(r._loaded=!0,o&&o.resourceTiming&&o.resourceTiming[r.id]&&(r._resourceTiming=o.resourceTiming[r.id].slice(0)),r.actor.send(r.type+".coalesce",{source:i.source},null),e(t))}))},r.prototype.loaded=function(){return this._loaded},r.prototype.loadTile=function(e,r){var i=this,o=e.actor?"reloadTile":"loadTile";e.actor=this.actor,e.request=this.actor.send(o,{type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},(function(t,n){return delete e.request,e.unloadVectorData(),e.aborted?r(null):t?r(t):(e.loadVectorData(n,i.map.painter,"reloadTile"===o),r(null))}))},r.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0},r.prototype.unloadTile=function(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})},r.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},r.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},r.prototype.hasTransition=function(){return!1},r}(t.Evented),P=t.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),L=function(e){function r(t,r,i,o){e.call(this),this.id=t,this.dispatcher=i,this.coordinates=r.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(o),this.options=r}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.load=function(e,r){var i=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this.url=this.options.url,t.getImage(this.map._requestManager.transformRequest(this.url,t.ResourceType.Image),(function(o,n){i._loaded=!0,o?i.fire(new t.ErrorEvent(o)):n&&(i.image=n,e&&(i.coordinates=e),r&&r(),i._finishLoading())}))},r.prototype.loaded=function(){return this._loaded},r.prototype.updateImage=function(t){var e=this;return this.image&&t.url?(this.options.url=t.url,this.load(t.coordinates,(function(){e.texture=null})),this):this},r.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setCoordinates=function(e){var r=this;this.coordinates=e;var i=e.map(t.MercatorCoordinate.fromLngLat);this.tileID=function(e){for(var r=1/0,i=1/0,o=-1/0,n=-1/0,a=0,s=e;a<s.length;a+=1){var l=s[a];r=Math.min(r,l.x),i=Math.min(i,l.y),o=Math.max(o,l.x),n=Math.max(n,l.y)}var p=Math.max(o-r,n-i),c=Math.max(0,Math.floor(-Math.log(p)/Math.LN2)),u=Math.pow(2,c);return new t.CanonicalTileID(c,Math.floor((r+o)/2*u),Math.floor((i+n)/2*u))}(i),this.minzoom=this.maxzoom=this.tileID.z;var o=i.map((function(t){return r.tileID.getTilePoint(t)._round()}));return this._boundsArray=new t.StructArrayLayout4i8,this._boundsArray.emplaceBack(o[0].x,o[0].y,0,0),this._boundsArray.emplaceBack(o[1].x,o[1].y,t.EXTENT,0),this._boundsArray.emplaceBack(o[3].x,o[3].y,0,t.EXTENT),this._boundsArray.emplaceBack(o[2].x,o[2].y,t.EXTENT,t.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})),this},r.prototype.prepare=function(){if(0!==Object.keys(this.tiles).length&&this.image){var e=this.map.painter.context,r=e.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,P.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new t.Texture(e,this.image,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var o=this.tiles[i];"loaded"!==o.state&&(o.state="loaded",o.texture=this.texture)}}},r.prototype.loadTile=function(t,e){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={},e(null)):(t.state="errored",e(null))},r.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return!1},r}(t.Evented),z=function(e){function r(t,r,i,o){e.call(this,t,r,i,o),this.roundZoom=!0,this.type="video",this.options=r}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.load=function(){var e=this;this._loaded=!1;var r=this.options;this.urls=[];for(var i=0,o=r.urls;i<o.length;i+=1)this.urls.push(this.map._requestManager.transformRequest(o[i],t.ResourceType.Source).url);t.getVideo(this.urls,(function(r,i){e._loaded=!0,r?e.fire(new t.ErrorEvent(r)):i&&(e.video=i,e.video.loop=!0,e.video.addEventListener("playing",(function(){e.map.triggerRepaint()})),e.map&&e.video.play(),e._finishLoading())}))},r.prototype.pause=function(){this.video&&this.video.pause()},r.prototype.play=function(){this.video&&this.video.play()},r.prototype.seek=function(e){if(this.video){var r=this.video.seekable;e<r.start(0)||e>r.end(0)?this.fire(new t.ErrorEvent(new t.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+r.start(0)+" and "+r.end(0)+"-second mark."))):this.video.currentTime=e}},r.prototype.getVideo=function(){return this.video},r.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},r.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var e=this.map.painter.context,r=e.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,P.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new t.Texture(e,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var o=this.tiles[i];"loaded"!==o.state&&(o.state="loaded",o.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this.video&&!this.video.paused},r}(L),R=function(e){function r(r,i,o,n){e.call(this,r,i,o,n),i.coordinates?Array.isArray(i.coordinates)&&4===i.coordinates.length&&!i.coordinates.some((function(t){return!Array.isArray(t)||2!==t.length||t.some((function(t){return"number"!=typeof t}))}))||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "coordinates"'))),i.animate&&"boolean"!=typeof i.animate&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'optional "animate" property must be a boolean value'))),i.canvas?"string"==typeof i.canvas||i.canvas instanceof t.window.HTMLCanvasElement||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "canvas"'))),this.options=i,this.animate=void 0===i.animate||i.animate}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof t.window.HTMLCanvasElement?this.options.canvas:t.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},r.prototype.getCanvas=function(){return this.canvas},r.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()},r.prototype.onRemove=function(){this.pause()},r.prototype.prepare=function(){var e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){var r=this.map.painter.context,i=r.gl;for(var o in this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,P.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new t.Texture(r,this.canvas,i.RGBA,{premultiply:!0}),this.tiles){var n=this.tiles[o];"loaded"!==n.state&&(n.state="loaded",n.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this._playing},r.prototype._hasInvalidDimensions=function(){for(var t=0,e=[this.canvas.width,this.canvas.height];t<e.length;t+=1){var r=e[t];if(isNaN(r)||r<=0)return!0}return!1},r}(L),D={vector:E,raster:T,"raster-dem":A,geojson:I,video:z,image:L,canvas:R};function O(e,r){var i=t.identity([]);return t.translate(i,i,[1,1,0]),t.scale(i,i,[.5*e.width,.5*e.height,1]),t.multiply(i,i,e.calculatePosMatrix(r.toUnwrapped()))}function F(t,e,r,i,o,n){var a=function(t,e,r){if(t)for(var i=0,o=t;i<o.length;i+=1){var n=e[o[i]];if(n&&n.source===r&&"fill-extrusion"===n.type)return!0}else for(var a in e){var s=e[a];if(s.source===r&&"fill-extrusion"===s.type)return!0}return!1}(o&&o.layers,e,t.id),s=n.maxPitchScaleFactor(),l=t.tilesIn(i,s,a);l.sort(B);for(var p=[],c=0,u=l;c<u.length;c+=1){var h=u[c];p.push({wrappedTileID:h.tileID.wrapped().key,queryResults:h.tile.queryRenderedFeatures(e,r,t._state,h.queryGeometry,h.cameraQueryGeometry,h.scale,o,n,s,O(t.transform,h.tileID))})}var d=function(t){for(var e={},r={},i=0,o=t;i<o.length;i+=1){var n=o[i],a=n.queryResults,s=n.wrappedTileID,l=r[s]=r[s]||{};for(var p in a)for(var c=a[p],u=l[p]=l[p]||{},h=e[p]=e[p]||[],d=0,f=c;d<f.length;d+=1){var m=f[d];u[m.featureIndex]||(u[m.featureIndex]=!0,h.push(m))}}return e}(p);for(var f in d)d[f].forEach((function(e){var r=e.feature,i=t.getFeatureState(r.layer["source-layer"],r.id);r.source=r.layer.source,r.layer["source-layer"]&&(r.sourceLayer=r.layer["source-layer"]),r.state=i}));return d}function B(t,e){var r=t.tileID,i=e.tileID;return r.overscaledZ-i.overscaledZ||r.canonical.y-i.canonical.y||r.wrap-i.wrap||r.canonical.x-i.canonical.x}var j=function(t,e){this.max=t,this.onRemove=e,this.reset()};j.prototype.reset=function(){for(var t in this.data)for(var e=0,r=this.data[t];e<r.length;e+=1){var i=r[e];i.timeout&&clearTimeout(i.timeout),this.onRemove(i.value)}return this.data={},this.order=[],this},j.prototype.add=function(t,e,r){var i=this,o=t.wrapped().key;void 0===this.data[o]&&(this.data[o]=[]);var n={value:e,timeout:void 0};if(void 0!==r&&(n.timeout=setTimeout((function(){i.remove(t,n)}),r)),this.data[o].push(n),this.order.push(o),this.order.length>this.max){var a=this._getAndRemoveByKey(this.order[0]);a&&this.onRemove(a)}return this},j.prototype.has=function(t){return t.wrapped().key in this.data},j.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},j.prototype._getAndRemoveByKey=function(t){var e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value},j.prototype.getByKey=function(t){var e=this.data[t];return e?e[0].value:null},j.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},j.prototype.remove=function(t,e){if(!this.has(t))return this;var r=t.wrapped().key,i=void 0===e?0:this.data[r].indexOf(e),o=this.data[r][i];return this.data[r].splice(i,1),o.timeout&&clearTimeout(o.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(o.value),this.order.splice(this.order.indexOf(r),1),this},j.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this},j.prototype.filter=function(t){var e=[];for(var r in this.data)for(var i=0,o=this.data[r];i<o.length;i+=1){var n=o[i];t(n.value)||e.push(n)}for(var a=0,s=e;a<s.length;a+=1){var l=s[a];this.remove(l.value.tileID,l)}};var N=function(t,e,r){this.context=t;var i=t.gl;this.buffer=i.createBuffer(),this.dynamicDraw=Boolean(r),this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),i.bufferData(i.ELEMENT_ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?i.DYNAMIC_DRAW:i.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer};N.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},N.prototype.updateData=function(t){var e=this.context.gl;this.context.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)},N.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var U={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},V=function(t,e,r,i){this.length=e.length,this.attributes=r,this.itemSize=e.bytesPerElement,this.dynamicDraw=i,this.context=t;var o=t.gl;this.buffer=o.createBuffer(),t.bindVertexBuffer.set(this.buffer),o.bufferData(o.ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?o.DYNAMIC_DRAW:o.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer};V.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},V.prototype.updateData=function(t){var e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer)},V.prototype.enableAttributes=function(t,e){for(var r=0;r<this.attributes.length;r++){var i=e.attributes[this.attributes[r].name];void 0!==i&&t.enableVertexAttribArray(i)}},V.prototype.setVertexAttribPointers=function(t,e,r){for(var i=0;i<this.attributes.length;i++){var o=this.attributes[i],n=e.attributes[o.name];void 0!==n&&t.vertexAttribPointer(n,o.components,t[U[o.type]],!1,this.itemSize,o.offset+this.itemSize*(r||0))}},V.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var q=function(t){this.gl=t.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1};q.prototype.get=function(){return this.current},q.prototype.set=function(t){},q.prototype.getDefault=function(){return this.default},q.prototype.setDefault=function(){this.set(this.default)};var $=function(e){function r(){e.apply(this,arguments)}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.getDefault=function(){return t.Color.transparent},r.prototype.set=function(t){var e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)},r}(q),H=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return 1},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.clearDepth(t),this.current=t,this.dirty=!1)},e}(q),Z=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return 0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.clearStencil(t),this.current=t,this.dirty=!1)},e}(q),G=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return[!0,!0,!0,!0]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)},e}(q),Q=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.depthMask(t),this.current=t,this.dirty=!1)},e}(q),X=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return 255},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.stencilMask(t),this.current=t,this.dirty=!1)},e}(q),W=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return{func:this.gl.ALWAYS,ref:0,mask:255}},e.prototype.set=function(t){var e=this.current;(t.func!==e.func||t.ref!==e.ref||t.mask!==e.mask||this.dirty)&&(this.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t,this.dirty=!1)},e}(q),K=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){var t=this.gl;return[t.KEEP,t.KEEP,t.KEEP]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||this.dirty)&&(this.gl.stencilOp(t[0],t[1],t[2]),this.current=t,this.dirty=!1)},e}(q),J=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.STENCIL_TEST):e.disable(e.STENCIL_TEST),this.current=t,this.dirty=!1}},e}(q),Y=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return[0,1]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.depthRange(t[0],t[1]),this.current=t,this.dirty=!1)},e}(q),tt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),this.current=t,this.dirty=!1}},e}(q),et=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.LESS},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.depthFunc(t),this.current=t,this.dirty=!1)},e}(q),rt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.BLEND):e.disable(e.BLEND),this.current=t,this.dirty=!1}},e}(q),it=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){var t=this.gl;return[t.ONE,t.ZERO]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.blendFunc(t[0],t[1]),this.current=t,this.dirty=!1)},e}(q),ot=function(e){function r(){e.apply(this,arguments)}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.getDefault=function(){return t.Color.transparent},r.prototype.set=function(t){var e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)},r}(q),nt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.FUNC_ADD},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.blendEquation(t),this.current=t,this.dirty=!1)},e}(q),at=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.CULL_FACE):e.disable(e.CULL_FACE),this.current=t,this.dirty=!1}},e}(q),st=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.BACK},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.cullFace(t),this.current=t,this.dirty=!1)},e}(q),lt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.CCW},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(t),this.current=t,this.dirty=!1)},e}(q),pt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.useProgram(t),this.current=t,this.dirty=!1)},e}(q),ct=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.TEXTURE0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.activeTexture(t),this.current=t,this.dirty=!1)},e}(q),ut=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){var t=this.gl;return[0,0,t.drawingBufferWidth,t.drawingBufferHeight]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)},e}(q),ht=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,t),this.current=t,this.dirty=!1}},e}(q),dt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindRenderbuffer(e.RENDERBUFFER,t),this.current=t,this.dirty=!1}},e}(q),ft=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindTexture(e.TEXTURE_2D,t),this.current=t,this.dirty=!1}},e}(q),mt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindBuffer(e.ARRAY_BUFFER,t),this.current=t,this.dirty=!1}},e}(q),_t=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){var e=this.gl;e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1},e}(q),yt=function(t){function e(e){t.call(this,e),this.vao=e.extVertexArrayObject}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){this.vao&&(t!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(t),this.current=t,this.dirty=!1)},e}(q),gt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return 4},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1}},e}(q),vt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1}},e}(q),xt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1}},e}(q),bt=function(t){function e(e,r){t.call(this,e),this.context=e,this.parent=r}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e}(q),wt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.setDirty=function(){this.dirty=!0},e.prototype.set=function(t){if(t!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var e=this.gl;e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}},e}(bt),Ct=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){if(t!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var e=this.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t),this.current=t,this.dirty=!1}},e}(bt),kt=function(t,e,r,i){this.context=t,this.width=e,this.height=r;var o=this.framebuffer=t.gl.createFramebuffer();this.colorAttachment=new wt(t,o),i&&(this.depthAttachment=new Ct(t,o))};kt.prototype.destroy=function(){var t=this.context.gl,e=this.colorAttachment.get();if(e&&t.deleteTexture(e),this.depthAttachment){var r=this.depthAttachment.get();r&&t.deleteRenderbuffer(r)}t.deleteFramebuffer(this.framebuffer)};var St=function(t,e,r){this.func=t,this.mask=e,this.range=r};St.ReadOnly=!1,St.ReadWrite=!0,St.disabled=new St(519,St.ReadOnly,[0,1]);var Mt=function(t,e,r,i,o,n){this.test=t,this.ref=e,this.mask=r,this.fail=i,this.depthFail=o,this.pass=n};Mt.disabled=new Mt({func:519,mask:0},0,0,7680,7680,7680);var Et=function(t,e,r){this.blendFunction=t,this.blendColor=e,this.mask=r};Et.disabled=new Et(Et.Replace=[1,0],t.Color.transparent,[!1,!1,!1,!1]),Et.unblended=new Et(Et.Replace,t.Color.transparent,[!0,!0,!0,!0]),Et.alphaBlended=new Et([1,771],t.Color.transparent,[!0,!0,!0,!0]);var Tt=function(t,e,r){this.enable=t,this.mode=e,this.frontFace=r};Tt.disabled=new Tt(!1,1029,2305),Tt.backCCW=new Tt(!0,1029,2305);var At=function(t){this.gl=t,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new $(this),this.clearDepth=new H(this),this.clearStencil=new Z(this),this.colorMask=new G(this),this.depthMask=new Q(this),this.stencilMask=new X(this),this.stencilFunc=new W(this),this.stencilOp=new K(this),this.stencilTest=new J(this),this.depthRange=new Y(this),this.depthTest=new tt(this),this.depthFunc=new et(this),this.blend=new rt(this),this.blendFunc=new it(this),this.blendColor=new ot(this),this.blendEquation=new nt(this),this.cullFace=new at(this),this.cullFaceSide=new st(this),this.frontFace=new lt(this),this.program=new pt(this),this.activeTexture=new ct(this),this.viewport=new ut(this),this.bindFramebuffer=new ht(this),this.bindRenderbuffer=new dt(this),this.bindTexture=new ft(this),this.bindVertexBuffer=new mt(this),this.bindElementBuffer=new _t(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new yt(this),this.pixelStoreUnpack=new gt(this),this.pixelStoreUnpackPremultiplyAlpha=new vt(this),this.pixelStoreUnpackFlipY=new xt(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)};At.prototype.setDefault=function(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()},At.prototype.setDirty=function(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.extVertexArrayObject&&(this.bindVertexArrayOES.dirty=!0),this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0},At.prototype.createIndexBuffer=function(t,e){return new N(this,t,e)},At.prototype.createVertexBuffer=function(t,e,r){return new V(this,t,e,r)},At.prototype.createRenderbuffer=function(t,e,r){var i=this.gl,o=i.createRenderbuffer();return this.bindRenderbuffer.set(o),i.renderbufferStorage(i.RENDERBUFFER,t,e,r),this.bindRenderbuffer.set(null),o},At.prototype.createFramebuffer=function(t,e,r){return new kt(this,t,e,r)},At.prototype.clear=function(t){var e=t.color,r=t.depth,i=this.gl,o=0;e&&(o|=i.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),void 0!==r&&(o|=i.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(r),this.depthMask.set(!0)),i.clear(o)},At.prototype.setCullFace=function(t){!1===t.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(t.mode),this.frontFace.set(t.frontFace))},At.prototype.setDepthMode=function(t){t.func!==this.gl.ALWAYS||t.mask?(this.depthTest.set(!0),this.depthFunc.set(t.func),this.depthMask.set(t.mask),this.depthRange.set(t.range)):this.depthTest.set(!1)},At.prototype.setStencilMode=function(t){t.test.func!==this.gl.ALWAYS||t.mask?(this.stencilTest.set(!0),this.stencilMask.set(t.mask),this.stencilOp.set([t.fail,t.depthFail,t.pass]),this.stencilFunc.set({func:t.test.func,ref:t.ref,mask:t.test.mask})):this.stencilTest.set(!1)},At.prototype.setColorMode=function(e){t.deepEqual(e.blendFunction,Et.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask)},At.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)};var It=function(e){function r(r,i,o){var n=this;e.call(this),this.id=r,this.dispatcher=o,this.on("data",(function(t){"source"===t.dataType&&"metadata"===t.sourceDataType&&(n._sourceLoaded=!0),n._sourceLoaded&&!n._paused&&"source"===t.dataType&&"content"===t.sourceDataType&&(n.reload(),n.transform&&n.update(n.transform))})),this.on("error",(function(){n._sourceErrored=!0})),this._source=function(e,r,i,o){var n=new D[r.type](e,r,i,o);if(n.id!==e)throw new Error("Expected Source id to be "+e+" instead of "+n.id);return t.bindAll(["load","abort","unload","serialize","prepare"],n),n}(r,i,o,this),this._tiles={},this._cache=new j(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new t.SourceFeatureState}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.onAdd=function(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(t)},r.prototype.onRemove=function(t){this._source&&this._source.onRemove&&this._source.onRemove(t)},r.prototype.loaded=function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;if(!this._source.loaded())return!1;for(var t in this._tiles){var e=this._tiles[t];if("loaded"!==e.state&&"errored"!==e.state)return!1}return!0},r.prototype.getSource=function(){return this._source},r.prototype.pause=function(){this._paused=!0},r.prototype.resume=function(){if(this._paused){var t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform)}},r.prototype._loadTile=function(t,e){return this._source.loadTile(t,e)},r.prototype._unloadTile=function(t){if(this._source.unloadTile)return this._source.unloadTile(t,(function(){}))},r.prototype._abortTile=function(t){if(this._source.abortTile)return this._source.abortTile(t,(function(){}))},r.prototype.serialize=function(){return this._source.serialize()},r.prototype.prepare=function(t){for(var e in this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null),this._tiles){var r=this._tiles[e];r.upload(t),r.prepare(this.map.style.imageManager)}},r.prototype.getIds=function(){return t.values(this._tiles).map((function(t){return t.tileID})).sort(Pt).map((function(t){return t.key}))},r.prototype.getRenderableIds=function(e){var r=this,i=[];for(var o in this._tiles)this._isIdRenderable(o,e)&&i.push(this._tiles[o]);return e?i.sort((function(e,i){var o=e.tileID,n=i.tileID,a=new t.Point(o.canonical.x,o.canonical.y)._rotate(r.transform.angle),s=new t.Point(n.canonical.x,n.canonical.y)._rotate(r.transform.angle);return o.overscaledZ-n.overscaledZ||s.y-a.y||s.x-a.x})).map((function(t){return t.tileID.key})):i.map((function(t){return t.tileID})).sort(Pt).map((function(t){return t.key}))},r.prototype.hasRenderableParent=function(t){var e=this.findLoadedParent(t,0);return!!e&&this._isIdRenderable(e.tileID.key)},r.prototype._isIdRenderable=function(t,e){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(e||!this._tiles[t].holdingForFade())},r.prototype.reload=function(){if(this._paused)this._shouldReloadOnResume=!0;else for(var t in this._cache.reset(),this._tiles)"errored"!==this._tiles[t].state&&this._reloadTile(t,"reloading")},r.prototype._reloadTile=function(t,e){var r=this._tiles[t];r&&("loading"!==r.state&&(r.state=e),this._loadTile(r,this._tileLoaded.bind(this,r,t,e)))},r.prototype._tileLoaded=function(e,r,i,o){if(o)return e.state="errored",void(404!==o.status?this._source.fire(new t.ErrorEvent(o,{tile:e})):this.update(this.transform));e.timeAdded=t.browser.now(),"expired"===i&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(r,e),"raster-dem"===this.getSource().type&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),this._source.fire(new t.Event("data",{dataType:"source",tile:e,coord:e.tileID}))},r.prototype._backfillDEM=function(t){for(var e=this.getRenderableIds(),r=0;r<e.length;r++){var i=e[r];if(t.neighboringTiles&&t.neighboringTiles[i]){var o=this.getTileByID(i);n(t,o),n(o,t)}}function n(t,e){t.needsHillshadePrepare=!0;var r=e.tileID.canonical.x-t.tileID.canonical.x,i=e.tileID.canonical.y-t.tileID.canonical.y,o=Math.pow(2,t.tileID.canonical.z),n=e.tileID.key;0===r&&0===i||Math.abs(i)>1||(Math.abs(r)>1&&(1===Math.abs(r+o)?r+=o:1===Math.abs(r-o)&&(r-=o)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,r,i),t.neighboringTiles&&t.neighboringTiles[n]&&(t.neighboringTiles[n].backfilled=!0)))}},r.prototype.getTile=function(t){return this.getTileByID(t.key)},r.prototype.getTileByID=function(t){return this._tiles[t]},r.prototype._retainLoadedChildren=function(t,e,r,i){for(var o in this._tiles){var n=this._tiles[o];if(!(i[o]||!n.hasData()||n.tileID.overscaledZ<=e||n.tileID.overscaledZ>r)){for(var a=n.tileID;n&&n.tileID.overscaledZ>e+1;){var s=n.tileID.scaledTo(n.tileID.overscaledZ-1);(n=this._tiles[s.key])&&n.hasData()&&(a=s)}for(var l=a;l.overscaledZ>e;)if(t[(l=l.scaledTo(l.overscaledZ-1)).key]){i[a.key]=a;break}}}},r.prototype.findLoadedParent=function(t,e){if(t.key in this._loadedParentTiles){var r=this._loadedParentTiles[t.key];return r&&r.tileID.overscaledZ>=e?r:null}for(var i=t.overscaledZ-1;i>=e;i--){var o=t.scaledTo(i),n=this._getLoadedTile(o);if(n)return n}},r.prototype._getLoadedTile=function(t){var e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(t.wrapped().key)},r.prototype.updateCacheSize=function(t){var e=Math.ceil(t.width/this._source.tileSize)+1,r=Math.ceil(t.height/this._source.tileSize)+1,i=Math.floor(e*r*5),o="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,i):i;this._cache.setMaxSize(o)},r.prototype.handleWrapJump=function(t){var e=Math.round((t-(void 0===this._prevLng?t:this._prevLng))/360);if(this._prevLng=t,e){var r={};for(var i in this._tiles){var o=this._tiles[i];o.tileID=o.tileID.unwrapTo(o.tileID.wrap+e),r[o.tileID.key]=o}for(var n in this._tiles=r,this._timers)clearTimeout(this._timers[n]),delete this._timers[n];for(var a in this._tiles)this._setTileReloadTimer(a,this._tiles[a])}},r.prototype.update=function(e){var i=this;if(this.transform=e,this._sourceLoaded&&!this._paused){var o;this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?o=e.getVisibleUnwrappedCoordinates(this._source.tileID).map((function(e){return new t.OverscaledTileID(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y)})):(o=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(o=o.filter((function(t){return i._source.hasTile(t)})))):o=[];var n=e.coveringZoomLevel(this._source),a=Math.max(n-r.maxOverzooming,this._source.minzoom),s=Math.max(n+r.maxUnderzooming,this._source.minzoom),l=this._updateRetainedTiles(o,n);if(Lt(this._source.type)){for(var p={},c={},u=0,h=Object.keys(l);u<h.length;u+=1){var d=h[u],f=l[d],m=this._tiles[d];if(m&&!(m.fadeEndTime&&m.fadeEndTime<=t.browser.now())){var _=this.findLoadedParent(f,a);_&&(this._addTile(_.tileID),p[_.tileID.key]=_.tileID),c[d]=f}}for(var y in this._retainLoadedChildren(c,n,s,l),p)l[y]||(this._coveredTiles[y]=!0,l[y]=p[y])}for(var g in l)this._tiles[g].clearFadeHold();for(var v=0,x=t.keysDifference(this._tiles,l);v<x.length;v+=1){var b=x[v],w=this._tiles[b];w.hasSymbolBuckets&&!w.holdingForFade()?w.setHoldDuration(this.map._fadeDuration):w.hasSymbolBuckets&&!w.symbolFadeFinished()||this._removeTile(b)}this._updateLoadedParentTileCache()}},r.prototype.releaseSymbolFadeTiles=function(){for(var t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t)},r.prototype._updateRetainedTiles=function(t,e){for(var i={},o={},n=Math.max(e-r.maxOverzooming,this._source.minzoom),a=Math.max(e+r.maxUnderzooming,this._source.minzoom),s={},l=0,p=t;l<p.length;l+=1){var c=p[l],u=this._addTile(c);i[c.key]=c,u.hasData()||e<this._source.maxzoom&&(s[c.key]=c)}this._retainLoadedChildren(s,e,a,i);for(var h=0,d=t;h<d.length;h+=1){var f=d[h],m=this._tiles[f.key];if(!m.hasData()){if(e+1>this._source.maxzoom){var _=f.children(this._source.maxzoom)[0],y=this.getTile(_);if(y&&y.hasData()){i[_.key]=_;continue}}else{var g=f.children(this._source.maxzoom);if(i[g[0].key]&&i[g[1].key]&&i[g[2].key]&&i[g[3].key])continue}for(var v=m.wasRequested(),x=f.overscaledZ-1;x>=n;--x){var b=f.scaledTo(x);if(o[b.key])break;if(o[b.key]=!0,!(m=this.getTile(b))&&v&&(m=this._addTile(b)),m&&(i[b.key]=b,v=m.wasRequested(),m.hasData()))break}}}return i},r.prototype._updateLoadedParentTileCache=function(){for(var t in this._loadedParentTiles={},this._tiles){for(var e=[],r=void 0,i=this._tiles[t].tileID;i.overscaledZ>0;){if(i.key in this._loadedParentTiles){r=this._loadedParentTiles[i.key];break}e.push(i.key);var o=i.scaledTo(i.overscaledZ-1);if(r=this._getLoadedTile(o))break;i=o}for(var n=0,a=e;n<a.length;n+=1)this._loadedParentTiles[a[n]]=r}},r.prototype._addTile=function(e){var r=this._tiles[e.key];if(r)return r;(r=this._cache.getAndRemove(e))&&(this._setTileReloadTimer(e.key,r),r.tileID=e,this._state.initializeTileState(r,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,r)));var i=Boolean(r);return i||(r=new t.Tile(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(r,this._tileLoaded.bind(this,r,e.key,r.state))),r?(r.uses++,this._tiles[e.key]=r,i||this._source.fire(new t.Event("dataloading",{tile:r,coord:r.tileID,dataType:"source"})),r):null},r.prototype._setTileReloadTimer=function(t,e){var r=this;t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);var i=e.getExpiryTimeout();i&&(this._timers[t]=setTimeout((function(){r._reloadTile(t,"expired"),delete r._timers[t]}),i))},r.prototype._removeTile=function(t){var e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),e.uses>0||(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))},r.prototype.clearTiles=function(){for(var t in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(t);this._cache.reset()},r.prototype.tilesIn=function(e,r,i){var o=this,n=[],a=this.transform;if(!a)return n;for(var s=i?a.getCameraQueryGeometry(e):e,l=e.map((function(t){return a.pointCoordinate(t)})),p=s.map((function(t){return a.pointCoordinate(t)})),c=this.getIds(),u=1/0,h=1/0,d=-1/0,f=-1/0,m=0,_=p;m<_.length;m+=1){var y=_[m];u=Math.min(u,y.x),h=Math.min(h,y.y),d=Math.max(d,y.x),f=Math.max(f,y.y)}for(var g=function(e){var i=o._tiles[c[e]];if(!i.holdingForFade()){var s=i.tileID,m=Math.pow(2,a.zoom-i.tileID.overscaledZ),_=r*i.queryPadding*t.EXTENT/i.tileSize/m,y=[s.getTilePoint(new t.MercatorCoordinate(u,h)),s.getTilePoint(new t.MercatorCoordinate(d,f))];if(y[0].x-_<t.EXTENT&&y[0].y-_<t.EXTENT&&y[1].x+_>=0&&y[1].y+_>=0){var g=l.map((function(t){return s.getTilePoint(t)})),v=p.map((function(t){return s.getTilePoint(t)}));n.push({tile:i,tileID:s,queryGeometry:g,cameraQueryGeometry:v,scale:m})}}},v=0;v<c.length;v++)g(v);return n},r.prototype.getVisibleCoordinates=function(t){for(var e=this,r=this.getRenderableIds(t).map((function(t){return e._tiles[t].tileID})),i=0,o=r;i<o.length;i+=1){var n=o[i];n.posMatrix=this.transform.calculatePosMatrix(n.toUnwrapped())}return r},r.prototype.hasTransition=function(){if(this._source.hasTransition())return!0;if(Lt(this._source.type))for(var e in this._tiles){var r=this._tiles[e];if(void 0!==r.fadeEndTime&&r.fadeEndTime>=t.browser.now())return!0}return!1},r.prototype.setFeatureState=function(t,e,r){this._state.updateState(t=t||"_geojsonTileLayer",e,r)},r.prototype.removeFeatureState=function(t,e,r){this._state.removeFeatureState(t=t||"_geojsonTileLayer",e,r)},r.prototype.getFeatureState=function(t,e){return this._state.getState(t=t||"_geojsonTileLayer",e)},r.prototype.setDependencies=function(t,e,r){var i=this._tiles[t];i&&i.setDependencies(e,r)},r.prototype.reloadTilesForDependencies=function(t,e){for(var r in this._tiles)this._tiles[r].hasDependency(t,e)&&this._reloadTile(r,"reloading");this._cache.filter((function(r){return!r.hasDependency(t,e)}))},r}(t.Evented);function Pt(t,e){var r=Math.abs(2*t.wrap)-+(t.wrap<0),i=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||i-r||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function Lt(t){return"raster"===t||"image"===t||"video"===t}function zt(){return new t.window.Worker(Xo.workerUrl)}It.maxOverzooming=10,It.maxUnderzooming=3;var Rt="mapboxgl_preloaded_worker_pool",Dt=function(){this.active={}};Dt.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length<Dt.workerCount;)this.workers.push(new zt);return this.active[t]=!0,this.workers.slice()},Dt.prototype.release=function(t){delete this.active[t],0===this.numActive()&&(this.workers.forEach((function(t){t.terminate()})),this.workers=null)},Dt.prototype.isPreloaded=function(){return!!this.active[Rt]},Dt.prototype.numActive=function(){return Object.keys(this.active).length};var Ot,Ft=Math.floor(t.browser.hardwareConcurrency/2);function Bt(){return Ot||(Ot=new Dt),Ot}function jt(e,r){var i={};for(var o in e)"ref"!==o&&(i[o]=e[o]);return t.refProperties.forEach((function(t){t in r&&(i[t]=r[t])})),i}function Nt(t){t=t.slice();for(var e=Object.create(null),r=0;r<t.length;r++)e[t[r].id]=t[r];for(var i=0;i<t.length;i++)"ref"in t[i]&&(t[i]=jt(t[i],e[t[i].ref]));return t}Dt.workerCount=Math.max(Math.min(Ft,6),1);var Ut={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 Vt(t,e,r){r.push({command:Ut.addSource,args:[t,e[t]]})}function qt(t,e,r){e.push({command:Ut.removeSource,args:[t]}),r[t]=!0}function $t(t,e,r,i){qt(t,r,i),Vt(t,e,r)}function Ht(e,r,i){var o;for(o in e[i])if(e[i].hasOwnProperty(o)&&"data"!==o&&!t.deepEqual(e[i][o],r[i][o]))return!1;for(o in r[i])if(r[i].hasOwnProperty(o)&&"data"!==o&&!t.deepEqual(e[i][o],r[i][o]))return!1;return!0}function Zt(e,r,i,o,n,a){var s;for(s in r=r||{},e=e||{})e.hasOwnProperty(s)&&(t.deepEqual(e[s],r[s])||i.push({command:a,args:[o,s,r[s],n]}));for(s in r)r.hasOwnProperty(s)&&!e.hasOwnProperty(s)&&(t.deepEqual(e[s],r[s])||i.push({command:a,args:[o,s,r[s],n]}))}function Gt(t){return t.id}function Qt(t,e){return t[e.id]=e,t}var Xt=function(t,e){this.reset(t,e)};Xt.prototype.reset=function(t,e){this.points=t||[],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(e||0,.5*this.length),this.paddedLength=this.length-2*this.padding},Xt.prototype.lerp=function(e){if(1===this.points.length)return this.points[0];e=t.clamp(e,0,1);for(var r=1,i=this._distances[r],o=e*this.paddedLength+this.padding;i<o&&r<this._distances.length;)i=this._distances[++r];var n=r-1,a=this._distances[n],s=i-a,l=s>0?(o-a)/s:0;return this.points[n].mult(1-l).add(this.points[r].mult(l))};var Wt=function(t,e,r){var i=this.boxCells=[],o=this.circleCells=[];this.xCellCount=Math.ceil(t/r),this.yCellCount=Math.ceil(e/r);for(var n=0;n<this.xCellCount*this.yCellCount;n++)i.push([]),o.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=t,this.height=e,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/e,this.boxUid=0,this.circleUid=0};function Kt(e,r,i,o,n){var a=t.create();return r?(t.scale(a,a,[1/n,1/n,1]),i||t.rotateZ(a,a,o.angle)):t.multiply(a,o.labelPlaneMatrix,e),a}function Jt(e,r,i,o,n){if(r){var a=t.clone(e);return t.scale(a,a,[n,n,1]),i||t.rotateZ(a,a,-o.angle),a}return o.glCoordMatrix}function Yt(e,r){var i=[e.x,e.y,0,1];ce(i,i,r);var o=i[3];return{point:new t.Point(i[0]/o,i[1]/o),signedDistanceFromCamera:o}}function te(t,e){return.5+t/e*.5}function ee(t,e){var r=t[0]/t[3],i=t[1]/t[3];return r>=-e[0]&&r<=e[0]&&i>=-e[1]&&i<=e[1]}function re(e,r,i,o,n,a,s,l){var p=o?e.textSizeData:e.iconSizeData,c=t.evaluateSizeForZoom(p,i.transform.zoom),u=[256/i.width*2+1,256/i.height*2+1],h=o?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;h.clear();for(var d=e.lineVertexArray,f=o?e.text.placedSymbolArray:e.icon.placedSymbolArray,m=i.transform.width/i.transform.height,_=!1,y=0;y<f.length;y++){var g=f.get(y);if(g.hidden||g.writingMode===t.WritingMode.vertical&&!_)pe(g.numGlyphs,h);else{_=!1;var v=[g.anchorX,g.anchorY,0,1];if(t.transformMat4(v,v,r),ee(v,u)){var x=te(i.transform.cameraToCenterDistance,v[3]),b=t.evaluateSizeForFeature(p,c,g),w=s?b/x:b*x,C=new t.Point(g.anchorX,g.anchorY),k=Yt(C,n).point,S={},M=ne(g,w,!1,l,r,n,a,e.glyphOffsetArray,d,h,k,C,S,m);_=M.useVertical,(M.notEnoughRoom||_||M.needsFlipping&&ne(g,w,!0,l,r,n,a,e.glyphOffsetArray,d,h,k,C,S,m).notEnoughRoom)&&pe(g.numGlyphs,h)}else pe(g.numGlyphs,h)}}o?e.text.dynamicLayoutVertexBuffer.updateData(h):e.icon.dynamicLayoutVertexBuffer.updateData(h)}function ie(t,e,r,i,o,n,a,s,l,p,c){var u=s.glyphStartIndex+s.numGlyphs,h=s.lineStartIndex,d=s.lineStartIndex+s.lineLength,f=e.getoffsetX(s.glyphStartIndex),m=e.getoffsetX(u-1),_=se(t*f,r,i,o,n,a,s.segment,h,d,l,p,c);if(!_)return null;var y=se(t*m,r,i,o,n,a,s.segment,h,d,l,p,c);return y?{first:_,last:y}:null}function oe(e,r,i,o){return e===t.WritingMode.horizontal&&Math.abs(i.y-r.y)>Math.abs(i.x-r.x)*o?{useVertical:!0}:(e===t.WritingMode.vertical?r.y<i.y:r.x>i.x)?{needsFlipping:!0}:null}function ne(e,r,i,o,n,a,s,l,p,c,u,h,d,f){var m,_=r/24,y=e.lineOffsetX*_,g=e.lineOffsetY*_;if(e.numGlyphs>1){var v=e.glyphStartIndex+e.numGlyphs,x=e.lineStartIndex,b=e.lineStartIndex+e.lineLength,w=ie(_,l,y,g,i,u,h,e,p,a,d);if(!w)return{notEnoughRoom:!0};var C=Yt(w.first.point,s).point,k=Yt(w.last.point,s).point;if(o&&!i){var S=oe(e.writingMode,C,k,f);if(S)return S}m=[w.first];for(var M=e.glyphStartIndex+1;M<v-1;M++)m.push(se(_*l.getoffsetX(M),y,g,i,u,h,e.segment,x,b,p,a,d));m.push(w.last)}else{if(o&&!i){var E=Yt(h,n).point,T=e.lineStartIndex+e.segment+1,A=new t.Point(p.getx(T),p.gety(T)),I=Yt(A,n),P=I.signedDistanceFromCamera>0?I.point:ae(h,A,E,1,n),L=oe(e.writingMode,E,P,f);if(L)return L}var z=se(_*l.getoffsetX(e.glyphStartIndex),y,g,i,u,h,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,p,a,d);if(!z)return{notEnoughRoom:!0};m=[z]}for(var R=0,D=m;R<D.length;R+=1){var O=D[R];t.addDynamicAttributes(c,O.point,O.angle)}return{}}function ae(t,e,r,i,o){var n=Yt(t.add(t.sub(e)._unit()),o).point,a=r.sub(n);return r.add(a._mult(i/a.mag()))}function se(e,r,i,o,n,a,s,l,p,c,u,h){var d=o?e-r:e+r,f=d>0?1:-1,m=0;o&&(f*=-1,m=Math.PI),f<0&&(m+=Math.PI);for(var _=f>0?l+s:l+s+1,y=n,g=n,v=0,x=0,b=Math.abs(d),w=[];v+x<=b;){if((_+=f)<l||_>=p)return null;if(g=y,w.push(y),void 0===(y=h[_])){var C=new t.Point(c.getx(_),c.gety(_)),k=Yt(C,u);if(k.signedDistanceFromCamera>0)y=h[_]=k.point;else{var S=_-f;y=ae(0===v?a:new t.Point(c.getx(S),c.gety(S)),C,g,b-v+1,u)}}v+=x,x=g.dist(y)}var M=(b-v)/x,E=y.sub(g),T=E.mult(M)._add(g);T._add(E._unit()._perp()._mult(i*f));var A=m+Math.atan2(y.y-g.y,y.x-g.x);return w.push(T),{point:T,angle:A,path:w}}Wt.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Wt.prototype.insert=function(t,e,r,i,o){this._forEachCell(e,r,i,o,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(i),this.bboxes.push(o)},Wt.prototype.insertCircle=function(t,e,r,i){this._forEachCell(e-i,r-i,e+i,r+i,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(r),this.circles.push(i)},Wt.prototype._insertBoxCell=function(t,e,r,i,o,n){this.boxCells[o].push(n)},Wt.prototype._insertCircleCell=function(t,e,r,i,o,n){this.circleCells[o].push(n)},Wt.prototype._query=function(t,e,r,i,o,n){if(r<0||t>this.width||i<0||e>this.height)return!o&&[];var a=[];if(t<=0&&e<=0&&this.width<=r&&this.height<=i){if(o)return!0;for(var s=0;s<this.boxKeys.length;s++)a.push({key:this.boxKeys[s],x1:this.bboxes[4*s],y1:this.bboxes[4*s+1],x2:this.bboxes[4*s+2],y2:this.bboxes[4*s+3]});for(var l=0;l<this.circleKeys.length;l++){var p=this.circles[3*l],c=this.circles[3*l+1],u=this.circles[3*l+2];a.push({key:this.circleKeys[l],x1:p-u,y1:c-u,x2:p+u,y2:c+u})}return n?a.filter(n):a}return this._forEachCell(t,e,r,i,this._queryCell,a,{hitTest:o,seenUids:{box:{},circle:{}}},n),o?a.length>0:a},Wt.prototype._queryCircle=function(t,e,r,i,o){var n=t-r,a=t+r,s=e-r,l=e+r;if(a<0||n>this.width||l<0||s>this.height)return!i&&[];var p=[];return this._forEachCell(n,s,a,l,this._queryCellCircle,p,{hitTest:i,circle:{x:t,y:e,radius:r},seenUids:{box:{},circle:{}}},o),i?p.length>0:p},Wt.prototype.query=function(t,e,r,i,o){return this._query(t,e,r,i,!1,o)},Wt.prototype.hitTest=function(t,e,r,i,o){return this._query(t,e,r,i,!0,o)},Wt.prototype.hitTestCircle=function(t,e,r,i){return this._queryCircle(t,e,r,!0,i)},Wt.prototype._queryCell=function(t,e,r,i,o,n,a,s){var l=a.seenUids,p=this.boxCells[o];if(null!==p)for(var c=this.bboxes,u=0,h=p;u<h.length;u+=1){var d=h[u];if(!l.box[d]){l.box[d]=!0;var f=4*d;if(t<=c[f+2]&&e<=c[f+3]&&r>=c[f+0]&&i>=c[f+1]&&(!s||s(this.boxKeys[d]))){if(a.hitTest)return n.push(!0),!0;n.push({key:this.boxKeys[d],x1:c[f],y1:c[f+1],x2:c[f+2],y2:c[f+3]})}}}var m=this.circleCells[o];if(null!==m)for(var _=this.circles,y=0,g=m;y<g.length;y+=1){var v=g[y];if(!l.circle[v]){l.circle[v]=!0;var x=3*v;if(this._circleAndRectCollide(_[x],_[x+1],_[x+2],t,e,r,i)&&(!s||s(this.circleKeys[v]))){if(a.hitTest)return n.push(!0),!0;var b=_[x],w=_[x+1],C=_[x+2];n.push({key:this.circleKeys[v],x1:b-C,y1:w-C,x2:b+C,y2:w+C})}}}},Wt.prototype._queryCellCircle=function(t,e,r,i,o,n,a,s){var l=a.circle,p=a.seenUids,c=this.boxCells[o];if(null!==c)for(var u=this.bboxes,h=0,d=c;h<d.length;h+=1){var f=d[h];if(!p.box[f]){p.box[f]=!0;var m=4*f;if(this._circleAndRectCollide(l.x,l.y,l.radius,u[m+0],u[m+1],u[m+2],u[m+3])&&(!s||s(this.boxKeys[f])))return n.push(!0),!0}}var _=this.circleCells[o];if(null!==_)for(var y=this.circles,g=0,v=_;g<v.length;g+=1){var x=v[g];if(!p.circle[x]){p.circle[x]=!0;var b=3*x;if(this._circlesCollide(y[b],y[b+1],y[b+2],l.x,l.y,l.radius)&&(!s||s(this.circleKeys[x])))return n.push(!0),!0}}},Wt.prototype._forEachCell=function(t,e,r,i,o,n,a,s){for(var l=this._convertToXCellCoord(t),p=this._convertToYCellCoord(e),c=this._convertToXCellCoord(r),u=this._convertToYCellCoord(i),h=l;h<=c;h++)for(var d=p;d<=u;d++)if(o.call(this,t,e,r,i,this.xCellCount*d+h,n,a,s))return},Wt.prototype._convertToXCellCoord=function(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))},Wt.prototype._convertToYCellCoord=function(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))},Wt.prototype._circlesCollide=function(t,e,r,i,o,n){var a=i-t,s=o-e,l=r+n;return l*l>a*a+s*s},Wt.prototype._circleAndRectCollide=function(t,e,r,i,o,n,a){var s=(n-i)/2,l=Math.abs(t-(i+s));if(l>s+r)return!1;var p=(a-o)/2,c=Math.abs(e-(o+p));if(c>p+r)return!1;if(l<=s||c<=p)return!0;var u=l-s,h=c-p;return u*u+h*h<=r*r};var le=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function pe(t,e){for(var r=0;r<t;r++){var i=e.length;e.resize(i+4),e.float32.set(le,3*i)}}function ce(t,e,r){var i=e[0],o=e[1];return t[0]=r[0]*i+r[4]*o+r[12],t[1]=r[1]*i+r[5]*o+r[13],t[3]=r[3]*i+r[7]*o+r[15],t}var ue=function(t,e,r){void 0===e&&(e=new Wt(t.width+200,t.height+200,25)),void 0===r&&(r=new Wt(t.width+200,t.height+200,25)),this.transform=t,this.grid=e,this.ignoredGrid=r,this.pitchfactor=Math.cos(t._pitch)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+100,this.screenBottomBoundary=t.height+100,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200};function he(e,r,i){return r*(t.EXTENT/(e.tileSize*Math.pow(2,i-e.tileID.overscaledZ)))}ue.prototype.placeCollisionBox=function(t,e,r,i,o){var n=this.projectAndGetPerspectiveRatio(i,t.anchorPointX,t.anchorPointY),a=r*n.perspectiveRatio,s=t.x1*a+n.point.x,l=t.y1*a+n.point.y,p=t.x2*a+n.point.x,c=t.y2*a+n.point.y;return!this.isInsideGrid(s,l,p,c)||!e&&this.grid.hitTest(s,l,p,c,o)?{box:[],offscreen:!1}:{box:[s,l,p,c],offscreen:this.isOffscreen(s,l,p,c)}},ue.prototype.placeCollisionCircles=function(e,r,i,o,n,a,s,l,p,c,u,h,d){var f=[],m=new t.Point(r.anchorX,r.anchorY),_=Yt(m,a),y=te(this.transform.cameraToCenterDistance,_.signedDistanceFromCamera),g=(c?n/y:n*y)/t.ONE_EM,v=Yt(m,s).point,x=ie(g,o,r.lineOffsetX*g,r.lineOffsetY*g,!1,v,m,r,i,s,{}),b=!1,w=!1,C=!0;if(x){for(var k=.5*h*y+d,S=new t.Point(-100,-100),M=new t.Point(this.screenRightBoundary,this.screenBottomBoundary),E=new Xt,T=x.first,A=x.last,I=[],P=T.path.length-1;P>=1;P--)I.push(T.path[P]);for(var L=1;L<A.path.length;L++)I.push(A.path[L]);var z=2.5*k;if(l){var R=I.map((function(t){return Yt(t,l)}));I=R.some((function(t){return t.signedDistanceFromCamera<=0}))?[]:R.map((function(t){return t.point}))}var D=[];if(I.length>0){for(var O=I[0].clone(),F=I[0].clone(),B=1;B<I.length;B++)O.x=Math.min(O.x,I[B].x),O.y=Math.min(O.y,I[B].y),F.x=Math.max(F.x,I[B].x),F.y=Math.max(F.y,I[B].y);D=O.x>=S.x&&F.x<=M.x&&O.y>=S.y&&F.y<=M.y?[I]:F.x<S.x||O.x>M.x||F.y<S.y||O.y>M.y?[]:t.clipLine([I],S.x,S.y,M.x,M.y)}for(var j=0,N=D;j<N.length;j+=1){var U;E.reset(N[j],.25*k),U=E.length<=.5*k?1:Math.ceil(E.paddedLength/z)+1;for(var V=0;V<U;V++){var q=V/Math.max(U-1,1),$=E.lerp(q),H=$.x+100,Z=$.y+100;f.push(H,Z,k,0);var G=H-k,Q=Z-k,X=H+k,W=Z+k;if(C=C&&this.isOffscreen(G,Q,X,W),w=w||this.isInsideGrid(G,Q,X,W),!e&&this.grid.hitTestCircle(H,Z,k,u)&&(b=!0,!p))return{circles:[],offscreen:!1,collisionDetected:b}}}}return{circles:!p&&b||!w?[]:f,offscreen:C,collisionDetected:b}},ue.prototype.queryRenderedSymbols=function(e){if(0===e.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};for(var r=[],i=1/0,o=1/0,n=-1/0,a=-1/0,s=0,l=e;s<l.length;s+=1){var p=l[s],c=new t.Point(p.x+100,p.y+100);i=Math.min(i,c.x),o=Math.min(o,c.y),n=Math.max(n,c.x),a=Math.max(a,c.y),r.push(c)}for(var u={},h={},d=0,f=this.grid.query(i,o,n,a).concat(this.ignoredGrid.query(i,o,n,a));d<f.length;d+=1){var m=f[d],_=m.key;if(void 0===u[_.bucketInstanceId]&&(u[_.bucketInstanceId]={}),!u[_.bucketInstanceId][_.featureIndex]){var y=[new t.Point(m.x1,m.y1),new t.Point(m.x2,m.y1),new t.Point(m.x2,m.y2),new t.Point(m.x1,m.y2)];t.polygonIntersectsPolygon(r,y)&&(u[_.bucketInstanceId][_.featureIndex]=!0,void 0===h[_.bucketInstanceId]&&(h[_.bucketInstanceId]=[]),h[_.bucketInstanceId].push(_.featureIndex))}}return h},ue.prototype.insertCollisionBox=function(t,e,r,i,o){(e?this.ignoredGrid:this.grid).insert({bucketInstanceId:r,featureIndex:i,collisionGroupID:o},t[0],t[1],t[2],t[3])},ue.prototype.insertCollisionCircles=function(t,e,r,i,o){for(var n=e?this.ignoredGrid:this.grid,a={bucketInstanceId:r,featureIndex:i,collisionGroupID:o},s=0;s<t.length;s+=4)n.insertCircle(a,t[s],t[s+1],t[s+2])},ue.prototype.projectAndGetPerspectiveRatio=function(e,r,i){var o=[r,i,0,1];return ce(o,o,e),{point:new t.Point((o[0]/o[3]+1)/2*this.transform.width+100,(-o[1]/o[3]+1)/2*this.transform.height+100),perspectiveRatio:.5+this.transform.cameraToCenterDistance/o[3]*.5}},ue.prototype.isOffscreen=function(t,e,r,i){return r<100||t>=this.screenRightBoundary||i<100||e>this.screenBottomBoundary},ue.prototype.isInsideGrid=function(t,e,r,i){return r>=0&&t<this.gridRightBoundary&&i>=0&&e<this.gridBottomBoundary},ue.prototype.getViewportMatrix=function(){var e=t.identity([]);return t.translate(e,e,[-100,-100,0]),e};var de=function(t,e,r,i){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?e:-e))):i&&r?1:0,this.placed=r};de.prototype.isHidden=function(){return 0===this.opacity&&!this.placed};var fe=function(t,e,r,i,o){this.text=new de(t?t.text:null,e,r,o),this.icon=new de(t?t.icon:null,e,i,o)};fe.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var me=function(t,e,r){this.text=t,this.icon=e,this.skipFade=r},_e=function(){this.invProjMatrix=t.create(),this.viewportMatrix=t.create(),this.circles=[]},ye=function(t,e,r,i,o){this.bucketInstanceId=t,this.featureIndex=e,this.sourceLayerIndex=r,this.bucketIndex=i,this.tileID=o},ge=function(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}};function ve(e,r,i,o,n){var a=t.getAnchorAlignment(e),s=-(a.horizontalAlign-.5)*r,l=-(a.verticalAlign-.5)*i,p=t.evaluateVariableOffset(e,o);return new t.Point(s+p[0]*n,l+p[1]*n)}function xe(e,r,i,o,n,a){var s=e.x1,l=e.x2,p=e.y1,c=e.y2,u=e.anchorPointX,h=e.anchorPointY,d=new t.Point(r,i);return o&&d._rotate(n?a:-a),{x1:s+d.x,y1:p+d.y,x2:l+d.x,y2:c+d.y,anchorPointX:u,anchorPointY:h}}ge.prototype.get=function(t){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[t]){var e=++this.maxGroupID;this.collisionGroups[t]={ID:e,predicate:function(t){return t.collisionGroupID===e}}}return this.collisionGroups[t]};var be=function(t,e,r,i){this.transform=t.clone(),this.collisionIndex=new ue(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=e,this.retainedQueryData={},this.collisionGroups=new ge(r),this.collisionCircleArrays={},this.prevPlacement=i,i&&(i.prevPlacement=void 0),this.placedOrientations={}};function we(t,e,r,i,o){t.emplaceBack(e?1:0,r?1:0,i||0,o||0),t.emplaceBack(e?1:0,r?1:0,i||0,o||0),t.emplaceBack(e?1:0,r?1:0,i||0,o||0),t.emplaceBack(e?1:0,r?1:0,i||0,o||0)}be.prototype.getBucketParts=function(e,r,i,o){var n=i.getBucket(r),a=i.latestFeatureIndex;if(n&&a&&r.id===n.layerIds[0]){var s=i.collisionBoxArray,l=n.layers[0].layout,p=Math.pow(2,this.transform.zoom-i.tileID.overscaledZ),c=i.tileSize/t.EXTENT,u=this.transform.calculatePosMatrix(i.tileID.toUnwrapped()),h="map"===l.get("text-pitch-alignment"),d="map"===l.get("text-rotation-alignment"),f=he(i,1,this.transform.zoom),m=Kt(u,h,d,this.transform,f),_=null;if(h){var y=Jt(u,h,d,this.transform,f);_=t.multiply([],this.transform.labelPlaneMatrix,y)}this.retainedQueryData[n.bucketInstanceId]=new ye(n.bucketInstanceId,a,n.sourceLayerIndex,n.index,i.tileID);var g={bucket:n,layout:l,posMatrix:u,textLabelPlaneMatrix:m,labelToScreenMatrix:_,scale:p,textPixelRatio:c,holdingForFade:i.holdingForFade(),collisionBoxArray:s,partiallyEvaluatedTextSize:t.evaluateSizeForZoom(n.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(n.sourceID)};if(o)for(var v=0,x=n.sortKeyRanges;v<x.length;v+=1){var b=x[v];e.push({sortKey:b.sortKey,symbolInstanceStart:b.symbolInstanceStart,symbolInstanceEnd:b.symbolInstanceEnd,parameters:g})}else e.push({symbolInstanceStart:0,symbolInstanceEnd:n.symbolInstances.length,parameters:g})}},be.prototype.attemptAnchorPlacement=function(t,e,r,i,o,n,a,s,l,p,c,u,h,d,f){var m,_=[u.textOffset0,u.textOffset1],y=ve(t,r,i,_,o),g=this.collisionIndex.placeCollisionBox(xe(e,y.x,y.y,n,a,this.transform.angle),c,s,l,p.predicate);if(!f||0!==this.collisionIndex.placeCollisionBox(xe(f,y.x,y.y,n,a,this.transform.angle),c,s,l,p.predicate).box.length)return g.box.length>0?(this.prevPlacement&&this.prevPlacement.variableOffsets[u.crossTileID]&&this.prevPlacement.placements[u.crossTileID]&&this.prevPlacement.placements[u.crossTileID].text&&(m=this.prevPlacement.variableOffsets[u.crossTileID].anchor),this.variableOffsets[u.crossTileID]={textOffset:_,width:r,height:i,anchor:t,textBoxScale:o,prevAnchor:m},this.markUsedJustification(h,t,u,d),h.allowVerticalPlacement&&(this.markUsedOrientation(h,d,u),this.placedOrientations[u.crossTileID]=d),{shift:y,placedGlyphBoxes:g}):void 0},be.prototype.placeLayerBucketPart=function(e,r,i){var o=this,n=e.parameters,a=n.bucket,s=n.layout,l=n.posMatrix,p=n.textLabelPlaneMatrix,c=n.labelToScreenMatrix,u=n.textPixelRatio,h=n.holdingForFade,d=n.collisionBoxArray,f=n.partiallyEvaluatedTextSize,m=n.collisionGroup,_=s.get("text-optional"),y=s.get("icon-optional"),g=s.get("text-allow-overlap"),v=s.get("icon-allow-overlap"),x="map"===s.get("text-rotation-alignment"),b="map"===s.get("text-pitch-alignment"),w="none"!==s.get("icon-text-fit"),C="viewport-y"===s.get("symbol-z-order"),k=g&&(v||!a.hasIconData()||y),S=v&&(g||!a.hasTextData()||_);!a.collisionArrays&&d&&a.deserializeCollisionBoxes(d);var M=function(e,n){if(!r[e.crossTileID])if(h)o.placements[e.crossTileID]=new me(!1,!1,!1);else{var d,C=!1,M=!1,E=!0,T=null,A={box:null,offscreen:null},I={box:null,offscreen:null},P=null,L=null,z=0,R=0,D=0;n.textFeatureIndex?z=n.textFeatureIndex:e.useRuntimeCollisionCircles&&(z=e.featureIndex),n.verticalTextFeatureIndex&&(R=n.verticalTextFeatureIndex);var O=n.textBox;if(O){var F=function(r){var i=t.WritingMode.horizontal;if(a.allowVerticalPlacement&&!r&&o.prevPlacement){var n=o.prevPlacement.placedOrientations[e.crossTileID];n&&(o.placedOrientations[e.crossTileID]=n,o.markUsedOrientation(a,i=n,e))}return i},B=function(r,i){if(a.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&n.verticalTextBox)for(var o=0,s=a.writingModes;o<s.length&&(s[o]===t.WritingMode.vertical?(A=i(),I=A):A=r(),!(A&&A.box&&A.box.length));o+=1);else A=r()};if(s.get("text-variable-anchor")){var j=s.get("text-variable-anchor");if(o.prevPlacement&&o.prevPlacement.variableOffsets[e.crossTileID]){var N=o.prevPlacement.variableOffsets[e.crossTileID];j.indexOf(N.anchor)>0&&(j=j.filter((function(t){return t!==N.anchor}))).unshift(N.anchor)}var U=function(t,r,i){for(var n=t.x2-t.x1,s=t.y2-t.y1,p=e.textBoxScale,c=w&&!v?r:null,h={box:[],offscreen:!1},d=g?2*j.length:j.length,f=0;f<d;++f){var _=o.attemptAnchorPlacement(j[f%j.length],t,n,s,p,x,b,u,l,m,f>=j.length,e,a,i,c);if(_&&(h=_.placedGlyphBoxes)&&h.box&&h.box.length){C=!0,T=_.shift;break}}return h};B((function(){return U(O,n.iconBox,t.WritingMode.horizontal)}),(function(){var r=n.verticalTextBox;return a.allowVerticalPlacement&&!(A&&A.box&&A.box.length)&&e.numVerticalGlyphVertices>0&&r?U(r,n.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null}})),A&&(C=A.box,E=A.offscreen);var V=F(A&&A.box);if(!C&&o.prevPlacement){var q=o.prevPlacement.variableOffsets[e.crossTileID];q&&(o.variableOffsets[e.crossTileID]=q,o.markUsedJustification(a,q.anchor,e,V))}}else{var $=function(t,r){var i=o.collisionIndex.placeCollisionBox(t,g,u,l,m.predicate);return i&&i.box&&i.box.length&&(o.markUsedOrientation(a,r,e),o.placedOrientations[e.crossTileID]=r),i};B((function(){return $(O,t.WritingMode.horizontal)}),(function(){var r=n.verticalTextBox;return a.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&r?$(r,t.WritingMode.vertical):{box:null,offscreen:null}})),F(A&&A.box&&A.box.length)}}if(C=(d=A)&&d.box&&d.box.length>0,E=d&&d.offscreen,e.useRuntimeCollisionCircles){var H=a.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex),Z=t.evaluateSizeForFeature(a.textSizeData,f,H),G=s.get("text-padding");P=o.collisionIndex.placeCollisionCircles(g,H,a.lineVertexArray,a.glyphOffsetArray,Z,l,p,c,i,b,m.predicate,e.collisionCircleDiameter,G),C=g||P.circles.length>0&&!P.collisionDetected,E=E&&P.offscreen}if(n.iconFeatureIndex&&(D=n.iconFeatureIndex),n.iconBox){var Q=function(t){var e=w&&T?xe(t,T.x,T.y,x,b,o.transform.angle):t;return o.collisionIndex.placeCollisionBox(e,v,u,l,m.predicate)};M=I&&I.box&&I.box.length&&n.verticalIconBox?(L=Q(n.verticalIconBox)).box.length>0:(L=Q(n.iconBox)).box.length>0,E=E&&L.offscreen}var X=_||0===e.numHorizontalGlyphVertices&&0===e.numVerticalGlyphVertices,W=y||0===e.numIconVertices;if(X||W?W?X||(M=M&&C):C=M&&C:M=C=M&&C,C&&d&&d.box&&o.collisionIndex.insertCollisionBox(d.box,s.get("text-ignore-placement"),a.bucketInstanceId,I&&I.box&&R?R:z,m.ID),M&&L&&o.collisionIndex.insertCollisionBox(L.box,s.get("icon-ignore-placement"),a.bucketInstanceId,D,m.ID),P&&(C&&o.collisionIndex.insertCollisionCircles(P.circles,s.get("text-ignore-placement"),a.bucketInstanceId,z,m.ID),i)){var K=a.bucketInstanceId,J=o.collisionCircleArrays[K];void 0===J&&(J=o.collisionCircleArrays[K]=new _e);for(var Y=0;Y<P.circles.length;Y+=4)J.circles.push(P.circles[Y+0]),J.circles.push(P.circles[Y+1]),J.circles.push(P.circles[Y+2]),J.circles.push(P.collisionDetected?1:0)}o.placements[e.crossTileID]=new me(C||k,M||S,E||a.justReloaded),r[e.crossTileID]=!0}};if(C)for(var E=a.getSortedSymbolIndexes(this.transform.angle),T=E.length-1;T>=0;--T){var A=E[T];M(a.symbolInstances.get(A),a.collisionArrays[A])}else for(var I=e.symbolInstanceStart;I<e.symbolInstanceEnd;I++)M(a.symbolInstances.get(I),a.collisionArrays[I]);if(i&&a.bucketInstanceId in this.collisionCircleArrays){var P=this.collisionCircleArrays[a.bucketInstanceId];t.invert(P.invProjMatrix,l),P.viewportMatrix=this.collisionIndex.getViewportMatrix()}a.justReloaded=!1},be.prototype.markUsedJustification=function(e,r,i,o){var n;n=o===t.WritingMode.vertical?i.verticalPlacedTextSymbolIndex:{left:i.leftJustifiedTextSymbolIndex,center:i.centerJustifiedTextSymbolIndex,right:i.rightJustifiedTextSymbolIndex}[t.getAnchorJustification(r)];for(var a=0,s=[i.leftJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.rightJustifiedTextSymbolIndex,i.verticalPlacedTextSymbolIndex];a<s.length;a+=1){var l=s[a];l>=0&&(e.text.placedSymbolArray.get(l).crossTileID=n>=0&&l!==n?0:i.crossTileID)}},be.prototype.markUsedOrientation=function(e,r,i){for(var o=r===t.WritingMode.horizontal||r===t.WritingMode.horizontalOnly?r:0,n=r===t.WritingMode.vertical?r:0,a=0,s=[i.leftJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.rightJustifiedTextSymbolIndex];a<s.length;a+=1)e.text.placedSymbolArray.get(s[a]).placedOrientation=o;i.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(i.verticalPlacedTextSymbolIndex).placedOrientation=n)},be.prototype.commit=function(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;var e=this.prevPlacement,r=!1;this.prevZoomAdjustment=e?e.zoomAdjustment(this.transform.zoom):0;var i=e?e.symbolFadeChange(t):1,o=e?e.opacities:{},n=e?e.variableOffsets:{},a=e?e.placedOrientations:{};for(var s in this.placements){var l=this.placements[s],p=o[s];p?(this.opacities[s]=new fe(p,i,l.text,l.icon),r=r||l.text!==p.text.placed||l.icon!==p.icon.placed):(this.opacities[s]=new fe(null,i,l.text,l.icon,l.skipFade),r=r||l.text||l.icon)}for(var c in o){var u=o[c];if(!this.opacities[c]){var h=new fe(u,i,!1,!1);h.isHidden()||(this.opacities[c]=h,r=r||u.text.placed||u.icon.placed)}}for(var d in n)this.variableOffsets[d]||!this.opacities[d]||this.opacities[d].isHidden()||(this.variableOffsets[d]=n[d]);for(var f in a)this.placedOrientations[f]||!this.opacities[f]||this.opacities[f].isHidden()||(this.placedOrientations[f]=a[f]);r?this.lastPlacementChangeTime=t:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=e?e.lastPlacementChangeTime:t)},be.prototype.updateLayerOpacities=function(t,e){for(var r={},i=0,o=e;i<o.length;i+=1){var n=o[i],a=n.getBucket(t);a&&n.latestFeatureIndex&&t.id===a.layerIds[0]&&this.updateBucketOpacities(a,r,n.collisionBoxArray)}},be.prototype.updateBucketOpacities=function(e,r,i){var o=this;e.hasTextData()&&e.text.opacityVertexArray.clear(),e.hasIconData()&&e.icon.opacityVertexArray.clear(),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexArray.clear(),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexArray.clear();var n=e.layers[0].layout,a=new fe(null,0,!1,!1,!0),s=n.get("text-allow-overlap"),l=n.get("icon-allow-overlap"),p=n.get("text-variable-anchor"),c="map"===n.get("text-rotation-alignment"),u="map"===n.get("text-pitch-alignment"),h="none"!==n.get("icon-text-fit"),d=new fe(null,0,s&&(l||!e.hasIconData()||n.get("icon-optional")),l&&(s||!e.hasTextData()||n.get("text-optional")),!0);!e.collisionArrays&&i&&(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData())&&e.deserializeCollisionBoxes(i);for(var f=function(t,e,r){for(var i=0;i<e/4;i++)t.opacityVertexArray.emplaceBack(r)},m=function(i){var n=e.symbolInstances.get(i),s=n.numHorizontalGlyphVertices,l=n.numVerticalGlyphVertices,m=n.crossTileID,_=o.opacities[m];r[m]?_=a:_||(o.opacities[m]=_=d),r[m]=!0;var y=n.numIconVertices>0,g=o.placedOrientations[n.crossTileID],v=g===t.WritingMode.vertical,x=g===t.WritingMode.horizontal||g===t.WritingMode.horizontalOnly;if(s>0||l>0){var b=Ie(_.text);f(e.text,s,v?Pe:b),f(e.text,l,x?Pe:b);var w=_.text.isHidden();[n.rightJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.leftJustifiedTextSymbolIndex].forEach((function(t){t>=0&&(e.text.placedSymbolArray.get(t).hidden=w||v?1:0)})),n.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(n.verticalPlacedTextSymbolIndex).hidden=w||x?1:0);var C=o.variableOffsets[n.crossTileID];C&&o.markUsedJustification(e,C.anchor,n,g);var k=o.placedOrientations[n.crossTileID];k&&(o.markUsedJustification(e,"left",n,k),o.markUsedOrientation(e,k,n))}if(y){var S=Ie(_.icon),M=!(h&&n.verticalPlacedIconSymbolIndex&&v);n.placedIconSymbolIndex>=0&&(f(e.icon,n.numIconVertices,M?S:Pe),e.icon.placedSymbolArray.get(n.placedIconSymbolIndex).hidden=_.icon.isHidden()),n.verticalPlacedIconSymbolIndex>=0&&(f(e.icon,n.numVerticalIconVertices,M?Pe:S),e.icon.placedSymbolArray.get(n.verticalPlacedIconSymbolIndex).hidden=_.icon.isHidden())}if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){var E=e.collisionArrays[i];if(E){var T=new t.Point(0,0);if(E.textBox||E.verticalTextBox){var A=!0;if(p){var I=o.variableOffsets[m];I?(T=ve(I.anchor,I.width,I.height,I.textOffset,I.textBoxScale),c&&T._rotate(u?o.transform.angle:-o.transform.angle)):A=!1}E.textBox&&we(e.textCollisionBox.collisionVertexArray,_.text.placed,!A||v,T.x,T.y),E.verticalTextBox&&we(e.textCollisionBox.collisionVertexArray,_.text.placed,!A||x,T.x,T.y)}var P=Boolean(!x&&E.verticalIconBox);E.iconBox&&we(e.iconCollisionBox.collisionVertexArray,_.icon.placed,P,h?T.x:0,h?T.y:0),E.verticalIconBox&&we(e.iconCollisionBox.collisionVertexArray,_.icon.placed,!P,h?T.x:0,h?T.y:0)}}},_=0;_<e.symbolInstances.length;_++)m(_);if(e.sortFeatures(this.transform.angle),this.retainedQueryData[e.bucketInstanceId]&&(this.retainedQueryData[e.bucketInstanceId].featureSortOrder=e.featureSortOrder),e.hasTextData()&&e.text.opacityVertexBuffer&&e.text.opacityVertexBuffer.updateData(e.text.opacityVertexArray),e.hasIconData()&&e.icon.opacityVertexBuffer&&e.icon.opacityVertexBuffer.updateData(e.icon.opacityVertexArray),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexBuffer&&e.iconCollisionBox.collisionVertexBuffer.updateData(e.iconCollisionBox.collisionVertexArray),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexBuffer&&e.textCollisionBox.collisionVertexBuffer.updateData(e.textCollisionBox.collisionVertexArray),e.bucketInstanceId in this.collisionCircleArrays){var y=this.collisionCircleArrays[e.bucketInstanceId];e.placementInvProjMatrix=y.invProjMatrix,e.placementViewportMatrix=y.viewportMatrix,e.collisionCircleArray=y.circles,delete this.collisionCircleArrays[e.bucketInstanceId]}},be.prototype.symbolFadeChange=function(t){return 0===this.fadeDuration?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment},be.prototype.zoomAdjustment=function(t){return Math.max(0,(this.transform.zoom-t)/1.5)},be.prototype.hasTransitions=function(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration},be.prototype.stillRecent=function(t,e){var r=this.zoomAtLastRecencyCheck===e?1-this.zoomAdjustment(e):1;return this.zoomAtLastRecencyCheck=e,this.commitTime+this.fadeDuration*r>t},be.prototype.setStale=function(){this.stale=!0};var Ce=Math.pow(2,25),ke=Math.pow(2,24),Se=Math.pow(2,17),Me=Math.pow(2,16),Ee=Math.pow(2,9),Te=Math.pow(2,8),Ae=Math.pow(2,1);function Ie(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;var e=t.placed?1:0,r=Math.floor(127*t.opacity);return r*Ce+e*ke+r*Se+e*Me+r*Ee+e*Te+r*Ae+e}var Pe=0,Le=function(t){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=[]};Le.prototype.continuePlacement=function(t,e,r,i,o){for(var n=this._bucketParts;this._currentTileIndex<t.length;)if(e.getBucketParts(n,i,t[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,o())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,n.sort((function(t,e){return t.sortKey-e.sortKey})));this._currentPartIndex<n.length;)if(e.placeLayerBucketPart(n[this._currentPartIndex],this._seenCrossTileIDs,r),this._currentPartIndex++,o())return!0;return!1};var ze=function(t,e,r,i,o,n,a){this.placement=new be(t,o,n,a),this._currentPlacementIndex=e.length-1,this._forceFullPlacement=r,this._showCollisionBoxes=i,this._done=!1};ze.prototype.isDone=function(){return this._done},ze.prototype.continuePlacement=function(e,r,i){for(var o=this,n=t.browser.now(),a=function(){var e=t.browser.now()-n;return!o._forceFullPlacement&&e>2};this._currentPlacementIndex>=0;){var s=r[e[this._currentPlacementIndex]],l=this.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=l)&&(!s.maxzoom||s.maxzoom>l)){if(this._inProgressLayer||(this._inProgressLayer=new Le(s)),this._inProgressLayer.continuePlacement(i[s.source],this.placement,this._showCollisionBoxes,s,a))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},ze.prototype.commit=function(t){return this.placement.commit(t),this.placement};var Re=512/t.EXTENT/2,De=function(t,e,r){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=r;for(var i=0;i<e.length;i++){var o=e.get(i),n=o.key;this.indexedSymbolInstances[n]||(this.indexedSymbolInstances[n]=[]),this.indexedSymbolInstances[n].push({crossTileID:o.crossTileID,coord:this.getScaledCoordinates(o,t)})}};De.prototype.getScaledCoordinates=function(e,r){var i=Re/Math.pow(2,r.canonical.z-this.tileID.canonical.z);return{x:Math.floor((r.canonical.x*t.EXTENT+e.anchorX)*i),y:Math.floor((r.canonical.y*t.EXTENT+e.anchorY)*i)}},De.prototype.findMatches=function(t,e,r){for(var i=this.tileID.canonical.z<e.canonical.z?1:Math.pow(2,this.tileID.canonical.z-e.canonical.z),o=0;o<t.length;o++){var n=t.get(o);if(!n.crossTileID){var a=this.indexedSymbolInstances[n.key];if(a)for(var s=this.getScaledCoordinates(n,e),l=0,p=a;l<p.length;l+=1){var c=p[l];if(Math.abs(c.coord.x-s.x)<=i&&Math.abs(c.coord.y-s.y)<=i&&!r[c.crossTileID]){r[c.crossTileID]=!0,n.crossTileID=c.crossTileID;break}}}}};var Oe=function(){this.maxCrossTileID=0};Oe.prototype.generate=function(){return++this.maxCrossTileID};var Fe=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0};Fe.prototype.handleWrapJump=function(t){var e=Math.round((t-this.lng)/360);if(0!==e)for(var r in this.indexes){var i=this.indexes[r],o={};for(var n in i){var a=i[n];a.tileID=a.tileID.unwrapTo(a.tileID.wrap+e),o[a.tileID.key]=a}this.indexes[r]=o}this.lng=t},Fe.prototype.addBucket=function(t,e,r){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===e.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(var i=0;i<e.symbolInstances.length;i++)e.symbolInstances.get(i).crossTileID=0;this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]={});var o=this.usedCrossTileIDs[t.overscaledZ];for(var n in this.indexes){var a=this.indexes[n];if(Number(n)>t.overscaledZ)for(var s in a){var l=a[s];l.tileID.isChildOf(t)&&l.findMatches(e.symbolInstances,t,o)}else{var p=a[t.scaledTo(Number(n)).key];p&&p.findMatches(e.symbolInstances,t,o)}}for(var c=0;c<e.symbolInstances.length;c++){var u=e.symbolInstances.get(c);u.crossTileID||(u.crossTileID=r.generate(),o[u.crossTileID]=!0)}return void 0===this.indexes[t.overscaledZ]&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new De(t,e.symbolInstances,e.bucketInstanceId),!0},Fe.prototype.removeBucketCrossTileIDs=function(t,e){for(var r in e.indexedSymbolInstances)for(var i=0,o=e.indexedSymbolInstances[r];i<o.length;i+=1)delete this.usedCrossTileIDs[t][o[i].crossTileID]},Fe.prototype.removeStaleBuckets=function(t){var e=!1;for(var r in this.indexes){var i=this.indexes[r];for(var o in i)t[i[o].bucketInstanceId]||(this.removeBucketCrossTileIDs(r,i[o]),delete i[o],e=!0)}return e};var Be=function(){this.layerIndexes={},this.crossTileIDs=new Oe,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};Be.prototype.addLayer=function(t,e,r){var i=this.layerIndexes[t.id];void 0===i&&(i=this.layerIndexes[t.id]=new Fe);var o=!1,n={};i.handleWrapJump(r);for(var a=0,s=e;a<s.length;a+=1){var l=s[a],p=l.getBucket(t);p&&t.id===p.layerIds[0]&&(p.bucketInstanceId||(p.bucketInstanceId=++this.maxBucketInstanceId),i.addBucket(l.tileID,p,this.crossTileIDs)&&(o=!0),n[p.bucketInstanceId]=!0)}return i.removeStaleBuckets(n)&&(o=!0),o},Be.prototype.pruneUnusedLayers=function(t){var e={};for(var r in t.forEach((function(t){e[t]=!0})),this.layerIndexes)e[r]||delete this.layerIndexes[r]};var je=function(e,r){return t.emitValidationErrors(e,r&&r.filter((function(t){return"source.canvas"!==t.identifier})))},Ne=t.pick(Ut,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),Ue=t.pick(Ut,["setCenter","setZoom","setBearing","setP
1itch"]),Ve=function(){var e={},r=t.styleSpec.$version;for(var i in t.styleSpec.$root){var o,n=t.styleSpec.$root[i];n.required&&null!=(o="version"===i?r:"array"===n.type?[]:{})&&(e[i]=o)}return e}(),qe=function(e){function r(i,o){var n=this;void 0===o&&(o={}),e.call(this),this.map=i,this.dispatcher=new k(Bt(),this),this.imageManager=new h,this.imageManager.setEventedParent(this),this.glyphManager=new v(i._requestManager,o.localIdeographFontFamily),this.lineAtlas=new C(256,512),this.crossTileSymbolIndex=new Be,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new t.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",t.getReferrer());var a=this;this._rtlTextPluginCallback=r.registerForPluginStateChange((function(e){a.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:e.pluginStatus,pluginURL:e.pluginURL},(function(e,r){if(t.triggerPluginCompletionEvent(e),r&&r.every((function(t){return t})))for(var i in a.sourceCaches)a.sourceCaches[i].reload()}))})),this.on("data",(function(t){if("source"===t.dataType&&"metadata"===t.sourceDataType){var e=n.sourceCaches[t.sourceId];if(e){var r=e.getSource();if(r&&r.vectorLayerIds)for(var i in n._layers){var o=n._layers[i];o.source===r.id&&n._validateLayer(o)}}}}))}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.loadURL=function(e,r){var i=this;void 0===r&&(r={}),this.fire(new t.Event("dataloading",{dataType:"style"}));var o="boolean"==typeof r.validate?r.validate:!t.isMapboxURL(e);e=this.map._requestManager.normalizeStyleURL(e,r.accessToken);var n=this.map._requestManager.transformRequest(e,t.ResourceType.Style);this._request=t.getJSON(n,(function(e,r){i._request=null,e?i.fire(new t.ErrorEvent(e)):r&&i._load(r,o)}))},r.prototype.loadJSON=function(e,r){var i=this;void 0===r&&(r={}),this.fire(new t.Event("dataloading",{dataType:"style"})),this._request=t.browser.frame((function(){i._request=null,i._load(e,!1!==r.validate)}))},r.prototype.loadEmpty=function(){this.fire(new t.Event("dataloading",{dataType:"style"})),this._load(Ve,!1)},r.prototype._load=function(e,r){if(!r||!je(this,t.validateStyle(e))){for(var i in this._loaded=!0,this.stylesheet=e,e.sources)this.addSource(i,e.sources[i],{validate:!1});e.sprite?this._loadSprite(e.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(e.glyphs);var o=Nt(this.stylesheet.layers);this._order=o.map((function(t){return t.id})),this._layers={},this._serializedLayers={};for(var n=0,a=o;n<a.length;n+=1){var s=a[n];(s=t.createStyleLayer(s)).setEventedParent(this,{layer:{id:s.id}}),this._layers[s.id]=s,this._serializedLayers[s.id]=s.serialize()}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new w(this.stylesheet.light),this.fire(new t.Event("data",{dataType:"style"})),this.fire(new t.Event("style.load"))}},r.prototype._loadSprite=function(e){var r=this;this._spriteRequest=function(e,r,i){var o,n,a,s=t.browser.devicePixelRatio>1?"@2x":"",l=t.getJSON(r.transformRequest(r.normalizeSpriteURL(e,s,".json"),t.ResourceType.SpriteJSON),(function(t,e){l=null,a||(a=t,o=e,c())})),p=t.getImage(r.transformRequest(r.normalizeSpriteURL(e,s,".png"),t.ResourceType.SpriteImage),(function(t,e){p=null,a||(a=t,n=e,c())}));function c(){if(a)i(a);else if(o&&n){var e=t.browser.getImageData(n),r={};for(var s in o){var l=o[s],p=l.width,c=l.height,u=l.x,h=l.y,d=l.sdf,f=l.pixelRatio,m=l.stretchX,_=l.stretchY,y=l.content,g=new t.RGBAImage({width:p,height:c});t.RGBAImage.copy(e,g,{x:u,y:h},{x:0,y:0},{width:p,height:c}),r[s]={data:g,pixelRatio:f,sdf:d,stretchX:m,stretchY:_,content:y}}i(null,r)}}return{cancel:function(){l&&(l.cancel(),l=null),p&&(p.cancel(),p=null)}}}(e,this.map._requestManager,(function(e,i){if(r._spriteRequest=null,e)r.fire(new t.ErrorEvent(e));else if(i)for(var o in i)r.imageManager.addImage(o,i[o]);r.imageManager.setLoaded(!0),r._availableImages=r.imageManager.listImages(),r.dispatcher.broadcast("setImages",r._availableImages),r.fire(new t.Event("data",{dataType:"style"}))}))},r.prototype._validateLayer=function(e){var r=this.sourceCaches[e.source];if(r){var i=e.sourceLayer;if(i){var o=r.getSource();("geojson"===o.type||o.vectorLayerIds&&-1===o.vectorLayerIds.indexOf(i))&&this.fire(new t.ErrorEvent(new Error('Source layer "'+i+'" does not exist on source "'+o.id+'" as specified by style layer "'+e.id+'"')))}}},r.prototype.loaded=function(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(var t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()},r.prototype._serializeLayers=function(t){for(var e=[],r=0,i=t;r<i.length;r+=1){var o=this._layers[i[r]];"custom"!==o.type&&e.push(o.serialize())}return e},r.prototype.hasTransitions=function(){if(this.light&&this.light.hasTransition())return!0;for(var t in this.sourceCaches)if(this.sourceCaches[t].hasTransition())return!0;for(var e in this._layers)if(this._layers[e].hasTransition())return!0;return!1},r.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},r.prototype.update=function(e){if(this._loaded){var r=this._changed;if(this._changed){var i=Object.keys(this._updatedLayers),o=Object.keys(this._removedLayers);for(var n in(i.length||o.length)&&this._updateWorkerLayers(i,o),this._updatedSources){var a=this._updatedSources[n];"reload"===a?this._reloadSource(n):"clear"===a&&this._clearSource(n)}for(var s in this._updateTilesForChangedImages(),this._updatedPaintProps)this._layers[s].updateTransitions(e);this.light.updateTransitions(e),this._resetUpdates()}var l={};for(var p in this.sourceCaches){var c=this.sourceCaches[p];l[p]=c.used,c.used=!1}for(var u=0,h=this._order;u<h.length;u+=1){var d=this._layers[h[u]];d.recalculate(e,this._availableImages),!d.isHidden(e.zoom)&&d.source&&(this.sourceCaches[d.source].used=!0)}for(var f in l){var m=this.sourceCaches[f];l[f]!==m.used&&m.fire(new t.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:f}))}this.light.recalculate(e),this.z=e.zoom,r&&this.fire(new t.Event("data",{dataType:"style"}))}},r.prototype._updateTilesForChangedImages=function(){var t=Object.keys(this._changedImages);if(t.length){for(var e in this.sourceCaches)this.sourceCaches[e].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}},r.prototype._updateWorkerLayers=function(t,e){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(t),removedIds:e})},r.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}},r.prototype.setState=function(e){var r=this;if(this._checkLoaded(),je(this,t.validateStyle(e)))return!1;
vendor: 6,108 bytes, line 1
1(e=t.clone$1(e)).layers=Nt(e.layers);var i=function(e,r){if(!e)return[{command:Ut.setStyle,args:[r]}];var i=[];try{if(!t.deepEqual(e.version,r.version))return[{command:Ut.setStyle,args:[r]}];t.deepEqual(e.center,r.center)||i.push({command:Ut.setCenter,args:[r.center]}),t.deepEqual(e.zoom,r.zoom)||i.push({command:Ut.setZoom,args:[r.zoom]}),t.deepEqual(e.bearing,r.bearing)||i.push({command:Ut.setBearing,args:[r.bearing]}),t.deepEqual(e.pitch,r.pitch)||i.push({command:Ut.setPitch,args:[r.pitch]}),t.deepEqual(e.sprite,r.sprite)||i.push({command:Ut.setSprite,args:[r.sprite]}),t.deepEqual(e.glyphs,r.glyphs)||i.push({command:Ut.setGlyphs,args:[r.glyphs]}),t.deepEqual(e.transition,r.transition)||i.push({command:Ut.setTransition,args:[r.transition]}),t.deepEqual(e.light,r.light)||i.push({command:Ut.setLight,args:[r.light]});var o={},n=[];!function(e,r,i,o){var n;for(n in r=r||{},e=e||{})e.hasOwnProperty(n)&&(r.hasOwnProperty(n)||qt(n,i,o));for(n in r)r.hasOwnProperty(n)&&(e.hasOwnProperty(n)?t.deepEqual(e[n],r[n])||("geojson"===e[n].type&&"geojson"===r[n].type&&Ht(e,r,n)?i.push({command:Ut.setGeoJSONSourceData,args:[n,r[n].data]}):$t(n,r,i,o)):Vt(n,r,i))}(e.sources,r.sources,n,o);var a=[];e.layers&&e.layers.forEach((function(t){o[t.source]?i.push({command:Ut.removeLayer,args:[t.id]}):a.push(t)})),i=i.concat(n),function(e,r,i){r=r||[];var o,n,a,s,l,p,c,u=(e=e||[]).map(Gt),h=r.map(Gt),d=e.reduce(Qt,{}),f=r.reduce(Qt,{}),m=u.slice(),_=Object.create(null);for(o=0,n=0;o<u.length;o++)f.hasOwnProperty(a=u[o])?n++:(i.push({command:Ut.removeLayer,args:[a]}),m.splice(m.indexOf(a,n),1));for(o=0,n=0;o<h.length;o++)m[m.length-1-o]!==(a=h[h.length-1-o])&&(d.hasOwnProperty(a)?(i.push({command:Ut.removeLayer,args:[a]}),m.splice(m.lastIndexOf(a,m.length-n),1)):n++,i.push({command:Ut.addLayer,args:[f[a],p=m[m.length-o]]}),m.splice(m.length-o,0,a),_[a]=!0);for(o=0;o<h.length;o++)if(s=d[a=h[o]],l=f[a],!_[a]&&!t.deepEqual(s,l))if(t.deepEqual(s.source,l.source)&&t.deepEqual(s["source-layer"],l["source-layer"])&&t.deepEqual(s.type,l.type)){for(c in Zt(s.layout,l.layout,i,a,null,Ut.setLayoutProperty),Zt(s.paint,l.paint,i,a,null,Ut.setPaintProperty),t.deepEqual(s.filter,l.filter)||i.push({command:Ut.setFilter,args:[a,l.filter]}),t.deepEqual(s.minzoom,l.minzoom)&&t.deepEqual(s.maxzoom,l.maxzoom)||i.push({command:Ut.setLayerZoomRange,args:[a,l.minzoom,l.maxzoom]}),s)s.hasOwnProperty(c)&&"layout"!==c&&"paint"!==c&&"filter"!==c&&"metadata"!==c&&"minzoom"!==c&&"maxzoom"!==c&&(0===c.indexOf("paint.")?Zt(s[c],l[c],i,a,c.slice(6),Ut.setPaintProperty):t.deepEqual(s[c],l[c])||i.push({command:Ut.setLayerProperty,args:[a,c,l[c]]}));for(c in l)l.hasOwnProperty(c)&&!s.hasOwnProperty(c)&&"layout"!==c&&"paint"!==c&&"filter"!==c&&"metadata"!==c&&"minzoom"!==c&&"maxzoom"!==c&&(0===c.indexOf("paint.")?Zt(s[c],l[c],i,a,c.slice(6),Ut.setPaintProperty):t.deepEqual(s[c],l[c])||i.push({command:Ut.setLayerProperty,args:[a,c,l[c]]}))}else i.push({command:Ut.removeLayer,args:[a]}),p=m[m.lastIndexOf(a)+1],i.push({command:Ut.addLayer,args:[l,p]})}(a,r.layers,i)}catch(t){console.warn("Unable to compute style diff:",t),i=[{command:Ut.setStyle,args:[r]}]}return i}(this.serialize(),e).filter((function(t){return!(t.command in Ue)}));if(0===i.length)return!1;var o=i.filter((function(t){return!(t.command in Ne)}));if(o.length>0)throw new Error("Unimplemented: "+o.map((function(t){return t.command})).join(", ")+".");return i.forEach((function(t){"setTransition"!==t.command&&r[t.command].apply(r,t.args)})),this.stylesheet=e,!0},r.prototype.addImage=function(e,r){if(this.getImage(e))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(e,r),this._afterImageUpdated(e)},r.prototype.updateImage=function(t,e){this.imageManager.updateImage(t,e)},r.prototype.getImage=function(t){return this.imageManager.getImage(t)},r.prototype.removeImage=function(e){if(!this.getImage(e))return this.fire(new t.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(e),this._afterImageUpdated(e)},r.prototype._afterImageUpdated=function(e){this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new t.Event("data",{dataType:"style"}))},r.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},r.prototype.addSource=function(e,r,i){var o=this;if(void 0===i&&(i={}),this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error("There is already a source with this ID");if(!r.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(r).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(r.type)>=0&&this._validate(t.validateStyle.source,"sources."+e,r,null,i))){this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);var n=this.sourceCaches[e]=new It(e,r,this.dispatcher);n.style=this,n.setEventedParent(this,(function(){return{isSourceLoaded:o.loaded(),source:n.serialize(),sourceId:e}})),n.onAdd(this.map),this._changed=!0}},r.prototype.removeSource=function(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(var r in this._layers)if(this._layers[r].source===e)return this.fire(new t.ErrorEvent(new Error('Source "'+e+'" cannot be removed while layer "'+r+'" is using it.')));var i=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],i.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),i.setEventedParent(null),i.clearTiles(),i.onRemove&&i.onRemove(this.map),this._changed=!0},r.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0},r.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},r.prototype.addLayer=function(e,r,i){void 0===i&&(i={}),this._checkLoaded();var o=e.id;if(this.getLayer(o))this.fire(new t.ErrorEvent(new Error('Layer with i
1d "'+o+'" already exists on this map')));else{var n;if("custom"===e.type){if(je(this,t.validateCustomStyleLayer(e)))return;n=t.createStyleLayer(e)}else{if("object"==typeof e.source&&(this.addSource(o,e.source),e=t.clone$1(e),e=t.extend(e,{source:o})),this._validate(t.validateStyle.layer,"layers."+o,e,{arrayIndex:-1},i))return;n=t.createStyleLayer(e),this._validateLayer(n),n.setEventedParent(this,{layer:{id:o}}),this._serializedLayers[n.id]=n.serialize()}var a=r?this._order.indexOf(r):this._order.length;if(r&&-1===a)this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.')));else{if(this._order.splice(a,0,o),this._layerOrderChanged=!0,this._layers[o]=n,this._removedLayers[o]&&n.source&&"custom"!==n.type){var s=this._removedLayers[o];delete this._removedLayers[o],s.type!==n.type?this._updatedSources[n.source]="clear":(this._updatedSources[n.source]="reload",this.sourceCaches[n.source].pause())}this._updateLayer(n),n.onAdd&&n.onAdd(this.map)}}},r.prototype.moveLayer=function(e,r){if(this._checkLoaded(),this._changed=!0,this._layers[e]){if(e!==r){var i=this._order.indexOf(e);this._order.splice(i,1);var o=r?this._order.indexOf(r):this._order.length;
vendor: 11,589 bytes, line 1
1r&&-1===o?this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.'))):(this._order.splice(o,0,e),this._layerOrderChanged=!0)}}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be moved.")))},r.prototype.removeLayer=function(e){this._checkLoaded();var r=this._layers[e];if(r){r.setEventedParent(null);var i=this._order.indexOf(e);this._order.splice(i,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=r,delete this._layers[e],delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],r.onRemove&&r.onRemove(this.map)}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be removed.")))},r.prototype.getLayer=function(t){return this._layers[t]},r.prototype.hasLayer=function(t){return t in this._layers},r.prototype.setLayerZoomRange=function(e,r,i){this._checkLoaded();var o=this.getLayer(e);o?o.minzoom===r&&o.maxzoom===i||(null!=r&&(o.minzoom=r),null!=i&&(o.maxzoom=i),this._updateLayer(o)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot have zoom extent.")))},r.prototype.setFilter=function(e,r,i){void 0===i&&(i={}),this._checkLoaded();var o=this.getLayer(e);if(o){if(!t.deepEqual(o.filter,r))return null==r?(o.filter=void 0,void this._updateLayer(o)):void(this._validate(t.validateStyle.filter,"layers."+o.id+".filter",r,null,i)||(o.filter=t.clone$1(r),this._updateLayer(o)))}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be filtered.")))},r.prototype.getFilter=function(e){return t.clone$1(this.getLayer(e).filter)},r.prototype.setLayoutProperty=function(e,r,i,o){void 0===o&&(o={}),this._checkLoaded();var n=this.getLayer(e);n?t.deepEqual(n.getLayoutProperty(r),i)||(n.setLayoutProperty(r,i,o),this._updateLayer(n)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getLayoutProperty=function(e,r){var i=this.getLayer(e);if(i)return i.getLayoutProperty(r);this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style.")))},r.prototype.setPaintProperty=function(e,r,i,o){void 0===o&&(o={}),this._checkLoaded();var n=this.getLayer(e);n?t.deepEqual(n.getPaintProperty(r),i)||(n.setPaintProperty(r,i,o)&&this._updateLayer(n),this._changed=!0,this._updatedPaintProps[e]=!0):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},r.prototype.setFeatureState=function(e,r){this._checkLoaded();var i=e.source,o=e.sourceLayer,n=this.sourceCaches[i];if(void 0!==n){var a=n.getSource().type;"geojson"===a&&o?this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==a||o?(void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),n.setFeatureState(o,e.id,r)):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+i+"' does not exist in the map's style.")))},r.prototype.removeFeatureState=function(e,r){this._checkLoaded();var i=e.source,o=this.sourceCaches[i];if(void 0!==o){var n=o.getSource().type,a="vector"===n?e.sourceLayer:void 0;"vector"!==n||a?r&&"string"!=typeof e.id&&"number"!=typeof e.id?this.fire(new t.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):o.removeFeatureState(a,e.id,r):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+i+"' does not exist in the map's style.")))},r.prototype.getFeatureState=function(e){this._checkLoaded();var r=e.source,i=e.sourceLayer,o=this.sourceCaches[r];if(void 0!==o){if("vector"!==o.getSource().type||i)return void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),o.getFeatureState(i,e.id);this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+r+"' does not exist in the map's style.")))},r.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},r.prototype.serialize=function(){return t.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:t.mapObject(this.sourceCaches,(function(t){return t.serialize()})),layers:this._serializeLayers(this._order)},(function(t){return void 0!==t}))},r.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&"raster"!==this.sourceCaches[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0},r.prototype._flattenAndSortRenderedFeatures=function(t){for(var e=this,r=function(t){return"fill-extrusion"===e._layers[t].type},i={},o=[],n=this._order.length-1;n>=0;n--){var a=this._order[n];if(r(a)){i[a]=n;for(var s=0,l=t;s<l.length;s+=1){var p=l[s][a];if(p)for(var c=0,u=p;c<u.length;c+=1)o.push(u[c])}}}o.sort((function(t,e){return e.intersectionZ-t.intersectionZ}));for(var h=[],d=this._order.length-1;d>=0;d--){var f=this._order[d];if(r(f))for(var m=o.length-1;m>=0;m--){var _=o[m].feature;if(i[_.layer.id]<d)break;h.push(_),o.pop()}else for(var y=0,g=t;y<g.length;y+=1){var v=g[y][f];if(v)for(var x=0,b=v;x<b.length;x+=1)h.push(b[x].feature)}}return h},r.prototype.queryRenderedFeatures=function(e,r,i){r&&r.filter&&this._validate(t.validateStyle.filter,"queryRenderedFeatures.filter",r.filter,null,r);var o={};if(r&&r.layers){if(!Array.isArray(r.layers))return this.fire(new t.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(var n=0,a=r.layers;n<a.length;n+=1){var s=a[n],l=this._layers[s];if(!l)return this.fire(new t.ErrorEvent(new Error("The layer '"+s+"' does not exist in the map's style and cannot be queried for features."))),[];o[l.source]=!0}}var p=[];for(var c in r.availableImages=this._availableImages,this.sourceCaches)r.layers&&!o[c]||p.push(F(this.sourceCaches[c],this._layers,this._serializedLayers,e,r,i));return this.placement&&p.push(function(t,e,r,i,o,n,a){for(var s={},l=n.queryRenderedSymbols(i),p=[],c=0,u=Object.keys(l).map(Number);c<u.length;c+=1)p.push(a[u[c]]);p.sort(B);for(var h=function(){var r=f[d],i=r.featureIndex.lookupSymbolFeatures(l[r.bucketInstanceId],e,r.bucketIndex,r.sourceLayerIndex,o.filter,o.layers,o.availableImages,t);for(var n in i){var a=s[n]=s[n]||[],p=i[n];p.sort((function(t,e){var i=r.featureSortOrder;if(i){var o=i.indexOf(t.featureIndex);return i.indexOf(e.featureIndex)-o}return e.featureIndex-t.featureIndex}));for(var c=0,u=p;c<u.length;c+=1)a.push(u[c])}},d=0,f=p;d<f.length;d+=1)h();var m=function(e){s[e].forEach((function(i){var o=i.feature,n=r[t[e].source].getFeatureState(o.layer["source-layer"],o.id);o.source=o.layer.source,o.layer["source-layer"]&&(o.sourceLayer=o.layer["source-layer"]),o.state=n}))};for(var _ in s)m(_);return s}(this._layers,this._serializedLayers,this.sourceCaches,e,r,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(p)},r.prototype.querySourceFeatures=function(e,r){r&&r.filter&&this._validate(t.validateStyle.filter,"querySourceFeatures.filter",r.filter,null,r);var i=this.sourceCaches[e];return i?function(t,e){for(var r=t.getRenderableIds().map((function(e){return t.getTileByID(e)})),i=[],o={},n=0;n<r.length;n++){var a=r[n],s=a.tileID.canonical.key;o[s]||(o[s]=!0,a.querySourceFeatures(i,e))}return i}(i,r):[]},r.prototype.addSourceType=function(t,e,i){return r.getSourceType(t)?i(new Error('A source type called "'+t+'" already exists.')):(r.setSourceType(t,e),e.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:t,url:e.workerSourceURL},i):i(null,null))},r.prototype.getLight=function(){return this.light.getLight()},r.prototype.setLight=function(e,r){void 0===r&&(r={}),this._checkLoaded();var i=this.light.getLight(),o=!1;for(var n in e)if(!t.deepEqual(e[n],i[n])){o=!0;break}if(o){var a={now:t.browser.now(),transition:t.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(e,r),this.light.updateTransitions(a)}},r.prototype._validate=function(e,r,i,o,n){return void 0===n&&(n={}),(!n||!1!==n.validate)&&je(this,e.call(t.validateStyle,t.extend({key:r,style:this.serialize(),value:i,styleSpec:t.styleSpec},o)))},r.prototype._remove=function(){for(var e in this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),t.evented.off("pluginStateChange",this._rtlTextPluginCallback),this._layers)this._layers[e].setEventedParent(null);for(var r in this.sourceCaches)this.sourceCaches[r].clearTiles(),this.sourceCaches[r].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()},r.prototype._clearSource=function(t){this.sourceCaches[t].clearTiles()},r.prototype._reloadSource=function(t){this.sourceCaches[t].resume(),this.sourceCaches[t].reload()},r.prototype._updateSources=function(t){for(var e in this.sourceCaches)this.sourceCaches[e].update(t)},r.prototype._generateCollisionBoxes=function(){for(var t in this.sourceCaches)this._reloadSource(t)},r.prototype._updatePlacement=function(e,r,i,o,n){void 0===n&&(n=!1);for(var a=!1,s=!1,l={},p=0,c=this._order;p<c.length;p+=1){var u=this._layers[c[p]];if("symbol"===u.type){if(!l[u.source]){var h=this.sourceCaches[u.source];l[u.source]=h.getRenderableIds(!0).map((function(t){return h.getTileByID(t)})).sort((function(t,e){return e.tileID.overscaledZ-t.tileID.overscaledZ||(t.tileID.isLessThan(e.tileID)?-1:1)}))}var d=this.crossTileSymbolIndex.addLayer(u,l[u.source],e.center.lng);a=a||d}}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((n=n||this._layerOrderChanged||0===i)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(t.browser.now(),e.zoom))&&(this.pauseablePlacement=new ze(e,this._order,n,r,i,o,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,l),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(t.browser.now()),s=!0),a&&this.pauseablePlacement.placement.setStale()),s||a)for(var f=0,m=this._order;f<m.length;f+=1){var _=this._layers[m[f]];"symbol"===_.type&&this.placement.updateLayerOpacities(_,l[_.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(t.browser.now())},r.prototype._releaseSymbolFadeTiles=function(){for(var t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles()},r.prototype.getImages=function(t,e,r){this.imageManager.getImages(e.icons,r),this._updateTilesForChangedImages();var i=this.sourceCaches[e.source];i&&i.setDependencies(e.tileID.key,e.type,e.icons)},r.prototype.getGlyphs=function(t,e,r){this.glyphManager.getGlyphs(e.stacks,r)}
1,r.prototype.getResource=function(e,r,i){return t.makeRequest(r,i)},r}(t.Evented);qe.getSourceType=function(t){return D[t]},qe.setSourceType=function(t,e){D[t]=e},qe.registerForPluginStateChange=t.registerForPluginStateChange;var $e=t.createLayout([{name:"a_pos",type:"Int16",components:2}]),He=yr("#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;}"),Ze=yr("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);}"),Ge=yr("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);}"),Qe=yr("varying vec3 v_data;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius
1/(radius+stroke_width));gl_FragColor=opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,0,1);} else {gl_Position=u_matrix*vec4(circle_center,0,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}"),Xe=yr("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),We=yr("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;}"),Ke=yr("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;}"),Je=yr("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),Ye=yr("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);}"),tr=yr("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,0,1);}"),er=yr("#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);}"),rr=yr("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;}"),ir=yr("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;}"),or=yr("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform 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);}"),nr=yr("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}"),ar=yr("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;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 pixe
1l_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;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"),sr=yr("#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;}"),lr=yr("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;}"),pr=yr("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),cr=yr("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;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),ur=yr("uniform 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;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),hr=yr("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;
1uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}"),dr=yr("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;}"),fr=yr("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}"),mr=yr("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),_r=yr("#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;
1gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}");function yr(t,e){var r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,i=e.match(/attribute ([\w]+) ([\w]+)/g),o=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),n=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=n?n.concat(o):o,s={};return{fragmentSource:t=t.replace(r,(function(t,e,r,i,o){return s[o]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+o+"\nvarying "+r+" "+i+" "+o+";\n#else\nuniform "+r+" "+i+" u_"+o+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+o+"\n "+r+" "+i+" "+o+" = u_"+o+";\n#endif\n"})),vertexSource:e=e.replace(r,(function(t,e,r,i,o){var n="float"===i?"vec2":"vec4",a=o.match(/color/)?"color":n;return s[o]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+o+"\nuniform lowp float u_"+o+"_t;\nattribute "+r+" "+n+" a_"+o+";\nvarying "+r+" "+i+" "+o+";\n#else\nuniform "+r+" "+i+" u_"+o+";\n#endif\n":"vec4"===a?"\n#ifndef HAS_UNIFORM_u_"+o+"\n "+o+" = a_"+o+";\n#else\n "+r+" "+i+" "+o+" = u_"+o+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+o+"\n "+o+" = unpack_mix_"+a+"(a_"+o+", u_"+o+"_t);\n#else\n "+r+" "+i+" "+o+" = u_"+o+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+o+"\nuniform lowp float u_"+o+"_t;\nattribute "+r+" "+n+" a_"+o+";\n#else\nuniform "+r+" "+i+" u_"+o+";\n#endif\n":"vec4"===a?"\n#ifndef HAS_UNIFORM_u_"+o+"\n "+r+" "+i+" "+o+" = a_"+o+";\n#else\n "+r+" "+i+" "+o+" = u_"+o+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+o+"\n "+r+" "+i+" "+o+" = unpack_mix_"+a+"(a_"+o+", u_"+o+"_t);\n#else\n "+r+" "+i+" "+o+" = u_"+o+";\n#endif\n"})),staticAttributes:i,staticUniforms:a}}var gr=Object.freeze({__proto__:null,prelude:He,background:Ze,backgroundPattern:Ge,circle:Qe,clippingMask:Xe,heatmap:We,heatmapTexture:Ke,collisionBox:Je,collisionCircle:Ye,debug:tr,fill:er,fillOutline:rr,fillOutlinePattern:ir,fillPattern:or,fillExtrusion:nr,fillExtrusionPattern:ar,hillshadePrepare:sr,hillshade:lr,line:pr,lineGradient:cr,linePattern:ur,lineSDF:hr,raster:dr,symbolIcon:fr,symbolSDF:mr,symbolTextAndIcon:_r}),vr=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};function xr(t){for(var e=[],r=0;r<t.length;r++)if(null!==t[r]){var i=t[r].split(" ");e.push(i.pop())}return e}vr.prototype.bind=function(t,e,r,i,o,n,a,s){this.context=t;for(var l=this.boundPaintVertexBuffers.length!==i.length,p=0;!l&&p<i.length;
vendor: 8,426 bytes, line 1
1p++)this.boundPaintVertexBuffers[p]!==i[p]&&(l=!0);t.extVertexArrayObject&&this.vao&&this.boundProgram===e&&this.boundLayoutVertexBuffer===r&&!l&&this.boundIndexBuffer===o&&this.boundVertexOffset===n&&this.boundDynamicVertexBuffer===a&&this.boundDynamicVertexBuffer2===s?(t.bindVertexArrayOES.set(this.vao),a&&a.bind(),o&&o.dynamicDraw&&o.bind(),s&&s.bind()):this.freshBind(e,r,i,o,n,a,s)},vr.prototype.freshBind=function(t,e,r,i,o,n,a){var s,l=t.numAttributes,p=this.context,c=p.gl;if(p.extVertexArrayObject)this.vao&&this.destroy(),this.vao=p.extVertexArrayObject.createVertexArrayOES(),p.bindVertexArrayOES.set(this.vao),s=0,this.boundProgram=t,this.boundLayoutVertexBuffer=e,this.boundPaintVertexBuffers=r,this.boundIndexBuffer=i,this.boundVertexOffset=o,this.boundDynamicVertexBuffer=n,this.boundDynamicVertexBuffer2=a;else{s=p.currentNumAttributes||0;for(var u=l;u<s;u++)c.disableVertexAttribArray(u)}e.enableAttributes(c,t);for(var h=0,d=r;h<d.length;h+=1)d[h].enableAttributes(c,t);n&&n.enableAttributes(c,t),a&&a.enableAttributes(c,t),e.bind(),e.setVertexAttribPointers(c,t,o);for(var f=0,m=r;f<m.length;f+=1){var _=m[f];_.bind(),_.setVertexAttribPointers(c,t,o)}n&&(n.bind(),n.setVertexAttribPointers(c,t,o)),i&&i.bind(),a&&(a.bind(),a.setVertexAttribPointers(c,t,o)),p.currentNumAttributes=l},vr.prototype.destroy=function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)};var br=function(t,e,r,i,o,n){var a=t.gl;this.program=a.createProgram();for(var s=xr(r.staticAttributes),l=i?i.getBinderAttributes():[],p=s.concat(l),c=r.staticUniforms?xr(r.staticUniforms):[],u=i?i.getBinderUniforms():[],h=[],d=0,f=c.concat(u);d<f.length;d+=1){var m=f[d];h.indexOf(m)<0&&h.push(m)}var _=i?i.defines():[];n&&_.push("#define OVERDRAW_INSPECTOR;");var y=_.concat(He.fragmentSource,r.fragmentSource).join("\n"),g=_.concat(He.vertexSource,r.vertexSource).join("\n"),v=a.createShader(a.FRAGMENT_SHADER);if(a.isContextLost())this.failedToCreate=!0;else{a.shaderSource(v,y),a.compileShader(v),a.attachShader(this.program,v);var x=a.createShader(a.VERTEX_SHADER);if(a.isContextLost())this.failedToCreate=!0;else{a.shaderSource(x,g),a.compileShader(x),a.attachShader(this.program,x),this.attributes={};var b={};this.numAttributes=p.length;for(var w=0;w<this.numAttributes;w++)p[w]&&(a.bindAttribLocation(this.program,w,p[w]),this.attributes[p[w]]=w);a.linkProgram(this.program),a.deleteShader(x),a.deleteShader(v);for(var C=0;C<h.length;C++){var k=h[C];if(k&&!b[k]){var S=a.getUniformLocation(this.program,k);S&&(b[k]=S)}}this.fixedUniforms=o(t,b),this.binderUniforms=i?i.getUniforms(t,b):[]}}};function wr(t,e,r){var i=1/he(r,1,e.transform.tileZoom),o=Math.pow(2,r.tileID.overscaledZ),n=r.tileSize*Math.pow(2,e.transform.tileZoom)/o,a=n*(r.tileID.canonical.x+r.tileID.wrap*o),s=n*r.tileID.canonical.y;return{u_image:0,u_texsize:r.imageAtlasTexture.size,u_scale:[i,t.fromScale,t.toScale],u_fade:t.t,u_pixel_coord_upper:[a>>16,s>>16],u_pixel_coord_lower:[65535&a,65535&s]}}br.prototype.draw=function(t,e,r,i,o,n,a,s,l,p,c,u,h,d,f,m){var _,y=t.gl;if(!this.failedToCreate){for(var g in t.program.set(this.program),t.setDepthMode(r),t.setStencilMode(i),t.setColorMode(o),t.setCullFace(n),this.fixedUniforms)this.fixedUniforms[g].set(a[g]);d&&d.setUniforms(t,this.binderUniforms,u,{zoom:h});for(var v=(_={},_[y.LINES]=2,_[y.TRIANGLES]=3,_[y.LINE_STRIP]=1,_)[e],x=0,b=c.get();x<b.length;x+=1){var w=b[x],C=w.vaos||(w.vaos={});(C[s]||(C[s]=new vr)).bind(t,this,l,d?d.getPaintVertexBuffers():[],p,w.vertexOffset,f,m),y.drawElements(e,w.primitiveLength*v,y.UNSIGNED_SHORT,w.primitiveOffset*v*2)}}};var Cr=function(e,r,i,o){var n=r.style.light,a=n.properties.get("position"),s=[a.x,a.y,a.z],l=t.create$1();"viewport"===n.properties.get("anchor")&&t.fromRotation(l,-r.transform.angle),t.transformMat3(s,s,l);var p=n.properties.get("color");return{u_matrix:e,u_lightpos:s,u_lightintensity:n.properties.get("intensity"),u_lightcolor:[p.r,p.g,p.b],u_vertical_gradient:+i,u_opacity:o}},kr=function(e,r,i,o,n,a,s){return t.extend(Cr(e,r,i,o),wr(a,r,s),{u_height_factor:-Math.pow(2,n.overscaledZ)/s.tileSize/8})},Sr=function(t){return{u_matrix:t}},Mr=function(e,r,i,o){return t.extend(Sr(e),wr(i,r,o))},Er=function(t,e){return{u_matrix:t,u_world:e}},Tr=function(e,r,i,o,n){return t.extend(Mr(e,r,i,o),{u_world:n})},Ar=function(e,r,i,o){var n,a,s=e.transform;if("map"===o.paint.get("circle-pitch-alignment")){var l=he(i,1,s.zoom);n=!0,a=[l,l]}else n=!1,a=s.pixelsToGLUnits;return{u_camera_to_center_distance:s.cameraToCenterDistance,u_scale_with_map:+("map"===o.paint.get("circle-pitch-scale")),u_matrix:e.translatePosMatrix(r.posMatrix,i,o.paint.get("circle-translate"),o.paint.get("circle-translate-anchor")),u_pitch_with_map:+n,u_device_pixel_ratio:t.browser.devicePixelRatio,u_extrude_scale:a}},Ir=function(t,e,r){var i=he(r,1,e.zoom),o=Math.pow(2,e.zoom-r.tileID.overscaledZ),n=r.tileID.overscaleFactor();return{u_matrix:t,u_camera_to_center_distance:e.cameraToCenterDistance,u_pixels_to_tile_units:i,u_extrude_scale:[e.pixelsToGLUnits[0]/(i*o),e.pixelsToGLUnits[1]/(i*o)],u_overscale_factor:n}},Pr=function(t,e,r){return{u_matrix:t,u_inv_matrix:e,u_camera_to_center_distance:r.cameraToCenterDistance,u_viewport_size:[r.width,r.height]}},Lr=function(t,e,r){return void 0===r&&(r=1),{u_matrix:t,u_color:e,u_overlay:0,u_overlay_scale:r}},zr=function(t){return{u_matrix:t}},Rr=function(t,e,r,i){return{u_matrix:t,u_extrude_scale:he(e,1,r),u_intensity:i}},Dr=function(e,r,i){var o=e.transform;return{u_matrix:Nr(e,r,i),u_ratio:1/he(r,1,o.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_units_to_pixels:[1/o.pixelsToGLUnits[0],1/o.pixelsToGLUnits[1]]}},Or=function(e,r,i,o){return t.extend(Dr(e,r,i),{u_image:0,u_image_height:o})},Fr=function(e,r,i,o){var n=e.transform,a=jr(r,n);return{u_matrix:Nr(e,r,i),u_texsize:r.imageAtlasTexture.size,u_ratio:1/he(r,1,n.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_image:0,u_scale:[a,o.fromScale,o.toScale],u_fade:o.t,u_units_to_pixels:[1/n.pixelsToGLUnits[0],1/n.pixelsToGLUnits[1]]}},Br=function(e,r,i,o,n){var a=e.lineAtlas,s=jr(r,e.transform),l="round"===i.layout.get("line-cap"),p=a.getDash(o.from,l),c=a.getDash(o.to,l),u=p.width*n.fromScale,h=c.width*n.toScale;return t.extend(Dr(e,r,i),{u_patternscale_a:[s/u,-p.height/2],u_patternscale_b:[s/h,-c.height/2],u_sdfgamma:a.width/(256*Math.min(u,h)*t.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:p.y,u_tex_y_b:c.y,u_mix:n.t})};function jr(t,e){return 1/he(t,1,e.tileZoom)}function Nr(t,e,r){return t.translatePosMatrix(e.tileID.posMatrix,e,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}var Ur=function(t,e,r,i,o){return{u_matrix:t,u_tl_parent:e,u_scale_parent:r,u_buffer_scale:1,u_fade_t:i.mix,u_opacity:i.opacity*o.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:o.paint.get("raster-brightness-min"),u_brightness_high:o.paint.get("raster-brightness-max"),u_saturation_factor:(a=o.paint.get("raster-saturation"),a>0?1-1/(1.001-a):-a),u_contrast_factor:(n=o.paint.get("raster-contrast"),n>0?1/(1-n):1+n),u_spin_weights:Vr(o.paint.get("raster-hue-rotate"))};var n,a};function Vr(t){t*=Math.PI/180;var e=Math.sin(t),r=Math.cos(t);return[(2*r+1)/3,(-Math.sqrt(3)*e-r+1)/3,(Math.sqrt(3)*e-r+1)/3]}var qr,$r=function(t,e,r,i,o,n,a,s,l,p){var c=o.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:c.cameraToCenterDistance,u_pitch:c.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:c.width/c.height,u_fade_change:o.options.fadeDuration?o.symbolFadeChange:1,u_matrix:n,u_label_plane_matrix:a,u_coord_matrix:s,u_is_text:+l,u_pitch_with_map:+i,u_texsize:p,u_texture:0}},Hr=function(e,r,i,o,n,a,s,l,p,c,u){var h=n.transform;return t.extend($r(e,r,i,o,n,a,s,l,p,c),{u_gamma_scale:o?Math.cos(h._pitch)*h.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:+u})},Zr=function(e,r,i,o,n,a,s,l,p,c){return t.extend(Hr(e,r,i,o,n,a,s,l,!0,p,!0),{u_texsize_icon:c,u_texture_icon:1})},Gr=function(t,e,r){return{u_matrix:t,u_opacity:e,u_color:r}},Qr=function(e,r,i,o,n,a){return t.extend(function(t,e,r,i){var o=r.imageManager.getPattern(t.from.toString()),n=r.imageManager.getPattern(t.to.toString()),a=r.imageManager.getPixelSize(),s=a.width,l=a.height,p=Math.pow(2,i.tileID.overscaledZ
vendor: 7,470 bytes, line 1
1),c=i.tileSize*Math.pow(2,r.transform.tileZoom)/p,u=c*(i.tileID.canonical.x+i.tileID.wrap*p),h=c*i.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:o.tl,u_pattern_br_a:o.br,u_pattern_tl_b:n.tl,u_pattern_br_b:n.br,u_texsize:[s,l],u_mix:e.t,u_pattern_size_a:o.displaySize,u_pattern_size_b:n.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/he(i,1,r.transform.tileZoom),u_pixel_coord_upper:[u>>16,h>>16],u_pixel_coord_lower:[65535&u,65535&h]}}(o,a,i,n),{u_matrix:e,u_opacity:r})},Xr={fillExtrusion:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fillExtrusionPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_height_factor:new t.Uniform1f(e,r.u_height_factor),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fill:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},fillPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},fillOutline:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world)}},fillOutlinePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},circle:function(e,r){return{u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(e,r.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},collisionBox:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pixels_to_tile_units:new t.Uniform1f(e,r.u_pixels_to_tile_units),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_overscale_factor:new t.Uniform1f(e,r.u_overscale_factor)}},collisionCircle:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_inv_matrix:new t.UniformMatrix4f(e,r.u_inv_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_viewport_size:new t.Uniform2f(e,r.u_viewport_size)}},debug:function(e,r){return{u_color:new t.UniformColor(e,r.u_color),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_overlay:new t.Uniform1i(e,r.u_overlay),u_overlay_scale:new t.Uniform1f(e,r.u_overlay_scale)}},clippingMask:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmap:function(e,r){return{u_extrude_scale:new t.Uniform1f(e,r.u_extrude_scale),u_intensity:new t.Uniform1f(e,r.u_intensity),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmapTexture:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_color_ramp:new t.Uniform1i(e,r.u_color_ramp),u_opacity:new t.Uniform1f(e,r.u_opacity)}},hillshade:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_latrange:new t.Uniform2f(e,r.u_latrange),u_light:new t.Uniform2f(e,r.u_light),u_shadow:new t.UniformColor(e,r.u_shadow),u_highlight:new t.UniformColor(e,r.u_highlight),u_accent:new t.UniformColor(e,r.u_accent)}},hillshadePrepare:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_dimension:new t.Uniform2f(e,r.u_dimension),u_zoom:new t.Uniform1f(e,r.u_zoom),u_unpack:new t.Uniform4f(e,r.u_unpack)}},line:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels)}},lineGradient:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_image:new t.Uniform1i(e,r.u_image),u_image_height:new t.Uniform1f(e,r.u_image_height)}},linePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_texsize:new t.Uniform2f(e,r.u_texsize),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_image:new t.Uniform1i(e,r.u_image),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},lineSDF:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_patternscale_a:new t.Uniform2f(e,r.u_patternscale_a),u_patternscale_b:new t.Uniform2f(e,r.u_patternscale_b),u_sdfgamma:new t.Uniform1f(e,r.u_sdfgamma),u_image:new t.Uniform1i(e,r.u_image),u_tex_y_a:new t.Uniform1f(e,r.u_tex_y_a),u_tex_y_b:new t.Uniform1f(e,r.u_tex_y_b),u_mix:new t.Uniform1f(e,r.u_mix)}},raster:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_tl_parent:new t.Uniform2f(e,r.u_tl_parent),u_scale_parent:new t.Uniform1f(e,r.u_scale_parent),u_buffer_scale:new t.Uniform1f(e,r.u_buffer_scale),u_fade_t:new t.Uniform1f(e,r.u_fade_t),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image0:new t.Uniform1i(e,r.u_image0),u_image1:new t.Uniform1i(e,r.u_image1),u_brightness_low:new t.Uniform1f(e,r.u_brightness_low),u_brightness_high:new t.Uniform1f(e,r.u_brightness_high),u_saturation_factor:new t.Uniform1f(e,r.u_saturation_factor),u_contrast_factor:new t.Uniform1f(e,r.u_contrast_factor),u_spin_weights:new t.Uniform3f(e,r.u_spin_weights)}},symbolIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix
vendor: 73,002 bytes, line 1
1),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture)}},symbolSDF:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},symbolTextAndIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texsize_icon:new t.Uniform2f(e,r.u_texsize_icon),u_texture:new t.Uniform1i(e,r.u_texture),u_texture_icon:new t.Uniform1i(e,r.u_texture_icon),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},background:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_color:new t.UniformColor(e,r.u_color)}},backgroundPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image:new t.Uniform1i(e,r.u_image),u_pattern_tl_a:new t.Uniform2f(e,r.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(e,r.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(e,r.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(e,r.u_pattern_br_b),u_texsize:new t.Uniform2f(e,r.u_texsize),u_mix:new t.Uniform1f(e,r.u_mix),u_pattern_size_a:new t.Uniform2f(e,r.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(e,r.u_pattern_size_b),u_scale_a:new t.Uniform1f(e,r.u_scale_a),u_scale_b:new t.Uniform1f(e,r.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(e,r.u_tile_units_to_pixels)}}};function Wr(e,r,i,o,n,a,s){for(var l=e.context,p=l.gl,c=e.useProgram("collisionBox"),u=[],h=0,d=0,f=0;f<o.length;f++){var m=o[f],_=r.getTile(m),y=_.getBucket(i);if(y){var g=m.posMatrix;0===n[0]&&0===n[1]||(g=e.translatePosMatrix(m.posMatrix,_,n,a));var v=s?y.textCollisionBox:y.iconCollisionBox,x=y.collisionCircleArray;if(x.length>0){var b=t.create(),w=g;t.mul(b,y.placementInvProjMatrix,e.transform.glCoordMatrix),t.mul(b,b,y.placementViewportMatrix),u.push({circleArray:x,circleOffset:d,transform:w,invTransform:b}),d=h+=x.length/4}v&&c.draw(l,p.LINES,St.disabled,Mt.disabled,e.colorModeForRenderPass(),Tt.disabled,Ir(g,e.transform,_),i.id,v.layoutVertexBuffer,v.indexBuffer,v.segments,null,e.transform.zoom,null,null,v.collisionVertexBuffer)}}if(s&&u.length){var C=e.useProgram("collisionCircle"),k=new t.StructArrayLayout2f1f2i16;k.resize(4*h),k._trim();for(var S=0,M=0,E=u;M<E.length;M+=1)for(var T=E[M],A=0;A<T.circleArray.length/4;A++){var I=4*A,P=T.circleArray[I+0],L=T.circleArray[I+1],z=T.circleArray[I+2],R=T.circleArray[I+3];k.emplace(S++,P,L,z,R,0),k.emplace(S++,P,L,z,R,1),k.emplace(S++,P,L,z,R,2),k.emplace(S++,P,L,z,R,3)}(!qr||qr.length<2*h)&&(qr=function(e){var r=2*e,i=new t.StructArrayLayout3ui6;i.resize(r),i._trim();for(var o=0;o<r;o++){var n=6*o;i.uint16[n+0]=4*o+0,i.uint16[n+1]=4*o+1,i.uint16[n+2]=4*o+2,i.uint16[n+3]=4*o+2,i.uint16[n+4]=4*o+3,i.uint16[n+5]=4*o+0}return i}(h));for(var D=l.createIndexBuffer(qr,!0),O=l.createVertexBuffer(k,t.collisionCircleLayout.members,!0),F=0,B=u;F<B.length;F+=1){var j=B[F],N=Pr(j.transform,j.invTransform,e.transform);C.draw(l,p.TRIANGLES,St.disabled,Mt.disabled,e.colorModeForRenderPass(),Tt.disabled,N,i.id,O,D,t.SegmentVector.simpleSegment(0,2*j.circleOffset,j.circleArray.length,j.circleArray.length/2),null,e.transform.zoom,null,null,null)}O.destroy(),D.destroy()}}var Kr=t.identity(new Float32Array(16));function Jr(e,r,i,o,n,a){var s=t.getAnchorAlignment(e),l=-(s.horizontalAlign-.5)*r,p=-(s.verticalAlign-.5)*i,c=t.evaluateVariableOffset(e,o);return new t.Point((l/n+c[0])*a,(p/n+c[1])*a)}function Yr(e,r,i,o,n,a,s,l,p,c,u){var h=e.text.placedSymbolArray,d=e.text.dynamicLayoutVertexArray,f=e.icon.dynamicLayoutVertexArray,m={};d.clear();for(var _=0;_<h.length;_++){var y=h.get(_),g=y.hidden||!y.crossTileID||e.allowVerticalPlacement&&!y.placedOrientation?null:o[y.crossTileID];if(g){var v=new t.Point(y.anchorX,y.anchorY),x=Yt(v,i?l:s),b=te(a.cameraToCenterDistance,x.signedDistanceFromCamera),w=n.evaluateSizeForFeature(e.textSizeData,c,y)*b/t.ONE_EM;i&&(w*=e.tilePixelRatio/p);for(var C=Jr(g.anchor,g.width,g.height,g.textOffset,g.textBoxScale,w),k=i?Yt(v.add(C),s).point:x.point.add(r?C.rotate(-a.angle):C),S=e.allowVerticalPlacement&&y.placedOrientation===t.WritingMode.vertical?Math.PI/2:0,M=0;M<y.numGlyphs;M++)t.addDynamicAttributes(d,k,S);u&&y.associatedIconIndex>=0&&(m[y.associatedIconIndex]={shiftedAnchor:k,angle:S})}else pe(y.numGlyphs,d)}if(u){f.clear();for(var E=e.icon.placedSymbolArray,T=0;T<E.length;T++){var A=E.get(T);if(A.hidden)pe(A.numGlyphs,f);else{var I=m[T];if(I)for(var P=0;P<A.numGlyphs;P++)t.addDynamicAttributes(f,I.shiftedAnchor,I.angle);else pe(A.numGlyphs,f)}}e.icon.dynamicLayoutVertexBuffer.updateData(f)}e.text.dynamicLayoutVertexBuffer.updateData(d)}function ti(t,e,r){return r.iconsInText&&e?"symbolTextAndIcon":t?"symbolSDF":"symbolIcon"}function ei(e,r,i,o,n,a,s,l,p,c,u,h){for(var d=e.context,f=d.gl,m=e.transform,_="map"===l,y="map"===p,g=_&&"point"!==i.layout.get("symbol-placement"),v=_&&!y&&!g,x=!i.layout.get("symbol-sort-key").isConstant(),b=!1,w=e.depthModeForSublayer(0,St.ReadOnly),C=i.layout.get("text-variable-anchor"),k=[],S=0,M=o;S<M.length;S+=1){var E=M[S],T=r.getTile(E),A=T.getBucket(i);if(A){var I=n?A.text:A.icon;if(I&&I.segments.get().length){var P=I.programConfigurations.get(i.id),L=n||A.sdfIcons,z=n?A.textSizeData:A.iconSizeData,R=y||0!==m.pitch,D=e.useProgram(ti(L,n,A),P),O=t.evaluateSizeForZoom(z,m.zoom),F=void 0,B=[0,0],j=void 0,N=void 0,U=null,V=void 0;if(n)j=T.glyphAtlasTexture,N=f.LINEAR,F=T.glyphAtlasTexture.size,A.iconsInText&&(B=T.imageAtlasTexture.size,U=T.imageAtlasTexture,V=R||e.options.rotating||e.options.zooming||"composite"===z.kind||"camera"===z.kind?f.LINEAR:f.NEAREST);else{var q=1!==i.layout.get("icon-size").constantOr(0)||A.iconsNeedLinear;j=T.imageAtlasTexture,N=L||e.options.rotating||e.options.zooming||q||R?f.LINEAR:f.NEAREST,F=T.imageAtlasTexture.size}var $=he(T,1,e.transform.zoom),H=Kt(E.posMatrix,y,_,e.transform,$),Z=Jt(E.posMatrix,y,_,e.transform,$),G=C&&A.hasTextData(),Q="none"!==i.layout.get("icon-text-fit")&&G&&A.hasIconData();g&&re(A,E.posMatrix,e,n,H,Z,y,c);var X=e.translatePosMatrix(E.posMatrix,T,a,s),W=g||n&&C||Q?Kr:H,K=e.translatePosMatrix(Z,T,a,s,!0),J=L&&0!==i.paint.get(n?"text-halo-width":"icon-halo-width").constantOr(1),Y={program:D,buffers:I,uniformValues:L?A.iconsInText?Zr(z.kind,O,v,y,e,X,W,K,F,B):Hr(z.kind,O,v,y,e,X,W,K,n,F,!0):$r(z.kind,O,v,y,e,X,W,K,n,F),atlasTexture:j,atlasTextureIcon:U,atlasInterpolation:N,atlasInterpolationIcon:V,isSDF:L,hasHalo:J};if(x&&A.canOverlap){b=!0;for(var tt=0,et=I.segments.get();tt<et.length;tt+=1){var rt=et[tt];k.push({segments:new t.SegmentVector([rt]),sortKey:rt.sortKey,state:Y})}}else k.push({segments:I.segments,sortKey:0,state:Y})}}}b&&k.sort((function(t,e){return t.sortKey-e.sortKey}));for(var it=0,ot=k;it<ot.length;it+=1){var nt=ot[it],at=nt.state;if(d.activeTexture.set(f.TEXTURE0),at.atlasTexture.bind(at.atlasInterpolation,f.CLAMP_TO_EDGE),at.atlasTextureIcon&&(d.activeTexture.set(f.TEXTURE1),at.atlasTextureIcon&&at.atlasTextureIcon.bind(at.atlasInterpolationIcon,f.CLAMP_TO_EDGE)),at.isSDF){var st=at.uniformValues;at.hasHalo&&(st.u_is_halo=1,ri(at.buffers,nt.segments,i,e,at.program,w,u,h,st)),st.u_is_halo=0}ri(at.buffers,nt.segments,i,e,at.program,w,u,h,at.uniformValues)}}function ri(t,e,r,i,o,n,a,s,l){var p=i.context;o.draw(p,p.gl.TRIANGLES,n,a,s,Tt.disabled,l,r.id,t.layoutVertexBuffer,t.indexBuffer,e,r.paint,i.transform.zoom,t.programConfigurations.get(r.id),t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer)}function ii(t,e,r,i,o,n,a){var s,l,p,c,u,h=t.context.gl,d=r.paint.get("fill-pattern"),f=d&&d.constantOr(1),m=r.getCrossfadeParameters();a?(l=f&&!r.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",s=h.LINES):(l=f?"fillPattern":"fill",s=h.TRIANGLES);for(var _=0,y=i;_<y.length;_+=1){var g=y[_],v=e.getTile(g);if(!f||v.patternsLoaded()){var x=v.getBucket(r);if(x){var b=x.programConfigurations.get(r.id),w=t.useProgram(l,b);f&&(t.context.activeTexture.set(h.TEXTURE0),v.imageAtlasTexture.bind(h.LINEAR,h.CLAMP_TO_EDGE),b.updatePaintBuffers(m));var C=d.constantOr(null);if(C&&v.imageAtlas){var k=v.imageAtlas,S=k.patternPositions[C.to.toString()],M=k.patternPositions[C.from.toString()];S&&M&&b.setConstantPatternPositions(S,M)}var E=t.translatePosMatrix(g.posMatrix,v,r.paint.get("fill-translate"),r.paint.get("fill-translate-anchor"));if(a){c=x.indexBuffer2,u=x.segments2;var T=[h.drawingBufferWidth,h.drawingBufferHeight];p="fillOutlinePattern"===l&&f?Tr(E,t,m,v,T):Er(E,T)}else c=x.indexBuffer,u=x.segments,p=f?Mr(E,t,m,v):Sr(E);w.draw(t.context,s,o,t.stencilModeForClipping(g),n,Tt.disabled,p,r.id,x.layoutVertexBuffer,c,u,r.paint,t.transform.zoom,b)}}}}function oi(t,e,r,i,o,n,a){for(var s=t.context,l=s.gl,p=r.paint.get("fill-extrusion-pattern"),c=p.constantOr(1),u=r.getCrossfadeParameters(),h=r.paint.get("fill-extrusion-opacity"),d=0,f=i;d<f.length;d+=1){var m=f[d],_=e.getTile(m),y=_.getBucket(r);if(y){var g=y.programConfigurations.get(r.id),v=t.useProgram(c?"fillExtrusionPattern":"fillExtrusion",g);c&&(t.context.activeTexture.set(l.TEXTURE0),_.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),g.updatePaintBuffers(u));var x=p.constantOr(null);if(x&&_.imageAtlas){var b=_.imageAtlas,w=b.patternPositions[x.to.toString()],C=b.patternPositions[x.from.toString()];w&&C&&g.setConstantPatternPositions(w,C)}var k=t.translatePosMatrix(m.posMatrix,_,r.paint.get("fill-extrusion-translate"),r.paint.get("fill-extrusion-translate-anchor")),S=r.paint.get("fill-extrusion-vertical-gradient"),M=c?kr(k,t,S,h,m,u,_):Cr(k,t,S,h);v.draw(s,s.gl.TRIANGLES,o,n,a,Tt.backCCW,M,r.id,y.layoutVertexBuffer,y.indexBuffer,y.segments,r.paint,t.transform.zoom,g)}}}function ni(e,r,i,o,n,a){var s=e.context,l=s.gl,p=r.fbo;if(p){var c=e.useProgram("hillshade");s.activeTexture.set(l.TEXTURE0),l.bindTexture(l.TEXTURE_2D,p.colorAttachment.get());var u=function(e,r,i){var o=i.paint.get("hillshade-shadow-color"),n=i.paint.get("hillshade-highlight-color"),a=i.paint.get("hillshade-accent-color"),s=i.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===i.paint.get("hillshade-illumination-anchor")&&(s-=e.transform.angle);var l,p,c,u=!e.options.moving;return{u_matrix:e.transform.calculatePosMatrix(r.tileID.toUnwrapped(),u),u_image:0,u_latrange:(l=r.tileID,p=Math.pow(2,l.canonical.z),c=l.canonical.y,[new t.MercatorCoordinate(0,c/p).toLngLat().lat,new t.MercatorCoordinate(0,(c+1)/p).toLngLat().lat]),u_light:[i.paint.get("hillshade-exaggeration"),s],u_shadow:o,u_highlight:n,u_accent:a}}(e,r,i);c.draw(s,l.TRIANGLES,o,n,a,Tt.disabled,u,i.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments)}}function ai(e,r,i,o,n,a){var s=e.context,l=s.gl,p=r.dem;if(p&&p.data){var c=p.dim,u=p.stride,h=p.getPixels();if(s.activeTexture.set(l.TEXTURE1),s.pixelStoreUnpackPremultiplyAlpha.set(!1),r.demTexture=r.demTexture||e.getTileTexture(u),r.demTexture){var d=r.demTexture;d.update(h,{premultiply:!1}),d.bind(l.NEAREST,l.CLAMP_TO_EDGE)}else r.demTexture=new t.Texture(s,h,l.RGBA,{premultiply:!1}),r.demTexture.bind(l.NEAREST,l.CLAMP_TO_EDGE);s.activeTexture.set(l.TEXTURE0);var f=r.fbo;if(!f){var m=new t.Texture(s,{width:c,height:c,data:null},l.RGBA);m.bind(l.LINEAR,l.CLAMP_TO_EDGE),(f=r.fbo=s.createFramebuffer(c,c,!0)).colorAttachment.set(m.texture)}s.bindFramebuffer.set(f.framebuffer),s.viewport.set([0,0,c,c]),e.useProgram("hillshadePrepare").draw(s,l.TRIANGLES,o,n,a,Tt.disabled,function(e,r){var i=r.stride,o=t.create();return t.ortho(o,0,t.EXTENT,-t.EXTENT,0,0,1),t.translate(o,o,[0,-t.EXTENT,0]),{u_matrix:o,u_image:1,u_dimension:[i,i],u_zoom:e.overscaledZ,u_unpack:r.getUnpackVector()}}(r.tileID,p),i.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments),r.needsHillshadePrepare=!1}}function si(e,r,i,o,n){var a=o.paint.get("raster-fade-duration");if(a>0){var s=t.browser.now(),l=(s-e.timeAdded)/a,p=r?(s-r.timeAdded)/a:-1,c=i.getSource(),u=n.coveringZoomLevel({tileSize:c.tileSize,roundZoom:c.roundZoom}),h=!r||Math.abs(r.tileID.overscaledZ-u)>Math.abs(e.tileID.overscaledZ-u),d=h&&e.refreshedUponExpiration?1:t.clamp(h?l:1-p,0,1);return e.refreshedUponExpiration&&l>=1&&(e.refreshedUponExpiration=!1),r?{opacity:1,mix:1-d}:{opacity:d,mix:0}}return{opacity:1,mix:0}}var li=new t.Color(1,0,0,1),pi=new t.Color(0,1,0,1),ci=new t.Color(0,0,1,1),ui=new t.Color(1,0,1,1),hi=new t.Color(0,1,1,1);function di(t,e,r,i){mi(t,0,e+r/2,t.transform.width,r,i)}function fi(t,e,r,i){mi(t,e-r/2,0,r,t.transform.height,i)}function mi(e,r,i,o,n,a){var s=e.context,l=s.gl;l.enable(l.SCISSOR_TEST),l.scissor(r*t.browser.devicePixelRatio,i*t.browser.devicePixelRatio,o*t.browser.devicePixelRatio,n*t.browser.devicePixelRatio),s.clear({color:a}),l.disable(l.SCISSOR_TEST)}function _i(e,r,i){var o=e.context,n=o.gl,a=i.posMatrix,s=e.useProgram("debug"),l=St.disabled,p=Mt.disabled,c=e.colorModeForRenderPass();o.activeTexture.set(n.TEXTURE0),e.emptyTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE),s.draw(o,n.LINE_STRIP,l,p,c,Tt.disabled,Lr(a,t.Color.red),"$debug",e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments);var u=r.getTileByID(i.key).latestRawTileData,h=Math.floor((u&&u.byteLength||0)/1024),d=r.getTile(i).tileSize,f=512/Math.min(d,512)*(i.overscaledZ/e.transform.zoom)*.5,m=i.canonical.toString();i.overscaledZ!==i.canonical.z&&(m+=" => "+i.overscaledZ),function(t,e){t.initDebugOverlayCanvas();var r=t.debugOverlayCanvas,i=t.context.gl,o=t.debugOverlayCanvas.getContext("2d");o.clearRect(0,0,r.width,r.height),o.shadowColor="white",o.shadowBlur=2,o.lineWidth=1.5,o.strokeStyle="white",o.textBaseline="top",o.font="bold 36px Open Sans, sans-serif",o.fillText(e,5,5),o.strokeText(e,5,5),t.debugOverlayTexture.update(r),t.debugOverlayTexture.bind(i.LINEAR,i.CLAMP_TO_EDGE)}(e,m+" "+h+"kb"),s.draw(o,n.TRIANGLES,l,p,Et.alphaBlended,Tt.disabled,Lr(a,t.Color.transparent,f),"$debug",e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments)}var yi={symbol:function(e,r,i,o,n){if("translucent"===e.renderPass){var a=Mt.disabled,s=e.colorModeForRenderPass();i.layout.get("text-variable-anchor")&&function(e,r,i,o,n,a,s){for(var l=r.transform,p="map"===n,c="map"===a,u=0,h=e;u<h.length;u+=1){var d=h[u],f=o.getTile(d),m=f.getBucket(i);if(m&&m.text&&m.text.segments.get().length){var _=t.evaluateSizeForZoom(m.textSizeData,l.zoom),y=he(f,1,r.transform.zoom),g=Kt(d.posMatrix,c,p,r.transform,y),v="none"!==i.layout.get("icon-text-fit")&&m.hasIconData();if(_){var x=Math.pow(2,l.zoom-f.tileID.overscaledZ);Yr(m,p,c,s,t.symbolSize,l,g,d.posMatrix,x,_,v)}}}}(o,e,i,r,i.layout.get("text-rotation-alignment"),i.layout.get("text-pitch-alignment"),n),0!==i.paint.get("icon-opacity").constantOr(1)&&ei(e,r,i,o,!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"),a,s),0!==i.paint.get("text-opacity").constantOr(1)&&ei(e,r,i,o,!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"),a,s),r.map.showCollisionBoxes&&(Wr(e,r,i,o,i.paint.get("text-translate"),i.paint.get("text-translate-anchor"),!0),Wr(e,r,i,o,i.paint.get("icon-translate"),i.paint.get("icon-translate-anchor"),!1))}},circle:function(e,r,i,o){if("translucent"===e.renderPass){var n=i.paint.get("circle-opacity"),a=i.paint.get("circle-stroke-width"),s=i.paint.get("circle-stroke-opacity"),l=!i.layout.get("circle-sort-key").isConstant();if(0!==n.constantOr(1)||0!==a.constantOr(1)&&0!==s.constantOr(1)){for(var p=e.context,c=p.gl,u=e.depthModeForSublayer(0,St.ReadOnly),h=Mt.disabled,d=e.colorModeForRenderPass(),f=[],m=0;m<o.length;m++){var _=o[m],y=r.getTile(_),g=y.getBucket(i);if(g){var v=g.programConfigurations.get(i.id),x={programConfiguration:v,program:e.useProgram("circle",v),layoutVertexBuffer:g.layoutVertexBuffer,indexBuffer:g.indexBuffer,uniformValues:Ar(e,_,y,i)};if(l)for(var b=0,w=g.segments.get();b<w.length;b+=1){var C=w[b];f.push({segments:new t.SegmentVector([C]),sortKey:C.sortKey,state:x})}else f.push({segments:g.segments,sortKey:0,state:x})}}l&&f.sort((function(t,e){return t.sortKey-e.sortKey}));for(var k=0,S=f;k<S.length;k+=1){var M=S[k],E=M.state;E.program.draw(p,c.TRIANGLES,u,h,d,Tt.disabled,E.uniformValues,i.id,E.layoutVertexBuffer,E.indexBuffer,M.segments,i.paint,e.transform.zoom,E.programConfiguration)}}}},heatmap:function(e,r,i,o){if(0!==i.paint.get("heatmap-opacity"))if("offscreen"===e.renderPass){var n=e.context,a=n.gl,s=Mt.disabled,l=new Et([a.ONE,a.ONE],t.Color.transparent,[!0,!0,!0,!0]);!function(t,e,r){var i=t.gl;t.activeTexture.set(i.TEXTURE1),t.viewport.set([0,0,e.width/4,e.height/4]);var o=r.heatmapFbo;if(o)i.bindTexture(i.TEXTURE_2D,o.colorAttachment.get()),t.bindFramebuffer.set(o.framebuffer);else{var n=i.createTexture();i.bindTexture(i.TEXTURE_2D,n),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),o=r.heatmapFbo=t.createFramebuffer(e.width/4,e.height/4,!1),function(t,e,r,i){var o=t.gl;o.texImage2D(o.TEXTURE_2D,0,o.RGBA,e.width/4,e.height/4,0,o.RGBA,t.extRenderToTextureHalfFloat?t.extTextureHalfFloat.HALF_FLOAT_OES:o.UNSIGNED_BYTE,null),i.colorAttachment.set(r)}(t,e,n,o)}}(n,e,i),n.clear({color:t.Color.transparent});for(var p=0;p<o.length;p++){var c=o[p];if(!r.hasRenderableParent(c)){var u=r.getTile(c),h=u.getBucket(i);if(h){var d=h.programConfigurations.get(i.id);e.useProgram("heatmap",d).draw(n,a.TRIANGLES,St.disabled,s,l,Tt.disabled,Rr(c.posMatrix,u,e.transform.zoom,i.paint.get("heatmap-intensity")),i.id,h.layoutVertexBuffer,h.indexBuffer,h.segments,i.paint,e.transform.zoom,d)}}}n.viewport.set([0,0,e.width,e.height])}else"translucent"===e.renderPass&&(e.context.setColorMode(e.colorModeForRenderPass()),function(e,r){var i=e.context,o=i.gl,n=r.heatmapFbo;if(n){i.activeTexture.set(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,n.colorAttachment.get()),i.activeTexture.set(o.TEXTURE1);var a=r.colorRampTexture;a||(a=r.colorRampTexture=new t.Texture(i,r.colorRamp,o.RGBA)),a.bind(o.LINEAR,o.CLAMP_TO_EDGE),e.useProgram("heatmapTexture").draw(i,o.TRIANGLES,St.disabled,Mt.disabled,e.colorModeForRenderPass(),Tt.disabled,function(e,r,i,o){var n=t.create();t.ortho(n,0,e.width,e.height,0,0,1);var a=e.context.gl;return{u_matrix:n,u_world:[a.drawingBufferWidth,a.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:r.paint.get("heatmap-opacity")}}(e,r),r.id,e.viewportBuffer,e.quadTriangleIndexBuffer,e.viewportSegments,r.paint,e.transform.zoom)}}(e,i))},line:function(e,r,i,o){if("translucent"===e.renderPass){var n=i.paint.get("line-opacity"),a=i.paint.get("line-width");if(0!==n.constantOr(1)&&0!==a.constantOr(1))for(var s=e.depthModeForSublayer(0,St.ReadOnly),l=e.colorModeForRenderPass(),p=i.paint.get("line-dasharray"),c=i.paint.get("line-pattern"),u=c.constantOr(1),h=i.paint.get("line-gradient"),d=i.getCrossfadeParameters(),f=u?"linePattern":p?"lineSDF":h?"lineGradient":"line",m=e.context,_=m.gl,y=!0,g=0,v=o;g<v.length;g+=1){var x=v[g],b=r.getTile(x);if(!u||b.patternsLoaded()){var w=b.getBucket(i);if(w){var C=w.programConfigurations.get(i.id),k=e.context.program.get(),S=e.useProgram(f,C),M=y||S.program!==k,E=c.constantOr(null);if(E&&b.imageAtlas){var T=b.imageAtlas,A=T.patternPositions[E.to.toString()],I=T.patternPositions[E.from.toString()];A&&I&&C.setConstantPatternPositions(A,I)}var P=u?Fr(e,b,i,d):p?Br(e,b,i,p,d):h?Or(e,b,i,w.lineClipsArray.length):Dr(e,b,i);if(u)m.activeTexture.set(_.TEXTURE0),b.imageAtlasTexture.bind(_.LINEAR,_.CLAMP_TO_EDGE),C.updatePaintBuffers(d);else if(p&&(M||e.lineAtlas.dirty))m.activeTexture.set(_.TEXTURE0),e.lineAtlas.bind(m);else if(h){var L=w.gradients[i.id],z=L.texture;if(i.gradientVersion!==L.version){var R=256;if(i.stepInterpolant){var D=r.getSource().maxzoom,O=x.canonical.z===D?Math.ceil(1<<e.transform.maxZoom-x.canonical.z):1;R=t.clamp(t.nextPowerOfTwo(w.maxLineLength/t.EXTENT*1024*O),256,m.maxTextureSize)}L.gradient=t.renderColorRamp({expression:i.gradientExpression(),evaluationKey:"lineProgress",resolution:R,image:L.gradient||void 0,clips:w.lineClipsArray}),L.texture?L.texture.update(L.gradient):L.texture=new t.Texture(m,L.gradient,_.RGBA),L.version=i.gradientVersion,z=L.texture}m.activeTexture.set(_.TEXTURE0),z.bind(i.stepInterpolant?_.NEAREST:_.LINEAR,_.CLAMP_TO_EDGE)}S.draw(m,_.TRIANGLES,s,e.stencilModeForClipping(x),l,Tt.disabled,P,i.id,w.layoutVertexBuffer,w.indexBuffer,w.segments,i.paint,e.transform.zoom,C,w.layoutVertexBuffer2),y=!1}}}}},fill:function(e,r,i,o){var n=i.paint.get("fill-color"),a=i.paint.get("fill-opacity");if(0!==a.constantOr(1)){var s=e.colorModeForRenderPass(),l=i.paint.get("fill-pattern"),p=e.opaquePassEnabledForLayer()&&!l.constantOr(1)&&1===n.constantOr(t.Color.transparent).a&&1===a.constantOr(0)?"opaque":"translucent";if(e.renderPass===p){var c=e.depthModeForSublayer(1,"opaque"===e.renderPass?St.ReadWrite:St.ReadOnly);ii(e,r,i,o,c,s,!1)}if("translucent"===e.renderPass&&i.paint.get("fill-antialias")){var u=e.depthModeForSublayer(i.getPaintProperty("fill-outline-color")?2:0,St.ReadOnly);ii(e,r,i,o,u,s,!0)}}},"fill-extrusion":function(t,e,r,i){var o=r.paint.get("fill-extrusion-opacity");if(0!==o&&"translucent"===t.renderPass){var n=new St(t.context.gl.LEQUAL,St.ReadWrite,t.depthRangeFor3D);if(1!==o||r.paint.get("fill-extrusion-pattern").constantOr(1))oi(t,e,r,i,n,Mt.disabled,Et.disabled),oi(t,e,r,i,n,t.stencilModeFor3D(),t.colorModeForRenderPass());else{var a=t.colorModeForRenderPass();oi(t,e,r,i,n,Mt.disabled,a)}}},hillshade:function(t,e,r,i){if("offscreen"===t.renderPass||"translucent"===t.renderPass){for(var o=t.context,n=t.depthModeForSublayer(0,St.ReadOnly),a=t.colorModeForRenderPass(),s="translucent"===t.renderPass?t.stencilConfigForOverlap(i):[{},i],l=s[0],p=0,c=s[1];p<c.length;p+=1){var u=c[p],h=e.getTile(u);h.needsHillshadePrepare&&"offscreen"===t.renderPass?ai(t,h,r,n,Mt.disabled,a):"translucent"===t.renderPass&&ni(t,h,r,n,l[u.overscaledZ],a)}o.viewport.set([0,0,t.width,t.height])}},raster:function(t,e,r,i){if("translucent"===t.renderPass&&0!==r.paint.get("raster-opacity")&&i.length)for(var o=t.context,n=o.gl,a=e.getSource(),s=t.useProgram("raster"),l=t.colorModeForRenderPass(),p=a instanceof L?[{},i]:t.stencilConfigForOverlap(i),c=p[0],u=p[1],h=u[u.length-1].overscaledZ,d=!t.options.moving,f=0,m=u;f<m.length;f+=1){var _=m[f],y=t.depthModeForSublayer(_.overscaledZ-h,1===r.paint.get("raster-opacity")?St.ReadWrite:St.ReadOnly,n.LESS),g=e.getTile(_),v=t.transform.calculatePosMatrix(_.toUnwrapped(),d);g.registerFadeDuration(r.paint.get("raster-fade-duration"));var x=e.findLoadedParent(_,0),b=si(g,x,e,r,t.transform),w=void 0,C=void 0,k="nearest"===r.paint.get("raster-resampling")?n.NEAREST:n.LINEAR;o.activeTexture.set(n.TEXTURE0),g.texture.bind(k,n.CLAMP_TO_EDGE,n.LINEAR_MIPMAP_NEAREST),o.activeTexture.set(n.TEXTURE1),x?(x.texture.bind(k,n.CLAMP_TO_EDGE,n.LINEAR_MIPMAP_NEAREST),w=Math.pow(2,x.tileID.overscaledZ-g.tileID.overscaledZ),C=[g.tileID.canonical.x*w%1,g.tileID.canonical.y*w%1]):g.texture.bind(k,n.CLAMP_TO_EDGE,n.LINEAR_MIPMAP_NEAREST);var S=Ur(v,C||[0,0],w||1,b,r);a instanceof L?s.draw(o,n.TRIANGLES,y,Mt.disabled,l,Tt.disabled,S,r.id,a.boundsBuffer,t.quadTriangleIndexBuffer,a.boundsSegments):s.draw(o,n.TRIANGLES,y,c[_.overscaledZ],l,Tt.disabled,S,r.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}},background:function(t,e,r){var i=r.paint.get("background-color"),o=r.paint.get("background-opacity");if(0!==o){var n=t.context,a=n.gl,s=t.transform,l=s.tileSize,p=r.paint.get("background-pattern");if(!t.isPatternMissing(p)){var c=!p&&1===i.a&&1===o&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(t.renderPass===c){var u=Mt.disabled,h=t.depthModeForSublayer(0,"opaque"===c?St.ReadWrite:St.ReadOnly),d=t.colorModeForRenderPass(),f=t.useProgram(p?"backgroundPattern":"background"),m=s.coveringTiles({tileSize:l});p&&(n.activeTexture.set(a.TEXTURE0),t.imageManager.bind(t.context));for(var _=r.getCrossfadeParameters(),y=0,g=m;y<g.length;y+=1){var v=g[y],x=t.transform.calculatePosMatrix(v.toUnwrapped()),b=p?Qr(x,o,t,p,{tileID:v,tileSize:l},_):Gr(x,o,i);f.draw(n,a.TRIANGLES,h,u,d,Tt.disabled,b,r.id,t.tileExtentBuffer,t.quadTriangleIndexBuffer,t.tileExtentSegments)}}}}},debug:function(t,e,r){for(var i=0;i<r.length;i++)_i(t,e,r[i])},custom:function(t,e,r){var i=t.context,o=r.implementation;if("offscreen"===t.renderPass){var n=o.prerender;n&&(t.setCustomLayerDefaults(),i.setColorMode(t.colorModeForRenderPass()),n.call(o,i.gl,t.transform.customLayerMatrix()),i.setDirty(),t.setBaseState())}else if("translucent"===t.renderPass){t.setCustomLayerDefaults(),i.setColorMode(t.colorModeForRenderPass()),i.setStencilMode(Mt.disabled);var a="3d"===o.renderingMode?new St(t.context.gl.LEQUAL,St.ReadWrite,t.depthRangeFor3D):t.depthModeForSublayer(0,St.ReadOnly);i.setDepthMode(a),o.render(i.gl,t.transform.customLayerMatrix()),i.setDirty(),t.setBaseState(),i.bindFramebuffer.set(null)}}},gi=function(t,e){this.context=new At(t),this.transform=e,this._tileTextures={},this.setup(),this.numSublayers=It.maxUnderzooming+It.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Be,this.gpuTimers={}};gi.prototype.resize=function(e,r){if(this.width=e*t.browser.devicePixelRatio,this.height=r*t.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var i=0,o=this.style._order;i<o.length;i+=1)this.style._layers[o[i]].resize()},gi.prototype.setup=function(){var e=this.context,r=new t.StructArrayLayout2i4;r.emplaceBack(0,0),r.emplaceBack(t.EXTENT,0),r.emplaceBack(0,t.EXTENT),r.emplaceBack(t.EXTENT,t.EXTENT),this.tileExtentBuffer=e.createVertexBuffer(r,$e.members),this.tileExtentSegments=t.SegmentVector.simpleSegment(0,0,4,2);var i=new t.StructArrayLayout2i4;i.emplaceBack(0,0),i.emplaceBack(t.EXTENT,0),i.emplaceBack(0,t.EXTENT),i.emplaceBack(t.EXTENT,t.EXTENT),this.debugBuffer=e.createVertexBuffer(i,$e.members),this.debugSegments=t.SegmentVector.simpleSegment(0,0,4,5);var o=new t.StructArrayLayout4i8;o.emplaceBack(0,0,0,0),o.emplaceBack(t.EXTENT,0,t.EXTENT,0),o.emplaceBack(0,t.EXTENT,0,t.EXTENT),o.emplaceBack(t.EXTENT,t.EXTENT,t.EXTENT,t.EXTENT),this.rasterBoundsBuffer=e.createVertexBuffer(o,P.members),this.rasterBoundsSegments=t.SegmentVector.simpleSegment(0,0,4,2);var n=new t.StructArrayLayout2i4;n.emplaceBack(0,0),n.emplaceBack(1,0),n.emplaceBack(0,1),n.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(n,$e.members),this.viewportSegments=t.SegmentVector.simpleSegment(0,0,4,2);var a=new t.StructArrayLayout1ui2;a.emplaceBack(0),a.emplaceBack(1),a.emplaceBack(3),a.emplaceBack(2),a.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(a);var s=new t.StructArrayLayout3ui6;s.emplaceBack(0,1,2),s.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(s),this.emptyTexture=new t.Texture(e,{width:1,height:1,data:new Uint8Array([0,0,0,0])},e.gl.RGBA);var l=this.context.gl;this.stencilClearMode=new Mt({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO)},gi.prototype.clearStencil=function(){var e=this.context,r=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var i=t.create();t.ortho(i,0,this.width,this.height,0,0,1),t.scale(i,i,[r.drawingBufferWidth,r.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(e,r.TRIANGLES,St.disabled,this.stencilClearMode,Et.disabled,Tt.disabled,zr(i),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},gi.prototype._renderTileClippingMasks=function(t,e){if(this.currentStencilSource!==t.source&&t.isTileClipped()&&e&&e.length){this.currentStencilSource=t.source;var r=this.context,i=r.gl;this.nextStencilID+e.length>256&&this.clearStencil(),r.setColorMode(Et.disabled),r.setDepthMode(St.disabled);var o=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var n=0,a=e;n<a.length;n+=1){var s=a[n],l=this._tileClippingMaskIDs[s.key]=this.nextStencilID++;o.draw(r,i.TRIANGLES,St.disabled,new Mt({func:i.ALWAYS,mask:0},l,255,i.KEEP,i.KEEP,i.REPLACE),Et.disabled,Tt.disabled,zr(s.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}},gi.prototype.stencilModeFor3D=function(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();var t=this.nextStencilID++,e=this.context.gl;return new Mt({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)},gi.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new Mt({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},gi.prototype.stencilConfigForOverlap=function(t){var e,r=this.context.gl,i=t.sort((function(t,e){return e.overscaledZ-t.overscaledZ})),o=i[i.length-1].overscaledZ,n=i[0].overscaledZ-o+1;if(n>1){this.currentStencilSource=void 0,this.nextStencilID+n>256&&this.clearStencil();for(var a={},s=0;s<n;s++)a[s+o]=new Mt({func:r.GEQUAL,mask:255},s+this.nextStencilID,255,r.KEEP,r.KEEP,r.REPLACE);return this.nextStencilID+=n,[a,i]}return[(e={},e[o]=Mt.disabled,e),i]},gi.prototype.colorModeForRenderPass=function(){var e=this.context.gl;return this._showOverdrawInspector?new Et([e.CONSTANT_COLOR,e.ONE],new t.Color(1/8,1/8,1/8,0),[!0,!0,!0,!0]):"opaque"===this.renderPass?Et.unblended:Et.alphaBlended},gi.prototype.depthModeForSublayer=function(t,e,r){if(!this.opaquePassEnabledForLayer())return St.disabled;var i=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new St(r||this.context.gl.LEQUAL,e,[i,i])},gi.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},gi.prototype.render=function(e,r){var i=this;this.style=e,this.options=r,this.lineAtlas=e.lineAtlas,this.imageManager=e.imageManager,this.glyphManager=e.glyphManager,this.symbolFadeChange=e.placement.symbolFadeChange(t.browser.now()),this.imageManager.beginFrame();var o=this.style._order,n=this.style.sourceCaches;for(var a in n){var s=n[a];s.used&&s.prepare(this.context)}var l,p,c={},u={},h={};for(var d in n){var f=n[d];c[d]=f.getVisibleCoordinates(),u[d]=c[d].slice().reverse(),h[d]=f.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(var m=0;m<o.length;m++)if(this.style._layers[o[m]].is3D()){this.opaquePassCutoff=m;break}this.renderPass="offscreen";for(var _=0,y=o;_<y.length;_+=1){var g=this.style._layers[y[_]];if(g.hasOffscreenPass()&&!g.isHidden(this.transform.zoom)){var v=u[g.source];("custom"===g.type||v.length)&&this.renderLayer(this,n[g.source],g,v)}}for(this.context.bindFramebuffer.set(null),this.context.clear({color:r.showOverdrawInspector?t.Color.black:t.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=r.showOverdrawInspector,this.depthRangeFor3D=[0,1-(e._order.length+2)*this.numSublayers*this.depthEpsilon],this.renderPass="opaque",this.currentLayer=o.length-1;this.currentLayer>=0;this.currentLayer--){var x=this.style._layers[o[this.currentLayer]],b=n[x.source],w=c[x.source];this._renderTileClippingMasks(x,w),this.renderLayer(this,b,x,w)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<o.length;this.currentLayer++){var C=this.style._layers[o[this.currentLayer]],k=n[C.source],S=("symbol"===C.type?h:u)[C.source];this._renderTileClippingMasks(C,c[C.source]),this.renderLayer(this,k,C,S)}this.options.showTileBoundaries&&(t.values(this.style._layers).forEach((function(t){t.source&&!t.isHidden(i.transform.zoom)&&(t.source!==(p&&p.id)&&(p=i.style.sourceCaches[t.source]),(!l||l.getSource().maxzoom<p.getSource().maxzoom)&&(l=p))})),l&&yi.debug(this,l,l.getVisibleCoordinates())),this.options.showPadding&&function(t){var e=t.transform.padding;di(t,t.transform.height-(e.top||0),3,li),di(t,e.bottom||0,3,pi),fi(t,e.left||0,3,ci),fi(t,t.transform.width-(e.right||0),3,ui);var r=t.transform.centerPoint;!function(t,e,r,i){mi(t,e-1,r-10,2,20,i),mi(t,e-10,r-1,20,2,i)}(t,r.x,t.transform.height-r.y,hi)}(this),this.context.setDefault()},gi.prototype.renderLayer=function(t,e,r,i){r.isHidden(this.transform.zoom)||("background"===r.type||"custom"===r.type||i.length)&&(this.id=r.id,this.gpuTimingStart(r),yi[r.type](t,e,r,i,this.style.placement.variableOffsets),this.gpuTimingEnd())},gi.prototype.gpuTimingStart=function(t){if(this.options.gpuTiming){var e=this.context.extTimerQuery,r=this.gpuTimers[t.id];r||(r=this.gpuTimers[t.id]={calls:0,cpuTime:0,query:e.createQueryEXT()}),r.calls++,e.beginQueryEXT(e.TIME_ELAPSED_EXT,r.query)}},gi.prototype.gpuTimingEnd=function(){if(this.options.gpuTiming){var t=this.context.extTimerQuery;t.endQueryEXT(t.TIME_ELAPSED_EXT)}},gi.prototype.collectGpuTimers=function(){var t=this.gpuTimers;return this.gpuTimers={},t},gi.prototype.queryGpuTimers=function(t){var e={};for(var r in t){var i=t[r],o=this.context.extTimerQuery,n=o.getQueryObjectEXT(i.query,o.QUERY_RESULT_EXT)/1e6;o.deleteQueryEXT(i.query),e[r]=n}return e},gi.prototype.translatePosMatrix=function(e,r,i,o,n){if(!i[0]&&!i[1])return e;var a=n?"map"===o?this.transform.angle:0:"viewport"===o?-this.transform.angle:0;if(a){var s=Math.sin(a),l=Math.cos(a);i=[i[0]*l-i[1]*s,i[0]*s+i[1]*l]}var p=[n?i[0]:he(r,i[0],this.transform.zoom),n?i[1]:he(r,i[1],this.transform.zoom),0],c=new Float32Array(16);return t.translate(c,e,p),c},gi.prototype.saveTileTexture=function(t){var e=this._tileTextures[t.size[0]];e?e.push(t):this._tileTextures[t.size[0]]=[t]},gi.prototype.getTileTexture=function(t){var e=this._tileTextures[t];return e&&e.length>0?e.pop():null},gi.prototype.isPatternMissing=function(t){if(!t)return!1;if(!t.from||!t.to)return!0;var e=this.imageManager.getPattern(t.from.toString()),r=this.imageManager.getPattern(t.to.toString());return!e||!r},gi.prototype.useProgram=function(t,e){this.cache=this.cache||{};var r=""+t+(e?e.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=new br(this.context,t,gr[t],e,Xr[t],this._showOverdrawInspector)),this.cache[r]},gi.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},gi.prototype.setBaseState=function(){var t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)},gi.prototype.initDebugOverlayCanvas=function(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=t.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new t.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))},gi.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var vi=function(t,e){this.points=t,this.planes=e};vi.fromInvProjectionMatrix=function(e,r,i){var o=Math.pow(2,i),n=[[-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(r){return t.transformMat4([],r,e)})).map((function(e){return t.scale$1([],e,1/e[3]/r*o)})),a=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(e){var r=t.sub([],n[e[0]],n[e[1]]),i=t.sub([],n[e[2]],n[e[1]]),o=t.normalize([],t.cross([],r,i)),a=-t.dot(o,n[e[1]]);return o.concat(a)}));return new vi(n,a)};var xi=function(e,r){this.min=e,this.max=r,this.center=t.scale$2([],t.add([],this.min,this.max),.5)};xi.prototype.quadrant=function(e){for(var r=[e%2==0,e<2],i=t.clone$2(this.min),o=t.clone$2(this.max),n=0;n<r.length;n++)i[n]=r[n]?this.min[n]:this.center[n],o[n]=r[n]?this.center[n]:this.max[n];return o[2]=this.max[2],new xi(i,o)},xi.prototype.distanceX=function(t){return Math.max(Math.min(this.max[0],t[0]),this.min[0])-t[0]},xi.prototype.distanceY=function(t){return Math.max(Math.min(this.max[1],t[1]),this.min[1])-t[1]},xi.prototype.intersects=function(e){for(var r=[[this.min[0],this.min[1],0,1],[this.max[0],this.min[1],0,1],[this.max[0],this.max[1],0,1],[this.min[0],this.max[1],0,1]],i=!0,o=0;o<e.planes.length;o++){for(var n=e.planes[o],a=0,s=0;s<r.length;s++)a+=t.dot$1(n,r[s])>=0;if(0===a)return 0;a!==r.length&&(i=!1)}if(i)return 2;for(var l=0;l<3;l++){for(var p=Number.MAX_VALUE,c=-Number.MAX_VALUE,u=0;u<e.points.length;u++){var h=e.points[u][l]-this.min[l];p=Math.min(p,h),c=Math.max(c,h)}if(c<0||p>this.max[l]-this.min[l])return 0}return 1};var bi=function(t,e,r,i){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=0),isNaN(t)||t<0||isNaN(e)||e<0||isNaN(r)||r<0||isNaN(i)||i<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=e,this.left=r,this.right=i};bi.prototype.interpolate=function(e,r,i){return null!=r.top&&null!=e.top&&(this.top=t.number(e.top,r.top,i)),null!=r.bottom&&null!=e.bottom&&(this.bottom=t.number(e.bottom,r.bottom,i)),null!=r.left&&null!=e.left&&(this.left=t.number(e.left,r.left,i)),null!=r.right&&null!=e.right&&(this.right=t.number(e.right,r.right,i)),this},bi.prototype.getCenter=function(e,r){var i=t.clamp((this.left+e-this.right)/2,0,e),o=t.clamp((this.top+r-this.bottom)/2,0,r);return new t.Point(i,o)},bi.prototype.equals=function(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right},bi.prototype.clone=function(){return new bi(this.top,this.bottom,this.left,this.right)},bi.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var wi=function(e,r,i,o,n){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===n||n,this._minZoom=e||0,this._maxZoom=r||22,this._minPitch=null==i?0:i,this._maxPitch=null==o?60:o,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new bi,this._posMatrixCache={},this._alignedPosMatrixCache={}},Ci={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};wi.prototype.clone=function(){var t=new wi(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.tileSize=this.tileSize,t.latRange=this.latRange,t.width=this.width,t.height=this.height,t._center=this._center,t.zoom=this.zoom,t.angle=this.angle,t._fov=this._fov,t._pitch=this._pitch,t._unmodified=this._unmodified,t._edgeInsets=this._edgeInsets.clone(),t._calcMatrices(),t},Ci.minZoom.get=function(){return this._minZoom},Ci.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},Ci.maxZoom.get=function(){return this._maxZoom},Ci.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},Ci.minPitch.get=function(){return this._minPitch},Ci.minPitch.set=function(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))},Ci.maxPitch.get=function(){return this._maxPitch},Ci.maxPitch.set=function(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))},Ci.renderWorldCopies.get=function(){return this._renderWorldCopies},Ci.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},Ci.worldSize.get=function(){return this.tileSize*this.scale},Ci.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},Ci.size.get=function(){return new t.Point(this.width,this.height)},Ci.bearing.get=function(){return-this.angle/Math.PI*180},Ci.bearing.set=function(e){var r=-t.wrap(e,-180,180)*Math.PI/180;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=t.create$2(),t.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},Ci.pitch.get=function(){return this._pitch/Math.PI*180},Ci.pitch.set=function(e){var r=t.clamp(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices())},Ci.fov.get=function(){return this._fov/Math.PI*180},Ci.fov.set=function(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())},Ci.zoom.get=function(){return this._zoom},Ci.zoom.set=function(t){var e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom,this._constrain(),this._calcMatrices())},Ci.center.get=function(){return this._center},Ci.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},Ci.padding.get=function(){return this._edgeInsets.toJSON()},Ci.padding.set=function(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())},Ci.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},wi.prototype.isPaddingEqual=function(t){return this._edgeInsets.equals(t)},wi.prototype.interpolatePadding=function(t,e,r){this._unmodified=!1,this._edgeInsets.interpolate(t,e,r),this._constrain(),this._calcMatrices()},wi.prototype.coveringZoomLevel=function(t){var e=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,e)},wi.prototype.getVisibleUnwrappedCoordinates=function(e){var r=[new t.UnwrappedTileID(0,e)];if(this._renderWorldCopies)for(var i=this.pointCoordinate(new t.Point(0,0)),o=this.pointCoordinate(new t.Point(this.width,0)),n=this.pointCoordinate(new t.Point(this.width,this.height)),a=this.pointCoordinate(new t.Point(0,this.height)),s=Math.floor(Math.min(i.x,o.x,n.x,a.x)),l=Math.floor(Math.max(i.x,o.x,n.x,a.x)),p=s-1;p<=l+1;p++)0!==p&&r.push(new t.UnwrappedTileID(p,e));return r},wi.prototype.coveringTiles=function(e){var r=this.coveringZoomLevel(e),i=r;if(void 0!==e.minzoom&&r<e.minzoom)return[];void 0!==e.maxzoom&&r>e.maxzoom&&(r=e.maxzoom);var o=t.MercatorCoordinate.fromLngLat(this.center),n=Math.pow(2,r),a=[n*o.x,n*o.y,0],s=vi.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,r),l=e.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(l=r);var p=function(t){return{aabb:new xi([t*n,0,0],[(t+1)*n,n,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}},c=[],u=[],h=r,d=e.reparseOverscaled?i:r;if(this._renderWorldCopies)for(var f=1;f<=3;f++)c.push(p(-f)),c.push(p(f));for(c.push(p(0));c.length>0;){var m=c.pop(),_=m.x,y=m.y,g=m.fullyVisible;if(!g){var v=m.aabb.intersects(s);if(0===v)continue;g=2===v}var x=m.aabb.distanceX(a),b=m.aabb.distanceY(a),w=Math.max(Math.abs(x),Math.abs(b));if(m.zoom===h||w>3+(1<<h-m.zoom)-2&&m.zoom>=l)u.push({tileID:new t.OverscaledTileID(m.zoom===h?d:m.zoom,m.wrap,m.zoom,_,y),distanceSq:t.sqrLen([a[0]-.5-_,a[1]-.5-y])});else for(var C=0;C<4;C++){var k=(_<<1)+C%2,S=(y<<1)+(C>>1);c.push({aabb:m.aabb.quadrant(C),zoom:m.zoom+1,x:k,y:S,wrap:m.wrap,fullyVisible:g})}}return u.sort((function(t,e){return t.distanceSq-e.distanceSq})).map((function(t){return t.tileID}))},wi.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},Ci.unmodified.get=function(){return this._unmodified},wi.prototype.zoomScale=function(t){return Math.pow(2,t)},wi.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},wi.prototype.project=function(e){var r=t.clamp(e.lat,-this.maxValidLatitude,this.maxValidLatitude);return new t.Point(t.mercatorXfromLng(e.lng)*this.worldSize,t.mercatorYfromLat(r)*this.worldSize)},wi.prototype.unproject=function(e){return new t.MercatorCoordinate(e.x/this.worldSize,e.y/this.worldSize).toLngLat()},Ci.point.get=function(){return this.project(this.center)},wi.prototype.setLocationAtPoint=function(e,r){var i=this.pointCoordinate(r),o=this.pointCoordinate(this.centerPoint),n=this.locationCoordinate(e),a=new t.MercatorCoordinate(n.x-(i.x-o.x),n.y-(i.y-o.y));this.center=this.coordinateLocation(a),this._renderWorldCopies&&(this.center=this.center.wrap())},wi.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},wi.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},wi.prototype.locationCoordinate=function(e){return t.MercatorCoordinate.fromLngLat(e)},wi.prototype.coordinateLocation=function(t){return t.toLngLat()},wi.prototype.pointCoordinate=function(e){var r=[e.x,e.y,0,1],i=[e.x,e.y,1,1];t.transformMat4(r,r,this.pixelMatrixInverse),t.transformMat4(i,i,this.pixelMatrixInverse);var o=r[3],n=i[3],a=r[1]/o,s=i[1]/n,l=r[2]/o,p=i[2]/n,c=l===p?0:(0-l)/(p-l);return new t.MercatorCoordinate(t.number(r[0]/o,i[0]/n,c)/this.worldSize,t.number(a,s,c)/this.worldSize)},wi.prototype.coordinatePoint=function(e){var r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix),new t.Point(r[0]/r[3],r[1]/r[3])},wi.prototype.getBounds=function(){return(new t.LngLatBounds).extend(this.pointLocation(new t.Point(0,0))).extend(this.pointLocation(new t.Point(this.width,0))).extend(this.pointLocation(new t.Point(this.width,this.height))).extend(this.pointLocation(new t.Point(0,this.height)))},wi.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new t.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},wi.prototype.setMaxBounds=function(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},wi.prototype.calculatePosMatrix=function(e,r){void 0===r&&(r=!1);var i=e.key,o=r?this._alignedPosMatrixCache:this._posMatrixCache;if(o[i])return o[i];var n=e.canonical,a=this.worldSize/this.zoomScale(n.z),s=n.x+Math.pow(2,n.z)*e.wrap,l=t.identity(new Float64Array(16));return t.translate(l,l,[s*a,n.y*a,0]),t.scale(l,l,[a/t.EXTENT,a/t.EXTENT,1]),t.multiply(l,r?this.alignedProjMatrix:this.projMatrix,l),o[i]=new Float32Array(l),o[i]},wi.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},wi.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var e,r,i,o,n=-90,a=90,s=-180,l=180,p=this.size,c=this._unmodified;if(this.latRange){var u=this.latRange;n=t.mercatorYfromLat(u[1])*this.worldSize,e=(a=t.mercatorYfromLat(u[0])*this.worldSize)-n<p.y?p.y/(a-n):0}if(this.lngRange){var h=this.lngRange;s=t.mercatorXfromLng(h[0])*this.worldSize,r=(l=t.mercatorXfromLng(h[1])*this.worldSize)-s<p.x?p.x/(l-s):0}var d=this.point,f=Math.max(r||0,e||0);if(f)return this.center=this.unproject(new t.Point(r?(l+s)/2:d.x,e?(a+n)/2:d.y)),this.zoom+=this.scaleZoom(f),this._unmodified=c,void(this._constraining=!1);if(this.latRange){var m=d.y,_=p.y/2;m-_<n&&(o=n+_),m+_>a&&(o=a-_)}if(this.lngRange){var y=d.x,g=p.x/2;y-g<s&&(i=s+g),y+g>l&&(i=l-g)}void 0===i&&void 0===o||(this.center=this.unproject(new t.Point(void 0!==i?i:d.x,void 0!==o?o:d.y))),this._unmodified=c,this._constraining=!1}},wi.prototype._calcMatrices=function(){if(this.height){var e=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var r=Math.PI/2+this._pitch,i=this._fov*(.5+e.y/this.height),o=Math.sin(i)*this.cameraToCenterDistance/Math.sin(t.clamp(Math.PI-r-i,.01,Math.PI-.01)),n=this.point,a=n.x,s=n.y,l=1.01*(Math.cos(Math.PI/2-this._pitch)*o+this.cameraToCenterDistance),p=this.height/50,c=new Float64Array(16);t.perspective(c,this._fov,this.width/this.height,p,l),c[8]=2*-e.x/this.width,c[9]=2*e.y/this.height,t.scale(c,c,[1,-1,1]),t.translate(c,c,[0,0,-this.cameraToCenterDistance]),t.rotateX(c,c,this._pitch),t.rotateZ(c,c,this.angle),t.translate(c,c,[-a,-s,0]),this.mercatorMatrix=t.scale([],c,[this.worldSize,this.worldSize,this.worldSize]),t.scale(c,c,[1,1,t.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=c,this.invProjMatrix=t.invert([],this.projMatrix);var u=this.width%2/2,h=this.height%2/2,d=Math.cos(this.angle),f=Math.sin(this.angle),m=a-Math.round(a)+d*u+f*h,_=s-Math.round(s)+d*h+f*u,y=new Float64Array(c);if(t.translate(y,y,[m>.5?m-1:m,_>.5?_-1:_,0]),this.alignedProjMatrix=y,c=t.create(),t.scale(c,c,[this.width/2,-this.height/2,1]),t.translate(c,c,[1,-1,0]),this.labelPlaneMatrix=c,c=t.create(),t.scale(c,c,[1,-1,1]),t.translate(c,c,[-1,-1,0]),t.scale(c,c,[2/this.width,2/this.height,1]),this.glCoordMatrix=c,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(c=t.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=c,this._posMatrixCache={},this._alignedPosMatrixCache={}}},wi.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var e=this.pointCoordinate(new t.Point(0,0)),r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance},wi.prototype.getCameraPoint=function(){var e=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,e))},wi.prototype.getCameraQueryGeometry=function(e){var r=this.getCameraPoint();if(1===e.length)return[e[0],r];for(var i=r.x,o=r.y,n=r.x,a=r.y,s=0,l=e;s<l.length;s+=1){var p=l[s];i=Math.min(i,p.x),o=Math.min(o,p.y),n=Math.max(n,p.x),a=Math.max(a,p.y)}return[new t.Point(i,o),new t.Point(n,o),new t.Point(n,a),new t.Point(i,a),new t.Point(i,o)]},Object.defineProperties(wi.prototype,Ci);var ki=function(e){var r,i,o,n;this._hashName=e&&encodeURIComponent(e),t.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=(r=this._updateHashUnthrottled.bind(this),i=!1,o=null,n=function(){o=null,i&&(r(),o=setTimeout(n,300),i=!1)},function(){return i=!0,o||n(),o})};ki.prototype.addTo=function(e){return this._map=e,t.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},ki.prototype.remove=function(){return t.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},ki.prototype.getHashString=function(e){var r=this._map.getCenter(),i=Math.round(100*this._map.getZoom())/100,o=Math.ceil((i*Math.LN2+Math.log(512/360/.5))/Math.LN10),n=Math.pow(10,o),a=Math.round(r.lng*n)/n,s=Math.round(r.lat*n)/n,l=this._map.getBearing(),p=this._map.getPitch(),c="";if(c+=e?"/"+a+"/"+s+"/"+i:i+"/"+s+"/"+a,(l||p)&&(c+="/"+Math.round(10*l)/10),p&&(c+="/"+Math.round(p)),this._hashName){var u=this._hashName,h=!1,d=t.window.location.hash.slice(1).split("&").map((function(t){var e=t.split("=")[0];return e===u?(h=!0,e+"="+c):t})).filter((function(t){return t}));return h||d.push(u+"="+c),"#"+d.join("&")}return"#"+c},ki.prototype._getCurrentHash=function(){var e,r=this,i=t.window.location.hash.replace("#","");return this._hashName?(i.split("&").map((function(t){return t.split("=")})).forEach((function(t){t[0]===r._hashName&&(e=t)})),(e&&e[1]||"").split("/")):i.split("/")},ki.prototype._onHashChange=function(){var t=this._getCurrentHash();if(t.length>=3&&!t.some((function(t){return isNaN(t)}))){var e=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:e,pitch:+(t[4]||0)}),!0}return!1},ki.prototype._updateHashUnthrottled=function(){var e=t.window.location.href.replace(/(#.+)?$/,this.getHashString());try{t.window.history.replaceState(t.window.history.state,null,e)}catch(t){}};var Si={linearity:.3,easing:t.bezier(0,0,.3,1)},Mi=t.extend({deceleration:2500,maxSpeed:1400},Si),Ei=t.extend({deceleration:20,maxSpeed:1400},Si),Ti=t.extend({deceleration:1e3,maxSpeed:360},Si),Ai=t.extend({deceleration:1e3,maxSpeed:90},Si),Ii=function(t){this._map=t,this.clear()};function Pi(t,e){(!t.duration||t.duration<e.duration)&&(t.duration=e.duration,t.easing=e.easing)}function Li(e,r,i){var o=i.maxSpeed,n=i.linearity,a=i.deceleration,s=t.clamp(e*n/(r/1e3),-o,o),l=Math.abs(s)/(a*n);return{easing:i.easing,duration:1e3*l,amount:s*(l/2)}}Ii.prototype.clear=function(){this._inertiaBuffer=[]},Ii.prototype.record=function(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:t.browser.now(),settings:e})},Ii.prototype._drainInertiaBuffer=function(){for(var e=this._inertiaBuffer,r=t.browser.now();e.length>0&&r-e[0].time>160;)e.shift()},Ii.prototype._onMoveEnd=function(e){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var r={zoom:0,bearing:0,pitch:0,pan:new t.Point(0,0),pinchAround:void 0,around:void 0},i=0,o=this._inertiaBuffer;i<o.length;i+=1){var n=o[i].settings;r.zoom+=n.zoomDelta||0,r.bearing+=n.bearingDelta||0,r.pitch+=n.pitchDelta||0,n.panDelta&&r.pan._add(n.panDelta),n.around&&(r.around=n.around),n.pinchAround&&(r.pinchAround=n.pinchAround)}var a=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,s={};if(r.pan.mag()){var l=Li(r.pan.mag(),a,t.extend({},Mi,e||{}));s.offset=r.pan.mult(l.amount/r.pan.mag()),s.center=this._map.transform.center,Pi(s,l)}if(r.zoom){var p=Li(r.zoom,a,Ei);s.zoom=this._map.transform.zoom+p.amount,Pi(s,p)}if(r.bearing){var c=Li(r.bearing,a,Ti);s.bearing=this._map.transform.bearing+t.clamp(c.amount,-179,179),Pi(s,c)}if(r.pitch){var u=Li(r.pitch,a,Ai);s.pitch=this._map.transform.pitch+u.amount,Pi(s,u)}if(s.zoom||s.bearing){var h=void 0===r.pinchAround?r.around:r.pinchAround;s.around=h?this._map.unproject(h):this._map.getCenter()}return this.clear(),t.extend(s,{noMoveStart:!0})}};var zi=function(e){function i(i,o,n,a){void 0===a&&(a={});var s=r.mousePos(o.getCanvasContainer(),n),l=o.unproject(s);e.call(this,i,t.extend({point:s,lngLat:l,originalEvent:n},a)),this._defaultPrevented=!1,this.target=o}e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i;var o={defaultPrevented:{configurable:!0}};return i.prototype.preventDefault=function(){this._defaultPrevented=!0},o.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(i.prototype,o),i}(t.Event),Ri=function(e){function i(i,o,n){var a="touchend"===i?n.changedTouches:n.touches,s=r.touchPos(o.getCanvasContainer(),a),l=s.map((function(t){return o.unproject(t)})),p=s.reduce((function(t,e,r,i){return t.add(e.div(i.length))}),new t.Point(0,0)),c=o.unproject(p);e.call(this,i,{points:s,point:p,lngLats:l,lngLat:c,originalEvent:n}),this._defaultPrevented=!1}e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i;var o={defaultPrevented:{configurable:!0}};return i.prototype.preventDefault=function(){this._defaultPrevented=!0},o.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(i.prototype,o),i}(t.Event),Di=function(t){function e(e,r,i){t.call(this,e,{originalEvent:i}),this._defaultPrevented=!1}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={defaultPrevented:{configurable:!0}};return e.prototype.preventDefault=function(){this._defaultPrevented=!0},r.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(e.prototype,r),e}(t.Event),Oi=function(t,e){this._map=t,this._clickTolerance=e.clickTolerance};Oi.prototype.reset=function(){delete this._mousedownPos},Oi.prototype.wheel=function(t){return this._firePreventable(new Di(t.type,this._map,t))},Oi.prototype.mousedown=function(t,e){return this._mousedownPos=e,this._firePreventable(new zi(t.type,this._map,t))},Oi.prototype.mouseup=function(t){this._map.fire(new zi(t.type,this._map,t))},Oi.prototype.click=function(t,e){this._mousedownPos&&this._mousedownPos.dist(e)>=this._clickTolerance||this._map.fire(new zi(t.type,this._map,t))},Oi.prototype.dblclick=function(t){return this._firePreventable(new zi(t.type,this._map,t))},Oi.prototype.mouseover=function(t){this._map.fire(new zi(t.type,this._map,t))},Oi.prototype.mouseout=function(t){this._map.fire(new zi(t.type,this._map,t))},Oi.prototype.touchstart=function(t){return this._firePreventable(new Ri(t.type,this._map,t))},Oi.prototype.touchmove=function(t){this._map.fire(new Ri(t.type,this._map,t))},Oi.prototype.touchend=function(t){this._map.fire(new Ri(t.type,this._map,t))},Oi.prototype.touchcancel=function(t){this._map.fire(new Ri(t.type,this._map,t))},Oi.prototype._firePreventable=function(t){if(this._map.fire(t),t.defaultPrevented)return{}},Oi.prototype.isEnabled=function(){return!0},Oi.prototype.isActive=function(){return!1},Oi.prototype.enable=function(){},Oi.prototype.disable=function(){};var Fi=function(t){this._map=t};Fi.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Fi.prototype.mousemove=function(t){this._map.fire(new zi(t.type,this._map,t))},Fi.prototype.mousedown=function(){this._delayContextMenu=!0},Fi.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new zi("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Fi.prototype.contextmenu=function(t){this._delayContextMenu?this._contextMenuEvent=t:this._map.fire(new zi(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()},Fi.prototype.isEnabled=function(){return!0},Fi.prototype.isActive=function(){return!1},Fi.prototype.enable=function(){},Fi.prototype.disable=function(){};var Bi=function(t,e){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1};function ji(t,e){for(var r={},i=0;i<t.length;i++)r[t[i].identifier]=e[i];return r}Bi.prototype.isEnabled=function(){return!!this._enabled},Bi.prototype.isActive=function(){return!!this._active},Bi.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},Bi.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Bi.prototype.mousedown=function(t,e){this.isEnabled()&&t.shiftKey&&0===t.button&&(r.disableDrag(),this._startPos=this._lastPos=e,this._active=!0)},Bi.prototype.mousemoveWindow=function(t,e){if(this._active){var i=e;if(!(this._lastPos.equals(i)||!this._box&&i.dist(this._startPos)<this._clickTolerance)){var o=this._startPos;this._lastPos=i,this._box||(this._box=r.create("div","maplibregl-boxzoom mapboxgl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair","mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var n=Math.min(o.x,i.x),a=Math.max(o.x,i.x),s=Math.min(o.y,i.y),l=Math.max(o.y,i.y);r.setTransform(this._box,"translate("+n+"px,"+s+"px)"),this._box.style.width=a-n+"px",this._box.style.height=l-s+"px"}}},Bi.prototype.mouseupWindow=function(e,i){var o=this;if(this._active&&0===e.button){var n=this._startPos,a=i;if(this.reset(),r.suppressClick(),n.x!==a.x||n.y!==a.y)return this._map.fire(new t.Event("boxzoomend",{originalEvent:e})),{cameraAnimation:function(t){return t.fitScreenCoordinates(n,a,o._map.getBearing(),{linear:!0})}};this._fireEvent("boxzoomcancel",e)}},Bi.prototype.keydown=function(t){this._active&&27===t.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",t))},Bi.prototype.reset=function(){this._active=!1,this._container.classList.remove("maplibregl-crosshair","mapboxgl-crosshair"),this._box&&(r.remove(this._box),this._box=null),r.enableDrag(),delete this._startPos,delete this._lastPos},Bi.prototype._fireEvent=function(e,r){return this._map.fire(new t.Event(e,{originalEvent:r}))};var Ni=function(t){this.reset(),this.numTouches=t.numTouches};Ni.prototype.reset=function(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1},Ni.prototype.touchstart=function(e,r,i){(this.centroid||i.length>this.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=e.timeStamp),i.length===this.numTouches&&(this.centroid=function(e){for(var r=new t.Point(0,0),i=0,o=e;i<o.length;i+=1)r._add(o[i]);return r.div(e.length)}(r),this.touches=ji(i,r)))},Ni.prototype.touchmove=function(t,e,r){if(!this.aborted&&this.centroid){var i=ji(r,e);for(var o in this.touches){var n=i[o];(!n||n.dist(this.touches[o])>30)&&(this.aborted=!0)}}},Ni.prototype.touchend=function(t,e,r){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===r.length){var i=!this.aborted&&this.centroid;if(this.reset(),i)return i}};var Ui=function(t){this.singleTap=new Ni(t),this.numTaps=t.numTaps,this.reset()};Ui.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},Ui.prototype.touchstart=function(t,e,r){this.singleTap.touchstart(t,e,r)},Ui.prototype.touchmove=function(t,e,r){this.singleTap.touchmove(t,e,r)},Ui.prototype.touchend=function(t,e,r){var i=this.singleTap.touchend(t,e,r);if(i){var o=t.timeStamp-this.lastTime<500,n=!this.lastTap||this.lastTap.dist(i)<30;if(o&&n||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=i,this.count===this.numTaps)return this.reset(),i}};var Vi=function(){this._zoomIn=new Ui({numTouches:1,numTaps:2}),this._zoomOut=new Ui({numTouches:2,numTaps:1}),this.reset()};Vi.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},Vi.prototype.touchstart=function(t,e,r){this._zoomIn.touchstart(t,e,r),this._zoomOut.touchstart(t,e,r)},Vi.prototype.touchmove=function(t,e,r){this._zoomIn.touchmove(t,e,r),this._zoomOut.touchmove(t,e,r)},Vi.prototype.touchend=function(t,e,r){var i=this,o=this._zoomIn.touchend(t,e,r),n=this._zoomOut.touchend(t,e,r);return o?(this._active=!0,t.preventDefault(),setTimeout((function(){return i.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()+1,around:e.unproject(o)},{originalEvent:t})}}):n?(this._active=!0,t.preventDefault(),setTimeout((function(){return i.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()-1,around:e.unproject(n)},{originalEvent:t})}}):void 0},Vi.prototype.touchcancel=function(){this.reset()},Vi.prototype.enable=function(){this._enabled=!0},Vi.prototype.disable=function(){this._enabled=!1,this.reset()},Vi.prototype.isEnabled=function(){return this._enabled},Vi.prototype.isActive=function(){return this._active};var qi={0:1,2:2},$i=function(t){this.reset(),this._clickTolerance=t.clickTolerance||1};$i.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},$i.prototype._correctButton=function(t,e){return!1},$i.prototype._move=function(t,e){return{}},$i.prototype.mousedown=function(t,e){if(!this._lastPoint){var i=r.mouseButton(t);this._correctButton(t,i)&&(this._lastPoint=e,this._eventButton=i)}},$i.prototype.mousemoveWindow=function(t,e){var r=this._lastPoint;if(r)if(t.preventDefault(),function(t,e){var r=qi[e];return void 0===t.buttons||(t.buttons&r)!==r}(t,this._eventButton))this.reset();else if(this._moved||!(e.dist(r)<this._clickTolerance))return this._moved=!0,this._lastPoint=e,this._move(r,e)},$i.prototype.mouseupWindow=function(t){this._lastPoint&&r.mouseButton(t)===this._eventButton&&(this._moved&&r.suppressClick(),this.reset())},$i.prototype.enable=function(){this._enabled=!0},$i.prototype.disable=function(){this._enabled=!1,this.reset()},$i.prototype.isEnabled=function(){return this._enabled},$i.prototype.isActive=function(){return this._active};var Hi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.mousedown=function(e,r){t.prototype.mousedown.call(this,e,r),this._lastPoint&&(this._active=!0)},e.prototype._correctButton=function(t,e){return 0===e&&!t.ctrlKey},e.prototype._move=function(t,e){return{around:e,panDelta:e.sub(t)}},e}($i),Zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._correctButton=function(t,e){return 0===e&&t.ctrlKey||2===e},e.prototype._move=function(t,e){var r=.8*(e.x-t.x);if(r)return this._active=!0,{bearingDelta:r}},e.prototype.contextmenu=function(t){t.preventDefault()},e}($i),Gi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._correctButton=function(t,e){return 0===e&&t.ctrlKey||2===e},e.prototype._move=function(t,e){var r=-.5*(e.y-t.y);if(r)return this._active=!0,{pitchDelta:r}},e.prototype.contextmenu=function(t){t.preventDefault()},e}($i),Qi=function(t){this._minTouches=1,this._clickTolerance=t.clickTolerance||1,this.reset()};Qi.prototype.reset=function(){this._active=!1,this._touches={},this._sum=new t.Point(0,0)},Qi.prototype.touchstart=function(t,e,r){return this._calculateTransform(t,e,r)},Qi.prototype.touchmove=function(t,e,r){if(this._active&&!(r.length<this._minTouches))return t.preventDefault(),this._calculateTransform(t,e,r)},Qi.prototype.touchend=function(t,e,r){this._calculateTransform(t,e,r),this._active&&r.length<this._minTouches&&this.reset()},Qi.prototype.touchcancel=function(){this.reset()},Qi.prototype._calculateTransform=function(e,r,i){i.length>0&&(this._active=!0);var o=ji(i,r),n=new t.Point(0,0),a=new t.Point(0,0),s=0;for(var l in o){var p=o[l],c=this._touches[l];c&&(n._add(p),a._add(p.sub(c)),s++,o[l]=p)}if(this._touches=o,!(s<this._minTouches)&&a.mag()){var u=a.div(s);if(this._sum._add(u),!(this._sum.mag()<this._clickTolerance))return{around:n.div(s),panDelta:u}}},Qi.prototype.enable=function(){this._enabled=!0},Qi.prototype.disable=function(){this._enabled=!1,this.reset()},Qi.prototype.isEnabled=function(){return this._enabled},Qi.prototype.isActive=function(){return this._active};var Xi=function(){this.reset()};function Wi(t,e,r){for(var i=0;i<t.length;i++)if(t[i].identifier===r)return e[i]}function Ki(t,e){return Math.log(t/e)/Math.LN2}Xi.prototype.reset=function(){this._active=!1,delete this._firstTwoTouches},Xi.prototype._start=function(t){},Xi.prototype._move=function(t,e,r){return{}},Xi.prototype.touchstart=function(t,e,r){this._firstTwoTouches||r.length<2||(this._firstTwoTouches=[r[0].identifier,r[1].identifier],this._start([e[0],e[1]]))},Xi.prototype.touchmove=function(t,e,r){if(this._firstTwoTouches){t.preventDefault();var i=this._firstTwoTouches,o=i[1],n=Wi(r,e,i[0]),a=Wi(r,e,o);if(n&&a){var s=this._aroundCenter?null:n.add(a).div(2);return this._move([n,a],s,t)}}},Xi.prototype.touchend=function(t,e,i){if(this._firstTwoTouches){var o=this._firstTwoTouches,n=o[1],a=Wi(i,e,o[0]),s=Wi(i,e,n);a&&s||(this._active&&r.suppressClick(),this.reset())}},Xi.prototype.touchcancel=function(){this.reset()},Xi.prototype.enable=function(t){this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around},Xi.prototype.disable=function(){this._enabled=!1,this.reset()},Xi.prototype.isEnabled=function(){return this._enabled},Xi.prototype.isActive=function(){return this._active};var Ji=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.reset=function(){t.prototype.reset.call(this),delete this._distance,delete this._startDistance},e.prototype._start=function(t){this._startDistance=this._distance=t[0].dist(t[1])},e.prototype._move=function(t,e){var r=this._distance;if(this._distance=t[0].dist(t[1]),this._active||!(Math.abs(Ki(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Ki(this._distance,r),pinchAround:e}},e}(Xi);function Yi(t,e){return 180*t.angleWith(e)/Math.PI}var to=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.reset=function(){t.prototype.reset.call(this),delete this._minDiameter,delete this._startVector,delete this._vector},e.prototype._start=function(t){this._startVector=this._vector=t[0].sub(t[1]),this._minDiameter=t[0].dist(t[1])},e.prototype._move=function(t,e){var r=this._vector;if(this._vector=t[0].sub(t[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:Yi(this._vector,r),pinchAround:e}},e.prototype._isBelowThreshold=function(t){this._minDiameter=Math.min(this._minDiameter,t.mag());var e=25/(Math.PI*this._minDiameter)*360,r=Yi(t,this._startVector);return Math.abs(r)<e},e}(Xi);function eo(t){return Math.abs(t.y)>Math.abs(t.x)}var ro=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.reset=function(){t.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},e.prototype._start=function(t){this._lastPoints=t,eo(t[0].sub(t[1]))&&(this._valid=!1)},e.prototype._move=function(t,e,r){var i=t[0].sub(this._lastPoints[0]),o=t[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(i,o,r.timeStamp),this._valid)return this._lastPoints=t,this._active=!0,{pitchDelta:(i.y+o.y)/2*-.5}},e.prototype.gestureBeginsVertically=function(t,e,r){if(void 0!==this._valid)return this._valid;var i=t.mag()>=2,o=e.mag()>=2;if(i||o){if(!i||!o)return void 0===this._firstMove&&(this._firstMove=r),r-this._firstMove<100&&void 0;var n=t.y>0==e.y>0;return eo(t)&&eo(e)&&n}},e}(Xi),io={panStep:100,bearingStep:15,pitchStep:10},oo=function(){var t=io;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep,this._rotationDisabled=!1};function no(t){return t*(2-t)}oo.prototype.reset=function(){this._active=!1},oo.prototype.keydown=function(t){var e=this;if(!(t.altKey||t.ctrlKey||t.metaKey)){var r=0,i=0,o=0,n=0,a=0;switch(t.keyCode){case 61:case 107:case 171:case 187:r=1;break;case 189:case 109:case 173:r=-1;break;case 37:t.shiftKey?i=-1:(t.preventDefault(),n=-1);break;case 39:t.shiftKey?i=1:(t.preventDefault(),n=1);break;case 38:t.shiftKey?o=1:(t.preventDefault(),a=-1);break;case 40:t.shiftKey?o=-1:(t.preventDefault(),a=1);break;default:return}return this._rotationDisabled&&(i=0,o=0),{cameraAnimation:function(s){var l=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:no,zoom:r?Math.round(l)+r*(t.shiftKey?2:1):l,bearing:s.getBearing()+i*e._bearingStep,pitch:s.getPitch()+o*e._pitchStep,offset:[-n*e._panStep,-a*e._panStep],center:s.getCenter()},{originalEvent:t})}}}},oo.prototype.enable=function(){this._enabled=!0},oo.prototype.disable=function(){this._enabled=!1,this.reset()},oo.prototype.isEnabled=function(){return this._enabled},oo.prototype.isActive=function(){return this._active},oo.prototype.disableRotation=function(){this._rotationDisabled=!0},oo.prototype.enableRotation=function(){this._rotationDisabled=!1};var ao=function(e,r){this._map=e,this._el=e.getCanvasContainer(),this._handler=r,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,t.bindAll(["_onT
1imeout"],this)};ao.prototype.setZoomRate=function(t){this._defaultZoomRate=t},ao.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t},ao.prototype.isEnabled=function(){return!!this._enabled},ao.prototype.isActive=function(){return!!this._active||void 0!==this._finishTimeout},ao.prototype.isZooming=function(){return!!this._zooming},ao.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},ao.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},ao.prototype.wheel=function(e){if(this.isEnabled()){var r=e.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,i=t.browser.now(),o=i-(this._lastWheelEventTime||0);this._lastWheelEventTime=i,0!==r&&r%4.000244140625==0?this._type="wheel":0!==r&&Math.abs(r)<4?this._type="trackpad":o>400?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(o*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),e.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=e,this._delta-=r,this._active||this._start(e)),e.preventDefault()}}
vendor: 25,833 bytes, line 1
1,ao.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},ao.prototype._start=function(e){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 i=r.mousePos(this._el,e);this._around=t.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(i)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},ao.prototype.renderFrame=function(){var e=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)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,o=2/(1+Math.exp(-Math.abs(this._delta*i)));this._delta<0&&0!==o&&(o=1/o);var n="number"==typeof this._targetZoom?r.zoomScale(this._targetZoom):r.scale;this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(n*o))),"wheel"===this._type&&(this._startZoom=r.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var a,s="number"==typeof this._targetZoom?this._targetZoom:r.zoom,l=this._startZoom,p=this._easing,c=!1;if("wheel"===this._type&&l&&p){var u=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),h=p(u);a=t.number(l,s,h),u<1?this._frameId||(this._frameId=!0):c=!0}else a=s,c=!0;return this._active=!0,c&&(this._active=!1,this._finishTimeout=setTimeout((function(){e._zooming=!1,e._handler._triggerRenderFrame(),delete e._targetZoom,delete e._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!c,zoomDelta:a-r.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},ao.prototype._smoothOutEasing=function(e){var r=t.ease;if(this._prevEase){var i=this._prevEase,o=(t.browser.now()-i.start)/i.duration,n=i.easing(o+.01)-i.easing(o),a=.27/Math.sqrt(n*n+1e-4)*.01,s=Math.sqrt(.0729-a*a);r=t.bezier(a,s,.25,1)}return this._prevEase={start:t.browser.now(),duration:e,easing:r},r},ao.prototype.reset=function(){this._active=!1};var so=function(t,e){this._clickZoom=t,this._tapZoom=e};so.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},so.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},so.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},so.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var lo=function(){this.reset()};lo.prototype.reset=function(){this._active=!1},lo.prototype.dblclick=function(t,e){return t.preventDefault(),{cameraAnimation:function(r){r.easeTo({duration:300,zoom:r.getZoom()+(t.shiftKey?-1:1),around:r.unproject(e)},{originalEvent:t})}}},lo.prototype.enable=function(){this._enabled=!0},lo.prototype.disable=function(){this._enabled=!1,this.reset()},lo.prototype.isEnabled=function(){return this._enabled},lo.prototype.isActive=function(){return this._active};var po=function(){this._tap=new Ui({numTouches:1,numTaps:1}),this.reset()};po.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},po.prototype.touchstart=function(t,e,r){this._swipePoint||(this._tapTime&&t.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?r.length>0&&(this._swipePoint=e[0],this._swipeTouch=r[0].identifier):this._tap.touchstart(t,e,r))},po.prototype.touchmove=function(t,e,r){if(this._tapTime){if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;var i=e[0],o=i.y-this._swipePoint.y;return this._swipePoint=i,t.preventDefault(),this._active=!0,{zoomDelta:o/128}}}else this._tap.touchmove(t,e,r)},po.prototype.touchend=function(t,e,r){this._tapTime?this._swipePoint&&0===r.length&&this.reset():this._tap.touchend(t,e,r)&&(this._tapTime=t.timeStamp)},po.prototype.touchcancel=function(){this.reset()},po.prototype.enable=function(){this._enabled=!0},po.prototype.disable=function(){this._enabled=!1,this.reset()},po.prototype.isEnabled=function(){return this._enabled},po.prototype.isActive=function(){return this._active};var co=function(t,e,r){this._el=t,this._mousePan=e,this._touchPan=r};co.prototype.enable=function(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan","mapboxgl-touch-drag-pan")},co.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan","mapboxgl-touch-drag-pan")},co.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},co.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var uo=function(t,e,r){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=r};uo.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},uo.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},uo.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},uo.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var ho=function(t,e,r,i){this._el=t,this._touchZoom=e,this._touchRotate=r,this._tapDragZoom=i,this._rotationDisabled=!1,this._enabled=!0};ho.prototype.enable=function(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate","mapboxgl-touch-zoom-rotate")},ho.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate","mapboxgl-touch-zoom-rotate")},ho.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},ho.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},ho.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},ho.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var fo=function(t){return t.zoom||t.drag||t.pitch||t.rotate},mo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(t.Event);function _o(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}var yo=function(e,i){this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Ii(e),this._bearingSnap=i.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(i),t.bindAll(["handleEvent","handleWindowEvent"],this);var o=this._el;this._listeners=[[o,"touchstart",{passive:!0}],[o,"touchmove",{passive:!1}],[o,"touchend",void 0],[o,"touchcancel",void 0],[o,"mousedown",void 0],[o,"mousemove",void 0],[o,"mouseup",void 0],[t.window.document,"mousemove",{capture:!0}],[t.window.document,"mouseup",void 0],[o,"mouseover",void 0],[o,"mouseout",void 0],[o,"dblclick",void 0],[o,"click",void 0],[o,"keydown",{capture:!1}],[o,"keyup",void 0],[o,"wheel",{passive:!1}],[o,"contextmenu",void 0],[t.window,"blur",void 0]];for(var n=0,a=this._listeners;n<a.length;n+=1){var s=a[n],l=s[0];r.addEventListener(l,s[1],l===t.window.document?this.handleWindowEvent:this.handleEvent,s[2])}};yo.prototype.destroy=function(){for(var e=0,i=this._listeners;e<i.length;e+=1){var o=i[e],n=o[0];r.removeEventListener(n,o[1],n===t.window.document?this.handleWindowEvent:this.handleEvent,o[2])}},yo.prototype._addDefaultHandlers=function(t){var e=this._map,r=e.getCanvasContainer();this._add("mapEvent",new Oi(e,t));var i=e.boxZoom=new Bi(e,t);this._add("boxZoom",i);var o=new Vi,n=new lo;e.doubleClickZoom=new so(n,o),this._add("tapZoom",o),this._add("clickZoom",n);var a=new po;this._add("tapDragZoom",a);var s=e.touchPitch=new ro;this._add("touchPitch",s);var l=new Zi(t),p=new Gi(t);e.dragRotate=new uo(t,l,p),this._add("mouseRotate",l,["mousePitch"]),this._add("mousePitch",p,["mouseRotate"]);var c=new Hi(t),u=new Qi(t);e.dragPan=new co(r,c,u),this._add("mousePan",c),this._add("touchPan",u,["touchZoom","touchRotate"]);var h=new to,d=new Ji;e.touchZoomRotate=new ho(r,d,h,a),this._add("touchRotate",h,["touchPan","touchZoom"]),this._add("touchZoom",d,["touchPan","touchRotate"]);var f=e.scrollZoom=new ao(e,this);this._add("scrollZoom",f,["mousePan"]);var m=e.keyboard=new oo;this._add("keyboard",m),this._add("blockableMapEvent",new Fi(e));for(var _=0,y=["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"];_<y.length;_+=1){var g=y[_];t.interactive&&t[g]&&e[g].enable(t[g])}},yo.prototype._add=function(t,e,r){this._handlers.push({handlerName:t,handler:e,allowed:r}),this._handlersById[t]=e},yo.prototype.stop=function(t){if(!this._updatingCamera){for(var e=0,r=this._handlers;e<r.length;e+=1)r[e].handler.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}},yo.prototype.isActive=function(){for(var t=0,e=this._handlers;t<e.length;t+=1)if(e[t].handler.isActive())return!0;return!1},yo.prototype.isZooming=function(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()},yo.prototype.isRotating=function(){return!!this._eventsInProgress.rotate},yo.prototype.isMoving=function(){return Boolean(fo(this._eventsInProgress))||this.isZooming()},yo.prototype._blockedByActive=function(t,e,r){for(var i in t)if(i!==r&&(!e||e.indexOf(i)<0))return!0;return!1},yo.prototype.handleWindowEvent=function(t){this.handleEvent(t,t.type+"Window")},yo.prototype._getMapTouches=function(t){for(var e=[],r=0,i=t;r<i.length;r+=1){var o=i[r];this._el.contains(o.target)&&e.push(o)}return e},yo.prototype.handleEvent=function(t,e){if("blur"!==t.type){this._updatingCamera=!0;for(var i="renderFrame"===t.type?void 0:t,o={needsRenderFrame:!1},n={},a={},s=t.touches?this._getMapTouches(t.touches):void 0,l=s?r.touchPos(this._el,s):r.mousePos(this._el,t),p=0,c=this._handlers;p<c.length;p+=1){var u=c[p],h=u.handlerName,d=u.handler,f=u.allowed;if(d.isEnabled()){var m=void 0;this._blockedByActive(a,f,h)?d.reset():d[e||t.type]&&(m=d[e||t.type](t,l,s),this.mergeHandlerResult(o,n,m,h,i),m&&m.needsRenderFrame&&this._triggerRenderFrame()),(m||d.isActive())&&(a[h]=d)}}var _={};for(var y in this._previousActiveHandlers)a[y]||(_[y]=i);this._previousActiveHandlers=a,(Object.keys(_).length||_o(o))&&(this._changes.push([o,n,_]),this._triggerRenderFrame()),(Object.keys(a).length||_o(o))&&this._map._stop(!0),this._updatingCamera=!1;var g=o.cameraAnimation;g&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],g(this._map))}else this.stop(!0)},yo.prototype.mergeHandlerResult=function(e,r,i,o,n){if(i){t.extend(e,i);var a={handlerName:o,originalEvent:i.originalEvent||n};void 0!==i.zoomDelta&&(r.zoom=a),void 0!==i.panDelta&&(r.drag=a),void 0!==i.pitchDelta&&(r.pitch=a),void 0!==i.bearingDelta&&(r.rotate=a)}},yo.prototype._applyChanges=function(){for(var e={},r={},i={},o=0,n=this._changes;o<n.length;o+=1){var a=n[o],s=a[0],l=a[1],p=a[2];s.panDelta&&(e.panDelta=(e.panDelta||new t.Point(0,0))._add(s.panDelta)),s.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+s.zoomDelta),s.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+s.bearingDelta),s.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+s.pitchDelta),void 0!==s.around&&(e.around=s.around),void 0!==s.pinchAround&&(e.pinchAround=s.pinchAround),s.noInertia&&(e.noInertia=s.noInertia),t.extend(r,l),t.extend(i,p)}this._updateMapTransform(e,r,i),this._changes=[]},yo.prototype._updateMapTransform=function(t,e,r){var i=this._map,o=i.transform;if(!_o(t))return this._fireEvents(e,r,!0);var n=t.panDelta,a=t.zoomDelta,s=t.bearingDelta,l=t.pitchDelta,p=t.around,c=t.pinchAround;void 0!==c&&(p=c),i._stop(!0),p=p||i.transform.centerPoint;var u=o.pointLocation(n?p.sub(n):p);s&&(o.bearing+=s),l&&(o.pitch+=l),a&&(o.zoom+=a),o.setLocationAtPoint(u,p),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(e,r,!0)},yo.prototype._fireEvents=function(e,r,i){var o=this,n=fo(this._eventsInProgress),a=fo(e),s={};for(var l in e)this._eventsInProgress[l]||(s[l+"start"]=e[l].originalEvent),this._eventsInProgress[l]=e[l];for(var p in!n&&a&&this._fireEvent("movestart",a.originalEvent),s)this._fireEvent(p,s[p]);for(var c in a&&this._fireEvent("move",a.originalEvent),e)this._fireEvent(c,e[c].originalEvent);var u,h={};for(var d in this._eventsInProgress){var f=this._eventsInProgress[d],m=f.handlerName,_=f.originalEvent;this._handlersById[m].isActive()||(delete this._eventsInProgress[d],h[d+"end"]=u=r[m]||_)}for(var y in h)this._fireEvent(y,h[y]);var g=fo(this._eventsInProgress);if(i&&(n||a)&&!g){this._updatingCamera=!0;var v=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),x=function(t){return 0!==t&&-o._bearingSnap<t&&t<o._bearingSnap};v?(x(v.bearing||this._map.getBearing())&&(v.bearing=0),this._map.easeTo(v,{originalEvent:u})):(this._map.fire(new t.Event("moveend",{originalEvent:u})),x(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}},yo.prototype._fireEvent=function(e,r){this._map.fire(new t.Event(e,r?{originalEvent:r}:{}))},yo.prototype._requestFrame=function(){var t=this;return this._map.triggerRepaint(),this._map._renderTaskQueue.add((function(e){delete t._frameId,t.handleEvent(new mo("renderFrame",{timeStamp:e})),t._applyChanges()}))},yo.prototype._triggerRenderFrame=function(){void 0===this._frameId&&(this._frameId=this._requestFrame())};var go=function(e){function r(r,i){e.call(this),this._moving=!1,this._zooming=!1,this.transform=r,this._bearingSnap=i.bearingSnap,t.bindAll(["_renderFrameCallback"],this)}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.getCenter=function(){return new t.LngLat(this.transform.center.lng,this.transform.center.lat)},r.prototype.setCenter=function(t,e){return this.jumpTo({center:t},e)},r.prototype.panBy=function(e,r,i){return e=t.Point.convert(e).mult(-1),this.panTo(this.transform.center,t.extend({offset:e},r),i)},r.prototype.panTo=function(e,r,i){return this.easeTo(t.extend({center:e},r),i)},r.prototype.getZoom=function(){return this.transform.zoom},r.prototype.setZoom=function(t,e){return this.jumpTo({zoom:t},e),this},r.prototype.zoomTo=function(e,r,i){return this.easeTo(t.extend({zoom:e},r),i)},r.prototype.zoomIn=function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},r.prototype.zoomOut=function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},r.prototype.getBearing=function(){return this.transform.bearing},r.prototype.setBearing=function(t,e){return this.jumpTo({bearing:t},e),this},r.prototype.getPadding=function(){return this.transform.padding},r.prototype.setPadding=function(t,e){return this.jumpTo({padding:t},e),this},r.prototype.rotateTo=function(e,r,i){return this.easeTo(t.extend({bearing:e},r),i)},r.prototype.resetNorth=function(e,r){return this.rotateTo(0,t.extend({duration:1e3},e),r),this},r.prototype.resetNorthPitch=function(e,r){return this.easeTo(t.extend({bearing:0,pitch:0,duration:1e3},e),r),this},r.prototype.snapToNorth=function(t,e){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,e):this},r.prototype.getPitch=function(){return this.transform.pitch},r.prototype.setPitch=function(t,e){return this.jumpTo({pitch:t},e),this},r.prototype.cameraForBounds=function(e,r){e=t.LngLatBounds.convert(e);var i=r&&r.bearing||0;return this._cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),i,r)},r.prototype._cameraForBoxAndBearing=function(e,r,i,o){var n={top:0,bottom:0,right:0,left:0};if("number"==typeof(o=t.extend({padding:n,offset:[0,0],maxZoom:this.transform.maxZoom},o)).padding){var a=o.padding;o.padding={top:a,bottom:a,right:a,left:a}}o.padding=t.extend(n,o.padding);var s=this.transform,l=s.padding,p=s.project(t.LngLat.convert(e)),c=s.project(t.LngLat.convert(r)),u=p.rotate(-i*Math.PI/180),h=c.rotate(-i*Math.PI/180),d=new t.Point(Math.max(u.x,h.x),Math.max(u.y,h.y)),f=new t.Point(Math.min(u.x,h.x),Math.min(u.y,h.y)),m=d.sub(f),_=(s.width-(l.left+l.right+o.padding.left+o.padding.right))/m.x,y=(s.height-(l.top+l.bottom+o.padding.top+o.padding.bottom))/m.y;if(!(y<0||_<0)){var g=Math.min(s.scaleZoom(s.scale*Math.min(_,y)),o.maxZoom),v="number"==typeof o.offset.x?new t.Point(o.offset.x,o.offset.y):t.Point.convert(o.offset),x=new t.Point((o.padding.left-o.padding.right)/2,(o.padding.top-o.padding.bottom)/2).rotate(i*Math.PI/180),b=v.add(x).mult(s.scale/s.zoomScale(g));return{center:s.unproject(p.add(c).div(2).sub(b)),zoom:g,bearing:i}}t.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.")},r.prototype.fitBounds=function(t,e,r){return this._fitInternal(this.cameraForBounds(t,e),e,r)},r.prototype.fitScreenCoordinates=function(e,r,i,o,n){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(t.Point.convert(e)),this.transform.pointLocation(t.Point.convert(r)),i,o),o,n)},r.prototype._fitInternal=function(e,r,i){return e?(delete(r=t.extend(e,r)).padding,r.linear?this.easeTo(r,i):this.flyTo(r,i)):this},r.prototype.jumpTo=function(e,r){this.stop();var i=this.transform,o=!1,n=!1,a=!1;return"zoom"in e&&i.zoom!==+e.zoom&&(o=!0,i.zoom=+e.zoom),void 0!==e.center&&(i.center=t.LngLat.convert(e.center)),"bearing"in e&&i.bearing!==+e.bearing&&(n=!0,i.bearing=+e.bearing),"pitch"in e&&i.pitch!==+e.pitch&&(a=!0,i.pitch=+e.pitch),null==e.padding||i.isPaddingEqual(e.padding)||(i.padding=e.padding),this.fire(new t.Event("movestart",r)).fire(new t.Event("move",r)),o&&this.fire(new t.Event("zoomstart",r)).fire(new t.Event("zoom",r)).fire(new t.Event("zoomend",r)),n&&this.fire(new t.Event("rotatestart",r)).fire(new t.Event("rotate",r)).fire(new t.Event("rotateend",r)),a&&this.fire(new t.Event("pitchstart",r)).fire(new t.Event("pitch",r)).fire(new t.Event("pitchend",r)),this.fire(new t.Event("moveend",r))},r.prototype.easeTo=function(e,r){var i=this;this._stop(!1,e.easeId),(!1===(e=t.extend({offset:[0,0],duration:500,easing:t.ease},e)).animate||!e.essential&&t.browser.prefersReducedMotion)&&(e.duration=0);var o=this.transform,n=this.getZoom(),a=this.getBearing(),s=this.getPitch(),l=this.getPadding(),p="zoom"in e?+e.zoom:n,c="bearing"in e?this._normalizeBearing(e.bearing,a):a,u="pitch"in e?+e.pitch:s,h="padding"in e?e.padding:o.padding,d=t.Point.convert(e.offset),f=o.centerPoint.add(d),m=o.pointLocation(f),_=t.LngLat.convert(e.center||m);this._normalizeCenter(_);var y,g,v=o.project(m),x=o.project(_).sub(v),b=o.zoomScale(p-n);e.around&&(y=t.LngLat.convert(e.around),g=o.locationPoint(y));var w={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||p!==n,this._rotating=this._rotating||a!==c,this._pitching=this._pitching||u!==s,this._padding=!o.isPaddingEqual(h),this._easeId=e.easeId,this._prepareEase(r,e.noMoveStart,w),this._ease((function(e){if(i._zooming&&(o.zoom=t.number(n,p,e)),i._rotating&&(o.bearing=t.number(a,c,e)),i._pitching&&(o.pitch=t.number(s,u,e)),i._padding&&(o.interpolatePadding(l,h,e),f=o.centerPoint.add(d)),y)o.setLocationAtPoint(y,g);else{var m=o.zoomScale(o.zoom-n),_=p>n?Math.min(2,b):Math.max(.5,b),w=Math.pow(_,1-e),C=o.unproject(v.add(x.mult(e*w)).mult(m));o.setLocationAtPoint(o.renderWorldCopies?C.wrap():C,f)}i._fireMoveEvents(r)}),(function(t){i._afterEase(r,t)}),e),this},r.prototype._prepareEase=function(e,r,i){void 0===i&&(i={}),this._moving=!0,r||i.moving||this.fire(new t.Event("movestart",e)),this._zooming&&!i.zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&!i.rotating&&this.fire(new t.Event("rotatestart",e)),this._pitching&&!i.pitching&&this.fire(new t.Event("pitchstart",e))},r.prototype._fireMoveEvents=function(e){this.fire(new t.Event("move",e)),this._zooming&&this.fire(new t.Event("zoom",e)),this._rotating&&this.fire(new t.Event("rotate",e)),this._pitching&&this.fire(new t.Event("pitch",e))},r.prototype._afterEase=function(e,r){if(!this._easeId||!r||this._easeId!==r){delete this._easeId;var i=this._zooming,o=this._rotating,n=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,i&&this.fire(new t.Event("zoomend",e)),o&&this.fire(new t.Event("rotateend",e)),n&&this.fire(new t.Event("pitchend",e)),this.fire(new t.Event("moveend",e))}},r.prototype.flyTo=function(e,r){var i=this;if(!e.essential&&t.browser.prefersReducedMotion){var o=t.pick(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(o,r)}this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);var n=this.transform,a=this.getZoom(),s=this.getBearing(),l=this.getPitch(),p=this.getPadding(),c="zoom"in e?t.clamp(+e.zoom,n.minZoom,n.maxZoom):a,u="bearing"in e?this._normalizeBearing(e.bearing,s):s,h="pitch"in e?+e.pitch:l,d="padding"in e?e.padding:n.padding,f=n.zoomScale(c-a),m=t.Point.convert(e.offset),_=n.centerPoint.add(m),y=n.pointLocation(_),g=t.LngLat.convert(e.center||y);this._normalizeCenter(g);var v=n.project(y),x=n.project(g).sub(v),b=e.curve,w=Math.max(n.width,n.height),C=w/f,k=x.mag();if("minZoom"in e){var S=t.clamp(Math.min(e.minZoom,a,c),n.minZoom,n.maxZoom),M=w/n.zoomScale(S-a);b=Math.sqrt(M/k*2)}var E=b*b;function T(t){var e=(C*C-w*w+(t?-1:1)*E*E*k*k)/(2*(t?C:w)*E*k);return Math.log(Math.sqrt(e*e+1)-e)}function A(t){return(Math.exp(t)-Math.exp(-t))/2}function I(t){return(Math.exp(t)+Math.exp(-t))/2}var P=T(0),L=function(t){return I(P)/I(P+b*t)},z=function(t){return w*((I(P)*(A(e=P+b*t)/I(e))-A(P))/E)/k;var e},R=(T(1)-P)/b;if(Math.abs(k)<1e-6||!isFinite(R)){if(Math.abs(w-C)<1e-6)return this.easeTo(e,r);var D=C<w?-1:1;R=Math.abs(Math.log(C/w))/b,z=function(){return 0},L=function(t){return Math.exp(D*b*t)}}return e.duration="duration"in e?+e.duration:1e3*R/("screenSpeed"in e?+e.screenSpeed/b:+e.speed),e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=s!==u,this._pitching=h!==l,this._padding=!n.isPaddingEqual(d),this._prepareEase(r,!1),this._ease((function(e){var o=e*R,f=1/L(o);n.zoom=1===e?c:a+n.scaleZoom(f),i._rotating&&(n.bearing=t.number(s,u,e)),i._pitching&&(n.pitch=t.number(l,h,e)),i._padding&&(n.interpolatePadding(p,d,e),_=n.centerPoint.add(m));var y=1===e?g:n.unproject(v.add(x.mult(z(o))).mult(f));n.setLocationAtPoint(n.renderWorldCopies?y.wrap():y,_),i._fireMoveEvents(r)}),(function(){return i._afterEase(r)}),e),this},r.prototype.isEasing=function(){return!!this._easeFrameId},r.prototype.stop=function(){return this._stop()},r.prototype._stop=function(t,e){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,e)}if(!t){var i=this.handlers;i&&i.stop(!1)}return this},r.prototype._ease=function(e,r,i){!1===i.animate||0===i.duration?(e(1),r()):(this._easeStart=t.browser.now(),this._easeOptions=i,this._onEaseFrame=e,this._onEaseEnd=r,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},r.prototype._renderFrameCallback=function(){var e=Math.min((t.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},r.prototype._normalizeBearing=function(e,r){e=t.wrap(e,-180,180);var i=Math.abs(e-r);return Math.abs(e-360-r)<i&&(e-=360),Math.abs(e+360-r)<i&&(e+=360),e},r.prototype._normalizeCenter=function(t){var e=this.transform;if(e.renderWorldCopies&&!e.lngRange){var r=t.lng-e.center.lng;t.lng+=r>180?-360:r<-180?360:0}},r}(t.Evented),vo=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};vo.prototype.getDefaultPosition=function(){return"bottom-right"},vo.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=r.create("div","maplibregl-ctrl maplibregl-ctrl-attrib mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=r.create("button","maplibregl-ctrl-attrib-button mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._compactButton.type="button",this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=r.create("div","maplibregl-ctrl-attrib-inner mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),e&&this._container.classList.add("maplibregl-compact","mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===e&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},vo.prototype.onRemove=function(){r.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},vo.prototype._setElementTitle=function(t,e){var r=this._map._getUIString("AttributionControl."+e);t.title=r,t.setAttribute("aria-label",r)},vo.prototype._toggleAttribution=function(){this._container.classList.contains("maplibregl-compact-show")||this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("maplibregl-compact-show","mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","fal
1se")):(this._container.classList.add("maplibregl-compact-show","mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},vo.prototype._updateEditLink=function(){var e=this._editLink;e||(e=this._editLink=this._container.querySelector(".mapbox-improve-map"));var r=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||t.config.ACCESS_TOKEN}];if(e){var i=r.reduce((function(t,e,i){return e.value&&(t+=e.key+"="+e.value+(i<r.length-1?"&":"")),t}),"?");e.href=t.config.FEEDBACK_URL+"/"+i+(this._map._hash?this._map._hash.getHashString(!0):""),e.rel="noopener nofollow",this._setElementTitle(e,"MapFeedback")}},vo.prototype._updateData=function(t){!t||"metadata"!==t.sourceDataType&&"visibility"!==t.sourceDataType&&"style"!==t.dataType||(this._updateAttributions(),this._updateEditLink())},vo.prototype._updateAttributions=function(){if(this._map.style){var t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map((function(t){return"string"!=typeof t?"":t}))):"string"==typeof this.options.customAttribution&&t.push(this.options.customAttribution)),this._map.style.stylesheet){var e=this._map.style.stylesheet;this.styleOwner=e.owner,this.styleId=e.id}var r=this._map.style.sourceCaches;for(var i in r){var o=r[i];if(o.used){var n=o.getSource();n.attribution&&t.indexOf(n.attribution)<0&&t.push(n.attribution)}}t.sort((function(t,e){return t.length-e.length}));var a=(t=t.filter((function(e,r){for(var i=r+1;i<t.length;i++)if(t[i].indexOf(e)>=0)return!1;return!0}))).join(" | ");a!==this._attribHTML&&(this._attribHTML=a,t.length?(this._innerContainer.innerHTML=a,this._container.classList.remove("maplibregl-attrib-empty","mapboxgl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty","mapboxgl-attrib-empty"),this._editLink=null)}},vo.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("maplibregl-compact","mapboxgl-compact"):this._container.classList.remove("maplibregl-compact","maplibregl-compact-show","mapboxgl-compact","mapboxgl-compact-show")};var xo=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this)};xo.prototype.onAdd=function(t){this._map=t,this._container=r.create("div","maplibregl-ctrl mapboxgl-ctrl");var e=r.create("a","maplibregl-ctrl-logo mapboxgl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://maplibre.org/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},xo.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},xo.prototype.getDefaultPosition=function(){return"bottom-left"},xo.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},xo.prototype._logoRequired=function(){if(this._map.style){var t=this._map.style.sourceCaches;for(var e in t)if(t[e].getSource().mapbox_logo)return!0;return!1}},xo.prototype._updateCompact=function(){var t=this._container.children;if(t.length){var e=t[0];this._map.getCanvasContainer().offsetWidth<250?e.classList.add("maplibregl-compact","mapboxgl-compact"):e.classList.remove("maplibregl-compact","mapboxgl-compact")}};var bo=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};bo.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},bo.prototype.remove=function(t){for(var e=this._currentlyRunning,r=0,i=e?this._queue.concat(e):this._queue;r<i.length;r+=1){var o=i[r];if(o.id===t)return void(o.cancelled=!0)}},bo.prototype.run=function(t){void 0===t&&(t=0);var e=this._currentlyRunning=this._queue;this._queue=[];for(var r=0,i=e;r<i.length;r+=1){var o=i[r];if(!o.cancelled&&(o.callback(t),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1},bo.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]};var wo={"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"}
vendor: 17,052 bytes, line 1
1,Co=t.window.HTMLImageElement,ko=t.window.HTMLElement,So=t.window.ImageBitmap,Mo={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,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",transformRequest:null,accessToken:null,fadeDuration:300,crossSourceCollisions:!0},Eo=function(i){function o(e){var r=this;if(null!=(e=t.extend({},Mo,e)).minZoom&&null!=e.maxZoom&&e.minZoom>e.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=e.minPitch&&null!=e.maxPitch&&e.minPitch>e.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=e.minPitch&&e.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=e.maxPitch&&e.maxPitch>60)throw new Error("maxPitch must be less than or equal to 60");var o=new wi(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies);if(i.call(this,o,e),this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._antialias=e.antialias,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles,this._fadeDuration=e.fadeDuration,this._crossSourceCollisions=e.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=e.collectResourceTiming,this._renderTaskQueue=new bo,this._controls=[],this._mapId=t.uniqueId(),this._locale=t.extend({},wo,e.locale),this._clickTolerance=e.clickTolerance,this._requestManager=new t.RequestManager(e.transformRequest,e.accessToken),"string"==typeof e.container){if(this._container=t.window.document.getElementById(e.container),!this._container)throw new Error("Container '"+e.container+"' not found.")}else{if(!(e.container instanceof ko))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return r._update(!1)})),this.on("moveend",(function(){return r._update(!1)})),this.on("zoom",(function(){return r._update(!0)})),void 0!==t.window&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1),t.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new yo(this,e),this._hash=e.hash&&new ki("string"==typeof e.hash&&e.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),e.bounds&&(this.resize(),this.fitBounds(e.bounds,t.extend({},e.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=e.localIdeographFontFamily,e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new vo({customAttribution:e.customAttribution})),this.addControl(new xo,e.logoPosition),this.on("style.load",(function(){r.transform.unmodified&&r.jumpTo(r.style.stylesheet)})),this.on("data",(function(e){r._update("style"===e.dataType),r.fire(new t.Event(e.dataType+"data",e))})),this.on("dataloading",(function(e){r.fire(new t.Event(e.dataType+"dataloading",e))}))}i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o;var n={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return o.prototype._getMapId=function(){return this._mapId},o.prototype.addControl=function(e,r){if(void 0===r&&(r=e.getDefaultPosition?e.getDefaultPosition():"top-right"),!e||!e.onAdd)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var i=e.onAdd(this);this._controls.push(e);var o=this._controlPositions[r];return-1!==r.indexOf("bottom")?o.insertBefore(i,o.firstChild):o.appendChild(i),this},o.prototype.removeControl=function(e){if(!e||!e.onRemove)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var r=this._controls.indexOf(e);return r>-1&&this._controls.splice(r,1),e.onRemove(this),this},o.prototype.hasControl=function(t){return this._controls.indexOf(t)>-1},o.prototype.resize=function(e){var r=this._containerDimensions(),i=r[0],o=r[1];this._resizeCanvas(i,o),this.transform.resize(i,o),this.painter.resize(i,o);var n=!this._moving;return n&&(this.stop(),this.fire(new t.Event("movestart",e)).fire(new t.Event("move",e))),this.fire(new t.Event("resize",e)),n&&this.fire(new t.Event("moveend",e)),this},o.prototype.getBounds=function(){return this.transform.getBounds()},o.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},o.prototype.setMaxBounds=function(e){return this.transform.setMaxBounds(t.LngLatBounds.convert(e)),this._update()},o.prototype.setMinZoom=function(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()<t&&this.setZoom(t),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")},o.prototype.getMinZoom=function(){return this.transform.minZoom},o.prototype.setMaxZoom=function(t){if((t=null==t?22:t)>=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")},o.prototype.getMaxZoom=function(){return this.transform.maxZoom},o.prototype.setMinPitch=function(t){if((t=null==t?0:t)<0)throw new Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()<t&&this.setPitch(t),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")},o.prototype.getMinPitch=function(){return this.transform.minPitch},o.prototype.setMaxPitch=function(t){if((t=null==t?60:t)>60)throw new Error("maxPitch must be less than or equal to 60");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t&&this.setPitch(t),this;throw new Error("maxPitch must be greater than the current minPitch")},o.prototype.getMaxPitch=function(){return this.transform.maxPitch},o.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},o.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update()},o.prototype.project=function(e){return this.transform.locationPoint(t.LngLat.convert(e))},o.prototype.unproject=function(e){return this.transform.pointLocation(t.Point.convert(e))},o.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},o.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},o.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},o.prototype._createDelegatedListener=function(t,e,r){var i,o=this;if("mouseenter"===t||"mouseover"===t){var n=!1;return{layer:e,listener:r,delegates:{mousemove:function(i){var a=o.getLayer(e)?o.queryRenderedFeatures(i.point,{layers:[e]}):[];a.length?n||(n=!0,r.call(o,new zi(t,o,i.originalEvent,{features:a}))):n=!1},mouseout:function(){n=!1}}}}if("mouseleave"===t||"mouseout"===t){var a=!1;return{layer:e,listener:r,delegates:{mousemove:function(i){(o.getLayer(e)?o.queryRenderedFeatures(i.point,{layers:[e]}):[]).length?a=!0:a&&(a=!1,r.call(o,new zi(t,o,i.originalEvent)))},mouseout:function(e){a&&(a=!1,r.call(o,new zi(t,o,e.originalEvent)))}}}}return{layer:e,listener:r,delegates:(i={},i[t]=function(t){var i=o.getLayer(e)?o.queryRenderedFeatures(t.point,{layers:[e]}):[];i.length&&(t.features=i,r.call(o,t),delete t.features)},i)}},o.prototype.on=function(t,e,r){if(void 0===r)return i.prototype.on.call(this,t,e);var o=this._createDelegatedListener(t,e,r);for(var n in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(o),o.delegates)this.on(n,o.delegates[n]);return this},o.prototype.once=function(t,e,r){if(void 0===r)return i.prototype.once.call(this,t,e);var o=this._createDelegatedListener(t,e,r);for(var n in o.delegates)this.once(n,o.delegates[n]);return this},o.prototype.off=function(t,e,r){var o=this;return void 0===r?i.prototype.off.call(this,t,e):(this._delegatedListeners&&this._delegatedListeners[t]&&function(i){for(var n=i[t],a=0;a<n.length;a++){var s=n[a];if(s.layer===e&&s.listener===r){for(var l in s.delegates)o.off(l,s.delegates[l]);return n.splice(a,1),o}}}(this._delegatedListeners),this)},o.prototype.queryRenderedFeatures=function(e,r){if(!this.style)return[];var i;if(void 0!==r||void 0===e||e instanceof t.Point||Array.isArray(e)||(r=e,e=void 0),r=r||{},(e=e||[[0,0],[this.transform.width,this.transform.height]])instanceof t.Point||"number"==typeof e[0])i=[t.Point.convert(e)];else{var o=t.Point.convert(e[0]),n=t.Point.convert(e[1]);i=[o,new t.Point(n.x,o.y),n,new t.Point(o.x,n.y),o]}return this.style.queryRenderedFeatures(i,r,this.transform)},o.prototype.querySourceFeatures=function(t,e){return this.style.querySourceFeatures(t,e)},o.prototype.setStyle=function(e,r){return!1!==(r=t.extend({},{localIdeographFontFamily:this._localIdeographFontFamily},r)).diff&&r.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&e?(this._diffStyle(e,r),this):(this._localIdeographFontFamily=r.localIdeographFontFamily,this._updateStyle(e,r))},o.prototype.setTransformRequest=function(t){return this._requestManager.setTransformRequest(t),this},o.prototype._getUIString=function(t){var e=this._locale[t];if(null==e)throw new Error("Missing UI string '"+t+"'");return e},o.prototype._updateStyle=function(t,e){return this.style&&(this.style.setEventedParent(null),this.style._remove()),t?(this.style=new qe(this,e||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof t?this.style.loadURL(t):this.style.loadJSON(t),this):(delete this.style,this)},o.prototype._lazyInitEmptyStyle=function(){this.style||(this.style=new qe(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())},o.prototype._diffStyle=function(e,r){var i=this;if("string"==typeof e){var o=this._requestManager.normalizeStyleURL(e),n=this._requestManager.transformRequest(o,t.ResourceType.Style);t.getJSON(n,(function(e,o){e?i.fire(new t.ErrorEvent(e)):o&&i._updateDiff(o,r)}))}else"object"==typeof e&&this._updateDiff(e,r)},o.prototype._updateDiff=function(e,r){try{this.style.setState(e)&&this._update(!0)}catch(i){t.warnOnce("Unable to perform style diff: "+(i.message||i.error||i)+". Rebuilding the style from scratch."),this._updateStyle(e,r)}},o.prototype.getStyle=function(){if(this.style)return this.style.serialize()},o.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():t.warnOnce("There is no style added to the map.")},o.prototype.addSource=function(t,e){return this._lazyInitEmptyStyle(),this.style.addSource(t,e),this._update(!0)},o.prototype.isSourceLoaded=function(e){var r=this.style&&this.style.sourceCaches[e];if(void 0!==r)return r.loaded();this.fire(new t.ErrorEvent(new Error("There is no source with ID '"+e+"'")))},o.prototype.areTilesLoaded=function(){var t=this.style&&this.style.sourceCaches;for(var e in t){var r=t[e]._tiles;for(var i in r){var o=r[i];if("loaded"!==o.state&&"errored"!==o.state)return!1}}return!0},o.prototype.addSourceType=function(t,e,r){return this._lazyInitEmptyStyle(),this.style.addSourceType(t,e,r)},o.prototype.removeSource=function(t){return this.style.removeSource(t),this._update(!0)},o.prototype.getSource=function(t){return this.style.getSource(t)},o.prototype.addImage=function(e,r,i){void 0===i&&(i={});var o=i.pixelRatio;void 0===o&&(o=1);var n=i.sdf;void 0===n&&(n=!1);var a=i.stretchX,s=i.stretchY,l=i.content;if(this._lazyInitEmptyStyle(),r instanceof Co||So&&r instanceof So){var p=t.browser.getImageData(r);this.style.addImage(e,{data:new t.RGBAImage({width:p.width,height:p.height},p.data),pixelRatio:o,stretchX:a,stretchY:s,content:l,sdf:n,version:0})}else{if(void 0===r.width||void 0===r.height)return this.fire(new t.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));var c=r;this.style.addImage(e,{data:new t.RGBAImage({width:r.width,height:r.height},new Uint8Array(r.data)),pixelRatio:o,stretchX:a,stretchY:s,content:l,sdf:n,version:0,userImage:c}),c.onAdd&&c.onAdd(this,e)}},o.prototype.updateImage=function(e,r){var i=this.style.getImage(e);if(!i)return this.fire(new t.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));var o=r instanceof Co||So&&r instanceof So?t.browser.getImageData(r):r,n=o.width,a=o.height,s=o.data;return void 0===n||void 0===a?this.fire(new t.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`"))):n!==i.data.width||a!==i.data.height?this.fire(new t.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image"))):(i.data.replace(s,!(r instanceof Co||So&&r instanceof So)),void this.style.updateImage(e,i))},o.prototype.hasImage=function(e){return e?!!this.style.getImage(e):(this.fire(new t.ErrorEvent(new Error("Missing required image id"))),!1)},o.prototype.removeImage=function(t){this.style.removeImage(t)},o.prototype.loadImage=function(e,r){t.getImage(this._requestManager.transformRequest(e,t.ResourceType.Image),r)},o.prototype.listImages=function(){return this.style.listImages()},o.prototype.addLayer=function(t,e){return this._lazyInitEmptyStyle(),this.style.addLayer(t,e),this._update(!0)},o.prototype.moveLayer=function(t,e){return this.style.moveLayer(t,e),this._update(!0)},o.prototype.removeLayer=function(t){return this.style.removeLayer(t),this._update(!0)},o.prototype.getLayer=function(t){return this.style.getLayer(t)},o.prototype.setLayerZoomRange=function(t,e,r){return this.style.setLayerZoomRange(t,e,r),this._update(!0)},o.prototype.setFilter=function(t,e,r){return void 0===r&&(r={}),this.style.setFilter(t,e,r),this._update(!0)},o.prototype.getFilter=function(t){return this.style.getFilter(t)},o.prototype.setPaintProperty=function(t,e,r,i){return void 0===i&&(i={}),this.style.setPaintProperty(t,e,r,i),this._update(!0)},o.prototype.getPaintProperty=function(t,e){return this.style.getPaintProperty(t,e)},o.prototype.setLayoutProperty=function(t,e,r,i){return void 0===i&&(i={}),this.style.setLayoutProperty(t,e,r,i),this._update(!0)},o.prototype.getLayoutProperty=function(t,e){return this.style.getLayoutProperty(t,e)},o.prototype.setLight=function(t,e){return void 0===e&&(e={}),this._lazyInitEmptyStyle(),this.style.setLight(t,e),this._update(!0)},o.prototype.getLight=function(){return this.style.getLight()},o.prototype.setFeatureState=function(t,e){return this.style.setFeatureState(t,e),this._update()},o.prototype.removeFeatureState=function(t,e){return this.style.removeFeatureState(t,e),this._update()},o.prototype.getFeatureState=function(t){return this.style.getFeatureState(t)},o.prototype.getContainer=function(){return this._container},o.prototype.getCanvasContainer=function(){return this._canvasContainer},o.prototype.getCanvas=function(){return this._canvas},o.prototype._containerDimensions=function(){var t=0,e=0;return this._container&&(t=this._container.clientWidth||400,e=this._container.clientHeight||300),[t,e]},o.prototype._setupContainer=function(){var t=this._container;t.classList.add("maplibregl-map","mapboxgl-map");var e=this._canvasContainer=r.create("div","maplibregl-canvas-container mapboxgl-canvas-container",t);this._interactive&&e.classList.add("maplibregl-interactive","mapboxgl-interactive"),this._canvas=r.create("canvas","maplibregl-canvas mapboxgl-canvas",e),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","regi
1on");var i=this._containerDimensions();this._resizeCanvas(i[0],i[1]);var o=this._controlContainer=r.create("div","maplibregl-control-container mapboxgl-control-container",t),n=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((function(t){n[t]=r.create("div","maplibregl-ctrl-"+t+" mapboxgl-ctrl-"+t,o)})),this._container.addEventListener("scroll",this._onMapScroll,!1)},o.prototype._resizeCanvas=function(e,r){var i=t.browser.devicePixelRatio||1;this._canvas.width=i*e,this._canvas.height=i*r,this._canvas.style.width=e+"px",this._canvas.style.height=r+"px"},o.prototype._setupPainter=function(){var r=t.extend({},e.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 gi(i,this.transform),t.webpSupported.testSupport(i)):this.fire(new t.ErrorEvent(new Error("Failed to initialize WebGL")))},o.prototype._contextLost=function(e){e.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new t.Event("webglcontextlost",{originalEvent:e}))},o.prototype._contextRestored=function(e){this._setupPainter(),this.resize(),this._update(),this.fire(new t.Event("webglcontextrestored",{originalEvent:e}))},o.prototype._onMapScroll=function(t){if(t.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},o.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()},o.prototype._update=function(t){return this.style?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this.triggerRepaint(),this):this},o.prototype._requestRenderFrame=function(t){return this._update(),this._renderTaskQueue.add(t)},o.prototype._cancelRenderFrame=function(t){this._renderTaskQueue.remove(t)},o.prototype._render=function(e){var r,i=this,o=0,n=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(r=n.createQueryEXT(),n.beginQueryEXT(n.TIME_ELAPSED_EXT,r),o=t.browser.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(e),!this._removed){var a=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var s=this.transform.zoom,l=t.browser.now();this.style.zoomHistory.update(s,l);var p=new t.EvaluationParameters(s,{now:l,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),c=p.crossFadingFactor();1===c&&c===this._crossFadingFactor||(a=!0,this._crossFadingFactor=c),this.style.update(p)}if(this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:this._fadeDuration,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer")}),this.fire(new t.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new t.Event("load"))),this.style&&(this.style.hasTransitions()||a)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){var u=t.browser.now()-o;n.endQueryEXT(n.TIME_ELAPSED_EXT,r),setTimeout((function(){var e=n.getQueryObjectEXT(r,n.QUERY_RESULT_EXT)/1e6;n.deleteQueryEXT(r),i.fire(new t.Event("gpu-timing-frame",{cpuTime:u,gpuTime:e}))}),50)}if(this.listens("gpu-timing-layer")){var h=this.painter.collectGpuTimers();setTimeout((function(){var e=i.painter.queryGpuTimers(h);i.fire(new t.Event("gpu-timing-layer",{layerTimes:e}))}),50)}var d=this._sourcesDirty||this._styleDirty||this._placementDirty;return d||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new t.Event("idle")),!this._loaded||this._fullyLoaded||d||(this._fullyLoaded=!0),this}},o.prototype.remove=function(){this._hash&&this._hash.remove();for(var e=0,r=this._controls;e<r.length;e+=1)r[e].onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),void 0!==t.window&&(t.window.removeEventListener("resize",this._onWindowResize,!1),t.window.removeEventListener("orientationchange",this._onWindowResize,!1),t.window.removeEventListener("online",this._onWindowOnline,!1));var i=this.painter.context.gl.getExtension("WEBGL_lose_context");i&&i.loseContext(),To(this._canvasContainer),To(this._controlContainer),this._container.classList.remove("maplibregl-map","mapboxgl-map"),this._removed=!0,this.fire(new t.Event("remove"))},o.prototype.triggerRepaint=function(){var e=this;this.style&&!this._frame&&(this._frame=t.browser.frame((function(t){e._frame=null,e._render(t)})))},o.prototype._onWindowOnline=function(){this._update()},o.prototype._onWindowResize=function(t){this._trackResize&&this.resize({originalEvent:t})._update()},n.showTileBoundaries.get=function(){return!!this._showTileBoundaries},n.showTileBoundaries.set=function(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())},n.showPadding.get=function(){return!!this._showPadding},n.showPadding.set=function(t){this._showPadding!==t&&(this._showPadding=t,this._update())},n.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},n.showCollisionBoxes.set=function(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,t?this.style._generateCollisionBoxes():this._update())},n.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},n.showOverdrawInspector.set=function(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())},n.repaint.get=function(){return!!this._repaint},n.repaint.set=function(t){this._repaint!==t&&(this._repaint=t,this.triggerRepaint())},n.vertices.get=function(){return!!this._vertices}
vendor: 18,488 bytes, line 1
1,n.vertices.set=function(t){this._vertices=t,this._update()},o.prototype._setCacheLimits=function(e,r){t.setCacheLimits(e,r)},n.version.get=function(){return t.version},Object.defineProperties(o.prototype,n),o}(go);function To(t){t.parentNode&&t.parentNode.removeChild(t)}var Ao={showCompass:!0,showZoom:!0,visualizePitch:!1},Io=function(e){var i=this;this.options=t.extend({},Ao,e),this._container=r.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this.options.showZoom&&(t.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in mapboxgl-ctrl-zoom-in",(function(t){return i._map.zoomIn({},{originalEvent:t})})),r.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden",!0),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out mapboxgl-ctrl-zoom-out",(function(t){return i._map.zoomOut({},{originalEvent:t})})),r.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden",!0)),this.options.showCompass&&(t.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("maplibregl-ctrl-compass mapboxgl-ctrl-compass",(function(t){i.options.visualizePitch?i._map.resetNorthPitch({},{originalEvent:t}):i._map.resetNorth({},{originalEvent:t})})),this._compassIcon=r.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden",!0))};Io.prototype._updateZoomButtons=function(){var t=this._map.getZoom(),e=t===this._map.getMaxZoom(),r=t===this._map.getMinZoom();this._zoomInButton.disabled=e,this._zoomOutButton.disabled=r,this._zoomInButton.setAttribute("aria-disabled",e.toString()),this._zoomOutButton.setAttribute("aria-disabled",r.toString())},Io.prototype._rotateCompassArrow=function(){var t=this.options.visualizePitch?"scale("+1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)+") rotateX("+this._map.transform.pitch+"deg) rotateZ("+this._map.transform.angle*(180/Math.PI)+"deg)":"rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassIcon.style.transform=t},Io.prototype.onAdd=function(t){return this._map=t,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Po(this._map,this._compass,this.options.visualizePitch)),this._container},Io.prototype.onRemove=function(){r.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map},Io.prototype._createButton=function(t,e){var i=r.create("button",t,this._container);return i.type="button",i.addEventListener("click",e),i},Io.prototype._setButtonTitle=function(t,e){var r=this._map._getUIString("NavigationControl."+e);t.title=r,t.setAttribute("aria-label",r)};var Po=function(e,i,o){void 0===o&&(o=!1),this._clickTolerance=10,this.element=i,this.mouseRotate=new Zi({clickTolerance:e.dragRotate._mouseRotate._clickTolerance}),this.map=e,o&&(this.mousePitch=new Gi({clickTolerance:e.dragRotate._mousePitch._clickTolerance})),t.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),r.addEventListener(i,"mousedown",this.mousedown),r.addEventListener(i,"touchstart",this.touchstart,{passive:!1}),r.addEventListener(i,"touchmove",this.touchmove),r.addEventListener(i,"touchend",this.touchend),r.addEventListener(i,"touchcancel",this.reset)};function Lo(e,r,i){if(e=new t.LngLat(e.lng,e.lat),r){var o=new t.LngLat(e.lng-360,e.lat),n=new t.LngLat(e.lng+360,e.lat),a=i.locationPoint(e).distSqr(r);i.locationPoint(o).distSqr(r)<a?e=o:i.locationPoint(n).distSqr(r)<a&&(e=n)}for(;Math.abs(e.lng-i.center.lng)>180;){var s=i.locationPoint(e);if(s.x>=0&&s.y>=0&&s.x<=i.width&&s.y<=i.height)break;e.lng>i.center.lng?e.lng-=360:e.lng+=360}return e}Po.prototype.down=function(t,e){this.mouseRotate.mousedown(t,e),this.mousePitch&&this.mousePitch.mousedown(t,e),r.disableDrag()},Po.prototype.move=function(t,e){var r=this.map,i=this.mouseRotate.mousemoveWindow(t,e);if(i&&i.bearingDelta&&r.setBearing(r.getBearing()+i.bearingDelta),this.mousePitch){var o=this.mousePitch.mousemoveWindow(t,e);o&&o.pitchDelta&&r.setPitch(r.getPitch()+o.pitchDelta)}},Po.prototype.off=function(){var t=this.element;r.removeEventListener(t,"mousedown",this.mousedown),r.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),r.removeEventListener(t,"touchmove",this.touchmove),r.removeEventListener(t,"touchend",this.touchend),r.removeEventListener(t,"touchcancel",this.reset),this.offTemp()},Po.prototype.offTemp=function(){r.enableDrag(),r.removeEventListener(t.window,"mousemove",this.mousemove),r.removeEventListener(t.window,"mouseup",this.mouseup)},Po.prototype.mousedown=function(e){this.down(t.extend({},e,{ctrlKey:!0,preventDefault:function(){return e.preventDefault()}}),r.mousePos(this.element,e)),r.addEventListener(t.window,"mousemove",this.mousemove),r.addEventListener(t.window,"mouseup",this.mouseup)},Po.prototype.mousemove=function(t){this.move(t,r.mousePos(this.element,t))},Po.prototype.mouseup=function(t){this.mouseRotate.mouseupWindow(t),this.mousePitch&&this.mousePitch.mouseupWindow(t),this.offTemp()},Po.prototype.touchstart=function(t){1!==t.targetTouches.length?this.reset():(this._startPos=this._lastPos=r.touchPos(this.element,t.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return t.preventDefault()}},this._startPos))},Po.prototype.touchmove=function(t){1!==t.targetTouches.length?this.reset():(this._lastPos=r.touchPos(this.element,t.targetTouches)[0],this.move({preventDefault:function(){return t.preventDefault()}},this._lastPos))},Po.prototype.touchend=function(t){0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()},Po.prototype.reset=function(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()};var zo={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 Ro(t,e,r){var i=t.classList;for(var o in zo)i.remove("maplibregl-"+r+"-anchor-"+o,"mapboxgl-"+r+"-anchor-"+o);i.add("maplibregl-"+r+"-anchor-"+e,"mapboxgl-"+r+"-anchor-"+e)}var Do,Oo=function(e){function i(i,o){if(e.call(this),(i instanceof t.window.HTMLElement||o)&&(i=t.extend({element:i},o)),t.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=i&&i.anchor||"center",this._color=i&&i.color||"#3FB1CE",this._scale=i&&i.scale||1,this._draggable=i&&i.draggable||!1,this._clickTolerance=i&&i.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=i&&i.rotation||0,this._rotationAlignment=i&&i.rotationAlignment||"auto",this._pitchAlignment=i&&i.pitchAlignment&&"auto"!==i.pitchAlignment?i.pitchAlignment:this._rotationAlignment,i&&i.element)this._element=i.element,this._offset=t.Point.convert(i&&i.offset||[0,0]);else{this._defaultMarker=!0,this._element=r.create("div"),this._element.setAttribute("aria-label","Map marker");var n=r.createNS("http://www.w3.org/2000/svg","svg");n.setAttributeNS(null,"display","block"),n.setAttributeNS(null,"height","41px"),n.setAttributeNS(null,"width","27px"),n.setAttributeNS(null,"viewBox","0 0 27 41");var a=r.createNS("http://www.w3.org/2000/svg","g");a.setAttributeNS(null,"stroke","none"),a.setAttributeNS(null,"stroke-width","1"),a.setAttributeNS(null,"fill","none"),a.setAttributeNS(null,"fill-rule","evenodd");var s=r.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"fill-rule","nonzero");var l=r.createNS("http://www.w3.org/2000/svg","g");l.setAttributeNS(null,"transform","translate(3.0, 29.0)"),l.setAttributeNS(null,"fill","#000000");for(var p=0,c=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];p<c.length;p+=1){var u=c[p],h=r.createNS("http://www.w3.org/2000/svg","ellipse");h.setAttributeNS(null,"opacity","0.04"),h.setAttributeNS(null,"cx","10.5"),h.setAttributeNS(null,"cy","5.80029008"),h.setAttributeNS(null,"rx",u.rx),h.setAttributeNS(null,"ry",u.ry),l.appendChild(h)}var d=r.createNS("http://www.w3.org/2000/svg","g");d.setAttributeNS(null,"fill",this._color);var f=r.createNS("http://www.w3.org/2000/svg","path");f.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),d.appendChild(f);var m=r.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"opacity","0.25"),m.setAttributeNS(null,"fill","#000000");var _=r.createNS("http://www.w3.org/2000/svg","path");_.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),m.appendChild(_);var y=r.createNS("http://www.w3.org/2000/svg","g");y.setAttributeNS(null,"transform","translate(6.0, 7.0)"),y.setAttributeNS(null,"fill","#FFFFFF");var g=r.createNS("http://www.w3.org/2000/svg","g");g.setAttributeNS(null,"transform","translate(8.0, 8.0)");var v=r.createNS("http://www.w3.org/2000/svg","circle");v.setAttributeNS(null,"fill","#000000"),v.setAttributeNS(null,"opacity","0.25"),v.setAttributeNS(null,"cx","5.5"),v.setAttributeNS(null,"cy","5.5"),v.setAttributeNS(null,"r","5.4999962");var x=r.createNS("http://www.w3.org/2000/svg","circle");x.setAttributeNS(null,"fill","#FFFFFF"),x.setAttributeNS(null,"cx","5.5"),x.setAttributeNS(null,"cy","5.5"),x.setAttributeNS(null,"r","5.4999962"),g.appendChild(v),g.appendChild(x),s.appendChild(l),s.appendChild(d),s.appendChild(m),s.appendChild(y),s.appendChild(g),n.appendChild(s),n.setAttributeNS(null,"height",41*this._scale+"px"),n.setAttributeNS(null,"width",27*this._scale+"px"),this._element.appendChild(n),this._offset=t.Point.convert(i&&i.offset||[0,-14])}this._element.classList.add("maplibregl-marker","mapboxgl-marker"),this._element.addEventListener("dragstart",(function(t){t.preventDefault()})),this._element.addEventListener("mousedown",(function(t){t.preventDefault()})),Ro(this._element,this._anchor,"marker"),this._popup=null}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.addTo=function(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this},i.prototype.remove=function(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),r.remove(this._element),this._popup&&this._popup.remove(),this},i.prototype.getLngLat=function(){return this._lngLat},i.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},i.prototype.getElement=function(){return this._element},i.prototype.setPopup=function(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){var e=Math.sqrt(Math.pow(13.5,2)/2);t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[e,-1*(24.6+e)],"bottom-right":[-e,-1*(24.6+e)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=t,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this},i.prototype._onKeyPress=function(t){var e=t.code,r=t.charCode||t.keyCode;"Space"!==e&&"Enter"!==e&&32!==r&&13!==r||this.togglePopup()},i.prototype._onMapClick=function(t){var e=t.originalEvent.target,r=this._element;this._popup&&(e===r||r.contains(e))&&this.togglePopup()},i.prototype.getPopup=function(){return this._popup},i.prototype.togglePopup=function(){var t=this._popup;return t?(t.isOpen()?t.remove():t.addTo(this._map),this):this},i.prototype._update=function(t){if(this._map){this._map.transform.renderWorldCopies&&(this._lngLat=Lo(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);var e="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?e="rotateZ("+this._rotation+"deg)":"map"===this._rotationAlignment&&(e="rotateZ("+(this._rotation-this._map.getBearing())+"deg)");var i="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?i="rotateX(0deg)":"map"===this._pitchAlignment&&(i="rotateX("+this._map.getPitch()+"deg)"),t&&"moveend"!==t.type||(this._pos=this._pos.round()),r.setTransform(this._element,zo[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px) "+i+" "+e)}},i.prototype.getOffset=function(){return this._offset},i.prototype.setOffset=function(e){return this._offset=t.Point.convert(e),this._update(),this},i.prototype._onMove=function(e){if(!this._isDragging){var r=this._clickTolerance||this._map._clickTolerance;this._isDragging=e.point.dist(this._pointerdownPos)>=r}this._isDragging&&(this._pos=e.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new t.Event("dragstart"))),this.fire(new t.Event("drag")))},i.prototype._onUp=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 t.Event("dragend")),this._state="inactive"},i.prototype._addDragHandler=function(t){this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._pointerdownPos=t.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))},i.prototype.setDraggable=function(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},i.prototype.isDraggable=function(){return this._draggable},i.prototype.setRotation=function(t){return this._rotation=t||0,this._update(),this},i.prototype.getRotation=function(){return this._rotation},i.prototype.setRotationAlignment=function(t){return this._rotationAlignment=t||"auto",this._update(),this},i.prototype.getRotationAlignment=function(){return this._rotationAlignment},i.prototype.setPitchAlignment=function(t){return this._pitchAlignment=t&&"auto"!==t?t:this._rotationAlignment,this._update(),this},i.prototype.getPitchAlignment=function(){return this._pitchAlignment},i}(t.Evented),Fo={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Bo=0,jo=!1,No=function(e){function i(r){e.call(this),this.options=t.extend({},Fo,r),t.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.onAdd=function(e){var i;return this._map=e,this._container=r.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),i=this._setupUI,void 0!==Do?i(Do):void 0!==t.window.navigator.permissions?t.window.navigator.permissions.query({name:"geolocation"}).then((function(t){i(Do="denied"!==t.state)})):i(Do=!!t.window.navigator.geolocation),this._container},i.prototype.onRemove=function(){void 0!==this._geolocationWatchID&&(t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),r.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Bo=0,jo=!1},i.prototype._isOutOfMapMaxBounds=function(t){var e=this._map.getMaxBounds(),r=t.coords;return e&&(r.longitude<e.getWest()||r.longitude>e.getEast()||r.latitude<e.getSouth()||r.latitude>e.getNorth())},i.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_E
1RROR",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")}},i.prototype._onSuccess=function(e){if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new t.Event("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("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")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(e),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale","mapboxgl-user-location-dot-stale"),this.fire(new t.Event("geolocate",e)),this._finish()}},i.prototype._updateCamera=function(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude),i=e.coords.accuracy,o=this._map.getBearing(),n=t.extend({bearing:o},this.options.fitBoundsOptions);this._map.fitBounds(r.toBounds(i),n,{geolocateSource:!0})},i.prototype._updateMarker=function(e){if(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},i.prototype._updateCircleRadius=function(){var t=this._map._container.clientHeight/2,e=this._map.unproject([0,t]),r=this._map.unproject([1,t]),i=e.distanceTo(r),o=Math.ceil(2*this._accuracy/i);this._circleElement.style.width=o+"px",this._circleElement.style.height=o+"px"},i.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},i.prototype._onError=function(e){if(this._map){if(this.options.trackUserLocation)if(1===e.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===e.code&&jo)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 t.Event("error",e)),this._finish()}},i.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},i.prototype._setupUI=function(e){var i=this;if(this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this._geolocateButton=r.create("button","maplibregl-ctrl-geolocate mapboxgl-ctrl-geolocate",this._container),r.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",!1===e){t.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var o=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=o,this._geolocateButton.setAttribute("aria-label",o)}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","fal
1se"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=r.create("div","maplibregl-user-location-dot mapboxgl-user-location-dot"),this._userLocationDotMarker=new Oo(this._dotElement),this._circleElement=r.create("div","maplibregl-user-location-accuracy-circle mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Oo({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(function(e){e.geolocateSource||"ACTIVE_LOCK"!==i._watchState||e.originalEvent&&"resize"===e.originalEvent.type||(i._watchState="BACKGROUND",i._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),i._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),i.fire(new t.Event("trackuserlocationend")))}))},i.prototype.trigger=function(){if(!this._setup)return t.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new t.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Bo--,jo=!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 t.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 t.Event("trackuserlocationstart"))}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"ACTIVE_ERROR":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){var e;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++Bo>1?(e={maximumAge:6e5,timeout:0},jo=!0):(e=this.options.positionOptions,jo=!1),this._geolocationWatchID=t.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,e)}}else t.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},i.prototype._clearWatch=function(){t.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","fal
1se"),this.options.showUserLocation&&this._updateMarker(null)},i}(t.Evented),Uo={maxWidth:100,unit:"metric"},Vo=function(e){this.options=t.extend({},Uo,e),t.bindAll(["_onMove","setUnit"],this)};function qo(t,e,r){var i=r&&r.maxWidth||100,o=t._container.clientHeight/2,n=t.unproject([0,o]),a=t.unproject([i,o]),s=n.distanceTo(a);if(r&&"imperial"===r.unit){var l=3.2808*s;l>5280?$o(e,i,l/5280,t._getUIString("ScaleControl.Miles")):$o(e,i,l,t._getUIString("ScaleControl.Feet"))}else r&&"nautical"===r.unit?$o(e,i,s/1852,t._getUIString("ScaleControl.NauticalMiles")):s>=1e3?$o(e,i,s/1e3,t._getUIString("ScaleControl.Kilometers")):$o(e,i,s,t._getUIString("ScaleControl.Meters"))}function $o(t,e,r,i){var o,n,a,s=(o=r,(n=Math.pow(10,(""+Math.floor(o)).length-1))*(a=(a=o/n)>=10?10:a>=5?5:a>=3?3:a>=2?2:a>=1?1:function(t){var e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(a)));t.style.width=e*(s/r)+"px",t.innerHTML=s+" "+i}Vo.prototype.getDefaultPosition=function(){return"bottom-left"},Vo.prototype._onMove=function(){qo(this._map,this._container,this.options)},Vo.prototype.onAdd=function(t){return this._map=t,this._container=r.create("div","maplibregl-ctrl maplibregl-ctrl-scale mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},Vo.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},Vo.prototype.setUnit=function(t){this.options.unit=t,qo(this._map,this._container,this.options)};var Ho=function(e){this._fullscreen=!1,e&&e.container&&(e.container instanceof t.window.HTMLElement?this._container=e.container:t.warnOnce("Full screen control 'container' must be a DOM element.")),t.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in t.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in t.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in t.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in t.window.document&&(this._fullscreenchange="MSFullscreenChange")};Ho.prototype.onAdd=function(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},Ho.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Ho.prototype._checkFullscreenSupport=function(){return!!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},Ho.prototype._setupUI=function(){var e=this._fullscreenButton=r.create("button","maplibregl-ctrl-fullscreen mapboxgl-ctrl-fullscreen",this._controlContainer);r.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",e).setAttribute("aria-hidden",!0),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},Ho.prototype._updateTitle=function(){var t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t},Ho.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Ho.prototype._isFullscreen=function(){return this._fullscreen},Ho.prototype._changeIcon=function(){(t.window.document.fullscreenElement||t.window.document.mozFullScreenElement||t.window.document.webkitFullscreenElement||t.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("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())},Ho.prototype._onClickFullscreen=function(){this._isFullscreen()?t.window.document.exitFullscreen?t.window.document.exitFullscreen():t.window.document.mozCancelFullScreen?t.window.document.mozCancelFullScreen():t.window.document.msExitFullscreen?t.window.document.msExitFullscreen():t.window.document.webkitCancelFullScreen&&t.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var Zo={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"}
vendor: 7,283 bytes, line 1
1,Go=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),Qo=function(e){function i(r){e.call(this),this.options=t.extend(Object.create(Zo),r),t.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.addTo=function(e){return this._map&&this.remove(),this._map=e,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._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 t.Event("open")),this},i.prototype.isOpen=function(){return!!this._map},i.prototype.remove=function(){return this._content&&r.remove(this._content),this._container&&(r.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("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 t.Event("close")),this},i.prototype.getLngLat=function(){return this._lngLat},i.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._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},i.prototype.trackPointer=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},i.prototype.getElement=function(){return this._container},i.prototype.setText=function(e){return this.setDOMContent(t.window.document.createTextNode(e))},i.prototype.setHTML=function(e){var r,i=t.window.document.createDocumentFragment(),o=t.window.document.createElement("body");for(o.innerHTML=e;r=o.firstChild;)i.appendChild(r);return this.setDOMContent(i)},i.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},i.prototype.setMaxWidth=function(t){return this.options.maxWidth=t,this._update(),this},i.prototype.setDOMContent=function(t){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=r.create("div","maplibregl-popup-content mapboxgl-popup-content",this._container);return this._content.appendChild(t),this._createCloseButton(),this._update(),this._focusFirstElement(),this},i.prototype.addClassName=function(t){this._container&&this._container.classList.add(t)},i.prototype.removeClassName=function(t){this._container&&this._container.classList.remove(t)},i.prototype.setOffset=function(t){return this.options.offset=t,this._update(),this},i.prototype.toggleClassName=function(t){if(this._container)return this._container.classList.toggle(t)},i.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=r.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))},i.prototype._onMouseUp=function(t){this._update(t.point)},i.prototype._onMouseMove=function(t){this._update(t.point)},i.prototype._onDrag=function(t){this._update(t.point)},i.prototype._update=function(e){var i=this;if(this._map&&(this._lngLat||this._trackPointer)&&this._content&&(this._container||(this._container=r.create("div","maplibregl-popup mapboxgl-popup",this._map.getContainer()),this._tip=r.create("div","maplibregl-popup-tip mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(t){return i._container.classList.add(t)})),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=Lo(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||e)){var o=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat),n=this.options.anchor,a=function e(r){if(r){if("number"==typeof r){var i=Math.round(Math.sqrt(.5*Math.pow(r,2)));return{center:new t.Point(0,0),top:new t.Point(0,r),"top-left":new t.Point(i,i),"top-right":new t.Point(-i,i),bottom:new t.Point(0,-r),"bottom-left":new t.Point(i,-i),"bottom-right":new t.Point(-i,-i),left:new t.Point(r,0),right:new t.Point(-r,0)}}if(r instanceof t.Point||Array.isArray(r)){var o=t.Point.convert(r);return{center:o,top:o,"top-left":o,"top-right":o,bottom:o,"bottom-left":o,"bottom-right":o,left:o,right:o}}return{center:t.Point.convert(r.center||[0,0]),top:t.Point.convert(r.top||[0,0]),"top-left":t.Point.convert(r["top-left"]||[0,0]),"top-right":t.Point.convert(r["top-right"]||[0,0]),bottom:t.Point.convert(r.bottom||[0,0]),"bottom-left":t.Point.convert(r["bottom-left"]||[0,0]),"bottom-right":t.Point.convert(r["bottom-right"]||[0,0]),left:t.Point.convert(r.left||[0,0]),right:t.Point.convert(r.right||[0,0])}}return e(new t.Point(0,0))}(this.options.offset);if(!n){var s,l=this._container.offsetWidth,p=this._container.offsetHeight;s=o.y+a.bottom.y<p?["top"]:o.y>this._map.transform.height-p?["bottom"]:[],o.x<l/2?s.push("left"):o.x>this._map.transform.width-l/2&&s.push("right"),n=0===s.length?"bottom":s.join("-")}var c=o.add(a[n]).round();r.setTransform(this._container,zo[n]+" translate("+c.x+"px,"+c.y+"px)"),Ro(this._container,n,"popup")}},i.prototype._focusFirstElement=function(){if(this.options.focusAfterOpen&&this._container){var t=this._container.querySelector(Go);t&&t.focus()}},i.prototype._onClose=function(){this.remove()},i}(t.Evented),Xo={version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:Eo,NavigationControl:Io,GeolocateControl:No,AttributionControl:vo,ScaleControl:Vo,FullscreenControl:Ho,Popup:Qo,Marker:Oo,Style:qe,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,Evented:t.
1Evented,config:t.config,prewarm:function(){Bt().acquire(Rt)},clearPrewarmedResources:function(){var t=Ot;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(Rt),Ot=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 accessToken(){return t.config.ACCESS_TOKEN},set accessToken(e){t.config.ACCESS_TOKEN=e},get baseApiUrl(){return t.config.API_URL},set baseApiUrl(e){t.config.API_URL=e},get workerCount(){return Dt.workerCount},set workerCount(t){Dt.workerCount=t},get maxParallelImageRequests(){return t.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(e){t.config.MAX_PARALLEL_IMAGE_REQUESTS=e},clearStorage:function(e){t.clearTileCache(e)},workerUrl:"",addProtocol:function(e,r){t.config.REGISTERED_PROTOCOLS[e]=r},removeProtocol:function(e){delete t.config.REGISTERED_PROTOCOLS[e]}};return Xo}));return r}));!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).DOMPurify=e()}(this,(function(){"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function e(t,r){return e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},e(t,r)}function r(t,i,o){return r=function(){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(t){return!1}}()?Reflect.construct:function(t,r,i){var o=[null];o.push.apply(o,r);var n=new(Function.bind.apply(t,o));return i&&e(n,i.prototype),n},r.apply(null,arguments)}function i(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var i,o,n=[],a=!0,s=!1;try{for(r=r.call(t);!(a=(i=r.next()).done)&&(n.push(i.value),!e||n.length!==e);a=!0);}catch(t){s=!0,o=t}finally{try{a||null==r.return||r.return()}finally{if(s)throw o}}return n}}(t,e)||n(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t){return function(t){if(Array.isArray(t))return a(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||n(t)||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 n(t,e){if(t){if("string"==typeof t)return a(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(t,e):void 0}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}var s=Object.entries,l=Object.setPrototypeOf,p=Object.isFrozen,c=Object.getPrototypeOf,u=Object.getOwnPropertyDescriptor,h=Object.freeze,d=Object.seal,f=Object.create,m="undefined"!=typeof Reflect&&Reflect,_=m.apply,y=m.construct;_||(_=function(t,e,r){return t.apply(e,r)}),h||(h=function(t){return t}),d||(d=function(t){return t}),y||(y=function(t,e){return r(t,o(e))});var g,v=I(Array.prototype.forEach),x=I(Array.prototype.pop),b=I(Array.prototype.push),w=I(String.prototype.toLowerCase),C=I(String.prototype.toString),k=I(String.prototype.match),S=I(String.prototype.replace),M=I(String.prototype.indexOf),E=I(String.prototype.trim),T=I(RegExp.prototype.test),A=(g=TypeError,function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return y(g,e)});function I(t){return function(e){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return _(t,e,i)}}function P(t,e,r){r=r||w,l&&l(t,null);for(var i=e.length;i--;){var o=e[i];if("string"==typeof o){var n=r(o);n!==o&&(p(e)||(e[i]=n),o=n)}t[o]=!0}return t}function L(t){var e,r=f(null),o=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=n(t))){r&&(t=r);var i=0,o=function(){};return{s:o,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,l=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){l=!0,a=t}
1,f:function(){try{s||null==r.return||r.return()}finally{if(l)throw a}}}}(s(t));try{for(o.s();!(e=o.n()).done;){var a=i(e.value,2),l=a[0],p=a[1];r[l]=p}}catch(t){o.e(t)}finally{o.f()}return r}function z(t,e){for(;null!==t;){var r=u(t,e);if(r){if(r.get)return I(r.get);if("function"==typeof r.value)return I(r.value)}t=c(t)}return function(t){return console.warn("fallback value for",t),null}}var R=h(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),D=h(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),O=h(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),F=h(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),B=h(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),j=h(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),N=h(["#text"]),U=h(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),V=h(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),q=h(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","
1subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),$=h(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),H=d(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Z=d(/<%[\w\W]*|[\w\W]*%>/gm),G=d(/\${[\w\W]*}/gm),Q=d(/^data-[\-\w.\u00B7-\uFFFF]/),X=d(/^aria-[\-\w]+$/),W=d(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),K=d(/^(?:\w+script|data):/i),J=d(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Y=d(/^html$/i),tt=function e(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"undefined"==typeof window?null:window,i=function(t){return e(t)};if(i.version="3.0.0",i.removed=[],!r||!r.document||9!==r.document.nodeType)return i.isSupported=!1,i;var n=r.document,a=r.document,l=r.DocumentFragment,p=r.HTMLTemplateElement,c=r.Node,u=r.Element,d=r.NodeFilter,f=r.NamedNodeMap,m=void 0===f?r.NamedNodeMap||r.MozNamedAttrMap:f,_=r.HTMLFormElement,y=r.DOMParser,g=r.trustedTypes,I=u.prototype,tt=z(I,"cloneNode"),et=z(I,"nextSibling"),rt=z(I,"childNodes"),it=z(I,"parentNode");if("function"==typeof p){var ot=a.createElement("template");ot.content&&ot.content.ownerDocument&&(a=ot.content.ownerDocument)}var nt=function(e,r){if("object"!==t(e)||"function"!=typeof e.createPolicy)return null;var i=null,o="data-tt-policy-suffix";r.currentScript&&r.currentScript.hasAttribute(o)&&(i=r.currentScript.getAttribute(o));var n="dompurify"+(i?"#"+i:"");try{return e.createPolicy(n,{createHTML:function(t){return t},createScriptURL:function(t){return t}})}catch(t){return console.warn("TrustedTypes policy "+n+" could not be created."),null}}(g,n),at=nt?nt.createHTML(""):"",st=a,lt=st.implementation,pt=st.createNodeIterator,ct=st.createDocumentFragment,ut=st.getElementsByTagName,ht=n.importNode,dt={};i.isSupported="function"==typeof s&&"function"==typeof it&<&&void 0!==lt.createHTMLDocument;var ft,mt,_t=H,yt=Z,gt=G,vt=Q,xt=X,bt=K,wt=J,Ct=W,kt=null,St=P({},[].concat(o(R),o(D),o(O),o(B),o(N))),Mt=null,Et=P({},[].concat(o(U),o(V),o(q),o($))),Tt=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),At=null,It=null,Pt=!0,Lt=!0,zt=!1,Rt=!0,Dt=!1,Ot=!1,Ft=!1,Bt=!1,jt=!1,Nt=!1,Ut=!1,Vt=!0,qt=!1,$t=!0,Ht=!1,Zt={},Gt=null,Qt=P({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Xt=null,Wt=P({},["audio","video","img","source","image","track"]),Kt=null,Jt=P({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Yt="http://www.w3.org/1998/Math/MathML",te="http://www.w3.org/2000/svg",ee="http://www.w3.org/1999/xhtml",re=ee,ie=!1,oe=null,ne=P({},[Yt,te,ee],C),ae=["application/xhtml+xml","text/html"],se=null,le=a.createElement("form"),pe=function(t){return t instanceof RegExp||t instanceof Function},ce=function(e){se&&se===e||(e&&"object"===t(e)||(e={}),e=L(e),ft=ft=-1===ae.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,mt="application/xhtml+xml"===ft?C:w,kt="ALLOWED_TAGS"in e?P({},e.ALLOWED_TAGS,mt):St,Mt="ALLOWED_ATTR"in e?P({},e.ALLOWED_ATTR,mt):Et,oe="ALLOWED_NAMESPACES"in e?P({},e.ALLOWED_NAMESPACES,C):ne,Kt="ADD_URI_SAFE_ATTR"in e?P(L(Jt),e.ADD_URI_SAFE_ATTR,mt):Jt,Xt="ADD_DATA_URI_TAGS"in e?P(L(Wt),e.ADD_DATA_URI_TAGS,mt):Wt,Gt="FORBID_CONTENTS"in e?P({},e.FORBID_CONTENTS,mt):Qt,At="FORBID_TAGS"in e?P({},e.FORBID_TAGS,mt):{},It="FORBID_ATTR"in e?P({},e.FORBID_ATTR,mt):{},Zt="USE_PROFILES"in e&&e.USE_PROFILES,Pt=!1!==e.ALLOW_ARIA_ATTR,Lt=!1!==e.ALLOW_DATA_ATTR,zt=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Rt=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Dt=e.SAFE_FOR_TEMPLATES||!1,Ot=e.WHOLE_DOCUMENT||!1,jt=e.RETURN_DOM||!1,Nt=e.RETURN_DOM_FRAGMENT||!1,Ut=e.RETURN_TRUSTED_TYPE||!1,Bt=e.FORCE_BODY||!1,Vt=!1!==e.SANITIZE_DOM,qt=e.SANITIZE_NAMED_PROPS||!1,$t=!1!==e.KEEP_CONTENT,Ht=e.IN_PLACE||!1,Ct=e.ALLOWED_URI_REGEXP||Ct,re=e.NAMESPACE||ee,e.CUSTOM_ELEMENT_HANDLING&&pe(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Tt.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&pe(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Tt.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Tt.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Dt&&(Lt=!1),Nt&&(jt=!0),Zt&&(kt=P({},o(N)),Mt=[],!0===Zt.html&&(P(kt,R),P(Mt,U)),!0===Zt.svg&&(P(kt,D),P(Mt,V),P(Mt,$)),!0===Zt.svgFilters&&
vendor: 4,284 bytes, line 1
1(P(kt,O),P(Mt,V),P(Mt,$)),!0===Zt.mathMl&&(P(kt,B),P(Mt,q),P(Mt,$))),e.ADD_TAGS&&(kt===St&&(kt=L(kt)),P(kt,e.ADD_TAGS,mt)),e.ADD_ATTR&&(Mt===Et&&(Mt=L(Mt)),P(Mt,e.ADD_ATTR,mt)),e.ADD_URI_SAFE_ATTR&&P(Kt,e.ADD_URI_SAFE_ATTR,mt),e.FORBID_CONTENTS&&(Gt===Qt&&(Gt=L(Gt)),P(Gt,e.FORBID_CONTENTS,mt)),$t&&(kt["#text"]=!0),Ot&&P(kt,["html","head","body"]),kt.table&&(P(kt,["tbody"]),delete At.tbody),h&&h(e),se=e)},ue=P({},["mi","mo","mn","ms","mtext"]),he=P({},["foreignobject","desc","title","annotation-xml"]),de=P({},["title","style","font","a","script"]),fe=P({},D);P(fe,O),P(fe,F);var me=P({},B);P(me,j);var _e=function(t){b(i.removed,{element:t});try{t.parentNode.removeChild(t)}catch(e){t.remove()}},ye=function(t,e){try{b(i.removed,{attribute:e.getAttributeNode(t),from:e})}catch(t){b(i.removed,{attribute:null,from:e})}if(e.removeAttribute(t),"is"===t&&!Mt[t])if(jt||Nt)try{_e(e)}catch(t){}else try{e.setAttribute(t,"")}catch(t){}},ge=function(t){var e,r;if(Bt)t="<remove></remove>"+t;else{var i=k(t,/^[\r\n\t ]+/);r=i&&i[0]}"application/xhtml+xml"===ft&&re===ee&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");var o=nt?nt.createHTML(t):t;if(re===ee)try{e=(new y).parseFromString(o,ft)}catch(t){}if(!e||!e.documentElement){e=lt.createDocument(re,"template",null);try{e.documentElement.innerHTML=ie?at:o}catch(t){}}var n=e.body||e.documentElement;return t&&r&&n.insertBefore(a.createTextNode(r),n.childNodes[0]||null),re===ee?ut.call(e,Ot?"html":"body")[0]:Ot?e.documentElement:n},ve=function(t){return pt.call(t.ownerDocument||t,t,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT,null,!1)},xe=function(e){return"object"===t(c)?e instanceof c:e&&"object"===t(e)&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},be=function(t,e,r){dt[t]&&v(dt[t],(function(t){t.call(i,e,r,se)}))},we=function(t){var e;if(be("beforeSanitizeElements",t,null),function(t){return t instanceof _&&("string"!=typeof t.nodeName||"string"!=typeof t.textContent||"function"!=typeof t.removeChild||!(t.attributes instanceof m)||"function"!=typeof t.removeAttribute||"function"!=typeof t.setAttribute||"string"!=typeof t.namespaceURI||"function"!=typeof t.insertBefore||"function"!=typeof t.hasChildNodes)}(t))return _e(t),!0;var r=mt(t.nodeName);if(be("uponSanitizeElement",t,{tagName:r,allowedTags:kt}),t.hasChildNodes()&&!xe(t.firstElementChild)&&(!xe(t.content)||!xe(t.content.firstElementChild))&&T(/<[/\w]/g,t.innerHTML)&&T(/<[/\w]/g,t.textContent))return _e(t),!0;if(!kt[r]||At[r]){if(!At[r]&&ke(r)){if(Tt.tagNameCheck instanceof RegExp&&T(Tt.tagNameCheck,r))return!1;if(Tt.tagNameCheck instanceof Function&&Tt.tagNameCheck(r))return!1}if($t&&!Gt[r]){var o=it(t)||t.parentNode,n=rt(t)||t.childNodes;if(n&&o)for(var a=n.length-1;a>=0;--a)o.insertBefore(tt(n[a],!0),et(t))}return _e(t),!0}return t instanceof u&&!function(t){var e=it(t);e&&e.tagName||(e={namespaceURI:re,tagName:"template"});var r=w(t.tagName),i=w(e.tagName);return!!oe[t.namespaceURI]&&(t.namespaceURI===te?e.namespaceURI===ee?"svg"===r:e.namespaceURI===Yt?"svg"===r&&("annotation-xml"===i||ue[i]):Boolean(fe[r]):t.namespaceURI===Yt?e.namespaceURI===ee?"math"===r:e.namespaceURI===te?"math"===r&&he[i]:Boolean(me[r]):t.namespaceURI===ee?!(e.namespaceURI===te&&!he[i])&&!(e.namespaceURI===Yt&&!ue[i])&&!me[r]&&(de[r]||!fe[r]):!("application/xhtml+xml"!==ft||!oe[t.namespaceURI]))}(t)?(_e(t),!0):"noscript"!==r&&"noembed"!==r||!T(/<\/no(script|embed)/i,t.innerHTML)?(Dt&&3===t.nodeType&&(e=t.textContent,e=S(e,_t," "),e=S(e,yt," "),e=S(e,gt," "),t.textContent!==e&&(b(i.removed,{element:t.cloneNode()}),t.textContent=e)),be("afterSanitizeElements",t,null),!1):(_e(t),!0)},Ce=function(t,e,r){if(Vt&&("id"===e||"name"===e)&&(r in a||r in le))return!1;if(Lt&&!It[e]&&T(vt,e));else if(Pt&&T(xt,e));else if(!Mt[e]||It[e]){if(!(ke(t)&&(Tt.tagNameCheck instanceof RegExp&&T(Tt.tagNameCheck,t)||Tt.tagNameCheck instanceof Function&&Tt.tagNameCheck(t))&&(Tt.attributeNameCheck instanceof RegExp&&T(Tt.attributeNameCheck,e)||Tt.attributeNameCheck instanceof Function&&Tt.attributeNameCheck(e))||"is"===e&&Tt.allowCustomizedBuiltInElements&&(Tt.tagNameCheck instanceof RegExp&&T(Tt.tagNameCheck,r)||Tt.tagNameCheck instanceof Function&&Tt.tagNameCheck(r))))return!1}else if(Kt[e]);else if(T(Ct,S(r,wt,"")));
1else if("src"!==e&&"xlink:href"!==e&&"href"!==e||"script"===t||0!==M(r,"data:")||!Xt[t])if(zt&&!T(bt,S(r,wt,"")));else if(r)return!1;return!0},ke=function(t){return t.indexOf("-")>0},Se=function(e){var r,o,n,a;be("beforeSanitizeAttributes",e,null);var s=e.attributes;if(s){var l={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Mt};for(a=s.length;a--;){var p=r=s[a],c=p.name,u=p.namespaceURI;if(o="value"===c?r.value:E(r.value),n=mt(c),l.attrName=n,l.attrValue=o,l.keepAttr=!0,l.forceKeepAttr=void 0,be("uponSanitizeAttribute",e,l),o=l.attrValue,!l.forceKeepAttr&&(ye(c,e),l.keepAttr))if(Rt||!T(/\/>/i,o)){Dt&&(o=S(o,_t," "),o=S(o,yt," "),o=S(o,gt," "));var h=mt(e.nodeName);if(Ce(h,n,o)){if(!qt||"id"!==n&&"name"!==n||(ye(c,e),o="user-content-"+o),nt&&"object"===t(g)&&"function"==typeof g.getAttributeType)if(u);else switch(g.getAttributeType(h,n)){case"TrustedHTML":o=nt.createHTML(o);break;case"TrustedScriptURL":o=nt.createScriptURL(o)}try{u?e.setAttributeNS(u,c,o):e.setAttribute(c,o),x(i.removed)}catch(t){}}}else ye(c,e)}be("afterSanitizeAttributes",e,null)}},Me=function t(e){var r,i=ve(e);for(be("beforeSanitizeShadowDOM",e,null);r=i.nextNode();)be("uponSanitizeShadowNode",r,null),we(r)||(r.content instanceof l&&t(r.content),Se(r));be("afterSanitizeShadowDOM",e,null)};return i.sanitize=function(t){var e,r,o,a,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((ie=!t)&&(t="\x3c!--\x3e"),"string"!=typeof t&&!xe(t)){if("function"!=typeof t.toString)throw A("toString is not a function");if("string"!=typeof(t=t.toString()))throw A("dirty is not a string, aborting")}if(!i.isSupported)return t;if(Ft||ce(s),i.removed=[],"string"==typeof t&&(Ht=!1),Ht){if(t.nodeName){var p=mt(t.nodeName);if(!kt[p]||At[p])throw A("root node is forbidden and cannot be sanitized in-place")}}else if(t instanceof c)1===(r=(e=ge("\x3c!----\x3e")).ownerDocument.importNode(t,!0)).nodeType&&"BODY"===r.nodeName||"HTML"===r.nodeName?e=r:e.appendChild(r);else{if(!jt&&!Dt&&!Ot&&-1===t.indexOf("<"))return nt&&Ut?nt.createHTML(t):t;if(!(e=ge(t)))return jt?null:Ut?at:""}e&&Bt&&_e(e.firstChild);for(var u=ve(Ht?t:e);o=u.nextNode();)we(o)||(o.content instanceof l&&Me(o.content),Se(o));if(Ht)return t;if(jt){if(Nt)for(a=ct.call(e.ownerDocument);e.firstChild;)a.appendChild(e.firstChild);else a=e;return(Mt.shadowroot||Mt.shadowrootmod)&&(a=ht.call(n,a,!0)),a}var h=Ot?e.outerHTML:e.innerHTML;return Ot&&kt["!doctype"]&&e.ownerDocument&&e.ownerDocument.doctype&&e.ownerDocument.doctype.name&&T(Y,e.ownerDocument.doctype.name)&&(h="<!DOCTYPE "+e.ownerDocument.doctype.name+">\n"+h),Dt&&(h=S(h,_t," "),h=S(h,yt," "),h=S(h,gt," ")),nt&&Ut?nt.createHTML(h):h},i.setConfig=function(t){ce(t),Ft=!0},i.clearConfig=function(){se=null,Ft=!1},i.isValidAttribute=function(t,e,r){se||ce({});var i=mt(t),o=mt(e);return Ce(i,o,r)},i.addHook=function(t,e){"function"==typeof e&&(dt[t]=dt[t]||[],b(dt[t],e))},i.removeHook=function(t){if(dt[t])return x(dt[t])},i.removeHooks=function(t){dt[t]&&(dt[t]=[])},i.removeAllHooks=function(){dt={}},i}();return tt}));!function t(e,r,i){function o(a,s){if(!r[a]){if(!e[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(n)return n(a,!0);throw(s=new Error("Cannot find module '"+a+"'")).code="MODULE_NOT_FOUND",s}l=r[a]={exports:{}},e[a][0].call(l.exports,(function(t){return o(e[a][1][t]||t)}),l,l.exports,t,e,r,i)}return r[a].exports}for(var n="function"==typeof require&&require,a=0;a<i.length;a++)o(i[a]);return o}({1:[function(t,e,r){"use strict";var i=t("@mapbox/mapbox-gl-sync-move"),o=t("events").EventEmitter;function n(t,e,r,n){if(this.options=n||{},this._mapA=t,this._mapB=e,this._horizontal="horizontal"===this.options.orientation,this._onDown=this._onDown.bind(this),this._onMove=this._onMove.bind(this),this._onMouseUp=this._onMouseUp.bind(this),this._onTouchEnd=this._onTouchEnd.bind(this),this._ev=new o,this._swiper=document.createElement("div"),this._swiper.className=this._horizontal?"compare-swiper-horizontal":"compare-swiper-vertical",this._controlContainer=document.createElement("div"),this._controlContainer.className=this._horizontal?"maplibregl-compare maplibregl-compare-horizontal":"maplibregl-compare",this._controlContainer.className=this._controlContainer.className,this._controlContainer.appendChild(this._swiper),"string"==typeof r&&document.body.querySelectorAll){if(!(n=document.body.querySelectorAll(r)[0]))throw new Error("Cannot find element with specified container selector.");n.appendChild(this._controlContainer)}else{if(!(r instanceof Element&&r.appendChild))throw new Error("Invalid container specified. Must be CSS selector or HTML element.");r.appendChild(this._controlContainer)}this._bounds=e.getContainer().getBoundingClientRect();n=(this._horizontal?this._bounds.height:this._bounds.width)/2;this._setPosition(n),this._clearSync=i(t,e),this._onResize=function(){this._bounds=e.getContainer().getBoundingClientRect(),this.currentPosition&&this._setPosition(this.currentPosition)}.bind(this),e.on("resize",this._onResize),this.options&&this.options.mousemove&&(t.getContainer().addEventListener("mousemove",this._onMove),e.getContainer().addEventListener("mousemove",this._onMove)),this._swiper.addEventListener("mousedown",this._onDown),this._swiper.addEventListener("touchstart",this._onDown)}n.prototype={_setPointerEvents:function(t){this._controlContainer.style.pointerEvents=t,this._swiper.style.pointerEvents=t},_onDown:function(t){t.touches?(document.addEventListener("touchmove",this._onMove),document.addEventListener("touchend",this._onTouchEnd)):(document.addEventListener("mousemove",this._onMove),document.addEventListener("mouseup",this._onMouseUp))},_setPosition:function(t){t=Math.min(t,this._horizontal?this._bounds.height:this._bounds.width);var e=this._horizontal?"translate(0, "+t+"px)":"translate("+t+"px, 0)",r=(e=(this._controlContainer.style.transform=e,this._controlContainer.style.WebkitTransform=e,this._horizontal?"rect(0, 999em, "+t+"px, 0)":"rect(0, "+t+"px, "+this._bounds.height+"px, 0)"),this._horizontal?"rect("+t+"px, 999em, "+this._bounds.height+"px,0)":"rect(0, 999em, "+this._bounds.height+"px,"+t+"px)");this._mapA.getContainer().style.clip=e,this._mapB.getContainer().style.clip=r,this.currentPosition=t},_onMove:function(t){this.options&&this.options.mousemove&&this._setPointerEvents(t.touches?"auto":"none"),this._horizontal?this._setPosition(this._getY(t)):this._setPosition(this._getX(t))},_onMouseUp:function(){document.removeEventListener("mousemove",this._onMove),document.removeEventListener("mouseup",this._onMouseUp),this.fire("slideend",{currentPosition:this.currentPosition})},_onTouchEnd:function(){document.removeEventListener("touchmove",this._onMove),document.removeEventListener("touchend",this._onTouchEnd),this.fire("slideend",{currentPosition:this.currentPosition})},_getX:function(t){return(t=(t=(t=t.touches?t.touches[0]:t).clientX-this._bounds.left)<0?0:t)>this._bounds.width?this._bounds.width:t},_getY:function(t){return(t=(t=(t=t.touches?t.touches[0]:t).clientY-this._bounds.top)<0?0:t)>this._bounds.height?this._bounds.height:t},setSlider:function(t){this._setPosition(t)},on:function(t,e){return this._ev.on(t,e),this},fire:function(t,e){return this._ev.emit(t,e),this},off:function(t,e){return this._ev.removeListener(t,e),this},remove:function(){this._clearSync(),this._mapB.off("resize",this._onResize);var t;(t=((t=this._mapA.getContainer())&&(t.style.clip=null,t.removeEventListener("mousemove",this._onMove)),this._mapB.getContainer()))&&(t.style.clip=null,t.removeEventListener("mousemove",this._onMove)),this._swiper.removeEventListener("mousedown",this._onDown),this._swiper.removeEventListener("touchstart",this._onDown),this._controlContainer.remove()}},window.maplibregl?maplibregl.Compare=n:void 0!==e&&(e.exports=n)},{"@mapbox/mapbox-gl-sync-move":2,events:3}],2:[function(t,e,r){e.exports=function(){var t=arguments.length;if(1===t)e=arguments[0];else for(var e=[],r=0;r<t;r++)e.push(arguments[r]);var i=[];function o(){e.forEach((function(t,e){t.on("move",i[e])}))}function n(){e.forEach((function(t,e){t.off("move",i[e])}))}return e.forEach((function(t,r){i[r]=function(t,e){n(),function(t,e){var r=t.getCenter(),i=t.getZoom(),o=t.getBearing(),n=t.getPitch();e.forEach((function(t){t.jumpTo({center:r,zoom:i,bearing:o,pitch:n})}))}(t,e),o()}.bind(null,t,e.filter((function(t,e){return e!==r})))})),o(),function(){n(),i=[]}}},{}],3:[function(t,e,r){"use strict";var i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)},n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)},a=Number.isNaN||function(t){return t!=t};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(t,e){return new Promise((function(r,i){function o(r){t.removeListener(e,n),i(r)}function n(){"function"==typeof t.removeListener&&t.removeListener("error",o),r([].slice.call(arguments))}var a,s,l;_(t,e,n,{once:!0}),"error"!==e&&(s=o,l={once:!0},"function"==typeof(a=t).on&&_(a,"error",s,l))}))},(s.EventEmitter=s).prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var l=10;function p(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function c(t){return void 0===t._maxListeners?s.defaultMaxListeners:t._maxListeners}function u(t,e,r,i){var o,n;return p(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener||r),o=t._events),n=o[e]),void 0===n?(n=o[e]=r,++t._eventsCount):("function"==typeof n?n=o[e]=i?[r,n]:[n,r]:i?n.unshift(r):n.push(r),
10<(o=c(t))&&n.length>o&&!n.warned&&(n.warned=!0,(i=new Error("Possible EventEmitter memory leak detected. "+n.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit")).name="MaxListenersExceededWarning",i.emitter=t,i.type=e,i.count=n.length,r=i,console&&console.warn&&console.warn(r))),t}function h(t,e,r){e=function(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}.bind(t={fired:!1,wrapFn:void 0,target:t,type:e,listener:r});return e.listener=r,t.wrapFn=e}function d(t,e,r){if(void 0===(t=t._events))return[];if(void 0===(t=t[e]))return[];if("function"==typeof t)return r?[t.listener||t]:[t];if(r){for(var i=t,o=new Array(i.length),n=0;n<o.length;++n)o[n]=i[n].listener||i[n];return o}return m(t,t.length)}function f(t){var e=this._events;if(void 0!==e){if("function"==typeof(e=e[t]))return 1;if(void 0!==e)return e.length}return 0}function m(t,e){for(var r=new Array(e),i=0;i<e;++i)r[i]=t[i];return r}function _(t,e,r,i){if("function"==typeof t.on)i.once?t.once(e,r):t.on(e,r);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function o(n){i.once&&t.removeEventListener(e,o),r(n)}))}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return l},set:function(t){if("number"!=typeof t||t<0||a(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");l=t}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||a(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var i="error"===t,n=this._events;if(void 0!==n)i=i&&void 0===n.error;else if(!i)return!1;if(i){if((a=0<e.length?e[0]:a)instanceof Error)throw a;throw(i=new Error("Unhandled error."+(a?" ("+a.message+")":""))).context=a,i}var a=n[t];if(void 0===a)return!1;if("function"==typeof a)o(a,this,e);else{var s=a.length,l=m(a,s);for(r=0;r<s;++r)o(l[r],this,e)}return!0},s.prototype.on=s.prototype.addListener=function(t,e){return u(this,t,e,!1)},s.prototype.prependListener=function(t,e){return u(this,t,e,!0)},s.prototype.once=function(t,e){return p(e),this.on(t,h(this,t,e)),this},s.prototype.prependOnceListener=function(t,e){return p(e),this.prependListener(t,h(this,t,e)),this},s.prototype.off=s.prototype.removeListener=function(t,e){var r,i,o,n,a;if(p(e),void 0===(i=this._events))return this;if(void 0===(r=i[t]))return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete i[t],i.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(o=-1,n=r.length-1;0<=n;n--)if(r[n]===e||r[n].listener===e){a=r[n].listener,o=n;break}if(o<0)return this;if(0===o)r.shift();else{for(var s=r,l=o;l+1<s.length;l++)s[l]=s[l+1];s.pop()}1===r.length&&(i[t]=r[0]),void 0!==i.removeListener&&this.emit("removeListener",t,a||e)}return this},s.prototype.removeAllListeners=function(t){var e,r=this._events;if(void 0===r)return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0===arguments.length){for(var i,o=Object.keys(r),n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(n=e.length-1;0<=n;n--)this.removeListener(t,e[n]);return this},s.prototype.listeners=function(t){return d(this,t,!0)},s.prototype.rawListeners=function(t){return d(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):f.call(t,e)},s.prototype.listenerCount=f,s.prototype.eventNames=function(){return 0<this._eventsCount?n(this._events):[]}},{}]},{},[1]);!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).turf=t()}}((function(){return function t(e,r,i){function o(a,s){if(!r[a]){if(!e[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(n)return n(a,!0);var p=new Error("Cannot find module '"+a+"'");throw p.code="MODULE_NOT_FOUND",p}var c=r[a]={exports:{}};e[a][0].call(c.exports,(function(t){return o(e[a][1][t]||t)}),c,c.exports,t,e,r,i)}return r[a].exports}for(var n="function"==typeof require&&require,a=0;a<i.length;a++)o(i[a]);return o}({1:[function(t,e,r){e.exports={along:t("@turf/along").default,bbox:t("@turf/bbox").default,center:t("@turf/center").default,distance:t("@turf/distance").default,destination:t("@turf/destination").default,length:t("@turf/length").default,nearestPointOnLine:t("@turf/nearest-point-on-line").default,booleanPointInPolygon:t("@turf/boolean-point-in-polygon").default,pointOnFeature:t("@turf/point-on-feature").default}},{"@turf/along":2,"@turf/bbox":3,"@turf/boolean-point-in-polygon":5,"@turf/center":6,"@turf/destination":8,"@turf/distance":9,"@turf/length":13,"@turf/nearest-point-on-line":17,"@turf/point-on-feature":19}],2:[function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};
1Object.defineProperty(r,"__esModule",{value:!0});var o=i(t("@turf/bearing")),n=i(t("@turf/destination")),a=i(t("@turf/distance")),s=t("@turf/helpers"),l=t("@turf/invariant");r.default=function(t,e,r){void 0===r&&(r={});for(var i=l.getGeom(t).coordinates,p=0,c=0;c<i.length&&!(e>=p&&c===i.length-1);c++){if(p>=e){var u=e-p;if(u){var h=o.default(i[c],i[c-1])-180;return n.default(i[c],u,h,r)}return s.point(i[c])}p+=a.default(i[c],i[c+1],r)}return s.point(i[i.length-1])}},{"@turf/bearing":4,"@turf/destination":8,"@turf/distance":9,"@turf/helpers":11,"@turf/invariant":12}],3:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=t("@turf/meta");function o(t){var e=[1/0,1/0,-1/0,-1/0];i.coordEach(t,(function(t){e[0]>t[0]&&(e[0]=t[0]);e[1]>t[1]&&(e[1]=t[1]);e[2]<t[0]&&(e[2]=t[0]);e[3]<t[1]&&(e[3]=t[1])}));return e}o.default=o;r.default=o},{"@turf/meta":16}],4:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=t("@turf/helpers"),o=t("@turf/invariant");function n(t,e,r){void 0===r&&(r={});if(!0===r.final)return function(t,e){var r=n(e,t);return(r+180)%360}(t,e);var a=o.getCoord(t),s=o.getCoord(e),l=i.degreesToRadians(a[0]),p=i.degreesToRadians(s[0]),c=i.degreesToRadians(a[1]),u=i.degreesToRadians(s[1]),h=Math.sin(p-l)*Math.cos(u),d=Math.cos(c)*Math.sin(u)-Math.sin(c)*Math.cos(u)*Math.cos(p-l);return i.radiansToDegrees(Math.atan2(h,d))}r.default=n},{"@turf/helpers":11,"@turf/invariant":12}],5:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=t("@turf/invariant");r.default=function(t,e,r){void 0===r&&(r={});if(!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var n=i.getCoord(t),a=i.getGeom(e),s=a.type,l=e.bbox,p=a.coordinates;if(l&&!1===function(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}(n,l))return!1;"Polygon"===s&&(p=[p]);for(var c=!1,u=0;u<p.length&&!c;u++)if(o(n,p[u][0],r.ignoreBoundary)){for(var h=!1,d=1;d<p[u].length&&!h;){o(n,p[u][d],!r.ignoreBoundary)&&(h=!0);d++}h||(c=!0)}return c};function o(t,e,r){var i=!1;e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]&&(e=e.slice(0,e.length-1));for(var o=0,n=e.length-1;o<e.length;n=o++){var a=e[o][0],s=e[o][1],l=e[n][0],p=e[n][1];if(t[1]*(a-l)+s*(l-t[0])+p*(t[0]-a)==0&&(a-t[0])*(l-t[0])<=0&&(s-t[1])*(p-t[1])<=0)return!r;s>t[1]!=p>t[1]&&t[0]<(l-a)*(t[1]-s)/(p-s)+a&&(i=!i)}return i}},{"@turf/invariant":12}],6:[function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(r,"__esModule",{value:!0});var o=i(t("@turf/bbox")),n=t("@turf/helpers");r.default=function(t,e){void 0===e&&(e={});var r=o.default(t),i=(r[0]+r[2])/2,a=(r[1]+r[3])/2;return n.point([i,a],e.properties,e)}},{"@turf/bbox":3,"@turf/helpers":11}],7:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});function i(t){var e={type:"Feature"};Object.keys(t).forEach((function(r){switch(r){case"type":case"properties":case"geometry":return;default:e[r]=t[r]}}));e.properties=o(t.properties);e.geometry=n(t.geometry);return e}function o(t){var e={};if(!t)return e;Object.keys(t).forEach((function(r){var i=t[r];"object"==typeof i?null===i?e[r]=null:Array.isArray(i)?e[r]=i.map((function(t){return t})):e[r]=o(i):e[r]=i}));return e}function n(t){var e={type:t.type};t.bbox&&(e.bbox=t.bbox);if("GeometryCollection"===t.type){e.geometries=t.geometries.map((function(t){return n(t)}));return e}e.coordinates=a(t.coordinates);return e}function a(t){var e=t;return"object"!=typeof e[0]?e.slice():e.map((function(t){return a(t)}))}r.default=function(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return i(t);case"FeatureCollection":return function(t){var e={type:"FeatureCollection"};Object.keys(t).forEach((function(r){switch(r){case"type":case"features":return;default:e[r]=t[r]}}));e.features=t.features.map((function(t){return i(t)}));return e}(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return n(t);default:throw new Error("unknown GeoJSON type")}}},{}],8:[function(t,e,r){"use strict";
1Object.defineProperty(r,"__esModule",{value:!0});var i=t("@turf/helpers"),o=t("@turf/invariant");r.default=function(t,e,r,n){void 0===n&&(n={});var a=o.getCoord(t),s=i.degreesToRadians(a[0]),l=i.degreesToRadians(a[1]),p=i.degreesToRadians(r),c=i.lengthToRadians(e,n.units),u=Math.asin(Math.sin(l)*Math.cos(c)+Math.cos(l)*Math.sin(c)*Math.cos(p)),h=s+Math.atan2(Math.sin(p)*Math.sin(c)*Math.cos(l),Math.cos(c)-Math.sin(l)*Math.sin(u)),d=i.radiansToDegrees(h),f=i.radiansToDegrees(u);return i.point([d,f],n.properties)}},{"@turf/helpers":11,"@turf/invariant":12}],9:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=t("@turf/invariant"),o=t("@turf/helpers");r.default=function(t,e,r){void 0===r&&(r={});var n=i.getCoord(t),a=i.getCoord(e),s=o.degreesToRadians(a[1]-n[1]),l=o.degreesToRadians(a[0]-n[0]),p=o.degreesToRadians(n[1]),c=o.degreesToRadians(a[1]),u=Math.pow(Math.sin(s/2),2)+Math.pow(Math.sin(l/2),2)*Math.cos(p)*Math.cos(c);return o.radiansToLength(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)),r.units)}},{"@turf/helpers":11,"@turf/invariant":12}],10:[function(t,e,r){"use strict";var i=t("@turf/meta"),o=t("@turf/helpers");function n(t){var e=[];"FeatureCollection"===t.type?i.featureEach(t,(function(t){i.coordEach(t,(function(r){e.push(o.point(r,t.properties))}))})):i.coordEach(t,(function(r){e.push(o.point(r,t.properties))}));return o.featureCollection(e)}e.exports=n;e.exports.default=n},{"@turf/helpers":11,"@turf/meta":16}],11:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.earthRadius=6371008.8;r.factors={centimeters:100*r.earthRadius,centimetres:100*r.earthRadius,degrees:r.earthRadius/111325,feet:3.28084*r.earthRadius,inches:39.37*r.earthRadius,kilometers:r.earthRadius/1e3,kilometres:r.earthRadius/1e3,meters:r.earthRadius,metres:r.earthRadius,miles:r.earthRadius/1609.344,millimeters:1e3*r.earthRadius,millimetres:1e3*r.earthRadius,nauticalmiles:r.earthRadius/1852,radians:1,yards:1.0936*r.earthRadius};r.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/r.earthRadius,yards:1.0936133};r.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function i(t,e,r){void 0===r&&(r={});var i={type:"Feature"};(0===r.id||r.id)&&(i.id=r.id);r.bbox&&(i.bbox=r.bbox);i.properties=e||{};i.geometry=t;return i}r.feature=i;r.geometry=function(t,e,r){void 0===r&&(r={});switch(t){case"Point":return o(e).geometry;case"LineString":return a(e).geometry;case"Polygon":return n(e).geometry;case"MultiPoint":return p(e).geometry;case"MultiLineString":return l(e).geometry;case"MultiPolygon":return c(e).geometry;default:throw new Error(t+" is invalid")}};function o(t,e,r){void 0===r&&(r={});if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!f(t[0])||!f(t[1]))throw new Error("coordinates must contain numbers");return i({type:"Point",coordinates:t},e,r)}r.point=o;r.points=function(t,e,r){void 0===r&&(r={});return s(t.map((function(t){return o(t,e)})),r)};function n(t,e,r){void 0===r&&(r={});for(var o=0,n=t;o<n.length;o++){var a=n[o];if(a.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<a[a.length-1].length;s++)if(a[a.length-1][s]!==a[0][s])throw new Error("First and last Position are not equivalent.")}return i({type:"Polygon",coordinates:t},e,r)}r.polygon=n;r.polygons=function(t,e,r){void 0===r&&(r={});return s(t.map((function(t){return n(t,e)})),r)};function a(t,e,r){void 0===r&&(r={});if(t.length<2)throw new Error("coordinates must be an array of two or more positions");return i({type:"LineString",coordinates:t},e,r)}r.lineString=a;r.lineStrings=function(t,e,r){void 0===r&&(r={});return s(t.map((function(t){return a(t,e)})),r)};function s(t,e){void 0===e&&(e={});var r={type:"FeatureCollection"};e.id&&(r.id=e.id);e.bbox&&(r.bbox=e.bbox);r.features=t;return r}r.featureCollection=s;function l(t,e,r){void 0===r&&(r={});return i({type:"MultiLineString",coordinates:t},e,r)}r.multiLineString=l;function p(t,e,r){void 0===r&&(r={});return i({type:"MultiPoint",coordinates:t},e,r)}r.multiPoint=p;function c(t,e,r){void 0===r&&(r={});return i({type:"MultiPolygon",coordinates:t},e,r)}r.multiPolygon=c;r.geometryCollection=function(t,e,r){void 0===r&&(r={});return i({type:"GeometryCollection",geometries:t},e,r)};r.round=function(t,e){void 0===e&&(e=0);if(e&&!(e>=0))throw new Error("precision must be a positive number");var r=Math.pow(10,e||0);return Math.round(t*r)/r};function u(t,e){void 0===e&&(e="kilometers");var i=r.factors[e];
1if(!i)throw new Error(e+" units is invalid");return t*i}r.radiansToLength=u;function h(t,e){void 0===e&&(e="kilometers");var i=r.factors[e];if(!i)throw new Error(e+" units is invalid");return t/i}r.lengthToRadians=h;r.lengthToDegrees=function(t,e){return d(h(t,e))};r.bearingToAzimuth=function(t){var e=t%360;e<0&&(e+=360);return e};function d(t){return 180*(t%(2*Math.PI))/Math.PI}r.radiansToDegrees=d;r.degreesToRadians=function(t){return t%360*Math.PI/180};r.convertLength=function(t,e,r){void 0===e&&(e="kilometers");void 0===r&&(r="kilometers");if(!(t>=0))throw new Error("length must be a positive number");return u(h(t,e),r)};r.convertArea=function(t,e,i){void 0===e&&(e="meters");void 0===i&&(i="kilometers");if(!(t>=0))throw new Error("area must be a positive number");var o=r.areaFactors[e];if(!o)throw new Error("invalid original units");var n=r.areaFactors[i];if(!n)throw new Error("invalid final units");return t/o*n};function f(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}r.isNumber=f;r.isObject=function(t){return!!t&&t.constructor===Object};r.validateBBox=function(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!f(t))throw new Error("bbox must only contain numbers")}))};r.validateId=function(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}},{}],12:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=t("@turf/helpers");
1r.getCoord=function(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if("Feature"===t.type&&null!==t.geometry&&"Point"===t.geometry.type)return t.geometry.coordinates;if("Point"===t.type)return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")};r.getCoords=function(t){if(Array.isArray(t))return t;if("Feature"===t.type){if(null!==t.geometry)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")};r.containsNumber=function t(e){if(e.length>1&&i.isNumber(e[0])&&i.isNumber(e[1]))return!0;if(Array.isArray(e[0])&&e[0].length)return t(e[0]);throw new Error("coordinates must only contain numbers")};r.geojsonType=function(t,e,r){if(!e||!r)throw new Error("type and name required");if(!t||t.type!==e)throw new Error("Invalid input to "+r+": must be a "+e+", given "+t.type)};r.featureOf=function(t,e,r){if(!t)throw new Error("No feature passed");if(!r)throw new Error(".featureOf() requires a name");if(!t||"Feature"!==t.type||!t.geometry)throw new Error("Invalid input to "+r+", Feature with geometry required");if(!t.geometry||t.geometry.type!==e)throw new Error("Invalid input to "+r+": must be a "+e+", given "+t.geometry.type)};r.collectionOf=function(t,e,r){if(!t)throw new Error("No featureCollection passed");if(!r)throw new Error(".collectionOf() requires a name");if(!t||"FeatureCollection"!==t.type)throw new Error("Invalid input to "+r+", FeatureCollection required");for(var i=0,o=t.features;i<o.length;i++){var n=o[i];if(!n||"Feature"!==n.type||!n.geometry)throw new Error("Invalid input to "+r+", Feature with geometry required");if(!n.geometry||n.geometry.type!==e)throw new Error("Invalid input to "+r+": must be a "+e+", given "+n.geometry.type)}};r.getGeom=function(t){return"Feature"===t.type?t.geometry:t};r.getType=function(t,e){return"FeatureCollection"===t.type?"FeatureCollection":"GeometryCollection"===t.type?"GeometryCollection":"Feature"===t.type&&null!==t.geometry?t.geometry.type:t.type}},{"@turf/helpers":11}],13:[function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(r,"__esModule",{value:!0});var o=i(t("@turf/distance")),n=t("@turf/meta");r.default=function(t,e){void 0===e&&(e={});return n.segmentReduce(t,(function(t,r){var i=r.geometry.coordinates;return t+o.default(i[0],i[1],e)}),0)}},{"@turf/distance":9,"@turf/meta":16}],14:[function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(r,"__esModule",{value:!0});var o=t("@turf/helpers"),n=t("@turf/invariant"),a=i(t("@turf/line-segment")),s=t("@turf/meta"),l=i(t("geojson-rbush"));function p(t,e){var r=n.getCoords(t),i=n.getCoords(e);if(2!==r.length)throw new Error("<intersects> line1 must only contain 2 coordinates");if(2!==i.length)throw new Error("<intersects> line2 must only contain 2 coordinates");var a=r[0][0],s=r[0][1],l=r[1][0],p=r[1][1],c=i[0][0],u=i[0][1],h=i[1][0],d=i[1][1],f=(d-u)*(l-a)-(h-c)*(p-s),m=(h-c)*(s-u)-(d-u)*(a-c),_=(l-a)*(s-u)-(p-s)*(a-c);if(0===f)return null;var y=m/f,g=_/f;if(y>=0&&y<=1&&g>=0&&g<=1){var v=a+y*(l-a),x=s+y*(p-s);return o.point([v,x])}return null}r.default=function(t,e){var r={},i=[];"LineString"===t.type&&(t=o.feature(t));"LineString"===e.type&&(e=o.feature(e));if("Feature"===t.type&&"Feature"===e.type&&null!==t.geometry&&null!==e.geometry&&"LineString"===t.geometry.type&&"LineString"===e.geometry.type&&2===t.geometry.coordinates.length&&2===e.geometry.coordinates.length){var c=p(t,e);c&&i.push(c);return o.featureCollection(i)}var u=l.default();u.load(a.default(e));s.featureEach(a.default(t),(function(t){s.featureEach(u.search(t),(function(e){var o=p(t,e);if(o){var a=n.getCoords(o).join(",");if(!r[a]){r[a]=!0;i.push(o)}}}))}));return o.featureCollection(i)}},{"@turf/helpers":11,"@turf/invariant":12,"@turf/line-segment":15,"@turf/meta":16,"geojson-rbush":20}],15:[function(t,e,r){"use strict";
1Object.defineProperty(r,"__esModule",{value:!0});var i=t("@turf/helpers"),o=t("@turf/invariant"),n=t("@turf/meta");r.default=function(t){if(!t)throw new Error("geojson is required");var e=[];n.flattenEach(t,(function(t){!function(t,e){var r=[],n=t.geometry;if(null!==n){switch(n.type){case"Polygon":r=o.getCoords(n);break;case"LineString":r=[o.getCoords(n)]}r.forEach((function(r){var o=function(t,e){var r=[];t.reduce((function(t,o){var n,a,s,l,p,c,u=i.lineString([t,o],e);u.bbox=(a=o,s=(n=t)[0],l=n[1],p=a[0],c=a[1],[s<p?s:p,l<c?l:c,s>p?s:p,l>c?l:c]);r.push(u);return o}));return r}(r,t.properties);o.forEach((function(t){t.id=e.length;e.push(t)}))}))}}(t,e)}));return i.featureCollection(e)}},{"@turf/helpers":11,"@turf/invariant":12,"@turf/meta":16}],16:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=t("@turf/helpers");function o(t,e,r){if(null!==t)for(var i,n,a,s,l,p,c,u,h=0,d=0,f=t.type,m="FeatureCollection"===f,_="Feature"===f,y=m?t.features.length:1,g=0;g<y;g++){l=(u=!!(c=m?t.features[g].geometry:_?t.geometry:t)&&"GeometryCollection"===c.type)?c.geometries.length:1;for(var v=0;v<l;v++){var x=0,b=0;if(null!==(s=u?c.geometries[v]:c)){p=s.coordinates;var w=s.type;h=!r||"Polygon"!==w&&"MultiPolygon"!==w?0:1;switch(w){case null:break;case"Point":if(!1===e(p,d,g,x,b))return!1;d++;x++;break;case"LineString":case"MultiPoint":for(i=0;i<p.length;i++){if(!1===e(p[i],d,g,x,b))return!1;d++;"MultiPoint"===w&&x++}"LineString"===w&&x++;break;case"Polygon":case"MultiLineString":for(i=0;i<p.length;i++){for(n=0;n<p[i].length-h;n++){if(!1===e(p[i][n],d,g,x,b))return!1;d++}"MultiLineString"===w&&x++;"Polygon"===w&&b++}"Polygon"===w&&x++;break;case"MultiPolygon":for(i=0;i<p.length;i++){b=0;for(n=0;n<p[i].length;n++){for(a=0;a<p[i][n].length-h;a++){if(!1===e(p[i][n][a],d,g,x,b))return!1;d++}b++}x++}break;case"GeometryCollection":for(i=0;i<s.geometries.length;i++)if(!1===o(s.geometries[i],e,r))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function n(t,e){var r;switch(t.type){case"FeatureCollection":for(r=0;r<t.features.length&&!1!==e(t.features[r].properties,r);r++);break;case"Feature":e(t.properties,0)}}function a(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var r=0;r<t.features.length&&!1!==e(t.features[r],r);r++);}function s(t,e){var r,i,o,n,a,s,l,p,c,u,h=0,d="FeatureCollection"===t.type,f="Feature"===t.type,m=d?t.features.length:1;for(r=0;r<m;r++){s=d?t.features[r].geometry:f?t.geometry:t;p=d?t.features[r].properties:f?t.properties:{};c=d?t.features[r].bbox:f?t.bbox:void 0;u=d?t.features[r].id:f?t.id:void 0;a=(l=!!s&&"GeometryCollection"===s.type)?s.geometries.length:1;for(o=0;o<a;o++)if(null!==(n=l?s.geometries[o]:s))switch(n.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===e(n,h,p,c,u))return!1;break;case"GeometryCollection":for(i=0;i<n.geometries.length;i++)if(!1===e(n.geometries[i],h,p,c,u))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===e(null,h,p,c,u))return!1;h++}}function l(t,e){s(t,(function(t,r,o,n,a){var s,l=null===t?null:t.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return!1!==e(i.feature(t,o,{bbox:n,id:a}),r,0)&&void 0}switch(l){case"MultiPoint":s="Point";break;case"MultiLineString":s="LineString";break;case"MultiPolygon":s="Polygon"}for(var p=0;p<t.coordinates.length;p++){var c={type:s,coordinates:t.coordinates[p]};if(!1===e(i.feature(c,o),r,p))return!1}}))}function p(t,e){l(t,(function(t,r,n){var a=0;if(t.geometry){var s=t.geometry.type;if("Point"!==s&&"MultiPoint"!==s){var l,p=0,c=0,u=0;return!1!==o(t,(function(o,s,h,d,f){if(void 0===l||r>p||d>c||f>u){l=o;p=r;c=d;u=f;a=0}else{var m=i.lineString([l,o],t.properties);if(!1===e(m,r,n,f,a))return!1;a++;l=o}}))&&void 0}}}))}function c(t,e){if(!t)throw new Error("geojson is required");l(t,(function(t,r,o){if(null!==t.geometry){var n=t.geometry.type,a=t.geometry.coordinates;switch(n){case"LineString":if(!1===e(t,r,o,0,0))return!1;break;case"Polygon":for(var s=0;s<a.length;s++)if(!1===e(i.lineString(a[s],t.properties),r,o,s))return!1}}}))}r.coordAll=function(t){var e=[];o(t,(function(t){e.push(t)}));return e};r.coordEach=o;r.coordReduce=function(t,e,r,i){var n=r;o(t,(function(t,i,o,a,s){n=0===i&&void 0===r?t:e(n,t,i,o,a,s)}),i);return n};
1r.featureEach=a;r.featureReduce=function(t,e,r){var i=r;a(t,(function(t,o){i=0===o&&void 0===r?t:e(i,t,o)}));return i};r.findPoint=function(t,e){e=e||{};if(!i.isObject(e))throw new Error("options is invalid");var r,o=e.featureIndex||0,n=e.multiFeatureIndex||0,a=e.geometryIndex||0,s=e.coordIndex||0,l=e.properties;switch(t.type){case"FeatureCollection":o<0&&(o=t.features.length+o);l=l||t.features[o].properties;r=t.features[o].geometry;break;case"Feature":l=l||t.properties;r=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":r=t;break;default:throw new Error("geojson is invalid")}if(null===r)return null;var p=r.coordinates;switch(r.type){case"Point":return i.point(p,l,e);case"MultiPoint":n<0&&(n=p.length+n);return i.point(p[n],l,e);case"LineString":s<0&&(s=p.length+s);return i.point(p[s],l,e);case"Polygon":a<0&&(a=p.length+a);s<0&&(s=p[a].length+s);return i.point(p[a][s],l,e);case"MultiLineString":n<0&&(n=p.length+n);s<0&&(s=p[n].length+s);return i.point(p[n][s],l,e);case"MultiPolygon":n<0&&(n=p.length+n);a<0&&(a=p[n].length+a);s<0&&(s=p[n][a].length-s);return i.point(p[n][a][s],l,e)}throw new Error("geojson is invalid")};r.findSegment=function(t,e){e=e||{};if(!i.isObject(e))throw new Error("options is invalid");var r,o=e.featureIndex||0,n=e.multiFeatureIndex||0,a=e.geometryIndex||0,s=e.segmentIndex||0,l=e.properties;switch(t.type){case"FeatureCollection":o<0&&(o=t.features.length+o);l=l||t.features[o].properties;r=t.features[o].geometry;break;case"Feature":l=l||t.properties;r=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":r=t;break;default:throw new Error("geojson is invalid")}if(null===r)return null;var p=r.coordinates;switch(r.type){case"Point":case"MultiPoint":return null;case"LineString":s<0&&(s=p.length+s-1);return i.lineString([p[s],p[s+1]],l,e);case"Polygon":a<0&&(a=p.length+a);s<0&&(s=p[a].length+s-1);return i.lineString([p[a][s],p[a][s+1]],l,e);case"MultiLineString":n<0&&(n=p.length+n);s<0&&(s=p[n].length+s-1);return i.lineString([p[n][s],p[n][s+1]],l,e);case"MultiPolygon":n<0&&(n=p.length+n);a<0&&(a=p[n].length+a);s<0&&(s=p[n][a].length-s-1);return i.lineString([p[n][a][s],p[n][a][s+1]],l,e)}throw new Error("geojson is invalid")};r.flattenEach=l;r.flattenReduce=function(t,e,r){var i=r;l(t,(function(t,o,n){i=0===o&&0===n&&void 0===r?t:e(i,t,o,n)}));return i};r.geomEach=s;r.geomReduce=function(t,e,r){var i=r;s(t,(function(t,o,n,a,s){i=0===o&&void 0===r?t:e(i,t,o,n,a,s)}));return i};r.lineEach=c;r.lineReduce=function(t,e,r){var i=r;c(t,(function(t,o,n,a){i=0===o&&void 0===r?t:e(i,t,o,n,a)}));return i};r.propEach=n;r.propReduce=function(t,e,r){var i=r;n(t,(function(t,o){i=0===o&&void 0===r?t:e(i,t,o)}));return i};r.segmentEach=p;r.segmentReduce=function(t,e,r){var i=r,o=!1;p(t,(function(t,n,a,s,l){i=!1===o&&void 0===r?t:e(i,t,n,a,s,l);o=!0}));return i}},{"@turf/helpers":11}],17:[function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(r,"__esModule",{value:!0});var o=i(t("@turf/bearing")),n=i(t("@turf/distance")),a=i(t("@turf/destination")),s=i(t("@turf/line-intersect")),l=t("@turf/meta"),p=t("@turf/helpers"),c=t("@turf/invariant");r.default=function(t,e,r){void 0===r&&(r={});var i=p.point([1/0,1/0],{dist:1/0}),u=0;l.flattenEach(t,(function(t){for(var l=c.getCoords(t),h=0;h<l.length-1;h++){var d=p.point(l[h]);d.properties.dist=n.default(e,d,r);var f=p.point(l[h+1]);f.properties.dist=n.default(e,f,r);var m=n.default(d,f,r),_=Math.max(d.properties.dist,f.properties.dist),y=o.default(d,f),g=a.default(e,_,y+90,r),v=a.default(e,_,y-90,r),x=s.default(p.lineString([g.geometry.coordinates,v.geometry.coordinates]),p.lineString([d.geometry.coordinates,f.geometry.coordinates])),b=null;if(x.features.length>0){(b=x.features[0]).properties.dist=n.default(e,b,r);b.properties.location=u+n.default(d,b,r)}if(d.properties.dist<i.properties.dist){(i=d).properties.index=h;i.properties.location=u}if(f.properties.dist<i.properties.dist){(i=f).properties.index=h+1;i.properties.location=u+m}b&&b.properties.dist<i.properties.dist&&((i=b).properties.index=h);u+=m}}));return i}},{"@turf/bearing":4,"@turf/destination":8,"@turf/distance":9,"@turf/helpers":11,"@turf/invariant":12,"@turf/line-intersect":14,"@turf/meta":16}],18:[function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};
1Object.defineProperty(r,"__esModule",{value:!0});var o=i(t("@turf/clone")),n=i(t("@turf/distance")),a=t("@turf/meta");r.default=function(t,e){if(!t)throw new Error("targetPoint is required");if(!e)throw new Error("points is required");var r,i=1/0,s=0;a.featureEach(e,(function(e,r){var o=n.default(t,e);if(o<i){s=r;i=o}}));(r=o.default(e.features[s])).properties.featureIndex=s;r.properties.distanceToPoint=i;return r}},{"@turf/clone":7,"@turf/distance":9,"@turf/meta":16}],19:[function(t,e,r){"use strict";var i=t("@turf/explode"),o=t("@turf/center"),n=t("@turf/nearest-point"),a=t("@turf/boolean-point-in-polygon"),s=t("@turf/helpers");function l(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var p=l(i),c=l(o),u=l(n),h=l(a);function d(t){for(var e=function(t){if("FeatureCollection"!==t.type)return"Feature"!==t.type?s.featureCollection([s.feature(t)]):s.featureCollection([t]);return t}(t),r=c.default(e),i=!1,o=0;!i&&o<e.features.length;){var n,a=e.features[o].geometry,l=!1;if("Point"===a.type)r.geometry.coordinates[0]===a.coordinates[0]&&r.geometry.coordinates[1]===a.coordinates[1]&&(i=!0);else if("MultiPoint"===a.type){var d=!1;n=0;for(;!d&&n<a.coordinates.length;){if(r.geometry.coordinates[0]===a.coordinates[n][0]&&r.geometry.coordinates[1]===a.coordinates[n][1]){i=!0;d=!0}n++}}else if("LineString"===a.type){n=0;for(;!l&&n<a.coordinates.length-1;){if(f(r.geometry.coordinates[0],r.geometry.coordinates[1],a.coordinates[n][0],a.coordinates[n][1],a.coordinates[n+1][0],a.coordinates[n+1][1])){l=!0;i=!0}n++}}else if("MultiLineString"===a.type)for(var m=0;m<a.coordinates.length;){l=!1;n=0;for(var _=a.coordinates[m];!l&&n<_.length-1;){if(f(r.geometry.coordinates[0],r.geometry.coordinates[1],_[n][0],_[n][1],_[n+1][0],_[n+1][1])){l=!0;i=!0}n++}m++}else"Polygon"!==a.type&&"MultiPolygon"!==a.type||h.default(r,a)&&(i=!0);o++}if(i)return r;var y=s.featureCollection([]);for(o=0;o<e.features.length;o++)y.features=y.features.concat(p.default(e.features[o]).features);return s.point(u.default(r,y).geometry.coordinates)}function f(t,e,r,i,o,n){return Math.sqrt((o-r)*(o-r)+(n-i)*(n-i))===Math.sqrt((t-r)*(t-r)+(e-i)*(e-i))+Math.sqrt((o-t)*(o-t)+(n-e)*(n-e))}e.exports=d;e.exports.default=d},{"@turf/boolean-point-in-polygon":5,"@turf/center":6,"@turf/explode":10,"@turf/helpers":11,"@turf/nearest-point":18}],20:[function(t,e,r){var i=t("rbush"),o=t("@turf/helpers"),n=t("@turf/meta"),a=t("@turf/bbox").default,s=n.featureEach,l=(n.coordEach,o.polygon,o.featureCollection);function p(t){var e=new i(t);e.insert=function(t){if("Feature"!==t.type)throw new Error("invalid feature");t.bbox=t.bbox?t.bbox:a(t);return i.prototype.insert.call(this,t)};e.load=function(t){var e=[];Array.isArray(t)?t.forEach((function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox?t.bbox:a(t);e.push(t)})):s(t,(function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox?t.bbox:a(t);e.push(t)}));return i.prototype.load.call(this,e)};e.remove=function(t,e){if("Feature"!==t.type)throw new Error("invalid feature");t.bbox=t.bbox?t.bbox:a(t);return i.prototype.remove.call(this,t,e)};e.clear=function(){return i.prototype.clear.call(this)};e.search=function(t){var e=i.prototype.search.call(this,this.toBBox(t));return l(e)};e.collides=function(t){return i.prototype.collides.call(this,this.toBBox(t))};e.all=function(){var t=i.prototype.all.call(this);return l(t)};e.toJSON=function(){return i.prototype.toJSON.call(this)};e.fromJSON=function(t){return i.prototype.fromJSON.call(this,t)};e.toBBox=function(t){var e;if(t.bbox)e=t.bbox;else if(Array.isArray(t)&&4===t.length)e=t;else if(Array.isArray(t)&&6===t.length)e=[t[0],t[1],t[3],t[4]];else if("Feature"===t.type)e=a(t);else{if("FeatureCollection"!==t.type)throw new Error("invalid geojson");e=a(t)}return{minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}};return e}e.exports=p;e.exports.default=p},{"@turf/bbox":3,"@turf/helpers":11,"@turf/meta":16,rbush:21}],21:[function(t,e,r){i=this,o=function(){"use strict";function t(t,i,o,n,a){!function t(r,i,o,n,a){for(;n>o;){if(n-o>600){var s=n-o+1,l=i-o+1,p=Math.log(s),c=.5*Math.exp(2*p/3),u=.5*Math.sqrt(p*c*(s-c)/s)*(l-s/2<0?-1:1);t(r,i,Math.max(o,Math.floor(i-l*c/s+u)),Math.min(n,Math.floor(i+(s-l)*c/s+u)),a)}var h=r[i],d=o,f=n;for(e(r,o,i),a(r[n],h)>0&&e(r,o,n);d<f;){for(e(r,d,f),d++,f--;a(r[d],h)<0;)d++;for(;a(r[f],h)>0;)f--}0===a(r[o],h)?e(r,o,f):e(r,++f,n),f<=i&&(o=f+1),i<=f&&(n=f-1)}}(t,i,o||0,n||t.length-1,a||r)}function e(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function r(t,e){return t<e?-1:t>e?1:0}var i=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(t,e,r){if(!r)return e.indexOf(t);for(var i=0;i<e.length;i++)if(r(t,e[i]))return i;return-1}function n(t,e){a(t,0,t.children.length,e,t)}function a(t,e,r,i,o){o||(o=f(null)),o.minX=1/0,o.minY=1/0,o.maxX=-1/0,o.maxY=-1/0;for(var n=e;n<r;n++){var a=t.children[n];s(o,t.leaf?i(a):a)}return o}function s(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function l(t,e){return t.minX-e.minX}function p(t,e){return t.minY-e.minY}
vendor: 5,890 bytes, line 1
1function c(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function u(t){return t.maxX-t.minX+(t.maxY-t.minY)}function h(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function d(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function f(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function m(e,r,i,o,n){for(var a=[r,i];a.length;)if(!((i=a.pop())-(r=a.pop())<=o)){var s=r+Math.ceil((i-r)/o/2)*o;t(e,s,r,i,n),a.push(r,s,s,i)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(t){var e=this.data,r=[];if(!d(t,e))return r;for(var i=this.toBBox,o=[];e;){for(var n=0;n<e.children.length;n++){var a=e.children[n],s=e.leaf?i(a):a;d(t,s)&&(e.leaf?r.push(a):h(t,s)?this._all(a,r):o.push(a))}e=o.pop()}return r},i.prototype.collides=function(t){var e=this.data;if(!d(t,e))return!1;for(var r=[];e;){for(var i=0;i<e.children.length;i++){var o=e.children[i],n=e.leaf?this.toBBox(o):o;if(d(t,n)){if(e.leaf||h(t,n))return!0;r.push(o)}}e=r.pop()}return!1},i.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0;e<t.length;e++)this.insert(t[e]);return this}var r=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===r.height)this._splitRoot(this.data,r);else{if(this.data.height<r.height){var i=this.data;this.data=r,r=i}this._insert(r,this.data.height-r.height-1,!0)}else this.data=r;return this},i.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},i.prototype.clear=function(){return this.data=f([]),this},i.prototype.remove=function(t,e){if(!t)return this;for(var r,i,n,a=this.data,s=this.toBBox(t),l=[],p=[];a||l.length;){if(a||(a=l.pop(),i=l[l.length-1],r=p.pop(),n=!0),a.leaf){var c=o(t,a.children,e);if(-1!==c)return a.children.splice(c,1),l.push(a),this._condense(l),this}n||a.leaf||!h(a,s)?i?(r++,a=i.children[r],n=!1):a=null:(l.push(a),p.push(r),r=0,i=a,a=a.children[0])}return this},i.prototype.toBBox=function(t){return t},i.prototype.compareMinX=function(t,e){return t.minX-e.minX},i.prototype.compareMinY=function(t,e){return t.minY-e.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(t){return this.data=t,this},i.prototype._all=function(t,e){for(var r=[];t;)t.leaf?e.push.apply(e,t.children):r.push.apply(r,t.children),t=r.pop();return e},i.prototype._build=function(t,e,r,i){var o,a=r-e+1,s=this._maxEntries;if(a<=s)return n(o=f(t.slice(e,r+1)),this.toBBox),o;i||(i=Math.ceil(Math.log(a)/Math.log(s)),s=Math.ceil(a/Math.pow(s,i-1))),(o=f([])).leaf=!1,o.height=i;var l=Math.ceil(a/s),p=l*Math.ceil(Math.sqrt(s));m(t,e,r,p,this.compareMinX);for(var c=e;c<=r;c+=p){var u=Math.min(c+p-1,r);m(t,c,u,l,this.compareMinY);for(var h=c;h<=u;h+=l){var d=Math.min(h+l-1,u);o.children.push(this._build(t,h,d,i-1))}}return n(o,this.toBBox),o},i.prototype._chooseSubtree=function(t,e,r,i){for(;i.push(e),!e.leaf&&i.length-1!==r;){for(var o=1/0,n=1/0,a=void 0,s=0;s<e.children.length;s++){var l=e.children[s],p=c(l),u=(h=t,d=l,(Math.max(d.maxX,h.maxX)-Math.min(d.minX,h.minX))*(Math.max(d.maxY,h.maxY)-Math.min(d.minY,h.minY))-p);u<n?(n=u,o=p<o?p:o,a=l):u===n&&p<o&&(o=p,a=l)}e=a||e.children[0]}var h,d;return e},i.prototype._insert=function(t,e,r){var i=r?t:this.toBBox(t),o=[],n=this._chooseSubtree(i,this.data,e,o);for(n.children.push(t),s(n,i);e>=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(i,o,e)},i.prototype._split=function(t,e){var r=t[e],i=r.children.length,o=this._minEntries;this._chooseSplitAxis(r,o,i);var a=this._chooseSplitIndex(r,o,i),s=f(r.children.splice(a,r.children.length-a));s.height=r.height,s.leaf=r.leaf,n(r,this.toBBox),n(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(r,s)},i.prototype._splitRoot=function(t,e){this.data=f([t,e]),this.data.height=t.height+1,this.data.leaf=!1,n(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(t,e,r){for(var i,o,n,s,l,p,u,h=1/0,d=1/0,f=e;f<=r-e;f++){var m=a(t,0,f,this.toBBox),_=a(t,f,r,this.toBBox),y=(o=m,n=_,s=Math.max(o.minX,n.minX),l=Math.max(o.minY,n.minY),p=Math.min(o.maxX,n.maxX),u=Math.min(o.maxY,n.maxY),Math.max(0,p-s)*Math.max(0,u-l)),g=c(m)+c(_);y<h?(h=y,i=f,d=g<d?g:d):y===h&&g<d&&(d=g,i=f)}return i||r-e},i.prototype._chooseSplitAxis=function(t,e,r){var i=t.leaf?this.compareMinX:l,o=t.leaf?this.compareMinY:p;this._allDistMargin(t,e,r,i)<this._allDistMargin(t,e,r,o)&&t.children.sort(i)},i.prototype._allDistMargin=function(t,e,r,i){t.children.sort(i);for(var o=this.toBBox,n=a(t,0,e,o),l=a(t,r-e,r,o),p=u(n)+u(l),c=e;c<r-e;c++){var h=t.children[c];s(n,t.leaf?o(h):h),p+=u(n)}for(var d=r-e-1;d>=e;d--){var f=t.children[d];s(l,t.leaf?o(f):f),p+=u(l)}return p},i.prototype._adjustParentBBoxes=function(t,e,r){for(var i=r;i>=0;i--)s(e[i],t)},i.prototype._condense=function(t){for(var e=t.length-1,r=void 0;e>=0;e--)0===t[e].children.length?e>0?(r=t[e-1].children).splice(r.indexOf(t[e]),1):this.clear():n(t[e],this.toBBox)},i},"object"==typeof r&&void 0!==e?e.exports=o():(i=i||self).RBush=o();var i,o},{}]},{},[1])(1)}));class ControlMenu{constructor(t){this.post_id=t.post_id;this.div_position=t.div_position}addListeners(){jQuery(document).on("click",`.mapster-control-menu-${this.post_id} .mapster-control-menu-toggle`,(()=>{jQuery(`.mapster-control-menu-${this.post_id} #mapster-control-menu-holder`).is(":visible")?jQuery(`.mapster-control-menu-${this.post_id} #mapster-control-menu-holder`).fadeOut():jQuery(`.mapster-control-menu-${this.post_id} #mapster-control-menu-holder`).fadeIn()}))}onAdd(t){this.map=t;this._container=document.createElement("div");this._container.className=`mapboxgl-ctrl mapster-control-menu mapster-control-menu-${this.post_id}`;this._container.innerHTML=`\n <div>\n ${"above"===this.div_position?"<div id='mapster-control-menu-holder'></div>":""}
1\n <span class="mapster-control-menu-toggle dashicons dashicons-menu"></span>\n ${"below"===this.div_position?"<div id='mapster-control-menu-holder'></div>":""}\n </div>\n `;this.addListeners();return this._container}onRemove(){this._container.parentNode.removeChild(this._container);this._map=void 0}}class CustomHTMLControl{constructor(t){this.custom_html=t.custom_html}onAdd(t){this.map=t;this._container=document.createElement("div");this._container.innerHTML=this.custom_html;return this._container}onRemove(){this._container.parentNode.removeChild(this._container);this._map=void 0}}class DownloadControl{constructor(t){this.post_id=t.post_id;this.interact_with_filters=t.interact_with_filters;this.notify_on_download=t.notify_on_download;this.included_fields=t.included_fields;this.features=t.locations.concat(t.lines.concat(t.polygons))}addListeners(){jQuery(document).on("click",`.mapster-download-control-${this.post_id} .mapster-data-download`,(()=>{this.downloadFeatures()}))}downloadFeatures(){let t=this.processFeatures();t.length>0?this.downloadCSV(t):alert("No features selected for download.")}processFeatures(t){let e=[];this.features.forEach((t=>{if(this.interact_with_filters&&window.mapster_categories_hidden_features&&window.mapster_categories_hidden_features.indexOf(t.id)>-1)return;let r=t.data.location?t.data.location:t.data.line?t.data.line:t.data.polygon?t.data.polygon:null,i={};i.title=t.title;i.permalink=t.permalink;i.categories=t.categories.map((t=>t.name)).join(",");this.getRecursivePropertyValue(i,t.data.additional_details,"");i.geography=JSON.stringify(r);if(this.included_fields&&""!==this.included_fields){let t={};this.included_fields.split(",").forEach((e=>{let r=e.trim();i[r]&&(t[r]=i[r])}));i=t}e.push(i)}));return e}getRecursivePropertyValue(t,e,r){for(let i in e)Array.isArray(e[i])?t[r+i]=e[i].join(","):"object"==typeof e[i]?this.getRecursivePropertyValue(t,e[i],r+i+"_"):t[r+i]=JSON.stringify(e[i])}downloadCSV(t){const e=(t,e)=>null===e?"":e;let r=[];t.forEach((t=>{for(let e in t)-1===r.indexOf(e)&&r.push(e)}));t.forEach((t=>{r.forEach((e=>{t[e]||(t[e]="")}))}));let i=t.map((t=>r.map((r=>JSON.stringify(t[r],e).replace(/\\"/g,'""'))).join(",")));i.unshift(r.join(","));i=i.join("\r\n");var o=document.createElement("a"),n=new Blob(["\ufeff",i]),a=URL.createObjectURL(n);o.href=a;o.download="map-data-download.csv";document.body.appendChild(o);o.click();document.body.removeChild(o);if(this.notify_on_download){let t=[];jQuery(`.mapster-download-control-${this.post_id} .mapster-category-control input`).each((function(){jQuery(this).is(":checked")&&t.push(jQuery(this).closest("li").text().trim())}));fetch(`${window.mapster_params.rest_url}mapster-wp-maps/send-email`,{method:"POST",body:JSON.stringify({users:this.notify_on_download,active_filters:t})})}}onAdd(t){this.map=t;this.storedBounds=this.map.getBounds();this._container=document.createElement("div");if(window.mapster_params.public){this._container.className=`mapboxgl-ctrl mapster-download-control mapster-download-control-${this.post_id}`;this._container.innerHTML='\n <div class="mapster-download-control-content">\n <button class="mapster-data-download">Download Data</button>\n </div>\n ';this.addListeners()}return this._container}onRemove(){this._container.parentNode.removeChild(this._container);this._map=void 0}}class ListControl{constructor(t,e,r,i,o,n){this.MapsterMap=t.MapsterMap;this.post_id=t.post_id;this.sort_by_distance=t.sort_by_distance;this.show_distance=t.show_distance;this.units=t.units;this.group_by_category=t.group_by_category;this.list_order=t.list_order;this.markers=t.markers;this.mapLibrary=t.mapLibrary;this.listing_type=t.listing_type;this.display_images=t.display_images;this.number_of_locations=t.number_of_locations;this.store_locator=t.store_locator_options.enable;this.sort_hours_by_day=t.store_locator_options.sort_hours_by_day;this.features=t.locations.concat(t.lines.concat(t.polygons));this.currentPage=1;this.storedBounds=null;this.storedMapLocation=null;this.storedLastMarkerClick=null;this.openedCategories=[]}storeLocatorHTML(t){return"<div>Upgrade to Mapster Pro to enable this functionality.</div>"}filterFeatures(){const t=new MapsterHelpers;let e=[];
1this.features.forEach(((r,i)=>{if(!(window.mapster_categories_hidden_features&&window.mapster_categories_hidden_features.indexOf(r.id)>-1)){var o=t.makeFeatureJSON(r.data);if(this.show_distance||this.sort_by_distance){var n=turf.distance(turf.center(o).geometry.coordinates,this.getCenter());r.distance=n*("imperial"===this.units?.621371:1)}e.push(r)}}));return e}sortFeatures(t){return this.sort_by_distance?t.sort(((t,e)=>t.distance>e.distance?1:-1)):t}getCategories(){return[]}sortCategories(t){return t}getCategoryListStructure(t){return[]}setCategoryListHTML(t){return""}setHTML(t){new MapsterHelpers;let e="<ul>",r=this.sortFeatures(this.filterFeatures()),i=this.sortCategories(this.getCategories(r));if(this.group_by_category){let t=this.getCategoryListStructure(i,r);e=this.setCategoryListHTML(t)}else{var o=[];r.forEach(((t,e)=>{"paginate"===this.listing_type?this.number_of_locations*(this.currentPage-1)<=e&&this.number_of_locations*this.currentPage>e&&o.push(t):o=r}));this.store_locator?e=this.storeLocatorHTML(e,o):o.forEach((t=>{let r=""; 2e+=`\n <li data-id="${t.id}">\n ${r}\n ${t.title}\n <em>${t.distance?t.distance.toFixed(2)+("imperial"===this.units?" miles":" km"):""}</em>\n </li>\n `}));e+="</ul>"}if("paginate"===this.listing_type){e+='<div class="mapster-paging">';this.currentPage>1&&(e+='<span class="mapster-back dashicons dashicons-arrow-left"></span>');this.number_of_locations*this.currentPage<r.length&&(e+='<span class="mapster-next dashicons dashicons-arrow-right"></span>');e+="</div>"}if(t)return e;jQuery(`.mapster-list-control-${this.post_id} .mapster-list-control-content`).html(e)}getStoreHTML(t){return""}getCenter(){return[this.map.getCenter().lng,this.map.getCenter().lat]}addListeners(){var t=this;const e=new MapsterHelpers;jQuery(document).on("click",`.mapster-list-control-${this.post_id} li`,(function(r,i=!1){if(!(jQuery(this).find(".mapster-accordion-indicator").length>0||r.isTrigger&&3!==r.isTrigger)){var o=t.features.find((t=>parseInt(t.id)==jQuery(this).data("id"))),n=e.makeFeatureJSON(o.data).features[0];if("Point"===n.geometry.type){const e=t.markers.find((t=>t.mapsterProperties.id===o.id));e&&o.data.enable_popup&&t.openPopup(e,o);!e&&o.data.enable_popup&&(i||t.openPopupNonMarker(o));let r=o.data.default_zoom_level&&""!==o.data.default_zoom_level?o.data.default_zoom_level:15;t.centerMap(n.geometry.coordinates,r)}else{o.data.enable_popup&&(i||t.openPopupNonMarker(o));var a=turf.bbox(n);t.fitBounds(a,{padding:20})}if(t.store_locator){jQuery(`.mapster-list-control-${t.post_id} .mapster-list-control-content`).hide();jQuery(`.mapster-list-control-${t.post_id} .mapster-list-control-single-content`).show();jQuery(`.mapster-list-control-${t.post_id} .mapster-list-control-single-content`).html(t.getStoreHTML(o))}}}));jQuery(document).on("click",`.mapster-list-control-${this.post_id} .mapster-accordion-indicator-open, .mapster-list-control-${this.post_id} .mapster-accordion-indicator-closed`,(function(){let e=!1;jQuery(this).hasClass("mapster-accordion-indicator-open")&&(e=!0);if(e){jQuery(this).removeClass("mapster-accordion-indicator-open");jQuery(this).addClass("mapster-accordion-indicator-closed");jQuery(this).next("ul").is(":visible")&&jQuery(this).next("ul").slideToggle();t.openedCategories.splice(t.openedCategories.indexOf(jQuery(this).data("id")),1)}else{jQuery(this).addClass("mapster-accordion-indicator-open");jQuery(this).next("ul").slideToggle();t.openedCategories.push(jQuery(this).data("id"))}}));jQuery(document).on("click",`.mapster-list-control-${this.post_id} .mapster-next`,(()=>{this.currentPage=this.currentPage+1;this.setHTML()}));jQuery(document).on("click",`.mapster-list-control-${this.post_id} .mapster-back`,(()=>{this.currentPage=this.currentPage-1;this.setHTML()}));jQuery(document).on("click",`.mapster-list-control-${this.post_id} .mapster-store-locator-results`,(()=>{jQuery(".mapster-list-control-content").show();jQuery(".mapster-list-control-single-content").hide();jQuery(".mapster-list-control-single-content").empty();this.storedBounds&&this.fitBounds(this.storedBounds);this.storedMapLocation&&(this.map.flyTo?this.map.flyTo(this.storedMapLocation):this.centerMap(this.storedMapLocation.center,this.storedMapLocation.zoom))}));jQuery(document).on("change",`.mapster-list-control-${this.post_id} .mapster-cat-toggle`,(()=>{this.setHTML()}));let r=!1,i=!1;jQuery(document).on("click",".mapster-list-hide-show",(function(){const t=jQuery(this).parent();if(t.find(".mapster-list-control-content").is(":visible")){if(!r){r=t.css("background-color");i=t.css("box-shadow")}t.css("background-color","transparent");t.css("box-shadow","none");t.find(".mapster-list-control-content").fadeOut();t.find(".mapster-list-control-single-content").fadeOut();jQuery(this).text("Show List")}else{const t=jQuery(this).parent();t.css("background-color",r);t.css("box-shadow",i);t.find(".mapster-list-control-content").fadeIn();t.find(".mapster-list-control-single-content").fadeIn();jQuery(this).text("Hide")}}))}openPopup(t,e){new MapsterHelpers;jQuery(t.getElement()).trigger("click")}openPopupNonMarker(t){const e=(new MapsterHelpers).makeFeatureJSON(t.data),r=turf.pointOnFeature(e);this.MapsterMap.doTriggerClick({lngLat:r.geometry.coordinates},t)}centerMap(t,e){this.map.flyTo({center:t,zoom:e})}fitBounds(t,e){this.map.fitBounds(t,e)}onAdd(t){this.map=t;this.storedMapLocation={center:this.map.getCenter(),zoom:this.map.getZoom(),pitch:this.map.getPitch(),bearing:this.map.getBearing()};this._container=document.createElement("div");this._container.className=`mapboxgl-ctrl mapster-list-control mapster-list-control-${this.post_id}`+(this.store_locator?" mapster-store-locator":"")+(window.innerWidth<768?" mapster-mobile":"");this._container.innerHTML=`<div class="mapster-list-control-content" style="max-height : ${jQuery(this.map._container).height()-100}px">`+this.setHTML(!0)+`</div><div class="mapster-list-control-single-content" style="max-height : ${jQuery(this.map._container).height()}px;"></div>`;if(window.innerWidth<768&&this.store_locator){jQuery(this.map._container).css("overflow","visible");this._container.style.marginTop=`${jQuery(this.map._container).height()}px`;jQuery(this.map._container).after(`<div style="height: ${jQuery(this.map._container).height()}px"></div>`);
2jQuery(".maplibregl-control-container > div, .mapboxgl-control-container > div").width("100%");jQuery(".mapboxgl-ctrl-geocoder").width("100%")}window.innerWidth<768&&!this.store_locator&&(this._container.innerHTML='<div class="mapster-list-hide-show">Hide</div>'+this._container.innerHTML);this.addListeners();this.map.on("moveend",(()=>{this.setHTML()}));setTimeout((()=>{this.store_locator&&!jQuery(".mapster-store-locator .mapboxgl-ctrl-geocoder").length&&jQuery(".mapboxgl-ctrl-geocoder").prependTo(".mapster-store-locator")}),100);return this._container}onAddGoogleMap(t){this.map=t;this.storedMapLocation={center:[this.map.getCenter().lng(),this.map.getCenter().lat()],zoom:this.map.getZoom()};this._container=document.createElement("div");this._container.className=`mapboxgl-ctrl mapster-list-control mapster-list-control-${this.post_id} mapster-list-control-google`+(this.store_locator?" mapster-store-locator":"")+(window.innerWidth<768?" mapster-mobile":"");this._container.innerHTML=`<div class="mapster-list-control-content" style="max-height : ${jQuery(this.map.__gm.developerProvidedDiv).height()-100}px">`+this.setHTML(!0)+`</div><div class="mapster-list-control-single-content" style="max-height : ${jQuery(this.map.__gm.developerProvidedDiv).height()}px;"></div>`;this.addListeners();this.map.addListener("dragend",(()=>{this.setHTML()}));google.maps.event.addListenerOnce(this.map,"idle",(()=>{this.store_locator&&setTimeout((()=>{jQuery(".mapster-google-geocoder-input").addClass("geocoder-google-store-locator");jQuery(".mapster-google-geocoder-input").prependTo(".mapster-store-locator")}),1e3);const t=this.map.getBounds();
2this.storedBounds=[t.getSouthWest().lng(),t.getSouthWest().lat(),t.getNorthEast().lng(),t.getNorthEast().lat()]}));return this._container}onRemove(){this._container.parentNode.removeChild(this._container);this._map=void 0}} 3;class PitchToggle{constructor(t=-20,e=70,r=null){this._bearing=-20;this._pitch=70;this._minpitchzoom=r}onAdd(t){this._map=t;let e=this;this._btn=document.createElement("button");this._btn.className="mapboxgl-ctrl-icon mapboxgl-ctrl-pitchtoggle-3d";this._btn.type="button";this._btn["aria-label"]="Toggle Pitch";this._btn.onclick=function(){if(0===t.getPitch()){let r={pitch:e._pitch,bearing:e._bearing};e._minpitchzoom&&t.getZoom()>e._minpitchzoom&&(r.zoom=e._minpitchzoom);t.easeTo(r);e._btn.className="mapboxgl-ctrl-icon mapboxgl-ctrl-pitchtoggle-2d"}else{t.easeTo({pitch:0,bearing:0});e._btn.className="mapboxgl-ctrl-icon mapboxgl-ctrl-pitchtoggle-3d"}};this._container=document.createElement("div");this._container.className="mapboxgl-ctrl-group mapboxgl-ctrl";this._container.appendChild(this._btn);return this._container}onRemove(){this._container.parentNode.removeChild(this._container);this._map=void 0}}class PrintControl{constructor(){}onAdd(t){this._map=t;let e=this;this._btn=document.createElement("button");this._btn.className="mapboxgl-ctrl-icon mapboxgl-ctrl-printcontrol";this._btn.type="button";this._btn["aria-label"]="Print";this._btn.innerHTML='\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16" style="margin-top: 3px;">\n <path d="M5 1a2 2 0 0 0-2 2v1h10V3a2 2 0 0 0-2-2zm6 8H5a1 1 0 0 0-1 1v3a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1"/>\n <path d="M0 7a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2h-1v-2a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2H2a2 2 0 0 1-2-2zm2.5 1a.5.5 0 1 0 0-1 .5.5 0 0 0 0 1"/>\n </svg>\n ';this._btn.onclick=function(){ 4};this._container=document.createElement("div");this._container.className="mapboxgl-ctrl-group mapboxgl-ctrl";this._container.appendChild(this._btn);return this._container}printMap(){"devicePixelRatio"in window||Object.defineProperty(window,"devicePixelRatio",{get:function(){return 3.125}});const t=document.createElement("canvas"),e=this._map.getCanvas().width,r=this._map.getCanvas().height;t.width=e;t.height=r;const i=t.getContext("2d"),o=new Image;o.onload=function(){i.fillStyle="#333";i.fillRect(0,0,e,r);i.drawImage(o,0,0);let n=document.createElement("a");n.download="image.png";n.href=t.toDataURL("image/png",.92);n.click()};o.src=this._map.getCanvas().toDataURL("image/png")}onRemove(){this._container.parentNode.removeChild(this._container);this._map=void 0}}class CategoryControl{constructor(t){this.post_id=t.post_id;this.displayMode=t.category_display;this.checkboxMode=t.checkbox_display;this.initialVisibility=t.initial_visibility;this.preSelectedCategories=t.pre_selected_categories;this.categoryOrder=t.category_order;this.independentChildren=t.independent_children;this.excludedCategories=t.excluded_categories;this.functionality=t.functionality;this.additional_filters=t.additional_filters;this.reset_button=t.reset_button;this.accordion_layout=t.accordion_layout;this.parent_cat_display=t.parent_cat_display;this.show_number_of_features=t.show_number_of_features;this.did_one_accordion=!1;this.markers=t.markers;this.map_provider=t.map_provider;this.circle_clustering=t.circle_clustering;this.label_icon_clustering=t.label_icon_clustering;this.marker_clustering=t.marker_clustering;this.polygon_clustering=t.polygon_clustering;this.line_clustering=t.line_clustering;this.cluster_options=t.cluster_options;this.features=t.locations.concat(t.lines.concat(t.polygons));this.dataLayers=t.dataLayers;this.locations=t.locations;this.lines=t.lines;this.polygons=t.polygons}setMarkers(t){this.markers=t}organizeCategories(){let t=[];this.features.forEach((e=>{e.categories.forEach((e=>{-1===t.findIndex((t=>t.id===e.id))&&t.push(e)}))}));t=this.filterCategories(t);t=this.sortCategories(t);return t}returnHTML(){return`\n <div>\n ${this.returnCategoryHTML(this.organizeCategories())}\n </div>\n `}returnCategoryHTML(t){var e="<ul>";t.filter((t=>
40===t.parent)).forEach(((r,i)=>{var o=t.filter((t=>t.parent===r.id));e+=this.returnInputHTML(r,o);e+=this.returnChildrenHTML(r,t)}));return e+="</ul>"}returnChildrenHTML(t,e){var r="<ul>",i=e.filter((e=>e.parent===t.id));i.forEach((t=>{r+=this.returnInputHTML(t,[]);r+=this.returnChildrenHTML(t,e)}));r+="</ul>";0===i.length&&(r="");return r}returnInputHTML(t,e){var r=!0;this.initialVisibility||this.preSelectedCategories&&(!this.preSelectedCategories||-1!==this.preSelectedCategories.indexOf(t.id))||(r=!1);return this.returnAccordionHTML(`\n <li>\n ${"checkbox"===this.checkboxMode?`\n <input\n class="mapster-cat-toggle"\n id="${t.id}"\n data-term="${t.id}"\n data-parent="${t.parent}" ${r?'checked="checked"':""}\n style="display: ${this.parent_cat_display&&"hide_check"===this.parent_cat_display&&0===t.parent?"none":""}"\n type="checkbox" />\n `:`\n <label\n class="mapster-switch"\n style="display: ${this.parent_cat_display&&"hide_check"===this.parent_cat_display&&0===t.parent?"none":""}">\n <input class="mapster-cat-toggle" id="${t.id}" data-term="${t.id}" data-parent="${t.parent}" ${r?'checked="checked"':""} type="checkbox" />\n <span class="mapster-slider mapster-round"></span>\n </label>\n `}\n ${"colors"===this.displayMode?`<div class="mapster-color-swatch" style="background-color: ${t.color};"></div>`:""}\n ${"icons"===this.displayMode?`<div class="mapster-icon-swatch" style="background-image: url(${t.icon});background-size: cover;"></div>`:""}\n <label for="${t.id}">${t.name} ${this.returnNumberOfFeatures(t)?`<span class="mapster-number-of-features">(${this.returnNumberOfFeatures(t)})</span>`:""}</label>\n </li>\n `,t,e)}setToggles(t){var e=jQuery(t).data("term"),r=jQuery(t).data("parent"),i=jQuery(t).is(":checked");if(!this.independentChildren)if(0===r)i?jQuery(`.mapster-category-control-${this.post_id} .mapster-cat-toggle[data-parent="${e}"]`).prop("checked",!0):jQuery(`.mapster-category-control-${this.post_id} .mapster-cat-toggle[data-parent="${e}"]`).prop("checked",!1);else if(i)jQuery(`.mapster-category-control-${this.post_id} .mapster-cat-toggle[data-term="${r}"]`).prop("checked",!0);else{var o=!0;jQuery(`.mapster-category-control-${this.post_id} .mapster-cat-toggle[data-parent="${r}"]`).each((function(){jQuery(this).is(":checked")&&(o=!1)}));o&&jQuery(`.mapster-category-control-${this.post_id} .mapster-cat-toggle[data-term="${r}"]`).prop("checked",!1)}}returnIDsToHideFeatures(t){let e=[];this.features.forEach((r=>{if(r.categories.length>0)if("exclusive"===this.functionality)r.categories.find((e=>t.indexOf(e.id)>-1))&&e.push(r.id);else if("inclusive"===this.functionality){var i=!0;r.categories.forEach((e=>{-1===t.indexOf(e.id)&&(i=!1)}));i&&e.push(r.id)}}));return e}returnNumberOfFeatures(){return!1}adjustMarkers(t){let e=[];this.markers.forEach((r=>{const i=this.returnMarkerProperties(r);if(i.categories.length>0)if("exclusive"===this.functionality)if(i.categories.find((e=>t.indexOf(e.id)>-1))){this.changeMarker("hide",r);e.push(r.mapsterProperties.id)}else this.changeMarker("show",r);else if("inclusive"===this.functionality){var o=!0;if(i.categories.length>0){i.categories.forEach((e=>{-1===t.indexOf(e.id)&&(o=!1)}));if(o){this.changeMarker("hide",r);e.push(r.mapsterProperties.id)}else this.changeMarker("show",r)}}}));this.adjustMarkerClusters(e)}adjustMarkerClusters(t){if(this.marker_clustering){let e=["marker"];(new MapsterHelpers).makeClusters(this.map,this.map_provider,this.cluster_options,e,this.locations,[],[],t)}}returnAccordionHTML(t,e,r){return t}filterCategories(t){return t}sortCategories(t){return t}changeMarker(t,e){"hide"===t?e.remove():"show"===t&&e.addTo(this.map)}changeLayerVisibility(){var t=this,e=[];jQuery(`.mapster-category-control-${this.post_id} .mapster-cat-toggle`).each((function(){jQuery(this).is(":checked")||e.push(jQuery(this).data("term"));"1"===window.mapster_params.activated&&t.parent_cat_display&&"hide_check"===t.parent_cat_display&&0===jQuery(this).data("parent")&&jQuery(this).parent().next().is("ul")&&e.push(jQuery(this).data("term"))}));var r=this.returnIDsToHideFeatures(e);this.setHiddenFeatures(r);this.adjustMarkers(e);this.map.fire("moveend")}setHiddenFeatures(t){const e=new MapsterHelpers;if(this.map.getLayer("symbol")){this.map.getLayer("symbol-clusters")&&e.setClustering(this.map,this.map_provider,this.cluster_options,this.circle_clustering,this.label_icon_clustering,this.marker_clustering,this.polygon_clustering,this.line_clustering,this.markers,this.locations,this.lines,this.polygons,t);let r=this.locations.filter((e=>-1===t.indexOf(e.id))),i=e.createLayerGeoJSON(this.map,"location","symbol",r,[],[],[]);this.map.getSource("symbol").setData(i)}this.map.getStyle().layers.find((t=>
4"circle"===t.type&&t.id.indexOf("clusters")>-1))&&e.setClustering(this.map,this.map_provider,this.cluster_options,this.circle_clustering,this.label_icon_clustering,this.marker_clustering,this.polygon_clustering,this.line_clustering,this.markers,this.locations,this.lines,this.polygons,t);if(this.map.getLayer("circle")){this.map.setPaintProperty("circle","circle-radius",["case",["in",["get","post_id"],["literal",t]],0,["has","circle_radius"],["to-number",["get","circle_radius"]],0]);this.map.setPaintProperty("circle","circle-stroke-width",["case",["in",["get","post_id"],["literal",t]],0,["has",'"circle_stroke-width"'],["to-number",["get",'"circle_stroke-width"']],0])}this.map.getLayer("line")&&this.map.setPaintProperty("line","line-width",["case",["in",["get","post_id"],["literal",t]],0,["has","width"],["to-number",["get","width"]],2]);if(this.map.getLayer("fill")){const e=new MapsterHelpers;let r=this.polygons.filter((e=>-1===t.indexOf(e.id))),i=e.createLayerGeoJSON(this.map,"polygon","fill",[],[],r,[]);this.map.getSource("fill").setData(i)}if(this.map.getLayer("fill-extrusion")){const e=new MapsterHelpers;let r=this.polygons.filter((e=>-1===t.indexOf(e.id))),i=e.createLayerGeoJSON(this.map,"polygon","fill-extrusion",[],[],r,[]);this.map.getSource("fill-extrusion").setData(i)}}returnMarkerProperties(t){return t.mapsterProperties}addResetButton(){if(this.reset_button){let t=this;jQuery(document).on("click",`.mapster-category-control-${this.post_id} #mapster-reset-categories`,(function(){jQuery(`.mapster-category-control-${t.post_id} .mapster-cat-toggle`).each((function(){let e=jQuery(this).data("term");var r=!0;t.initialVisibility||t.preSelectedCategories&&(!t.preSelectedCategories||-1!==t.preSelectedCategories.indexOf(e))||(r=!1);jQuery(this).prop("checked",r)}));t.changeLayerVisibility()}));return'<button id="mapster-reset-categories">Reset</button>'}return""}addListeners(){var t=this;jQuery(document).on("change",`.mapster-category-control-${this.post_id} .mapster-cat-toggle`,(function(){t.setToggles(this);t.changeLayerVisibility()}));jQuery(document).on("click",`.mapster-category-control-${this.post_id} .mapster-accordion-indicator`,(function(){let e=!1;jQuery(this).parent().hasClass("mapster-accordion-indicator-open")&&(e=!0);jQuery(`.mapster-category-control-${t.post_id} .mapster-accordion-indicator`).each((function(){if(jQuery(this).parent().next("ul").is(":visible")){jQuery(this).parent().next("ul").slideToggle(400,(()=>jQuery(this).parent().addClass("mapster-accordion-indicator-closed")));jQuery(this).parent().removeClass("mapster-accordion-indicator-open")}}));if(e)jQuery(this).parent().addClass("mapster-accordion-indicator-closed");else{jQuery(this).parent().addClass("mapster-accordion-indicator-open");jQuery(this).parent().next("ul").slideToggle()}}))}onAdd(t){this.map=t;this._container=document.createElement("div");this._container.className=`mapboxgl-ctrl mapster-category-control mapster-category-control-${this.post_id}`;this._container.innerHTML=this.returnHTML();this.initialVisibility||setTimeout((()=>{this.changeLayerVisibility()}),10);this.addListeners();return this._container}onAddGoogleMap(t){this.map=t;this._container=document.createElement("div");this._container.className=`mapster-category-control mapster-google-category-control mapster-category-control-${this.post_id}`;this._container.innerHTML=this.returnHTML();this.addListeners();return this._container}onRemove(){this._container.parentNode.removeChild(this._container);this.map=void 0}} 5;class LayerControl{constructor(t){this.post_id=t.post_id;this.toggleable_layers=t.toggleable_layers;this.toggleable_layer_titles=t.toggleable_layer_titles;this.checkbox_type=t.checkbox_type}returnHTML(){let t='<ul class="mapster-layer-control-content">';const e=this.toggleable_layers.replace("\r","").split("\n"),r=this.toggleable_layer_titles.replace("\r","").split("\n");e.forEach(((e,i)=>{t+="<li>";const o=e.split(",");let n=!0,a=!0;o.forEach((t=>{if(""!==t){this.map.getLayer(t.trim())||(n=!1);
5"hidden"!==this.map.getLayoutProperty(t.trim(),"visibility")&&void 0===this.map.getLayoutProperty(t.trim(),"visibility")||(a=!1)}}));n?"checkbox"===this.checkbox_type?t+=`<input class="mapster-layer-toggle" data-layers="${e}" ${a?'checked="checked"':""} type="checkbox" /> ${r[i]}`:"radio"===this.checkbox_type?t+=`<input name="mapster-layer-control" class="mapster-layer-toggle" data-layers="${e}" ${a?'checked="checked"':""} type="radio" /> ${r[i]}`:"switch"===this.checkbox_type&&(t+=`<label class="mapster-switch">\n <input class="mapster-layer-toggle" data-layers="${e}" ${a?'checked="checked"':""} type="checkbox" />\n <span class="mapster-slider mapster-round"></span>\n </label> ${r[i]}`):alert("Please double check the layers you've set for the layer control: some don't exist in the style!");t+="</li>"}));t+="</ul>";return t}changeLayerVisibility(){let t=this;jQuery(`.mapster-layer-control-${this.post_id} .mapster-layer-toggle`).each((function(){jQuery(this).data("layers").split(",").forEach((e=>{jQuery(this).is(":checked")?t.map.setLayoutProperty(e.trim(),"visibility","visible"):t.map.setLayoutProperty(e.trim(),"visibility","none")}))}))}addListeners(){var t=this;jQuery(document).on("change",`.mapster-layer-control-${this.post_id} .mapster-layer-toggle`,(function(){t.changeLayerVisibility()}))}onAdd(t){this.map=t;this._container=document.createElement("div");this._container.className=`mapboxgl-ctrl mapster-layer-control mapster-layer-control-${this.post_id}`;const e=setInterval((()=>{if(this.map.isStyleLoaded()){this._container.innerHTML=this.returnHTML();clearInterval(e)}}),100);this.addListeners();return this._container}onRemove(){this._container.parentNode.removeChild(this._container);this._map=void 0}}class StyleControl{constructor(t){this.post_id=t.post_id;this.toggleable_styles=t.toggleable_styles;this.toggleable_styles_titles=t.toggleable_styles_titles;this.initial_style_title=t.initial_style_title;this.map_type=t.map_type;this.default_style=!1}returnHTML(){let t='<ul class="mapster-style-control-content">';const e=new MapsterHelpers;this.default_style=e.getStyle(this.map_type);this.map_type.custom_style_json&&""!==this.map_type.custom_style_json&&(this.default_style=JSON.parse(this.map_type.custom_style_json));t+=`<li><input name="mapster-style-control" class="mapster-style-toggle" data-index="default" checked="checked" type="radio" /> ${this.initial_style_title}`;const r=this.toggleable_styles.replace("\r","").split("\n"),i=this.toggleable_styles_titles.replace("\r","").split("\n");r.forEach(((e,r)=>{if(""!==e){t+="<li>";t+=`<input name="mapster-style-control" class="mapster-style-toggle" data-index="${r}" type="radio" /> ${i[r]}`;t+="</li>"}}));t+="</ul>";return t}addListeners(){var t=this;new MapsterHelpers;jQuery(document).on("change",`.mapster-style-control-${this.post_id} .mapster-style-toggle`,(function(){const e=jQuery(this).data("index");if("default"!==e){const r=t.toggleable_styles.split("\n");r[e].indexOf("{")>-1?t.map.setStyle(JSON.parse(r[e])):t.map.setStyle(r[e]);t.map.fire("mapster_custom_style_load")}else{t.map.setStyle(t.default_style);t.map.fire("mapster_custom_style_load")}}))}onAdd(t){this.map=t;this._container=document.createElement("div");this._container.className=`mapboxgl-ctrl mapster-style-control mapster-style-control-${this.post_id}`;const e=setInterval((()=>{if(this.map.isStyleLoaded()){this._container.innerHTML=this.returnHTML();clearInterval(e)}}),100);this.addListeners();return this._container}onRemove(){this._container.parentNode.removeChild(this._container);this._map=void 0}}class ElevationControl{constructor(t){this.lines=t.lines;this.post_id=t.post_id;this.single_line=t.single_line;this.open_on_load=t.open_on_load;this.profile_color=t.profile_color;this.units=t.units;this.show_line_length=t.show_line_length;this.profile_displayed=!1;this.last_line_displayed=!1}addListeners(){jQuery(document).on("click",`.mapster-elevation-control-${this.post_id} .mapster-elevation-control-content`,(()=>{if(this.profile_displayed){this.removeElevation();this.profile_displayed=!1;jQuery(`.mapster-elevation-control-${this.post_id} .mapster-elevation-control-content`).removeClass("mapster-elevation-control-active")}else{if(this.map.getSource("mapbox-dem"))this.addElevation(this.last_line_displayed);else{this.loadElevationData();this.map.once("idle",(()=>{this.addElevation(this.last_line_displayed)}))}this.profile_displayed=!0;jQuery(`.mapster-elevation-control-${this.post_id} .mapster-elevation-control-content`).addClass("mapster-elevation-control-active")}}));this.single_line&&this.open_on_load&&setTimeout((()=>{this.last_line_displayed=this.lines[0];jQuery(`.mapster-elevation-control-${this.post_id} .mapster-elevation-control-content`).click()}),1e3);this.single_line||this.map.on("click","line",(t=>{this.last_line_displayed=this.lines.find((e=>e.id===t.features[0].properties.post_id));this.profile_displayed&&jQuery(`.mapster-elevation-control-${this.post_id} .mapster-elevation-control-content`).click();jQuery(`.mapster-elevation-control-${this.post_id} .mapster-elevation-control-content`).click()}));this.map.on("mousemove",(()=>
5{this.map.getLayer("elevation-point-along-layer")&&this.map.setLayoutProperty("elevation-point-along-layer","visibility","none")}))}loadElevationData(){this.map.addSource("mapbox-dem",{type:"raster-dem",url:"mapbox://mapbox.terrain-rgb",tileSize:512,maxzoom:14});this.map.setTerrain({source:"mapbox-dem",exaggeration:1.5})}removeElevation(){document.getElementById("mapster-chartjs-container").remove()}addElevation(t){let e=[],r=turf.length(t.data.line);for(let i=0;i<r;i+=r/50){let r=turf.along(t.data.line,i),o=this.map.queryTerrainElevation(r.geometry.coordinates,{exaggerated:!1});"feet"===this.units&&(o*=3.28084);e.push(o)}let i=document.createElement("div");i.setAttribute("id","mapster-chartjs-container");let o=document.createElement("canvas");o.setAttribute("id","mapster-chartjs");document.getElementById(`mapster-wp-maps-${this.post_id}`).append(i);i.append(o);const n=new MapsterConstants;let a=e.map((t=>""));if(this.show_line_length){a=[];e.forEach(((t,e)=>{let i=r/50;"feet"===this.units&&(i*=.621371);let o=parseInt(e*i*10)/10;a.push(o)}))}new Chart(document.getElementById("mapster-chartjs"),{type:"line",data:{labels:a,datasets:[{label:"Elevation",data:e,fill:!1,borderColor:this.profile_color,pointRadius:0,tension:.2}]},options:n.returnElevationChartOptions(this.units,this.show_line_length),plugins:[n.returnElevationChartPlugin(this.map,t)]})}onAdd(t){this.map=t;this.storedBounds=this.map.getBounds();this._container=document.createElement("div");if(window.mapster_params.public){this._container.className=`mapboxgl-ctrl mapster-elevation-control mapster-elevation-control-${this.post_id}`;this._container.innerHTML='\n <div class="mapster-elevation-control-content">\n <svg class="mapster-svg-mountain" focusable="false" viewBox="0 0 24 24" aria-hidden="true">\n <path d="M14 6l-3.75 5 2.85 3.8-1.6 1.2C9.81 13.75 7 10 7 10l-6 8h22L14 6z"></path>\n </svg>\n </div>\n ';this.addListeners()}return this._container}onRemove(){this._container.parentNode.removeChild(this._container);this._map=void 0}}class MapsterConstants{returnElevationChartPlugin(t,e){return{id:"corsair",afterInit:t=>{t.corsair={x:0,y:0}},afterEvent:(t,e)=>{const{chartArea:{top:r,bottom:i,left:o,right:n}}=t,{event:{x:a,y:s}}=e;if(a<o||a>n||s<r||s>i){t.corsair={x:a,y:s,draw:!1};t.draw()}else{t.corsair={x:a,y:s,draw:!0};t.draw()}},afterDatasetsDraw:(r,i,o)=>{const{ctx:n,chartArea:{top:a,bottom:s,left:l,right:p}}=r,{x:c,y:u,draw:h}=r.corsair;if(!h)return;n.lineWidth=o.width||0;n.setLineDash(o.dash||[]);n.strokeStyle=o.color||"black";n.save();n.beginPath();n.moveTo(c,s);n.lineTo(c,a);n.stroke();n.restore();const d=(c-l)/(p-l);let f=turf.length(e.data.line),m=turf.along(e.data.line,f*d);if(t.getSource("elevation-point-along")&&t.getLayer("elevation-point-along-layer")){t.getSource("elevation-point-along").setData(m);t.setLayoutProperty("elevation-point-along-layer","visibility","visible")}else{t.addSource("elevation-point-along",{type:"geojson",data:m});t.addLayer({id:"elevation-point-along-layer",type:"circle",source:"elevation-point-along"})}}}}returnElevationChartOptions(t,e){return{interaction:{intersect:!1,mode:"index"},scales:{x:{title:{display:!!e,text:"meters"===t?"KM":"Miles",font:{style:"italic",size:10}},grid:{display:!0},ticks:{font:{size:10}}}},maintainAspectRatio:!1,plugins:{legend:{display:!1},title:{display:!0,text:`Elevation (${"meters"===t?"m":"ft"})`},tooltip:{displayColors:!1,callbacks:{label:function(e){return parseInt(10*e.parsed.y)/10+" "+("meters"===t?"m":"ft")}}},corsair:{color:"#333",width:1}}}}returnStyleProviders(){let t=[{id:"standard-day",style:"mapbox://styles/mapbox/standard",lighting:"day"},{id:"standard-night",style:"mapbox://styles/mapbox/standard",lighting:"night"},{id:"standard-dusk",style:"mapbox://styles/mapbox/standard",lighting:"dusk"},{id:"standard-dawn",style:"mapbox://styles/mapbox/standard",lighting:"dawn"},{id:"standard-satellite-day",style:"mapbox://styles/mapbox/standard-satellite",lighting:"day"},{id:"standard-satellite-night",style:"mapbox://styles/mapbox/standard-satellite",lighting:"night"},{id:"streets",style:"mapbox://styles/mapbox/streets-v12"},{id:"outdoors",style:"mapbox://styles/mapbox/outdoors-v12"},{id:"light",style:"mapbox://styles/mapbox/light-v11"},{id:"dark",style:"mapbox://styles/mapbox/dark-v11"},{id:"satellite",style:"mapbox://styles/mapbox/satellite-v9"},{id:"satellite-streets",style:"mapbox://styles/mapbox/satellite-streets-v12"},{id:"navigation-day",style:"mapbox://styles/mapbox/navigation-day-v1"},{id:"navigation-night",style:"mapbox://styles/mapbox/navigation-night-v1"},{id:"custom-image",style:{version:8,glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf",sources:{},layers:[{id:"background",type:"background",paint:{"background-color":"rgba(255,255,255,1)"}}]}},{id:"empty",style:{version:8,glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf",sources:{},layers:[{id:"background",type:"background",paint:{"background-color":"rgba(255,255,255,1)"}}]}},{id:"open-street-map",style:this.returnJsonStyle("https://a.tile.openstreetmap.org/{z}/{x}/{y}.png",'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors')},{id:"open-topo-map",style:this.returnJsonStyle("https://a.tile.opentopomap.org/{z}/{x}/{y}.png",'Map data: © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, <a href="https://viewfinderpanoramas.org">SRTM</a> | Map style: © <a href="https://opentopomap.org">OpenTopoMap</a> (<a href="https://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA</a>)')},{id:"hot-osm",style:this.returnJsonStyle("https://a.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png",'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, Tiles style by <a href="https://www.hotosm.org/" target="_blank">Humanitarian OpenStreetMap Team</a> hosted by <a href="https://openstreetmap.fr/" target="_blank">OpenStreetMap France</a>')},{id:"cyclo-osm",style:this.returnJsonStyle("https://a.tile-cyclosm.openstreetmap.fr/cyclosm/{z}/{x}/{y}.png",'<a href="https://github.com/cyclosm/cyclosm-cartocss-style/releases" title="CyclOSM - Open Bicycle render">CyclOSM</a> | Map data: © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors')},{id:"toner-stamen",style:this.returnJsonStyle("https://tiles.stadiamaps.com/tiles/stamen_toner/{z}/{x}/{y}.png",'Map tiles by <a href="https://stamen.com">Stamen Design</a>, <a href="https://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> — Map data © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors')},{id:"watercolor-stamen",style:this.returnJsonStyle("https://tiles.stadiamaps.com/tiles/stamen_watercolor/{z}/{x}/{y}.jpg",'Map tiles by <a href="https://stamen.com">Stamen Design</a>, <a href="https://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> — Map data © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors')},{id:"terrain-stamen",style:this.returnJsonStyle("https://tiles.stadiamaps.com/tiles/stamen_terrain/{z}/{x}/{y}.png",'Map tiles by <a href="https://stamen.com">Stamen Design</a>, <a href="https://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> — Map data © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors')},{id:"esri-satellite",style:this.returnJsonStyle("https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}","Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community")},{id:"esri-topo",style:this.returnJsonStyle("https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}","Tiles © Esri — Esri, DeLorme, NAVTEQ, TomTom, Intermap, iPC, USGS, FAO, NPS, NRCAN, GeoBase, Kadaster NL, Ordnance Survey, Esri Japan, METI, Esri China (Hong Kong), and the GIS User Community")},{id:"esri-hybrid",style:"https://raw.githubusercontent.com/go2garret/maps/main/sr
5c/assets/json/arcgis_hybrid.json"},{id:"dark-matter",style:"https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json"},{id:"dark-matter-nolabels",style:"https://basemaps.cartocdn.com/gl/dark-matter-nolabels-gl-style/style.json"},{id:"positron",style:"https://basemaps.cartocdn.com/gl/positron-gl-style/style.json"},{id:"positron-nolabels",style:"https://basemaps.cartocdn.com/gl/positron-nolabels-gl-style/style.json"},{id:"voyager",style:"https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json"},{id:"voyager-nolabels",style:"https://basemaps.cartocdn.com/gl/voyager-nolabels-gl-style/style.json"},{id:"icgc-main",style:"https://geoserveis.icgc.cat/contextmaps/icgc.json"},{id:"icgc-dark",style:"https://geoserveis.icgc.cat/contextmaps/icgc_mapa_base_fosc.json"},{id:"icgc-orthophoto",style:"https://geoserveis.icgc.cat/contextmaps/icgc_orto_estandard.json"},{id:"blank-map",style:this.returnJsonStyle("https://a.tile.openstreetmap.org/{z}/{x}/{y}.png",'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors')}];if("1"===window.mapster_params.activated){let e=[{id:"mapster-unicorn",style:"mapbox://styles/mapstertech/cm10x5cvq02n401pwhdpncvrj"},{id:"mapster-minimo",style:"mapbox://styles/mapstertech/cm12g9n3g00t501rbej0m74bv"},{id:"mapster-whaam",style:"mapbox://styles/mapstertech/cm15kgcun033l01r793jh5b30"},{id:"mapster-standard-oil",style:"mapbox://styles/mapstertech/cm12g8j4t03ao01pq9wm99p54"},{id:"mapster-blueprint",style:"mapbox://styles/mapstertech/cm12g880g00t401rb9yc32icp"},{id:"mapster-frank",style:"mapbox://styles/mapstertech/cm12g7tw303an01pqh7vr9sp4"},{id:"mapster-pencil",style:"mapbox://styles/mapstertech/cm10xd4pn02g501rggzgifof7"},{id:"mapster-bubble",style:"mapbox://styles/mapstertech/cm10xc01702g401rg1hmg4db8"},{id:"mapster-memory",style:"mapbox://styles/mapstertech/cm10xaa8m020g01pq4ueh42z2"},{id:"mapster-neon-glow",style:"mapbox://styles/mapstertech/cm10x86ma00l601r74d7a7rfw"},{id:"mapster-vintage",style:"mapbox://styles/mapstertech/cm15klhbj033m01r70dwy5ap8"},{id:"mapster-swiss-ski",style:"mapbox://styles/mapstertech/cm15klq59018k01q13nz0eo5k"},{id:"mapster-neon",style:"mapbox://styles/mapstertech/cm15km0rx023b01rb6v7ieds5"},{id:"mapster-monochrome-blue",style:"mapbox://styles/mapstertech/cm15km82m018l01q1aha7e04l"},{id:"mapster-camouflage",style:"mapbox://styles/mapstertech/cm15l1x1g018n01q127v8g0pu"},{id:"mapster-bright",style:"mapbox://styles/mapstertech/cm15l28wo023c01rb3ukd02j6"}];t=t.concat(e)}return t}returnJsonStyle(t,e){return{version:8,glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf",sources:{"raster-tiles":{type:"raster",tiles:[t],tileSize:256,attribution:e}},layers:[{id:"simple-tiles",type:"raster",source:"raster-tiles",minzoom:0,maxzoom:22}]}}defaultLoader(){return"\n <svg width='38' height='38' viewBox='0 0 38 38' xmlns='https://www.w3.org/2000/svg' stroke='#333'>\n <g fill='none' fill-rule='evenodd'>\n <g transform='translate(1 1)' stroke-width='2'>\n <circle stroke-opacity='.5' cx='18' cy='18' r='18'/>\n <path d='M36 18c0-9.94-8.06-18-18-18'>\n <animateTransform\n attributeName='transform'\n type='rotate'\n from='0 18 18'\n to='360 18 18'\n dur='1s'\n repeatCount='indefinite'/>\n </path>\n </g>\n </g>\n </svg>"}loaderHTML(t){let e=this.defaultLoader(),r="rgba(255,255,255,0.6)";if("1"===window.mapster_params.activated&&t&&t.loading_graphic){e=t.loading_graphic.replace("svg",`svg stroke="${t.loader_color}" fill="${t.loader_color}"`);t.background_color&&(r=t.background_color);"custom"===t.loading_graphic&&(e=`<img src="${t.custom_loader}" />`)}return`\n\t\t\t<div class="mapster-map-loader" style="background-color:${r}">\n\t\t\t\t${e}\n\t\t\t</div>\n\t\t`}markerAsSVG(t){return"data:image/svg+xml;charset=UTF-8,"+encodeURIComponent(`\n <svg display="block" height="41px" width="27px" viewBox="0 0 27 41" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <g fill-rule="nonzero">\n <g transform="translate(3.0, 29.0)" fill="#000000">\n <ellipse opacity="0.04" cx="10.5" cy="5.80029008" rx="10.5" ry="5.25002273"></ellipse>\n <ellipse opacity="0.04" cx="10.5" cy="5.80029008" rx="10.5" ry="5.25002273"></ellipse>\n <ellipse opacity="0.04" cx="10.5" cy="5.80029008" rx="9.5" ry="4.77275007"></ellipse>\n <ellipse opacity="0.04" cx="10.5" cy="5.80029008" rx="8.5" ry="4.29549936"></ellipse>\n <ellipse opacity="0.04" cx="10.5" cy="5.80029008" rx="7.5" ry="3.81822308"></ellipse>\n <ellipse opacity="0.04" cx="10.5" cy="5.80029008" rx="6.5" ry="3.34094679"></ellipse>\n <ellipse opacity="0.04" cx="10.5" cy="5.80029008" rx="5.5" ry="2.86367051"></ellipse>\n <ellipse opacity="0.04" cx="10.5" cy="5.80029008" rx="4.5" ry="2.38636864"></ellipse>\n </g>\n <g fill="${t}">\n <path 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"></path>\n </g>\n <g opacity="0.25" fill="${t}">\n <path 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"></path>\n </g>\n <g transform="translate(6.0, 7.0)" fill="#FFFFFF"></g>\n <g transform="translate(8.0, 8.0)">\n <circle fill="${t}" opacity="0.25" cx="5.5" cy="5.5" r="5.4999962"></circle>\n <circle fill="#FFFFFF" cx="5.5" cy="5.5" r="5.4999962"></circle>\n </g>\n </g>\n </svg>\n `)}}class MapsterHelpers{constructor(){this.queuedImages=[]}isMobile(){let t=!1;/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&(t=!0);return t}changeCursor(t,e,r){e&&e.data&&(e.data.enable_popup||e.data.open_link_on_click)&&(t.getCanvas().style.cursor="on"===r?"pointer":"grab")}formatResponse(t){["location","line","polygon"].forEach((e=>{t[e+"s"].forEach((r=>{this.setObjectProperties(r,t[e+"_template"]);this.setPopupStyles(r,t.popup_styles)}))}));return new Promise((e=>{e(t)}))}simulateMouseActions(t,e,r,i,o,n,a){const s=i.find((t=>t.mapsterProperties.id===parseInt(r)));if(s){let t=s.mapsterProperties.data.default_zoom_level&&""!==s.mapsterProperties.data.default_zoom_level?s.mapsterProperties.data.default_zoom_level:15;e.jumpTo({center:s.mapsterProperties.data.location.coordinates,zoom:t});if(s.mapsterProperties.data.enable_popup)if("click"===s.mapsterProperties.data.interaction)s.getElement().click();else if("hover"===s.mapsterProperties.data.interaction){const t=new Event("mouseenter");s.getElement().dispatchEvent(t)}}else{const i=o.concat(n.concat(a)).find((t=>t.id===parseInt(r)));if(i){let r=i.data.default_zoom_level&&""!==i.data.default_zoom_level?i.data.default_zoom_level:15,o=!1;if(i.data.location){o=i.data.location.coordinates;e.jumpTo({center:i.data.location.coordinates,zoom:r})}else{const t=i.data.line?i.data.line:i.data.polygon;o=turf.center(t).geometry.coordinates;e.fitBounds(turf.bbox(t),{padding:20})}i.data.enable_popup&&("click"===i.data.interaction?t.doTriggerClick({lngLat:o},i):"hover"===i.data.interaction&&t.doTriggerHover({lngLat:o},i))}}}getDefaultCenter(){let t=[0,0];"1"===window.mapster_params.activated&&window.mapster_params.mapster_default_lat&&window.mapster_params.mapster_default_lng&&(t=[parseFloat(window.mapster_params.mapster_default_lng),parseFloat(window.mapster_params.mapster_default_lat)]
5);return t}getDefaultZoom(){let t=2;"1"===window.mapster_params.activated&&window.mapster_params.mapster_default_zoom&&(t=parseFloat(window.mapster_params.mapster_default_zoom));return t}doHover(t,e){let r=e.data.line?"line":e.data.label&&e.data.label.label_on||e.data.icon&&e.data.icon.icon_on?"symbol":e.data.circle?"circle":e.data.polygon?"fill":[],i="line"===r||"fill"===r||"symbol"===r?e.data:"circle"===r?e.data.circle:e.data.symbol;if("symbol"===r){e.data.label.label_on&&(i=e.data.label.label_properties);e.data.icon.icon_on&&(i=e.data.icon.icon_properties)}if(i&&i.hover_effects&&i.hover_effects.hover_enabled){t.removeFeatureState({source:r});t.setFeatureState({source:r,id:e.id},{hover:!0})}}doHoverOut(t,e){let r=e.data.line?"line":e.data.label&&e.data.label.label_on||e.data.icon&&e.data.icon.icon_on?"symbol":e.data.circle?"circle":e.data.polygon?"fill":[],i="line"===r||"fill"===r?e.data:"circle"===r?e.data.circle:e.data.symbol;if("symbol"===r){e.data.label.label_on&&(i=e.data.label.label_properties);e.data.icon.icon_on&&(i=e.data.icon.icon_properties)}i&&i.hover_effects&&i.hover_effects.hover_enabled&&t.setFeatureState({source:r,id:e.id},{hover:!1})}doMarkerHover(t,e,r){let i=r.mapsterProperties.data;if(i.marker.hover_effects.hover_enabled){const o=new e.Marker({color:i.marker.hover_effects.hover_color,scale:parseFloat(i.marker.hover_effects.hover_scale)/100,rotation:parseFloat(i.marker.hover_effects.hover_rotation),anchor:i.marker.anchor});-1===o._element.className.indexOf("mapster-remove-hover")&&(o._element.className+=" mapster-remove-hover");-1===r._element.className.indexOf("mapster-hide-original")&&(r._element.className+=" mapster-hide-original");o.setLngLat([r._lngLat.lng,r._lngLat.lat]).addTo(t);return o}return!1}doMarkerHoverOut(t,e){e._element.className.indexOf("mapster-hide-original")>-1&&(e._element.className=e._element.className.replace(" mapster-hide-original",""));t.remove()}globeAnimate(t,e,r){t.getZoom();let i=360/(201-e);const o=t.getCenter();"east-west"===r?o.lng+=i:"west-east"===r?o.lng-=i:"north-south"===r?o.lat+=i:"south-north"===r&&(o.lat-=i);t.easeTo({center:o,duration:1e3,easing:t=>t})}setMapCompare(t,e,r,i){ 6}createFillImages(t,e){ 7}getBase64Image(t){var e=document.createElement("canvas");e.width=t.width;e.height=t.height;e.getContext("2d").drawImage(t,0,0);return e.toDataURL("image/png")}applyProSearchFilter(t,e){ 8return e}setGeolocationOnLoad(t){ 9}setMapBreakpointSizes(t,e){ 10}async getImageData(t){return wp.media.attachment(t).fetch().then((t=>t))}async setCustomImageMap(t,e,r,i){ 11}loadModalSteps(t,e,r,i,o,n){const a=new MapsterConstants;let s=!1,l=[];if("create_point"===i){if(o)if(1===o.length){s=o[0].term_id;if(n.submission_interface.include_address_search){p(t);c()}else{c();u()}}else{p(t);jQuery(`#mapster-submission-modal-${t} .mapster-submission-modal-content`).html(`\n <div class="mapster-category-container">\n ${o.map((t=>`\n <div class="mapster-category-tile mapster-cat-set" data-category="${t.term_id}">\n ${t.icon?`<div class="mapster-category-image"><img src="${t.icon}" /></div>`:""}\n ${t.name?`<div class="mapster-category-name"><p>${t.name}</p></div>`:""}\n ${t.description?`<div class="mapster-category-description"><p>${t.description}</p></div>`:""}\n </div>\n `)).join("")}\n </div>\n `)}else{p(t);jQuery(`#mapster-submission-modal-${t} .mapster-submission-modal-content`).html(`\n <div class="mapster-category-container" data-category="none">\n <div class="mapster-category-tile mapster-cat-set">${n.custom_texts.add_point_text}</div>\n </div>\n `)}jQuery(document).on("click",`#mapster-submission-modal-${t} .mapster-category-tile.mapster-cat-set`,(function(){"none"!==jQuery(this).data("category")&&(s=jQuery(this).data("category"));c()}))}if("edit_point"===i){const e=window.mapster_params.user_submission_permalink;p(t);jQuery(`#mapster-submission-modal-${t} .mapster-submission-modal-content`).html(`\n ${a.loaderHTML()}\n <iframe\n onload="jQuery('.mapster-map-loader').remove();"\n class="mapster-submission-embed"\n src="${e}?pagetype=search&map_id=${t}">\n </iframe>\n `)}window.onmessage=function(t){if(t.data&&t.data.indexOf){t.data.indexOf("set_point")>-1&&c(t.data.replace("set_point-",""));if(t.data.indexOf("close_modal")>-1){jQuery(".mapster-submission-modal-overlay").fadeOut(50);jQuery(".mapster-submission-modal").fadeOut(100)}}};function p(t){jQuery(`.mapster-submit-${t} #mapster-submission-modal-overlay-${t}`).fadeIn(100);jQuery(`.mapster-submit-${t} #mapster-submission-modal-${t}`).fadeIn(150)}function c(i){n.submission_interface.include_address_search?jQuery(`#mapster-submission-modal-${t} .mapster-submission-modal-content`).html(`\n <div class="mapster-description-text"><p>${n.custom_texts.choose_how}</p></div>\n <div class="mapster-category-container">\n ${n.submission_interface.include_address_search?`<div class="mapster-category-tile mapster-method-set" data-method="address" style="max-width:none;"><p>${n.custom_texts.address_search}</p></div>`:""}\n <div class="mapster-category-tile mapster-method-set" data-method="click" style="max-width:none;"><p>${n.custom_texts.map_click}</p></div>\n </div>\n `):u();jQuery(document).on("click",`#mapster-submission-modal-${t} .mapster-category-tile.mapster-method-set`,(function(){if("address"===jQuery(this).data("method")){const i=new MapboxGeocoder({accessToken:n.submission_interface.mapbox_geocoder_access_token,mapboxgl:r,marker:!1});jQuery(`#mapster-submission-modal-${t} .mapster-submission-modal-content`).html(`<p>${n.custom_texts.search_location}</p>`);jQuery(`#mapster-submission-modal-${t} .mapster-submission-modal-content`)[0].appendChild(i.onAdd(e));i.on("result",(function(){u()}
11))}"click"===jQuery(this).data("method")&&u()}));jQuery(document).on("click",`#mapster-wp-maps-${t} .mapster-selection-instructions button`,(function(r){const i=e.getCenter();let o=!0;if(n.administration.allowed_area){const t=JSON.parse(n.administration.allowed_area);turf.booleanPointInPolygon([i.lng,i.lat],t.features[0])||(o=!1)}jQuery(".mapboxgl-ctrl").show();jQuery(".mapster-selection-overlay").remove();l=[i.lng,i.lat];jQuery(`#mapster-submission-modal-overlay-${t}`).fadeIn(100);jQuery(`#mapster-submission-modal-${t}`).fadeIn(150);jQuery(`#mapster-submission-modal-${t} .mapster-submission-modal-content`).html(`\n <div class="mapster-description-text"><p>${o?n.custom_texts.selection_saved:n.custom_texts.selection_error}</p></div>\n <div class="mapster-category-container">\n <div class="mapster-category-tile mapster-method-set" data-method="click" style="max-width:none;"><p>${n.custom_texts.try_again}</p></div>\n ${o?`<div class="mapster-category-tile mapster-coords-set" style="max-width:none;"><p>${n.custom_texts.confirm}</p></div>`:""}\n </div>\n `)}));jQuery(document).on("click",`#mapster-submission-modal-${t} .mapster-category-tile.mapster-coords-set`,(function(){const e=window.mapster_params.user_submission_permalink;let r=!!n.administration.template_post&&n.administration.template_post.ID;if(n.administration.multiple_templates){let t=n.submission_interface.categories.indexOf(s);r=n.administration.template_posts[t]}let o=i?"&type=edit&post_id="+i:"";jQuery(`#mapster-submission-modal-${t} .mapster-submission-modal-content`).html(`\n ${a.loaderHTML()}\n <iframe\n onload="jQuery('.mapster-map-loader').remove();"\n class="mapster-submission-embed"\n src="${e}?category=${s}&coords=${l.join(",")}&map_id=${t}${o}">\n </iframe>\n `)}))}function u(){jQuery(".mapster-submission-modal-close").trigger("click");jQuery(".mapboxgl-ctrl").hide();jQuery(e._container).append(`\n <div class="mapster-selection-overlay">\n <div class="mapster-selection-instructions">\n <p>${n.custom_texts.drag_zoom}</p>\n <button>${n.custom_texts.capture_point}</button>\n </div>\n <svg version="1.1" id="Uploaded to svgrepo.com" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n width="32px" height="32px" viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve">\n <style type="text/css">\n .dashing_een{fill:#141414;}\n .st0{fill:#141414;}\n </style>\n <path class="dashing_een" d="M15.5,21.5v-2c0-0.276,0.224-0.5,0.5-0.5s0.5,0.224,0.5,0.5v2c0,0.276-0.224,0.5-0.5,0.5\n S15.5,21.776,15.5,21.5z M16,13c0.276,0,0.5-0.224,0.5-0.5v-2c0-0.276-0.224-0.5-0.5-0.5s-0.5,0.224-0.5,0.5v2\n C15.5,12.776,15.724,13,16,13z M16,3c0.276,0,0.5-0.224,0.5-0.5v-2C16.5,0.224,16.276,0,16,0c-0.276,0-0.5,0.224-0.5,0.5v2\n C15.5,2.776,15.724,3,16,3z M16,32c0.276,0,0.5-0.224,0.5-0.5v-2c0-0.276-0.224-0.5-0.5-0.5s-0.5,0.224-0.5,0.5v2\n C15.5,31.776,15.724,32,16,32z M22,16c0-0.276-0.224-0.5-0.5-0.5h-2c-0.276,0-0.5,0.224-0.5,0.5s0.224,0.5,0.5,0.5h2\n C21.776,16.5,22,16.276,22,16z M13,16c0-0.276-0.224-0.5-0.5-0.5h-2c-0.276,0-0.5,0.224-0.5,0.5s0.224,0.5,0.5,0.5h2\n C12.776,16.5,13,16.276,13,16z M3,16c0-0.276-0.224-0.5-0.5-0.5h-2C0.224,15.5,0,15.724,0,16c0,0.276,0.224,0.5,0.5,0.5h2\n C2.776,16.5,3,16.276,3,16z M32,16c0-0.276-0.224-0.5-0.5-0.5h-2c-0.276,0-0.5,0.224-0.5,0.5s0.224,0.5,0.5,0.5h2\n C31.776,16.5,32,16.276,32,16z M27,16c0,6.065-4.935,11-11,11S5,22.065,5,16S9.935,5,16,5S27,9.935,27,16z M26,16.5h-1.5\n c-0.276,0-0.5-0.224-0.5-0.5s0.224-0.5,0.5-0.5H26c-0.255-5.115-4.387-9.245-9.5-9.5v1.5C16.5,7.776,16.276,8,16,8\n s-0.5-0.224-0.5-0.5V6c-5.113,0.255-9.245,4.385-9.5,9.5h1.5C7.776,15.5,8,15.724,8,16s-0.224,0.5-0.5,0.5H6\n c0.255,5.115,4.387,9.245,9.5,9.5v-1.5c0-0.276,0.224-0.5,0.5-0.5s0.5,0.224,0.5,0.5V26C21.613,25.745,25.745,21.615,26,16.5z"/>\n </svg>\n </div>\n `)}}setProjectionGlobe(t,e){ 12}create3DModels(t,e){ 13}setPopupStyles(t,e){if(t.data.popup_style){let r=t.data.popup_style,i=e.find((t=>t.id===r));t.data.popup_style=i}}setObjectProperties(t,e){for(var r in e)if(this.isObject(e[r])){null==t[r]&&(t[r]={});this.setObjectProperties(t[r],e[r])}else null==t[r]&&(t[r]=e[r])}isObject(t){return"object"==typeof t&&!Array.isArray(t)&&null!==t}makeFeatureJSON(t){let e=t.line?t.line:t.location?t.location:!!t.polygon&&t.polygon;return{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:{type:e.type,coordinates:e.coordinates}}]}}getLighting(t){const e=new MapsterConstants;if(""!==t.custom_mapbox_style)return!1;if("custom-image"===t.map_provider)return!1;if(""!==t.access_token&&"mapbox"===t.map_provider){var r=t.map_tile_style_access_token;return e.returnStyleProviders().find((t=>t.id===r)).lighting}r=t.map_tile_style_no_access_token;return e.returnStyleProviders().find((t=>t.id===r)).lighting}getStyle(t){const e=new MapsterConstants;if(""!==t.custom_mapbox_style)return t.custom_mapbox_style;if("custom-image"===t.map_provider)return e.returnStyleProviders().find((t=>"custom-image"===t.id)).style;if(""!==t.access_token&&"mapbox"===t.map_provider){var r=t.map_tile_style_access_token;return e.returnStyleProviders().find((t=>t.id===r)).style}r=t.map_tile_style_no_access_token;return e.returnStyleProviders().find((t=>t.id===r)).style}isInControlMenu(t,e){let r=[];t&&t.enable&&t.included_controls&&(r=JSON.parse(t.included_controls));return r.indexOf(e)>-1}addMapControl(t,e,r,i,o,n,a,s={}){e&&t.removeControl(e);if(r){const e=new a(s);o&&""!==o&&document.getElementById(o)?document.getElementById(o).appendChild(e.onAdd(t)):n?document.getElementById("mapster-control-menu-holder").appendChild(e.onAdd(t)):t.addControl(e,i);return e}return!1}searchCoordinateGeocoder(t){ 14}searchLocalFeatures(t,e,r,i,o,n=!1){var a={type:"FeatureCollection",features:[]};
14r.concat(i.concat(o)).forEach((t=>{var e=this.makeFeatureJSON(t.data);a.features.push(this.makeGeocoderResult(t,e,n))}));let s=this.localFeaturesTextMatch(t,e,a.features);s.sort(((t,e)=>t.place_name>e.place_name?1:-1));return s}localFeaturesTextMatch(t,e,r){let i=[];const o=e.split(" ").filter((t=>""!==t));r.forEach((r=>{var n=!1;r.properties.searchableTexts.forEach((a=>{var s={type:"Feature",id:r.properties.id,place_name:jQuery("<div>").html(r.properties.place_name).text()};"1"===window.mapster_params.activated&&r.properties.thumbnail&&(s.place_name=`\n <img src="${r.properties.thumbnail}" class="mapster-filter-dropdown-image" /><br />${s.place_name}\n `);if(!(window.mapster_categories_hidden_features&&window.mapster_categories_hidden_features.length>0&&-1!==window.mapster_categories_hidden_features.indexOf(r.properties.id))){if("exact-match"===t&&a&&(a.toLowerCase().indexOf(e.toLowerCase())>-1||" "===e)&&!n){s.center=turf.center(r).geometry.coordinates;"Point"!==r.geometry.type&&(s.bbox=turf.bbox(r));i.push(s);n=!0} 15}}))}));return i}initializeSlider(t,e){const r=t=>{jQuery("#mapster-slider ul").animate({left:jQuery("#mapster-slider ul li").width()*("right"===t?-1:1)},200,(()=>{jQuery("#mapster-slider ul li:first-child").appendTo("#mapster-slider ul");jQuery("#mapster-slider ul").css("left","")}))};if(!window.sliderClicksInitialized){jQuery(document).on("click","#mapster-slider .mapster-slider-control_prev",(function(){r("left")}));jQuery(document).on("click","#mapster-slider .mapster-slider-control_next",(function(){r("right")}));window.sliderClicksInitialized=!0}}makeHeatmap(t,e,r,i){ 16}loadListings(t,e,r){ 17}loadCustomListingHTML(t,e){let r; 18return`\n <div class="mapster-listing-single-item" data-post_id="${e.id}">\n ${r}\n </div>\n `}setListingEvents(t,e,r,i,o){ 19}setListingStickyMap(){ 20}createHeatmapProperties(t,e,r,i){ 21}fadeHeatmapFeatures(t,e){ 22}setClustering(t,e,r,i,o,n,a,s,l,p,c,u,h){n&&this.doMarkerClustering(t,e,r,n,l,p,h);return o||i?this.doSymbolClustering(t,e,r,i,o,p,c,u,h):a||s?this.doPolygonAndLineClustering(t,e,r,a,s,p,c,u,h):[]}doMarkerClustering(t,e,r,i,o,n,a){let s=r.cluster_by_category?r.categories_to_cluster.map((t=>"marker-"+t)):["marker"];this.makeClusters(t,e,r,s,n,[],[],a);t.on("render",(()=>{let e=[];s.forEach((r=>{if(!t.isSourceLoaded(r))return;const i=t.querySourceFeatures(r);e=e.concat(i.filter((t=>t.properties.id)).map((t=>t.properties.id)))}));o.forEach((r=>{-1===e.indexOf(r.mapsterProperties.id)?r.remove():(!r._popup||r._popup&&!r._popup.isOpen())&&r.addTo(t)}))}))}doSymbolClustering(t,e,r,i,o,n,a,s,l){var p=[];o&&(r.cluster_by_category?r.categories_to_cluster.forEach((t=>{p.push("symbol-"+t)})):p.push("symbol"));i&&(r.cluster_by_category?r.categories_to_cluster.forEach((t=>{p.push("circle-"+t)})):p.push("circle"));this.makeClusters(t,e,r,p,n,a,s,l);return p}doPolygonAndLineClustering(t,e,r,i,o,n,a,s,l){var p=[];if("1"===window.mapster_params.activated){i&&(r.cluster_by_category?r.categories_to_cluster.forEach((t=>{p.push("fillcl-"+t)})):p.push("fillcl"));o&&(r.cluster_by_category?r.categories_to_cluster.forEach((t=>{p.push("line-"+t)})):p.push("line"));this.makeClusters(t,e,r,p,n,a,s,l);let c=!1;t.on("render",(()=>{let e=[];p.forEach((r=>{if(!t.isSourceLoaded(r))return;const i=t.querySourceFeatures(r);e=e.concat(i.filter((t=>t.properties.post_id)).map((t=>t.properties.post_id)))}));if(JSON.stringify(e)!==JSON.stringify(c)){c=e;if(i){const r=this.createLayerGeoJSON(!1,"polygon","fill",n,a,s,[]).features.filter((t=>e.indexOf(t.id)>-1));t.getSource("fill").setData({type:"FeatureCollection",features:r})}if(o){const r=this.createLayerGeoJSON(!1,"line","line",n,a,s,[]).features.filter((t=>e.indexOf(t.id)>-1));t.getSource("line").setData({type:"FeatureCollection",features:r})}}}))}return p}makeClusters(t,e,r,i,o,n,a,s){let l=[];i.forEach((e=>{t.getLayer(`${e}-cluster-count`)&&t.removeLayer(`${e}-cluster-count`);t.getLayer(`${e}-clusters`)&&t.removeLayer(`${e}-clusters`);t.getLayer(`${e}-clusters-border`)&&t.removeLayer(`${e}-clusters-border`);t.getLayer(e)&&t.removeLayer(e);if(t.getSource(e))try{t.removeSource(e)}catch(t){}if(e.indexOf("-")>-1){let t=parseInt(e.split("-")[1]);l.push(t)}}));let p="location";i.indexOf("fillcl")>-1&&(p="polygon");
22i.indexOf("linecl")>-1&&(p="line");i.forEach(((i,c)=>{let u,h=i.split("-")[0];if(l.length>0){let e=this.createLayerGeoJSON(t,p,h,o,n,a,l);"location"!==p&&(e=this.reduceToPoints(e));t.getSource(h)&&t.getSource(h).setData(e)}else if(t.getLayer(h)&&t.getSource(h)){t.removeLayer(h);t.removeSource(h)}if(i.indexOf("marker")>-1)u=this.createMarkerGeoJSON(o,i);else{u=this.createLayerGeoJSON(t,p,i,o,n,a,[]);"location"!==p&&(u=this.reduceToPoints(u))}s=s||[];var d=u.features.filter((t=>-1===s.indexOf(t.properties.post_id)));let f=!1;if(r.show_category_name){let t=o.concat(n.concat(a)),e=parseInt(i.split("-")[1]);t.forEach((t=>{f||(f=t.categories.find((t=>t.id===e)))}))}t.addSource(i,{type:"geojson",data:{type:"FeatureCollection",features:d},cluster:!0,clusterMaxZoom:14,clusterRadius:50});if(i.indexOf("marker")>-1)t.addLayer({id:i,source:i,type:"circle",filter:["!",["has","point_count"]],paint:{"circle-radius":0}});else if(i.indexOf("fillcl")>-1)t.addLayer({id:i,source:i,type:"fill",filter:["!",["has","point_count"]],paint:{"fill-opacity":0}});else{var m=this.getLayerExpressions("location",i.indexOf("symbol")>-1?"symbol":"circle",e);t.addLayer({id:i,source:i,type:i.split("-")[0],filter:["!",["has","point_count"]],paint:m.paint,layout:m.layout})}this.addIcons(t,i,u);let _="#51bbd6",y="#000",g=100,v=20,x="#f1f075",b="#000",w=750,C=30,k="#f28cb1",S="#000",M=40; 23if(r.image_on_cluster&&""!==r.image_on_cluster)this.addNewIcon(t,r.image_on_cluster,"cluster",(()=>{ 24}));else{t.addLayer({id:`${i}-clusters`,type:"circle",source:i,filter:["has","point_count"],paint:{"circle-stroke-width":["step",["get","point_count"],v/7,g/7,C/7,w/7,M/7],"circle-stroke-color":["step",["get","point_count"],_,g,x,w,k],"circle-stroke-opacity":.3,"circle-color":["step",["get","point_count"],_,g,x,w,k],"circle-radius":["step",["get","point_count"],v,g,C,w,M]}});t.addLayer({id:`${i}-cluster-count`,type:"symbol",source:i,filter:["has","point_count"],layout:{"text-field":f?f.name:"{point_count_abbreviated}","text-font":"mapbox"===e?["DIN Offc Pro Medium","Arial Unicode MS Bold"]:["Open Sans Regular"],"text-size":12},paint:{"text-color":["step",["get","point_count"],y,g,b,w,S]}})}setTimeout((()=>{t.on("click",`${i}-clusters`,(e=>{const r=t.queryRenderedFeatures(e.point,{layers:[`${i}-clusters`]}),o=r[0].properties.cluster_id;t.getSource(i).getClusterExpansionZoom(o,((e,i)=>{t.easeTo({center:r[0].geometry.coordinates,zoom:i+1})}))}))}),500)}))}reduceToPoints(t){let e={type:"FeatureCollection",features:[]};t.features.forEach((t=>{e.features.push(turf.center(t,{properties:t.properties}))}));return e}makeGeocoderResult(t,e,r){var i=e.features[0];i.properties={searchableTexts:[t.data.popup?t.data.popup.header_text:"",t.data.popup?t.data.popup.body_text:"",t.title,t.content],id:t.id,place_name:t.title};t.categories.forEach((t=>{i.properties.searchableTexts.push(t.name)}));"1"===window.mapster_params.activated&&r&&t.data.popup&&t.data.popup.featured_image&&(i.properties.thumbnail=t.data.popup.featured_image.url);return i}modifyDropdown(t,e){t.container.classList.add("mapster-maps-dropdown");jQuery(".mapster-maps-dropdown").find(".mapboxgl-ctrl-geocoder--icon.mapboxgl-ctrl-geocoder--icon-search").replaceWith('<svg viewBox="0 0 32 32" class="mapboxgl-ctrl-geocoder--icon mapboxgl-ctrl-geocoder--icon-search" viewBox="0 0 32 32" aria-hidden="true">\n <path d="M24 11.305l-7.997 11.39L8 11.305z"/>\n </svg>');jQuery(".mapster-maps-dropdown").find(".mapboxgl-ctrl-geocoder--input").wrap('<div class="input-wrapper"></div>');jQuery(".mapster-maps-dropdown").find(".mapboxgl-ctrl-geocoder--input").attr("disabled",!0);jQuery(".mapster-maps-dropdown").find(".mapboxgl-ctrl-geocoder--input").css("pointer-events","none");jQuery(document).on("click",".mapster-maps-dropdown .input-wrapper, .mapster-maps-dropdown .mapboxgl-ctrl-geocoder--icon-search",(()=>{t.query("");jQuery(".suggestions-wrapper .suggestions li").removeClass("active")}));jQuery(document).on("click",".mapboxgl-ctrl-geocoder--icon.mapboxgl-ctrl-geocoder--icon-close",(()=>{t.clear();jQuery(".suggestions-wrapper .suggestions").hide()}))}openExternalLink(t){t&&t.data.open_link_on_click&&t.data.click_link&&t.data.click_link.url&&DOMPurify.isValidAttribute("a","href",t.data.click_link.url)&&(t.data.click_link.open_link_
24in_new_tab?window.open(t.data.click_link.url):window.open(t.data.click_link.url,"_self"))}getMapBounds(t,e,r){var i={type:"FeatureCollection",features:[]};[["location",t],["line",e],["polygon",r]].forEach((t=>{t[1].forEach((t=>{var e=this.makeFeatureJSON(t.data);i.features.push(e.features[0])}))}));return i.features.length>0?turf.bbox(i):null}openStoreLocatorClick(t,e){t.enable&&jQuery(`.mapster-store-locator-list[data-id="${e}"]`).trigger("click",[!0])}openSidebarClick(t,e,r,i,o,n){!t.enable&&e&&this.setSidebarHTML(r,i,o,n)}openPopup(t,e,r,i,o,n,a){if(!a){r&&r.remove();if(i.data.popup_style){if(!i.data.popup_style.open_as_modal_immediately){i.data.location&&"Point"===i.data.location.type&&(o=i.data.location.coordinates);let r=new e.Popup(this.returnPopupOptions(i.data)).setLngLat(o).setHTML(this.getPopupHTML(i.id,i));r.addTo(t);return r}this.openDirectToModal(i)}}}openDirectToModal(t){ 25}centerPopup(t,e,r){ 26}mouseIsNear(t,e,r){if(t&&t.offset()){var i=t.offset().left-e,o=t.offset().top-e,n=i+t.width()+2*e,a=o+t.height()+2*e,s=r.pageX,l=r.pageY;return s>i&&s<n&&l>o&&l<a}return!1}getDirectionsLatLng(t){let e="";t.location&&(e=t.location.coordinates[1].toString()+","+t.location.coordinates[0].toString());if(t.line){let r=turf.center(t.line);e=r.geometry.coordinates[1].toString()+","+r.geometry.coordinates[0].toString()}if(t.polygon){let r=turf.center(t.polygon);e=r.geometry.coordinates[1].toString()+","+r.geometry.coordinates[0].toString()}return e}getPopupHTML(t,e){const r=e.data;var i=this.getPopupStyle(r,e.title),o=this.returnPopupCSS(r),n=this.returnPopupLayout(r),a=this.returnPopupContent(r,e.title),s=this.returnPopupHTML(r),l="";"to-directions"===a.button_action&&(l=this.getDirectionsLatLng(r));n.enable_image&&"gallery"===a.image_type&&setTimeout((()=>{this.initializeSlider(`mapster-popup-${r.popup_style.id}`,a.images.length+1)}),400);return`\n <style>${i}</style>\n ${n.use_custom_css?`<style>${o.css_editor.replace(/#mapster-popup/g,`#mapster-popup-${r.popup_style.id}`)}</style>`:""}\n ${n.use_custom_html?this.replaceHTMLValues(s.html_editor,a,t,r):`<div id="mapster-popup-${r.popup_style.id}" class="map-popup-background ${this.sanitizeInput(n.popup_class)} mapster-feature-popup-${t}">\n ${n.enable_header?`<div class="map-popup-header">\n <h2>${a.header_text}</h2>\n </div>`:""}\n ${n.enable_image&&"feature-image"===a.image_type?'<div class="map-popup-image"></div>':""}\n ${n.enable_image&&"gallery"===a.image_type?`<div class="map-popup-gallery">\n <div id="mapster-slider" style="height : ${o.image_height}px;">\n <div class="mapster-slider-control_next">></div>\n <div class="mapster-slider-control_prev"><</div>\n <ul>\n ${a.images.map((t=>`<li style="height : ${o.image_height}px; background-image: url(${t});"> </li>`)).join(" ")}\n </ul>\n </div>\n </div>`:""}\n ${n.enable_body?`<div class="map-popup-body">\n ${r.popup.render_shortcode&&"1"===window.mapster_params.activated?`<iframe class="mapster-popup-shortcode-iframe" scrolling="no" onload="this.style.height=(this.contentDocument.getElementById('mapster-popup-shortcode-content').offsetHeight+10) + 'px';" src='${window.mapster_params.directory}../admin/includes/mapster-popup-shortcode.php?feature_id=${t}&popup_id=${r.popup_style.id}'></iframe>`:`<p>${a.body_text}</p>`}\n </div>`:""}\n ${n.enable_footer?`<div class="map-popup-footer">\n ${"do-nothing"===a.button_action?`<button class="map-popup-footer-button">${a.button_text}</button>`:""}\n ${"to-post"===a.button_action?`<button class="map-popup-footer-button" onclick="${a.open_link_
26in_new_tab?`window.open('${r.popup.permalink}', '_blank');`:`window.open('${r.popup.permalink}', '_self');`}">\n ${a.button_text}\n </button>`:""}\n ${"to-link"===a.button_action?`<button class="map-popup-footer-button" onclick="${a.open_link_in_new_tab?`window.open('${a.button_url}', '_blank');`:`window.open('${a.button_url}', '_self');`}">\n ${a.button_text}\n </button>`:""}\n ${"to-directions"===a.button_action?`<button class="map-popup-footer-button" onclick="window.open('https://www.google.com/maps/dir/?api=1&destination=${l}', '_blank');">\n ${a.button_text}\n </button>`:""}\n ${"to-modal"===a.button_action?`<button class="map-popup-footer-button mapster-button-modal-open">\n ${a.button_text}\n </button>\n <div class="mapster-modal-content-in-popup" data-title="${a.header_text?a.header_text:"Details"}"><iframe style='width: 100%; height: ${window.innerHeight-300}px;' src='${window.mapster_params.directory}../admin/includes/mapster-modal-shortcode.php?feature_id=${t}&type=modal_details'></iframe></div>`:""}\n </div>`:""}\n </div>`}\n `}getPopupStyle(t,e){var r=this.returnPopupCSS(t),i=this.returnPopupLayout(t),o=this.returnPopupContent(t,e),n=t.popup_style.id;return`\n .mapboxgl-popup .mapboxgl-popup-content, .maplibregl-popup .maplibregl-popup-content {\n padding: 0px;\n background: none;\n border: none;\n border-radius: none;\n box-shadow: none;\n }\n #mapster-popup-${n}.map-popup-background {\n background : ${r.background};\n text-align : ${r.align};\n min-width: ${r.image_min_width}px;\n border-radius: 3px;\n box-shadow: 0 1px 2px rgb(0 0 0 / 10%);\n }\n #mapster-popup-${n} .map-popup-header {\n background : ${r.header};\n padding: 10px;\n }\n #mapster-popup-${n} .map-popup-header h2 {\n all : revert;\n color : ${r.header_text};\n text-align : ${r.align};\n font-weight: bold;\n margin: 0;\n padding: 0;\n }\n #mapster-popup-${n} .map-popup-image {\n background-image : url("${o.featured_image?o.featured_image.url:""}");\n background-position : center center;\n background-size: cover;\n min-width: ${r.image_min_width}px;\n height : ${r.image_height}px;\n width: 100%;\n }\n #mapster-popup-${n} .map-popup-gallery {\n min-width: ${r.image_min_width}px;\n }\n #mapster-popup-${n} .map-popup-body {\n margin-top: -1px;\n background : ${r.body};\n padding: 10px;\n color : ${r.body_text};\n }\n #mapster-popup-${n} .map-popup-body p {\n padding: 0px;\n text-align : ${r.align};\n margin: 0px;\n }\n #mapster-popup-${n} .map-popup-footer {\n margin-top: -1px;\n background : ${r.footer};\n padding: 10px;\n }\n #mapster-popup-${n} .map-popup-footer .map-popup-footer-button {\n all : revert;\n background : ${r.button};\n border-color: ${r.button};\n color : ${r.button_text};\n padding: 5px;\n text-decoration: none;\n text-shadow: none;\n }\n #mapster-popup-${n} .map-popup-footer .map-popup-footer-button:hover {\n cursor: pointer;\n filter: brightness(1.15);\n }\n\t\t\t.mapboxgl-popup.mapboxgl-popup-anchor-top .mapboxgl-popup-tip, .maplibregl-popup.maplibregl-popup-anchor-top .maplibregl-popup-tip,\n\t\t\t.mapboxgl-popup.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip, .maplibregl-popup.maplibregl-popup-anchor-top-left .maplibregl-popup-tip,\n\t\t\t.mapboxgl-popup.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip, .maplibregl-popup.maplibregl-popup-anchor-top-right .maplibregl-popup-tip {\n border-bottom-color : ${r.pointer};\n display : ${i.enable_pointer?"block":"none"};\n }\n\t\t\t.mapboxgl-popup.mapboxgl-popup-anchor-right .mapboxgl-popup-tip, .maplibregl-popup.maplibregl-popup-anchor-right .maplibregl-popup-tip {\n\t\t\t\tborder-left-color : ${r.pointer};\n display : ${i.enable_pointer?"block":"none"};\n\t\t\t}\n\t\t\t.mapboxgl-popup.mapboxgl-popup-anchor-left .mapboxgl-popup-tip, .maplibregl-popup.maplibregl-popup-anchor-left .maplibregl-popup-tip {\n\t\t\t\tborder-right-color : ${r.pointer};\n display : ${i.enable_pointer?"block":"none"};\n\t\t\t}\n\t\t\t.mapboxgl-popup.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip, .maplibregl-popup.maplibregl-popup-anchor-bottom .maplibregl-popup-tip,\n\t\t\t.mapboxgl-popup.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip, .maplibregl-popup.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip,\n\t\t\t.mapboxgl-popup.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip, .maplibregl-popup.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip {\n border-top-color : ${r.pointer};\n display : ${i.enable_pointer?"block":"none"};\n }\n `}sanitizeInput(t){const e={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return t?t.replace(/[&<>"'/]/gi,(t=>e[t])):""}setSidebarHTML(t,e,r,i){var o="#mapster-wp-maps-"+i;jQuery(".mapster-sidebar-popup").remove();const n=t.data;var a=jQuery(o).height(),s=(jQuery(o).width(),this.getPopupStyle(n)),l=this.returnPopupCSS(n),p=this.returnPopupLayout(n),c=this.returnPopupContent(n,t.title),u=this.returnPopupHTML(n);p.enable_image&&"gallery"===c.image_type&&setTimeout((()=>{this.initializeSlider(`mapster-sidebar-popup-${n.popup_style.id}`,c.images.length+1)}),400);jQuery(document).on("click",".mapster-sidebar-popup-exit",(()=>{jQuery(".mapster-sidebar-popup").remove()}));const h=parseFloat(e),d=parseFloat(r),f=`\n <style>${s.replace(/-popup/g,"-sidebar-popup")}</style>\n ${p.use_custom_css?`<style>${l.css_editor.replace(/#mapster-popup/g,`#mapster-popup-${n.popup_style.id}`)}</style>`:""}\n <div id="mapster-sidebar-popup-${n.popup_style.id}" class="mapster-sidebar-popup" style="min-width: ${h}px; min-height: ${a/2}px; max-height: ${a}px; max-width: ${d}px;">\n ${p.use_custom_html?this.replaceHTMLValues(u.html_editor,c,n.popup_style.id,n):`<div>\n <div class="mapster-sidebar-popup-exit">✖</div>\n ${p.enable_header?`<div class="map-sidebar-popup-header">\n <h2>${c.header_text}</h2>\n </div>`:""}\n ${p.enable_image&&"feature-image"===c.image_type?'<div class="map-sidebar-popup-image"></div>':""}\n ${p.enable_image&&"gallery"===c.image_type?`<div class="map-sidebar-popup-gallery">\n <div id="mapster-slider" style="height : ${l.image_height}px;">\n <div class="mapster-slider-control_next">></div>\n <div class="mapster-slider-control_prev"><</div>\n <ul>\n ${c.images.map((t=>`<li style="height : ${l.image_height}px; background-image: url(${t});"> </li>`)).join(" ")}\n </ul>\n </div>\n </div>`:""}\n ${p.enable_body?`<div class="map-sidebar-popup-body">\n <p>${c.body_text}</p>\n </div>`:""}\n ${p.enable_footer?`<div class="map-sidebar-popup-footer">\n ${"do-nothing"===c.button_action?`<button class="map-sidebar-popup-footer-button">${c.button_text}</button>`:""}\n ${"to-post"===c.button_action?`<button class="map-sidebar-popup-footer-button" onclick="${c.open_link_
26in_new_tab?`window.open('${n.popup.permalink}', '_blank');`:`window.open('${n.popup.permalink}', '_self');`}">\n ${c.button_text}\n </button>`:""}\n ${"to-link"===c.button_action?`<button class="map-sidebar-popup-footer-button" onclick="${c.open_link_in_new_tab?`window.open('${c.button_url}', '_blank');`:`window.open('${c.button_url}', '_self');`}">\n ${c.button_text}\n </button>`:""}\n ${"to-modal"===c.button_action?`<button class="map-sidebar-popup-footer-button mapster-button-modal-open">\n ${c.button_text}\n </button>\n <div class="mapster-modal-content-in-popup" data-title="${c.header_text?c.header_text:"Details"}">${c.modal_details}</div>`:""}\n </div>`:""}\n </div>`}\n </div>\n `;jQuery(o).append(f)}replaceHTMLValues(t,e,r,i){let o; 27return`\n <div class="mapster-feature-popup-${r}">\n ${o}\n </div>\n `}returnPopupHTML(t){return{html_editor:t.popup_style.html_editor}}returnPopupContent(t,e){return{post_title:e,header_text:t.popup.header_text,image_type:t.popup.image_type,featured_image:t.popup.featured_image,images:t.popup.images,body_text:t.popup.body_text,button_text:t.popup.button_text,button_action:t.popup.button_action,button_url:t.popup.button_url,modal_details:t.popup.modal_details,additional_details:t.additional_details,open_link_in_new_tab:t.popup.open_link_
27in_new_tab}}returnPopupLayout(t){return{enable_header:t.popup_style.enable_header,enable_image:t.popup_style.enable_image,enable_body:t.popup_style.enable_body,enable_footer:t.popup_style.enable_footer,enable_pointer:t.popup_style.enable_pointer,use_custom_css:t.popup_style.use_custom_css,use_custom_html:t.popup_style.use_custom_html,popup_class:t.popup_style.popup_class}}returnPopupOptions(t){let e={anchor:t.popup_style.popup_anchor?t.popup_style.popup_anchor:"bottom",focusAfterOpen:!1,className:"hover"===t.interaction?"mapster-hover-popup":"",closeButton:t.popup_style.close_button,closeOnClick:t.popup_style.close_on_click,closeMapMove:t.popup_style.close_on_map_move,maxWidth:t.popup_style.max_width+"px"};if("1"===window.mapster_params.activated&&t.popup_permanent){e.closeButton=!1;e.closeMapMove=!1;e.closeOnClick=!1}if(t.popup_style.popup_translate){let r=t.popup_style.popup_translate;(parseFloat(r.left_translate)||parseFloat(r.right_translate)||parseFloat(r.top_translate)||parseFloat(r.bottom_translate))&&(e.offset=[-1*parseFloat(r.left_translate)+parseFloat(r.right_translate),-1*parseFloat(r.top_translate)+parseFloat(r.bottom_translate)])}return e}returnPopupCSS(t){return{background:t.popup_style.background,header:t.popup_style.header,image_min_width:t.popup_style.image_min_width?t.popup_style.image_min_width:200,image_height:t.popup_style.image_height,body:t.popup_style.body,footer:t.popup_style.footer,button:t.popup_style.button,pointer:t.popup_style.pointer,header_text:t.popup_style.header_text,body_text:t.popup_style.body_text,button_text:t.popup_style.button_text,align:t.popup_style.align,css_editor:t.popup_style.css_editor,max_width:t.popup_style.max_width}}getMarkerStyles(t){var e=t.data;return{color:e.marker.color,scale:parseFloat(e.marker.scale)/100,rotation:parseFloat(e.marker.rotation),anchor:e.marker.anchor}}getLayerExpressions(t,e,r){if("line"===t)return{layout:{},paint:{"line-color":["case",["boolean",["feature-state","hover"],!1],["get","hover_effects_hover_color"],["has","color"],["get","color"],"#000"],"line-opacity":["case",["boolean",["feature-state","hover"],!1],["/",["to-number",["get","hover_effects_hover_opacity"]],100],["has","opacity"],["/",["to-number",["get","opacity"]],100],1],"line-width":["case",["boolean",["feature-state","hover"],!1],["to-number",["get","hover_effects_hover_width"]],["has","width"],["to-number",["get","width"]],2],"line-dasharray":"mapbox"===r?["case",["==",!0,["to-boolean",["get","dashed_line"]]],["get","dash_properties_line_dash_array"],["literal",[1,0]]]:[1,0]}};if("polygon"===t){if("fill"===e)return{layout:{},paint:{"fill-color":["case",["boolean",["feature-state","hover"],!1],["get","hover_effects_hover_color"],["has","color"],["get","color"],"#000"],"fill-opacity":["case",["boolean",["feature-state","hover"],!1],["/",["to-number",["get","hover_effects_opacity"]],100],["has","opacity"],["/",["to-number",["get","opacity"]],100],1],"fill-outline-color":["case",["boolean",["feature-state","hover"],!1],["get","hover_effects_outline-color"],["has","outline-color"],["get","outline-color"],"rgba(0,0,0,0)"]}};if("fill-pattern"===e)return{layout:{},paint:{"fill-pattern":["case",["has","pattern"],["concat","icon-image-",["get","pattern"]],""]}};if("fill-extrusion"===e)return"1"===window.mapster_params.activated?{layout:{},paint:{"fill-extrusion-color":["case",["boolean",["feature-state","hover"],!1],["get","hover_effects_hover_color"],["has","color"],["get","color"],"#000"],"fill-extrusion-opacity":.75,"fill-extrusion-base":["case",["boolean",["feature-state","hover"],!1],["/",["to-number",["get","3d_polygon_base"]],100],["has","3d_polygon_base"],["to-number",["get","3d_polygon_base"]],0],"fill-extrusion-height":["case",["boolean",["feature-state","hover"],!1],["to-number",["get","3d_polygon_height"]],["has","3d_polygon_height"],["to-number",["get","3d_polygon_height"]],0]}}:{layout:{},paint:{}}}if("location"===t){if("circle"===e)return{layout:{},paint:{"circle-color":["case",["boolean",["feature-state","hover"],!1],["get","circle_hover_effects_hover_color"],["has","circle_color"],["get","circle_color"],"#000"],"circle-opacity":["case",["boolean",["feature-state","hover"],!1],["/",["to-number",["get","circle_hover_effects_hover_opacity"]],100],["has","circle_opacity"],["/",["to-number",["get","circle_opacity"]],100],1],"circle-radius":["interpolate",["exponential",2],["zoom"],0,["case",["all",["has","circle_circle-static-size"],["==",!0,["get","circle_circle-static-size"]]],["*",["case",["boolean",["feature-state","hover"],!1],["to-number",["get","circle_hover_effects_hover_radius"]],["has","circle_radius"],["to-number",["get","circle_radius"]],0],["^",2,-16]],["case",["boolean",["feature-state","hover"],!1],["to-number",["get","circle_hover_effects_hover_radius"]],["has","circle_radius"],["to-number",["get","circle_radius"]],0]],24,["case",["all",["has","circle_circle-static-size"],["==",!0,["get","circle_circle-static-size"]]],["*",["case",["boolean",["feature-state","hover"],!1],["to-number",["get","circle_hover_effects_hover_radius"]],["has","circle_radius"],["to-number",["get","circle_radius"]],0],["^",2,8]],["case",["boolean",["feature-state","hover"],!1],["to-number",["get","circle_hover_effects_hover_radius"]],["has","circle_radius"],["to-number",["get","circle_radius"]],0]]],"circle-stroke-width":["case",["boolean",["feature-state","hover"],!1],["to-number",["get","circle_hover_effects_hover_stroke-width"]],["has","circle_stroke-width"],["to-number",["get","circle_stroke-width"]],0],"circle-stroke-color":["case",["boolean",["feature-state","hover"],!1],["get","circle_hover_effects_hover_stroke-color"],["has","circle_stroke-color"],["get","circle_stroke-color"],"#000"],"circle-stroke-opacity":["case",["boolean",["feature-state","hover"],!1],["/",["to-number",["get","circle_hover_effects_hover_stroke-opacity"]],100],["has","circle_stroke-opacity"],["/",["to-number",["get","circle_stroke-opacity"]],100],1]}};if("symbol"===e)return{layout:{"text-field":["case",["has","label_text_properties_text-field"],["get","label_text_properties_text-field"],"New Text"],"text-font":["case",["==","Open Sans Regular",["get","label_text_properties_text-font"]],["literal",["Open Sans Regular"]],["==","Open Sans Bold",["get","label_text_properties_text-font"]],["literal",["Open Sans Bold"]],["==","Open Sans Italic",["get","label_text_properties_text-font"]],["literal",["Open Sans Italic"]],["==","Klokantech Noto Sans Regular",["get","label_text_properties_text-font"]],["literal",["Klokantech Noto Sans Regular"]],["==","Klokantech Noto Sans Bold",["get","label_text_properties_text-font"]],["literal",["Klokantech Noto Sans Bold"]],["==","Klokantech Noto Sans Italic",["get","label_text_properties_text-font"]],["literal",["Klokantech Noto Sans Italic"]],["==","Metropolis",["get","label_text_properties_text-font"]],["literal",["Metropolis"]],["==","Metropolis Bold",["get","label_text_properties_text-font"]],["literal",["Metropolis Bold"]],["==","Metropolis Regular Italic",["get","label_text_properties_text-font"]],["literal",["Metropolis Regular Italic"]],["literal",["Open Sans Regular"]]],"text-rotate":["case",["has","label_text_properties_text-rotate"],["to-number",["get","label_text_properties_text-rotate"]],0],"text-size":["case",["==",!1,["get","label_label_on"]],0,["has","label_text_properties_text-size"],["to-number",["get","label_text_properties_text-size"]],16],"icon-size":["interpolate",["exponential",2],["zoom"],1,["case",["==",!1,["get","icon_icon_on"]],0,["all",["has","icon_icon_properties_icon-static-size"],["==",!0,["get","icon_icon_properties_icon-static-size"]]],["*",["to-number",["get","icon_icon_properties_icon-size"]],["^",2,-15]],["has","icon_icon_properties_icon-size"],["/",["to-number",["get","icon_icon_properties_icon-size"]],100],1],22,["case",["==",!1,["get","icon_icon_on"]],0,["all",["has","icon_icon_properties_icon-static-size"],["==",!0,["get","icon_icon_properties_icon-static-size"]]],["*",["to-number",["get","icon_icon_properties_icon-static-size"]],["^",2,6]],["has","icon_icon_properties_icon-size"],["/",["to-number",["get","icon_icon_properties_icon-size"]],100],1]],"icon-rotate":["case",["has","icon_icon_properties_icon-rotate"],["to-number",["get","icon_icon_properties_icon-rotate"]],0],"icon-allow-overlap":!0,"icon-ignore-placement":!0,"icon-anchor":["case",["has","icon_icon_properties_icon-anchor"],["get","icon_icon_properties_icon-anchor"],"center"],"icon-offset":["case",["has","icon_icon_properties_offset_array"],["get","icon_icon_properties_offset_array"],["literal",[0,0]]],"text-offset":["case",["has","label_text_properties_offset_array"],["get","label_text_properties_offset_array"],["literal",[0,0]]],"text-allow-overlap":!0,"text-ignore-placement":!0},paint:{"text-color":["case",["has","label_text_properties_text-color"],["get","label_text_properties_text-color"],"#000000"],"text-halo-width":["case",["has","label_text_properties_text-halo-width"],["to-number",["get","label_text_properties_text-halo-width"]],1],"text-halo-color":["case",["has","label_text_properties_text-halo-color"],["get","label_text_properties_text-halo-color"],"#FFFFFF"],"text-halo-blur":["case",["has","label_text_properties_text-halo-blur"],["/",["to-number",["get","label_text_properties_text-halo-blur"]],100],1],"text-opacity":["case",["has","label_text_properties_text-opacity"],["/",["to-number",["get","label_text_properties_text-opacity"]],100],1],"icon-opacity":["case",["boolean",["feature-state","hover"],!1],["/",["to-number",["get","icon_icon_properties_hover_effects_hover_opacity"]],100],["has","icon_icon_properties_icon-opacity"],["/",["to-number",["get","icon_icon_properties_icon-opacity"]],100],1]}}}}createFillPatterns(t,e,r){if(e.getSource("fill-pattern")){e.getSource("fill-pattern").setData(r);this.addIcons(e,"fill-pattern",r)}else{e.addSource("fill-pattern",{type:"geojson",data:r});var i=this.getLayerExpressions("polygon","fill-pattern",t);e.addLayer({id:"fill-pattern",source:"fill-pattern",type:"fill",paint:i.paint,layout:i.layout})}}
27addIcons(t,e,r){e.indexOf("symbol")>-1&&r.features.forEach((r=>{if(r.properties.icon_icon_on){r.properties["icon_icon_properties_icon-image_url"]&&this.addNewIcon(t,r.properties["icon_icon_properties_icon-image_url"],r.properties["icon_icon_properties_icon-image_id"],(()=>{t.getLayer(e)&&t.setLayoutProperty(e,"icon-image",["case",["has","icon_icon_properties_icon-image_id"],["concat","icon-image-",["get","icon_icon_properties_icon-image_id"]],"none"])}));r.properties.icon_icon_properties_hover_effects_hover_image_url&&this.addNewIcon(t,r.properties.icon_icon_properties_hover_effects_hover_image_url,r.properties.icon_icon_properties_hover_effects_hover_image_id,(()=>{}))}}));e.indexOf("fill-pattern")>-1&&r.features.forEach((r=>{r.properties.pattern&&""!==r.properties.pattern&&this.addNewIcon(t,r.properties.pattern,r.properties.pattern,(()=>{t.getLayer(e)&&t.setPaintProperty(e,"fill-pattern",["case",["has","pattern"],["concat","icon-image-",["get","pattern"]],""])}))}))}addNewIcon(t,e,r,i){if(this.queuedImages.indexOf(`icon-image-${r}`)>-1)i();else{this.queuedImages.push(`icon-image-${r}`);e||i();"https:"===window.location.protocol&&e.indexOf("http://")>-1&&(e=e.replace("http","https"));var o=new Image;o.src=e;o.crossOrigin="";o.onload=function(){if(t.loaded()){t.hasImage(`icon-image-${r}`)?t.updateImage(`icon-image-${r}`,o):t.addImage(`icon-image-${r}`,o);i()}else t.once("idle",(()=>{t.hasImage(`icon-image-${r}`)?t.updateImage(`icon-image-${r}`,o):t.addImage(`icon-image-${r}`,o);i()}))}}}createLayerGeoJSON(t,e,r,i,o,n,a){var s={type:"FeatureCollection",features:[]};let l="line"===e?o:"location"===e?i:"polygon"===e?n:[],p=r.indexOf("-")>-1&&r.split("-")[1],c=r.indexOf("-")>-1?r.split("-")[0]:r;if("fill-extrusion"===r){c=r;p=!1}if("fill-pattern"===r){c=r;p=!1}"fillcl"===r&&(c="fill");"linecl"===r&&(c="line");l.forEach((i=>{if(i.data[e]&&c===this.getLayerType(e,i.data)&&(!p||i.categories.find((t=>t.id===parseFloat(p))))){let e=!1;a.length>0&&i.categories.forEach((t=>{a.indexOf(t.id)>-1&&(e=!0)}));if(!e){var o=this.makeFeatureJSON(i.data);let e=!1;if(o.features[0]){e=this.makeFeatureWithProperties(i,o.features[0]);s.features.push(e)}if(t&&i.data.open_popup_on_load&&-1===r.indexOf("-")){const e=turf.pointOnFeature(o);t.doTriggerClick({lngLat:e.geometry.coordinates},i)}}}}));return s}createMarkerGeoJSON(t,e){let r=!!e.indexOf("-")&&e.split("-")[1];var i={type:"FeatureCollection",features:[]};i.features=t.filter((t=>!r&&"marker"===t.data.location_style||!(!r||"marker"!==t.data.location_style||!t.categories.find((t=>t.id===parseFloat(r)))))).map((t=>{t.post_id=t.id;return{type:"Feature",properties:t,geometry:t.data.location}}));return i}makeFeatureWithProperties(t,e){var r=JSON.parse(JSON.stringify(e));r.id=t.id;r.properties.post_id=t.id;for(var i in t.data)-1===["polygon","line","location","popup","popup_style"].indexOf(i)&&this.assignToProperty(r,t.data,i);r.properties.dashed_line&&r.properties.dash_properties_dash_length&&(r.properties.dash_properties_line_dash_array=[parseFloat(r.properties.dash_properties_dash_length),parseFloat(r.properties.dash_properties_gap_length)]);(r.properties["label_text_properties_text-translate-x"]||r.properties["label_text_properties_text-translate-y"])&&(r.properties.label_text_properties_offset_array=[parseFloat(r.properties["label_text_properties_text-translate-x"]),parseFloat(r.properties["label_text_properties_text-translate-y"])]);(r.properties["icon_icon_properties_icon-translate-x"]||r.properties["icon_icon_properties_icon-translate-y"])&&(r.properties.icon_icon_properties_offset_array=[parseFloat(r.properties["icon_icon_properties_icon-translate-x"]),parseFloat(r.properties["icon_icon_properties_icon-translate-y"])]);return r}assignToProperty(t,e,r,i){if("object"==typeof e[r])for(var o in e[r])this.assignToProperty(t,e[r],o,i?i+"_"+r:r);else{var n=i?i+"_"+r:r;t.properties[n]=e[r]}}getLayerType(t,e){if("line"===t)return"line";if("polygon"===t){if(!e.polygon_style||"fill"===e.polygon_style)return"fill";if("fill-extrusion"===e.polygon_style)return"fill-extrusion";if("fill-pattern"===e.polygon_style)return"fill-pattern"}if("location"===t){if("circle"===e.location_style)return"circle";if("label"===e.location_style)return"symbol"}}}class MapsterCore{constructor(){}setDataLayers(){}getPostData({post_id:t,single_feature_id:e,feature_ids:r}){const i=new MapsterHelpers;let o=e?`&single_feature_id=${e}
27`:"",n=r?`&feature_ids=${r}`:"";return fetch(`${window.mapster_params.rest_url}mapster-wp-maps/map${window.mapster_params.qd}id=${t}${o}${n}`).then((t=>t.json())).then((t=>i.formatResponse(t)))}getFeaturesAdmin({locations_ids:t,lines_ids:e,polygons_ids:r,cats:i,custom_post_ids:o,custom_cats:n}){let a=t.concat(e.concat(r));return fetch(`${window.mapster_params.rest_url}mapster-wp-maps/features${window.mapster_params.qd}ids=${JSON.stringify(a)}&categories=${JSON.stringify(i)}&custom=${JSON.stringify(o)}&custom_cats=${JSON.stringify(n)}`).then((t=>t.json()))}sortLocations({adminFeatures:t}){return t.filter((t=>t.data.location))}sortLines({adminFeatures:t}){return t.filter((t=>t.data.line))}sortPolygons({adminFeatures:t}){return t.filter((t=>t.data.polygon))}doClustering({map:t,map_provider:e,cluster_options:r,circle_clustering:i,label_icon_clustering:o,marker_clustering:n,polygon_clustering:a,line_clustering:s,markers:l,locations:p,lines:c,polygons:u,idsToHide:h}){return(new MapsterHelpers).setClustering(t,e,r,i,o,n,a,s,l,p,c,u,h)}loadCustomScripts({map:t,javascript:e,locations:r,lines:i,polygons:o}){e&&window[e]&&(0,window[e])(t,r.concat(i.concat(o)))}setLighting({map:t,map_type:e}){let r=(new MapsterHelpers).getLighting(e);r&&t.getConfig("basemap")&&t.getConfig("basemap","lightPreset")&&t.setConfigProperty("basemap","lightPreset",r)}setMapStyle({post_id:t,map:e,map_type:r}){const i=new MapsterHelpers;"custom-image"===r.map_provider?i.setCustomImageMap(t,e,r,!0):r.custom_style_json&&""!==r.custom_style_json?e.setStyle(JSON.parse(r.custom_style_json)):e.setStyle(i.getStyle(r))}checkQuerystring({MapsterMap:t,post_id:e,map:r,markers:i,locations:o,lines:n,polygons:a}){ 28}loadProjection({map:t,map_provider:e,projection:r}){"mapbox"===e&&t.setProjection({name:r,center:[0,30],parallels:[30,30]})}loadBuildings3D({map:t,map_provider:e,buildings_3d:r}){ 29}setIPLocation({map:t,view:e}){"location"===e.initial_load&&window.mapster_params.ip&&fetch(`http://ip-api.com/json/${window.mapster_params.ip}`).then((t=>t.json())).then((r=>{"fail"!==r.status&&t.flyTo({center:[r.lon,r.lat],zoom:parseFloat(e.manual_zoom),bearing:parseFloat(e.manual_rotation),pitch:parseFloat(e.manual_pitch)})}))}loadTerrain({map:t,map_provider:e,terrain:r}){if("mapbox"===e)if(r){if(!t.getSource("mapbox-mapster-dem")){t.addSource("mapbox-mapster-dem",{type:"raster-dem",url:"mapbox://mapbox.mapbox-terrain-dem-v1",tileSize:512,maxzoom:14});t.setTerrain({source:"mapbox-mapster-dem",exaggeration:1.5});t.addLayer({id:"sky",type:"sky",paint:{"sky-type":"atmosphere","sky-atmosphere-sun":[0,0],"sky-atmosphere-sun-intensity":15}})}}else{t.getLayer("sky")&&t.removeLayer("sky");t.setTerrain(null);t.getSource("mapbox-mapster-dem")&&t.removeSource("mapbox-mapster-dem")}}layerClick({map:t,interactivity:e,clicking_disabled:r,clickedEvent:i,locations:o,lines:n,polygons:a}){if(e||!r){if(i.is3D)return i.location;let e=i.point?i.point:t.project(i.lngLat),r=t.queryRenderedFeatures(e).filter((t=>["symbol","line","fill","circle"].indexOf(t.source.split("-")[0])>-1)),s=r.sort(((e,r)=>{const o=t.project(turf.center(e).geometry.coordinates),n=t.project(turf.center(r).geometry.coordinates);return Math.hypot(o.x-i.point.x,o.y-i.point.y)-Math.hypot(n.x-i.point.x,n.y-i.point.y)}))[0];if(i.mapsterFeatureID){let t=r.find((t=>t.id===i.mapsterFeatureID));t&&(s=t)}i.mapsterFoundFeature&&(s=i.mapsterFoundFeature);return!(!s||"fill"===s.layer.id&&("fill"!==s.layer.id||0===s.layer.paint["fill-opacity"]))&&o.concat(n.concat(a)).find((t=>t.id===s.properties.post_id))}return!1}storeLocatorClick({clickedFeature:t,store_locator_options:e}){const r=new MapsterHelpers;t&&t.data.enable_popup&&("click"===t.data.interaction||r.isMobile()&&t.data.click_on_mobile)&&r.openStoreLocatorClick(e,t.id)}sidebarClick({post_id:t,clickedFeature:e,minimum_sidebar_width:r,maximum_sidebar_width:i,store_locator_options:o,open_popups_in_sidebar:n}){const a=new MapsterHelpers;e&&e.data.enable_popup&&("click"===e.data.interaction||a.isMobile()&&e.data.click_on_mobile)&&a.openSidebarClick(o,n,e,r,i,t)}externalClickLayer({clickedFeature:t}){(new MapsterHelpers).openExternalLink(t)}externalClickMarker({clickedMarker:t}){(new MapsterHelpers).openExternalLink(t)}
29popupClick({map:t,mapLibrary:e,clickedPopup:r,clickedFeature:i,clickedEvent:o,store_locator_options:n,open_popups_in_sidebar:a}){const s=new MapsterHelpers;if(i&&i.data.enable_popup&&("click"===i.data.interaction||s.isMobile()&&i.data.click_on_mobile))return s.openPopup(t,e,r,i,o.lngLat,n,a)}layerHover({map:t,interactivity:e,clicking_disabled:r,hoveredEvent:i,locations:o,lines:n,polygons:a}){if(e||!r){if(i.is3D)return i.location;var s=t.queryRenderedFeatures(i.point).filter((t=>["symbol","line","fill","circle"].indexOf(t.source.split("-")[0])>-1));return!(!s[0]||"fill"===s[0].layer.id&&("fill"!==s[0].layer.id||0===s[0].layer.paint["fill-opacity"]))&&o.concat(n.concat(a)).find((t=>t.id===s[0].properties.post_id))}return!1}layerHoverEffect({map:t,interactivity:e,clicking_disabled:r,hoveredFeature:i}){const o=new MapsterHelpers;o.changeCursor(t,i,"on");"1"===window.mapster_params.activated&&(!e&&r||!i||o.doHover(t,i))}popupHover({map:t,mapLibrary:e,hoveredPopup:r,hoveredFeature:i,hoveredEvent:o,store_locator_options:n}){const a=new MapsterHelpers;console.log(i,r);if(i&&i.data.enable_popup&&"hover"===i.data.interaction&&(!a.isMobile()||a.isMobile()&&i.data.click_on_mobile))return a.openPopup(t,e,r,i,o.lngLat,n);r&&r.remove()}markerClick({interactivity:t,clicking_disabled:e,clickedMarker:r}){return!(!t&&e)&&r.mapsterProperties}triggerClick({interactivity:t,clicking_disabled:e,triggeredFeature:r}){return!(!t&&e)&&r}markerHover({interactivity:t,clicking_disabled:e,hoveredMarker:r}){return!(!t&&e)&&r.mapsterProperties}triggerHover({interactivity:t,clicking_disabled:e,triggeredFeature:r}){return!(!t&&e)&&r}markerHoverEffect({map:t,mapLibrary:e,interactivity:r,clicking_disabled:i,hoveredMarker:o}){ 30}openMarkerClickPopup({map:t,mapLibrary:e,clickedMarker:r,clickedFeature:i,clickedPopup:o,store_locator_options:n,open_popups_in_sidebar:a}){const s=new MapsterHelpers;if(!a&&i&&i.data.enable_popup&&("click"===i.data.interaction||s.isMobile()&&i.data.click_on_mobile)&&i.data.popup_style)if(i.data.popup_style.open_as_modal_immediately)s.openDirectToModal(i);else{const o=new e.Popup(s.returnPopupOptions(i.data));o.setHTML(s.getPopupHTML(i.id,i));s.centerPopup(t,o,i);r.setPopup(o)}}openMarkerHoverPopup({map:t,mapLibrary:e,hoveredMarker:r,hoveredFeature:i}){const o=new MapsterHelpers;if(i&&i.data.enable_popup&&"hover"===i.data.interaction&&!o.isMobile()&&i.data.popup_style&&!r.getPopup())if(i.data.popup_style.open_as_modal_immediately)o.openDirectToModal(i);else{const n=new e.Popup(o.returnPopupOptions(i.data));n.setHTML(o.getPopupHTML(i.id,i));o.centerPopup(t,n,i);r.setPopup(n).togglePopup()}}markerHoverEffectOff({tempHoverMarker:t,hoveredMarker:e}){ 31}removeMarkerHoverPopup({hoveredMarker:t}){const e=new MapsterHelpers;t&&t.mapsterProperties.data.enable_popup&&"hover"===t.mapsterProperties.data.interaction&&!e.isMobile()&&(t&&!t.mapsterProperties.data.keep_popup_open_on_hover?t.setPopup(null):t&&t.mapsterProperties.data.keep_popup_open_on_hover&&jQuery(document).on("mousemove.mapster",(function(r){let i=jQuery(`.mapster-feature-popup-${t.mapsterProperties.id}`).closest(".mapboxgl-popup");if(e.mouseIsNear(i,2,r))i.one("mouseleave",(function(){t.setPopup(null);jQuery(document).off("mousemove.mapster")}));else{t.setPopup(null);jQuery(document).off("mousemove.mapster")}})))}layerHoverEffectOff({map:t,interactivity:e,clicking_disabled:r,hoveredFeature:i}){const o=new MapsterHelpers;o.changeCursor(t,i,"off");"1"===window.mapster_params.activated&&(!e&&r||!i||o.doHoverOut(t,i))}removePopupHover({hoveredFeature:t,hoveredPopup:e}){e&&!t.data.keep_popup_open_on_hover?e.remove():e&&t.data.keep_popup_open_on_hover&&jQuery(document).one("mousemove",(function(r){let i=jQuery(`.mapster-feature-popup-${t.id}`).closest(".mapboxgl-popup:hover");i.length?i.one("mouseleave",(function(){e.remove()})):e.remove()}))}setInteractivity({map:t,zoom_on_scroll:e,interactivity:r,allow_rotation_and_pitch:i}){e||t.scrollZoom.disable();if(!r){t.scrollZoom.disable();t.boxZoom.disable();t.dragRotate.disable();t.dragPan.disable();t.keyboard.disable();t.doubleClickZoom.disable();t.touchZoomRotate.disable()}if(r&&!i){t.dragRotate.disable();t.setMaxPitch(0);t.touchZoomRotate.disableRotation()}}setFeaturesToMap({MapsterMap:t,map:e,map_provider:r,locations:i,lines:o,polygons:n}){const a=new MapsterHelpers;[["polygon","fill"],["polygon","fill-extrusion"],["polygon","fill-image"],["polygon","fill-pattern"],["line","line"],["location","circle"],["location","symbol"],["location","3d-model"]].forEac
31h((s=>{var l=a.createLayerGeoJSON(t,s[0],s[1],i,o,n,[]);if("3d-model"!==s[1]&&"fill-image"!==s[1]&&"fill-pattern"!==s[1])if(e.getSource(s[1])){e.getSource(s[1]).setData(l);a.addIcons(e,s[1],l)}else{e.addSource(s[1],{type:"geojson",data:l});var p=a.getLayerExpressions(s[0],s[1],r);e.addLayer({id:s[1],source:s[1],type:s[1],paint:p.paint,layout:p.layout});a.addIcons(e,s[1],l)}else if("3d-model"===s[1])a.create3DModels(e,i);else if("fill-image"===s[1])a.createFillImages(e,n);else if("fill-pattern"===s[1]){a.createFillPatterns(r,e,l);a.addIcons(e,s[1],l)}}))}setMarkersToMap({map:t,markers:e,mapLibrary:r,locations:i,marker_clustering:o}){i.filter((t=>!t.data.location.coordinates||!t.data.location.coordinates[0]));const n=new MapsterHelpers;let a=[];e.forEach((t=>{i.find((e=>e.id===t.id))?a.push(t):t.remove()}));let s=[];s=s.concat(a);const l=i.filter((t=>"marker"===t.data.location_style));let p=[];l.sort(((t,e)=>{if(t.data.location.coordinates&&e.data.location.coordinates)return t.data.location.coordinates[1]>e.data.location.coordinates[1]?-1:1;if(!t.data.location.coordinates&&-1===p.indexOf(t.title)){alert(`A point is missing coordinates. See ${t.title}.`);p.push(t.title)}if(!e.data.location.coordinates&&-1===p.indexOf(e.title)){alert(`A point is missing coordinates. See ${e.title}.`);p.push(e.title)}}));l.forEach((e=>{if(!a.find((t=>t.mapsterProperties.id===e.id))){var i=n.getMarkerStyles(e),l=n.makeFeatureJSON(e.data).features[0].geometry.coordinates,p=new r.Marker(i).setLngLat(l);p.mapsterProperties=e;o||p.addTo(t);s.push(p);e.data.open_popup_on_load&&setTimeout((()=>{jQuery(p.getElement()).trigger("click")}),100)}}));return s}setHeatmap({map:t,mapLibrary:e,markers:r,locations:i,heatmap:o}){ 32}setMapSize({post_id:t,layout:e}){var r="#mapster-wp-maps-"+t;const i=new MapsterHelpers;if(!e.full_page){jQuery(r).height(e.height+e.height_units);jQuery(r).width(e.width+e.width_units);i.setMapBreakpointSizes(t,e)}if(e.full_page){jQuery(r).height(window.innerHeight+"px");jQuery(r).width("100%")}if(e.full_page&&e.ignore_container)if(e.map_only){let t=jQuery(".mapster-wp-maps-container").clone();jQuery("html").attr("style","margin-top : 0px !important; overflow-y: hidden;");jQuery("body").children().each((function(){jQuery(this).is("script")||jQuery(this).is("style")||jQuery(this).hide()}));jQuery("body").prepend(t)}else{jQuery(`<div id="margin-compensator" style="padding-bottom: ${window.innerHeight}px"></div>`).insertAfter(r);jQuery(r).css("marginLeft",-1*jQuery(r).offset().left+"px");jQuery(r).width(window.innerWidth+"px");jQuery(r).css("position","absolute")}}setMapMoveEndVariables({map:t}){jQuery('.acf-field[data-name="manual_pitch"]').find(".acf-label label").html(`Manual Pitch <i>(currently: ${t.getPitch()})</i>`);jQuery('.acf-field[data-name="manual_zoom"]').find(".acf-label label").html(`Manual Zoom <i>(currently: ${t.getZoom()})</i>`);jQuery('.acf-field[data-name="manual_rotation"]').find(".acf-label label").html(`Manual Rotation <i>(currently: ${t.getBearing()})</i>`);const{lng:e,lat:r}=t.getCenter();jQuery('.acf-field[data-name="manual_latitude"]').find(".acf-label label").html(`Manual Latitude <i>(currently: ${r})</i>`);jQuery('.acf-field[data-name="manual_longitude"]').find(".acf-label label").html(`Manual Longitude <i>(currently: ${e})</i>`)}setDefaultAccessToken(){""===jQuery('.acf-field[data-name="access_token"]').find(":input").val()&&jQuery('.acf-field[data-name="access_token"]').find(":input").val(window.mapster_params.mapbox_access_token)}setMapType({map_type:t}){if("mapbox"!==t.map_provider){""!==t.access_token&&(maplibregl.accessToken=t.access_token);return maplibregl}if(""!==t.access_token){mapboxgl.accessToken=t.access_token;return mapboxgl}window.alert(window.mapster_params.strings["Mapbox Token Warning"])}setSubmissionModal({post_id:t,map:e,mapLibrary:r,submission:i}){const o=new MapsterHelpers;jQuery(document).on("click",`#mapster-submit-${t}`,(function(){const n=jQuery(this).data("type"),a=jQuery(this).data("header");jQuery(`.mapster-submit-${t} .mapster-submission-modal-title`).text(a);jQuery(`.mapster-submit-${t} #mapster-submission-modal-overlay-${t}`).parent().detach().appendTo("body");jQuery(`.mapster-submit-${t} #mapster-submission-modal-${t}`).parent().detach().appendTo("body");i.submission_interface.categories.length>0?fetch(`${window.mapster_params.rest_url}mapster-wp-maps/submission-info${window.mapster_params.qd}categories=${i.submission_interface.categories.join(",")}`).then((t=>t.json())).then((a=>{o.loadModalSteps(t,e,r,n,a,i)})):o.loadModalSteps(t,e,r,n,!1,i)}));jQuery(document).on("click",".mapster-submission-modal-close",(function(){jQuery(".mapster-submission-modal-overlay").fadeOut(50);jQuery(".mapster-submission-modal").fadeOut(100)}))}setMap({post_id:t,mapLibrary:e,map:r,locations:i,lines:o,polygons:n}){var a="mapster-wp-maps-"+t;const s=new MapsterHelpers;let l=!0,p="manual"===r.view.initial_load?[parseFloat(r.view.manual_longitude),parseFloat(r.view.manual_latitude)]:s.getDefaultCenter();if(jQuery(`#${a}`).data("latitude")&&"null"!==jQuery(`#${a}`).data("latitude")&&jQuery(`#${a}`).data("longitude")&&"null"!==jQuery(`#${a}`).data("longitude")){p=[parseFloat(jQuery(`#${a}`).data("longitude")),parseFloat(jQuery(`#${a}`).data("latitude"))];l=!1}let c="manual"===r.view.initial_load?parseFloat(r.view.manual_zoom):s.getDefaultZoom();if(jQuery(`#${a}`).data("zoom")&&"null"!==jQuery(`#${a}`).data("zoom")){c=parseFloat(jQuery(`#${a}`).data("zoom"));l=!1}const u={renderWorldCopies:r.layout.duplicate_horizontally,style:s.getStyle(r.map_type),container:a,fitBoundsOptions:{padding:20,maxZoom:18},cooperativeGestures:r.cooperative_gestures,projection:{name:r.map_type.projection?r.map_type.projection:"mercator",center:[0,30],parallels:[30,30]},bounds:"fit-features"===r.view.initial_load&&l?s.getMapBounds(i,o,n):null,center:p,zoom:c,preserveDrawingBuffer:!!r.print_control&&r.print_control.enable,pitch:r.view.manual_pitch?parseFloat(r.view.manual_pitch):0,bearing:r.view.manual_rotation?parseFloat(r.view.manual_rotation):0,attributionControl:!1,logoPosition:r.logo_control?r.logo_control.position:"bottom-left"};let h=s.getLighting(r.map_type);h&&(u.config={basemap:{lightPreset:h}});if("1"===window.mapster_params.activated){if(r.restricted_movement.restrict_movement){let t=r.restricted_movement.allowed_bounds.southwest_longitude,e=r.restricted_movement.allowed_bounds.southwest_latitude,i=r.restricted_movement.allowed_bounds.northeast_longitude,o=r.restricted_movement.allowed_bounds.northeast_latitude;if(""!==t&&""!==e&&""!==i&&""!==o){let r=[[parseFloat(t),parseFloat(e)],[parseFloat(i),parseFloat(o)]];u.maxBounds=r}let n=r.restricted_movement.allowed_zoom.min_zoom;""!==n&&(u.minZoom=parseFloat(n));let a=r.restricted_movement.allowed_zoom.max_zoom;""!==a&&(u.maxZoom=parseFloat(a))}r.map_type.map_language&&(u.language=r.map_type.map_language);r.view.padding_around_bounds&&0!==r.view.padding_around_bounds&&(u.fitBoundsOptions.padding=parseInt(r.view.padding_around_bounds))}const d=new e.Map(u);if(r.map_type.custom_style_json&&""!==r.map_type.custom_style_json){let t=r.map_type.custom_style_json.replace(/&/g,"&");d.setStyle(JSON.parse(t))}"custom-image"===r.map_type.map_provider&&s.setCustomImageMap(t,d,r.map_type);r.map_compare&&r.map_compare.enable_map_slider&&r.map_compare.compared_map&&s.setMapCompare(e,d,t,r.map_compare);r.load_3d_model_libraries&&window.Threebox&&(window.tb=new window.Threebox(d,d.getCanvas().getContext("webgl"),{defaultLights:!0,enableSelectingObjects:!0}));window[`mapsterMap${t}`]=d;s.setProjectionGlobe(d,r.map_type);jQuery(".mapster-wp-maps-loader-container").hide();return d}setLoader({post_id:t,loading:e}){const r=new MapsterConstants;jQuery("#mapster-wp-maps-"+t).append(r.loaderHTML(e))}setLoaderDone({post_id:t}){jQuery("#mapster-wp-maps-"+t+" .mapster-map-loader").fadeOut()}setMapResize({map:t}){t.resize()}setStreetViewControl(){}setMapTypeControl(){}setZoomControl({map:t,mapLibrary:e,controls:r,control_menu:i,zoom_control:o}){const n=new MapsterHelpers;return n.addMapControl(t,r.zoomControl,o.enable,o.position,!1,n.isInControlMenu(i,"zoom_control"),e.NavigationControl)}setAttributionControl({map:t,mapLibrary:e,controls:r,attribution_control:i,map_type:o}){if("mapbox"===o.map_provider||"maplibre"===o.map_provider)return(new MapsterHelpers).addMapControl(t,r.attributionControl,!0,i.position,!1,!1,e.AttributionControl)}setControlOrder({control_order:t}){return!(!t||"1"!==window.mapster_params.activated)&&JSON.parse(t)}setControlMenu({map:t,mapLibrary:e,post_id:r,controls:i,control_menu:o}){ 33}setElevationControl({map:t,mapLibrary:e,controls:r,control_menu:i,elevation_line_chart:o,post_id:n,lines:a}){ 34}set3DControl(t){const{map:e,mapLibrary:r,control_menu:i,controls:o}=t,n=new MapsterHelpers;return n.addMapControl(e,o["3dControl"],t["3d_control"].enable,t["3d_control"].position,!1,n.isInControlMenu(i,"3d_control"),PitchToggle)}setScaleControl({map:t,mapLibrary:e,controls:r,control_menu:i,scale_control:o}){const n=new MapsterHelpers;return n.addMapControl(t,r.scaleControl,o.enable,o.position,!1,n.isInControlMenu(i,"scale_control"),e.ScaleControl)}setPrintControl({map:t,mapLibrary:e,controls:r,control_menu:i,print_control:o}){const n=new MapsterHelpers;return!!o&&n.addMapControl(t,r.printControl,o.enable,o.position,!1,n.isInControlMenu(i,"print_control"),PrintControl)}setGeolocationControl({map:t,mapLibrary:e,controls:r,control_menu:i,geolocation_control:o}){const n=new MapsterHelpers,a={showAccuracyCircle:o.show_accuracy_circle,showUserHeading:o.show_user_heading,trackUserLocation:o.show_user_heading||o.track_user_location};"1"===window.mapster_params.activated&&o.enable_high_accuracy&&(a.positionOptions={enableHighAccuracy:!0,maximumAge:0,timeout:5e3});const s=n.addMapControl(t,r.geolocationControl,o.enable,o.position,!1,n.isInControlMenu(i,"geolocation_control"),e.GeolocateControl,a);n.setGeolocationOnLoad(o);return s}setFullscreenControl({map:t,mapLibrary:e,controls:r,control_menu:i,fullscreen_control:o}){const n=new MapsterHelpers;return n.addMapControl(t,r.fullscreenControl,o.enable,o.position,!1,n.isInControlMenu(i,"fullscreen_control"),e.FullscreenControl)}setGeocoderControl({map:t,mapLibrary:e,controls:r,control_menu:i,geocoder_control:o}){const n=new MapsterHelpers;if("undefined"!=typeof MapboxGeocoder){var a={accessToken:e.accessToken,mapboxgl:e,placeholder:o.placeholder};""!==o.limit_results&&(a.countries=o.limit_results);o.marker_color&&""!==o.marker_color&&(a.marker={color:o.marker_color});if(o.accept_latlngs){ 35}if(o.limit_by_bounds&&"1"===window.mapster_params.activated){let t=
35o.bounds_limit.southwest_longitude,e=o.bounds_limit.southwest_latitude,r=o.bounds_limit.northeast_longitude,i=o.bounds_limit.northeast_latitude;if(""!==t&&""!==e&&""!==r&&""!==i){let o=[parseFloat(t),parseFloat(e),parseFloat(r),parseFloat(i)];a.bbox=o}}return n.addMapControl(t,r.geocoderControl,o.enable,o.position,!1,n.isInControlMenu(i,"geocoder_control"),MapboxGeocoder,a)}}setDirectionsControl({map:t,mapLibrary:e,controls:r,control_menu:i,directions_control:o}){if("undefined"!=typeof MapboxDirections){const a=new MapsterHelpers;var n={accessToken:e.accessToken,mapboxgl:e,unit:o.unit,profile:o.profile,interactive:!1,placeholderOrigin:o.placeholderOrigin};return a.addMapControl(t,r.directionsControl,o.enable,o.position,!1,a.isInControlMenu(i,"directions_control"),MapboxDirections,n)}}setSearchBoxControl({map:t,mapLibrary:e,controls:r,control_menu:i,searchbox_control:o,post_id:n}){const a=new MapsterHelpers;if(o&&"undefined"!=typeof MapsterSearchBoxControl){const s={post_id:n,mapLibrary:e,accessToken:e.accessToken,position:o.position};return a.addMapControl(t,r.searchBoxControl,o.enable,o.position,!1,a.isInControlMenu(i,"searchbox_control"),MapsterSearchBoxControl,s)}}setCustomSearchFilterControl({map:t,mapLibrary:e,controls:r,control_menu:i,custom_search_filter:o,locations:n,lines:a,polygons:s,markers:l,open_popups_in_sidebar:p}){const c=new MapsterHelpers;if("undefined"!=typeof MapboxGeocoder){var u={mapboxgl:e,marker:!1,flyTo:!1,placeholder:o.placeholder};o.include_geocoder?u.accessToken=e.accessToken:u.localGeocoderOnly=!0;""!==o.limit_results&&(u.countries=o.limit_results);if(o.limit_by_bounds&&"1"===window.mapster_params.activated){let t=o.bounds_limit.southwest_longitude,e=o.bounds_limit.southwest_latitude,r=o.bounds_limit.northeast_longitude,i=o.bounds_limit.northeast_latitude;if(""!==t&&""!==e&&""!==r&&""!==i){let o=[parseFloat(t),parseFloat(e),parseFloat(r),parseFloat(i)];u.bbox=o}}(u=c.applyProSearchFilter(o,u)).localGeocoder=t=>c.searchLocalFeatures(o.search_type,t,n,a,s);const h=c.addMapControl(t,r.customSearchControl,o.enable,o.position,o.render_in_external_div,c.isInControlMenu(i,"custom_search_filter"),MapboxGeocoder,u);if(h){h.on("result",(({result:r})=>{const i=l.find((t=>t.mapsterProperties.id===r.id)),o=n.find((t=>t.id===r.id));let a={};r.bbox?a={bounds:r.bbox}:r.center&&(a={center:r.center,zoom:15});"1"===window.mapster_params.activated&&(i&&i.mapsterProperties.data.default_zoom_level?a.zoom=i.mapsterProperties.data.default_zoom_level:o&&o.data.default_zoom_level&&(a.zoom=o.data.default_zoom_level));a.bounds?t.fitBounds(a.bounds):t.flyTo(a);var s=document.createElement("div");s.innerHTML=r.place_name;jQuery(h._inputEl).val(s.innerHTML);i&&i.mapsterProperties.data.enable_popup&&!p&&i.setPopup(new e.Popup(c.returnPopupOptions(i.mapsterProperties.data)).setHTML(c.getPopupHTML(i.mapsterProperties.id,i.mapsterProperties))).togglePopup()}));return h}}}setFilterDropdownControl({MapsterMap:t,map:e,mapLibrary:r,controls:i,control_menu:o,filter_dropdown:n,locations:a,lines:s,polygons:l,markers:p}){const c=new MapsterHelpers;if("undefined"!=typeof MapboxGeocoder){var u={mapboxgl:r,localGeocoderOnly:!0,marker:!1,placeholder:n.placeholder,minLength:0,limit:1e3,flyTo:!1,localGeocoder:t=>c.searchLocalFeatures("exact-match",t,a,s,l,n.display_images)};const h=c.addMapControl(e,i.filterDropdownControl,n.enable,n.position,!1,c.isInControlMenu(o,"filter_dropdown"),MapboxGeocoder,u);if(h){n.enable&&c.modifyDropdown(h,a);h.on("result",(({result:r})=>{const i=p.find((t=>t.mapsterProperties.id===r.id)),o=a.find((t=>t.id===r.id));let n={};r.bbox?n={bounds:r.bbox}:r.center&&(n={center:r.center});"1"===window.mapster_params.activated&&(i&&i.mapsterProperties.data.default_zoom_level?n.zoom=i.mapsterProperties.data.default_zoom_level:o&&o.data.default_zoom_level&&(n.zoom=o.data.default_zoom_level));n.bounds?e.fitBounds(n.bounds,{padding:20}):e.flyTo(n);if(i&&i.mapsterProperties.data.enable_popup){if("click"===i.mapsterProperties.data.interaction)i.getElement().click();else if("hover"===i.mapsterProperties.data.interaction){const t=new Event("mouseenter");i.getElement().dispatchEvent(t)}}else o&&o.data.enable_popup&&("click"===o.data.interaction?t.doTriggerClick({lngLat:o.data.location.coordinates},o):"hover"===o.data.interaction&&t.doTriggerHover({lngLat:o.data.location.coordinates},o))}))}return h}}setCategoryFilterControl({map:t,mapLibrary:e,post_id:r,controls:i,control_menu:o,cluster_options:n,category_filter:a,markers:s,dataLayers:l,locations:p,lines:c,polygons:u,map_provider:h,label_icon_clustering:d,circle_clustering:f,marker_clustering:m,polygon_clustering:_,line_clustering:y}
35){const g=new MapsterHelpers,v={post_id:r,functionality:a.functionality,independent_children:a.independent_children,initial_visibility:a.initial_visibility,category_order:a.category_order,category_display:a.category_display,checkbox_display:a.checkbox_display,reset_button:a.reset_button,pre_selected_categories:a.pre_selected_categories,additional_filters:a.additional_filters,accordion_layout:a.accordion_layout,excluded_categories:a.excluded_categories,show_number_of_features:a.show_number_of_features,parent_cat_display:a.parent_cat_display,cluster_options:n,markers:s,dataLayers:l,locations:p,lines:c,polygons:u,map_provider:h,circle_clustering:f,label_icon_clustering:d,marker_clustering:m,polygon_clustering:_,line_clustering:y};return g.addMapControl(t,i.categoryFilterControl,a.enable,a.position,a.render_in_external_div,g.isInControlMenu(o,"category_filter"),CategoryControl,v)}setListControl({MapsterMap:t,map:e,mapLibrary:r,post_id:i,controls:o,control_menu:n,list:a,locations:s,lines:l,polygons:p,markers:c}){const u=new MapsterHelpers,h={MapsterMap:t,post_id:i,sort_by_distance:a.sort_by_distance,show_distance:a.show_distance,units:a.units,group_by_category:a.group_by_category,list_order:a.list_order,listing_type:a.listing_type,display_images:a.display_images,number_of_locations:a.number_of_locations,store_locator_options:a.store_locator_options,locations:s,lines:l,polygons:p,markers:c,mapLibrary:r};return u.addMapControl(e,o.listControl,a.enable,a.position,a.render_in_external_div,u.isInControlMenu(n,"list"),ListControl,h)}setDownloadControl({map:t,mapLibrary:e,post_id:r,controls:i,control_menu:o,download_control:n,locations:a,lines:s,polygons:l}){ 36}setCustomHTMLControl({map:t,mapLibrary:e,controls:r,control_menu:i,custom_html_control:o}){ 37}setLayerControl({map:t,mapLibrary:e,post_id:r,controls:i,control_menu:o,layer_control:n}){ 38}setStyleControl({map:t,mapLibrary:e,post_id:r,controls:i,control_menu:o,style_control:n,map_type:a}){ 39}autoAnimateGlobe({map:t,globe_animation:e,globe_animation_speed:r,globe_animation_direction:i}){ 40}setListingPosts({MapsterMap:t,post_id:e,map:r,listing_page:i,locations:o,lines:n,polygons:a,markers:s}){ 41}setJqueryEvents(){ 42}destroyMap({post_id:t,mapLibrary:e,map:r}){if(r){r.remove();jQuery(`#mapster-wp-maps-${t}`).empty()}}}class MapsterContainer{constructor(t,e,r,i){this.core={};this.MapsterMap=i;this.post_id=t;this.single_feature_id=e;this.feature_ids=r;this.postResponse;this.mapLibrary;this.markers=[];this.controls=[];this.clusterLayers=[];this.triggeredFeature;this.clickedEvent;this.clickedFeature;this.clickedPopup;this.clickedMarker;this.hoveredEvent;this.hoveredFeature;this.hoveredPopup;this.hoveredMarker;this.tempHoverMarker;this.map;this.postResponseAdmin;this.adminFeatures;this.controlOrder;this.dataLayers;this.defineCore()}defineCore(){const t=new MapsterCore;this.core.set_accesstokendefault={args:[],hook:"access_token_set",func:t.setDefaultAccessToken};this.core.define_postResponse={args:["post_id","single_feature_id","feature_ids"],hook:"data_fetched",func:t.getPostData,promise:!0};this.core.set_mapSize={args:["post_id","postResponse.map.layout"],hook:"map_size_set",func:t.setMapSize};this.core.define_mapLibrary={args:["postResponse.map.map_type"],hook:"map_library_set",func:t.setMapType};this.core.set_submissionModal={args:["post_id","map","mapLibrary","postResponse.map.submission"],hook:"submission_modal_initialized",func:t.setSubmissionModal};this.core.define_map={args:["post_id","mapLibrary","postResponse.map","postResponse.locations","postResponse.lines","postResponse.polygons"],hook:"map_set",func:t.setMap};this.core.destroy_map={args:["post_id","mapLibrary","map"],hook:"map_destroy",func:t.destroyMap};this.core.set_moveendVariables={args:["map"],hook:"map_moveend",func:t.setMapMoveEndVariables};this.core.set_jquery_events={args:[],hook:"jquery_events_set",func:t.setJqueryEvents};this.core.set_loader={args:["post_id","postResponse.map.loading"],hook:"loading_icon_started",func:t.setLoader};this.core.set_loaderdone={args:["post_id"],hook:"loading_icon_done",func:t.setLoaderDone};this.core.set_mapresize={args:["map"],hook:"map_resize_set",func:t.setMapResize};this.core.set_ipload={args:["map","postResponse.map.view"],hook:"map_set_ip_on_load",func:t.setIPLocation};this.core.set_querystringLoad={args:["MapsterMap","post_id","map","markers","postResponse.locations","postResponse.lines","postResponse.polygons"],hook:"check_querystring",func:t.checkQuerystring};this.core.set_listingposts={args:["MapsterMap","post_id","map","postResponse.map.listing_page","postResponse.locations","postResponse.lines","postResponse.polygons","markers"],hook:"map_set_listing_posts",func:t.setListingPosts};this.core.define_dataLayers={args:["map","postResponse.map.map_type.map_provider","dataLayers","postResponse.locations","postResponse.lines","postResponse.polygons"],hook:"map_datalayers_set",func:t.setDataLayers,callback:this.MapsterMap.setDataLayerEvents};this.core.set_mapfeatures={args:["MapsterMap","map","postResponse.map.map_type.map_provider","postResponse.locations","postResponse.lines","postResponse.polygons"],hook:"map_features_set",func:t.setFeaturesToMap,callback:this.MapsterMap.setLayerEvents};this.core.define_markers={args:["map","markers","mapLibrary","postResponse.locations","postResponse.map.marker_clustering"],hook:"map_markers_set",func:t.setMarkersToMap,callback:this.MapsterMap.setMarkerEvents};this.core.set_heatmap={args:["map","markers","postResponse.locations","postResponse.map.heatmap"],hook:"map_heatmap_set",func:t.setHeatmap};this.core.define_controlOrder={args:["postResponse.map.control_order"],hook:"control_order_set",func:t.setControlOrder};this.core["define_controls.controlMenu"]={args:["map","mapLibrary","post_id","controls","postResponse.map.control_menu"],hook:"control_menu_set",func:t.setControlMenu};this.core["define_controls.elevationControl"]={args:["map","mapLibrary","post_id","controls","postResponse.map.control_menu","postResponse.map.elevation_line_chart","post_id","postResponse.lines"],hook:"elevation_control_set",func:t.setElevationControl};this.core["define_controls.zoomControl"]={args:["map","mapLibrary","controls","postResponse.map.control_menu","postResponse.map.zoom_control"],hook:"zoom_control_set",func:t.setZoomControl};this.core["define_controls.attributionControl"]={args:["map","mapLibrary","controls","postResponse.map.attribution_control","postResponse.map.map_type"],hook:"attribution_control_set",func:t.setAttributionControl};this.core["define_controls.streetViewControl"]={args:["map","mapLibrary","controls","postResponse.map.street_view_control"],hook:"street_view_control_set",func:t.setStreetViewControl};this.core["define_controls.mapTypeControl"]={args:["map","mapLibrary","controls","postResponse.map.map_type_control"],hook:"map_type_control_set",func:t.setMapTypeControl};this.core["define_controls.geocoderControl"]={args:["map","mapLibrary","controls","postResponse.map.control_menu","postResponse.map.geocoder_control"],hook:"geocoder_control_set",func:t.setGeocoderControl};this.core["define_controls.searchBoxControl"]={args:["map","mapLibrary","post_id","controls","postResponse.map.control_menu","postResponse.map.searchbox_control"],hook:"geocoder_control_set",func:t.setSearchBoxControl};this.core["define_controls.directionsControl"]={args:["map","mapLibrary","controls","postResponse.map.control_menu","postResponse.map.directions_control"],hook:"directions_control_set",func:t.setDirectionsControl};this.core["define_controls.3dControl"]={args:["map","mapLibrary","controls","postResponse.map.control_menu","postResponse.map.3d_control"],hook:"3d_control_set",func:t.set3DControl};this.core["define_controls.scaleControl"]={args:["map","mapLibrary","controls","postResponse.map.control_menu","postResponse.map.scale_control"],hook:"scale_control_set",func:t.setScaleControl};this.core["define_controls.printControl"]={args:["map","mapLibrary","controls","postResponse.map.control_menu","postResponse.map.print_control"],hook:"print_control_set",func:t.setPrintControl};this.core["define_controls.geolocationControl"]={args:["map","mapLibrary","controls","postResponse.map.control_menu","postResponse.map.geolocation_control"],hook:"geolocation_control_set",func:t.setGeolocationControl};this.core["define_controls.fullscreenControl"]={args:["map","mapLibrary","controls","postResponse.map.control_menu","postResponse.map.fullscreen_control"],hook:"fullscreen_control_set",func:t.setFullscreenControl};this.core["define_controls.downloadControl"]={args:["map","mapLibrary","post_id","controls","postResponse.map.control_menu","postResponse.map.download_control","postResponse.locations","postResponse.lines","postResponse.polygons"],hook:"download_control_set",func:t.setDownloadControl};this.core["define_controls.customHTMLControl"]={args:["map","mapLibrary","controls","postResponse.map.control_menu","postResponse.map.custom_html_control"],hook:"custom_html_control_set",func:t.setCustomHTMLControl};this.core["define_controls.layerControl"]={args:["map","mapLibrary","post_id","controls","postResponse.map.control_menu","postResponse.map.layer_control"],hook:"layer_control_set",func:t.setLayerControl};this.core["define_controls.styleControl"]={args:["map","mapLibrary","post_id","controls","postResponse.map.control_menu","postResponse.map.style_control","postResponse.map.map_type"],hook:"style_control_set",func:t.setStyleControl};this.core["define_controls.customSearchControl"]={args:["map","mapLibrary","controls","postResponse.map.control_menu","postResponse.map.filter.custom_search_filter","postResponse.locations","postResponse.lines","postResponse.polygons","markers","postResponse.map.open_popups_in_sidebar"],hook:"customSearch_control_set",func:t.setCustomSearchFilterControl};this.core["define_controls.filterDropdownControl"]={args:["MapsterMap","map","mapLibrary","controls","postResponse.map.control_menu","postResponse.map.filter.filter_dropdown","postResponse.locations","postResponse.lines","postResponse.polygons","markers"],hook:"filterDropdown_control_set",func:t.setFilterDropdownControl};this.core["define_controls.categoryFilterControl"]={args:["map","mapLibrary","post_id","controls","postResponse.map.control_menu","postResponse.map.cluster_options","postResponse.map.filter.category_filter","markers","dataLayers","postResponse.locations","postResponse.lines","postResponse.polygons","postResponse.map.map_type.map_provider","postResponse.map.circle_clustering","postResponse.map.label_icon_clustering","postResponse.map.marker_clustering","postResponse.map.polygon_clustering","postResponse.map.line_clustering"],hook:"categoryFilter_control_set",func:t.setCategoryFilterControl};this.core["define_controls.listControl"]={args:["MapsterMap","map","mapLibrary","post_id","controls","postResponse.map.control_menu","postResponse.map.list","postResponse.locations","postResponse.lines","postResponse.polygons","markers"],hook:"list_control_set",func:t.setListControl};this.core.set_autoanimate={args:["map","postResponse.map.view.globe_animation","postResponse.map.view.globe_animation_speed","postResponse.map.view.globe_animation_direction"],hook:"globe_autoanimate_set",func:t.autoAnimateGlobe};this.core.define_clusterLayers={args:["map","postResponse.map.map_type.map_provider","postResponse.map.cluster_options","postResponse.map.circle_clustering","postResponse.map.label_icon_clustering","postResponse.map.marker_clustering","postResponse.map.polygon_clustering","postResponse.map.line_clustering","markers","postResponse.locations","postResponse.lines","postResponse.polygons"],hook:"map_clustering_set",func:t.doClustering,callback:this.MapsterMap.setDynamicLayerEvents};this.core.set_customscripts={args:["map","postResponse.map.javascript","postResponse.locations","postResponse.lines","postResponse.polygons"],hook:"custom_scripts_set",func:t.loadCustomScripts};this.core.set_interactivity={args:["map","postResponse.map.zoom_on_scroll","postResponse.map.interactivity","postResponse.map.allow_rotation_and_pitch"],hook:"interactivity_set",func:t.setInteractivity};this.core.set_mapstyle={args:["post_id","map","postResponse.map.map_type"],hook:"map_style_set",func:t.setMapStyle,callback:this.MapsterMap.idleReload};this.core.set_lighting={args:["map","postResponse.map.map_type"],hook:"map_lighting_set",func:t.setLighting};this.core.set_terrain={args:["map","postResponse.map.map_type.map_provider","postResponse.map.map_type.terrain"],hook:"map_terrain_set",func:t.loadTerrain};this.core.set_buildings3d={args:["map","postResponse.map.map_type.map_provider","postResponse.map.map_type.buildings_3d"],hook:"map_buildings3d_set",func:t.loadBuildings3D};this.core.set_projection={args:["map","postResponse.map.map_type.map_provider","postResponse.map.map_type.projection"],hook:"map_projection_set",func:t.loadProjection};this.core.define_clickedFeature={args:["map","postResponse.map.interactivity","postResponse.map.clicking_disabled","clickedEvent","postResponse.locations","postResponse.lines","postResponse.polygons"],hook:"layer_feature_clicked",func:t.layerClick};this.core.set_storelocatorclick={args:["clickedFeature","postResponse.map.list.store_locator_options"],hook:"",func:t.storeLocatorClick};this.core.set_sidebarclick={args:["post_id","clickedFeature","postResponse.map.minimum_sidebar_width","postResponse.map.maximum_sidebar_width","postResponse.map.list.store_locator_options","postResponse.map.open_popups_in_sidebar"],hook:"",func:t.sidebarClick}
42;this.core.define_clickedPopup={args:["map","mapLibrary","clickedPopup","clickedFeature","clickedEvent","postResponse.map.list.store_locator_options","postResponse.map.open_popups_in_sidebar"],hook:"popup_opened_from_layer_click",func:t.popupClick};this.core.define_hoveredFeature={args:["map","postResponse.map.interactivity","postResponse.map.clicking_disabled","hoveredEvent","postResponse.locations","postResponse.lines","postResponse.polygons"],hook:"layer_feature_hovered",func:t.layerHover};this.core.set_hoverEffects={args:["map","postResponse.map.interactivity","postResponse.map.clicking_disabled","hoveredFeature","dataLayers"],hook:"",func:t.layerHoverEffect};this.core.define_hoveredPopup={args:["map","mapLibrary","hoveredPopup","hoveredFeature","hoveredEvent","postResponse.map.list.store_locator_options","postResponse.map.open_popups_in_sidebar"],hook:"popup_opened_from_layer_hover",func:t.popupHover};this.core.set_hoverEffectsOff={args:["map","postResponse.map.interactivity","postResponse.map.clicking_disabled","hoveredFeature","dataLayers"],hook:"",func:t.layerHoverEffectOff};this.core.set_hoveredPopupOff={args:["hoveredFeature","hoveredPopup"],hook:"popup_closed_from_layer_hover",func:t.removePopupHover};this.core.set_externallink={args:["clickedFeature"],hook:"external_link_opened",func:t.externalClickLayer};this.core.define_clickedFeature_fromTrigger={args:["triggeredFeature","postResponse.map.interactivity","postResponse.map.clicking_disabled"],hook:"triggered_feature_clicked",func:t.triggerClick};this.core.define_clickedFeature_fromMarker={args:["clickedMarker","postResponse.map.interactivity","postResponse.map.clicking_disabled"],hook:"marker_feature_clicked",func:t.markerClick};this.core.define_hoveredFeature_fromTrigger={args:["triggeredFeature","postResponse.map.interactivity","postResponse.map.clicking_disabled"],hook:"triggered_feature_hovered",func:t.triggerHover};this.core.define_hoveredFeature_fromMarker={args:["hoveredMarker","postResponse.map.interactivity","postResponse.map.clicking_disabled"],hook:"marker_feature_hovered",func:t.markerHover};this.core.define_tempHoverMarker={args:["map","mapLibrary","postResponse.map.interactivity","postResponse.map.clicking_disabled","hoveredMarker"],hook:"",func:t.markerHoverEffect};this.core.define_clickedPopup_fromMarker={args:["map","mapLibrary","clickedMarker","clickedFeature","clickedPopup","postResponse.map.list.store_locator_options","postResponse.map.open_popups_in_sidebar"],hook:"popup_opened_from_marker_click",func:t.openMarkerClickPopup};this.core.define_hoveredPopup_fromMarker={args:["map","mapLibrary","hoveredMarker","hoveredFeature","hoveredPopup","postResponse.map.list.store_locator_options","postResponse.map.open_popups_in_sidebar"],hook:"popup_opened_from_marker_hover",func:t.openMarkerHoverPopup};this.core.set_hoverEffectsOff_fromMarker={args:["tempHoverMarker","hoveredMarker"],hook:"",func:t.markerHoverEffectOff};this.core.set_hoveredPopupOff_fromMarker={args:["hoveredMarker","hoveredFeature","hoveredPopup"],hook:"popup_closed_from_marker_hover",func:t.removeMarkerHoverPopup};this.core.define_adminFeatures={args:["postResponseAdmin.locations_ids","postResponseAdmin.lines_ids","postResponseAdmin.polygons_ids","postResponse.cats","postResponseAdmin.custom_post_ids","postResponseAdmin.custom_cats"],hook:"",func:t.getFeaturesAdmin,promise:!0};this.core["define_postResponse.locations"]={args:["adminFeatures"],hook:"locations_fetched",func:t.sortLocations};this.core["define_postResponse.lines"]={args:["adminFeatures"],hook:"lines_fetched",func:t.sortLines};this.core["define_postResponse.polygons"]={args:["adminFeatures"],hook:"polygons_fetched",func:t.sortPolygons}}doCore(t){let e=this.core[t].args,r=this.core[t].func,i={};for(var o=0;o<e.length;o++){let t=e[o].split(".");i[t[t.length-1]]=this.getObjectProperty(this,e[o])}if(this.core[t].promise)return Promise.resolve(r(i)).then((e=>{this.defineThisObject(t,e);this.core[t].callback&&this.core[t].callback(this,this.MapsterMap);this.core[t].hook&&this.MapsterMap.runHookActions(t,e)}));{const e=r(i);this.defineThisObject(t,e);this.core[t].callback&&this.core[t].callback(this,this.MapsterMap);this.core[t].hook&&this.MapsterMap.runHookActions(t,e);return e}}registerListener(t,e,r,i){this.setStarterValue(t,e,r);jQuery(document).on("change","select"!==e?t:t.replace("select",":input"),(()=>{"check"===e&&this.setObjectProperty(this,r,jQuery(t).is(":checked"));"val"===e&&this.setObjectProperty(this,r,jQuery(t).val());"select"===e&&this.setObjectProperty(this,r,jQuery(t).select2("data").map((t=>t.id)));if(i&&i.length>0)for(var o=0;o<i.length;o++){if(this.core[i[o]].promise){this.MapsterMap.doCoreAndRunActions(i[o]).then((()=>{for(var t=o+1;t<i.length;t++)this.MapsterMap.doCoreAndRunActions(i[t])}));break}this.MapsterMap.doCoreAndRunActions(i[o])}}))}setStarterValue(t,e,r){"check"===e&&this.setObjectProperty(this,r,jQuery(t).is(":checked"));"val"===e&&this.setObjectProperty(this,r,jQuery(t).val());"img"===e&&this.setObjectProperty(this,r,jQuery(t).find("img").attr("src"));"select"===e&&this.setObjectProperty(this,r,jQuery(t).select2("data").map((t=>t.id)))}defineThisObject(t,e){t.indexOf("define_")>-1&&this.setObjectProperty(this,t.split("_")[1],e)}getObjectProperty(t,e){return e.split(".").reduce(((t,e)=>t?.[e]),t)}setObjectProperty(t,e,r){e.split(".").reduce(((t,i)=>{i===e.split(".")[e.split(".").length-1]&&(t[i]=r);void 0===t[i]&&(i===e.split(".")[e.split(".").length-1]?t[i]="":t[i]={});return t?.[i]}),t)}getControlOrder(){return this.controlOrder}}class MapsterMap{constructor(t,e,r,i){this.MapsterContainer=new MapsterContainer(t,r,i,this);this.post_id=t;this.isPublic=e;this.dynamicLayerListenersSet=!1;this.isPublic||this.registerAdminEventListeners()}preInitMap(){return this.isPublic?this.doCoreAndRunActions("define_postResponse"):this.doCoreAndRunActions("define_adminFeatures")}destroy(){this.doCoreAndRunActions("destroy_map")}init(){this.preInitMap().then((()=>
42{if(!this.isPublic){this.doCoreAndRunActions("set_accesstokendefault");this.doCoreAndRunActions("define_postResponse.locations");this.doCoreAndRunActions("define_postResponse.lines");this.doCoreAndRunActions("define_postResponse.polygons")}this.initMap();this.MapsterContainer.map.on("load",(()=>{this.postLoad();this.setMoveEvents(this.MapsterContainer.map)}));this.MapsterContainer.map.on("mapster_custom_style_load",(()=>{this.postStyleSwitch(this.MapsterContainer,this)}))}))}initMap(){this.isPublic&&this.doCoreAndRunActions("set_mapSize");this.doCoreAndRunActions("define_mapLibrary");this.doCoreAndRunActions("define_map");this.doCoreAndRunActions("set_jquery_events");this.doCoreAndRunActions("set_loader");if(this.isPublic){this.doCoreAndRunActions("set_submissionModal");this.doCoreAndRunActions("set_interactivity")}}postLoad(){this.doCoreAndRunActions("set_mapresize");this.doCoreAndRunActions("set_terrain");this.doCoreAndRunActions("set_buildings3d");this.doCoreAndRunActions("set_mapfeatures");this.doCoreAndRunActions("define_dataLayers");this.doCoreAndRunActions("define_markers");this.doCoreAndRunActions("set_heatmap");setTimeout((()=>{this.doCoreAndRunActions("set_autoanimate")}),1e3);this.doCoreAndRunActions("set_listingposts");this.setControls();if(this.isPublic){this.doCoreAndRunActions("set_ipload");this.doCoreAndRunActions("define_clusterLayers");this.doCoreAndRunActions("set_querystringLoad")}this.doCoreAndRunActions("set_loaderdone");this.doCoreAndRunActions("set_customscripts")}setControls(){this.doCoreAndRunActions("define_controlOrder");this.doCoreAndRunActions("define_controls.controlMenu");let t=this.getControlOrder(),e=[],r=[{slug:"zoom_control",function:"zoomControl"},{slug:"map_type_control",function:"mapTypeControl"},{slug:"street_view_control",function:"streetViewControl"},{slug:"attribution_control",function:"attributionControl"},{slug:"geocoder_control",function:"geocoderControl"},{slug:"searchbox_control",function:"searchBoxControl"},{slug:"directions_control",function:"directionsControl"},{slug:"3d_control",function:"3dControl"},{slug:"scale_control",function:"scaleControl"},{slug:"print_control",function:"printControl"},{slug:"geolocation_control",function:"geolocationControl"},{slug:"fullscreen_control",function:"fullscreenControl"},{slug:"download_control",function:"downloadControl"},{slug:"custom_html_control",function:"customHTMLControl"},{slug:"layer_control",function:"layerControl"},{slug:"style_control",function:"styleControl"},{slug:"custom_search_filter",function:"customSearchControl"},{slug:"filter_dropdown",function:"filterDropdownControl"},{slug:"category_filter",function:"categoryFilterControl"},{slug:"elevation_line_chart",function:"elevationControl"},{slug:"list",function:"listControl"}];if(t){t.forEach((t=>{let i=r.find((e=>e.slug===t.slug));i&&e.push(i)}));r.forEach((t=>{e.find((e=>e.slug===t.slug))||e.push(t)}))}else e=r;e.forEach((t=>{this.doCoreAndRunActions(`define_controls.${t.function}`)}))}idleReload(t,e){t.map.once("idle",(()=>{e.doCoreAndRunActions("set_loader");e.doCoreAndRunActions("set_lighting");e.doCoreAndRunActions("set_terrain");e.doCoreAndRunActions("set_mapfeatures");e.doCoreAndRunActions("define_dataLayers");e.doCoreAndRunActions("define_markers");e.doCoreAndRunActions("define_clusterLayers");e.doCoreAndRunActions("set_loaderdone")}))}postStyleSwitch(t,e){t.map.once("idle",(()=>{e.doCoreAndRunActions("set_terrain");e.doCoreAndRunActions("set_mapfeatures");e.doCoreAndRunActions("define_dataLayers");e.doCoreAndRunActions("define_markers");e.doCoreAndRunActions("define_clusterLayers");e.doCoreAndRunActions("set_lighting")}))}setLayerEvents(t,e){["symbol","circle","line","fill","fill-pattern"].forEach((r=>{t.map.on("click",r,(r=>{t.clickedEvent=r;e.doCoreAndRunActions("define_clickedFeature");e.doCoreAndRunActions("set_storelocatorclick");e.doCoreAndRunActions("set_sidebarclick");e.doCoreAndRunActions("set_externallink");e.doCoreAndRunActions("define_clickedPopup")}));t.map.on("mousemove",r,(r=>{t.hoveredEvent=r;e.doCoreAndRunActions("define_hoveredFeature");e.doCoreAndRunActions("set_hoverEffects");e.doCoreAndRunActions("define_hoveredPopup")}));t.map.on("mouseout",r,(t=>{e.doCoreAndRunActions("set_hoverEffectsOff");e.doCoreAndRunActions("set_hoveredPopupOff")}))}));t.map.on("custom_layer_click",(r=>{t.clickedEvent=r;e.doCoreAndRunActions("define_clickedFeature");e.doCoreAndRunActions("set_storelocatorclick");e.doCoreAndRunActions("set_sidebarclick");e.doCoreAndRunActions("set_externallink");e.doCoreAndRunActions("define_clickedPopup")}));t.map.on("custom_layer_mouseover",(r=>{t.hoveredEvent=r;e.doCoreAndRunActions("define_hoveredFeature");e.doCoreAndRunActions("set_hoverEffects");e.doCoreAndRunActions("define_hoveredPopup")}));t.map.on("custom_layer_mouseout",(t=>{e.doCoreAndRunActions("set_hoverEffectsOff");e.doCoreAndRunActions("set_hoveredPopupOff")}))}setDynamicLayerEvents(t,e){if(t.clusterLayers.length>
420&&!this.dynamicLayerListenersSet){t.clusterLayers.forEach((r=>{if(r.indexOf("-")>-1){t.map.on("click",r,(r=>{t.clickedEvent=r;e.doCoreAndRunActions("define_clickedFeature");e.doCoreAndRunActions("set_storelocatorclick");e.doCoreAndRunActions("set_sidebarclick");e.doCoreAndRunActions("set_externallink");e.doCoreAndRunActions("define_clickedPopup")}));t.map.on("mousemove",r,(r=>{t.hoveredEvent=r;e.doCoreAndRunActions("define_hoveredFeature");e.doCoreAndRunActions("set_hoverEffects");e.doCoreAndRunActions("define_hoveredPopup")}));t.map.on("mouseout",r,(t=>{e.doCoreAndRunActions("set_hoverEffectsOff");e.doCoreAndRunActions("set_hoveredPopupOff")}))}}));this.dynamicLayerListenersSet=!0}}doTriggerClick(t,e){this.MapsterContainer.clickedEvent=t;this.MapsterContainer.triggeredFeature=e;this.doCoreAndRunActions("define_clickedFeature_fromTrigger");this.doCoreAndRunActions("set_storelocatorclick");this.doCoreAndRunActions("set_sidebarclick");this.doCoreAndRunActions("set_externallink");this.doCoreAndRunActions("define_clickedPopup")}doTriggerHover(t,e){this.MapsterContainer.hoveredEvent=t;this.MapsterContainer.triggeredFeature=e;this.doCoreAndRunActions("define_hoveredFeature_fromTrigger");this.doCoreAndRunActions("set_hoverEffects");this.doCoreAndRunActions("define_hoveredPopup")}setDataLayerEvents(t,e){}setMarkerEvents(t,e){t.markers.forEach((r=>{r.getElement().addEventListener("click",(i=>{t.clickedMarker=r;e.doCoreAndRunActions("define_clickedFeature_fromMarker");e.doCoreAndRunActions("set_storelocatorclick");e.doCoreAndRunActions("set_sidebarclick");e.doCoreAndRunActions("set_externallink");e.doCoreAndRunActions("define_clickedPopup_fromMarker")}));r.getElement().addEventListener("mouseenter",(i=>{t.hoveredMarker=r;e.doCoreAndRunActions("define_hoveredFeature_fromMarker");e.doCoreAndRunActions("define_tempHoverMarker");e.doCoreAndRunActions("define_hoveredPopup_fromMarker")}));r.getElement().addEventListener("mouseleave",(t=>{e.doCoreAndRunActions("set_hoverEffectsOff_fromMarker");e.doCoreAndRunActions("set_hoveredPopupOff_fromMarker")}))}))}setMoveEvents(t){if(!this.isPublic){t.once("idle",(t=>{this.doCoreAndRunActions("set_moveendVariables")}));t.on("moveend",(t=>{this.doCoreAndRunActions("set_moveendVariables")}))}}getControlOrder(){return this.MapsterContainer.getControlOrder()}doCoreAndRunActions(t){return this.MapsterContainer.doCore(t)}runHookActions(t,e){if(window.mwm){let i=this.MapsterContainer.core[t].hook;const o=`${i}/mapster-${this.isPublic?this.post_id:"admin"}`;if(window.mwm.actions[o]){window.mwm.actions[o].funcs;if(window.mwm.actions[o].funcs.length>0)for(var r=0;r<window.mwm.actions[o].funcs.length;r++)window.mwm.actions[o].funcs[r].func(e)}if(window.mwm.actions[i]){window.mwm.actions[i].funcs;if(window.mwm.actions[i].funcs.length>0)for(r=0;r<window.mwm.actions[i].funcs.length;r++)window.mwm.actions[i].funcs[r].func(e)}}}registerAdminEventListeners(){this.MapsterContainer.registerListener('.acf-field[data-name="zoom_on_scroll"] :input',"check","postResponse.map.zoom_on_scroll");this.MapsterContainer.registerListener('.acf-field[data-name="interactivity"] :input',"check","postResponse.map.interactivity");this.MapsterContainer.registerListener('.acf-field[data-name="open_popups_in_sidebar"] :input',"check","postResponse.map.open_popups_in_sidebar");this.MapsterContainer.registerListener('.acf-field[data-name="restrict_movement"] :input',"check","postResponse.map.restricted_movement.restrict_movement");this.MapsterContainer.registerListener('.acf-field[data-name="southwest_longitude"] :input',"val","postResponse.map.restricted_movement.allowed_bounds.southwest_longitude");this.MapsterContainer.registerListener('.acf-field[data-name="southwest_latitude"] :input',"val","postResponse.map.restricted_movement.allowed_bounds.southwest_latitude");this.MapsterContainer.registerListener('.acf-field[data-name="northeast_longitude"] :input',"val","postResponse.map.restricted_movement.allowed_bounds.northeast_longitude");this.MapsterContainer.registerListener('.acf-field[data-name="northeast_latitude"] :input',"val","postResponse.map.restricted_movement.allowed_bounds.northeast_latitude");this.MapsterContainer.registerListener('.acf-field[data-name="min_zoom"] :input',"val","postResponse.map.restricted_movement.allowed_zoom.min_zoom");this.MapsterContainer.registerListener('.acf-field[data-name="max_zoom"] :input',"val","postResponse.map.restricted_movement.allowed_zoom.max_zoom");this.MapsterContainer.registerListener('.acf-field[data-name="control_order"] :input',"val","postResponse.map.control_order");this.MapsterContainer.registerListener('.acf-field[data-name="control_menu"] .acf-field[data-name="enable"] :input',"check","postResponse.map.control_menu.enable",["define_controls.controlMenu"]);this.MapsterContainer.registerListener('.acf-field[data-name="control_menu"] .acf-field[data-name="position"] :input',"val","postResponse.map.control_menu.position",["define_controls.controlMenu"]);this.MapsterContainer.registerListener('.acf-field[data-name="control_menu"] .acf-field[data-name="included_controls"] :input[type="text"]',"val","postResponse.map.control_menu.included_controls",["define_controls.controlMenu"]);this.MapsterContainer.registerListener('.acf-field[data-name="zoom_control"] .acf-field[data-name="enable"] :input',"check","postResponse.map.zoom_control.enable",["define_controls.zoomControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="zoom_control"] .acf-field[data-name="position"] :input',"val","postResponse.map.zoom_control.position",["define_controls.zoomControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="3d_control"] .acf-field[data-name="enable"] :input',"check","postResponse.map.3d_control.enable",["define_controls.3dControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="3d_control"] .acf-field[data-name="position"] :input',"val","postResponse.map.3d_control.position",["define_controls.3dControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="scale_control"] .acf-field[data-name="enable"] :input',"check","postResponse.map.scale_control.enable",["define_controls.scaleControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="scale_control"] .acf-field[data-name="position"] :input',"val","postResponse.map.scale_control.position",["define_controls.scaleControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="print_control"] .acf-field[data-name="enable"] :input',"check","postResponse.map.print_control.enable",["define_controls.printControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="print_control"] .acf-field[data-name="position"] :input',"val","postResponse.map.print_control.position",["define_controls.printControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="attribution_control"] .acf-field[data-name="position"] :input',"val","postResponse.map.attribution_control.position",["define_controls.attributionControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="geolocation_control"] .acf-field[data-name="enable"] :input',"check","postResponse.map.geolocation_control.enable",["define_controls.geolocationControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="geolocation_control"] .acf-field[data-name="position"] :input',"val","postResponse.map.geolocation_control.position",["define_controls.geolocationControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="geolocation_control"] .acf-field[data-name="set_on_load"] :input',"check","postResponse.map.geolocation_control.set_on_load",["define_controls.geolocationControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="fullscreen_control"] .acf-field[data-name="enable"] :input',"check","postResponse.map.fullscreen_control.enable",["define_controls.fullscreenControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="fullscreen_control"] .acf-field[data-name="position"] :input',"val","postResponse.map.fullscreen_control.position",["define_controls.fullscreenControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="street_view_control"] .acf-field[data-name="enable"] :input',"check","postResponse.map.street_view_control.enable",["define_controls.streetViewControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="street_view_control"] .acf-field[data-name="position"] :input',"val","postResponse.map.street_view_control.position",["define_controls.streetViewControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="map_type_control"] .acf-field[data-name="enable"] :input',"check","postResponse.map.map_type_control.enable",["define_controls.mapTypeControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="map_type_control"] .acf-field[data-name="position"] :input',"val","postResponse.map.map_type_control.position",["define_controls.mapTypeControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="download_control"] .acf-field[data-name="enable"] :input',"check","postResponse.map.download_control.enable",["define_controls.downloadControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="download_control"] .acf-field[data-name="position"] :input',"val","postResponse.map.download_control.position",["define_controls.downloadControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="download_control"] .acf-field[data-name="interact_with_filters"] :input',"check","postResponse.map.download_control.interact_with_filters",["define_controls.downloadControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="download_control"] .acf-field[data-name="notify_on_download"] :input',"val","postResponse.map.download_control.notify_on_download",["define_controls.downloadControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="custom_html_control"] .acf-field[data-name="enable"] :input',"check","postResponse.map.custom_html_control.enable",["define_controls.customHTMLControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="custom_html_control"] .acf-field[data-name="position"] :input',"val","postResponse.map.custom_html_control.position",["define_controls.customHTMLControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="custom_html_control"] .acf-field[data-name="custom_html"] :input',"val","postResponse.map.custom_html_control.custom_html",["define_controls.customHTMLControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="layer_control"] .acf-field[data-name="enable"] :input',"check","postResponse.map.layer_control.enable",["define_controls.layerControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="layer_control"] .acf-field[data-name="position"] :input',"val","postResponse.map.layer_control.position",["define_controls.layerControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="layer_control"] .acf-field[data-name="toggleable_layers"] :input',"val","postResponse.map.layer_control.toggleable_layers",["define_controls.layerControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="layer_control"] .acf-field[data-name="toggleable_layer_titles"] :input',"val","postResponse.map.layer_control.toggleable_layer_titles",["define_controls.layerControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="layer_control"] .acf-field[data-name="checkbox_type"] :input',"val","postResponse.map.layer_control.checkbox_type",["define_controls.layerControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="style_control"] .acf-field[data-name="enable"] :input',"check","postResponse.map.style_control.enable",["define_controls.styleControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="style_control"] .acf-field[data-name="position"] :input',"val","postResponse.map.style_control.position",["define_controls.styleControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="style_control"] .acf-field[data-name="toggleable_styles"] :input',"val","postResponse.map.style_control.toggleable_styles",["define_controls.styleControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="style_control"] .acf-field[data-name="toggleable_styles_titles"] :input',"val","postResponse.map.style_control.toggleable_styles_titles",["define_controls.styleControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="style_control"] .acf-field[data-name="initial_style_title"] :input',"val","postResponse.map.style_control.initial_style_title",["define_controls.styleControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="searchbox_control"] .acf-field[data-name="enable"] :input',"check","postResponse.map.searchbox_control.enable",["define_controls.searchBoxControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="searchbox_control"] .acf-field[data-name="position"] :input',"val","postResponse.map.searchbox_control.position",["define_controls.searchBoxControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="geocoder_control"] .acf-field[data-name="enable"] :input',"check","postResponse.map.geocoder_control.enable",["define_controls.geocoderControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="geocoder_control"] .acf-field[data-name="position"] :input',"val","postResponse.map.geocoder_control.position",["define_controls.geocoderControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="geocoder_control"] .acf-field[data-name="limit_results"] :input',"val","postResponse.map.geocoder_control.limit_results",["define_controls.geocoderControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="geocoder_control"] .acf-field[data-name="placeholder"] :input',"val","postResponse.map.geocoder_control.placeholder",["define_controls.geocoderControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="directions_control"] .acf-field[data-name="enable"] :input',"check","postResponse.map.directions_control.enable",["define_controls.directionsControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="directions_control"] .acf-field[data-name="position"] :input',"val","postResponse.map.directions_control.position",["define_controls.directionsControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="directions_control"] .acf-field[data-name="unit"] :input',"val","postResponse.map.directions_control.unit",["define_controls.directionsControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="directions_control"] .acf-field[data-name="profile"] :input',"val","postResponse.map.directions_control.profile",["define_controls.directionsControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="directions_control"] .acf-field[data-name="placeholderOrigin"] :input',"val","postResponse.map.directions_control.placeholderOrigin",["define_controls.directionsControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="custom_search_filter"] .acf-field[data-name="enable"] :input',"check","postResponse.map.filter.custom_search_filter.enable",["define_controls.customSearchControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="custom_search_filter"] .acf-field[data-name="position"] :input',"val","postResponse.map.filter.custom_search_filter.position",["define_controls.customSearchControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="custom_search_filter"] .acf-field[data-name="include_geocoder"] :input',"check","postResponse.map.filter.custom_search_filter.include_geocoder",["define_controls.customSearchControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="custom_search_filter"] .acf-field[data-name="limit_results"] :input',"val","postResponse.map.filter.custom_search_filter.limit_results",["define_controls.customSearchControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="custom_search_filter"] .acf-field[data-name="number_of_results"] :input',"val","postResponse.map.filter.custom_search_filter.number_of_results",["define_controls.customSearchControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="custom_search_filter"] .acf-field[data-name="placeholder"] :input',"val","postResponse.map.filter.custom_search_filter.placeholder",["def
42ine_controls.customSearchControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="filter_dropdown"] .acf-field[data-name="enable"] :input',"check","postResponse.map.filter.filter_dropdown.enable",["define_controls.filterDropdownControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="filter_dropdown"] .acf-field[data-name="position"] :input',"val","postResponse.map.filter.filter_dropdown.position",["define_controls.filterDropdownControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="filter_dropdown"] .acf-field[data-name="placeholder"] :input',"val","postResponse.map.filter.filter_dropdown.placeholder",["define_controls.filterDropdownControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="category_filter"] .acf-field[data-name="enable"] :input',"check","postResponse.map.filter.category_filter.enable",["define_controls.categoryFilterControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="category_filter"] .acf-field[data-name="position"] :input',"val","postResponse.map.filter.category_filter.position",["define_controls.categoryFilterControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="category_filter"] .acf-field[data-name="initial_visibility"] :input',"check","postResponse.map.filter.category_filter.initial_visibility",["define_controls.categoryFilterControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="category_filter"] .acf-field[data-name="functionality"] :input',"val","postResponse.map.filter.category_filter.functionality",["define_controls.categoryFilterControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="category_filter"] .acf-field[data-name="independent_children"] :input',"check","postResponse.map.filter.category_filter.independent_children",["define_controls.categoryFilterControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="category_filter"] .acf-field[data-name="category_display"] :input',"val","postResponse.map.filter.category_filter.category_display",["define_controls.categoryFilterControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="category_filter"] .acf-field[data-name="category_order"] :input',"val","postResponse.map.filter.category_filter.category_order",["define_controls.categoryFilterControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="category_filter"] .acf-field[data-name="checkbox_display"] :input',"val","postResponse.map.filter.category_filter.checkbox_display",["define_controls.categoryFilterControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="category_filter"] .acf-field[data-name="pre_selected_categories"] :input',"val","postResponse.map.filter.category_filter.pre_selected_categories",["define_controls.categoryFilterControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="list"] .acf-field[data-name="enable"] :input',"check","postResponse.map.list.enable",["define_controls.listControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="list"] .acf-field[data-name="position"] :input',"val","postResponse.map.list.position",["define_controls.listControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="list"] .acf-field[data-name="units"] :input',"val","postResponse.map.list.units",["define_controls.listControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="list"] .acf-field[data-name="show_distance"] :input',"check","postResponse.map.list.show_distance",["define_controls.listControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="list"] .acf-field[data-name="sort_by_distance"] :input',"check","postResponse.map.list.sort_by_distance",["define_controls.listControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="list"] .acf-field[data-name="listing_type"] :input',"val","postResponse.map.list.listing_type",["define_controls.listControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="list"] .acf-field[data-name="list_order"] :input',"val","postResponse.map.list.list_order",["define_controls.listControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="list"] .acf-field[data-name="group_by_category"] :input',"check","postResponse.map.list.group_by_category",["define_controls.listControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="list"] .acf-field[data-name="number_of_locations"] :input',"val","postResponse.map.list.number_of_locations",["define_controls.listControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="list"] .acf-field[data-name="store_locator_options"] .acf-field[data-name="enable"] :input',"check","postResponse.map.list.store_locator_options.enable",["define_controls.listControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="list"] .acf-field[data-name="store_locator_options"] .acf-field[data-name="sort_hours_by_day"] :input',"check","postResponse.map.list.store_locator_options.sort_hours_by_day",["define_controls.listControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="locations"] select',"select","postResponseAdmin.locations_ids",["define_adminFeatures","define_postResponse.locations","set_mapfeatures","define_dataLayers","define_markers","define_controls.customSearchControl","define_controls.filterDropdownControl","define_controls.categoryFilterControl","define_controls.listControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="lines"] select',"select","postResponseAdmin.lines_ids",["define_adminFeatures","define_postResponse.lines","set_mapfeatures","define_dataLayers","define_markers","define_controls.customSearchControl","define_controls.filterDropdownControl","define_controls.categoryFilterControl","define_controls.listControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="polygons"] select',"select","postResponseAdmin.polygons_ids",["define_adminFeatures","define_postResponse.polygons","set_mapfeatures","define_dataLayers","define_markers","define_controls.customSearchControl","define_controls.filterDropdownControl","define_controls.categoryFilterControl","define_controls.listControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="add_by_category"] select',"select","postResponse.cats",["define_adminFeatures","define_postResponse.locations","define_postResponse.lines","define_postResponse.polygons","set_mapfeatures","define_dataLayers","define_markers","define_controls.customSearchControl","define_controls.filterDropdownControl","define_controls.categoryFilterControl","define_controls.listControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="add_custom_posts"] select',"select","postResponseAdmin.custom_post_ids",["define_adminFeatures","define_postResponse.locations","define_postResponse.lines","define_postResponse.polygons","set_mapfeatures","define_dataLayers","define_markers","define_controls.customSearchControl","define_controls.filterDropdownControl","define_controls.categoryFilterControl","define_controls.listControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="add_by_custom_category"] select',"select","postResponseAdmin.custom_cats",["define_adminFeatures","define_postResponse.locations","define_postResponse.lines","define_postResponse.polygons","set_mapfeatures","define_dataLayers","define_markers","define_controls.customSearchControl","define_controls.filterDropdownControl","define_controls.categoryFilterControl","define_controls.listControl"]);this.MapsterContainer.registerListener('.acf-field[data-name="manual_latitude"] :input',"val","postResponse.map.view.manual_latitude");this.MapsterContainer.registerListener('.acf-field[data-name="manual_longitude"] :input',"val","postResponse.map.view.manual_longitude");this.MapsterContainer.registerListener('.acf-field[data-name="manual_zoom"] :input',"val","postResponse.map.view.manual_zoom");this.MapsterContainer.registerListener('.acf-field[data-name="manual_pitch"] :input',"val","postResponse.map.view.manual_pitch");this.MapsterContainer.registerListener('.acf-field[data-name="manual_rotation"] :input',"val","postResponse.map.view.manual_rotation");this.MapsterContainer.registerListener('.acf-field[data-name="padding_around_bounds"] :input',"val","postResponse.map.view.padding_around_bounds");this.MapsterContainer.registerListener('.acf-field[data-name="initial_load"] :input',"val","postResponse.map.view.initial_load");this.MapsterContainer.registerListener('.acf-field[data-name="loading_graphic"] :input',"val","postResponse.map.loading.loading_graphic");this.MapsterContainer.registerListener('.acf-field[data-name="background_color"] :input',"val","postResponse.map.loading.background_color");this.MapsterContainer.registerListener('.acf-field[data-name="loader_color"] :input',"val","postResponse.map.loading.loader_color");this.MapsterContainer.registerListener('.acf-field[data-name="custom_loader"]',"img","postResponse.map.loading.custom_loader");this.MapsterContainer.registerListener('.acf-field[data-name="circle_clustering"] :input',"check","postResponse.map.circle_clustering");this.MapsterContainer.registerListener('.acf-field[data-name="label_icon_clustering"] :input',"check","postResponse.map.label_icon_clustering");this.MapsterContainer.registerListener('.acf-field[data-name="enable_heatmap"] :input',"check","postResponse.map.heatmap.enable_heatmap",["set_heatmap"]);this.MapsterContainer.registerListener('.acf-field[data-name="heatmap_layer"] :input',"val","postResponse.map.heatmap.heatmap_layer",["set_heatmap"]);this.MapsterContainer.registerListener('.acf-field[data-name="heatmap_layer_visibility"] :input',"val","postResponse.map.heatmap.heatmap_layer_visibility",["set_heatmap"]);this.MapsterContainer.registerListener('.acf-field[data-name="heatmap_weighted_property"] :input',"val","postResponse.map.heatmap.heatmap_weighted_property",["set_heatmap"]);this.MapsterContainer.registerListener('.acf-field[data-name="heatmap_intensity"] :input',"val","postResponse.map.heatmap.heatmap_intensity",["set_heatmap"]);this.MapsterContainer.registerListener('.acf-field[data-name="heatmap_color_range"] :input',"val","postResponse.map.heatmap.heatmap_color_range",["set_heatmap"]);this.MapsterContainer.registerListener('.acf-field[data-name="heatmap_point_radius"] :input',"val","postResponse.map.heatmap.heatmap_point_radius",["set_heatmap"]);this.MapsterContainer.registerListener('.acf-field[data-name="heatmap_opacity"] :input',"val","postResponse.map.heatmap.heatmap_opacity",["set_heatmap"]);this.MapsterContainer.registerListener('.acf-field[data-name="enable_elevation_chart"] :input',"check","postResponse.map.elevation_line_chart.enable_elevation_chart");this.MapsterContainer.registerListener('.acf-field[data-name="map_provider"] :input',"val","postResponse.map.map_type.map_provider",["define_mapLibrary"]);this.MapsterContainer.registerListener('.acf-field[data-name="map_tile_style_access_token"] :input',"val","postResponse.map.map_type.map_tile_style_access_token",["set_mapstyle"]);this.MapsterContainer.registerListener('.acf-field[data-name="map_tile_style_no_access_token"] :input',"val","postResponse.map.map_type.map_tile_style_no_access_token",["set_mapstyle"]);this.MapsterContainer.registerListener('.acf-field[data-name="access_token"] :input',"val","postResponse.map.map_type.access_token");this.MapsterContainer.registerListener('.acf-field[data-name="custom_mapbox_style"] :input',"val","postResponse.map.map_type.custom_mapbox_style",["set_mapstyle"]);this.MapsterContainer.registerListener('.acf-field[data-name="custom_style_json"] :input',"val","postResponse.map.map_type.custom_style_json",["set_mapstyle"]);this.MapsterContainer.registerListener('.acf-field[data-name="snazzy_map_style"] :input',"val","postResponse.map.map_type.snazzy_map_style",["set_mapstyle"]);this.MapsterContainer.registerListener('.acf-field[data-name="custom_image"] :input',"val","postResponse.map.map_type.custom_image",["set_mapstyle"]);this.MapsterContainer.registerListener('.acf-field[data-name="duplicate_horizontally"] :input',"check","postResponse.map.layout.duplicate_horizontally");this.MapsterContainer.registerListener('.acf-field[data-name="terrain"] :input',"check","postResponse.map.map_type.terrain",["set_terrain"]);this.MapsterContainer.registerListener('.acf-field[data-name="buildings_3d"] :input',"check","postResponse.map.map_type.buildings_3d",["set_buildings3d"]);this.MapsterContainer.registerListener('.acf-field[data-name="map_language"] :input',"val","postResponse.map.map_type.map_language");this.MapsterContainer.registerListener('.acf-field[data-name="projection"] :input',"val","postResponse.map.map_type.projection",["set_projection"]);this.MapsterContainer.registerListener('.acf-field[data-name="globe"] :input',"check","postResponse.map.map_type.globe",[]);this.MapsterContainer.registerListener('.acf-field[data-name="globe_background"] :input',"val","postResponse.map.map_type.globe_background",[])}}class MapsterPublic{constructor(){this.actions={}}add_action(t,e){this.actions[t]||(this.actions[t]={funcs:[]});this.actions[t].funcs.push({func:e})}}window.mwm=new MapsterPublic;!function(t){if(window.mapster_params&&window.mapster_params.public)(r=".mapster-wp-maps",new Promise((t=>{if(document.querySelector(r))return t(document.querySelector(r));const e=new MutationObserver((i=>{if(document.querySelector(r)){t(document.querySelector(r));e.disconnect()}}));e.observe(document.body,{childList:!0,subtree:!0})}
42))).then((e=>{let r=!1,i=t(document).scrollTop();t(".mapster-wp-maps").length>15&&(r=!0);t(".mapster-wp-maps").each((function(){const e=t(this).attr("id").replace("mapster-wp-maps-",""),o=""!==t(this).data("single_feature_id")&&t(this).data("single_feature_id"),n=""!==t(this).data("feature_ids")&&t(this).data("feature_ids");if(r){let s=!1;const l=t(window).height(),p=t(this).offset().top;a();t(document).scroll((()=>{i=t(document).scrollTop();a()}));function a(){if(i-1.5*l<p&&i+1.5*l>p&&!s){s=new MapsterMap(e,window.mapster_params.public,o,n);s.init()}else if((i-1.5*l>p||i+1.5*l<p)&&s){s.destroy();s=!1}}}else new MapsterMap(e,window.mapster_params.public,o,n).init()}))}));else if(window.mapster_params){let i="Publish this post to generate an embed code.";const o=new URLSearchParams(window.location.search);if(o.has("post")){let h=window.mapster_params.directory.replace("/admin/","/admin/includes/mapster-embed-map.php");h=h+window.mapster_params.qd+"map_id="+o.get("post");i=`<iframe src="${h}" />`}let n="Publish this post to generate a listing code.";o.has("post")&&(n=`[mapster_listing_posts id="${o.get("post")}"]`);if(document.body.classList.contains("block-editor-page")){t("#mapster-wp-maps-preview").prependTo("#normal-sortables");t(".acf-field-625df5ebf4ecc .acf-input").text(i);t(".acf-field-6507ba6e3053a .acf-input").text(n);t("#mapster-wp-map-external-search-filter-shortcode").text(a)}else{t("#mapster-wp-maps-preview").prependTo("#acf_after_title-sortables");t(".acf-field-625df5ebf4ecc .acf-input").text(i);t(".acf-field-6507ba6e3053a .acf-input").text(n)}if(o.has("post")){let d=`\n [mapster_wp_map_submit map_id="${o.get("post")}" type="create_point"]<br />\n [mapster_wp_map_submit map_id="${o.get("post")}" type="edit_point" button_text="Edit Point" header_text="Edit Point"]\n `;t(".acf-field-62bf86b094491 .acf-input").append(d)}let a="Publish this post to generate a custom search code.";o.has("post")&&(a=`[mapster_custom_search id="${o.get("post")}" to_url="${jQuery("#sample-permalink").text()}"]`);t("#mapster-wp-map-external-search-filter-shortcode").text(a);let s=acf.getFields().length,l=acf.getFields().filter((t=>"accordion"===t.data.type)).length;s-=l;let p=6,c=0,u=0;function e(t){"select"!==t&&(c+=1);c===s&&p===u&&new MapsterMap("map",window.mapster_params.public,!1).init()}acf.add_action("ready_field",e);acf.addAction("select2_init",(function(t,r,i,o){u+=1;e("select")}))}var r}(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.