suyiScreen/public/land/js/maps.js

39 lines
1.1 MiB
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global = global || self, global.SGMap = factory());
}(this, (function () { 'use strict';
/* eslint-disable */
var shared, worker, sgmap;
// define gets called three times: one for each chunk. we rely on the order
// they're imported to know which is which
function define(_, chunk) {
if (!shared) {
shared = chunk;
} else if (!worker) {
worker = chunk;
} else {
var workerBundleString = 'var sharedChunk = {}; (' + shared + ')(sharedChunk); (' + worker + ')(sharedChunk);'
var sharedChunk = {};
shared(sharedChunk);
sgmap = chunk(sharedChunk);
sgmap.workerUrl = window.URL.createObjectURL(new Blob([workerBundleString], { type: 'text/javascript' }));
}
}
define(["exports"],(function(t){"use strict";function e(t,e){return t(e={exports:{}},e.exports),e.exports}var r=n;function n(t,e,r,n){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*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=n,this.p2x=r,this.p2y=n;}n.prototype.sampleCurveX=function(t){return ((this.ax*t+this.bx)*t+this.cx)*t},n.prototype.sampleCurveY=function(t){return ((this.ay*t+this.by)*t+this.cy)*t},n.prototype.sampleCurveDerivativeX=function(t){return (3*this.ax*t+2*this.bx)*t+this.cx},n.prototype.solveCurveX=function(t,e){var r,n,i,a,o;for(void 0===e&&(e=1e-6),i=t,o=0;o<8;o++){if(a=this.sampleCurveX(i)-t,Math.abs(a)<e)return i;var s=this.sampleCurveDerivativeX(i);if(Math.abs(s)<1e-6)break;i-=a/s;}if((i=t)<(r=0))return r;if(i>(n=1))return n;for(;r<n;){if(a=this.sampleCurveX(i),Math.abs(a-t)<e)return i;t>a?r=i:n=i,i=.5*(n-r)+r;}return i},n.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var i=a;function a(t,e){this.x=t,this.y=e;}function o(t,e,n,i){var a=new r(t,e,n,i);return function(t){return a.solve(t)}}a.prototype={clone:function(){return new a(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,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),n=r*this.x+e*this.y;return this.x=e*this.x-r*this.y,this.y=n,this},_rotateAround:function(t,e){var r=Math.cos(t),n=Math.sin(t),i=e.y+n*(this.x-e.x)+r*(this.y-e.y);return this.x=e.x+r*(this.x-e.x)-n*(this.y-e.y),this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},a.convert=function(t){return t instanceof a?t:Array.isArray(t)?new a(t[0],t[1]):t};var s=o(.25,.1,.25,1);function u(t,e,r){return Math.min(r,Math.max(e,t))}function l(t,e,r){var n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i}function p(t,e,r){if(!t.length)return r(null,[]);var n=t.length,i=new Array(t.length),a=null;t.forEach((function(t,o){e(t,(function(t,e){t&&(a=t),i[o]=e,0==--n&&r(a,i);}));}));}function h(t){var e=[];for(var r in t)e.push(t[r]);return e}function c(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n<i.length;n+=1){var a=i[n];for(var o in a)t[o]=a[o];}return t}var f=1;function y(){return f++}function d(){return function t(e){return e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function m(t){return !!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function v(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 x(t,e,r){var n={};for(var i in t)n[i]=e.call(r||this,t[i],i,t);return n}function b(t,e,r){var n={};for(var i in t)e.call(r||this,t[i],i,t)&&(n[i]=t[i]);return n}function w(t){return Array.isArray(t)?t.map(w):"object"==typeof t&&t?x(t,w):t}var A={};function S(t){A[t]||("undefined"!=typeof console&&console.warn(t),A[t]=!0);}function z(t,e,r){return (r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function I(t){for(var e=0,r=0,n=t.length,i=n-1,a=void 0,o=void 0;r<n;i=r++)e+=((o=t[i]).x-(a=t[r]).x)*(a.y+o.y);return e}function k(){return "undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}function M(t){var e={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(t,r,n,i){var a=n||i;return e[r]=!a||a.toLowerCase(),""})),e["max-age"]){var r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r;}return e}var P=null;function V(t){if(null==P){var e=t.navigator?t.navigator.userAgent:null;P=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")));}return P}function C(t){try{var e=self[t];return e.setItem("_sgmap_test_",1),e.removeItem("_sgmap_test_"),!0}catch(t){return !1}}function T(){var t=navigator.userAgent;return t.indexOf("Trident")>-1&&t.indexOf("rv:11.0")>-1}function E(t,e,r,n){if(!n||!e||null==r||null==r)return t||{};var i=t.styleid,a=t.shieldType,o=0;if(!i&&!a)return t||{};if(!e[i]&&!e["40001:"+a])return null;var s=r+1;if(s=s<=3?3:s>=20?20:s,i&&e[i])for(var u=Object.keys(e[i]),l=0;l<u.length;l++){var p=u[l];if("type"!=p&&((p=p.split(",")).indexOf(s)>=0||p.indexOf(String(s))>=0)){o=1,t=c(t,e[i][u[l]]);break}}if(a&&e["40001:"+a])for(var h=Object.keys(e["40001:"+a]),f=0;f<h.length;f++){var y=h[f];if("type"!=y&&((y=y.split(",")).indexOf(s)>=0||y.indexOf(String(s))>=0)){o=1,t=c(t,e["40001:"+a][h[f]]);break}}return 0==o?null:t}var B,D,L,F,R=self.performance&&self.performance.now?self.performance.now.bind(self.performance):Date.now.bind(Date),O=self.requestAnimationFrame||self.mozRequestAnimationFrame||self.webkitRequestAnimationFrame||self.msRequestAnimationFrame,j=self.cancelAnimationFrame||self.mozCancelAnimationFrame||self.webkitCancelAnimationFrame||self.msCancelAnimationFrame,U={now:R,frame:function(t){var e=O(t);return {cancel:function(){return j(e)}}},getImageData:function(t,e){void 0===e&&(e=0);var r=self.document.createElement("canvas"),n=r.getContext("2d");if(!n)throw new Error("failed to create canvas 2d context");return r.width=t.width,r.height=t.height,n.drawImage(t,0,0,t.width,t.height),n.getImageData(-e,-e,t.width+2*e,t.height+2*e)},resolveURL:function(t){return B||(B=self.document.createElement("a")),B.href=t,B.href},hardwareConcurrency:self.navigator.hardwareConcurrency||4,get devicePixelRatio(){return self.devicePixelRatio},get prefersReducedMotion(){return !!self.matchMedia&&(null==D&&(D=self.matchMedia("(prefers-reduced-motion: reduce)")),D.matches)}},q={API_URL:"",EVENTS_URL:"",FEEDBACK_URL:"",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16,version:"2.1.0.20"},N={supported:!1,testSupport:function(t){!Z&&F&&(G?Y(t):L=t);}},Z=!1,G=!1;function Y(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,F),t.isContextLost())return;N.supported=!0;}catch(t){}t.deleteTexture(e),Z=!0;}self.document&&((F=self.document.createElement("img")).onload=function(){L&&Y(L),L=null,G=!0;},F.onerror=function(){Z=!0,L=null;},F.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var X="01",K=function(t,e){this._transformRequestFn=t,this._customAccessToken=e,this._createSkuToken();};function J(t){return 0===t.indexOf("aegis:")||/aegis\./}K.prototype._createSkuToken=function(){var t=function(){for(var t="",e=0;e<10;e++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return {token:["1",X,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt;},K.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},K.prototype.transformRequest=function(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}},K.prototype.normalizeStyleURL=function(t,e){if(!J(t))return t;var r=tt(t);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},K.prototype.normalizeGlyphsURL=function(t,e){if(!J(t))return t;var r=tt(t);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},K.prototype.normalizeSourceURL=function(t,e){if(!J(t))return t;var r=tt(t);return r.path="/v1/"+r.authority+".json",this._makeAPIURL(r,this._customAccessToken||e)},K.prototype.normalizeSpriteURL=function(t,e,r,n){var i=tt(t);return J(t)?(i.path="/styles/v1"+i.path+"/sprite"+e+r,this._makeAPIURL(i,this._customAccessToken||n)):(i.path+=""+e+r,et(i))},K.prototype.normalizeTileURL=function(t,e){if(t&&!J(t)&&!Q(t))return t;var r=tt(t);r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,"$1"),r.path=""+r.path;var n=this._customAccessToken||W(r.params)||q.ACCESS_TOKEN;return W(r.params)||r.params.push("access_token="+n),et(r)},K.prototype.canonicalizeTileURL=function(t,e){var r=tt(t);if(!r.path.match(/(^\/v4\/)/)||!r.path.match(/\.[\w]+$/))return t;var n="sgmap://tiles/";n+=r.path.replace("/v4/","");var i=r.params;return e&&(i=i.filter((function(t){return !t.match(/^access_token=/)}))),i.length&&(n+="?"+i.join("&")),n},K.prototype.canonicalizeTileset=function(t,e){for(var r=!!e&&J(e),n=[],i=0,a=t.tiles||[];i<a.length;i+=1){var o=a[i];Q(o)?n.push("Sg4326"==t.reference?this.normalizeTilesURL(o,r):this.canonicalizeTileURL(o,r)):n.push(o);}return n},K.prototype.normalizeTilesURL=function(t,e){if(0!==t.indexOf("aegis:"))return t;var r=tt(t);r.path="/v1"+r.path;var n=tt(q.API_URL);return r.protocol=n.protocol,r.authority=n.authority,et(r)},K.prototype._makeAPIURL=function(t,e){var r=tt(q.API_URL);if(t.protocol=r.protocol,t.authority=r.authority,"/"!==r.path&&(t.path=""+r.path+t.path),!q.REQUIRE_ACCESS_TOKEN)return et(t);if(!(e=e||q.ACCESS_TOKEN))throw new Error("请参考. See https://map.sgcc.com.cn/products/js-sdk/v3/# 进行登陆后获取资源");return t.params=t.params.filter((function(t){return -1===t.indexOf("access_token")})),t.params.push("access_token="+e),et(t)};var H=/^((https?:)?\/\/)?([^\/]+\.)?(epgis|sgcc)\.c(n|om)(\.cn)?|^aegis:\/\//i;function Q(t){return H.test(t)}function W(t){for(var e=0,r=t;e<r.length;e+=1){var n=r[e].match(/^access_token=(.*)$/);if(n)return n[1]}return null}var $=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function tt(t){var e=/^blob/.test(t);e&&(t=t.slice(5));var r=t.match($);if(!r)throw new Error("Unable to parse URL object");return {protocol:r[1],authority:r[2],path:r[3]||"/",params:r[4]?r[4].split("&"):[],blob:e?"blob:":""}}function et(t){var e=t.params.length?"?"+t.params.join("&"):"";return ""+t.blob+t.protocol+"://"+t.authority+t.path+e}function rt(t){if(!t)return null;var e=t.split(".");if(!e||3!==e.length)return null;try{return JSON.parse(decodeURIComponent(self.atob(e[1]).split("").map((function(t){return "%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)})).join("")))}catch(t){return null}}var nt=function(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null;};nt.prototype.getStorageKey=function(t){var e,r=rt(q.ACCESS_TOKEN);return e=r&&r.u?self.btoa(encodeURIComponent(r.u).replace(/%([0-9A-F]{2})/g,(function(t,e){return String.fromCharCode(Number("0x"+e))}))):q.ACCESS_TOKEN||"",t?"sgmap.eventData."+t+":"+e:"sgmap.eventData:"+e},nt.prototype.fetchEventData=function(){var t=C("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{var n=self.localStorage.getItem(e);n&&(this.eventData=JSON.parse(n));var i=self.localStorage.getItem(r);i&&(this.anonId=i);}catch(t){S("Unable to read from LocalStorage");}},nt.prototype.saveEventData=function(){var t=C("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{self.localStorage.setItem(r,this.anonId),Object.keys(this.eventData).length>=1&&self.localStorage.setItem(e,JSON.stringify(this.eventData));}catch(t){S("Unable to write to LocalStorage");}},nt.prototype.processRequests=function(t){},nt.prototype.postEvent=function(t,e,r,n){var i=this;if(q.EVENTS_URL){var a=tt(q.EVENTS_URL);a.params.push("access_token="+(n||q.ACCESS_TOKEN||""));var o={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"sgmap-js",sdkVersion:"3.0.18.1",skuId:X,userId:this.anonId},s=e?c(o,e):o,u={url:et(a),headers:{"Content-Type":"text/plain"},body:JSON.stringify([s])};this.pendingRequest=jt(u,(function(t){i.pendingRequest=null,r(t),i.saveEventData(),i.processRequests(n);}));}},nt.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e);};var it,at,ot=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,n){this.skuToken=r,(q.EVENTS_URL&&n||q.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return J(t)||Q(t)})))&&this.queueRequest({id:e,timestamp:Date.now()},n);},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){var r=this.queue.shift(),n=r.id,i=r.timestamp;n&&this.success[n]||(this.anonId||this.fetchEventData(),m(this.anonId)||(this.anonId=d()),this.postEvent(i,{skuToken:this.skuToken},(function(t){t||n&&(e.success[n]=!0);}),t));}},e}(nt),st=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){q.EVENTS_URL&&q.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return J(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=rt(q.ACCESS_TOKEN),n=r?r.u:q.ACCESS_TOKEN,i=n!==this.eventData.tokenU;m(this.anonId)||(this.anonId=d(),i=!0);var a=this.queue.shift();if(this.eventData.lastSuccess){var o=new Date(this.eventData.lastSuccess),s=new Date(a),u=(a-this.eventData.lastSuccess)/864e5;i=i||u>=1||u<-1||o.getDate()!==s.getDate();}else i=!0;if(!i)return this.processRequests();this.postEvent(a,{"enabled.telemetry":!1},(function(t){t||(e.eventData.lastSuccess=a,e.eventData.tokenU=n);}),t);}},e}(nt)),ut=st.postTurnstileEvent.bind(st),lt=new ot,pt=lt.postMapLoadEvent.bind(lt),ht=500,ct=50;function ft(){self.caches&&!it&&(it=self.caches.open("sgmap-tiles"));}function yt(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}var dt,mt=1/0;function vt(){return null==dt&&(dt=self.OffscreenCanvas&&new self.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof self.createImageBitmap),dt}var gt=Object.prototype.hasOwnProperty,xt=Array.isArray,bt=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),wt=function(t,e){for(var r=e&&e.plainObjects?Object.create(null):{},n=0;n<t.length;++n)void 0!==t[n]&&(r[n]=t[n]);return r},_t={arrayToObject:wt,assign:function(t,e){return Object.keys(e).reduce((function(t,r){return t[r]=e[r],t}),t)},combine:function(t,e){return [].concat(t,e)},compact:function(t){for(var e=[{obj:{o:t},prop:"o"}],r=[],n=0;n<e.length;++n)for(var i=e[n],a=i.obj[i.prop],o=Object.keys(a),s=0;s<o.length;++s){var u=o[s],l=a[u];"object"==typeof l&&null!==l&&-1===r.indexOf(l)&&(e.push({obj:a,prop:u}),r.push(l));}return function(t){for(;t.length>1;){var e=t.pop(),r=e.obj[e.prop];if(xt(r)){for(var n=[],i=0;i<r.length;++i)void 0!==r[i]&&n.push(r[i]);e.obj[e.prop]=n;}}}(e),t},decode:function(t,e,r){var n=t.replace(/\+/g," ");if("iso-8859-1"===r)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(t){return n}},encode:function(t,e,r){if(0===t.length)return t;var n="string"==typeof t?t:String(t);if("iso-8859-1"===r)return escape(n).replace(/%u[0-9a-f]{4}/gi,(function(t){return "%26%23"+parseInt(t.slice(2),16)+"%3B"}));for(var i="",a=0;a<n.length;++a){var o=n.charCodeAt(a);45===o||46===o||95===o||126===o||o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122?i+=n.charAt(a):o<128?i+=bt[o]:o<2048?i+=bt[192|o>>6]+bt[128|63&o]:o<55296||o>=57344?i+=bt[224|o>>12]+bt[128|o>>6&63]+bt[128|63&o]:(o=65536+((1023&o)<<10|1023&n.charCodeAt(a+=1)),i+=bt[240|o>>18]+bt[128|o>>12&63]+bt[128|o>>6&63]+bt[128|63&o]);}return i},isBuffer:function(t){return !(!t||"object"!=typeof t||!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t)))},isRegExp:function(t){return "[object RegExp]"===Object.prototype.toString.call(t)},merge:function t(e,r,n){if(!r)return e;if("object"!=typeof r){if(xt(e))e.push(r);else {if(!e||"object"!=typeof e)return [e,r];(n&&(n.plainObjects||n.allowPrototypes)||!gt.call(Object.prototype,r))&&(e[r]=!0);}return e}if(!e||"object"!=typeof e)return [e].concat(r);var i=e;return xt(e)&&!xt(r)&&(i=wt(e,n)),xt(e)&&xt(r)?(r.forEach((function(r,i){if(gt.call(e,i)){var a=e[i];a&&"object"==typeof a&&r&&"object"==typeof r?e[i]=t(a,r,n):e.push(r);}else e[i]=r;})),e):Object.keys(r).reduce((function(e,i){var a=r[i];return e[i]=gt.call(e,i)?t(e[i],a,n):a,e}),i)}},At=(Date,Object.prototype.hasOwnProperty),St={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:_t.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},zt=function(t){return t.replace(/&#(\d+);/g,(function(t,e){return String.fromCharCode(parseInt(e,10))}))},It=function(t,e,r){if(t){var n=r.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,i=/(\[[^[\]]*])/g,a=/(\[[^[\]]*])/.exec(n),o=a?n.slice(0,a.index):n,s=[];if(o){if(!r.plainObjects&&At.call(Object.prototype,o)&&!r.allowPrototypes)return;s.push(o);}for(var u=0;null!==(a=i.exec(n))&&u<r.depth;){if(u+=1,!r.plainObjects&&At.call(Object.prototype,a[1].slice(1,-1))&&!r.allowPrototypes)return;s.push(a[1]);}return a&&s.push("["+n.slice(a.index)+"]"),function(t,e,r){for(var n=e,i=t.length-1;i>=0;--i){var a,o=t[i];if("[]"===o&&r.parseArrays)a=[].concat(n);else {a=r.plainObjects?Object.create(null):{};var s="["===o.charAt(0)&&"]"===o.charAt(o.length-1)?o.slice(1,-1):o,u=parseInt(s,10);r.parseArrays||""!==s?!isNaN(u)&&o!==s&&String(u)===s&&u>=0&&r.parseArrays&&u<=r.arrayLimit?(a=[])[u]=n:a[s]=n:a={0:n};}n=a;}return n}(s,e,r)}},kt=function(t){var e=t.url,r=t.params;if(!r||0===Object.keys(r).length)return e;var n=-1!==e.indexOf("?");return e+(n?"&":"?")+function(t){var e=[];for(var r in t)e.push(r+"="+t[r]);return e.join("&")}(r)},Mt=function(t){window.__MAP_ISDEV&&console.log(t);},Pt={_Jm:function(t,e){for(var r,n=[],i=[0,0],a=0,o=Pt._w(t);a<o;++a)r=e?e(t[a]):t[a],Pt._zh(r[0]-i[0],n),Pt._zh(r[1]-i[1],n),i=r;return n.join("")},_zh:function(t,e){return Pt._Km(0>t?~(t<<1):t<<1,e)},_Km:function(t,e){for(;32<=t;)e.push(String.fromCharCode(63+(32|31&t))),t>>=5;return e.push(String.fromCharCode(t+63)),e},_w:function(t){return t?t.length:0},_F:function(t,e,r){if(t&&(void 0!==t.lat||void 0!==t.lng))try{Ac(t),e=t.lng,t=t.lat,r=!1;}catch(t){_.oc(t);}return t-=0,e-=0,r||(t=Pt._fb(t,-90,90),180!=e&&(e=Pt._gb(e,-180,180))),t||e},_fb:function(t,e,r){return null!=e&&(t=Math.max(t,e)),null!=r&&(t=Math.min(t,r)),t},_gb:function(t,e,r){return ((t-e)%(r-=e)+r)%r+e}},Vt=function(t){if("string"==typeof t)return function(t){for(var e=[],r=Pt._w(t),n=Array(Math.floor(t.length/2)),i=0,a=0,o=0,s=0;i<r;++s){var u=1,l=0;do{var p=t.charCodeAt(i++)-63-1;u+=p<<l,l+=5;}while(31<=p);a+=1&u?~(u>>1):u>>1,u=1,l=0;do{u+=(p=t.charCodeAt(i++)-63-1)<<l,l+=5;}while(31<=p);n[s]=Pt._F(1e-5*a,1e-5*(o+=1&u?~(u>>1):u>>1),!0),e.push([1e-5*o,1e-5*a]);}return n.length=s,e.length>1?e:e[0]}(t);if(Array.isArray(t))return t.map((function(t){return Vt(t)}));throw new Error("shape.coordinates参数格不正确")},Ct=[],Tt=function(t){return Ct.indexOf(t)>=0},Et={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(Et);var Bt=function(t){function e(e,r,n){401===r&&Q(n)&&(e+=": you may have provided an invalid sgmap access token. See https://www.sgmap.com/api-documentation/#access-tokens-and-token-scopes"),t.call(this,e),this.status=r,this.url=n,this.name=this.constructor.name,this.message=e;}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},e}(Error),Dt=k()?function(){return self.worker&&self.worker.referrer}:function(){return ("blob:"===self.location.protocol?self.parent:self).location.href};var Lt,Ft,Rt=function(t,e){var r,n=function(t){var e={};if(-1!==t.indexOf("?")){var r=t.split("?");e.url=r[0],e.params=function(t,e){var r=St;if(""===t||null==t)return r.plainObjects?Object.create(null):{};for(var n="string"==typeof t?function(t,e){var r,n={},i=(e.ignoreQueryPrefix?t.replace(/^\?/,""):t).split(e.delimiter,e.parameterLimit===1/0?void 0:e.parameterLimit),a=-1,o=e.charset;if(e.charsetSentinel)for(r=0;r<i.length;++r)0===i[r].indexOf("utf8=")&&("utf8=%E2%9C%93"===i[r]?o="utf-8":"utf8=%26%2310003%3B"===i[r]&&(o="iso-8859-1"),a=r,r=i.length);for(r=0;r<i.length;++r)if(r!==a){var s,u,l=i[r],p=l.indexOf("]="),h=-1===p?l.indexOf("="):p+1;-1===h?(s=e.decoder(l,St.decoder,o),u=e.strictNullHandling?null:""):(s=e.decoder(l.slice(0,h),St.decoder,o),u=e.decoder(l.slice(h+1),St.decoder,o)),u&&e.interpretNumericEntities&&"iso-8859-1"===o&&(u=zt(u)),u&&e.comma&&u.indexOf(",")>-1&&(u=u.split(",")),n[s]=At.call(n,s)?_t.combine(n[s],u):u;}return n}(t,r):t,i=r.plainObjects?Object.create(null):{},a=Object.keys(n),o=0;o<a.length;++o){var s=a[o],u=It(s,n[s],r);i=_t.merge(i,u,r);}return _t.compact(i)}(r[1]);}else e.url=t,e.params={};return e}(t.url),i=n.params.access_token;if(void 0===t.cache&&(t.cache=!0),i&&(delete n.params.access_token,t.headers||(t.headers={}),t.headers.Authorization=i),t.url=kt(n),!(/^file:/.test(r=t.url)||/^file:/.test(Dt())&&!/^\w+:/.test(r))){if(self.fetch&&self.Request&&self.AbortController&&self.Request.prototype.hasOwnProperty("signal"))return function(t,e){var r,n=new self.AbortController,i=new self.Request(encodeURI(t.url),{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:Dt(),signal:n.signal}),a=!1,o=!1,s=(r=i.url).indexOf("sku=")>0&&Q(r);"json"===t.type&&i.headers.set("Accept","application/json");var u=function(r,n,a){if(!o){if(r&&"SecurityError"!==r.message&&S(r),n&&a)return l(n);var u=Date.now();self.fetch(i).then((function(r){if(r.ok){var n=s?r.clone():null;return l(r,n,u)}return e(new Bt(r.statusText,r.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message));}));}},l=function(r,n,s){("arrayBuffer"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text()).then((function(t){o||(n&&s&&function(t,e,r){if(ft(),it){var n={status:e.status,statusText:e.statusText,headers:new self.Headers};e.headers.forEach((function(t,e){return n.headers.set(e,t)}));var i=M(e.headers.get("Cache-Control")||"");i["no-store"]||(i["max-age"]&&n.headers.set("Expires",new Date(r+1e3*i["max-age"]).toUTCString()),new Date(n.headers.get("Expires")).getTime()-r<42e4||function(t,e){if(void 0===at)try{new Response(new ReadableStream),at=!0;}catch(t){at=!1;}at?e(t.body):t.blob().then(e);}(e,(function(e){var r=new self.Response(e,n);ft(),it&&it.then((function(e){return e.put(yt(t.url),r)})).catch((function(t){return S(t.message)}));})));}}(i,n,s),a=!0,e(null,t,r.headers.get("Cache-Control"),r.headers.get("Expires")));})).catch((function(t){o||e(new Error(t.message));}));};return s?function(t,e){if(ft(),!it)return e(null);var r=yt(t.url);it.then((function(t){t.match(r).then((function(n){var i=function(t){if(!t)return !1;var e=new Date(t.headers.get("Expires")||0),r=M(t.headers.get("Cache-Control")||"");return e>Date.now()&&!r["no-cache"]}(n);t.delete(r),i&&t.put(r,n.clone()),e(null,n,i);})).catch(e);})).catch(e);}(i,u):u(null,null),{cancel:function(){o=!0,a||n.abort();}}}(t,e);if(k()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}return function(t,e){var r=new self.XMLHttpRequest;for(var n in r.open(t.method||"GET",encodeURI(t.url),!0),"arrayBuffer"===t.type&&(r.responseType="arraybuffer"),t.headers)r.setRequestHeader(n,t.headers[n]);return "json"===t.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===t.credentials,r.onerror=function(){e(new Error(r.statusText));},r.onload=function(){if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){var n=r.response;if("json"===t.type)try{n=JSON.parse(r.response);}catch(t){return e(t)}e(null,n,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"));}else e(new Bt(r.statusText,r.status,t.url));},r.send(t.body),{cancel:function(){return r.abort()}}}(t,e)},Ot=function(t,e){var r=t.tilesecurity,n=t.zxy;return delete t.zxy,delete t.tilesecurity,Rt(c(t,{type:"arrayBuffer"}),(function(t,i,a,o){!t&&i&&r&&(i=function(t,e){var r,n,i,a=t.z%8,o=t.x%8,s=t.y%8,u=e,l=u.byteLength-a-o-s,p=Math.floor(l/3),h=Math.floor(l/3),c=l-p-h;s<=o&&o<=a&&s<=a?(i=new Uint8Array(u.slice(s,c+s)),n=new Uint8Array(u.slice(c+o+s,c+h+o+s)),r=new Uint8Array(u.slice(c+h+o+s+a,l+a+o+s))):s<=o&&a<=o&&s<=a?(i=new Uint8Array(u.slice(s,c+s)),r=new Uint8Array(u.slice(c+a+s,c+p+a+s)),n=new Uint8Array(u.slice(c+p+a+s+o,l+a+o+s))):o<=s&&s<=a&&o<=a?(n=new Uint8Array(u.slice(o,h+o)),i=new Uint8Array(u.slice(h+o+s,c+h+o+s)),r=new Uint8Array(u.slice(c+h+a+s+o,l+a+o+s))):o<=a&&a<=s&&o<=s?(n=new Uint8Array(u.slice(o,h+o)),r=new Uint8Array(u.slice(h+o+a,h+p+o+a)),i=new Uint8Array(u.slice(h+p+a+s+o,l+a+o+s))):a<=s&&s<=o&&a<=o?(r=new Uint8Array(u.slice(a,p+a)),i=new Uint8Array(u.slice(p+a+s,c+p+a+s)),n=new Uint8Array(u.slice(c+p+a+s+o,l+a+o+s))):a<=o&&o<=s&&a<=s&&(r=new Uint8Array(u.slice(a,p+a)),n=new Uint8Array(u.slice(p+a+o,p+h+a+o)),i=new Uint8Array(u.slice(p+h+a+s+o,l+a+o+s)));var f=new Uint8Array(l);return f.set(r,0),f.set(n,p),f.set(i,h+p),T()?[].slice.call(f):f.buffer}(n,i)),e(t,i,a,o);}))},jt=function(t,e){return Rt(c(t,{method:"POST"}),e)};Lt=[],Ft=0;var Ut=function(t,e){if(N.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),Ft>=q.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:t,callback:e,cancelled:!1,cancel:function(){this.cancelled=!0;}};return Lt.push(r),r}Ft++;var n=!1,i=function(){if(!n)for(n=!0,Ft--;Lt.length&&Ft<q.MAX_PARALLEL_IMAGE_REQUESTS;){var t=Lt.shift();t.cancelled||(t.cancel=Ut(t.requestParameters,t.callback).cancel);}},a=Ot(t,(function(t,r,n,a){i(),t?e(t):r&&(vt()?function(t,e){var r=new self.Blob([new Uint8Array(t)],{type:"image/png"});self.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,n){var i=new self.Image,a=self.URL;i.onload=function(){e(null,i),a.revokeObjectURL(i.src);},i.onerror=function(){return e(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))};var o=new self.Blob([new Uint8Array(t)],{type:"image/png"});i.cacheControl=r,i.expires=n,i.src=o.size?a.createObjectURL(o):"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";}(r,e,n,a));}));return {cancel:function(){a.cancel(),i();}}};function qt(t,e,r){r[t]&&-1!==r[t].indexOf(e)||(r[t]=r[t]||[],r[t].push(e));}function Nt(t,e,r){if(r&&r[t]){var n=r[t].indexOf(e);-1!==n&&r[t].splice(n,1);}}var Zt=function(t,e){void 0===e&&(e={}),c(this,e),this.type=t;},Gt=function(t){function e(e,r){void 0===r&&(r={}),t.call(this,"error",c({error:e},r));}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(Zt),Yt=function(){};Yt.prototype.on=function(t,e){return this._listeners=this._listeners||{},qt(t,e,this._listeners),this},Yt.prototype.off=function(t,e){return Nt(t,e,this._listeners),Nt(t,e,this._oneTimeListeners),this},Yt.prototype.once=function(t,e){return this._oneTimeListeners=this._oneTimeListeners||{},qt(t,e,this._oneTimeListeners),this},Yt.prototype.fire=function(t,e){"string"==typeof t&&(t=new Zt(t,e||{}));var r=t.type;if(this.listens(r)){t.target=this;for(var n=0,i=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];n<i.length;n+=1)i[n].call(this,t);for(var a=0,o=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];a<o.length;a+=1){var s=o[a];Nt(r,s,this._oneTimeListeners),s.call(this,t);}var u=this._eventedParent;u&&(c(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),u.fire(t));}else t instanceof Gt&&console.error(t.error);return this},Yt.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)},Yt.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var Xt={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},sgmap:{}},default:"sgmap"},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},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:{},esymbol:{},eline:{},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_esymbol"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"allow-clip":{type:"boolean",value:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"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:{"allow-clip":{type:"boolean",value:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"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:{"esymbol-id":{type:"string",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"allow-clip":{type:"boolean",value:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"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:{"allow-clip":{type:"boolean",value:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-scaleable":{type:"boolean",default:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"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:["Microsoft YaHei 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_esymbol:{"allow-clip":{type:"boolean",value:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"esymbol-scaleable":{type:"boolean",default:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"esymbol-size":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"esymbol-rotate":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"esymbol-id":{type:"string",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"esymbol-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_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},expression_name:{type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},in:{group:"Lookup"},"index-of":{group:"Lookup"},slice:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},"interpolate-hcl":{group:"Ramps, scales, curves"},"interpolate-lab":{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},format:{group:"Types"},image:{group:"Types"},"number-format":{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Zoom"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Feature data"},accumulated:{group:"Feature data"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},distance:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},within:{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_esymbol"],paint_fill:{"fill-minzoom":{type:"number",default:0,minimum:0,maximum:24,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-maxzoom":{type:"number",default:24,minimum:1,maximum:24,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"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-minzoom":{type:"number",default:0,minimum:0,maximum:24,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-maxzoom":{type:"number",default:24,minimum:1,maximum:24,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"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-topcolor":{type:"color",default:"rgba(0,0,0,0)",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-minzoom":{type:"number",default:0,minimum:0,maximum:24,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-maxzoom":{type:"number",default:24,minimum:1,maximum:24,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"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-outline-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-outline-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-outline-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-outline-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern-mode":{type:"number",default:0,requires:[{"!":"line-outline-pattern"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-pattern-color":{type:"boolean",default:!1,requires:["line-pattern","line-color"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"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-minzoom":{type:"number",default:0,minimum:0,maximum:24,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-maxzoom":{type:"number",default:24,minimum:1,maximum:24,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"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_esymbol:{"esymbol-minzoom":{type:"number",default:0,minimum:0,maximum:24,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"esymbol-maxzoom":{type:"number",default:24,minimum:1,maximum:24,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"esymbol-radius":{type:"number",default:40,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"esymbol-color":{type:"color",default:"#b84842",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"esymbol-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"esymbol-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"esymbol-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"esymbol-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"esymbol-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"esymbol-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"esymbol-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"esymbol-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"esymbol-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:{"symbol-minzoom":{type:"number",default:0,minimum:0,maximum:24,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"symbol-maxzoom":{type:"number",default:24,minimum:1,maximum:24,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"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"}}},Kt=function(t,e,r,n){this.message=(t?t+": ":"")+r,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__);};function Jt(t){var e=t.value;return e?[new Kt(t.key,e,"constants have been deprecated as of v8")]:[]}function Ht(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n<i.length;n+=1){var a=i[n];for(var o in a)t[o]=a[o];}return t}function Qt(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function Wt(t){if(Array.isArray(t))return t.map(Wt);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){var e={};for(var r in t)e[r]=Wt(t[r]);return e}return Qt(t)}var $t=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),te=function(t,e){void 0===e&&(e=[]),this.parent=t,this.bindings={};for(var r=0,n=e;r<n.length;r+=1){var i=n[r];this.bindings[i[0]]=i[1];}};te.prototype.concat=function(t){return new te(this,t)},te.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.")},te.prototype.has=function(t){return !!this.bindings[t]||!!this.parent&&this.parent.has(t)};var ee={kind:"null"},re={kind:"number"},ne={kind:"string"},ie={kind:"boolean"},ae={kind:"color"},oe={kind:"object"},se={kind:"value"},ue={kind:"collator"},le={kind:"formatted"},pe={kind:"resolvedImage"};function he(t,e){return {kind:"array",itemType:t,N:e}}function ce(t){if("array"===t.kind){var e=ce(t.itemType);return "number"==typeof t.N?"array<"+e+", "+t.N+">":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var fe=[ee,re,ne,ie,ae,le,oe,he(se),pe];function ye(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!ye(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else {if(t.kind===e.kind)return null;if("value"===t.kind)for(var r=0,n=fe;r<n.length;r+=1)if(!ye(n[r],e))return null}return "Expected "+ce(t)+" but found "+ce(e)+" instead."}function de(t,e){return e.some((function(e){return e.kind===t.kind}))}function me(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 ve=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 n(t){return (t=Math.round(t))<0?0:t>255?255:t}function i(t){return n("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function a(t){return (e="%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))<0?0:e>1?1:e;var e;}function o(t,e,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 u=s.indexOf("("),l=s.indexOf(")");if(-1!==u&&l+1===s.length){var p=s.substr(0,u),h=s.substr(u+1,l-(u+1)).split(","),c=1;switch(p){case"rgba":if(4!==h.length)return null;c=a(h.pop());case"rgb":return 3!==h.length?null:[i(h[0]),i(h[1]),i(h[2]),c];case"hsla":if(4!==h.length)return null;c=a(h.pop());case"hsl":if(3!==h.length)return null;var f=(parseFloat(h[0])%360+360)%360/360,y=a(h[1]),d=a(h[2]),m=d<=.5?d*(y+1):d+y-d*y,v=2*d-m;return [n(255*o(v,m,f+1/3)),n(255*o(v,m,f)),n(255*o(v,m,f-1/3)),c];default:return null}}return null};}catch(t){}})).parseCSSColor,ge=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n;};ge.parse=function(t){if(t){if(t instanceof ge)return t;if("string"==typeof t){var e=ve(t);if(e)return new ge(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},ge.prototype.toString=function(){var t=this.toArray(),e=t[1],r=t[2],n=t[3];return "rgba("+Math.round(t[0])+","+Math.round(e)+","+Math.round(r)+","+n+")"},ge.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]},ge.black=new ge(0,0,0,1),ge.white=new ge(1,1,1,1),ge.transparent=new ge(0,0,0,0),ge.red=new ge(1,0,0,1);var xe=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"});};xe.prototype.compare=function(t,e){return this.collator.compare(t,e)},xe.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var be=function(t,e,r,n,i){this.text=t,this.image=e,this.scale=r,this.fontStack=n,this.textColor=i;},we=function(t){this.sections=t;};we.fromString=function(t){return new we([new be(t,null,null,null,null)])},we.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}))},we.factory=function(t){return t instanceof we?t:we.fromString(t)},we.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},we.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e<r.length;e+=1){var n=r[e];if(n.image)t.push(["image",n.image.name]);else {t.push(n.text);var i={};n.fontStack&&(i["text-font"]=["literal",n.fontStack.split(",")]),n.scale&&(i["font-scale"]=n.scale),n.textColor&&(i["text-color"]=["rgba"].concat(n.textColor.toArray())),t.push(i);}}return t};var _e=function(t){this.name=t.name,this.available=t.available;};function Ae(t,e,r,n){return "number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:"Invalid rgba value ["+[t,e,r,n].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function 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 ge)return !0;if(t instanceof xe)return !0;if(t instanceof we)return !0;if(t instanceof _e)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 n in t)if(!Se(t[n]))return !1;return !0}return !1}function ze(t){if(null===t)return ee;if("string"==typeof t)return ne;if("boolean"==typeof t)return ie;if("number"==typeof t)return re;if(t instanceof ge)return ae;if(t instanceof xe)return ue;if(t instanceof we)return le;if(t instanceof _e)return pe;if(Array.isArray(t)){for(var e,r=t.length,n=0,i=t;n<i.length;n+=1){var a=ze(i[n]);if(e){if(e===a)continue;e=se;break}e=a;}return he(e||se,r)}return oe}function Ie(t){var e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof ge||t instanceof we||t instanceof _e?t.toString():JSON.stringify(t)}_e.prototype.toString=function(){return this.name},_e.fromString=function(t){return t?new _e({name:t,available:!1}):null},_e.prototype.serialize=function(){return ["image",this.name]};var ke=function(t,e){this.type=t,this.value=e;};ke.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],n=ze(r),i=e.expectedType;return "array"!==n.kind||0!==n.N||!i||"array"!==i.kind||"number"==typeof i.N&&0!==i.N||(n=i),new ke(n,r)},ke.prototype.evaluate=function(){return this.value},ke.prototype.eachChild=function(){},ke.prototype.outputDefined=function(){return !0},ke.prototype.serialize=function(){return "array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof ge?["rgba"].concat(this.value.toArray()):this.value instanceof we?this.value.serialize():this.value};var Me=function(t){this.name="ExpressionEvaluationError",this.message=t;};Me.prototype.toJSON=function(){return this.message};var Pe={string:ne,number:re,boolean:ie,object:oe},Ve=function(t,e){this.type=t,this.args=e;};Ve.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r,n=1,i=t[0];if("array"===i){var a,o;if(t.length>2){var s=t[1];if("string"!=typeof s||!(s in Pe)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);a=Pe[s],n++;}else a=se;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);o=t[2],n++;}r=he(a,o);}else r=Pe[i];for(var u=[];n<t.length;n++){var l=e.parse(t[n],n,se);if(!l)return null;u.push(l);}return new Ve(r,u)},Ve.prototype.evaluate=function(t){for(var e=0;e<this.args.length;e++){var r=this.args[e].evaluate(t);if(!ye(this.type,ze(r)))return r;if(e===this.args.length-1)throw new Me("Expected value to be of type "+ce(this.type)+", but found "+ce(ze(r))+" instead.")}return null},Ve.prototype.eachChild=function(t){this.args.forEach(t);},Ve.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},Ve.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 n=t.N;("number"==typeof n||this.args.length>1)&&e.push(n);}}return e.concat(this.args.map((function(t){return t.serialize()})))};var Ce=function(t){this.type=le,this.sections=t;};Ce.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");for(var n=[],i=!1,a=1;a<=t.length-1;++a){var o=t[a];if(i&&"object"==typeof o&&!Array.isArray(o)){i=!1;var s=null;if(o["font-scale"]&&!(s=e.parse(o["font-scale"],1,re)))return null;var u=null;if(o["text-font"]&&!(u=e.parse(o["text-font"],1,he(ne))))return null;var l=null;if(o["text-color"]&&!(l=e.parse(o["text-color"],1,ae)))return null;var p=n[n.length-1];p.scale=s,p.font=u,p.textColor=l;}else {var h=e.parse(t[a],1,se);if(!h)return null;var c=h.type.kind;if("string"!==c&&"value"!==c&&"null"!==c&&"resolvedImage"!==c)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:h,scale:null,font:null,textColor:null});}}return new Ce(n)},Ce.prototype.evaluate=function(t){return new we(this.sections.map((function(e){var r=e.content.evaluate(t);return ze(r)===pe?new be("",r,null,null,null):new be(Ie(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},Ce.prototype.eachChild=function(t){for(var e=0,r=this.sections;e<r.length;e+=1){var n=r[e];t(n.content),n.scale&&t(n.scale),n.font&&t(n.font),n.textColor&&t(n.textColor);}},Ce.prototype.outputDefined=function(){return !1},Ce.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e<r.length;e+=1){var n=r[e];t.push(n.content.serialize());var i={};n.scale&&(i["font-scale"]=n.scale.serialize()),n.font&&(i["text-font"]=n.font.serialize()),n.textColor&&(i["text-color"]=n.textColor.serialize()),t.push(i);}return t};var Te=function(t){this.type=pe,this.input=t;};Te.parse=function(t,e){if(2!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,ne);return r?new Te(r):e.error("No image name provided.")},Te.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=_e.fromString(e);return r&&t.availableImages&&(r.available=t.availableImages.indexOf(e)>-1),r},Te.prototype.eachChild=function(t){t(this.input);},Te.prototype.outputDefined=function(){return !1},Te.prototype.serialize=function(){return ["image",this.input.serialize()]};var Ee={"to-boolean":ie,"to-color":ae,"to-number":re,"to-string":ne},Be=function(t,e){this.type=t,this.args=e;};Be.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[0];if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");for(var n=Ee[r],i=[],a=1;a<t.length;a++){var o=e.parse(t[a],a,se);if(!o)return null;i.push(o);}return new Be(n,i)},Be.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,n=0,i=this.args;n<i.length;n+=1){if(r=null,(e=i[n].evaluate(t))instanceof ge)return e;if("string"==typeof e){var a=t.parseColor(e);if(a)return a}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 ge(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new Me(r||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var o=null,s=0,u=this.args;s<u.length;s+=1){if(null===(o=u[s].evaluate(t)))return 0;var l=Number(o);if(!isNaN(l))return l}throw new Me("Could not convert "+JSON.stringify(o)+" to number.")}return "formatted"===this.type.kind?we.fromString(Ie(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?_e.fromString(Ie(this.args[0].evaluate(t))):Ie(this.args[0].evaluate(t))},Be.prototype.eachChild=function(t){this.args.forEach(t);},Be.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},Be.prototype.serialize=function(){if("formatted"===this.type.kind)return new Ce([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new Te(this.args[0]).serialize();var t=["to-"+this.type.kind];return this.eachChild((function(e){t.push(e.serialize());})),t};var De=["Unknown","Point","LineString","Polygon"],Le=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null;};Le.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},Le.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?De[this.feature.type]:this.feature.type:null},Le.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},Le.prototype.canonicalID=function(){return this.canonical},Le.prototype.properties=function(){return this.feature&&this.feature.properties||{}},Le.prototype.parseColor=function(t){var e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=ge.parse(t)),e};var Fe=function(t,e,r,n){this.name=t,this.type=e,this._evaluate=r,this.args=n;};Fe.prototype.evaluate=function(t){return this._evaluate(t,this.args)},Fe.prototype.eachChild=function(t){this.args.forEach(t);},Fe.prototype.outputDefined=function(){return !1},Fe.prototype.serialize=function(){return [this.name].concat(this.args.map((function(t){return t.serialize()})))},Fe.parse=function(t,e){var r,n=t[0],i=Fe.definitions[n];if(!i)return e.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0);for(var a=Array.isArray(i)?i[0]:i.type,o=Array.isArray(i)?[[i[1],i[2]]]:i.overloads,s=o.filter((function(e){var r=e[0];return !Array.isArray(r)||r.length===t.length-1})),u=null,l=0,p=s;l<p.length;l+=1){var h=p[l],c=h[0],f=h[1];u=new ar(e.registry,e.path,null,e.scope);for(var y=[],d=!1,m=1;m<t.length;m++){var v=t[m],g=Array.isArray(c)?c[m-1]:c.type,x=u.parse(v,1+y.length,g);if(!x){d=!0;break}y.push(x);}if(!d)if(Array.isArray(c)&&c.length!==y.length)u.error("Expected "+c.length+" arguments, but found "+y.length+" instead.");else {for(var b=0;b<y.length;b++){var w=Array.isArray(c)?c[b]:c.type,_=y[b];u.concat(b+1).checkSubtype(w,_.type);}if(0===u.errors.length)return new Fe(n,a,f,y)}}if(1===s.length)(r=e.errors).push.apply(r,u.errors);else {for(var A=(s.length?s:o).map((function(t){var e;return e=t[0],Array.isArray(e)?"("+e.map(ce).join(", ")+")":"("+ce(e.type)+"...)"})).join(" | "),S=[],z=1;z<t.length;z++){var I=e.parse(t[z],1+S.length);if(!I)return null;S.push(ce(I.type));}e.error("Expected arguments of type "+A+", but found ("+S.join(", ")+") instead.");}return null},Fe.register=function(t,e){for(var r in Fe.definitions=e,e)t[r]=Fe;};var Re=function(t,e,r){this.type=ue,this.locale=r,this.caseSensitive=t,this.diacriticSensitive=e;};function Oe(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 je(t,e){return !(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function Ue(t,e){var r=(180+t[0])/360,n=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,i=Math.pow(2,e.z);return [Math.round(r*i*8192),Math.round(n*i*8192)]}function qe(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 Ne(t,e){for(var r,n,i,a,o,s,u,l=!1,p=0,h=e.length;p<h;p++)for(var c=e[p],f=0,y=c.length;f<y-1;f++){if((a=(r=t)[0]-(n=c[f])[0])*(u=r[1]-(i=c[f+1])[1])-(s=r[0]-i[0])*(o=r[1]-n[1])==0&&a*s<=0&&o*u<=0)return !1;qe(t,c[f],c[f+1])&&(l=!l);}return l}function Ze(t,e){for(var r=0;r<e.length;r++)if(Ne(t,e[r]))return !0;return !1}function Ge(t,e,r,n){var i=n[0]-r[0],a=n[1]-r[1],o=(t[0]-r[0])*a-i*(t[1]-r[1]),s=(e[0]-r[0])*a-i*(e[1]-r[1]);return o>0&&s<0||o<0&&s>0}function Ye(t,e,r){for(var n=0,i=r;n<i.length;n+=1)for(var a=i[n],o=0;o<a.length-1;++o)if(0!=(h=[(p=a[o+1])[0]-(l=a[o])[0],p[1]-l[1]])[0]*(c=[(u=e)[0]-(s=t)[0],u[1]-s[1]])[1]-h[1]*c[0]&&Ge(s,u,l,p)&&Ge(l,p,s,u))return !0;var s,u,l,p,h,c;return !1}function Xe(t,e){for(var r=0;r<t.length;++r)if(!Ne(t[r],e))return !1;for(var n=0;n<t.length-1;++n)if(Ye(t[n],t[n+1],e))return !1;return !0}function Ke(t,e){for(var r=0;r<e.length;r++)if(Xe(t,e[r]))return !0;return !1}function Je(t,e,r){for(var n=[],i=0;i<t.length;i++){for(var a=[],o=0;o<t[i].length;o++){var s=Ue(t[i][o],r);Oe(e,s),a.push(s);}n.push(a);}return n}function He(t,e,r){for(var n=[],i=0;i<t.length;i++){var a=Je(t[i],e,r);n.push(a);}return n}function Qe(t,e,r,n){if(t[0]<r[0]||t[0]>r[2]){var i=.5*n,a=t[0]-r[0]>i?-n:r[0]-t[0]>i?n:0;0===a&&(a=t[0]-r[2]>i?-n:r[2]-t[0]>i?n:0),t[0]+=a;}Oe(e,t);}function We(t,e,r,n){for(var i=8192*Math.pow(2,n.z),a=[8192*n.x,8192*n.y],o=[],s=0,u=t;s<u.length;s+=1)for(var l=0,p=u[s];l<p.length;l+=1){var h=p[l],c=[h.x+a[0],h.y+a[1]];Qe(c,e,r,i),o.push(c);}return o}function $e(t,e,r,n){for(var i,a=8192*Math.pow(2,n.z),o=[8192*n.x,8192*n.y],s=[],u=0,l=t;u<l.length;u+=1){for(var p=[],h=0,c=l[u];h<c.length;h+=1){var f=c[h],y=[f.x+o[0],f.y+o[1]];Oe(e,y),p.push(y);}s.push(p);}if(e[2]-e[0]<=a/2){(i=e)[0]=i[1]=1/0,i[2]=i[3]=-1/0;for(var d=0,m=s;d<m.length;d+=1)for(var v=0,g=m[d];v<g.length;v+=1)Qe(g[v],e,r,a);}return s}Re.parse=function(t,e){if(2!==t.length)return e.error("Expected one argument.");var r=t[1];if("object"!=typeof r||Array.isArray(r))return e.error("Collator options argument must be an object.");var n=e.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,ie);if(!n)return null;var i=e.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,ie);if(!i)return null;var a=null;return r.locale&&!(a=e.parse(r.locale,1,ne))?null:new Re(n,i,a)},Re.prototype.evaluate=function(t){return new xe(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},Re.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale);},Re.prototype.outputDefined=function(){return !1},Re.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 tr=function(t,e){this.type=ie,this.geojson=t,this.geometries=e;};function er(t){if(t instanceof Fe){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 tr)return !1;var e=!0;return t.eachChild((function(t){e&&!er(t)&&(e=!1);})),e}function rr(t){if(t instanceof Fe&&"feature-state"===t.name)return !1;var e=!0;return t.eachChild((function(t){e&&!rr(t)&&(e=!1);})),e}function nr(t,e){if(t instanceof Fe&&e.indexOf(t.name)>=0)return !1;var r=!0;return t.eachChild((function(t){r&&!nr(t,e)&&(r=!1);})),r}tr.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 n=0;n<r.features.length;++n){var i=r.features[n].geometry.type;if("Polygon"===i||"MultiPolygon"===i)return new tr(r,r.features[n].geometry)}else if("Feature"===r.type){var a=r.geometry.type;if("Polygon"===a||"MultiPolygon"===a)return new tr(r,r.geometry)}else if("Polygon"===r.type||"MultiPolygon"===r.type)return new tr(r,r)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")},tr.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],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if("Polygon"===e.type){var a=Je(e.coordinates,n,i),o=We(t.geometry(),r,n,i);if(!je(r,n))return !1;for(var s=0,u=o;s<u.length;s+=1)if(!Ne(u[s],a))return !1}if("MultiPolygon"===e.type){var l=He(e.coordinates,n,i),p=We(t.geometry(),r,n,i);if(!je(r,n))return !1;for(var h=0,c=p;h<c.length;h+=1)if(!Ze(c[h],l))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],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if("Polygon"===e.type){var a=Je(e.coordinates,n,i),o=$e(t.geometry(),r,n,i);if(!je(r,n))return !1;for(var s=0,u=o;s<u.length;s+=1)if(!Xe(u[s],a))return !1}if("MultiPolygon"===e.type){var l=He(e.coordinates,n,i),p=$e(t.geometry(),r,n,i);if(!je(r,n))return !1;for(var h=0,c=p;h<c.length;h+=1)if(!Ke(c[h],l))return !1}return !0}(t,this.geometries)}return !1},tr.prototype.eachChild=function(){},tr.prototype.outputDefined=function(){return !0},tr.prototype.serialize=function(){return ["within",this.geojson]};var ir=function(t,e){this.type=e.type,this.name=t,this.boundExpression=e;};ir.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 ir(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)},ir.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},ir.prototype.eachChild=function(){},ir.prototype.outputDefined=function(){return !1},ir.prototype.serialize=function(){return ["var",this.name]};var ar=function(t,e,r,n,i){void 0===e&&(e=[]),void 0===n&&(n=new te),void 0===i&&(i=[]),this.registry=t,this.path=e,this.key=e.map((function(t){return "["+t+"]"})).join(""),this.scope=n,this.errors=i,this.expectedType=r;};function or(t,e){for(var r,n=t.length-1,i=0,a=n,o=0;i<=a;)if((r=t[o=Math.floor((i+a)/2)])<=e){if(o===n||e<t[o+1])return o;i=o+1;}else {if(!(r>e))throw new Me("Input is not a number.");a=o-1;}return 0}ar.prototype.parse=function(t,e,r,n,i){return void 0===i&&(i={}),e?this.concat(e,r,n)._parse(t,i):this._parse(t,i)},ar.prototype._parse=function(t,e){function r(t,e,r){return "assert"===r?new Ve(e,[t]):"coerce"===r?new Be(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var n=t[0];if("string"!=typeof n)return this.error("Expression name must be a string, but found "+typeof n+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var i=this.registry[n];if(i){var a=i.parse(t,this);if(!a)return null;if(this.expectedType){var o=this.expectedType,s=a.type;if("string"!==o.kind&&"number"!==o.kind&&"boolean"!==o.kind&&"object"!==o.kind&&"array"!==o.kind||"value"!==s.kind)if("color"!==o.kind&&"formatted"!==o.kind&&"resolvedImage"!==o.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(o,s))return null}else a=r(a,o,e.typeAnnotation||"coerce");else a=r(a,o,e.typeAnnotation||"assert");}if(!(a instanceof ke)&&"resolvedImage"!==a.type.kind&&function t(e){if(e instanceof ir)return t(e.boundExpression);if(e instanceof Fe&&"error"===e.name)return !1;if(e instanceof Re)return !1;if(e instanceof tr)return !1;var r=e instanceof Be||e instanceof Ve,n=!0;return e.eachChild((function(e){n=r?n&&t(e):n&&e instanceof ke;})),!!n&&er(e)&&nr(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(a)){var u=new Le;try{a=new ke(a.type,a.evaluate(u));}catch(t){return this.error(t.message),null}}return a}return this.error('Unknown expression "'+n+'". 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.")},ar.prototype.concat=function(t,e,r){var n="number"==typeof t?this.path.concat(t):this.path,i=r?this.scope.concat(r):this.scope;return new ar(this.registry,n,e||null,i,this.errors)},ar.prototype.error=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];var n=""+this.key+e.map((function(t){return "["+t+"]"})).join("");this.errors.push(new $t(n,t));},ar.prototype.checkSubtype=function(t,e){var r=ye(t,e);return r&&this.error(r),r};var sr=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var n=0,i=r;n<i.length;n+=1){var a=i[n],o=a[1];this.labels.push(a[0]),this.outputs.push(o);}};function ur(t,e,r){return t*(1-r)+e*r}sr.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,re);if(!r)return null;var n=[],i=null;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);for(var a=1;a<t.length;a+=2){var o=1===a?-1/0:t[a],s=t[a+1],u=a,l=a+1;if("number"!=typeof o)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',u);if(n.length&&n[n.length-1][0]>=o)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',u);var p=e.parse(s,l,i);if(!p)return null;i=i||p.type,n.push([o,p]);}return new sr(i,r,n)},sr.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;return n>=e[i-1]?r[i-1].evaluate(t):r[or(e,n)].evaluate(t)},sr.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1)t(r[e]);},sr.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},sr.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 lr=Object.freeze({__proto__:null,number:ur,color:function(t,e,r){return new ge(ur(t.r,e.r,r),ur(t.g,e.g,r),ur(t.b,e.b,r),ur(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,n){return ur(t,e[n],r)}))}}),pr=6/29*3*(6/29),hr=Math.PI/180,cr=180/Math.PI;function fr(t){return t>.008856451679035631?Math.pow(t,1/3):t/pr+4/29}function yr(t){return t>6/29?t*t*t:pr*(t-4/29)}function dr(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function mr(t){return (t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function vr(t){var e=mr(t.r),r=mr(t.g),n=mr(t.b),i=fr((.4124564*e+.3575761*r+.1804375*n)/.95047),a=fr((.2126729*e+.7151522*r+.072175*n)/1);return {l:116*a-16,a:500*(i-a),b:200*(a-fr((.0193339*e+.119192*r+.9503041*n)/1.08883)),alpha:t.a}}function gr(t){var e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=1*yr(e),r=.95047*yr(r),n=1.08883*yr(n),new ge(dr(3.2404542*r-1.5371385*e-.4985314*n),dr(-.969266*r+1.8760108*e+.041556*n),dr(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}function xr(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var br={forward:vr,reverse:gr,interpolate:function(t,e,r){return {l:ur(t.l,e.l,r),a:ur(t.a,e.a,r),b:ur(t.b,e.b,r),alpha:ur(t.alpha,e.alpha,r)}}},wr={forward:function(t){var e=vr(t),r=e.l,n=e.a,i=e.b,a=Math.atan2(i,n)*cr;return {h:a<0?a+360:a,c:Math.sqrt(n*n+i*i),l:r,alpha:t.a}},reverse:function(t){var e=t.h*hr,r=t.c;return gr({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return {h:xr(t.h,e.h,r),c:ur(t.c,e.c,r),l:ur(t.l,e.l,r),alpha:ur(t.alpha,e.alpha,r)}}},_r=Object.freeze({__proto__:null,lab:br,hcl:wr}),Ar=function(t,e,r,n,i){this.type=t,this.operator=e,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(var a=0,o=i;a<o.length;a+=1){var s=o[a],u=s[1];this.labels.push(s[0]),this.outputs.push(u);}};function Sr(t,e,r,n){var i=n-r,a=t-r;return 0===i?0:1===e?a/i:(Math.pow(e,a)-1)/(Math.pow(e,i)-1)}Ar.interpolationFactor=function(t,e,n,i){var a=0;if("exponential"===t.name)a=Sr(e,t.base,n,i);else if("linear"===t.name)a=Sr(e,1,n,i);else if("cubic-bezier"===t.name){var o=t.controlPoints;a=new r(o[0],o[1],o[2],o[3]).solve(Sr(e,1,n,i));}return a},Ar.parse=function(t,e){var r=t[0],n=t[1],i=t[2],a=t.slice(3);if(!Array.isArray(n)||0===n.length)return e.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){var o=n[1];if("number"!=typeof o)return e.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:o};}else {if("cubic-bezier"!==n[0])return e.error("Unknown interpolation type "+String(n[0]),1,0);var s=n.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);n={name:"cubic-bezier",controlPoints:s};}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(i=e.parse(i,2,re)))return null;var u=[],l=null;"interpolate-hcl"===r||"interpolate-lab"===r?l=ae:e.expectedType&&"value"!==e.expectedType.kind&&(l=e.expectedType);for(var p=0;p<a.length;p+=2){var h=a[p],c=a[p+1],f=p+3,y=p+4;if("number"!=typeof h)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',f);if(u.length&&u[u.length-1][0]>=h)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',f);var d=e.parse(c,y,l);if(!d)return null;l=l||d.type,u.push([h,d]);}return "number"===l.kind||"color"===l.kind||"array"===l.kind&&"number"===l.itemType.kind&&"number"==typeof l.N?new Ar(l,r,n,i,u):e.error("Type "+ce(l)+" 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 n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;if(n>=e[i-1])return r[i-1].evaluate(t);var a=or(e,n),o=Ar.interpolationFactor(this.interpolation,n,e[a],e[a+1]),s=r[a].evaluate(t),u=r[a+1].evaluate(t);return "interpolate"===this.operator?lr[this.type.kind.toLowerCase()](s,u,o):"interpolate-hcl"===this.operator?wr.reverse(wr.interpolate(wr.forward(s),wr.forward(u),o)):br.reverse(br.interpolate(br.forward(s),br.forward(u),o))},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 zr=function(t,e){this.type=t,this.args=e;};zr.parse=function(t,e){if(t.length<2)return e.error("Expectected at least one argument.");var r=null,n=e.expectedType;n&&"value"!==n.kind&&(r=n);for(var i=[],a=0,o=t.slice(1);a<o.length;a+=1){var s=e.parse(o[a],1+i.length,r,void 0,{typeAnnotation:"omit"});if(!s)return null;r=r||s.type,i.push(s);}var u=n&&i.some((function(t){return ye(n,t.type)}));return new zr(u?se:r,i)},zr.prototype.evaluate=function(t){for(var e,r=null,n=0,i=0,a=this.args;i<a.length&&(n++,(r=a[i].evaluate(t))&&r instanceof _e&&!r.available&&(e||(e=r.name),r=null,n===this.args.length&&(r=e)),null===r);i+=1);return r},zr.prototype.eachChild=function(t){this.args.forEach(t);},zr.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},zr.prototype.serialize=function(){var t=["coalesce"];return this.eachChild((function(e){t.push(e.serialize());})),t};var Ir=function(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e;};Ir.prototype.evaluate=function(t){return this.result.evaluate(t)},Ir.prototype.eachChild=function(t){for(var e=0,r=this.bindings;e<r.length;e+=1)t(r[e][1]);t(this.result);},Ir.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=[],n=1;n<t.length-1;n+=2){var i=t[n];if("string"!=typeof i)return e.error("Expected string, but found "+typeof i+" instead.",n);if(/[^a-zA-Z0-9_]/.test(i))return e.error("Variable names must contain only alphanumeric characters or '_'.",n);var a=e.parse(t[n+1],n+1);if(!a)return null;r.push([i,a]);}var o=e.parse(t[t.length-1],t.length-1,e.expectedType,r);return o?new Ir(r,o):null},Ir.prototype.outputDefined=function(){return this.result.outputDefined()},Ir.prototype.serialize=function(){for(var t=["let"],e=0,r=this.bindings;e<r.length;e+=1){var n=r[e];t.push(n[0],n[1].serialize());}return t.push(this.result.serialize()),t};var kr=function(t,e,r){this.type=t,this.index=e,this.input=r;};kr.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,re),n=e.parse(t[2],2,he(e.expectedType||se));return r&&n?new kr(n.type.itemType,r,n):null},kr.prototype.evaluate=function(t){var e=this.index.evaluate(t),r=this.input.evaluate(t);if(e<0)throw new Me("Array index out of bounds: "+e+" < 0.");if(e>=r.length)throw new Me("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new Me("Array index must be an integer, but found "+e+" instead.");return r[e]},kr.prototype.eachChild=function(t){t(this.index),t(this.input);},kr.prototype.outputDefined=function(){return !1},kr.prototype.serialize=function(){return ["at",this.index.serialize(),this.input.serialize()]};var Mr=function(t,e){this.type=ie,this.needle=t,this.haystack=e;};Mr.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,se),n=e.parse(t[2],2,se);return r&&n?de(r.type,[ie,ne,re,ee,se])?new Mr(r,n):e.error("Expected first argument to be of type boolean, string, number or null, but found "+ce(r.type)+" instead"):null},Mr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!r)return !1;if(!me(e,["boolean","string","number","null"]))throw new Me("Expected first argument to be of type boolean, string, number or null, but found "+ce(ze(e))+" instead.");if(!me(r,["string","array"]))throw new Me("Expected second argument to be of type array or string, but found "+ce(ze(r))+" instead.");return r.indexOf(e)>=0},Mr.prototype.eachChild=function(t){t(this.needle),t(this.haystack);},Mr.prototype.outputDefined=function(){return !0},Mr.prototype.serialize=function(){return ["in",this.needle.serialize(),this.haystack.serialize()]};var Pr=function(t,e,r){this.type=re,this.needle=t,this.haystack=e,this.fromIndex=r;};Pr.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,se),n=e.parse(t[2],2,se);if(!r||!n)return null;if(!de(r.type,[ie,ne,re,ee,se]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+ce(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,re);return i?new Pr(r,n,i):null}return new Pr(r,n)},Pr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!me(e,["boolean","string","number","null"]))throw new Me("Expected first argument to be of type boolean, string, number or null, but found "+ce(ze(e))+" instead.");if(!me(r,["string","array"]))throw new Me("Expected second argument to be of type array or string, but found "+ce(ze(r))+" instead.");if(this.fromIndex){var n=this.fromIndex.evaluate(t);return r.indexOf(e,n)}return r.indexOf(e)},Pr.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex);},Pr.prototype.outputDefined=function(){return !1},Pr.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 Vr=function(t,e,r,n,i,a){this.inputType=t,this.type=e,this.input=r,this.cases=n,this.outputs=i,this.otherwise=a;};Vr.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var r,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var i={},a=[],o=2;o<t.length-1;o+=2){var s=t[o],u=t[o+1];Array.isArray(s)||(s=[s]);var l=e.concat(o);if(0===s.length)return l.error("Expected at least one branch label.");for(var p=0,h=s;p<h.length;p+=1){var c=h[p];if("number"!=typeof c&&"string"!=typeof c)return l.error("Branch labels must be numbers or strings.");if("number"==typeof c&&Math.abs(c)>Number.MAX_SAFE_INTEGER)return l.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof c&&Math.floor(c)!==c)return l.error("Numeric branch labels must be integer values.");if(r){if(l.checkSubtype(r,ze(c)))return null}else r=ze(c);if(void 0!==i[String(c)])return l.error("Branch labels must be unique.");i[String(c)]=a.length;}var f=e.parse(u,o,n);if(!f)return null;n=n||f.type,a.push(f);}var y=e.parse(t[1],1,se);if(!y)return null;var d=e.parse(t[t.length-1],t.length-1,n);return d?"value"!==y.type.kind&&e.concat(1).checkSubtype(r,y.type)?null:new Vr(r,n,y,i,a,d):null},Vr.prototype.evaluate=function(t){var e=this.input.evaluate(t);return (ze(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},Vr.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise);},Vr.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},Vr.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],n={},i=0,a=Object.keys(this.cases).sort();i<a.length;i+=1){var o=a[i];void 0===(h=n[this.cases[o]])?(n[this.cases[o]]=r.length,r.push([this.cases[o],[o]])):r[h][1].push(o);}for(var s=function(e){return "number"===t.inputType.kind?Number(e):e},u=0,l=r;u<l.length;u+=1){var p=l[u],h=p[0],c=p[1];e.push(1===c.length?s(c[0]):c.map(s)),e.push(this.outputs[outputIndex$1].serialize());}return e.push(this.otherwise.serialize()),e};var Cr=function(t,e,r){this.type=t,this.branches=e,this.otherwise=r;};Cr.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 n=[],i=1;i<t.length-1;i+=2){var a=e.parse(t[i],i,ie);if(!a)return null;var o=e.parse(t[i+1],i+1,r);if(!o)return null;n.push([a,o]),r=r||o.type;}var s=e.parse(t[t.length-1],t.length-1,r);return s?new Cr(r,n,s):null},Cr.prototype.evaluate=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var n=r[e],i=n[1];if(n[0].evaluate(t))return i.evaluate(t)}return this.otherwise.evaluate(t)},Cr.prototype.eachChild=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var n=r[e],i=n[1];t(n[0]),t(i);}t(this.otherwise);},Cr.prototype.outputDefined=function(){return this.branches.every((function(t){return t[1].outputDefined()}))&&this.otherwise.outputDefined()},Cr.prototype.serialize=function(){var t=["case"];return this.eachChild((function(e){t.push(e.serialize());})),t};var Tr=function(t,e,r,n){this.type=t,this.input=e,this.beginIndex=r,this.endIndex=n;};function Er(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 Br(t,e,r,n){return 0===n.compare(e,r)}function Dr(t,e,r){var n="=="!==t&&"!="!==t;return function(){function i(t,e,r){this.type=ie,this.lhs=t,this.rhs=e,this.collator=r,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind;}return i.parse=function(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");var r=t[0],a=e.parse(t[1],1,se);if(!a)return null;if(!Er(r,a.type))return e.concat(1).error('"'+r+"\" comparisons are not supported for type '"+ce(a.type)+"'.");var o=e.parse(t[2],2,se);if(!o)return null;if(!Er(r,o.type))return e.concat(2).error('"'+r+"\" comparisons are not supported for type '"+ce(o.type)+"'.");if(a.type.kind!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return e.error("Cannot compare types '"+ce(a.type)+"' and '"+ce(o.type)+"'.");n&&("value"===a.type.kind&&"value"!==o.type.kind?a=new Ve(o.type,[a]):"value"!==a.type.kind&&"value"===o.type.kind&&(o=new Ve(a.type,[o])));var s=null;if(4===t.length){if("string"!==a.type.kind&&"string"!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return e.error("Cannot use collator to compare non-string types.");if(!(s=e.parse(t[3],3,ue)))return null}return new i(a,o,s)},i.prototype.evaluate=function(i){var a=this.lhs.evaluate(i),o=this.rhs.evaluate(i);if(n&&this.hasUntypedArgument){var s=ze(a),u=ze(o);if(s.kind!==u.kind||"string"!==s.kind&&"number"!==s.kind)throw new Me('Expected arguments for "'+t+'" to be (string, string) or (number, number), but found ('+s.kind+", "+u.kind+") instead.")}if(this.collator&&!n&&this.hasUntypedArgument){var l=ze(a),p=ze(o);if("string"!==l.kind||"string"!==p.kind)return e(i,a,o)}return this.collator?r(i,a,o,this.collator.evaluate(i)):e(i,a,o)},i.prototype.eachChild=function(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator);},i.prototype.outputDefined=function(){return !0},i.prototype.serialize=function(){var e=[t];return this.eachChild((function(t){e.push(t.serialize());})),e},i}()}Tr.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,se),n=e.parse(t[2],2,re);if(!r||!n)return null;if(!de(r.type,[he(se),ne,se]))return e.error("Expected first argument to be of type array or string, but found "+ce(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,re);return i?new Tr(r.type,r,n,i):null}return new Tr(r.type,r,n)},Tr.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(!me(e,["string","array"]))throw new Me("Expected first argument to be of type array or string, but found "+ce(ze(e))+" instead.");if(this.endIndex){var n=this.endIndex.evaluate(t);return e.slice(r,n)}return e.slice(r)},Tr.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex);},Tr.prototype.outputDefined=function(){return !1},Tr.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 Lr=Dr("==",(function(t,e,r){return e===r}),Br),Fr=Dr("!=",(function(t,e,r){return e!==r}),(function(t,e,r,n){return !Br(0,e,r,n)})),Rr=Dr("<",(function(t,e,r){return e<r}),(function(t,e,r,n){return n.compare(e,r)<0})),Or=Dr(">",(function(t,e,r){return e>r}),(function(t,e,r,n){return n.compare(e,r)>0})),jr=Dr("<=",(function(t,e,r){return e<=r}),(function(t,e,r,n){return n.compare(e,r)<=0})),Ur=Dr(">=",(function(t,e,r){return e>=r}),(function(t,e,r,n){return n.compare(e,r)>=0})),qr=function(t,e,r,n,i){this.type=ne,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i;};qr.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,re);if(!r)return null;var n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");var i=null;if(n.locale&&!(i=e.parse(n.locale,1,ne)))return null;var a=null;if(n.currency&&!(a=e.parse(n.currency,1,ne)))return null;var o=null;if(n["min-fraction-digits"]&&!(o=e.parse(n["min-fraction-digits"],1,re)))return null;var s=null;return n["max-fraction-digits"]&&!(s=e.parse(n["max-fraction-digits"],1,re))?null:new qr(r,i,a,o,s)},qr.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))},qr.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);},qr.prototype.outputDefined=function(){return !1},qr.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var Nr=function(t){this.type=re,this.input=t;};Nr.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?e.error("Expected argument of type string or array, but found "+ce(r.type)+" instead."):new Nr(r):null},Nr.prototype.evaluate=function(t){var e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new Me("Expected value to be of type string or array, but found "+ce(ze(e))+" instead.")},Nr.prototype.eachChild=function(t){t(this.input);},Nr.prototype.outputDefined=function(){return !1},Nr.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize());})),t};var Zr={"==":Lr,"!=":Fr,">":Or,"<":Rr,">=":Ur,"<=":jr,array:Ve,at:kr,boolean:Ve,case:Cr,coalesce:zr,collator:Re,format:Ce,image:Te,in:Mr,"index-of":Pr,interpolate:Ar,"interpolate-hcl":Ar,"interpolate-lab":Ar,length:Nr,let:Ir,literal:ke,match:Vr,number:Ve,"number-format":qr,object:Ve,slice:Tr,step:sr,string:Ve,"to-boolean":Be,"to-color":Be,"to-number":Be,"to-string":Be,var:ir,within:tr};function Gr(t,e){var r=e[0],n=e[1],i=e[2],a=e[3];r=r.evaluate(t),n=n.evaluate(t),i=i.evaluate(t);var o=a?a.evaluate(t):1,s=Ae(r,n,i,o);if(s)throw new Me(s);return new ge(r/255*o,n/255*o,i/255*o,o)}function Yr(t,e){return t in e}function Xr(t,e){var r=e[t];return void 0===r?null:r}function Kr(t){return {type:t}}function Jr(t){return {result:"success",value:t}}function Hr(t){return {result:"error",value:t}}function Qr(t){return "data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Wr(t){return !!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function $r(t){return !!t.expression&&t.expression.interpolated}function tn(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function en(t){return "object"==typeof t&&null!==t&&!Array.isArray(t)}function rn(t){return t}function nn(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function an(t,e,r,n,i){return nn(typeof r===i?n[r]:void 0,t.default,e.default)}function on(t,e,r){if("number"!==tn(r))return nn(t.default,e.default);var n=t.stops.length;if(1===n)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];var i=or(t.stops.map((function(t){return t[0]})),r);return t.stops[i][1]}function sn(t,e,r){var n=void 0!==t.base?t.base:1;if("number"!==tn(r))return nn(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 a=or(t.stops.map((function(t){return t[0]})),r),o=function(t,e,r,n){var i=n-r,a=t-r;return 0===i?0:1===e?a/i:(Math.pow(e,a)-1)/(Math.pow(e,i)-1)}(r,n,t.stops[a][0],t.stops[a+1][0]),s=t.stops[a][1],u=t.stops[a+1][1],l=lr[e.type]||rn;if(t.colorSpace&&"rgb"!==t.colorSpace){var p=_r[t.colorSpace];l=function(t,e){return p.reverse(p.interpolate(p.forward(t),p.forward(e),o))};}return "function"==typeof s.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=s.evaluate.apply(void 0,t),n=u.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==n)return l(r,n,o)}}:l(s,u,o)}function un(t,e,r){return "color"===e.type?r=ge.parse(r):"formatted"===e.type?r=we.fromString(r.toString()):"resolvedImage"===e.type?r=_e.fromString(r.toString()):tn(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),nn(r,t.default,e.default)}Fe.register(Zr,{error:[{kind:"error"},[ne],function(t,e){throw new Me(e[0].evaluate(t))}],typeof:[ne,[se],function(t,e){return ce(ze(e[0].evaluate(t)))}],"to-rgba":[he(re,4),[ae],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[ae,[re,re,re],Gr],rgba:[ae,[re,re,re,re],Gr],has:{type:ie,overloads:[[[ne],function(t,e){return Yr(e[0].evaluate(t),t.properties())}],[[ne,oe],function(t,e){var r=e[1];return Yr(e[0].evaluate(t),r.evaluate(t))}]]},get:{type:se,overloads:[[[ne],function(t,e){return Xr(e[0].evaluate(t),t.properties())}],[[ne,oe],function(t,e){var r=e[1];return Xr(e[0].evaluate(t),r.evaluate(t))}]]},"feature-state":[se,[ne],function(t,e){return Xr(e[0].evaluate(t),t.featureState||{})}],properties:[oe,[],function(t){return t.properties()}],"geometry-type":[ne,[],function(t){return t.geometryType()}],id:[se,[],function(t){return t.id()}],zoom:[re,[],function(t){return t.globals.zoom}],"heatmap-density":[re,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[re,[],function(t){return t.globals.lineProgress||0}],accumulated:[se,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[re,Kr(re),function(t,e){for(var r=0,n=0,i=e;n<i.length;n+=1)r+=i[n].evaluate(t);return r}],"*":[re,Kr(re),function(t,e){for(var r=1,n=0,i=e;n<i.length;n+=1)r*=i[n].evaluate(t);return r}],"-":{type:re,overloads:[[[re,re],function(t,e){var r=e[1];return e[0].evaluate(t)-r.evaluate(t)}],[[re],function(t,e){return -e[0].evaluate(t)}]]},"/":[re,[re,re],function(t,e){var r=e[1];return e[0].evaluate(t)/r.evaluate(t)}],"%":[re,[re,re],function(t,e){var r=e[1];return e[0].evaluate(t)%r.evaluate(t)}],ln2:[re,[],function(){return Math.LN2}],pi:[re,[],function(){return Math.PI}],e:[re,[],function(){return Math.E}],"^":[re,[re,re],function(t,e){var r=e[1];return Math.pow(e[0].evaluate(t),r.evaluate(t))}],sqrt:[re,[re],function(t,e){return Math.sqrt(e[0].evaluate(t))}],log10:[re,[re],function(t,e){return Math.log(e[0].evaluate(t))/Math.LN10}],ln:[re,[re],function(t,e){return Math.log(e[0].evaluate(t))}],log2:[re,[re],function(t,e){return Math.log(e[0].evaluate(t))/Math.LN2}],sin:[re,[re],function(t,e){return Math.sin(e[0].evaluate(t))}],cos:[re,[re],function(t,e){return Math.cos(e[0].evaluate(t))}],tan:[re,[re],function(t,e){return Math.tan(e[0].evaluate(t))}],asin:[re,[re],function(t,e){return Math.asin(e[0].evaluate(t))}],acos:[re,[re],function(t,e){return Math.acos(e[0].evaluate(t))}],atan:[re,[re],function(t,e){return Math.atan(e[0].evaluate(t))}],min:[re,Kr(re),function(t,e){return Math.min.apply(Math,e.map((function(e){return e.evaluate(t)})))}],max:[re,Kr(re),function(t,e){return Math.max.apply(Math,e.map((function(e){return e.evaluate(t)})))}],abs:[re,[re],function(t,e){return Math.abs(e[0].evaluate(t))}],round:[re,[re],function(t,e){var r=e[0].evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[re,[re],function(t,e){return Math.floor(e[0].evaluate(t))}],ceil:[re,[re],function(t,e){return Math.ceil(e[0].evaluate(t))}],"filter-==":[ie,[ne,se],function(t,e){var r=e[0],n=e[1];return t.properties()[r.value]===n.value}],"filter-id-==":[ie,[se],function(t,e){var r=e[0];return t.id()===r.value}],"filter-type-==":[ie,[ne],function(t,e){var r=e[0];return t.geometryType()===r.value}],"filter-<":[ie,[ne,se],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i<a}],"filter-id-<":[ie,[se],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<i}],"filter->":[ie,[ne,se],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i>a}],"filter-id->":[ie,[se],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>i}],"filter-<=":[ie,[ne,se],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i<=a}],"filter-id-<=":[ie,[se],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<=i}],"filter->=":[ie,[ne,se],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i>=a}],"filter-id->=":[ie,[se],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>=i}],"filter-has":[ie,[se],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[ie,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[ie,[he(ne)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[ie,[he(se)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[ie,[ne,he(se)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[ie,[ne,he(se)],function(t,e){var r=e[0],n=e[1];return function(t,e,r,n){for(;r<=n;){var i=r+n>>1;if(e[i]===t)return !0;e[i]>t?n=i-1:r=i+1;}return !1}(t.properties()[r.value],n.value,0,n.value.length-1)}],all:{type:ie,overloads:[[[ie,ie],function(t,e){var r=e[1];return e[0].evaluate(t)&&r.evaluate(t)}],[Kr(ie),function(t,e){for(var r=0,n=e;r<n.length;r+=1)if(!n[r].evaluate(t))return !1;return !0}]]},any:{type:ie,overloads:[[[ie,ie],function(t,e){var r=e[1];return e[0].evaluate(t)||r.evaluate(t)}],[Kr(ie),function(t,e){for(var r=0,n=e;r<n.length;r+=1)if(n[r].evaluate(t))return !0;return !1}]]},"!":[ie,[ie],function(t,e){return !e[0].evaluate(t)}],"is-supported-script":[ie,[ne],function(t,e){var r=t.globals&&t.globals.isSupportedScript;return !r||r(e[0].evaluate(t))}],upcase:[ne,[ne],function(t,e){return e[0].evaluate(t).toUpperCase()}],downcase:[ne,[ne],function(t,e){return e[0].evaluate(t).toLowerCase()}],concat:[ne,Kr(se),function(t,e){return e.map((function(e){return Ie(e.evaluate(t))})).join("")}],"resolved-locale":[ne,[ue],function(t,e){return e[0].evaluate(t).resolvedLocale()}]});var ln=function(t,e){this.expression=t,this._warningHistory={},this._evaluator=new Le,this._defaultValue=e?function(t){return "color"===t.type&&en(t.default)?new ge(0,0,0,0):"color"===t.type?ge.parse(t.default)||null:void 0===t.default?null:t.default}(e):null,this._enumValues=e&&"enum"===e.type?e.values:null;};function pn(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in Zr}function hn(t,e){var r=new ar(Zr,[],e?function(t){var e={color:ae,string:ne,number:re,enum:ne,boolean:ie,formatted:le,resolvedImage:pe};return "array"===t.type?he(e[t.value]||se,t.length):e[t.type]}(e):void 0),n=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?Jr(new ln(n,e)):Hr(r.errors)}ln.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,a){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)},ln.prototype.evaluate=function(t,e,r,n,i,a){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a||null;try{var o=this.expression.evaluate(this._evaluator);if(null==o||"number"==typeof o&&o!=o)return this._defaultValue;if(this._enumValues&&!(o in this._enumValues))throw new Me("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(o)+" instead.");return o}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var cn=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!rr(e.expression);};cn.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,a)},cn.prototype.evaluate=function(t,e,r,n,i,a){return this._styleExpression.evaluate(t,e,r,n,i,a)};var fn=function(t,e,r,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!rr(e.expression),this.interpolationType=n;};function yn(t,e){if("error"===(t=hn(t,e)).result)return t;var r=t.value.expression,n=er(r);if(!n&&!Qr(e))return Hr([new $t("","data expressions not supported")]);var i=nr(r,["zoom"]);if(!i&&!Wr(e))return Hr([new $t("","zoom expressions not supported")]);var a=function t(e){var r=null;if(e instanceof Ir)r=t(e.result);else if(e instanceof zr)for(var n=0,i=e.args;n<i.length&&!(r=t(i[n]));n+=1);else (e instanceof sr||e instanceof Ar)&&e.input instanceof Fe&&"zoom"===e.input.name&&(r=e);return r instanceof $t||e.eachChild((function(e){var n=t(e);n instanceof $t?r=n:!r&&n?r=new $t("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):r&&n&&r!==n&&(r=new $t("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'));})),r}(r);return a||i?a instanceof $t?Hr([a]):a instanceof Ar&&!$r(e)?Hr([new $t("",'"interpolate" expressions cannot be used with this property')]):Jr(a?new fn(n?"camera":"composite",t.value,a.labels,a instanceof Ar?a.interpolation:void 0):new cn(n?"constant":"source",t.value)):Hr([new $t("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}fn.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,a)},fn.prototype.evaluate=function(t,e,r,n,i,a){return this._styleExpression.evaluate(t,e,r,n,i,a)},fn.prototype.interpolationFactor=function(t,e,r){return this.interpolationType?Ar.interpolationFactor(this.interpolationType,t,e,r):0};var dn=function(t,e){this._parameters=t,this._specification=e,Ht(this,function t(e,r){var n,i,a,o="color"===r.type,s=e.stops&&"object"==typeof e.stops[0][0],u=s||!(s||void 0!==e.property),l=e.type||($r(r)?"exponential":"interval");if(o&&((e=Ht({},e)).stops&&(e.stops=e.stops.map((function(t){return [t[0],ge.parse(t[1])]}))),e.default=ge.parse(e.default?e.default:r.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!_r[e.colorSpace])throw new Error("Unknown color space: "+e.colorSpace);if("exponential"===l)n=sn;else if("interval"===l)n=on;else if("categorical"===l){n=an,i=Object.create(null);for(var p=0,h=e.stops;p<h.length;p+=1){var c=h[p];i[c[0]]=c[1];}a=typeof e.stops[0][0];}else {if("identity"!==l)throw new Error('Unknown function type "'+l+'"');n=un;}if(s){for(var f={},y=[],d=0;d<e.stops.length;d++){var m=e.stops[d],v=m[0].zoom;void 0===f[v]&&(f[v]={zoom:v,type:e.type,property:e.property,default:e.default,stops:[]},y.push(v)),f[v].stops.push([m[0].value,m[1]]);}for(var g=[],x=0,b=y;x<b.length;x+=1){var w=b[x];g.push([f[w].zoom,t(f[w],r)]);}var _={name:"linear"};return {kind:"composite",interpolationType:_,interpolationFactor:Ar.interpolationFactor.bind(void 0,_),zoomStops:g.map((function(t){return t[0]})),evaluate:function(t,n){var i=t.zoom;return sn({stops:g,base:e.base},r,i).evaluate(i,n)}}}if(u){var A="exponential"===l?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return {kind:"camera",interpolationType:A,interpolationFactor:Ar.interpolationFactor.bind(void 0,A),zoomStops:e.stops.map((function(t){return t[0]})),evaluate:function(t){return n(e,r,t.zoom,i,a)}}}return {kind:"source",evaluate:function(t,o){var s=o&&o.properties?o.properties[e.property]:void 0;return void 0===s?nn(e.default,r.default):n(e,r,s,i,a)}}}(this._parameters,this._specification));};function mn(t){var e=t.key,r=t.value,n=t.valueSpec||{},i=t.objectElementValidators||{},a=t.style,o=t.styleSpec,s=[],u=tn(r);if("object"!==u)return [new Kt(e,r,"object expected, "+u+" found")];for(var l in r){var p=l.split(".")[0],h=n[p]||n["*"],c=void 0;if(i[p])c=i[p];else if(n[p])c=Un;else if(i["*"])c=i["*"];else {if(!n["*"]){s.push(new Kt(e,r[l],'unknown property "'+l+'"'));continue}c=Un;}s=s.concat(c({key:(e?e+".":e)+l,value:r[l],valueSpec:h,style:a,styleSpec:o,object:r,objectKey:l},r));}for(var f in n)i[f]||n[f].required&&void 0===n[f].default&&void 0===r[f]&&s.push(new Kt(e,r,'missing required property "'+f+'"'));return s}function vn(t){var e=t.value,r=t.valueSpec,n=t.style,i=t.styleSpec,a=t.key,o=t.arrayElementValidator||Un;if("array"!==tn(e))return [new Kt(a,e,"array expected, "+tn(e)+" found")];if(r.length&&e.length!==r.length)return [new Kt(a,e,"array length "+r.length+" expected, length "+e.length+" found")];if(r["min-length"]&&e.length<r["min-length"])return [new Kt(a,e,"array length at least "+r["min-length"]+" expected, length "+e.length+" found")];var s={type:r.value,values:r.values};i.$version<7&&(s.function=r.function),"object"===tn(r.value)&&(s=r.value);for(var u=[],l=0;l<e.length;l++)u=u.concat(o({array:e,arrayIndex:l,value:e[l],valueSpec:s,style:n,styleSpec:i,key:a+"["+l+"]"}));return u}function gn(t){var e=t.key,r=t.value,n=t.valueSpec,i=tn(r);return "number"===i&&r!=r&&(i="NaN"),"number"!==i?[new Kt(e,r,"number expected, "+i+" found")]:"minimum"in n&&r<n.minimum?[new Kt(e,r,r+" is less than the minimum value "+n.minimum)]:"maximum"in n&&r>n.maximum?[new Kt(e,r,r+" is greater than the maximum value "+n.maximum)]:[]}function xn(t){var e,r,n,i=t.valueSpec,a=Qt(t.value.type),o={},s="categorical"!==a&&void 0===t.value.property,u=!s,l="array"===tn(t.value.stops)&&"array"===tn(t.value.stops[0])&&"object"===tn(t.value.stops[0][0]),p=mn({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===a)return [new Kt(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;return e=e.concat(vn({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:h})),"array"===tn(r)&&0===r.length&&e.push(new Kt(t.key,r,"array must have at least one stop")),e},default:function(t){return Un({key:t.key,value:t.value,valueSpec:i,style:t.style,styleSpec:t.styleSpec})}}});return "identity"===a&&s&&p.push(new Kt(t.key,t.value,'missing required property "property"')),"identity"===a||t.value.stops||p.push(new Kt(t.key,t.value,'missing required property "stops"')),"exponential"===a&&t.valueSpec.expression&&!$r(t.valueSpec)&&p.push(new Kt(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(u&&!Qr(t.valueSpec)?p.push(new Kt(t.key,t.value,"property functions not supported")):s&&!Wr(t.valueSpec)&&p.push(new Kt(t.key,t.value,"zoom functions not supported"))),"categorical"!==a&&!l||void 0!==t.value.property||p.push(new Kt(t.key,t.value,'"property" property is required')),p;function h(t){var e=[],a=t.value,s=t.key;if("array"!==tn(a))return [new Kt(s,a,"array expected, "+tn(a)+" found")];if(2!==a.length)return [new Kt(s,a,"array length 2 expected, length "+a.length+" found")];if(l){if("object"!==tn(a[0]))return [new Kt(s,a,"object expected, "+tn(a[0])+" found")];if(void 0===a[0].zoom)return [new Kt(s,a,"object stop key must have zoom")];if(void 0===a[0].value)return [new Kt(s,a,"object stop key must have value")];if(n&&n>Qt(a[0].zoom))return [new Kt(s,a[0].zoom,"stop zoom values must appear in ascending order")];Qt(a[0].zoom)!==n&&(n=Qt(a[0].zoom),r=void 0,o={}),e=e.concat(mn({key:s+"[0]",value:a[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:gn,value:c}}));}else e=e.concat(c({key:s+"[0]",value:a[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},a));return pn(Wt(a[1]))?e.concat([new Kt(s+"[1]",a[1],"expressions are not allowed in function stops.")]):e.concat(Un({key:s+"[1]",value:a[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function c(t,n){var s=tn(t.value),u=Qt(t.value),l=null!==t.value?t.value:n;if(e){if(s!==e)return [new Kt(t.key,l,s+" stop domain type must match previous stop domain type "+e)]}else e=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return [new Kt(t.key,l,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==a){var p="number expected, "+s+" found";return Qr(i)&&void 0===a&&(p+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Kt(t.key,l,p)]}return "categorical"!==a||"number"!==s||isFinite(u)&&Math.floor(u)===u?"categorical"!==a&&"number"===s&&void 0!==r&&u<r?[new Kt(t.key,l,"stop domain values must appear in ascending order")]:(r=u,"categorical"===a&&u in o?[new Kt(t.key,l,"stop domain values must be unique")]:(o[u]=!0,[])):[new Kt(t.key,l,"integer expected, found "+u)]}}function bn(t){var e=("property"===t.expressionContext?yn:hn)(Wt(t.value),t.valueSpec);if("error"===e.result)return e.value.map((function(e){return new Kt(""+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 Kt(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&&!rr(r))return [new Kt(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext&&!rr(r))return [new Kt(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!nr(r,["zoom","feature-state"]))return [new Kt(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!er(r))return [new Kt(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return []}function wn(t){var e=t.key,r=t.value,n=t.valueSpec,i=[];return Array.isArray(n.values)?-1===n.values.indexOf(Qt(r))&&i.push(new Kt(e,r,"expected one of ["+n.values.join(", ")+"], "+JSON.stringify(r)+" found")):-1===Object.keys(n.values).indexOf(Qt(r))&&i.push(new Kt(e,r,"expected one of ["+Object.keys(n.values).join(", ")+"], "+JSON.stringify(r)+" found")),i}function _n(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 n=r[e];if(!_n(n)&&"boolean"!=typeof n)return !1}return !0;default:return !0}}dn.deserialize=function(t){return new dn(t._parameters,t._specification)},dn.serialize=function(t){return {_parameters:t._parameters,_specification:t._specification}};var An={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Sn(t){if(null==t)return {filter:function(){return !0},needGeometry:!1};_n(t)||(t=In(t));var e=hn(t,An);if("error"===e.result)throw new Error(e.value.map((function(t){return t.key+": "+t.message})).join(", "));return {filter:function(t,r,n){return e.value.evaluate(t,r,{},n)},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 zn(t,e){return t<e?-1:t>e?1:0}function In(t){if(!t)return !0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?kn(t[1],t[2],"=="):"!="===r?Vn(kn(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?kn(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(In))):"all"===r?["all"].concat(t.slice(1).map(In)):"none"===r?["all"].concat(t.slice(1).map(In).map(Vn)):"in"===r?Mn(t[1],t.slice(2)):"!in"===r?Vn(Mn(t[1],t.slice(2))):"has"===r?Pn(t[1]):"!has"===r?Vn(Pn(t[1])):"within"!==r||t}function kn(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 Mn(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(zn)]]:["filter-in-small",t,["literal",e]]}}function Pn(t){switch(t){case"$type":return !0;case"$id":return ["filter-has-id"];default:return ["filter-has",t]}}function Vn(t){return ["!",t]}function Cn(t){return _n(Wt(t.value))?bn(Ht({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var r=e.value,n=e.key;if("array"!==tn(r))return [new Kt(n,r,"array expected, "+tn(r)+" found")];var i,a=e.styleSpec,o=[];if(r.length<1)return [new Kt(n,r,"filter array must have at least 1 element")];switch(o=o.concat(wn({key:n+"[0]",value:r[0],valueSpec:a.filter_operator,style:e.style,styleSpec:e.styleSpec})),Qt(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===Qt(r[1])&&o.push(new Kt(n,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&o.push(new Kt(n,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":r.length>=2&&"string"!==(i=tn(r[1]))&&o.push(new Kt(n+"[1]",r[1],"string expected, "+i+" found"));for(var s=2;s<r.length;s++)i=tn(r[s]),"$type"===Qt(r[1])?o=o.concat(wn({key:n+"["+s+"]",value:r[s],valueSpec:a.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"!==i&&"number"!==i&&"boolean"!==i&&o.push(new Kt(n+"["+s+"]",r[s],"string, number, or boolean expected, "+i+" found"));break;case"any":case"all":case"none":for(var u=1;u<r.length;u++)o=o.concat(t({key:n+"["+u+"]",value:r[u],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":i=tn(r[1]),2!==r.length?o.push(new Kt(n,r,'filter array for "'+r[0]+'" operator must have 2 elements')):"string"!==i&&o.push(new Kt(n+"[1]",r[1],"string expected, "+i+" found"));break;case"within":i=tn(r[1]),2!==r.length?o.push(new Kt(n,r,'filter array for "'+r[0]+'" operator must have 2 elements')):"object"!==i&&o.push(new Kt(n+"[1]",r[1],"object expected, "+i+" found"));}return o}(t)}function Tn(t,e){var r=t.key,n=t.style,i=t.styleSpec,a=t.value,o=t.objectKey,s=i[e+"_"+t.layerType];if(!s)return [];var u=o.match(/^(.*)-transition$/);if("paint"===e&&u&&s[u[1]]&&s[u[1]].transition)return Un({key:r,value:a,valueSpec:i.transition,style:n,styleSpec:i});var l,p=t.valueSpec||s[o];if(!p)return [new Kt(r,a,'unknown property "'+o+'"')];if("string"===tn(a)&&Qr(p)&&!p.tokens&&(l=/^{([^}]+)}$/.exec(a)))return [new Kt(r,a,'"'+o+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(l[1])+" }`.")];var h=[];return "symbol"===t.layerType&&("text-field"===o&&n&&!n.glyphs&&h.push(new Kt(r,a,'use of "text-field" requires a style "glyphs" property')),"text-font"===o&&en(Wt(a))&&"identity"===Qt(a.type)&&h.push(new Kt(r,a,'"text-font" does not support identity functions'))),h.concat(Un({key:t.key,value:a,valueSpec:p,style:n,styleSpec:i,expressionContext:"property",propertyType:e,propertyKey:o}))}function En(t){return Tn(t,"paint")}function Bn(t){return Tn(t,"layout")}function Dn(t){var e=[],r=t.value,n=t.key,i=t.style,a=t.styleSpec;r.type||r.ref||e.push(new Kt(n,r,'either "type" or "ref" is required'));var o,s=Qt(r.type),u=Qt(r.ref);if(r.id)for(var l=Qt(r.id),p=0;p<t.arrayIndex;p++){var h=i.layers[p];Qt(h.id)===l&&e.push(new Kt(n,r.id,'duplicate layer id "'+r.id+'", previously used at line '+h.id.__line__));}if("ref"in r)["type","source","source-layer","filter","layout"].forEach((function(t){t in r&&e.push(new Kt(n,r[t],'"'+t+'" is prohibited for ref layers'));})),i.layers.forEach((function(t){Qt(t.id)===u&&(o=t);})),o?o.ref?e.push(new Kt(n,r.ref,"ref cannot reference another ref layer")):s=Qt(o.type):e.push(new Kt(n,r.ref,'ref layer "'+u+'" not found'));else if("background"!==s)if(r.source){var c=i.sources&&i.sources[r.source],f=c&&Qt(c.type);c?"vector"===f&&"raster"===s?e.push(new Kt(n,r.source,'layer "'+r.id+'" requires a raster source')):"raster"===f&&"raster"!==s?e.push(new Kt(n,r.source,'layer "'+r.id+'" requires a vector source')):"vector"!==f||r["source-layer"]?"raster-dem"===f&&"hillshade"!==s?e.push(new Kt(n,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==s||!r.paint||!r.paint["line-gradient"]||"geojson"===f&&c.lineMetrics||e.push(new Kt(n,r,'layer "'+r.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):e.push(new Kt(n,r,'layer "'+r.id+'" must specify a "source-layer"')):e.push(new Kt(n,r.source,'source "'+r.source+'" not found'));}else e.push(new Kt(n,r,'missing required property "source"'));return e=e.concat(mn({key:n,value:r,valueSpec:a.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(){return []},type:function(){return Un({key:n+".type",value:r.type,valueSpec:a.layer.type,style:t.style,styleSpec:t.styleSpec,object:r,objectKey:"type"})},filter:Cn,layout:function(t){return mn({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return Bn(Ht({layerType:s},t))}}})},paint:function(t){return mn({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return En(Ht({layerType:s},t))}}})}}}))}function Ln(t){var e=t.value,r=t.key,n=tn(e);return "string"!==n?[new Kt(r,e,"string expected, "+n+" found")]:[]}var Fn={promoteId:function(t){var e=t.key,r=t.value;if("string"===tn(r))return Ln({key:e,value:r});var n=[];for(var i in r)n.push.apply(n,Ln({key:e+"."+i,value:r[i]}));return n}};function Rn(t){var e=t.value,r=t.key,n=t.styleSpec,i=t.style;if(!e.type)return [new Kt(r,e,'"type" is required')];var a,o=Qt(e.type);switch(o){case"vector":case"raster":case"raster-dem":return mn({key:r,value:e,valueSpec:n["source_"+o.replace("-","_")],style:t.style,styleSpec:n,objectElementValidators:Fn});case"geojson":if(a=mn({key:r,value:e,valueSpec:n.source_geojson,style:i,styleSpec:n,objectElementValidators:Fn}),e.cluster)for(var s in e.clusterProperties){var u=e.clusterProperties[s],l=u[0],p="string"==typeof l?[l,["accumulated"],["get",s]]:l;a.push.apply(a,bn({key:r+"."+s+".map",value:u[1],expressionContext:"cluster-map"})),a.push.apply(a,bn({key:r+"."+s+".reduce",value:p,expressionContext:"cluster-reduce"}));}return a;case"video":return mn({key:r,value:e,valueSpec:n.source_video,style:i,styleSpec:n});case"image":return mn({key:r,value:e,valueSpec:n.source_image,style:i,styleSpec:n});case"canvas":return [new Kt(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return wn({key:r+".type",value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:i,styleSpec:n})}}function On(t){var e=t.value,r=t.styleSpec,n=r.light,i=t.style,a=[],o=tn(e);if(void 0===e)return a;if("object"!==o)return a.concat([new Kt("light",e,"object expected, "+o+" found")]);for(var s in e){var u=s.match(/^(.*)-transition$/);a=a.concat(u&&n[u[1]]&&n[u[1]].transition?Un({key:s,value:e[s],valueSpec:r.transition,style:i,styleSpec:r}):n[s]?Un({key:s,value:e[s],valueSpec:n[s],style:i,styleSpec:r}):[new Kt(s,e[s],'unknown property "'+s+'"')]);}return a}var jn={"*":function(){return []},array:vn,boolean:function(t){var e=t.value,r=t.key,n=tn(e);return "boolean"!==n?[new Kt(r,e,"boolean expected, "+n+" found")]:[]},number:gn,color:function(t){var e=t.key,r=t.value,n=tn(r);return "string"!==n?[new Kt(e,r,"color expected, "+n+" found")]:null===ve(r)?[new Kt(e,r,'color expected, "'+r+'" found')]:[]},constants:Jt,enum:wn,filter:Cn,function:xn,layer:Dn,object:mn,source:Rn,light:On,string:Ln,formatted:function(t){return 0===Ln(t).length?[]:bn(t)},resolvedImage:function(t){return 0===Ln(t).length?[]:bn(t)}};function Un(t){var e=t.value,r=t.valueSpec,n=t.styleSpec;return r.expression&&en(Qt(e))?xn(t):r.expression&&pn(Wt(e))?bn(t):r.type&&jn[r.type]?jn[r.type](t):mn(Ht({},t,{valueSpec:r.type?n[r.type]:r}))}function qn(t){var e=t.value,r=t.key,n=Ln(t);return n.length||(-1===e.indexOf("{fontstack}")&&n.push(new Kt(r,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&n.push(new Kt(r,e,'"glyphs" url must include a "{range}" token'))),n}function Nn(t,e){void 0===e&&(e=Xt);var r=[];return r=r.concat(Un({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:qn,"*":function(){return []}}})),t.constants&&(r=r.concat(Jt({key:"constants",value:t.constants,style:t,styleSpec:e}))),Zn(r)}function Zn(t){return [].concat(t).sort((function(t,e){return t.line-e.line}))}function Gn(t){return function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return Zn(t.apply(this,e))}}Nn.source=Gn(Rn),Nn.light=Gn(On),Nn.layer=Gn(Dn),Nn.filter=Gn(Cn),Nn.paintProperty=Gn(En),Nn.layoutProperty=Gn(Bn);var Yn=Nn,Xn=Yn.light,Kn=Yn.paintProperty,Jn=Yn.layoutProperty;function Hn(t,e){var r=!1;if(e&&e.length)for(var n=0,i=e;n<i.length;n+=1)t.fire(new Gt(new Error(i[n].message))),r=!0;return r}var Qn=Wn;function Wn(t,e,r){var n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var i=new Int32Array(this.arrayBuffer);t=i[0],this.d=(e=i[1])+2*(r=i[2]);for(var a=0;a<this.d*this.d;a++){var o=i[3+a],s=i[3+a+1];n.push(o===s?null:i.subarray(o,s));}var u=i[3+n.length+1];this.keys=i.subarray(i[3+n.length],u),this.bboxes=i.subarray(u),this.insert=this._insertReadonly;}else {this.d=e+2*r;for(var l=0;l<this.d*this.d;l++)n.push([]);this.keys=[],this.bboxes=[];}this.n=e,this.extent=t,this.padding=r,this.scale=e/t,this.uid=0;var p=r/e*t;this.min=-p,this.max=t+p;}Wn.prototype.insert=function(t,e,r,n,i){this._forEachCell(e,r,n,i,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i);},Wn.prototype._insertReadonly=function(){throw "Cannot insert into a GridIndex created from an ArrayBuffer."},Wn.prototype._insertCell=function(t,e,r,n,i,a){this.cells[i].push(a);},Wn.prototype.query=function(t,e,r,n,i){var a=this.min,o=this.max;if(t<=a&&e<=a&&o<=r&&o<=n&&!i)return Array.prototype.slice.call(this.keys);var s=[];return this._forEachCell(t,e,r,n,this._queryCell,s,{},i),s},Wn.prototype._queryCell=function(t,e,r,n,i,a,o,s){var u=this.cells[i];if(null!==u)for(var l=this.keys,p=this.bboxes,h=0;h<u.length;h++){var c=u[h];if(void 0===o[c]){var f=4*c;(s?s(p[f+0],p[f+1],p[f+2],p[f+3]):t<=p[f+2]&&e<=p[f+3]&&r>=p[f+0]&&n>=p[f+1])?(o[c]=!0,a.push(l[c])):o[c]=!1;}}},Wn.prototype._forEachCell=function(t,e,r,n,i,a,o,s){for(var u=this._convertToCellCoord(t),l=this._convertToCellCoord(e),p=this._convertToCellCoord(r),h=this._convertToCellCoord(n),c=u;c<=p;c++)for(var f=l;f<=h;f++){var y=this.d*f+c;if((!s||s(this._convertFromCellCoord(c),this._convertFromCellCoord(f),this._convertFromCellCoord(c+1),this._convertFromCellCoord(f+1)))&&i.call(this,t,e,r,n,y,a,o,s))return}},Wn.prototype._convertFromCellCoord=function(t){return (t-this.padding)/this.scale},Wn.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},Wn.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=3+this.cells.length+1+1,r=0,n=0;n<this.cells.length;n++)r+=this.cells[n].length;var i=new Int32Array(e+r+this.keys.length+this.bboxes.length);i[0]=this.extent,i[1]=this.n,i[2]=this.padding;for(var a=e,o=0;o<t.length;o++){var s=t[o];i[3+o]=a,i.set(s,a),a+=s.length;}return i[3+t.length]=a,i.set(this.keys,a),i[3+t.length+1]=a+=this.keys.length,i.set(this.bboxes,a),a+=this.bboxes.length,i.buffer};var $n=self.ImageData,ti=self.ImageBitmap,ei={};function ri(t,e,r){void 0===r&&(r={}),Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),ei[t]={klass:e,omit:r.omit||[],shallow:r.shallow||[]};}for(var ni in ri("Object",Object),Qn.serialize=function(t,e){var r=t.toArrayBuffer();return e&&e.push(r),{buffer:r}},Qn.deserialize=function(t){return new Qn(t.buffer)},ri("Grid",Qn),ri("Color",ge),ri("Error",Error),ri("ResolvedImage",_e),ri("StylePropertyFunction",dn),ri("StyleExpression",ln,{omit:["_evaluator"]}),ri("ZoomDependentExpression",fn),ri("ZoomConstantExpression",cn),ri("CompoundExpression",Fe,{omit:["_evaluate"]}),Zr)Zr[ni]._classRegistryKey||ri("Expression_"+ni,Zr[ni]);function ii(t){return t&&"undefined"!=typeof ArrayBuffer&&(t instanceof ArrayBuffer||t.constructor&&"ArrayBuffer"===t.constructor.name)}function ai(t){return ti&&t instanceof ti}function oi(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(ii(t)||ai(t))return e&&e.push(t),t;if(ArrayBuffer.isView(t)){var r=t;return e&&e.push(r.buffer),r}if(t instanceof $n)return e&&e.push(t.data.buffer),t;if(Array.isArray(t)){for(var n=[],i=0,a=t;i<a.length;i+=1)n.push(oi(a[i],e));return n}if("object"==typeof t){var o=t.constructor,s=o._classRegistryKey;if(!s)throw new Error("can't serialize object of unregistered class");var u=o.serialize?o.serialize(t,e):{};if(!o.serialize){for(var l in t)if(t.hasOwnProperty(l)&&!(ei[s].omit.indexOf(l)>=0)){var p=t[l];u[l]=ei[s].shallow.indexOf(l)>=0?p:oi(p,e);}t instanceof Error&&(u.message=t.message);}if(u.$name)throw new Error("$name property is reserved for worker serialization logic.");return "Object"!==s&&(u.$name=s),u}throw new Error("can't serialize object of type "+typeof t)}function si(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||ii(t)||ai(t)||ArrayBuffer.isView(t)||t instanceof $n)return t;if(Array.isArray(t))return t.map(si);if("object"==typeof t){var e=t.$name||"Object",r=ei[e].klass;if(!r)throw new Error("can't deserialize unregistered class "+e);if(r.deserialize)return r.deserialize(t);for(var n=Object.create(r.prototype),i=0,a=Object.keys(t);i<a.length;i+=1){var o=a[i];if("$name"!==o){var s=t[o];n[o]=ei[e].shallow.indexOf(o)>=0?s:si(s);}}return n}throw new Error("can't deserialize object of type "+typeof t)}var ui=function(){this.first=!0;};ui.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 li=function(t){return t>=1536&&t<=1791},pi=function(t){return t>=1872&&t<=1919},hi=function(t){return t>=2208&&t<=2303},ci=function(t){return t>=11904&&t<=12031},fi=function(t){return t>=12032&&t<=12255},yi=function(t){return t>=12272&&t<=12287},di=function(t){return t>=12288&&t<=12351},mi=function(t){return t>=12352&&t<=12447},vi=function(t){return t>=12448&&t<=12543},gi=function(t){return t>=12544&&t<=12591},xi=function(t){return t>=12704&&t<=12735},bi=function(t){return t>=12736&&t<=12783},wi=function(t){return t>=12784&&t<=12799},_i=function(t){return t>=12800&&t<=13055},Ai=function(t){return t>=13056&&t<=13311},Si=function(t){return t>=13312&&t<=19903},zi=function(t){return t>=19968&&t<=40959},Ii=function(t){return t>=40960&&t<=42127},ki=function(t){return t>=42128&&t<=42191},Mi=function(t){return t>=44032&&t<=55215},Pi=function(t){return t>=63744&&t<=64255},Vi=function(t){return t>=64336&&t<=65023},Ci=function(t){return t>=65040&&t<=65055},Ti=function(t){return t>=65072&&t<=65103},Ei=function(t){return t>=65104&&t<=65135},Bi=function(t){return t>=65136&&t<=65279},Di=function(t){return t>=65280&&t<=65519};function Li(t){for(var e=0,r=t;e<r.length;e+=1)if(Fi(r[e].charCodeAt(0)))return !0;return !1}function Fi(t){return !(746!==t&&747!==t&&(t<4352||!(xi(t)||gi(t)||Ti(t)&&!(t>=65097&&t<=65103)||Pi(t)||Ai(t)||ci(t)||bi(t)||!(!di(t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||Si(t)||zi(t)||_i(t)||function(t){return t>=12592&&t<=12687}(t)||function(t){return t>=43360&&t<=43391}(t)||function(t){return t>=55216&&t<=55295}(t)||function(t){return t>=4352&&t<=4607}(t)||Mi(t)||mi(t)||yi(t)||function(t){return t>=12688&&t<=12703}(t)||fi(t)||wi(t)||vi(t)&&12540!==t||!(!Di(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)||!(!Ei(t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||function(t){return t>=5120&&t<=5759}(t)||function(t){return t>=6320&&t<=6399}(t)||Ci(t)||function(t){return t>=19904&&t<=19967}(t)||Ii(t)||ki(t))))}function Ri(t){return !(Fi(t)||function(t){return !!(function(t){return t>=128&&t<=255}(t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||function(t){return t>=8192&&t<=8303}(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)||function(t){return t>=8448&&t<=8527}(t)||function(t){return t>=8528&&t<=8591}(t)||function(t){return t>=8960&&t<=9215}(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)||function(t){return t>=9216&&t<=9279}(t)&&9251!==t||function(t){return t>=9280&&t<=9311}(t)||function(t){return t>=9312&&t<=9471}(t)||function(t){return t>=9632&&t<=9727}(t)||function(t){return t>=9728&&t<=9983}(t)&&!(t>=9754&&t<=9759)||function(t){return t>=11008&&t<=11263}(t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||di(t)||vi(t)||function(t){return t>=57344&&t<=63743}(t)||Ti(t)||Ei(t)||Di(t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}function Oi(t){return t>=1424&&t<=2303||Vi(t)||Bi(t)}function ji(t,e){return !(!e&&Oi(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||function(t){return t>=6016&&t<=6143}(t))}function Ui(t){for(var e=0,r=t;e<r.length;e+=1)if(Oi(r[e].charCodeAt(0)))return !0;return !1}var qi=null,Ni="unavailable",Zi=null,Gi=function(t){t&&"string"==typeof t&&t.indexOf("NetworkError")>-1&&(Ni="error"),qi&&qi(t);};function Yi(){Xi.fire(new Zt("pluginStateChange",{pluginStatus:Ni,pluginURL:Zi}));}var Xi=new Yt,Ki=function(){return Ni},Ji=function(){if("deferred"!==Ni||!Zi)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Ni="loading",Yi(),Zi&&Ot({url:Zi},(function(t){t?Gi(t):(Ni="loaded",Yi());}));},Hi={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return "loaded"===Ni||null!=Hi.applyArabicShaping},isLoading:function(){return "loading"===Ni},setState:function(t){Ni=t.pluginStatus,Zi=t.pluginURL;},isParsed:function(){return null!=Hi.applyArabicShaping&&null!=Hi.processBidirectionalText&&null!=Hi.processStyledBidirectionalText},getPluginURL:function(){return Zi}},Qi=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 ui,this.transition={});};Qi.prototype.isSupportedScript=function(t){return function(t,e){for(var r=0,n=t;r<n.length;r+=1)if(!ji(n[r].charCodeAt(0),e))return !1;return !0}(t,Hi.isLoaded())},Qi.prototype.crossFadingFactor=function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},Qi.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 Wi=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(en(t))return new dn(t,e);if(pn(t)){var r=yn(t,e);if("error"===r.result)throw new Error(r.value.map((function(t){return t.key+": "+t.message})).join(", "));return r.value}var n=t;return "string"==typeof t&&"color"===e.type&&(n=ge.parse(t)),{kind:"constant",evaluate:function(){return n}}}(void 0===e?t.specification.default:e,t.specification);};Wi.prototype.isDataDriven=function(){return "source"===this.expression.kind||"composite"===this.expression.kind},Wi.prototype.possiblyEvaluate=function(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)};var $i=function(t){this.property=t,this.value=new Wi(t,void 0);};$i.prototype.transitioned=function(t,e){return new ea(this.property,this.value,e,c({},t.transition,this.transition),t.now)},$i.prototype.untransitioned=function(){return new ea(this.property,this.value,null,{},0)};var ta=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues);};ta.prototype.getValue=function(t){return w(this._values[t].value.value)},ta.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new $i(this._values[t].property)),this._values[t].value=new Wi(this._values[t].property,null===e?void 0:w(e));},ta.prototype.getTransition=function(t){return w(this._values[t].transition)},ta.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new $i(this._values[t].property)),this._values[t].transition=w(e)||void 0;},ta.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);e<r.length;e+=1){var n=r[e],i=this.getValue(n);void 0!==i&&(t[n]=i);var a=this.getTransition(n);void 0!==a&&(t[n+"-transition"]=a);}return t},ta.prototype.transitioned=function(t,e){for(var r=new ra(this._properties),n=0,i=Object.keys(this._values);n<i.length;n+=1){var a=i[n];r._values[a]=this._values[a].transitioned(t,e._values[a]);}return r},ta.prototype.untransitioned=function(){for(var t=new ra(this._properties),e=0,r=Object.keys(this._values);e<r.length;e+=1){var n=r[e];t._values[n]=this._values[n].untransitioned();}return t};var ea=function(t,e,r,n,i){this.property=t,this.value=e,this.begin=i+n.delay||0,this.end=this.begin+n.duration||0,t.specification.transition&&(n.delay||n.duration)&&(this.prior=r);};ea.prototype.possiblyEvaluate=function(t,e,r){var n=t.now||0,i=this.value.possiblyEvaluate(t,e,r),a=this.prior;if(a){if(n>this.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(n<this.begin)return a.possiblyEvaluate(t,e,r);var o=(n-this.begin)/(this.end-this.begin);return this.property.interpolate(a.possiblyEvaluate(t,e,r),i,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)}(o))}return i};var ra=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues);};ra.prototype.possiblyEvaluate=function(t,e,r){for(var n=new aa(this._properties),i=0,a=Object.keys(this._values);i<a.length;i+=1){var o=a[i];n._values[o]=this._values[o].possiblyEvaluate(t,e,r);}return n},ra.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 na=function(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues);};na.prototype.getValue=function(t){return w(this._values[t].value)},na.prototype.setValue=function(t,e){this._values[t]=new Wi(this._values[t].property,null===e?void 0:w(e));},na.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);e<r.length;e+=1){var n=r[e],i=this.getValue(n);void 0!==i&&(t[n]=i);}return t},na.prototype.possiblyEvaluate=function(t,e,r){for(var n=new aa(this._properties),i=0,a=Object.keys(this._values);i<a.length;i+=1){var o=a[i];n._values[o]=this._values[o].possiblyEvaluate(t,e,r);}return n};var ia=function(t,e,r){this.property=t,this.value=e,this.parameters=r;};ia.prototype.isConstant=function(){return "constant"===this.value.kind},ia.prototype.constantOr=function(t){return "constant"===this.value.kind?this.value.value:t},ia.prototype.evaluate=function(t,e,r,n){return this.property.evaluate(this.value,this.parameters,t,e,r,n)};var aa=function(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues);};aa.prototype.get=function(t){return this._values[t]};var oa=function(t){this.specification=t;};oa.prototype.possiblyEvaluate=function(t,e){return t.expression.evaluate(e)},oa.prototype.interpolate=function(t,e,r){var n=lr[this.specification.type];return n?n(t,e,r):t};var sa=function(t,e){this.specification=t,this.overrides=e;};sa.prototype.possiblyEvaluate=function(t,e,r,n){return new ia(this,"constant"===t.expression.kind||"camera"===t.expression.kind?{kind:"constant",value:t.expression.evaluate(e,null,{},r,n)}:t.expression,e)},sa.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 ia(this,{kind:"constant",value:void 0},t.parameters);var n=lr[this.specification.type];return n?new ia(this,{kind:"constant",value:n(t.value.value,e.value.value,r)},t.parameters):t},sa.prototype.evaluate=function(t,e,r,n,i,a){return "constant"===t.kind?t.value:t.evaluate(e,r,n,i,a)};var ua=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,n){if(void 0===t.value)return new ia(this,{kind:"constant",value:void 0},e);if("constant"===t.expression.kind){var i=t.expression.evaluate(e,null,{},r,n),a="resolvedImage"===t.property.specification.type&&"string"!=typeof i?i.name:i,o=this._calculate(a,a,a,e);return new ia(this,{kind:"constant",value:o},e)}if("camera"===t.expression.kind){var s=this._calculate(t.expression.evaluate({zoom:e.zoom-1}),t.expression.evaluate({zoom:e.zoom}),t.expression.evaluate({zoom:e.zoom+1}),e);return new ia(this,{kind:"constant",value:s},e)}return new ia(this,t.expression,e)},e.prototype.evaluate=function(t,e,r,n,i,a){if("source"===t.kind){var o=t.evaluate(e,r,n,i,a);return this._calculate(o,o,o,e)}return "composite"===t.kind?this._calculate(t.evaluate({zoom:Math.floor(e.zoom)-1},r,n),t.evaluate({zoom:Math.floor(e.zoom)},r,n),t.evaluate({zoom:Math.floor(e.zoom)+1},r,n),e):t.value},e.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},e.prototype.interpolate=function(t){return t},e}(sa),la=function(t){this.specification=t;};la.prototype.possiblyEvaluate=function(t,e,r,n){if(void 0!==t.value){if("constant"===t.expression.kind){var i=t.expression.evaluate(e,null,{},r,n);return this._calculate(i,i,i,e)}return this._calculate(t.expression.evaluate(new Qi(Math.floor(e.zoom-1),e)),t.expression.evaluate(new Qi(Math.floor(e.zoom),e)),t.expression.evaluate(new Qi(Math.floor(e.zoom+1),e)),e)}},la.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},la.prototype.interpolate=function(t){return t};var pa=function(t){this.specification=t;};pa.prototype.possiblyEvaluate=function(t,e,r,n){return !!t.expression.evaluate(e,null,{},r,n)},pa.prototype.interpolate=function(){return !1};var ha=function(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],t){var r=t[e];r.specification.overridable&&this.overridableProperties.push(e);var n=this.defaultPropertyValues[e]=new Wi(r,void 0),i=this.defaultTransitionablePropertyValues[e]=new $i(r);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({});}};ri("DataDrivenProperty",sa),ri("DataConstantProperty",oa),ri("CrossFadedDataDrivenProperty",ua),ri("CrossFadedProperty",la),ri("ColorRampProperty",pa);var ca=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=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):e.source&&(this.source=e.source),r.layout&&(this._unevaluatedLayout=new na(r.layout)),r.paint)){for(var n in this._transitionablePaint=new ta(r.paint),e.paint)this.setPaintProperty(n,e.paint[n],{validate:!1});for(var i in e.layout)this.setLayoutProperty(i,e.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new aa(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(Jn,"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,-"-transition".length)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e&&this._validate(Kn,"layers."+this.id+".paint."+t,t,e,r))return !1;if(g(t,"-transition"))return this._transitionablePaint.setTransition(t.slice(0,-"-transition".length),e||void 0),!1;var n=this._transitionablePaint._values[t],i="cross-faded-data-driven"===n.property.specification["property-type"],a=n.value.isDataDriven(),o=n.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var s=this._transitionablePaint._values[t].value;return s.isDataDriven()||a||i||this._handleOverridablePaintPropertyUpdate(t,o,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),b(t,(function(t,e){return !(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)}))},e.prototype._validate=function(t,e,r,n,i){return void 0===i&&(i={}),(!i||!1!==i.validate)&&Hn(this,t.call(Yn,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:Xt,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 ia&&Qr(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return !0}return !1},e}(Yt),fa={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},ya=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;},da=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0);};function ma(t,e){void 0===e&&(e=1);var r=0,n=0;return {members:t.map((function(t){var i=fa[t.type].BYTES_PER_ELEMENT,a=r=va(r,Math.max(e,i)),o=t.components||1;return n=Math.max(n,i),r+=i*o,{name:t.name,type:t.type,components:o,offset:a}})),size:va(r,Math.max(n,e)),alignment:e}}function va(t,e){return Math.ceil(t/e)*e}da.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},da.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},da.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews());},da.prototype.clear=function(){this.length=0;},da.prototype.resize=function(t){this.reserve(t),this.length=t;},da.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);}},da.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var ga=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.float32=new Float32Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)},e.prototype.emplace=function(t,e,r,n,i,a,o){var s=10*t,u=5*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.float32[u+1]=n,this.float32[u+2]=i,this.float32[u+3]=a,this.float32[u+4]=o,t},e}(da);ga.prototype.bytesPerElement=20,ri("StructArrayLayout2i4f20",ga);var xa=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 n=2*t;return this.int16[n+0]=e,this.int16[n+1]=r,t},e}(da);xa.prototype.bytesPerElement=4,ri("StructArrayLayout2i4",xa);var ba=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,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var a=4*t;return this.int16[a+0]=e,this.int16[a+1]=r,this.int16[a+2]=n,this.int16[a+3]=i,t},e}(da);ba.prototype.bytesPerElement=8,ri("StructArrayLayout4i8",ba);var wa=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,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)},e.prototype.emplace=function(t,e,r,n,i,a,o){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,t},e}(da);wa.prototype.bytesPerElement=12,ri("StructArrayLayout2i4i12",wa);var _a=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,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)},e.prototype.emplace=function(t,e,r,n,i,a,o){var s=4*t,u=8*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.uint8[u+4]=n,this.uint8[u+5]=i,this.uint8[u+6]=a,this.uint8[u+7]=o,t},e}(da);_a.prototype.bytesPerElement=8,ri("StructArrayLayout2i4ub8",_a);var Aa=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,u,l){var p=this.length;return this.resize(p+1),this.emplace(p,t,e,r,n,i,a,o,s,u,l)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,u,l,p){var h=9*t,c=18*t;return this.uint16[h+0]=e,this.uint16[h+1]=r,this.uint16[h+2]=n,this.uint16[h+3]=i,this.uint16[h+4]=a,this.uint16[h+5]=o,this.uint16[h+6]=s,this.uint16[h+7]=u,this.uint8[c+16]=l,this.uint8[c+17]=p,t},e}(da);Aa.prototype.bytesPerElement=18,ri("StructArrayLayout8ui2ub18",Aa);var Sa=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,n,i,a,o,s){var u=this.length;return this.resize(u+1),this.emplace(u,t,e,r,n,i,a,o,s)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,u){var l=8*t;return this.uint16[l+0]=e,this.uint16[l+1]=r,this.uint16[l+2]=n,this.uint16[l+3]=i,this.uint16[l+4]=a,this.uint16[l+5]=o,this.uint16[l+6]=s,this.uint16[l+7]=u,t},e}(da);Sa.prototype.bytesPerElement=16,ri("StructArrayLayout8ui16",Sa);var za=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,n,i,a,o,s,u,l,p,h){var c=this.length;return this.resize(c+1),this.emplace(c,t,e,r,n,i,a,o,s,u,l,p,h)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,u,l,p,h,c){var f=12*t;return this.int16[f+0]=e,this.int16[f+1]=r,this.int16[f+2]=n,this.int16[f+3]=i,this.uint16[f+4]=a,this.uint16[f+5]=o,this.uint16[f+6]=s,this.uint16[f+7]=u,this.int16[f+8]=l,this.int16[f+9]=p,this.int16[f+10]=h,this.int16[f+11]=c,t},e}(da);za.prototype.bytesPerElement=24,ri("StructArrayLayout4i4ui4i24",za);var Ia=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.float32[i+0]=e,this.float32[i+1]=r,this.float32[i+2]=n,t},e}(da);Ia.prototype.bytesPerElement=12,ri("StructArrayLayout3f12",Ia);var ka=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}(da);ka.prototype.bytesPerElement=4,ri("StructArrayLayout1ul4",ka);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.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,u){var l=this.length;return this.resize(l+1),this.emplace(l,t,e,r,n,i,a,o,s,u)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,u,l){var p=10*t,h=5*t;return this.int16[p+0]=e,this.int16[p+1]=r,this.int16[p+2]=n,this.int16[p+3]=i,this.int16[p+4]=a,this.int16[p+5]=o,this.uint32[h+3]=s,this.uint16[p+8]=u,this.uint16[p+9]=l,t},e}(da);Ma.prototype.bytesPerElement=20,ri("StructArrayLayout6i1ul2ui20",Ma);var Pa=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)},e.prototype.emplace=function(t,e,r,n,i,a,o){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,t},e}(da);Pa.prototype.bytesPerElement=12,ri("StructArrayLayout2i2i2i12",Pa);var Va=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,n,i){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i)},e.prototype.emplace=function(t,e,r,n,i,a){var o=4*t,s=8*t;return this.float32[o+0]=e,this.float32[o+1]=r,this.float32[o+2]=n,this.int16[s+6]=i,this.int16[s+7]=a,t},e}(da);Va.prototype.bytesPerElement=16,ri("StructArrayLayout2f1f2i16",Va);var Ca=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var a=12*t,o=3*t;return this.uint8[a+0]=e,this.uint8[a+1]=r,this.float32[o+1]=n,this.float32[o+2]=i,t},e}(da);Ca.prototype.bytesPerElement=12,ri("StructArrayLayout2ub2f12",Ca);var Ta=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.uint16[i+0]=e,this.uint16[i+1]=r,this.uint16[i+2]=n,t},e}(da);Ta.prototype.bytesPerElement=6,ri("StructArrayLayout3ui6",Ta);var Ea=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,u,l,p,h,c,f,y,d,m){var v=this.length;return this.resize(v+1),this.emplace(v,t,e,r,n,i,a,o,s,u,l,p,h,c,f,y,d,m)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,u,l,p,h,c,f,y,d,m,v){var g=24*t,x=12*t,b=48*t;return this.int16[g+0]=e,this.int16[g+1]=r,this.uint16[g+2]=n,this.uint16[g+3]=i,this.uint32[x+2]=a,this.uint32[x+3]=o,this.uint32[x+4]=s,this.uint16[g+10]=u,this.uint16[g+11]=l,this.uint16[g+12]=p,this.float32[x+7]=h,this.float32[x+8]=c,this.uint8[b+36]=f,this.uint8[b+37]=y,this.uint8[b+38]=d,this.uint32[x+10]=m,this.int16[g+22]=v,t},e}(da);Ea.prototype.bytesPerElement=48,ri("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Ea);var Ba=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,n,i,a,o,s,u,l,p,h,c,f,y,d,m,v,g,x,b,w,_,A,S,z,I,k){var M=this.length;return this.resize(M+1),this.emplace(M,t,e,r,n,i,a,o,s,u,l,p,h,c,f,y,d,m,v,g,x,b,w,_,A,S,z,I,k)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,u,l,p,h,c,f,y,d,m,v,g,x,b,w,_,A,S,z,I,k,M){var P=34*t,V=17*t;return this.int16[P+0]=e,this.int16[P+1]=r,this.int16[P+2]=n,this.int16[P+3]=i,this.int16[P+4]=a,this.int16[P+5]=o,this.int16[P+6]=s,this.int16[P+7]=u,this.uint16[P+8]=l,this.uint16[P+9]=p,this.uint16[P+10]=h,this.uint16[P+11]=c,this.uint16[P+12]=f,this.uint16[P+13]=y,this.uint16[P+14]=d,this.uint16[P+15]=m,this.uint16[P+16]=v,this.uint16[P+17]=g,this.uint16[P+18]=x,this.uint16[P+19]=b,this.uint16[P+20]=w,this.uint16[P+21]=_,this.uint16[P+22]=A,this.uint32[V+12]=S,this.float32[V+13]=z,this.float32[V+14]=I,this.float32[V+15]=k,this.float32[V+16]=M,t},e}(da);Ba.prototype.bytesPerElement=68,ri("StructArrayLayout8i15ui1ul4f68",Ba);var Da=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._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}(da);Da.prototype.bytesPerElement=4,ri("StructArrayLayout1f4",Da);var La=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.int16[i+0]=e,this.int16[i+1]=r,this.int16[i+2]=n,t},e}(da);La.prototype.bytesPerElement=6,ri("StructArrayLayout3i6",La);var Fa=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 n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=4*t;return this.uint32[2*t+0]=e,this.uint16[i+2]=r,this.uint16[i+3]=n,t},e}(da);Fa.prototype.bytesPerElement=8,ri("StructArrayLayout1ul2ui8",Fa);var Ra=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.uint16[n+0]=e,this.uint16[n+1]=r,t},e}(da);Ra.prototype.bytesPerElement=4,ri("StructArrayLayout2ui4",Ra);var Oa=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._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}(da);Oa.prototype.bytesPerElement=2,ri("StructArrayLayout1ui2",Oa);var ja=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 n=2*t;return this.float32[n+0]=e,this.float32[n+1]=r,t},e}(da);ja.prototype.bytesPerElement=8,ri("StructArrayLayout2f8",ja);var Ua=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,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var a=4*t;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=n,this.float32[a+3]=i,t},e}(da);Ua.prototype.bytesPerElement=16,ri("StructArrayLayout4f16",Ua);var qa=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 i(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,r),e}(ya);qa.prototype.size=20;var Na=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new qa(this,t)},e}(Ma);ri("CollisionBoxArray",Na);var Za=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}(ya);Za.prototype.size=48;var Ga=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 Za(this,t)},e}(Ea);ri("PlacedSymbolArray",Ga);var Ya=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}(ya);Ya.prototype.size=68;var Xa=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 Ya(this,t)},e}(Ba);ri("SymbolInstanceArray",Xa);var Ka=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}(Da);ri("GlyphOffsetArray",Ka);var Ja=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}(La);ri("SymbolLineVertexArray",Ja);var Ha=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}(ya);Ha.prototype.size=8;var Qa=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 Ha(this,t)},e}(Fa);ri("FeatureIndexArray",Qa);var Wa=ma([{name:"a_pos",components:2,type:"Int16"}],4).members,$a=function(t){void 0===t&&(t=[]),this.segments=t;};function to(t,e){return 256*(t=u(Math.floor(t),0,255))+u(Math.floor(e),0,255)}$a.prototype.prepareSegment=function(t,e,r,n){var i=this.segments[this.segments.length-1];return t>$a.MAX_VERTEX_ARRAY_LENGTH&&S("Max vertices per segment is "+$a.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!i||i.vertexLength+t>$a.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==n)&&(i={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==n&&(i.sortKey=n),this.segments.push(i)),i},$a.prototype.get=function(){return this.segments},$a.prototype.destroy=function(){for(var t=0,e=this.segments;t<e.length;t+=1){var r=e[t];for(var n in r.vaos)r.vaos[n].destroy();}},$a.simpleSegment=function(t,e,r,n){return new $a([{vertexOffset:t,primitiveOffset:e,vertexLength:r,primitiveLength:n,vaos:{},sortKey:0}])},$a.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,ri("SegmentVector",$a);var eo=ma([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint8"},{name:"a_pixel_ratio_to",components:1,type:"Uint8"}]),ro=ma([{name:"a_dash_to",components:4,type:"Uint16"},{name:"a_dash_from",components:4,type:"Uint16"}]),no=e((function(t){t.exports=function(t,e){var r,n,i,a,o,s,u,l;for(n=t.length-(r=3&t.length),i=e,o=3432918353,s=461845907,l=0;l<n;)u=255&t.charCodeAt(l)|(255&t.charCodeAt(++l))<<8|(255&t.charCodeAt(++l))<<16|(255&t.charCodeAt(++l))<<24,++l,i=27492+(65535&(a=5*(65535&(i=(i^=u=(65535&(u=(u=(65535&u)*o+(((u>>>16)*o&65535)<<16)&4294967295)<<15|u>>>17))*s+(((u>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(a>>>16)&65535)<<16);switch(u=0,r){case 3:u^=(255&t.charCodeAt(l+2))<<16;case 2:u^=(255&t.charCodeAt(l+1))<<8;case 1:i^=u=(65535&(u=(u=(65535&(u^=255&t.charCodeAt(l)))*o+(((u>>>16)*o&65535)<<16)&4294967295)<<15|u>>>17))*s+(((u>>>16)*s&65535)<<16)&4294967295;}return i^=t.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0};})),io=e((function(t){t.exports=function(t,e){for(var r,n=t.length,i=e^n,a=0;n>=4;)r=1540483477*(65535&(r=255&t.charCodeAt(a)|(255&t.charCodeAt(++a))<<8|(255&t.charCodeAt(++a))<<16|(255&t.charCodeAt(++a))<<24))+((1540483477*(r>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++a;switch(n){case 3:i^=(255&t.charCodeAt(a+2))<<16;case 2:i^=(255&t.charCodeAt(a+1))<<8;case 1:i=1540483477*(65535&(i^=255&t.charCodeAt(a)))+((1540483477*(i>>>16)&65535)<<16);}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0};})),ao=no,oo=io;ao.murmur3=no,ao.murmur2=oo;var so=function(){this.ids=[],this.positions=[],this.indexed=!1;};so.prototype.add=function(t,e,r,n){this.ids.push(lo(t)),this.positions.push(e,r,n);},so.prototype.getPositions=function(t){for(var e=lo(t),r=0,n=this.ids.length-1;r<n;){var i=r+n>>1;this.ids[i]>=e?n=i:r=i+1;}for(var a=[];this.ids[r]===e;)a.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return a},so.serialize=function(t,e){var r=new Float64Array(t.ids),n=new Uint32Array(t.positions);return function t(e,r,n,i){for(;n<i;){for(var a=e[n+i>>1],o=n-1,s=i+1;;){do{o++;}while(e[o]<a);do{s--;}while(e[s]>a);if(o>=s)break;po(e,o,s),po(r,3*o,3*s),po(r,3*o+1,3*s+1),po(r,3*o+2,3*s+2);}s-n<i-s?(t(e,r,n,s),n=s+1):(t(e,r,s+1,i),i=s);}}(r,n,0,r.length-1),e&&e.push(r.buffer,n.buffer),{ids:r,positions:n}},so.deserialize=function(t){var e=new so;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e};var uo=Math.pow(2,53)-1;function lo(t){var e=+t;return !isNaN(e)&&e<=uo?e:ao(String(t))}function po(t,e,r){var n=t[e];t[e]=t[r],t[r]=n;}ri("FeaturePositionMap",so);var ho=function(t,e){this.gl=t.gl,this.location=e;},co=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}(ho),fo=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}(ho),yo=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}(ho),mo=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}(ho),vo=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}(ho),go=function(t){function e(e,r){t.call(this,e,r),this.current=ge.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}(ho),xo=new Float32Array(16),bo=function(t){function e(e,r){t.call(this,e,r),this.current=xo;}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}(ho);function wo(t){return [to(255*t.r,255*t.g),to(255*t.b,255*t.a)]}var _o=function(t,e,r){this.value=t,this.uniformNames=e.map((function(t){return "u_"+t})),this.type=r;};_o.prototype.setUniform=function(t,e,r){t.set(r.constantOr(this.value));},_o.prototype.getBinding=function(t,e,r){return "color"===this.type?new go(t,e):new fo(t,e)};var Ao=function(t,e){this.uniformNames=e.map((function(t){return "u_"+t})),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1;};Ao.prototype.setConstantPatternPositions=function(t,e){this.pixelRatioFrom=e.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=e.tl.concat(e.br),this.patternTo=t.tl.concat(t.br);},Ao.prototype.setUniform=function(t,e,r,n){var i="u_pattern_to"===n||"u_dash_to"===n?this.patternTo:"u_pattern_from"===n||"u_dash_from"===n?this.patternFrom:"u_pixel_ratio_to"===n?this.pixelRatioTo:"u_pixel_ratio_from"===n?this.pixelRatioFrom:null;i&&t.set(i);},Ao.prototype.getBinding=function(t,e,r){return "u_pattern_from"===r||"u_pattern_to"===r||"u_dash_from"===r||"u_dash_to"===r?new vo(t,e):new fo(t,e)};var So=function(t,e,r,n){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 n;};So.prototype.populatePaintArray=function(t,e,r,n,i){var a=this.paintVertexArray.length,o=this.expression.evaluate(new Qi(0),e,{},n,[],i);this.paintVertexArray.resize(t),this._setPaintValue(a,t,o);},So.prototype.updatePaintArray=function(t,e,r,n){var i=this.expression.evaluate({zoom:0},r,n);this._setPaintValue(t,e,i);},So.prototype._setPaintValue=function(t,e,r){if("color"===this.type)for(var n=wo(r),i=t;i<e;i++)this.paintVertexArray.emplace(i,n[0],n[1]);else {for(var a=t;a<e;a++)this.paintVertexArray.emplace(a,r);this.maxValue=Math.max(this.maxValue,Math.abs(r));}},So.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));},So.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy();};var zo=function(t,e,r,n,i,a){this.expression=t,this.uniformNames=e.map((function(t){return "u_"+t+"_t"})),this.type=r,this.useIntegerZoom=n,this.zoom=i,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 a;};zo.prototype.populatePaintArray=function(t,e,r,n,i){var a=this.expression.evaluate(new Qi(this.zoom),e,{},n,[],i),o=this.expression.evaluate(new Qi(this.zoom+1),e,{},n,[],i),s=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(s,t,a,o);},zo.prototype.updatePaintArray=function(t,e,r,n){var i=this.expression.evaluate({zoom:this.zoom},r,n),a=this.expression.evaluate({zoom:this.zoom+1},r,n);this._setPaintValue(t,e,i,a);},zo.prototype._setPaintValue=function(t,e,r,n){if("color"===this.type)for(var i=wo(r),a=wo(n),o=t;o<e;o++)this.paintVertexArray.emplace(o,i[0],i[1],a[0],a[1]);else {for(var s=t;s<e;s++)this.paintVertexArray.emplace(s,r,n);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(n));}},zo.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));},zo.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy();},zo.prototype.setUniform=function(t,e){var r=this.useIntegerZoom?Math.floor(e.zoom):e.zoom,n=u(this.expression.interpolationFactor(r,this.zoom,this.zoom+1),0,1);t.set(n);},zo.prototype.getBinding=function(t,e,r){return new fo(t,e)};var Io=function(t,e,r,n,i,a,o,s){this.expression=t,this.type=r,this.useIntegerZoom=n,this.zoom=i,this.layerId=o,this.paintVertexAttributes=("array"===r?ro:eo).members;for(var u=0;u<e.length;++u);this.zoomInPaintVertexArray=new a,this.zoomOutPaintVertexArray=new a,this.property=s;};Io.prototype.populatePaintArray=function(t,e,r){var n=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(t),this.zoomOutPaintVertexArray.resize(t),this._setPaintValues(n,t,e.patterns&&e.patterns[this.layerId],r);},Io.prototype.updatePaintArray=function(t,e,r,n,i){this._setPaintValues(t,e,r.patterns&&r.patterns[this.layerId],i);},Io.prototype._setPaintValues=function(t,e,r,n){if(n&&r){var i=r.min,a=r.mid,o=r.max;"line-outline-dasharray"!==String(this.property)&&"line-outline-pattern"!==String(this.property)||(i=r.min_out,a=r.mid_out,o=r.max_out);var s=n[i],u=n[a],l=n[o];if(s&&u&&l)for(var p=t;p<e;p++)this._setPaintValue(this.zoomInPaintVertexArray,p,u,s),this._setPaintValue(this.zoomOutPaintVertexArray,p,u,l);}},Io.prototype._setPaintValue=function(t,e,r,n){t.emplace(e,r.tl[0],r.tl[1],r.br[0],r.br[1],n.tl[0],n.tl[1],n.br[0],n.br[1],r.pixelRatio,n.pixelRatio);},Io.prototype.upload=function(t){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent));},Io.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy();};var ko=function(t,e,r,n){this.binders={},this.layoutAttributes=n,this._buffers=[];var i=[];for(var a in t.paint._values)if(r(a)){var o=t.paint.get(a);if(o instanceof ia&&Qr(o.property.specification)){var s=Po(a,t.type),u=o.value,l=o.property.specification.type,p=o.property.useIntegerZoom,h=o.property.specification["property-type"],c="cross-faded"===h||"cross-faded-data-driven"===h,f=("line-dasharray"===String(a)||"line-outline-dasharray"===String(a))&&"constant"!==t.layout.get("line-cap").value.kind;if("constant"!==u.kind||f)if("source"===u.kind||f||c){var y=Vo(a,l,"source");this.binders[a]=c?new Io(u,s,l,p,e,y,t.id,a):new So(u,s,l,y),i.push("/a_"+a);}else {var d=Vo(a,l,"composite");this.binders[a]=new zo(u,s,l,p,e,d),i.push("/z_"+a);}else this.binders[a]=c?new Ao(u.value,s):new _o(u.value,s,l),i.push("/u_"+a);}}this.cacheKey=i.sort().join("");};ko.prototype.getMaxValue=function(t){var e=this.binders[t];return e instanceof So||e instanceof zo?e.maxValue:0},ko.prototype.populatePaintArrays=function(t,e,r,n,i){for(var a in this.binders){var o=this.binders[a];(o instanceof So||o instanceof zo||o instanceof Io)&&o.populatePaintArray(t,e,r,n,i);}},ko.prototype.setConstantPatternPositions=function(t,e){for(var r in this.binders){var n=this.binders[r];n instanceof Ao&&n.setConstantPatternPositions(t,e);}},ko.prototype.updatePaintArrays=function(t,e,r,n,i){var a=!1;for(var o in t)for(var s=0,u=e.getPositions(o);s<u.length;s+=1){var l=u[s],p=r.feature(l.index);for(var h in this.binders){var c=this.binders[h];if((c instanceof So||c instanceof zo||c instanceof Io)&&!0===c.expression.isStateDependent){var f=n.paint.get(h);c.expression=f.value,c.updatePaintArray(l.start,l.end,p,t[o],i),a=!0;}}}return a},ko.prototype.defines=function(){var t=[];for(var e in this.binders){var r=this.binders[e];(r instanceof _o||r instanceof Ao)&&t.push.apply(t,r.uniformNames.map((function(t){return "#define HAS_UNIFORM_"+t})));}return t},ko.prototype.getPaintVertexBuffers=function(){return this._buffers},ko.prototype.getUniforms=function(t,e){var r=[];for(var n in this.binders){var i=this.binders[n];if(i instanceof _o||i instanceof Ao||i instanceof zo)for(var a=0,o=i.uniformNames;a<o.length;a+=1){var s=o[a];if(e[s]){var u=i.getBinding(t,e[s],s);r.push({name:s,property:n,binding:u});}}}return r},ko.prototype.setUniforms=function(t,e,r,n){for(var i=0,a=e;i<a.length;i+=1){var o=a[i],s=o.name,u=o.property;this.binders[u].setUniform(o.binding,n,r.get(u),s);}},ko.prototype.updatePaintBuffers=function(t){for(var e in this._buffers=[],this.binders){var r=this.binders[e];if(t&&r instanceof Io){var n=2===t.fromScale?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;n&&this._buffers.push(n);}else (r instanceof So||r instanceof zo)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer);}},ko.prototype.upload=function(t){for(var e in this.binders){var r=this.binders[e];(r instanceof So||r instanceof zo||r instanceof Io)&&r.upload(t);}this.updatePaintBuffers();},ko.prototype.destroy=function(){for(var t in this.binders){var e=this.binders[t];(e instanceof So||e instanceof zo||e instanceof Io)&&e.destroy();}};var Mo=function(t,e,r,n){void 0===n&&(n=function(){return !0}),this.programConfigurations={};for(var i=0,a=e;i<a.length;i+=1){var o=a[i];this.programConfigurations[o.id]=new ko(o,r,n,t);}this.needsUpload=!1,this._featureMap=new so,this._bufferOffset=0;};function Po(t,e){return "eline"==e&&(e="line"),{"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_from","pattern_to","pixel_ratio_from","pixel_ratio_to"],"fill-pattern":["pattern_from","pattern_to","pixel_ratio_from","pixel_ratio_to"],"fill-extrusion-pattern":["pattern_from","pattern_to","pixel_ratio_from","pixel_ratio_to"],"line-dasharray":["dash_to","dash_from"],"line-outline-pattern":["pattern_from","pattern_to","pixel_ratio_from","pixel_ratio_to"],"line-outline-dasharray":["dash_to","dash_from"],"line-outline-width":["width"],"line-outline-floorwidth":["floorwidth"],"line-outline-color":["color"]}[t]||[t.replace(e+"-","").replace(/-/g,"_")]}function Vo(t,e,r){var n={color:{source:ja,composite:Ua},number:{source:Da,composite:ja}},i=function(t){return {"line-pattern":{source:Aa,composite:Aa},"fill-pattern":{source:Aa,composite:Aa},"fill-extrusion-pattern":{source:Aa,composite:Aa},"line-dasharray":{source:Sa,composite:Sa},"line-outline-dasharray":{source:Sa,composite:Sa},"line-outline-pattern":{source:Aa,composite:Aa}}[t]}(t);return i&&i[r]||n[e][r]}Mo.prototype.populatePaintArrays=function(t,e,r,n,i,a){for(var o in this.programConfigurations)this.programConfigurations[o].populatePaintArrays(t,e,n,i,a);void 0!==e.id&&this._featureMap.add(e.id,r,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0;},Mo.prototype.updatePaintArrays=function(t,e,r,n){for(var i=0,a=r;i<a.length;i+=1){var o=a[i];this.needsUpload=this.programConfigurations[o.id].updatePaintArrays(t,this._featureMap,e,o,n)||this.needsUpload;}},Mo.prototype.get=function(t){return this.programConfigurations[t]},Mo.prototype.upload=function(t){if(this.needsUpload){for(var e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1;}},Mo.prototype.destroy=function(){for(var t in this.programConfigurations)this.programConfigurations[t].destroy();},ri("ConstantBinder",_o),ri("CrossFadedConstantBinder",Ao),ri("SourceExpressionBinder",So),ri("CrossFadedCompositeBinder",Io),ri("CompositeExpressionBinder",zo),ri("ProgramConfiguration",ko,{omit:["_buffers"]}),ri("ProgramConfigurationSet",Mo);var Co=function(t){return Math.abs(t-180)<=1e-6?2147483647:parseInt(2147483648*t/180+.5)},To=function(t,e,r){var n={},i=1<<r,a=360/i,o=180/i;return e=i-e-1,n.low_lon=a*t-180,n.low_lat=o*e-90,n.high_lon=a*(t+1)-180,n.high_lat=o*(e+1)-90,n},Eo=function(t,e,r){r-=-90;var n=1<<t,i=180/n,a=parseInt((e-=-180)/(360/n)),o=parseInt(r/i);return o=n-o-1,{x:parseInt(a),y:parseInt(o)}},Bo=function(t,e){return 2==e?t<5?11:t<14?12:13:3==e?12:t<=3?11:12},Do=function(t,e,r,n){var i=To(r,n,t);return function(t,e,r,n){var i=parseInt(33-e-t);n<-90&&(n=-90),n>90&&(n=90),r<-180&&(r=-180),r>180&&(r=180);var a=Co(r),o=Co(n),s=a/(1<<i),u=o/(1<<i);return {x:a=s>0?parseInt(s+.5):parseInt(s-.5),y:o=u>0?parseInt(u+.5):parseInt(u-.5)}}(t,e,i.low_lon,i.low_lat)},Lo=function(t,e,r,n,i,a){var o=parseInt(i+r),s=33-e-t;return i=o<<s,o>0&&i<0&&(i=2147483647),{lon:180*i/2147483648,lat:180*(a=parseInt(a+n)<<s)/2147483648}},Fo=function(t,e,r,n,i,a,o){var s=o||Bo(t,e),u=Do(t,s,r,n);return Lo(t,s,u.x,u.y,i,a)},Ro=function(t){return -90==t?1:90==t?0:(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360},Oo=function(t,e,r,n){var i=Math.pow(2,r),a=To(t,e,r),o=Ro(a.high_lat);if("all"==n){var s=Ro(a.low_lat);return {top:o*i,bottom:s*i,height:(s-o)*i}}return o*i},jo={min:-1*Math.pow(2,14),max:Math.pow(2,14)-1};function Uo(t){var e=8192/t.extent,r=t.loadGeometry();if(t.tileID&&"Sg4326"==t.tileID.reference){for(var n=t.tileID,i=n.x,a=n.y,o=n.z,s=Math.pow(2,o),l=t.tileID._tileY,p=t.properties.resolution||Bo(o,t.type),h=Do(o,p,i,a),c=h.x,f=h.y,y=Math.PI/4,d=Math.PI/360,m=180/Math.PI,v=0,g=r.length;v<g;v++)for(var x=r[v],b=0,w=x.length;b<w;b++){var _,A=x[b],z=Lo(o,p,c,f,A.x,A.y),I=(180+z.lon)/360,k=z.lat;_=-90==k?1:90==k?0:(180-m*Math.log(Math.tan(y+k*d)))/360,A.x=Math.round(8192*(I*s-i)),A.y=Math.round(8192*(_*s-l[0])/l[1]),z=null;}return r}for(var M=0;M<r.length;M++)for(var P=r[M],V=0;V<P.length;V++){var C=P[V];C.x=Math.round(C.x*e),C.y=Math.round(C.y*e),(C.x<jo.min||C.x>jo.max||C.y<jo.min||C.y>jo.max)&&(S("Geometry exceeds allowed extent, reduce your vector tile buffer size"),C.x=u(C.x,jo.min,jo.max),C.y=u(C.y,jo.min,jo.max));}return r}function qo(t,e,r,n,i){t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2);}var No=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 xa,this.indexArray=new Ta,this.segments=new $a,this.programConfigurations=new Mo(Wa,t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}));};function Zo(t,e){for(var r=0;r<t.length;r++)if($o(e,t[r]))return !0;for(var n=0;n<e.length;n++)if($o(t,e[n]))return !0;return !!Ko(t,e)}function Go(t,e,r){return !!$o(t,e)||!!Ho(e,t,r)}function Yo(t,e){if(1===t.length)return Wo(e,t[0]);for(var r=0;r<e.length;r++)for(var n=e[r],i=0;i<n.length;i++)if($o(t,n[i]))return !0;for(var a=0;a<t.length;a++)if(Wo(e,t[a]))return !0;for(var o=0;o<e.length;o++)if(Ko(t,e[o]))return !0;return !1}function Xo(t,e,r){if(t.length>1){if(Ko(t,e))return !0;for(var n=0;n<e.length;n++)if(Ho(e[n],t,r))return !0}for(var i=0;i<t.length;i++)if(Ho(t[i],e,r))return !0;return !1}function Ko(t,e){if(0===t.length||0===e.length)return !1;for(var r=0;r<t.length-1;r++)for(var n=t[r],i=t[r+1],a=0;a<e.length-1;a++)if(Jo(n,i,e[a],e[a+1]))return !0;return !1}function Jo(t,e,r,n){return z(t,r,n)!==z(e,r,n)&&z(t,e,r)!==z(t,e,n)}function Ho(t,e,r){var n=r*r;if(1===e.length)return t.distSqr(e[0])<n;for(var i=1;i<e.length;i++)if(Qo(t,e[i-1],e[i])<n)return !0;return !1}function Qo(t,e,r){var n=e.distSqr(r);if(0===n)return t.distSqr(e);var i=((t.x-e.x)*(r.x-e.x)+(t.y-e.y)*(r.y-e.y))/n;return t.distSqr(i<0?e:i>1?r:r.sub(e)._mult(i)._add(e))}function Wo(t,e){for(var r,n,i,a=!1,o=0;o<t.length;o++)for(var s=0,u=(r=t[o]).length-1;s<r.length;u=s++)(n=r[s]).y>e.y!=(i=r[u]).y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(a=!a);return a}function $o(t,e){for(var r=!1,n=0,i=t.length-1;n<t.length;i=n++){var a=t[n],o=t[i];a.y>e.y!=o.y>e.y&&e.x<(o.x-a.x)*(e.y-a.y)/(o.y-a.y)+a.x&&(r=!r);}return r}function ts(t,e,r){var n=r[0],i=r[2];if(t.x<n.x&&e.x<n.x||t.x>i.x&&e.x>i.x||t.y<n.y&&e.y<n.y||t.y>i.y&&e.y>i.y)return !1;var a=z(t,e,r[0]);return a!==z(t,e,r[1])||a!==z(t,e,r[2])||a!==z(t,e,r[3])}function es(t,e,r){var n=e.paint.get(t).value;return "constant"===n.kind?n.value:r.programConfigurations.get(e.id).getMaxValue(t)}function rs(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function ns(t,e,r,n,a){if(!e[0]&&!e[1])return t;var o=i.convert(e)._mult(a);"viewport"===r&&o._rotate(-n);for(var s=[],u=0;u<t.length;u++)s.push(t[u].sub(o));return s}No.prototype.populate=function(t,e,r){var n=this.layers[0],i=[],a=null;"circle"===n.type&&(a=n.layout.get("circle-sort-key"));for(var o=0,s=t;o<s.length;o+=1){var u=s[o],l=u.feature,p=u.id,h=u.index,c=u.sourceLayerIndex,f=u.order,y=this.layers[0]._featureFilter.needGeometry,d={type:l.type,id:p,properties:l.properties,geometry:y?Uo(l):[]};if(this.layers[0]._featureFilter.filter(new Qi(this.zoom),d,r)){y||(d.geometry=Uo(l));var m=a?a.evaluate(d,{},r):void 0;i.push({id:p,properties:l.properties,type:l.type,sourceLayerIndex:c,index:h,geometry:d.geometry,patterns:{},sortKey:m,order:f});}}a&&i.sort((function(t,e){return t.sortKey-e.sortKey}));for(var v=0,g=i;v<g.length;v+=1){var x=g[v],b=x.geometry,w=x.index,_=x.sourceLayerIndex,A=t[x.order].feature;this.addFeature(x,b,w,r),e.featureIndex.insert(A,b,w,_,this.index);}},No.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r);},No.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},No.prototype.uploadPending=function(){return !this.uploaded||this.programConfigurations.needsUpload},No.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Wa),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0;},No.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy());},No.prototype.addFeature=function(t,e,r,n){for(var i=0,a=e;i<a.length;i+=1)for(var o=0,s=a[i];o<s.length;o+=1){var u=s[o],l=u.x,p=u.y;if(!(l<0||l>=8192||p<0||p>=8192)){var h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),c=h.vertexLength;qo(this.layoutVertexArray,l,p,-1,-1),qo(this.layoutVertexArray,l,p,1,-1),qo(this.layoutVertexArray,l,p,1,1),qo(this.layoutVertexArray,l,p,-1,1),this.indexArray.emplaceBack(c,c+1,c+2),this.indexArray.emplaceBack(c,c+3,c+2),h.vertexLength+=4,h.primitiveLength+=2;}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{},n);},ri("CircleBucket",No,{omit:["layers"]});var is=new ha({"circle-sort-key":new sa(Xt.layout_circle["circle-sort-key"]),"allow-clip":new oa(Xt.layout_circle["allow-clip"])}),as={paint:new ha({"circle-radius":new sa(Xt.paint_circle["circle-radius"]),"circle-color":new sa(Xt.paint_circle["circle-color"]),"circle-blur":new sa(Xt.paint_circle["circle-blur"]),"circle-opacity":new sa(Xt.paint_circle["circle-opacity"]),"circle-translate":new oa(Xt.paint_circle["circle-translate"]),"circle-translate-anchor":new oa(Xt.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new oa(Xt.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new oa(Xt.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new sa(Xt.paint_circle["circle-stroke-width"]),"circle-stroke-color":new sa(Xt.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new sa(Xt.paint_circle["circle-stroke-opacity"]),"circle-minzoom":new sa(Xt.paint_circle["circle-minzoom"]),"circle-maxzoom":new sa(Xt.paint_circle["circle-maxzoom"])}),layout:is},os="undefined"!=typeof Float32Array?Float32Array:Array;function ss(){var t=new os(4);return os!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t}function us(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),u=Math.cos(r);return t[0]=n*u+a*s,t[1]=i*u+o*s,t[2]=n*-s+a*u,t[3]=i*-s+o*u,t}function ls(){var t=new os(16);return os!=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}function ps(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 hs(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],u=e[6],l=e[7],p=e[8],h=e[9],c=e[10],f=e[11],y=e[12],d=e[13],m=e[14],v=e[15],g=r*s-n*o,x=r*u-i*o,b=r*l-a*o,w=n*u-i*s,_=n*l-a*s,A=i*l-a*u,S=p*d-h*y,z=p*m-c*y,I=p*v-f*y,k=h*m-c*d,M=h*v-f*d,P=c*v-f*m,V=g*P-x*M+b*k+w*I-_*z+A*S;return V?(t[0]=(s*P-u*M+l*k)*(V=1/V),t[1]=(i*M-n*P-a*k)*V,t[2]=(d*A-m*_+v*w)*V,t[3]=(c*_-h*A-f*w)*V,t[4]=(u*I-o*P-l*z)*V,t[5]=(r*P-i*I+a*z)*V,t[6]=(m*b-y*A-v*x)*V,t[7]=(p*A-c*b+f*x)*V,t[8]=(o*M-s*I+l*S)*V,t[9]=(n*I-r*M-a*S)*V,t[10]=(y*_-d*b+v*g)*V,t[11]=(h*b-p*_-f*g)*V,t[12]=(s*z-o*k-u*S)*V,t[13]=(r*k-n*z+i*S)*V,t[14]=(d*x-y*w-m*g)*V,t[15]=(p*w-h*x+c*g)*V,t):null}function cs(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],u=e[5],l=e[6],p=e[7],h=e[8],c=e[9],f=e[10],y=e[11],d=e[12],m=e[13],v=e[14],g=e[15],x=r[0],b=r[1],w=r[2],_=r[3];return t[0]=x*n+b*s+w*h+_*d,t[1]=x*i+b*u+w*c+_*m,t[2]=x*a+b*l+w*f+_*v,t[3]=x*o+b*p+w*y+_*g,t[4]=(x=r[4])*n+(b=r[5])*s+(w=r[6])*h+(_=r[7])*d,t[5]=x*i+b*u+w*c+_*m,t[6]=x*a+b*l+w*f+_*v,t[7]=x*o+b*p+w*y+_*g,t[8]=(x=r[8])*n+(b=r[9])*s+(w=r[10])*h+(_=r[11])*d,t[9]=x*i+b*u+w*c+_*m,t[10]=x*a+b*l+w*f+_*v,t[11]=x*o+b*p+w*y+_*g,t[12]=(x=r[12])*n+(b=r[13])*s+(w=r[14])*h+(_=r[15])*d,t[13]=x*i+b*u+w*c+_*m,t[14]=x*a+b*l+w*f+_*v,t[15]=x*o+b*p+w*y+_*g,t}function fs(t,e,r){var n,i,a,o,s,u,l,p,h,c,f,y,d=r[0],m=r[1],v=r[2];return e===t?(t[12]=e[0]*d+e[4]*m+e[8]*v+e[12],t[13]=e[1]*d+e[5]*m+e[9]*v+e[13],t[14]=e[2]*d+e[6]*m+e[10]*v+e[14],t[15]=e[3]*d+e[7]*m+e[11]*v+e[15]):(i=e[1],a=e[2],o=e[3],s=e[4],u=e[5],l=e[6],p=e[7],h=e[8],c=e[9],f=e[10],y=e[11],t[0]=n=e[0],t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=u,t[6]=l,t[7]=p,t[8]=h,t[9]=c,t[10]=f,t[11]=y,t[12]=n*d+s*m+h*v+e[12],t[13]=i*d+u*m+c*v+e[13],t[14]=a*d+l*m+f*v+e[14],t[15]=o*d+p*m+y*v+e[15]),t}function ys(t,e,r){var n=r[0],i=r[1],a=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function ds(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[4],o=e[5],s=e[6],u=e[7],l=e[8],p=e[9],h=e[10],c=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=a*i+l*n,t[5]=o*i+p*n,t[6]=s*i+h*n,t[7]=u*i+c*n,t[8]=l*i-a*n,t[9]=p*i-o*n,t[10]=h*i-s*n,t[11]=c*i-u*n,t}function ms(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[0],o=e[1],s=e[2],u=e[3],l=e[4],p=e[5],h=e[6],c=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i+l*n,t[1]=o*i+p*n,t[2]=s*i+h*n,t[3]=u*i+c*n,t[4]=l*i-a*n,t[5]=p*i-o*n,t[6]=h*i-s*n,t[7]=c*i-u*n,t}function vs(t,e,r,n,i){var a,o=1/Math.tan(e/2);return t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(t[10]=(i+n)*(a=1/(n-i)),t[14]=2*i*n*a):(t[10]=-1,t[14]=-2*n),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 gs=cs;function xs(t){var e=new os(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}var bs,ws=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t};function _s(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}function As(){var t=new os(2);return os!=Float32Array&&(t[0]=0,t[1]=0),t}function Ss(t,e,r){return t[0]=e,t[1]=r,t}function zs(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function Is(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function ks(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function Ms(t){return Math.hypot(t[0],t[1])}function Ps(t,e){var r=e[0],n=e[1],i=r*r+n*n;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t}function Vs(t,e){return t[0]*e[0]+t[1]*e[1]}function Cs(t,e,r,n){var i=e[0]-r[0],a=e[1]-r[1],o=Math.sin(n),s=Math.cos(n);return t[0]=i*s-a*o+r[0],t[1]=i*o+a*s+r[1],t}bs=new os(3),os!=Float32Array&&(bs[0]=0,bs[1]=0,bs[2]=0),function(){var t=new os(4);os!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0);}();var Ts=Is,Es=function(t){var e=t[0],r=t[1];return e*e+r*r},Bs=(As(),function(t){function e(e){t.call(this,e,as);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new No(t)},e.prototype.queryRadius=function(t){var e=t;return es("circle-radius",this,e)+es("circle-stroke-width",this,e)+rs(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,a,o,s){var u=ns(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),a.angle,o),l=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r);return Ds(u,n,a,s,"map"===this.paint.get("circle-pitch-alignment"),"map"===this.paint.get("circle-pitch-scale"),l,o)},e}(ca));function Ds(t,e,r,n,i,a,o,s){for(var u=i?t:function(t,e){return t.map((function(t){return Ls(t,e)}))}(t,n),l=i?o*s:o,p=0,h=e;p<h.length;p+=1)for(var c=0,f=h[p];c<f.length;c+=1){var y=f[c],d=i?y:Ls(y,n),m=l,v=_s([],[y.x,y.y,0,1],n);if(!a&&i?m*=v[3]/r.cameraToCenterDistance:a&&!i&&(m*=r.cameraToCenterDistance/v[3]),Go(u,d,m))return !0}return !1}function Ls(t,e){var r=_s([],[t.x,t.y,0,1],e);return new i(r[0]/r[3],r[1]/r[3])}var Fs=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(No);function Rs(t,e,r,n){var i=e.width,a=e.height;if(n){if(n instanceof Uint8ClampedArray)n=new Uint8Array(n.buffer);else if(n.length!==i*a*r)throw new RangeError("mismatched image size")}else n=new Uint8Array(i*a*r);return t.width=i,t.height=a,t.data=n,t}function Os(t,e,r){var n=e.width,i=e.height;if(n!==t.width||i!==t.height){var a=Rs({},{width:n,height:i},r);js(t,a,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,n),height:Math.min(t.height,i)},r),t.width=n,t.height=i,t.data=a.data;}}function js(t,e,r,n,i,a){if(0===i.width||0===i.height)return e;if(i.width>t.width||i.height>t.height||r.x>t.width-i.width||r.y>t.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>e.width||i.height>e.height||n.x>e.width-i.width||n.y>e.height-i.height)throw new RangeError("out of range destination coordinates for image copy");for(var o=t.data,s=e.data,u=0;u<i.height;u++)for(var l=((r.y+u)*t.width+r.x)*a,p=((n.y+u)*e.width+n.x)*a,h=0;h<i.width*a;h++)s[p+h]=o[l+h];return e}ri("HeatmapBucket",Fs,{omit:["layers"]});var Us=function(t,e){Rs(this,t,1,e);};Us.prototype.resize=function(t){Os(this,t,1);},Us.prototype.clone=function(){return new Us({width:this.width,height:this.height},new Uint8Array(this.data))},Us.copy=function(t,e,r,n,i){js(t,e,r,n,i,1);};var qs=function(t,e){Rs(this,t,4,e);};qs.prototype.resize=function(t){Os(this,t,4);},qs.prototype.replace=function(t,e){e?this.data.set(t):this.data=t instanceof Uint8ClampedArray?new Uint8Array(t.buffer):t;},qs.prototype.clone=function(){return new qs({width:this.width,height:this.height},new Uint8Array(this.data))},qs.copy=function(t,e,r,n,i){js(t,e,r,n,i,4);},ri("AlphaImage",Us),ri("RGBAImage",qs);var Ns={paint:new ha({"heatmap-radius":new sa(Xt.paint_heatmap["heatmap-radius"]),"heatmap-weight":new sa(Xt.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new oa(Xt.paint_heatmap["heatmap-intensity"]),"heatmap-color":new pa(Xt.paint_heatmap["heatmap-color"]),"heatmap-opacity":new oa(Xt.paint_heatmap["heatmap-opacity"])})};function Zs(t,e){for(var r=new Uint8Array(1024),n={},i=0,a=0;i<256;i++,a+=4){n[e]=i/255;var o=t.evaluate(n);r[a+0]=Math.floor(255*o.r/o.a),r[a+1]=Math.floor(255*o.g/o.a),r[a+2]=Math.floor(255*o.b/o.a),r[a+3]=Math.floor(255*o.a);}return new qs({width:256,height:1},r)}var Gs=function(t){function e(e){t.call(this,e,Ns),this._updateColorRamp();}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new Fs(t)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){"heatmap-color"===t&&this._updateColorRamp();},e.prototype._updateColorRamp=function(){this.colorRamp=Zs(this._transitionablePaint._values["heatmap-color"].value.expression,"heatmapDensity"),this.colorRampTexture=null;},e.prototype.resize=function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null);},e.prototype.queryRadius=function(t){return es("heatmap-radius",this,t)},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,a,o,s){return Ds(t,n,a,s,!0,!0,this.paint.get("heatmap-radius").evaluate(e,r),o)},e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility},e}(ca),Ys={paint:new ha({"hillshade-illumination-direction":new oa(Xt.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new oa(Xt.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new oa(Xt.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new oa(Xt.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new oa(Xt.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new oa(Xt.paint_hillshade["hillshade-accent-color"])})},Xs=function(t){function e(e){t.call(this,e,Ys);}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}(ca),Ks=ma([{name:"a_pos",components:2,type:"Int16"}],4).members,Js=Qs,Hs=Qs;function Qs(t,e,r){r=r||2;var n,i,a,o,s,u,l,p=e&&e.length,h=p?e[0]*r:t.length,c=Ws(t,0,h,r,!0),f=[];if(!c||c.next===c.prev)return f;if(p&&(c=function(t,e,r,n){var i,a,o,s=[];for(i=0,a=e.length;i<a;i++)(o=Ws(t,e[i]*n,i<a-1?e[i+1]*n:t.length,n,!1))===o.next&&(o.steiner=!0),s.push(lu(o));for(s.sort(au),i=0;i<s.length;i++)ou(s[i],r),r=$s(r,r.next);return r}(t,e,c,r)),t.length>80*r){n=a=t[0],i=o=t[1];for(var y=r;y<h;y+=r)(s=t[y])<n&&(n=s),(u=t[y+1])<i&&(i=u),s>a&&(a=s),u>o&&(o=u);l=0!==(l=Math.max(a-n,o-i))?1/l:0;}return tu(c,f,r,n,i,l),f}function Ws(t,e,r,n,i){var a,o;if(i===_u(t,e,r,n)>0)for(a=e;a<r;a+=n)o=xu(a,t[a],t[a+1],o);else for(a=r-n;a>=e;a-=n)o=xu(a,t[a],t[a+1],o);return o&&fu(o,o.next)&&(bu(o),o=o.next),o}function $s(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!fu(n,n.next)&&0!==cu(n.prev,n,n.next))n=n.next;else {if(bu(n),(n=e=n.prev)===n.next)break;r=!0;}}while(r||n!==e);return e}function tu(t,e,r,n,i,a,o){if(t){!o&&a&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=uu(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,a,o,s,u,l=1;do{for(r=t,t=null,a=null,o=0;r;){for(o++,n=r,s=0,e=0;e<l&&(s++,n=n.nextZ);e++);for(u=l;s>0||u>0&&n;)0!==s&&(0===u||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,u--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;r=n;}a.nextZ=null,l*=2;}while(o>1)}(i);}(t,n,i,a);for(var s,u,l=t;t.prev!==t.next;)if(s=t.prev,u=t.next,a?ru(t,n,i,a):eu(t))e.push(s.i/r),e.push(t.i/r),e.push(u.i/r),bu(t),t=u.next,l=u.next;else if((t=u)===l){o?1===o?tu(t=nu($s(t),e,r),e,r,n,i,a,2):2===o&&iu(t,e,r,n,i,a):tu($s(t),e,r,n,i,a,1);break}}}function eu(t){var e=t.prev,r=t,n=t.next;if(cu(e,r,n)>=0)return !1;for(var i=t.next.next;i!==t.prev;){if(pu(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&cu(i.prev,i,i.next)>=0)return !1;i=i.next;}return !0}function ru(t,e,r,n){var i=t.prev,a=t,o=t.next;if(cu(i,a,o)>=0)return !1;for(var s=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,u=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,l=uu(i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,e,r,n),p=uu(s,u,e,r,n),h=t.prevZ,c=t.nextZ;h&&h.z>=l&&c&&c.z<=p;){if(h!==t.prev&&h!==t.next&&pu(i.x,i.y,a.x,a.y,o.x,o.y,h.x,h.y)&&cu(h.prev,h,h.next)>=0)return !1;if(h=h.prevZ,c!==t.prev&&c!==t.next&&pu(i.x,i.y,a.x,a.y,o.x,o.y,c.x,c.y)&&cu(c.prev,c,c.next)>=0)return !1;c=c.nextZ;}for(;h&&h.z>=l;){if(h!==t.prev&&h!==t.next&&pu(i.x,i.y,a.x,a.y,o.x,o.y,h.x,h.y)&&cu(h.prev,h,h.next)>=0)return !1;h=h.prevZ;}for(;c&&c.z<=p;){if(c!==t.prev&&c!==t.next&&pu(i.x,i.y,a.x,a.y,o.x,o.y,c.x,c.y)&&cu(c.prev,c,c.next)>=0)return !1;c=c.nextZ;}return !0}function nu(t,e,r){var n=t;do{var i=n.prev,a=n.next.next;!fu(i,a)&&yu(i,n,n.next,a)&&vu(i,a)&&vu(a,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(a.i/r),bu(n),bu(n.next),n=t=a),n=n.next;}while(n!==t);return $s(n)}function iu(t,e,r,n,i,a){var o=t;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&hu(o,s)){var u=gu(o,s);return o=$s(o,o.next),u=$s(u,u.next),tu(o,e,r,n,i,a),void tu(u,e,r,n,i,a)}s=s.next;}o=o.next;}while(o!==t)}function au(t,e){return t.x-e.x}function ou(t,e){if(e=function(t,e){var r,n=e,i=t.x,a=t.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o){if(o=s,s===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x<n.next.x?n:n.next;}}n=n.next;}while(n!==e);if(!r)return null;if(i===o)return r;var u,l=r,p=r.x,h=r.y,c=1/0;n=r;do{i>=n.x&&n.x>=p&&i!==n.x&&pu(a<h?i:o,a,p,h,a<h?o:i,a,n.x,n.y)&&(u=Math.abs(a-n.y)/(i-n.x),vu(n,t)&&(u<c||u===c&&(n.x>r.x||n.x===r.x&&su(r,n)))&&(r=n,c=u)),n=n.next;}while(n!==l);return r}(t,e)){var r=gu(e,t);$s(e,e.next),$s(r,r.next);}}function su(t,e){return cu(t.prev,t,e.prev)<0&&cu(e.next,t,t.next)<0}function uu(t,e,r,n,i){return (t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function lu(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 pu(t,e,r,n,i,a,o,s){return (i-o)*(e-s)-(t-o)*(a-s)>=0&&(t-o)*(n-s)-(r-o)*(e-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function hu(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&&yu(r,r.next,t,e))return !0;r=r.next;}while(r!==t);return !1}(t,e)&&(vu(t,e)&&vu(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{r.y>a!=r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next;}while(r!==t);return n}(t,e)&&(cu(t.prev,t,e.prev)||cu(t,e.prev,e))||fu(t,e)&&cu(t.prev,t,t.next)>0&&cu(e.prev,e,e.next)>0)}function cu(t,e,r){return (e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function fu(t,e){return t.x===e.x&&t.y===e.y}function yu(t,e,r,n){var i=mu(cu(t,e,r)),a=mu(cu(t,e,n)),o=mu(cu(r,n,t)),s=mu(cu(r,n,e));return i!==a&&o!==s||!(0!==i||!du(t,r,e))||!(0!==a||!du(t,n,e))||!(0!==o||!du(r,t,n))||!(0!==s||!du(r,e,n))}function du(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 mu(t){return t>0?1:t<0?-1:0}function vu(t,e){return cu(t.prev,t,t.next)<0?cu(t,e,t.next)>=0&&cu(t,t.prev,e)>=0:cu(t,e,t.prev)<0||cu(t,t.next,e)<0}function gu(t,e){var r=new wu(t.i,t.x,t.y),n=new wu(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function xu(t,e,r,n){var i=new wu(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function bu(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 wu(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 _u(t,e,r,n){for(var i=0,a=e,o=r-n;a<r;a+=n)i+=(t[o]-t[a])*(t[a+1]+t[o+1]),o=a;return i}function Au(t,e,r,n,i){!function t(e,r,n,i,a){for(;i>n;){if(i-n>600){var o=i-n+1,s=r-n+1,u=Math.log(o),l=.5*Math.exp(2*u/3),p=.5*Math.sqrt(u*l*(o-l)/o)*(s-o/2<0?-1:1);t(e,r,Math.max(n,Math.floor(r-s*l/o+p)),Math.min(i,Math.floor(r+(o-s)*l/o+p)),a);}var h=e[r],c=n,f=i;for(Su(e,n,r),a(e[i],h)>0&&Su(e,n,i);c<f;){for(Su(e,c,f),c++,f--;a(e[c],h)<0;)c++;for(;a(e[f],h)>0;)f--;}0===a(e[n],h)?Su(e,n,f):Su(e,++f,i),f<=r&&(n=f+1),r<=f&&(i=f-1);}}(t,e,r||0,n||t.length-1,i||zu);}function Su(t,e,r){var n=t[e];t[e]=t[r],t[r]=n;}function zu(t,e){return t<e?-1:t>e?1:0}function Iu(t,e){var r=t.length;if(r<=1)return [t];for(var n,i,a=[],o=0;o<r;o++){var s=I(t[o]);0!==s&&(t[o].area=Math.abs(s),void 0===i&&(i=s<0),i===s<0?(n&&a.push(n),n=[t[o]]):n.push(t[o]));}if(n&&a.push(n),e>1)for(var u=0;u<a.length;u++)a[u].length<=e||(Au(a[u],e,1,a[u].length-1,ku),a[u]=a[u].slice(0,e));return a}function ku(t,e){return e.area-t.area}function Mu(t,e,r){for(var n=r.patternDependencies,i=!1,a=0,o=e;a<o.length;a+=1){var s=o[a].paint.get(t+"-pattern");s.isConstant()||(i=!0);var u=s.constantOr(null);u&&(i=!0,n[u.to]=!0,n[u.from]=!0);}return i}function Pu(t,e,r,n,i){for(var a=i.patternDependencies,o=0,s=e;o<s.length;o+=1){var u=s[o],l=u.paint.get(t+"-pattern").value;if("constant"!==l.kind){var p=l.evaluate({zoom:n-1},r,{},i.availableImages),h=l.evaluate({zoom:n},r,{},i.availableImages),c=l.evaluate({zoom:n+1},r,{},i.availableImages);h=h&&h.name?h.name:h,c=c&&c.name?c.name:c,a[p=p&&p.name?p.name:p]=!0,a[h]=!0,a[c]=!0,r.patterns[u.id]={min:p,mid:h,max:c};}}return r}Qs.deviation=function(t,e,r,n){var i=e&&e.length,a=Math.abs(_u(t,0,i?e[0]*r:t.length,r));if(i)for(var o=0,s=e.length;o<s;o++)a-=Math.abs(_u(t,e[o]*r,o<s-1?e[o+1]*r:t.length,r));var u=0;for(o=0;o<n.length;o+=3){var l=n[o]*r,p=n[o+1]*r,h=n[o+2]*r;u+=Math.abs((t[l]-t[h])*(t[p+1]-t[l+1])-(t[l]-t[p])*(t[h+1]-t[l+1]));}return 0===a&&0===u?0:Math.abs((u-a)/a)},Qs.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},n=0,i=0;i<t.length;i++){for(var a=0;a<t[i].length;a++)for(var o=0;o<e;o++)r.vertices.push(t[i][a][o]);i>0&&r.holes.push(n+=t[i-1].length);}return r},Js.default=Hs;var Vu=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 xa,this.indexArray=new Ta,this.indexArray2=new Ra,this.programConfigurations=new Mo(Ks,t.layers,t.zoom),this.segments=new $a,this.segments2=new $a,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}));};Vu.prototype.populate=function(t,e,r){this.hasPattern=Mu("fill",this.layers,e);for(var n=this.layers[0].layout.get("fill-sort-key"),i=[],a=0,o=t.length;a<o;a+=1){var s=t[a],u=s.feature,l=s.id,p=s.index,h=s.sourceLayerIndex,c=s.order,f=this.layers[0]._featureFilter.needGeometry,y={type:u.type,id:l,properties:u.properties,geometry:f?Uo(u):[]};if(this.layers[0]._featureFilter.filter(new Qi(this.zoom),y,r)){f||(y.geometry=Uo(u));var d=n?n.evaluate(y,{},r,e.availableImages):void 0;i.push({id:l,properties:u.properties,type:u.type,sourceLayerIndex:h,index:p,geometry:y.geometry,patterns:{},sortKey:d,order:c});}}n&&i.sort((function(t,e){return t.sortKey-e.sortKey}));for(var m=0,v=i.length;m<v;m+=1){var g=i[m],x=g.geometry,b=g.index,w=g.sourceLayerIndex,_=g.order;if(this.hasPattern){var A=Pu("fill",this.layers,g,this.zoom,e);this.patternFeatures.push(A);}else this.addFeature(g,x,b,r,{});e.featureIndex.insert(t[_].feature,x,b,w,this.index);}},Vu.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r);},Vu.prototype.addFeatures=function(t,e,r){for(var n=0,i=this.patternFeatures;n<i.length;n+=1){var a=i[n];this.addFeature(a,a.geometry,a.index,e,r);}},Vu.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Vu.prototype.uploadPending=function(){return !this.uploaded||this.programConfigurations.needsUpload},Vu.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ks),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0;},Vu.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy());},Vu.prototype.addFeature=function(t,e,r,n,i){for(var a=0,o=Iu(e,500);a<o.length;a+=1){for(var s=o[a],u=0,l=0,p=s;l<p.length;l+=1)u+=p[l].length;for(var h=this.segments.prepareSegment(u,this.layoutVertexArray,this.indexArray),c=h.vertexLength,f=[],y=[],d=0,m=s;d<m.length;d+=1){var v=m[d];if(0!==v.length){v!==s[0]&&y.push(f.length/2);var g=this.segments2.prepareSegment(v.length,this.layoutVertexArray,this.indexArray2),x=g.vertexLength;this.layoutVertexArray.emplaceBack(v[0].x,v[0].y),this.indexArray2.emplaceBack(x+v.length-1,x),f.push(v[0].x),f.push(v[0].y);for(var b=1;b<v.length;b++)this.layoutVertexArray.emplaceBack(v[b].x,v[b].y),this.indexArray2.emplaceBack(x+b-1,x+b),f.push(v[b].x),f.push(v[b].y);g.vertexLength+=v.length,g.primitiveLength+=v.length;}}for(var w=Js(f,y),_=0;_<w.length;_+=3)this.indexArray.emplaceBack(c+w[_],c+w[_+1],c+w[_+2]);h.vertexLength+=u,h.primitiveLength+=w.length/3;}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,i,n);},ri("FillBucket",Vu,{omit:["layers","patternFeatures"]});var Cu=new ha({"fill-sort-key":new sa(Xt.layout_fill["fill-sort-key"]),"allow-clip":new oa(Xt.layout_fill["allow-clip"])}),Tu={paint:new ha({"fill-antialias":new oa(Xt.paint_fill["fill-antialias"]),"fill-opacity":new sa(Xt.paint_fill["fill-opacity"]),"fill-color":new sa(Xt.paint_fill["fill-color"]),"fill-outline-color":new sa(Xt.paint_fill["fill-outline-color"]),"fill-translate":new oa(Xt.paint_fill["fill-translate"]),"fill-translate-anchor":new oa(Xt.paint_fill["fill-translate-anchor"]),"fill-pattern":new ua(Xt.paint_fill["fill-pattern"]),"fill-minzoom":new sa(Xt.paint_fill["fill-minzoom"]),"fill-maxzoom":new sa(Xt.paint_fill["fill-maxzoom"])}),layout:Cu},Eu=function(t){function e(e){t.call(this,e,Tu);}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 n=this.paint._values["fill-outline-color"];"constant"===n.value.kind&&void 0===n.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"]);},e.prototype.createBucket=function(t){return new Vu(t)},e.prototype.queryRadius=function(){return rs(this.paint.get("fill-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,a,o){return Yo(ns(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),a.angle,o),n)},e.prototype.isTileClipped=function(){return !0},e}(ca),Bu=ma([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,Du=Lu;function Lu(t,e,r,n,i){this.properties={},this.extent=r,this.type=0,this._pbf=t,this._geometry=-1,this._keys=n,this._values=i,t.readFields(Fu,this,e);}function Fu(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 n=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[n]=i;}}(r,e):3==t?e.type=r.readVarint():4==t&&(e._geometry=r.pos);}function Ru(t){for(var e,r,n=0,i=0,a=t.length,o=a-1;i<a;o=i++)n+=((r=t[o]).x-(e=t[i]).x)*(e.y+r.y);return n}Lu.types=["Unknown","Point","LineString","Polygon"],Lu.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,r=t.readVarint()+t.pos,n=1,a=0,o=0,s=0,u=[];t.pos<r;){if(a<=0){var l=t.readVarint();n=7&l,a=l>>3;}if(a--,1===n||2===n)o+=t.readSVarint(),s+=t.readSVarint(),1===n&&(e&&u.push(e),e=[]),e.push(new i(o,s));else {if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone());}}return e&&u.push(e),u},Lu.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,a=0,o=1/0,s=-1/0,u=1/0,l=-1/0;t.pos<e;){if(n<=0){var p=t.readVarint();r=7&p,n=p>>3;}if(n--,1===r||2===r)(i+=t.readSVarint())<o&&(o=i),i>s&&(s=i),(a+=t.readSVarint())<u&&(u=a),a>l&&(l=a);else if(7!==r)throw new Error("unknown command "+r)}return [o,u,s,l]},Lu.prototype.toGeoJSON=function(t,e,r){var n,i,a=this.extent*Math.pow(2,r),o=this.extent*t,s=this.extent*e,u=this.loadGeometry(),l=Lu.types[this.type];function p(t){for(var e=0;e<t.length;e++){var r=t[e];t[e]=[360*(r.x+o)/a-180,360/Math.PI*Math.atan(Math.exp((180-360*(r.y+s)/a)*Math.PI/180))-90];}}switch(this.type){case 1:var h=[];for(n=0;n<u.length;n++)h[n]=u[n][0];p(u=h);break;case 2:for(n=0;n<u.length;n++)p(u[n]);break;case 3:for(u=function(t){var e=t.length;if(e<=1)return [t];for(var r,n,i=[],a=0;a<e;a++){var o=Ru(t[a]);0!==o&&(void 0===n&&(n=o<0),n===o<0?(r&&i.push(r),r=[t[a]]):r.push(t[a]));}return r&&i.push(r),i}(u),n=0;n<u.length;n++)for(i=0;i<u[n].length;i++)p(u[n][i]);}1===u.length?u=u[0]:l="Multi"+l;var c={type:"Feature",geometry:{type:l,coordinates:u},properties:this.properties};return "id"in this&&(c.id=this.id),c};var Ou=ju;function ju(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(Uu,this,e),this.length=this._features.length;}function Uu(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 n=t.readVarint()>>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null;}return e}(r));}function qu(t,e,r){if(3===t){var n=new Ou(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n);}}ju.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 Du(this._pbf,e,this.extent,this._keys,this._values)};var Nu={VectorTile:function(t,e){this.layers=t.readFields(qu,{},e);},VectorTileFeature:Du,VectorTileLayer:Ou},Zu=Nu.VectorTileFeature.types,Gu=Math.pow(2,13);function Yu(t,e,r,n,i,a,o,s){t.emplaceBack(e,r,2*Math.floor(n*Gu)+o,i*Gu*2,a*Gu*2,Math.round(s));}var Xu=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 wa,this.indexArray=new Ta,this.programConfigurations=new Mo(Bu,t.layers,t.zoom),this.segments=new $a,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}));};function Ku(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}Xu.prototype.populate=function(t,e,r){this.features=[],this.hasPattern=Mu("fill-extrusion",this.layers,e);for(var n=0,i=t;n<i.length;n+=1){var a=i[n],o=a.feature,s=a.id,u=a.index,l=a.sourceLayerIndex,p=this.layers[0]._featureFilter.needGeometry,h={type:o.type,id:s,properties:o.properties,geometry:p?Uo(o):[]};if(this.layers[0]._featureFilter.filter(new Qi(this.zoom),h,r)){var c={id:s,sourceLayerIndex:l,index:u,geometry:p?h.geometry:Uo(o),properties:o.properties,type:o.type,patterns:{}};void 0!==o.id&&(c.id=o.id),this.hasPattern?this.features.push(Pu("fill-extrusion",this.layers,c,this.zoom,e)):this.addFeature(c,c.geometry,u,r,{}),e.featureIndex.insert(o,c.geometry,u,l,this.index,!0);}}},Xu.prototype.addFeatures=function(t,e,r){for(var n=0,i=this.features;n<i.length;n+=1){var a=i[n];this.addFeature(a,a.geometry,a.index,e,r);}},Xu.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r);},Xu.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Xu.prototype.uploadPending=function(){return !this.uploaded||this.programConfigurations.needsUpload},Xu.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Bu),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0;},Xu.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy());},Xu.prototype.addFeature=function(t,e,r,n,i){for(var a="Sg4326"==n.reference,o=0,s=Iu(e,500);o<s.length;o+=1){for(var u=s[o],l=0,p=0,h=u;p<h.length;p+=1)l+=h[p].length;for(var c=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),f=0,y=u;f<y.length;f+=1){var d=y[f];if(0!==d.length&&!((E=d).every((function(t){return t.x<0}))||E.every((function(t){return t.x>8192}))||E.every((function(t){return t.y<0}))||E.every((function(t){return t.y>8192}))))for(var m=0,v=0;v<d.length;v++){var g=d[v];if(v>=1){var x=d[v-1];if(!Ku(g,x)){c.vertexLength+4>$a.MAX_VERTEX_ARRAY_LENGTH&&(c=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var b=g.sub(x)._perp()._unit();a&&(b=b._mult(-1));var w=x.dist(g);m+w>32768&&(m=0),Yu(this.layoutVertexArray,g.x,g.y,b.x,b.y,0,0,m),Yu(this.layoutVertexArray,g.x,g.y,b.x,b.y,0,1,m),Yu(this.layoutVertexArray,x.x,x.y,b.x,b.y,0,0,m+=w),Yu(this.layoutVertexArray,x.x,x.y,b.x,b.y,0,1,m);var _=c.vertexLength;a?(this.indexArray.emplaceBack(_,_+1,_+2),this.indexArray.emplaceBack(_+1,_+3,_+2)):(this.indexArray.emplaceBack(_,_+2,_+1),this.indexArray.emplaceBack(_+1,_+2,_+3)),c.vertexLength+=4,c.primitiveLength+=2;}}}}if(c.vertexLength+l>$a.MAX_VERTEX_ARRAY_LENGTH&&(c=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray)),"Polygon"===Zu[t.type]){for(var A=[],S=[],z=c.vertexLength,I=0,k=u;I<k.length;I+=1){var M=k[I];if(0!==M.length){M!==u[0]&&S.push(A.length/2);for(var P=0;P<M.length;P++){var V=M[P];Yu(this.layoutVertexArray,V.x,V.y,0,0,1,1,0),A.push(V.x),A.push(V.y);}}}for(var C=Js(A,S),T=0;T<C.length;T+=3)this.indexArray.emplaceBack(z+C[T],z+C[T+2],z+C[T+1]);c.primitiveLength+=C.length/3,c.vertexLength+=l;}}var E;this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,i,n);},ri("FillExtrusionBucket",Xu,{omit:["layers","features"]});var Ju={paint:new ha({"fill-extrusion-opacity":new oa(Xt["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new sa(Xt["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new oa(Xt["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new oa(Xt["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new ua(Xt["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new sa(Xt["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new sa(Xt["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new oa(Xt["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"]),"fill-extrusion-minzoom":new sa(Xt["paint_fill-extrusion"]["fill-extrusion-minzoom"]),"fill-extrusion-maxzoom":new sa(Xt["paint_fill-extrusion"]["fill-extrusion-maxzoom"]),"fill-extrusion-topcolor":new sa(Xt["paint_fill-extrusion"]["fill-extrusion-topcolor"])})},Hu=function(t){function e(e){t.call(this,e,Ju);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new Xu(t)},e.prototype.queryRadius=function(){return rs(this.paint.get("fill-extrusion-translate"))},e.prototype.is3D=function(){return !0},e.prototype.queryIntersectsFeature=function(t,e,r,n,a,o,s,u){var l=ns(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),o.angle,s),p=this.paint.get("fill-extrusion-height").evaluate(e,r),h=this.paint.get("fill-extrusion-base").evaluate(e,r),c=function(t,e,r,n){for(var a=[],o=0,s=t;o<s.length;o+=1){var u=s[o],l=[u.x,u.y,0,1];_s(l,l,e),a.push(new i(l[0]/l[3],l[1]/l[3]));}return a}(l,u),f=function(t,e,r,n){for(var a=[],o=[],s=n[8]*e,u=n[9]*e,l=n[10]*e,p=n[11]*e,h=n[8]*r,c=n[9]*r,f=n[10]*r,y=n[11]*r,d=0,m=t;d<m.length;d+=1){for(var v=[],g=[],x=0,b=m[d];x<b.length;x+=1){var w=b[x],_=w.x,A=w.y,S=n[0]*_+n[4]*A+n[12],z=n[1]*_+n[5]*A+n[13],I=n[2]*_+n[6]*A+n[14],k=n[3]*_+n[7]*A+n[15],M=I+l,P=k+p,V=S+h,C=z+c,T=I+f,E=k+y,B=new i((S+s)/P,(z+u)/P);B.z=M/P,v.push(B);var D=new i(V/E,C/E);D.z=T/E,g.push(D);}a.push(v),o.push(g);}return [a,o]}(n,h,p,u);return function(t,e,r){var n=1/0;Yo(r,e)&&(n=Wu(r,e[0]));for(var i=0;i<e.length;i++)for(var a=e[i],o=t[i],s=0;s<a.length-1;s++){var u=a[s],l=[u,a[s+1],o[s+1],o[s],u];Zo(r,l)&&(n=Math.min(n,Wu(r,l)));}return n!==1/0&&n}(f[0],f[1],c)},e}(ca);function Qu(t,e){return t.x*e.x+t.y*e.y}function Wu(t,e){if(1===t.length){for(var r,n=0,i=e[n++];!r||i.equals(r);)if(!(r=e[n++]))return 1/0;for(;n<e.length;n++){var a=e[n],o=t[0],s=r.sub(i),u=a.sub(i),l=o.sub(i),p=Qu(s,s),h=Qu(s,u),c=Qu(u,u),f=Qu(l,s),y=Qu(l,u),d=p*c-h*h,m=(c*f-h*y)/d,v=(p*y-h*f)/d,g=i.z*(1-m-v)+r.z*m+a.z*v;if(isFinite(g))return g}return 1/0}for(var x=1/0,b=0,w=e;b<w.length;b+=1)x=Math.min(x,w[b].z);return x}var $u=ma([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,tl=Nu.VectorTileFeature.types,el=Math.cos(Math.PI/180*37.5),rl=Math.pow(2,14)/.5,nl=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 _a,this.indexArray=new Ta,this.programConfigurations=new Mo($u,t.layers,t.zoom,(function(t){return t.indexOf("line-outline")<0}));var e=["line-color","line-floorwidth","line-width","line-dasharray","line-pattern"];this.programConfigurations_outline=new Mo($u,t.layers,t.zoom,(function(t){return e.indexOf(t)<0})),this.segments=new $a,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}));};nl.prototype.populate=function(t,e,r){var n=Mu("line",this.layers,e),i=Mu("line-outline",this.layers,e);this.hasPattern=n||i;for(var a=this.layers[0].layout.get("line-sort-key"),o=[],s=0,u=t.length;s<u;s+=1){var l=t[s],p=l.feature,h=l.id,c=l.index,f=l.sourceLayerIndex,y=l.order,d=this.layers[0]._featureFilter,m=d.needGeometry,v={type:p.type,id:h,properties:p.properties,geometry:m?Uo(p):[]};if(d.filter(new Qi(this.zoom),v,r)){m||(v.geometry=Uo(p));var g=a?a.evaluate(v,{},r):void 0;o.push({id:h,properties:p.properties,type:p.type,sourceLayerIndex:f,index:c,geometry:v.geometry,patterns:{},sortKey:g,order:y});}}a&&o.sort((function(t,e){return t.sortKey-e.sortKey}));for(var x=e.lineAtlas,b=this.addConstantDashes(x),w=0,_=o.length;w<_;w+=1){var A=o[w],S=A.geometry,z=A.index,I=A.sourceLayerIndex,k=A.order;if(b&&this.addFeatureDashes(A,x),this.hasPattern){var M=this.addPatternDependencies("line",this.layers,A,this.zoom,e);this.patternFeatures.push(M);}else this.addFeature(A,S,z,r,x.positions);e.featureIndex.insert(t[k].feature,S,z,I,this.index);}},nl.prototype.addPatternDependencies=function(t,e,r,n,i,a){for(var o=i.patternDependencies,s=0,u=e;s<u.length;s+=1){var l=u[s],p=l.paint.get(t+"-pattern");r.patterns[l.id]={};var h=p.value;if("constant"!==h.kind){var f=h.evaluate({zoom:n-1},r,{},i.availableImages),y=h.evaluate({zoom:n},r,{},i.availableImages),d=h.evaluate({zoom:n+1},r,{},i.availableImages);y=y&&y.name?y.name:y,d=d&&d.name?d.name:d,o[f=f&&f.name?f.name:f]=!0,o[y]=!0,o[d]=!0,r.patterns[l.id]={min:f,mid:y,max:d};}var m=l.paint.get(t+"-outline-pattern").value;if("constant"!==m.kind){var v=m.evaluate({zoom:n-1},r,{},i.availableImages),g=m.evaluate({zoom:n},r,{},i.availableImages),x=m.evaluate({zoom:n+1},r,{},i.availableImages);g=g&&g.name?g.name:g,x=x&&x.name?x.name:x,o[v=v&&v.name?v.name:v]=!0,o[g]=!0,o[x]=!0,r.patterns[l.id]=c(r.patterns[l.id],{min_out:v,mid_out:g,max_out:x});}}return r},nl.prototype.addConstantDashes=function(t){for(var e=!1,r=0,n=this.layers;r<n.length;r+=1){var i=n[r],a=i.paint.get("line-dasharray").value,o=i.paint.get("line-outline-dasharray").value,s=i.layout.get("line-cap").value;if("constant"!==a.kind||"constant"!==o.kind||"constant"!==s.kind)e=!0;else {var u=s.value,l=a.value;l&&(t.addDash(l.from,u),t.addDash(l.to,u),l.other&&t.addDash(l.other,u));var p=o.value;p&&(t.addDash(p.from,u),t.addDash(p.to,u),p.other&&t.addDash(p.other,u));}}return e},nl.prototype.addFeatureDashes=function(t,e,r){var n=this.zoom;function i(t,e,r,n,i){var a,o,s,u,l,p,h=r.paint.get(i).value,c=r.layout.get("line-cap").value;if("constant"===h.kind&&"constant"===c.kind)return null;if("constant"===h.kind){var f=h.value;if(!f)return null;a=f.other||f.to,o=f.to,s=f.from;}else a=h.evaluate({zoom:e-1},n),o=h.evaluate({zoom:e},n),s=h.evaluate({zoom:e+1},n);return "constant"===c.kind?u=l=p=c.value:(u=c.evaluate({zoom:e-1},n),l=c.evaluate({zoom:e},n),p=c.evaluate({zoom:e+1},n)),t.addDash(a,u),t.addDash(o,l),t.addDash(s,p),{min:t.getKey(a,u),mid:t.getKey(o,l),max:t.getKey(s,p)}}for(var a=0,o=this.layers;a<o.length;a+=1){var s=o[a],u=i(e,n,s,t,"line-dasharray"),l=i(e,n,s,t,"line-outline-dasharray");t.patterns[s.id]={},null!=u&&(t.patterns[s.id].min=u.min,t.patterns[s.id].mid=u.mid,t.patterns[s.id].max=u.max),null!=l&&(t.patterns[s.id].min_out=l.min,t.patterns[s.id].mid_out=l.mid,t.patterns[s.id].max_out=l.max);}},nl.prototype.update=function(t,e,r){this.stateDependentLayers.length&&(this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r),this.programConfigurations_outline.updatePaintArrays(t,e,this.stateDependentLayers,r));},nl.prototype.addFeatures=function(t,e,r){for(var n=0,i=this.patternFeatures;n<i.length;n+=1){var a=i[n];this.addFeature(a,a.geometry,a.index,e,r);}},nl.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},nl.prototype.uploadPending=function(){return !this.uploaded||this.programConfigurations.needsUpload||this.programConfigurations_outline.needsUpload},nl.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,$u),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.programConfigurations_outline.upload(t),this.uploaded=!0;},nl.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.programConfigurations_outline.destroy(),this.segments.destroy());},nl.prototype.addFeature=function(t,e,r,n,i){for(var a=this.layers[0].layout,o=a.get("line-join").evaluate(t,{}),s=a.get("line-cap").evaluate(t,{}),u=a.get("line-miter-limit"),l=a.get("line-round-limit"),p=this.layers[0].paint.get("line-offset").evaluate(t,{}),h=0,c=e;h<c.length;h+=1)this.addLine(c[h],t,o,s,u,l,p);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,i,n),this.programConfigurations_outline.populatePaintArrays(this.layoutVertexArray.length,t,r,i,n);},nl.prototype.addLine=function(t,e,r,n,i,a,o){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,e.properties&&e.properties.hasOwnProperty("sgmap_clip_start")&&e.properties.hasOwnProperty("sgmap_clip_end")){this.clipStart=+e.properties.sgmap_clip_start,this.clipEnd=+e.properties.sgmap_clip_end;for(var s=0;s<t.length-1;s++)this.totalDistance+=t[s].dist(t[s+1]);this.updateScaledDistance();}for(var u="Polygon"===tl[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<(u?3:2))){"bevel"===r&&(i=1.05);var h,c=this.overscaling<=16?122880/(512*this.overscaling):0,f=this.segments.prepareSegment(10*l,this.layoutVertexArray,this.indexArray),y=void 0,d=void 0,m=void 0,v=void 0;this.e1=this.e2=-1,u&&(v=t[p].sub(h=t[l-2])._unit()._perp());for(var g=p;g<l;g++)if(!(d=g===l-1?u?t[p+1]:void 0:t[g+1])||!t[g].equals(d)){v&&(m=v),h&&(y=h),h=t[g],v=d?d.sub(h)._unit()._perp():m;var x=(m=m||v).add(v);0===x.x&&0===x.y||x._unit();var b=m.x*v.x+m.y*v.y,w=x.x*v.x+x.y*v.y,_=0!==w?1/w:1/0,A=2*Math.sqrt(2-2*w),S=w<el&&y&&d,z=m.x*v.y-m.y*v.x>0;if(S&&g>p){var I=h.dist(y);if(I>2*c){var k=h.sub(h.sub(y)._mult(c/I)._round());this.updateDistance(y,k),this.addCurrentVertex(k,m,0,0,f),y=k;}}var M=y&&d,P=M?r:u?"butt":n;if(M&&"round"===P&&(_<a?P="miter":_<=2&&(P="fakeround")),"miter"===P&&_>i&&(P="bevel"),"bevel"===P&&(_>2&&(P="flipbevel"),_<i&&(P="miter")),y&&this.updateDistance(y,h),"miter"===P)x._mult(_),this.addCurrentVertex(h,x,0,0,f);else if("flipbevel"===P){if(_>100)x=v.mult(-1);else if(o)x=m.add(v)._mult(_),this.addCurrentVertex(h,x,0,0,f);else {var V=_*m.add(v).mag()/m.sub(v).mag();x._perp()._mult(V*(z?-1:1));}this.addCurrentVertex(h,x,0,0,f),this.addCurrentVertex(h,x.mult(-1),0,0,f);}else if("bevel"===P||"fakeround"===P){var C=-Math.sqrt(_*_-1),T=z?C:0,E=z?0:C;if(y&&this.addCurrentVertex(h,m,T,E,f),"fakeround"===P)for(var B=Math.round(180*A/Math.PI/20),D=1;D<B;D++){var L=D/B;if(.5!==L){var F=L-.5;L+=L*F*(L-1)*((1.0904+b*(b*(3.55645-1.43519*b)-3.2452))*F*F+(.848013+b*(.215638*b-1.06021)));}var R=v.sub(m)._mult(L)._add(m)._unit()._mult(z?-1:1);this.addHalfVertex(h,R.x,R.y,!1,z,0,f);}d&&this.addCurrentVertex(h,v,-T,-E,f);}else if("butt"===P)this.addCurrentVertex(h,x,0,0,f);else if("square"===P){var O=y?1:-1;this.addCurrentVertex(h,x,O,O,f);}else "round"===P&&(y&&(this.addCurrentVertex(h,m,0,0,f),this.addCurrentVertex(h,m,1,1,f,!0)),d&&(this.addCurrentVertex(h,v,-1,-1,f,!0),this.addCurrentVertex(h,v,0,0,f)));if(S&&g<l-1){var j=h.dist(d);if(j>2*c){var U=h.add(d.sub(h)._mult(c/j)._round());this.updateDistance(h,U),this.addCurrentVertex(U,v,0,0,f),h=U;}}}}},nl.prototype.addCurrentVertex=function(t,e,r,n,i,a){void 0===a&&(a=!1);var o=e.y*n-e.x,s=-e.y-e.x*n;this.addHalfVertex(t,e.x+e.y*r,e.y-e.x*r,a,!1,r,i),this.addHalfVertex(t,o,s,a,!0,-n,i),this.distance>rl/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,r,n,i,a));},nl.prototype.addHalfVertex=function(t,e,r,n,i,a,o){var s=.5*this.scaledDistance;this.layoutVertexArray.emplaceBack((t.x<<1)+(n?1:0),(t.y<<1)+(i?1:0),Math.round(63*e)+128,Math.round(63*r)+128,1+(0===a?0:a<0?-1:1)|(63&s)<<2,s>>6);var u=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,u),o.primitiveLength++),i?this.e2=u:this.e1=u;},nl.prototype.updateScaledDistance=function(){this.scaledDistance=this.totalDistance>0?(this.clipStart+(this.clipEnd-this.clipStart)*this.distance/this.totalDistance)*(rl-1):this.distance;},nl.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.updateScaledDistance();},ri("LineBucket",nl,{omit:["layers","patternFeatures"]});var il=new ha({"line-cap":new sa(Xt.layout_line["line-cap"]),"line-join":new sa(Xt.layout_line["line-join"]),"line-miter-limit":new oa(Xt.layout_line["line-miter-limit"]),"line-round-limit":new oa(Xt.layout_line["line-round-limit"]),"line-sort-key":new sa(Xt.layout_line["line-sort-key"]),"allow-clip":new oa(Xt.layout_line["allow-clip"]),"esymbol-id":new sa(Xt.layout_line["esymbol-id"])}),al={paint:new ha({"line-opacity":new sa(Xt.paint_line["line-opacity"]),"line-color":new sa(Xt.paint_line["line-color"]),"line-translate":new oa(Xt.paint_line["line-translate"]),"line-translate-anchor":new oa(Xt.paint_line["line-translate-anchor"]),"line-width":new sa(Xt.paint_line["line-width"]),"line-gap-width":new sa(Xt.paint_line["line-gap-width"]),"line-offset":new sa(Xt.paint_line["line-offset"]),"line-blur":new sa(Xt.paint_line["line-blur"]),"line-dasharray":new ua(Xt.paint_line["line-dasharray"]),"line-pattern":new ua(Xt.paint_line["line-pattern"]),"line-pattern-mode":new sa(Xt.paint_line["line-pattern-mode"]),"line-pattern-color":new oa(Xt.paint_line["line-pattern-color"]),"line-gradient":new pa(Xt.paint_line["line-gradient"]),"line-outline-pattern":new ua(Xt.paint_line["line-outline-pattern"]),"line-outline-color":new sa(Xt.paint_line["line-outline-color"]),"line-outline-width":new sa(Xt.paint_line["line-outline-width"]),"line-outline-dasharray":new ua(Xt.paint_line["line-outline-dasharray"]),"line-minzoom":new sa(Xt.paint_line["line-minzoom"]),"line-maxzoom":new sa(Xt.paint_line["line-maxzoom"])}),layout:il},ol=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 Qi(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),t.prototype.possiblyEvaluate.call(this,e,r)},e.prototype.evaluate=function(e,r,n,i){return r=c({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,n,i)},e}(sa))(al.paint.properties["line-width"].specification);ol.useIntegerZoom=!0;var sl=function(t){function e(e){e&&e.layout&&"eline"==e.type&&e.layout["esymbol-id"]&&(e.paint["line-pattern"]=e.layout["esymbol-id"]),t.call(this,e,al);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&this._updateGradient();},e.prototype._updateGradient=function(){this.gradient=Zs(this._transitionablePaint._values["line-gradient"].value.expression,"lineProgress"),this.gradientTexture=null;},e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r),this.paint._values["line-floorwidth"]=ol.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e),this.paint._values["line-outline-floorwidth"]=ol.possiblyEvaluate(this._transitioningPaint._values["line-outline-width"].value,e);},e.prototype.createBucket=function(t){return new nl(t)},e.prototype.queryRadius=function(t){var e=t,r=ul(Math.max(es("line-width",this,e),es("line-outline-width",this,e)),es("line-gap-width",this,e)),n=es("line-offset",this,e);return r/2+Math.abs(n)+rs(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,a,o,s){var u=ns(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),o.angle,s),l=s/2*ul(this.paint.get("line-width").evaluate(e,r)+this.paint.get("line-outline-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),p=this.paint.get("line-offset").evaluate(e,r);return p&&(n=function(t,e){for(var r=[],n=new i(0,0),a=0;a<t.length;a++){for(var o=t[a],s=[],u=0;u<o.length;u++){var l=o[u],p=o[u+1],h=0===u?n:l.sub(o[u-1])._unit()._perp(),c=u===o.length-1?n:p.sub(l)._unit()._perp(),f=h._add(c)._unit();f._mult(1/(f.x*c.x+f.y*c.y)),s.push(f._mult(e)._add(l));}r.push(s);}return r}(n,p*s)),function(t,e,r){for(var n=0;n<e.length;n++){var i=e[n];if(t.length>=3)for(var a=0;a<i.length;a++)if($o(t,i[a]))return !0;if(Xo(t,i,r))return !0}return !1}(u,n,l)},e.prototype.isTileClipped=function(){return !0},e}(ca);function ul(t,e){return e>0?e+2*t:t}var ll=ma([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),pl=ma([{name:"a_projected_pos",components:3,type:"Float32"}],4),hl=(ma([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),ma([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),cl=(ma([{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"}]),ma([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),fl=ma([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function yl(t,e,r){return t.sections.forEach((function(t){t.text=function(t,e,r){var n=e.layout.get("text-transform").evaluate(r,{});return "uppercase"===n?t=t.toLocaleUpperCase():"lowercase"===n&&(t=t.toLocaleLowerCase()),Hi.applyArabicShaping&&(t=Hi.applyArabicShaping(t)),t}(t.text,e,r);})),t}ma([{name:"triangle",components:3,type:"Uint16"}]),ma([{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"}]),ma([{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"}]),ma([{type:"Float32",name:"offsetX"}]),ma([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var dl={"!":"︕","#":"",$:"","%":"","&":"","(":"︵",")":"︶","*":"","+":"",",":"︐","-":"︲",".":"・","/":"",":":"︓",";":"︔","<":"︿","=":"",">":"﹀","?":"︖","@":"","[":"﹇","\\":"","]":"﹈","^":"",_:"︳","`":"","{":"︷","|":"―","}":"︸","~":"","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","":"︲","—":"︱","":"﹃","":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","":"︹","":"︺","〖":"︗","〗":"︘","":"︕","":"︵","":"︶","":"︐","":"︲","":"・","":"︓","":"︔","":"︿","":"﹀","":"︖","":"﹇","":"﹈","_":"︳","":"︷","":"―","":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},ml=function(t,e,r,n,i){var a,o,s=8*i-n-1,u=(1<<s)-1,l=u>>1,p=-7,h=r?i-1:0,c=r?-1:1,f=t[e+h];for(h+=c,a=f&(1<<-p)-1,f>>=-p,p+=s;p>0;a=256*a+t[e+h],h+=c,p-=8);for(o=a&(1<<-p)-1,a>>=-p,p+=n;p>0;o=256*o+t[e+h],h+=c,p-=8);if(0===a)a=1-l;else {if(a===u)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,n),a-=l;}return (f?-1:1)*o*Math.pow(2,a-n)},vl=function(t,e,r,n,i,a){var o,s,u,l=8*a-i-1,p=(1<<l)-1,h=p>>1,c=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:a-1,y=n?1:-1,d=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=p):(o=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-o))<1&&(o--,u*=2),(e+=o+h>=1?c/u:c*Math.pow(2,1-h))*u>=2&&(o++,u/=2),o+h>=p?(s=0,o=p):o+h>=1?(s=(e*u-1)*Math.pow(2,i),o+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[r+f]=255&s,f+=y,s/=256,i-=8);for(o=o<<i|s,l+=i;l>0;t[r+f]=255&o,f+=y,o/=256,l-=8);t[r+f-y]|=128*d;},gl=xl;function xl(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length;}xl.Varint=0,xl.Fixed64=1,xl.Bytes=2,xl.Fixed32=5;var bl="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function wl(t){return t.type===xl.Bytes?t.readVarint()+t.pos:t.pos+1}function _l(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Al(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i];}function Sl(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r]);}function zl(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r]);}function Il(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r]);}function kl(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r]);}function Ml(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r]);}function Pl(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r]);}function Vl(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 Tl(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r]);}function El(t,e){return (t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function Bl(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24;}function Dl(t,e){return (t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function Ll(t,e,r){1===t&&r.readMessage(Fl,e);}function Fl(t,e,r){if(3===t){var n=r.readMessage(Rl,{}),i=n.width,a=n.height,o=n.left,s=n.top,u=n.advance;e.push({id:n.id,bitmap:new Us({width:i+6,height:a+6},n.bitmap),metrics:{width:i,height:a,left:o,top:s,advance:u}});}}function Rl(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 Ol(t){for(var e=0,r=0,n=0,i=t;n<i.length;n+=1){var a=i[n];e+=a.w*a.h,r=Math.max(r,a.w);}t.sort((function(t,e){return e.h-t.h}));for(var o=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}],s=0,u=0,l=0,p=t;l<p.length;l+=1)for(var h=p[l],c=o.length-1;c>=0;c--){var f=o[c];if(!(h.w>f.w||h.h>f.h)){if(h.x=f.x,h.y=f.y,u=Math.max(u,h.y+h.h),s=Math.max(s,h.x+h.w),h.w===f.w&&h.h===f.h){var y=o.pop();c<o.length&&(o[c]=y);}else h.h===f.h?(f.x+=h.w,f.w-=h.w):h.w===f.w?(f.y+=h.h,f.h-=h.h):(o.push({x:f.x+h.w,y:f.y,w:f.w-h.w,h:h.h}),f.y+=h.h,f.h-=h.h);break}}return {w:s,h:u,fill:e/(s*u)||0}}xl.prototype={destroy:function(){this.buf=null;},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,a=this.pos;this.type=7&n,t(i,e,this),this.pos===a&&this.skip(n);}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=El(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Dl(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=El(this.buf,this.pos)+4294967296*El(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=El(this.buf,this.pos)+4294967296*Dl(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=ml(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=ml(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,i,a=r.buf;if(n=(112&(i=a[r.pos++]))>>4,i<128)return _l(t,n,e);if(n|=(127&(i=a[r.pos++]))<<3,i<128)return _l(t,n,e);if(n|=(127&(i=a[r.pos++]))<<10,i<128)return _l(t,n,e);if(n|=(127&(i=a[r.pos++]))<<17,i<128)return _l(t,n,e);if(n|=(127&(i=a[r.pos++]))<<24,i<128)return _l(t,n,e);if(n|=(1&(i=a[r.pos++]))<<31,i<128)return _l(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&bl?function(t,e,r){return bl.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){for(var n="",i=e;i<r;){var a,o,s,u=t[i],l=null,p=u>239?4:u>223?3:u>191?2:1;if(i+p>r)break;1===p?u<128&&(l=u):2===p?128==(192&(a=t[i+1]))&&(l=(31&u)<<6|63&a)<=127&&(l=null):3===p?(o=t[i+2],128==(192&(a=t[i+1]))&&128==(192&o)&&((l=(15&u)<<12|(63&a)<<6|63&o)<=2047||l>=55296&&l<=57343)&&(l=null)):4===p&&(o=t[i+2],s=t[i+3],128==(192&(a=t[i+1]))&&128==(192&o)&&128==(192&s)&&((l=(15&u)<<18|(63&a)<<12|(63&o)<<6|63&s)<=65535||l>=1114112)&&(l=null)),null===l?(l=65533,p=1):l>65535&&(l-=65536,n+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),n+=String.fromCharCode(l),i+=p;}return n}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==xl.Bytes)return t.push(this.readVarint(e));var r=wl(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==xl.Bytes)return t.push(this.readSVarint());var e=wl(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==xl.Bytes)return t.push(this.readBoolean());var e=wl(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==xl.Bytes)return t.push(this.readFloat());var e=wl(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==xl.Bytes)return t.push(this.readDouble());var e=wl(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==xl.Bytes)return t.push(this.readFixed32());var e=wl(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==xl.Bytes)return t.push(this.readSFixed32());var e=wl(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==xl.Bytes)return t.push(this.readFixed64());var e=wl(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==xl.Bytes)return t.push(this.readSFixed64());var e=wl(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===xl.Varint)for(;this.buf[this.pos++]>127;);else if(e===xl.Bytes)this.pos=this.readVarint()+this.pos;else if(e===xl.Fixed32)this.pos+=4;else {if(e!==xl.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),Bl(this.buf,t,this.pos),this.pos+=4;},writeSFixed32:function(t){this.realloc(4),Bl(this.buf,t,this.pos),this.pos+=4;},writeFixed64:function(t){this.realloc(8),Bl(this.buf,-1&t,this.pos),Bl(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8;},writeSFixed64:function(t){this.realloc(8),Bl(this.buf,-1&t,this.pos),Bl(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,n;if(t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,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)))));}(n,e);}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))));},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t);},writeBoolean:function(t){this.writeVarint(Boolean(t));},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var n,i,a=0;a<e.length;a++){if((n=e.charCodeAt(a))>55295&&n<57344){if(!i){n>56319||a+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):i=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null;}else i&&(t[r++]=239,t[r++]=191,t[r++]=189,i=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128);}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&Al(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r;},writeFloat:function(t){this.realloc(4),vl(this.buf,t,this.pos,!0,23,4),this.pos+=4;},writeDouble:function(t){this.realloc(8),vl(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 n=this.pos-r;n>=128&&Al(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n;},writeMessage:function(t,e,r){this.writeTag(t,xl.Bytes),this.writeRawMessage(e,r);},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Sl,e);},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,zl,e);},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Ml,e);},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Il,e);},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,kl,e);},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Pl,e);},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Vl,e);},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Cl,e);},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Tl,e);},writeBytesField:function(t,e){this.writeTag(t,xl.Bytes),this.writeBytes(e);},writeFixed32Field:function(t,e){this.writeTag(t,xl.Fixed32),this.writeFixed32(e);},writeSFixed32Field:function(t,e){this.writeTag(t,xl.Fixed32),this.writeSFixed32(e);},writeFixed64Field:function(t,e){this.writeTag(t,xl.Fixed64),this.writeFixed64(e);},writeSFixed64Field:function(t,e){this.writeTag(t,xl.Fixed64),this.writeSFixed64(e);},writeVarintField:function(t,e){this.writeTag(t,xl.Varint),this.writeVarint(e);},writeSVarintField:function(t,e){this.writeTag(t,xl.Varint),this.writeSVarint(e);},writeStringField:function(t,e){this.writeTag(t,xl.Bytes),this.writeString(e);},writeFloatField:function(t,e){this.writeTag(t,xl.Fixed32),this.writeFloat(e);},writeDoubleField:function(t,e){this.writeTag(t,xl.Fixed64),this.writeDouble(e);},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e));}};var jl=function(t,e){var r=e.pixelRatio,n=e.version,i=e.stretchX,a=e.stretchY,o=e.content;this.paddedRect=t,this.pixelRatio=r,this.stretchX=i,this.stretchY=a,this.content=o,this.version=n;},Ul={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};Ul.tl.get=function(){return [this.paddedRect.x+1,this.paddedRect.y+1]},Ul.br.get=function(){return [this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},Ul.tlbr.get=function(){return this.tl.concat(this.br)},Ul.displaySize.get=function(){return [(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(jl.prototype,Ul);var ql=function(t,e){var r={},n={};this.haveRenderCallbacks=[];var i=[];this.addImages(t,r,i),this.addImages(e,n,i);var a=Ol(i),o=new qs({width:a.w||1,height:a.h||1});for(var s in t){var u=t[s],l=r[s].paddedRect;qs.copy(u.data,o,{x:0,y:0},{x:l.x+1,y:l.y+1},u.data);}for(var p in e){var h=e[p],c=n[p].paddedRect,f=c.x+1,y=c.y+1,d=h.data.width,m=h.data.height;qs.copy(h.data,o,{x:0,y:0},{x:f,y:y},h.data),qs.copy(h.data,o,{x:0,y:m-1},{x:f,y:y-1},{width:d,height:1}),qs.copy(h.data,o,{x:0,y:0},{x:f,y:y+m},{width:d,height:1}),qs.copy(h.data,o,{x:d-1,y:0},{x:f-1,y:y},{width:1,height:m}),qs.copy(h.data,o,{x:0,y:0},{x:f+d,y:y},{width:1,height:m});}this.image=o,this.iconPositions=r,this.patternPositions=n;};ql.prototype.addImages=function(t,e,r){for(var n in t){var i=t[n],a={x:0,y:0,w:i.data.width+2,h:i.data.height+2};r.push(a),e[n]=new jl(a,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(n);}},ql.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);},ql.prototype.patchUpdatedImage=function(t,e,r){if(t&&e&&t.version!==e.version){t.version=e.version;var n=t.tl;r.update(e.data,void 0,{x:n[0],y:n[1]});}},ri("ImagePosition",jl),ri("ImageAtlas",ql);var Nl={horizontal:1,vertical:2,horizontalOnly:3},Zl=function(){this.scale=1,this.fontStack="",this.imageName=null;};Zl.forText=function(t,e){var r=new Zl;return r.scale=t||1,r.fontStack=e,r},Zl.forImage=function(t){var e=new Zl;return e.imageName=t,e};var Gl=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null;};function Yl(t,e,r,n,i,a,o,s,u,l,p,h,c,f,y,d){var m,v=Gl.fromFeature(t,i);h===Nl.vertical&&v.verticalizePunctuation();var g=Hi.processBidirectionalText,x=Hi.processStyledBidirectionalText;if(g&&1===v.sections.length){m=[];for(var b=0,w=g(v.toString(),$l(v,l,a,e,n,f,y));b<w.length;b+=1){var _=w[b],A=new Gl;A.text=_,A.sections=v.sections;for(var S=0;S<_.length;S++)A.sectionIndex.push(0);m.push(A);}}else if(x){m=[];for(var z=0,I=x(v.text,v.sectionIndex,$l(v,l,a,e,n,f,y));z<I.length;z+=1){var k=I[z],M=new Gl;M.text=k[0],M.sectionIndex=k[1],M.sections=v.sections,m.push(M);}}else m=function(t,e){for(var r=[],n=t.text,i=0,a=0,o=e;a<o.length;a+=1){var s=o[a];r.push(t.substring(i,s)),i=s;}return i<n.length&&r.push(t.substring(i,n.length)),r}(v,$l(v,l,a,e,n,f,y));var P=[],V={positionedLines:P,text:v.toString(),top:p[1],bottom:p[1],left:p[0],right:p[0],writingMode:h,iconsInText:!1,verticalizable:!1};return function(t,e,r,n,i,a,o,s,u,l,p,h){for(var c=0,f=-17,y=0,d=0,m="right"===s?1:"left"===s?0:.5,v=0,g=0,x=i;g<x.length;g+=1){var b=x[g];b.trim();var w=b.getMaxScale(),_=24*(w-1),A={positionedGlyphs:[],lineOffset:0};t.positionedLines[v]=A;var S=A.positionedGlyphs,z=0;if(b.length()){for(var I=0;I<b.length();I++){var k=b.getSection(I),M=b.getSectionIndex(I),P=b.getCharCode(I),V=0,C=null,T=null,E=null,B=24,D=!(u===Nl.horizontal||!p&&!Fi(P)||p&&(Xl[P]||(Z=P,li(Z)||pi(Z)||hi(Z)||Vi(Z)||Bi(Z))));if(k.imageName){var L=n[k.imageName];if(!L)continue;E=k.imageName,t.iconsInText=t.iconsInText||!0,T=L.paddedRect;var F=L.displaySize;k.scale=24*k.scale/h,V=_+(24-F[1]*k.scale),B=(C={width:F[0],height:F[1],left:1,top:-3,advance:D?F[1]:F[0],localGlyph:!1}).advance;var R=D?F[0]*k.scale-24*w:F[1]*k.scale-24*w;R>0&&R>z&&(z=R);}else {var O=r[k.fontStack],j=O&&O[P];if(j&&j.rect)T=j.rect,C=j.metrics;else {var U=e[k.fontStack],q=U&&U[P];if(!q)continue;C=q.metrics;}V=24*(w-k.scale);}D?(t.verticalizable=!0,S.push({glyph:P,imageName:E,x:c,y:f+V,vertical:D,scale:k.scale,localGlyph:C.localGlyph,fontStack:k.fontStack,sectionIndex:M,metrics:C,rect:T}),c+=B*k.scale+l):(S.push({glyph:P,imageName:E,x:c,y:f+V,vertical:D,scale:k.scale,localGlyph:C.localGlyph,fontStack:k.fontStack,sectionIndex:M,metrics:C,rect:T}),c+=C.advance*k.scale+l);}0!==S.length&&(y=Math.max(c-l,y),ep(S,0,S.length-1,m,z)),c=0;var N=a*w+z;A.lineOffset=Math.max(z,_),f+=N,d=Math.max(N,d),++v;}else f+=a,++v;}var Z,G=f- -17,Y=tp(o),X=Y.horizontalAlign,K=Y.verticalAlign;(function(t,e,r,n,i,a,o,s,u){var l,p=(e-r)*i;l=a!==o?-s*n- -17:(-n*u+.5)*o;for(var h=0,c=t;h<c.length;h+=1)for(var f=0,y=c[h].positionedGlyphs;f<y.length;f+=1){var d=y[f];d.x+=p,d.y+=l;}})(t.positionedLines,m,X,K,y,d,a,G,i.length),t.top+=-K*G,t.bottom=t.top+G,t.left+=-X*y,t.right=t.left+y;}(V,e,r,n,m,o,s,u,h,l,c,d),!function(t){for(var e=0,r=t;e<r.length;e+=1)if(0!==r[e].positionedGlyphs.length)return !1;return !0}(P)&&V}Gl.fromFeature=function(t,e){for(var r=new Gl,n=0;n<t.sections.length;n++){var i=t.sections[n];i.image?r.addImageSection(i):r.addTextSection(i,e);}return r},Gl.prototype.length=function(){return this.text.length},Gl.prototype.getSection=function(t){return this.sections[this.sectionIndex[t]]},Gl.prototype.getSectionIndex=function(t){return this.sectionIndex[t]},Gl.prototype.getCharCode=function(t){return this.text.charCodeAt(t)},Gl.prototype.verticalizePunctuation=function(){this.text=function(t){for(var e="",r=0;r<t.length;r++){var n=t.charCodeAt(r+1)||null,i=t.charCodeAt(r-1)||null;e+=n&&Ri(n)&&!dl[t[r+1]]||i&&Ri(i)&&!dl[t[r-1]]||!dl[t[r]]?t[r]:dl[t[r]];}return e}(this.text);},Gl.prototype.trim=function(){for(var t=0,e=0;e<this.text.length&&Xl[this.text.charCodeAt(e)];e++)t++;for(var r=this.text.length,n=this.text.length-1;n>=0&&n>=t&&Xl[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r);},Gl.prototype.substring=function(t,e){var r=new Gl;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},Gl.prototype.toString=function(){return this.text},Gl.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,r){return Math.max(e,t.sections[r].scale)}),0)},Gl.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(Zl.forText(t.scale,t.fontStack||e));for(var r=this.sections.length-1,n=0;n<t.text.length;++n)this.sectionIndex.push(r);},Gl.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(Zl.forImage(e)),this.sectionIndex.push(this.sections.length-1)):S("Reached maximum number of images 6401");}else S("Can't add FormattedSection with an empty image.");},Gl.prototype.getNextImageSectionCharCode=function(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var Xl={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Kl={};function Jl(t,e,r,n,i,a){if(e.imageName){var o=n[e.imageName];return o?o.displaySize[0]*e.scale*24/a+i:0}var s=r[e.fontStack],u=s&&s[t];return u?u.metrics.advance*e.scale+i:0}function Hl(t,e,r,n){var i=Math.pow(t-e,2);return n?t<e?i/2:2*i:i+Math.abs(r)*r}function Ql(t,e,r){var n=0;return 10===t&&(n-=1e4),r&&(n+=150),40!==t&&65288!==t||(n+=50),41!==e&&65289!==e||(n+=50),n}function Wl(t,e,r,n,i,a){for(var o=null,s=Hl(e,r,i,a),u=0,l=n;u<l.length;u+=1){var p=l[u],h=Hl(e-p.x,r,i,a)+p.badness;h<=s&&(o=p,s=h);}return {index:t,x:e,priorBreak:o,badness:s}}function $l(t,e,r,n,i,a,o){if("point"!==a)return [];if(!t)return [];for(var s,u=[],l=function(t,e,r,n,i,a){for(var o=0,s=0;s<t.length();s++){var u=t.getSection(s);o+=Jl(t.getCharCode(s),u,n,i,e,a);}return o/Math.max(1,Math.ceil(o/r))}(t,e,r,n,i,o),p=t.text.indexOf("")>=0,h=0,c=0;c<t.length();c++){var f=t.getSection(c),y=t.getCharCode(c);if(Xl[y]||(h+=Jl(y,f,n,i,e,o)),c<t.length()-1){var d=!((s=y)<11904||!(xi(s)||gi(s)||Ti(s)||Pi(s)||Ai(s)||ci(s)||bi(s)||di(s)||Si(s)||zi(s)||_i(s)||Di(s)||mi(s)||yi(s)||fi(s)||wi(s)||vi(s)||Ci(s)||ki(s)||Ii(s)));(Kl[y]||d||f.imageName)&&u.push(Wl(c+1,h,l,u,Ql(y,t.getCharCode(c+1),d&&p),!1));}}return function t(e){return e?t(e.priorBreak).concat(e.index):[]}(Wl(t.length(),h,l,u,0,!0))}function tp(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 ep(t,e,r,n,i){if(n||i)for(var a=t[r],o=(t[r].x+a.metrics.advance*a.scale)*n,s=e;s<=r;s++)t[s].x-=o,t[s].y+=i;}function rp(t,e,r,n,i,a){var o,s=t.image;if(s.content){var u=s.content,l=s.pixelRatio||1;o=[u[0]/l,u[1]/l,s.displaySize[0]-u[2]/l,s.displaySize[1]-u[3]/l];}var p,h,c,f,y=e.left*a,d=e.right*a;"width"===r||"both"===r?(f=i[0]+y-n[3],h=i[0]+d+n[1]):h=(f=i[0]+(y+d-s.displaySize[0])/2)+s.displaySize[0];var m=e.top*a,v=e.bottom*a;return "height"===r||"both"===r?(p=i[1]+m-n[0],c=i[1]+v+n[2]):c=(p=i[1]+(m+v-s.displaySize[1])/2)+s.displaySize[1],{image:s,top:p,right:h,bottom:c,left:f,collisionPadding:o}}Kl[10]=!0,Kl[32]=!0,Kl[38]=!0,Kl[40]=!0,Kl[41]=!0,Kl[43]=!0,Kl[45]=!0,Kl[47]=!0,Kl[173]=!0,Kl[183]=!0,Kl[8203]=!0,Kl[8208]=!0,Kl[8211]=!0,Kl[8231]=!0;var np=function(t){function e(e,r,n,i){t.call(this,e,r),this.angle=n,void 0!==i&&(this.segment=i);}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}(i);function ip(t,e){var r=e.expression;if("constant"===r.kind)return {kind:"constant",layoutSize:r.evaluate(new Qi(t+1))};if("source"===r.kind)return {kind:"source"};for(var n=r.zoomStops,i=r.interpolationType,a=0;a<n.length&&n[a]<=t;)a++;for(var o=a=Math.max(0,a-1);o<n.length&&n[o]<t+1;)o++;o=Math.min(n.length-1,o);var s=n[a],u=n[o];return "composite"===r.kind?{kind:"composite",minZoom:s,maxZoom:u,interpolationType:i}:{kind:"camera",minZoom:s,maxZoom:u,minSize:r.evaluate(new Qi(s)),maxSize:r.evaluate(new Qi(u)),interpolationType:i}}function ap(t,e,r){var n=e.uSize,i=r.lowerSize;return "source"===t.kind?i/128:"composite"===t.kind?ur(i/128,r.upperSize/128,e.uSizeT):n}function op(t,e){var r=0,n=0;if("constant"===t.kind)n=t.layoutSize;else if("source"!==t.kind){var i=t.interpolationType,a=i?u(Ar.interpolationFactor(i,e,t.minZoom,t.maxZoom),0,1):0;"camera"===t.kind?n=ur(t.minSize,t.maxSize,a):r=a;}return {uSizeT:r,uSize:n}}ri("Anchor",np);var sp=Object.freeze({__proto__:null,getSizeData:ip,evaluateSizeForFeature:ap,evaluateSizeForZoom:op,SIZE_PACK_FACTOR:128});function up(t,e,r,n,i){if(void 0===e.segment)return !0;for(var a=e,o=e.segment+1,s=0;s>-r/2;){if(--o<0)return !1;s-=t[o].dist(a),a=t[o];}s+=t[o].dist(t[o+1]),o++;for(var u=[],l=0;s<r/2;){var p=t[o],h=t[o+1];if(!h)return !1;var c=t[o-1].angleTo(p)-p.angleTo(h);for(c=Math.abs((c+3*Math.PI)%(2*Math.PI)-Math.PI),u.push({distance:s,angleDelta:c}),l+=c;s-u[0].distance>n;)l-=u.shift().angleDelta;if(l>i)return !1;o++,s+=p.dist(h);}return !0}function lp(t){for(var e=0,r=0;r<t.length-1;r++)e+=t[r].dist(t[r+1]);return e}function pp(t,e,r){return t?.6*e*r:0}function hp(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function cp(t,e,r,n,i,a){for(var o=pp(r,i,a),s=hp(r,n)*a,u=0,l=lp(t)/2,p=0;p<t.length-1;p++){var h=t[p],c=t[p+1],f=h.dist(c);if(u+f>l){var y=(l-u)/f,d=ur(h.x,c.x,y),m=ur(h.y,c.y,y),v=new np(d,m,c.angleTo(h),p);return v._round(),!o||up(t,v,s,o,e)?v:void 0}u+=f;}}function fp(t,e,r,n,i,a,o,s,u){var l=pp(n,a,o),p=hp(n,i),h=p*o,c=0===t[0].x||t[0].x===u||0===t[0].y||t[0].y===u;return e-h<e/4&&(e=h+e/4),function t(e,r,n,i,a,o,s,u,l){for(var p=o/2,h=lp(e),c=0,f=r-n,y=[],d=0;d<e.length-1;d++){for(var m=e[d],v=e[d+1],g=m.dist(v),x=v.angleTo(m);f+n<c+g;){var b=((f+=n)-c)/g,w=ur(m.x,v.x,b),_=ur(m.y,v.y,b);if(w>=0&&w<l&&_>=0&&_<l&&f-p>=0&&f+p<=h){var A=new np(w,_,x,d);A._round(),i&&!up(e,A,o,i,a)||y.push(A);}}c+=g;}return u||y.length||s||(y=t(e,c/2,n,i,a,o,s,!0,l)),y}(t,c?e/2*s%e:(p/2+2*a)*o*s%e,e,l,r,h,c,!1,u)}function yp(t,e,r,n,a){for(var o=[],s=0;s<t.length;s++)for(var u=t[s],l=void 0,p=0;p<u.length-1;p++){var h=u[p],c=u[p+1];h.x<e&&c.x<e||(h.x<e?h=new i(e,h.y+(e-h.x)/(c.x-h.x)*(c.y-h.y))._round():c.x<e&&(c=new i(e,h.y+(e-h.x)/(c.x-h.x)*(c.y-h.y))._round()),h.y<r&&c.y<r||(h.y<r?h=new i(h.x+(r-h.y)/(c.y-h.y)*(c.x-h.x),r)._round():c.y<r&&(c=new i(h.x+(r-h.y)/(c.y-h.y)*(c.x-h.x),r)._round()),h.x>=n&&c.x>=n||(h.x>=n?h=new i(n,h.y+(n-h.x)/(c.x-h.x)*(c.y-h.y))._round():c.x>=n&&(c=new i(n,h.y+(n-h.x)/(c.x-h.x)*(c.y-h.y))._round()),h.y>=a&&c.y>=a||(h.y>=a?h=new i(h.x+(a-h.y)/(c.y-h.y)*(c.x-h.x),a)._round():c.y>=a&&(c=new i(h.x+(a-h.y)/(c.y-h.y)*(c.x-h.x),a)._round()),l&&h.equals(l[l.length-1])||o.push(l=[h]),l.push(c)))));}return o}var dp=gp,mp=gp,vp=1e20;function gp(t,e,r,n,i,a){this.fontSize=t||24,this.buffer=void 0===e?3:e,this.cutoff=n||.25,this.fontFamily=i||"sans-serif",this.fontWeight=a||"normal",this.radius=r||8;var o=this.size=this.fontSize+2*this.buffer,s=o+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=o,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textAlign="left",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(s*s),this.gridInner=new Float64Array(s*s),this.f=new Float64Array(s),this.z=new Float64Array(s+1),this.v=new Uint16Array(s),this.useMetrics=void 0!==this.ctx.measureText("A").actualBoundingBoxLeft,this.middle=Math.round(o/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1));}function xp(t,e,r,n,i,a){for(var o=0;o<e;o++)bp(t,o,e,r,n,i,a);for(var s=0;s<r;s++)bp(t,s*e,1,e,n,i,a);}function bp(t,e,r,n,i,a,o){var s,u,l,p;for(a[0]=0,o[0]=-vp,o[1]=vp,s=0;s<n;s++)i[s]=t[e+s*r];for(s=1,u=0,l=0;s<n;s++){do{l=(i[s]-i[p=a[u]]+s*s-p*p)/(s-p)/2;}while(l<=o[u]&&--u>-1);a[++u]=s,o[u]=l,o[u+1]=vp;}for(s=0,u=0;s<n;s++){for(;o[u+1]<s;)u++;t[e+s*r]=i[p=a[u]]+(s-p)*(s-p);}}gp.prototype._draw=function(t,e){var r,n,i,a,o,s,u,l,p,h=this.ctx.measureText(t),c=h.width,f=2*this.buffer;e&&this.useMetrics?(o=Math.floor(h.actualBoundingBoxAscent),l=this.buffer+Math.ceil(h.actualBoundingBoxAscent),s=this.buffer,u=this.buffer,r=(n=Math.min(this.size,Math.ceil(h.actualBoundingBoxRight-h.actualBoundingBoxLeft)))+f,i=(a=Math.min(this.size-s,Math.ceil(h.actualBoundingBoxAscent+h.actualBoundingBoxDescent)))+f,this.ctx.textBaseline="alphabetic"):(r=n=this.size,i=a=this.size,o=19*this.fontSize/24,s=u=0,l=this.middle,this.ctx.textBaseline="middle"),n&&a&&(this.ctx.clearRect(u,s,n,a),this.ctx.fillText(t,this.buffer,l),p=this.ctx.getImageData(u,s,n,a));var y=new Uint8ClampedArray(r*i);return function(t,e,r,n,i,a,o){a.fill(vp,0,e*r),o.fill(0,0,e*r);for(var s=(e-n)/2,u=0;u<i;u++)for(var l=0;l<n;l++){var p=(u+s)*e+l+s,h=t.data[4*(u*n+l)+3]/255;if(1===h)a[p]=0,o[p]=vp;else if(0===h)a[p]=vp,o[p]=0;else {var c=Math.max(0,.5-h),f=Math.max(0,h-.5);a[p]=c*c,o[p]=f*f;}}}(p,r,i,n,a,this.gridOuter,this.gridInner),xp(this.gridOuter,r,i,this.f,this.v,this.z),xp(this.gridInner,r,i,this.f,this.v,this.z),function(t,e,r,n,i,a,o){for(var s=0;s<e*r;s++){var u=Math.sqrt(n[s])-Math.sqrt(i[s]);t[s]=Math.round(255-255*(u/a+o));}}(y,r,i,this.gridOuter,this.gridInner,this.radius,this.cutoff),{data:y,metrics:{width:n,height:a,sdfWidth:r,sdfHeight:i,top:o,left:0,advance:c}}},gp.prototype.draw=function(t){return this._draw(t,!1).data},gp.prototype.drawWithMetrics=function(t){return this._draw(t,!0)},dp.default=mp;var wp={none:0,ideographs:1,all:2},_p=function(t,e,r){this.requestManager=t,this.localGlyphMode=e,this.localFontFamily=r,this.entries={},this.localGlyphs={200:{},400:{},500:{},900:{}};};function Ap(t,e,r,n){var a=[],o=t.image,s=o.pixelRatio,u=o.paddedRect.w-2,l=o.paddedRect.h-2,p=t.right-t.left,h=t.bottom-t.top,c=o.stretchX||[[0,u]],f=o.stretchY||[[0,l]],y=function(t,e){return t+e[1]-e[0]},d=c.reduce(y,0),m=f.reduce(y,0),v=u-d,g=l-m,x=0,b=d,w=0,_=m,A=0,S=v,z=0,I=g;if(o.content&&n){var k=o.content;x=Sp(c,0,k[0]),w=Sp(f,0,k[1]),b=Sp(c,k[0],k[2]),_=Sp(f,k[1],k[3]),A=k[0]-x,z=k[1]-w,S=k[2]-k[0]-b,I=k[3]-k[1]-_;}var M=function(n,a,u,l){var c=Ip(n.stretch-x,b,p,t.left),f=kp(n.fixed-A,S,n.stretch,d),y=Ip(a.stretch-w,_,h,t.top),v=kp(a.fixed-z,I,a.stretch,m),g=Ip(u.stretch-x,b,p,t.left),k=kp(u.fixed-A,S,u.stretch,d),M=Ip(l.stretch-w,_,h,t.top),P=kp(l.fixed-z,I,l.stretch,m),V=new i(c,y),C=new i(g,y),T=new i(g,M),E=new i(c,M),B=new i(f/s,v/s),D=new i(k/s,P/s),L=e*Math.PI/180;if(L){var F=Math.sin(L),R=Math.cos(L),O=[R,-F,F,R];V._matMult(O),C._matMult(O),E._matMult(O),T._matMult(O);}var j=n.stretch+n.fixed,U=a.stretch+a.fixed;return {tl:V,tr:C,bl:E,br:T,tex:{x:o.paddedRect.x+1+j,y:o.paddedRect.y+1+U,w:u.stretch+u.fixed-j,h:l.stretch+l.fixed-U},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:B,pixelOffsetBR:D,minFontScaleX:S/s/p,minFontScaleY:I/s/h,isSDF:r}};if(n&&(o.stretchX||o.stretchY))for(var P=zp(c,v,d),V=zp(f,g,m),C=0;C<P.length-1;C++)for(var T=P[C],E=P[C+1],B=0;B<V.length-1;B++)a.push(M(T,V[B],E,V[B+1]));else a.push(M({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:u+1},{fixed:0,stretch:l+1}));return a}function Sp(t,e,r){for(var n=0,i=0,a=t;i<a.length;i+=1){var o=a[i];n+=Math.max(e,Math.min(r,o[1]))-Math.max(e,Math.min(r,o[0]));}return n}function zp(t,e,r){for(var n=[{fixed:-1,stretch:0}],i=0,a=t;i<a.length;i+=1){var o=a[i],s=o[0],u=o[1],l=n[n.length-1];n.push({fixed:s-l.stretch,stretch:l.stretch}),n.push({fixed:s-l.stretch,stretch:l.stretch+(u-s)});}return n.push({fixed:e+1,stretch:r}),n}function Ip(t,e,r,n){return t/e*r+n}function kp(t,e,r,n){return t-e*r/n}_p.prototype.setURL=function(t){this.url=t;},_p.prototype.getGlyphs=function(t,e){var r=this,n=[];for(var i in t)for(var a=0,o=t[i];a<o.length;a+=1)n.push({stack:i,id:o[a]});p(n,(function(t,e){var n=t.stack,i=t.id,a=r.entries[n];a||(a=r.entries[n]={glyphs:{},requests:{},ranges:{}});var o=a.glyphs[i];if(void 0===o){if(o=r._tinySDF(a,n,i))return a.glyphs[i]=o,void e(null,{stack:n,id:i,glyph:o});var s=Math.floor(i/256);if(256*s>65535)e(new Error("glyphs > 65535 not supported"));else if(a.ranges[s])e(null,{stack:n,id:i,glyph:o});else {var u=a.requests[s];u||(u=a.requests[s]=[],_p.loadGlyphRange(n,s,r.url,r.requestManager,(function(t,e){if(e){for(var n in e)r._doesCharSupportLocalGlyph(+n)||(a.glyphs[+n]=e[+n],n>=19968&&n<=40943&&(a.glyphs[+n].metrics.top=-4));a.ranges[s]=!0;}for(var i=0,o=u;i<o.length;i+=1)(0,o[i])(t,e);delete a.requests[s];}))),u.push((function(t,r){t?e(t):r&&e(null,{stack:n,id:i,glyph:r[i]||null});}));}}else e(null,{stack:n,id:i,glyph:o});}),(function(t,r){if(t)e(t);else if(r){for(var n={},i=0,a=r;i<a.length;i+=1){var o=a[i],s=o.stack,u=o.id,l=o.glyph;(n[s]||(n[s]={}))[u]=l&&{id:l.id,bitmap:l.bitmap.clone(),metrics:l.metrics};}e(null,n);}}));},_p.prototype._doesCharSupportLocalGlyph=function(t){return this.localGlyphMode!==wp.none&&(this.localGlyphMode===wp.all?!!this.localFontFamily:!!this.localFontFamily&&(zi(t)||Mi(t)||mi(t)||vi(t)))},_p.prototype._tinySDF=function(t,e,r){var n=this.localFontFamily;if(n&&this._doesCharSupportLocalGlyph(r)){var i=t.tinySDF;if(!i){var a="400";/bold/i.test(e)?a="900":/medium/i.test(e)?a="500":/light/i.test(e)&&(a="200"),i=t.tinySDF=new _p.TinySDF(48,6,16,.22,n,a);}if(this.localGlyphs[i.fontWeight][r])return this.localGlyphs[i.fontWeight][r];var o=i.drawWithMetrics(String.fromCharCode(r)),s=o.metrics,u=s.width,l=s.height,p=s.left,h=s.top,c=s.advance;return this.localGlyphs[i.fontWeight][r]={id:r,bitmap:new Us({width:s.sdfWidth,height:s.sdfHeight},o.data),metrics:{width:u/2,height:l/2,left:p/2,top:h/2-27+(r>=19968&&r<=40943?4:0),advance:c/2,localGlyph:!0}}}},_p.loadGlyphRange=function(t,e,r,n,i){var a=256*e,o=a+255,s=n.transformRequest(n.normalizeGlyphsURL(r).replace("{fontstack}",t).replace("{range}",a+"-"+o),Et.Glyphs);Ot(s,(function(t,e){if(t)i(t);else if(e){for(var r={},n=0,a=function(t){return new gl(t).readFields(Ll,[])}(e);n<a.length;n+=1){var o=a[n];r[o.id]=o;}i(null,r);}}));},_p.TinySDF=dp;var Mp=function(t,e,r,n,a,o,s,u,l,p){if(this.boxStartIndex=t.length,l){var h=o.top,c=o.bottom,f=o.collisionPadding;f&&(h-=f[1],c+=f[3]);var y=c-h;y>0&&(y=Math.max(10,y),this.circleDiameter=y);}else {var d=o.top*s-u,m=o.bottom*s+u,v=o.left*s-u,g=o.right*s+u,x=o.collisionPadding;if(x&&(v-=x[0]*s,d-=x[1]*s,g+=x[2]*s,m+=x[3]*s),p){var b=new i(v,d),w=new i(g,d),_=new i(v,m),A=new i(g,m),S=p*Math.PI/180;b._rotate(S),w._rotate(S),_._rotate(S),A._rotate(S),v=Math.min(b.x,w.x,_.x,A.x),g=Math.max(b.x,w.x,_.x,A.x),d=Math.min(b.y,w.y,_.y,A.y),m=Math.max(b.y,w.y,_.y,A.y);}t.emplaceBack(e.x,e.y,v,d,g,m,r,n,a);}this.boxEndIndex=t.length;},Pp=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=Vp),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 Vp(t,e){return t<e?-1:t>e?1:0}function Cp(t,e,r){void 0===e&&(e=1),void 0===r&&(r=!1);for(var n=1/0,a=1/0,o=-1/0,s=-1/0,u=t[0],l=0;l<u.length;l++){var p=u[l];(!l||p.x<n)&&(n=p.x),(!l||p.y<a)&&(a=p.y),(!l||p.x>o)&&(o=p.x),(!l||p.y>s)&&(s=p.y);}var h=Math.min(o-n,s-a),c=h/2,f=new Pp([],Tp);if(0===h)return new i(n,a);for(var y=n;y<o;y+=h)for(var d=a;d<s;d+=h)f.push(new Ep(y+c,d+c,c,t));for(var m=function(t){for(var e=0,r=0,n=0,i=t[0],a=0,o=i.length,s=o-1;a<o;s=a++){var u=i[a],l=i[s],p=u.x*l.y-l.x*u.y;r+=(u.x+l.x)*p,n+=(u.y+l.y)*p,e+=3*p;}return new Ep(r/e,n/e,0,t)}(t),v=f.length;f.length;){var g=f.pop();(g.d>m.d||!m.d)&&(m=g,r&&console.log("found best %d after %d probes",Math.round(1e4*g.d)/1e4,v)),g.max-m.d<=e||(f.push(new Ep(g.p.x-(c=g.h/2),g.p.y-c,c,t)),f.push(new Ep(g.p.x+c,g.p.y-c,c,t)),f.push(new Ep(g.p.x-c,g.p.y+c,c,t)),f.push(new Ep(g.p.x+c,g.p.y+c,c,t)),v+=4);}return r&&(console.log("num probes: "+v),console.log("best distance: "+m.d)),m.p}function Tp(t,e){return e.max-t.max}function Ep(t,e,r,n){this.p=new i(t,e),this.h=r,this.d=function(t,e){for(var r=!1,n=1/0,i=0;i<e.length;i++)for(var a=e[i],o=0,s=a.length,u=s-1;o<s;u=o++){var l=a[o],p=a[u];l.y>t.y!=p.y>t.y&&t.x<(p.x-l.x)*(t.y-l.y)/(p.y-l.y)+l.x&&(r=!r),n=Math.min(n,Qo(t,l,p));}return (r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2;}Pp.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1);},Pp.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}},Pp.prototype.peek=function(){return this.data[0]},Pp.prototype._up=function(t){for(var e=this.data,r=this.compare,n=e[t];t>0;){var i=t-1>>1,a=e[i];if(r(n,a)>=0)break;e[t]=a,t=i;}e[t]=n;},Pp.prototype._down=function(t){for(var e=this.data,r=this.compare,n=this.length>>1,i=e[t];t<n;){var a=1+(t<<1),o=e[a],s=a+1;if(s<this.length&&r(e[s],o)<0&&(a=s,o=e[s]),r(o,i)>=0)break;e[t]=o,t=a;}e[t]=i;};var Bp=Number.POSITIVE_INFINITY;function Dp(t,e){return e[1]!==Bp?function(t,e,r){var n=0,i=0;switch(e=Math.abs(e),r=Math.abs(r),t){case"top-right":case"top-left":case"top":i=r-7;break;case"bottom-right":case"bottom-left":case"bottom":i=7-r;}switch(t){case"top-right":case"bottom-right":case"right":n=-e;break;case"top-left":case"bottom-left":case"left":n=e;}return [n,i]}(t,e[0],e[1]):function(t,e){var r=0,n=0;e<0&&(e=0);var i=e/Math.sqrt(2);switch(t){case"top-right":case"top-left":n=i-7;break;case"bottom-right":case"bottom-left":n=7-i;break;case"bottom":n=7-e;break;case"top":n=e-7;}switch(t){case"top-right":case"bottom-right":r=-i;break;case"top-left":case"bottom-left":r=i;break;case"left":r=e;break;case"right":r=-e;}return [r,n]}(t,e[0])}function Lp(t,e,r,n,i,a,o){t.createArrays(),t.tilePixelRatio=8192/(512*t.overscaling),t.compareText={},t.iconsNeedLinear=!1;var s=t.layers[0].layout,u=t.layers[0]._unevaluatedLayout._values,l={};if("composite"===t.textSizeData.kind){var p=t.textSizeData,h=p.maxZoom;l.compositeTextSizes=[u["text-size"].possiblyEvaluate(new Qi(p.minZoom),o),u["text-size"].possiblyEvaluate(new Qi(h),o)];}if("composite"===t.iconSizeData.kind){var c=t.iconSizeData,f=c.maxZoom;l.compositeIconSizes=[u["icon-size"].possiblyEvaluate(new Qi(c.minZoom),o),u["icon-size"].possiblyEvaluate(new Qi(f),o)];}l.layoutTextSize=u["text-size"].possiblyEvaluate(new Qi(t.zoom+1),o),l.layoutIconSize=u["icon-size"].possiblyEvaluate(new Qi(t.zoom+1),o),l.textMaxSize=u["text-size"].possiblyEvaluate(new Qi(18));for(var y=24*s.get("text-line-height"),d="map"===s.get("text-rotation-alignment")&&"point"!==s.get("symbol-placement"),m=s.get("text-keep-upright"),v=s.get("text-size"),g=function(){var a=b[x],u=s.get("text-font").evaluate(a,{},o).join(","),p=v.evaluate(a,{},o),h=l.layoutTextSize.evaluate(a,{},o),c=l.layoutIconSize.evaluate(a,{},o),f={horizontal:{},vertical:void 0},g=a.text,w=[0,0];if(g){var _=g.toString(),A=24*s.get("text-letter-spacing").evaluate(a,{},o),z=function(t){for(var e=0,r=t;e<r.length;e+=1)if(n=r[e].charCodeAt(0),li(n)||pi(n)||hi(n)||Vi(n)||Bi(n))return !1;var n;return !0}(_)?A:0,I=s.get("text-anchor").evaluate(a,{},o),k=s.get("text-variable-anchor");if(!k){var M=s.get("text-radial-offset").evaluate(a,{},o);w=M?Dp(I,[24*M,Bp]):s.get("text-offset").evaluate(a,{},o).map((function(t){return 24*t}));}var P=d?"center":s.get("text-justify").evaluate(a,{},o),V=s.get("symbol-placement"),C="point"===V?24*s.get("text-max-width").evaluate(a,{},o):0,T=function(){t.allowVerticalPlacement&&Li(_)&&(f.vertical=Yl(g,e,r,i,u,C,y,I,"left",z,w,Nl.vertical,!0,V,h,p));};if(!d&&k){for(var E="auto"===P?k.map((function(t){return Fp(t)})):[P],B=!1,D=0;D<E.length;D++){var L=E[D];if(!f.horizontal[L])if(B)f.horizontal[L]=f.horizontal[0];else {var F=Yl(g,e,r,i,u,C,y,"center",L,z,w,Nl.horizontal,!1,V,h,p);F&&(f.horizontal[L]=F,B=1===F.positionedLines.length);}}T();}else {"auto"===P&&(P=Fp(I));var R=Yl(g,e,r,i,u,C,y,I,P,z,w,Nl.horizontal,!1,V,h,p);R&&(f.horizontal[P]=R),T(),Li(_)&&d&&m&&(f.vertical=Yl(g,e,r,i,u,C,y,I,P,z,w,Nl.vertical,!1,V,h,p));}}var O=void 0,j=!1;if(a.icon&&a.icon.name){var U=n[a.icon.name];U&&(O=function(t,e,r){var n=tp(r),i=e[0]-t.displaySize[0]*n.horizontalAlign,a=e[1]-t.displaySize[1]*n.verticalAlign;return {image:t,top:a,bottom:a+t.displaySize[1],left:i,right:i+t.displaySize[0]}}(i[a.icon.name],s.get("icon-offset").evaluate(a,{},o),s.get("icon-anchor").evaluate(a,{},o)),j=U.sdf,void 0===t.sdfIcons?t.sdfIcons=U.sdf:t.sdfIcons!==U.sdf&&S("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 q=Op(f.horizontal)||f.vertical;t.iconsInText=!!q&&q.iconsInText,(q||O)&&function(t,e,r,n,i,a,o,s,u,l,p){var h=a.textMaxSize.evaluate(e,{});void 0===h&&(h=o);var c,f=t.layers[0].layout,y=f.get("icon-offset").evaluate(e,{},p),d=Op(r.horizontal),m=o/24,v=t.tilePixelRatio*m,g=t.tilePixelRatio*h/24,x=t.tilePixelRatio*s,b=t.tilePixelRatio*f.get("symbol-spacing"),w=f.get("text-padding")*t.tilePixelRatio,_=f.get("icon-padding")*t.tilePixelRatio,A=f.get("text-max-angle")/180*Math.PI,z="map"===f.get("text-rotation-alignment")&&"point"!==f.get("symbol-placement"),I="map"===f.get("icon-rotation-alignment")&&"point"!==f.get("symbol-placement"),k=f.get("symbol-placement"),M=b/2,P=f.get("icon-text-fit");n&&"none"!==P&&(t.allowVerticalPlacement&&r.vertical&&(c=rp(n,r.vertical,P,f.get("icon-text-fit-padding"),y,m)),d&&(n=rp(n,d,P,f.get("icon-text-fit-padding"),y,m)));var V=function(s,h){h.x<0||h.x>=8192||h.y<0||h.y>=8192||function(t,e,r,n,i,a,o,s,u,l,p,h,c,f,y,d,m,v,g,x,b,w,_,A,z){var I,k,M,P,V,C=t.addToLineVertexArray(e,r),T=0,E=0,B=0,D=0,L=-1,F=-1,R={},O=ao(""),j=0,U=0;if(void 0===s._unevaluatedLayout.getValue("text-radial-offset")?(j=(I=s.layout.get("text-offset").evaluate(b,{},A).map((function(t){return 24*t})))[0],U=I[1]):(j=24*s.layout.get("text-radial-offset").evaluate(b,{},A),U=Bp),t.allowVerticalPlacement&&n.vertical){var q=s.layout.get("text-rotate").evaluate(b,{},A)+90;P=new Mp(u,e,l,p,h,n.vertical,c,f,y,q),o&&(V=new Mp(u,e,l,p,h,o,m,v,y,q));}if(i){var N=s.layout.get("icon-rotate").evaluate(b,{}),Z="none"!==s.layout.get("icon-text-fit"),G=Ap(i,N,_,Z),Y=o?Ap(o,N,_,Z):void 0;M=new Mp(u,e,l,p,h,i,m,v,!1,N),T=4*G.length;var X=t.iconSizeData,K=null;"source"===X.kind?(K=[128*s.layout.get("icon-size").evaluate(b,{})])[0]>32640&&S(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):"composite"===X.kind&&((K=[128*w.compositeIconSizes[0].evaluate(b,{},A),128*w.compositeIconSizes[1].evaluate(b,{},A)])[0]>32640||K[1]>32640)&&S(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),t.addSymbols(t.icon,G,K,x,g,b,!1,e,C.lineStartIndex,C.lineLength,-1,A),L=t.icon.placedSymbolArray.length-1,Y&&(E=4*Y.length,t.addSymbols(t.icon,Y,K,x,g,b,Nl.vertical,e,C.lineStartIndex,C.lineLength,-1,A),F=t.icon.placedSymbolArray.length-1);}for(var J in n.horizontal){var H=n.horizontal[J];if(!k){O=ao(H.text);var Q=s.layout.get("text-rotate").evaluate(b,{},A);k=new Mp(u,e,l,p,h,H,c,f,y,Q);}var W=1===H.positionedLines.length;if(B+=Rp(t,e,H,a,s,y,b,d,C,n.vertical?Nl.horizontal:Nl.horizontalOnly,W?Object.keys(n.horizontal):[J],R,L,w,A),W)break}n.vertical&&(D+=Rp(t,e,n.vertical,a,s,y,b,d,C,Nl.vertical,["vertical"],R,F,w,A));var $=k?k.boxStartIndex:t.collisionBoxArray.length,tt=k?k.boxEndIndex:t.collisionBoxArray.length,et=P?P.boxStartIndex:t.collisionBoxArray.length,rt=P?P.boxEndIndex:t.collisionBoxArray.length,nt=M?M.boxStartIndex:t.collisionBoxArray.length,it=M?M.boxEndIndex:t.collisionBoxArray.length,at=V?V.boxStartIndex:t.collisionBoxArray.length,ot=V?V.boxEndIndex:t.collisionBoxArray.length,st=-1,ut=function(t,e){return t&&t.circleDiameter?Math.max(t.circleDiameter,e):e};st=ut(k,st),st=ut(P,st),st=ut(M,st);var lt=(st=ut(V,st))>-1?1:0;lt&&(st*=z/24),t.glyphOffsetArray.length>=Kp.MAX_GLYPHS&&S("Too many glyphs being rendered in a tile. See https://github.com/sgmap/sgmap-js/issues/2907"),void 0!==b.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,b.sortKey),t.symbolInstances.emplaceBack(e.x,e.y,R.right>=0?R.right:-1,R.center>=0?R.center:-1,R.left>=0?R.left:-1,R.vertical||-1,L,F,O,$,tt,et,rt,nt,it,at,ot,l,B,D,T,E,lt,0,c,j,U,st);}(t,h,s,r,n,i,c,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,v,w,z,u,x,_,I,y,e,a,l,p,o);};if("line"===k)for(var C=0,T=yp(e.geometry,0,0,8192,8192);C<T.length;C+=1)for(var E=T[C],B=0,D=fp(E,b,A,r.vertical||d,n,24,g,t.overscaling,8192);B<D.length;B+=1){var L=D[B];d&&jp(t,d.text,M,L)||V(E,L);}else if("line-center"===k)for(var F=0,R=e.geometry;F<R.length;F+=1){var O=R[F];if(O.length>1){var j=cp(O,A,r.vertical||d,n,24,g);j&&V(O,j);}}else if("Polygon"===e.type)for(var U=0,q=Iu(e.geometry,0);U<q.length;U+=1){var N=q[U],Z=Cp(N,16);V(N[0],new np(Z.x,Z.y,0));}else if("LineString"===e.type)for(var G=0,Y=e.geometry;G<Y.length;G+=1){var X=Y[G];V(X,new np(X[0].x,X[0].y,0));}else if("Point"===e.type)for(var K=0,J=e.geometry;K<J.length;K+=1)for(var H=0,Q=J[K];H<Q.length;H+=1){var W=Q[H];V([W],new np(W.x,W.y,0));}}(t,a,f,O,n,l,h,c,w,j,o);},x=0,b=t.features;x<b.length;x+=1)g();a&&t.generateCollisionDebugBuffers();}function Fp(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 Rp(t,e,r,n,a,o,s,u,l,p,h,c,f,y,d){var m=function(t,e,r,n,a,o,s,u){for(var l=n.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,p=[],h=0,c=e.positionedLines;h<c.length;h+=1)for(var f=c[h],y=0,d=f.positionedGlyphs;y<d.length;y+=1){var m=d[y];if(m.rect){var v=m.rect||{},g=4,x=!0,b=1,w=0,_=(a||u)&&m.vertical,A=m.metrics.advance*m.scale/2;if(u&&e.verticalizable&&(w=f.lineOffset/2-(m.imageName?-(24-m.metrics.width*m.scale)/2:24*(m.scale-1))),m.imageName){var S=s[m.imageName];x=S.sdf,g=1/(b=S.pixelRatio);}var z=a?[m.x+A,m.y]:[0,0],I=a?[0,0]:[m.x+A+r[0],m.y+r[1]-w],k=[0,0];_&&(k=I,I=[0,0]);var M=(m.metrics.left-g)*m.scale-A+I[0],P=(-m.metrics.top-g)*m.scale+I[1],V=M+v.w*m.scale/(b*(m.localGlyph?2:1)),C=P+v.h*m.scale/(b*(m.localGlyph?2:1)),T=new i(M,P),E=new i(V,P),B=new i(M,C),D=new i(V,C);if(_){var L=new i(-A,A- -17),F=-Math.PI/2,R=12-A,O=new i(22-R,-(m.imageName?R:0)),j=new(Function.prototype.bind.apply(i,[null].concat(k)));T._rotateAround(F,L)._add(O)._add(j),E._rotateAround(F,L)._add(O)._add(j),B._rotateAround(F,L)._add(O)._add(j),D._rotateAround(F,L)._add(O)._add(j);}if(l){var U=Math.sin(l),q=Math.cos(l),N=[q,-U,U,q];T._matMult(N),E._matMult(N),B._matMult(N),D._matMult(N);}var Z=new i(0,0),G=new i(0,0);p.push({tl:T,tr:E,bl:B,br:D,tex:v,writingMode:e.writingMode,glyphOffset:z,sectionIndex:m.sectionIndex,isSDF:x,pixelOffsetTL:Z,pixelOffsetBR:G,minFontScaleX:0,minFontScaleY:0});}}return p}(0,r,u,a,o,s,n,t.allowVerticalPlacement),v=t.textSizeData,g=null;"source"===v.kind?(g=[128*a.layout.get("text-size").evaluate(s,{})])[0]>32640&&S(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):"composite"===v.kind&&((g=[128*y.compositeTextSizes[0].evaluate(s,{},d),128*y.compositeTextSizes[1].evaluate(s,{},d)])[0]>32640||g[1]>32640)&&S(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),t.addSymbols(t.text,m,g,u,o,s,p,e,l.lineStartIndex,l.lineLength,f,d);for(var x=0,b=h;x<b.length;x+=1)c[b[x]]=t.text.placedSymbolArray.length-1;return 4*m.length}function Op(t){for(var e in t)return t[e];return null}function jp(t,e,r,n){var i=t.compareText;if(e in i){for(var a=i[e],o=a.length-1;o>=0;o--)if(n.dist(a[o])<r)return !0}else i[e]=[];return i[e].push(n),!1}var Up=Nu.VectorTileFeature.types,qp=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Np(t,e,r,n,i,a,o,s,u,l,p,h,c){var f=s?Math.min(32640,Math.round(s[0])):0,y=s?Math.min(32640,Math.round(s[1])):0;t.emplaceBack(e,r,Math.round(32*n),Math.round(32*i),a,o,(f<<1)+(u?1:0),y,16*l,16*p,256*h,256*c);}function Zp(t,e,r,n){n&&(r=-1*(r+100)),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 Gp(t){for(var e=0,r=t.sections;e<r.length;e+=1)if(Ui(r[e].text))return !0;return !1}var Yp=function(t){this.layoutVertexArray=new za,this.indexArray=new Ta,this.programConfigurations=t,this.segments=new $a,this.dynamicLayoutVertexArray=new Ia,this.opacityVertexArray=new ka,this.placedSymbolArray=new Ga;};Yp.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length},Yp.prototype.upload=function(t,e,r,n){this.isEmpty()||(r&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ll.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,pl.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,qp,!0),this.opacityVertexBuffer.itemSize=1),(r||n)&&this.programConfigurations.upload(t));},Yp.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy());},ri("SymbolBuffers",Yp);var Xp=function(t,e,r){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new r,this.segments=new $a,this.collisionVertexArray=new Ca;};Xp.prototype.upload=function(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,hl.members,!0);},Xp.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy());},ri("CollisionBuffers",Xp);var Kp=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=ps([]),this.placementViewportMatrix=ps([]);var e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=ip(this.zoom,e["text-size"]),this.iconSizeData=ip(this.zoom,e["icon-size"]);var r=this.layers[0].layout,n=r.get("symbol-sort-key"),i=r.get("symbol-z-order");this.sortFeaturesByKey="viewport-y"!==i&&void 0!==n.constantOr(1),this.sortFeaturesByY=("viewport-y"===i||"auto"===i&&!this.sortFeaturesByKey)&&(r.get("text-allow-overlap")||r.get("icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement")),"point"===r.get("symbol-placement")&&(this.writingModes=r.get("text-writing-mode").map((function(t){return Nl[t]}))),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id})),this.sourceID=t.sourceID,this.feature_values={};};function Jp(t,e){return e.replace(/{([^{}]+)}/g,(function(e,r){return r in t?String(t[r]):""}))}Kp.prototype.createArrays=function(){this.text=new Yp(new Mo(ll.members,this.layers,this.zoom,(function(t){return /^text/.test(t)||/symbol-minzoom/.test(t)||/symbol-maxzoom/.test(t)}))),this.icon=new Yp(new Mo(ll.members,this.layers,this.zoom,(function(t){return /^icon/.test(t)||/symbol-minzoom/.test(t)||/symbol-maxzoom/.test(t)}))),this.glyphOffsetArray=new Ka,this.lineVertexArray=new Ja,this.symbolInstances=new Xa;},Kp.prototype.calculateGlyphDependencies=function(t,e,r,n,i){for(var a=0;a<t.length;a++)if(e[t.charCodeAt(a)]=!0,(r||n)&&i){var o=dl[t.charAt(a)];o&&(e[o.charCodeAt(0)]=!0);}},Kp.prototype.populate=function(t,e,r){var n=this.layers[0],i=n.layout,a=n.paint,o=i.get("text-font"),s=i.get("text-field"),u=i.get("icon-image"),l=("constant"!==s.value.kind||s.value.value instanceof we&&!s.value.value.isEmpty()||s.value.value.toString().length>0)&&("constant"!==o.value.kind||o.value.value.length>0),p="constant"!==u.value.kind||!!u.value.value||Object.keys(u.parameters).length>0,h=i.get("symbol-sort-key");this.features=[],this.feature_values=[];var c=a.get("symbol-minzoom"),f=a.get("symbol-maxzoom");if(l||p){for(var y=e.iconDependencies,d=e.glyphDependencies,m=e.availableImages,v=new Qi(this.zoom),g=0,x=t.length;g<x;g+=1){var b=t[g],w=b.feature,_=b.id,A=b.index,S=b.sourceLayerIndex,z=I?Uo(w):[],I=n._featureFilter.needGeometry,k={type:w.type,id:_,properties:w.properties,geometry:z};if(n._featureFilter.filter(v,k,r)){I||(z=!I&&Uo(w),k.geometry=z);var M=void 0;if(l){var P=n.getValueAndResolveTokens("text-field",k,r,m),V=we.factory(P);Gp(V)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===Ki()||this.hasRTLText&&Hi.isParsed())&&(M=yl(V,n,k));}var C=void 0;if(p){var T=n.getValueAndResolveTokens("icon-image",k,r,m);C=T instanceof _e?T:_e.fromString(T);}if(M||C){var E=this.sortFeaturesByKey?h.evaluate(k,{},r):void 0;if(this.features.push({id:_,text:M,icon:C,index:A,sourceLayerIndex:S,geometry:z,properties:w.properties,type:Up[w.type],sortKey:E}),c&&f&&0!=c.constantOr(1)&&24!=f.constantOr(1)){var B=c.evaluate(k),D=f.evaluate(k);this.feature_values.push([A,B=B<=3?0:B-1,D=D>=19?25:D>B?D:B+1]);}if(C&&(y[C.name]=!0),M){var L=o.evaluate(k,{},r).join(","),F="map"===i.get("text-rotation-alignment")&&"point"!==i.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(Nl.vertical)>=0;for(var R=0,O=M.sections;R<O.length;R+=1){var j=O[R];if(j.image)y[j.image.name]=!0;else {var U=Li(M.toString()),q=j.fontStack||L,N=d[q]=d[q]||{};this.calculateGlyphDependencies(j.text,N,F,this.allowVerticalPlacement,U);}}}}}}"line"===i.get("symbol-placement")&&(this.features=function(t){var e={},r={},n=[],i=0;function a(e){n.push(t[e]),i++;}function o(t,e,i){var a=r[t];return delete r[t],r[e]=a,n[a].geometry[0].pop(),n[a].geometry[0]=n[a].geometry[0].concat(i[0]),a}function s(t,r,i){var a=e[r];return delete e[r],e[t]=a,n[a].geometry[0].shift(),n[a].geometry[0]=i[0].concat(n[a].geometry[0]),a}function u(t,e,r){var n=r?e[0][e[0].length-1]:e[0][0];return t+":"+n.x+":"+n.y}for(var l=0;l<t.length;l++){var p=t[l],h=p.geometry,c=p.text?p.text.toString():null;if(c){var f=u(c,h),y=u(c,h,!0);if(f in r&&y in e&&r[f]!==e[y]){var d=s(f,y,h),m=o(f,y,n[d].geometry);delete e[f],delete r[y],r[u(c,n[m].geometry,!0)]=m,n[d].geometry=null;}else f in r?o(f,y,h):y in e?s(f,y,h):(a(l),e[f]=i-1,r[y]=i-1);}else a(l);}return n.filter((function(t){return t.geometry}))}(this.features)),this.sortFeaturesByKey&&this.features.sort((function(t,e){return t.sortKey-e.sortKey}));}},Kp.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));},Kp.prototype.isEmpty=function(){return 0===this.symbolInstances.length&&!this.hasRTLText},Kp.prototype.uploadPending=function(){return !this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},Kp.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;},Kp.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy();},Kp.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData();},Kp.prototype.addToLineVertexArray=function(t,e){var r=this.lineVertexArray.length;if(void 0!==t.segment){for(var n=t.dist(e[t.segment+1]),i=t.dist(e[t.segment]),a={},o=t.segment+1;o<e.length;o++)a[o]={x:e[o].x,y:e[o].y,tileUnitDistanceFromAnchor:n},o<e.length-1&&(n+=e[o+1].dist(e[o]));for(var s=t.segment||0;s>=0;s--)a[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:i},s>0&&(i+=e[s-1].dist(e[s]));for(var u=0;u<e.length;u++){var l=a[u];this.lineVertexArray.emplaceBack(l.x,l.y,l.tileUnitDistanceFromAnchor);}}return {lineStartIndex:r,lineLength:this.lineVertexArray.length-r}},Kp.prototype.addSymbols=function(t,e,r,n,i,a,o,s,u,l,p,h){for(var c=t.indexArray,f=t.layoutVertexArray,y=t.segments.prepareSegment(4*e.length,f,c,a.sortKey),d=this.glyphOffsetArray.length,m=y.vertexLength,v=this.allowVerticalPlacement&&o===Nl.vertical?Math.PI/2:0,g=a.text&&a.text.sections,x=this.layers[0].layout.get("symbol-scaleable").evaluate(a,{}),b=0;b<e.length;b++){var w=e[b],_=w.tl,A=w.tr,S=w.bl,z=w.br,I=w.tex,k=w.pixelOffsetTL,M=w.pixelOffsetBR,P=w.minFontScaleX,V=w.minFontScaleY,C=w.glyphOffset,T=w.isSDF,E=w.sectionIndex,B=y.vertexLength,D=C[1];Np(f,s.x,s.y,_.x,D+_.y,I.x,I.y,r,T,k.x,k.y,P,V),Np(f,s.x,s.y,A.x,D+A.y,I.x+I.w,I.y,r,T,M.x,k.y,P,V),Np(f,s.x,s.y,S.x,D+S.y,I.x,I.y+I.h,r,T,k.x,M.y,P,V),Np(f,s.x,s.y,z.x,D+z.y,I.x+I.w,I.y+I.h,r,T,M.x,M.y,P,V),Zp(t.dynamicLayoutVertexArray,s,v,x),c.emplaceBack(B,B+1,B+2),c.emplaceBack(B+1,B+2,B+3),y.vertexLength+=4,y.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(C[0]),b!==e.length-1&&E===e[b+1].sectionIndex||t.programConfigurations.populatePaintArrays(f.length,a,a.index,{},h,g&&g[E]);}t.placedSymbolArray.emplaceBack(s.x,s.y,d,this.glyphOffsetArray.length-d,m,u,l,s.segment,r?r[0]:0,r?r[1]:0,n[0],n[1],o,0,!1,0,p);},Kp.prototype._addCollisionDebugVertex=function(t,e,r,n,i,a){return e.emplaceBack(0,0),t.emplaceBack(r.x,r.y,n,i,Math.round(a.x),Math.round(a.y))},Kp.prototype.addCollisionDebugVertices=function(t,e,r,n,a,o,s){var u=a.segments.prepareSegment(4,a.layoutVertexArray,a.indexArray),l=u.vertexLength,p=a.layoutVertexArray,h=a.collisionVertexArray,c=s.anchorX,f=s.anchorY;this._addCollisionDebugVertex(p,h,o,c,f,new i(t,e)),this._addCollisionDebugVertex(p,h,o,c,f,new i(r,e)),this._addCollisionDebugVertex(p,h,o,c,f,new i(r,n)),this._addCollisionDebugVertex(p,h,o,c,f,new i(t,n)),u.vertexLength+=4;var y=a.indexArray;y.emplaceBack(l,l+1),y.emplaceBack(l+1,l+2),y.emplaceBack(l+2,l+3),y.emplaceBack(l+3,l),u.primitiveLength+=4;},Kp.prototype.addDebugCollisionBoxes=function(t,e,r,n){for(var i=t;i<e;i++){var a=this.collisionBoxArray.get(i);this.addCollisionDebugVertices(a.x1,a.y1,a.x2,a.y2,n?this.textCollisionBox:this.iconCollisionBox,a.anchorPoint,r);}},Kp.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new Xp(Pa,cl.members,Ra),this.iconCollisionBox=new Xp(Pa,cl.members,Ra);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);}},Kp.prototype._deserializeCollisionBoxesForSymbol=function(t,e,r,n,i,a,o,s,u){for(var l={},p=e;p<r;p++){var h=t.get(p);l.textBox={x1:h.x1,y1:h.y1,x2:h.x2,y2:h.y2,anchorPointX:h.anchorPointX,anchorPointY:h.anchorPointY},l.textFeatureIndex=h.featureIndex;break}for(var c=n;c<i;c++){var f=t.get(c);l.verticalTextBox={x1:f.x1,y1:f.y1,x2:f.x2,y2:f.y2,anchorPointX:f.anchorPointX,anchorPointY:f.anchorPointY},l.verticalTextFeatureIndex=f.featureIndex;break}for(var y=a;y<o;y++){var d=t.get(y);l.iconBox={x1:d.x1,y1:d.y1,x2:d.x2,y2:d.y2,anchorPointX:d.anchorPointX,anchorPointY:d.anchorPointY},l.iconFeatureIndex=d.featureIndex;break}for(var m=s;m<u;m++){var v=t.get(m);l.verticalIconBox={x1:v.x1,y1:v.y1,x2:v.x2,y2:v.y2,anchorPointX:v.anchorPointX,anchorPointY:v.anchorPointY},l.verticalIconFeatureIndex=v.featureIndex;break}return l},Kp.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));}},Kp.prototype.hasTextData=function(){return this.text.segments.get().length>0},Kp.prototype.hasIconData=function(){return this.icon.segments.get().length>0},Kp.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},Kp.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},Kp.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},Kp.prototype.addIndicesForPlacedSymbol=function(t,e){for(var r=t.placedSymbolArray.get(e),n=r.vertexStartIndex+4*r.numGlyphs,i=r.vertexStartIndex;i<n;i+=4)t.indexArray.emplaceBack(i,i+1,i+2),t.indexArray.emplaceBack(i+1,i+2,i+3);},Kp.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),n=[],i=[],a=[],o=0;o<this.symbolInstances.length;++o){a.push(o);var s=this.symbolInstances.get(o);n.push(0|Math.round(e*s.anchorX+r*s.anchorY)),i.push(s.featureIndex);}return a.sort((function(t,e){return n[t]-n[e]||i[e]-i[t]})),a},Kp.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});},Kp.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,n=this.symbolInstanceIndexes;r<n.length;r+=1){var i=this.symbolInstances.get(n[r]);this.featureSortOrder.push(i.featureIndex),[i.rightJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.leftJustifiedTextSymbolIndex].forEach((function(t,r,n){t>=0&&n.indexOf(t)===r&&e.addIndicesForPlacedSymbol(e.text,t);})),i.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,i.verticalPlacedTextSymbolIndex),i.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,i.placedIconSymbolIndex),i.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,i.verticalPlacedIconSymbolIndex);}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray);}},ri("SymbolBucket",Kp,{omit:["layers","collisionBoxArray","features","compareText"]}),Kp.MAX_GLYPHS=65535,Kp.addDynamicAttributes=Zp;var Hp=new ha({"symbol-placement":new oa(Xt.layout_symbol["symbol-placement"]),"symbol-spacing":new oa(Xt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new oa(Xt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new sa(Xt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new oa(Xt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new oa(Xt.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new oa(Xt.layout_symbol["icon-ignore-placement"]),"icon-optional":new oa(Xt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new oa(Xt.layout_symbol["icon-rotation-alignment"]),"icon-size":new sa(Xt.layout_symbol["icon-size"]),"icon-text-fit":new oa(Xt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new oa(Xt.layout_symbol["icon-text-fit-padding"]),"icon-image":new sa(Xt.layout_symbol["icon-image"]),"icon-rotate":new sa(Xt.layout_symbol["icon-rotate"]),"icon-padding":new oa(Xt.layout_symbol["icon-padding"]),"icon-keep-upright":new oa(Xt.layout_symbol["icon-keep-upright"]),"icon-offset":new sa(Xt.layout_symbol["icon-offset"]),"icon-anchor":new sa(Xt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new oa(Xt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new oa(Xt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new oa(Xt.layout_symbol["text-rotation-alignment"]),"text-field":new sa(Xt.layout_symbol["text-field"]),"text-font":new sa(Xt.layout_symbol["text-font"]),"text-size":new sa(Xt.layout_symbol["text-size"]),"text-max-width":new sa(Xt.layout_symbol["text-max-width"]),"text-line-height":new oa(Xt.layout_symbol["text-line-height"]),"text-letter-spacing":new sa(Xt.layout_symbol["text-letter-spacing"]),"text-justify":new sa(Xt.layout_symbol["text-justify"]),"text-radial-offset":new sa(Xt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new oa(Xt.layout_symbol["text-variable-anchor"]),"text-anchor":new sa(Xt.layout_symbol["text-anchor"]),"text-max-angle":new oa(Xt.layout_symbol["text-max-angle"]),"text-writing-mode":new oa(Xt.layout_symbol["text-writing-mode"]),"text-rotate":new sa(Xt.layout_symbol["text-rotate"]),"text-padding":new oa(Xt.layout_symbol["text-padding"]),"text-keep-upright":new oa(Xt.layout_symbol["text-keep-upright"]),"text-transform":new sa(Xt.layout_symbol["text-transform"]),"text-offset":new sa(Xt.layout_symbol["text-offset"]),"text-allow-overlap":new oa(Xt.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new oa(Xt.layout_symbol["text-ignore-placement"]),"text-optional":new oa(Xt.layout_symbol["text-optional"]),"symbol-scaleable":new sa(Xt.layout_symbol["symbol-scaleable"]),"allow-clip":new oa(Xt.layout_symbol["allow-clip"])}),Qp={paint:new ha({"icon-opacity":new sa(Xt.paint_symbol["icon-opacity"]),"icon-color":new sa(Xt.paint_symbol["icon-color"]),"icon-halo-color":new sa(Xt.paint_symbol["icon-halo-color"]),"icon-halo-width":new sa(Xt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new sa(Xt.paint_symbol["icon-halo-blur"]),"icon-translate":new oa(Xt.paint_symbol["icon-translate"]),"icon-translate-anchor":new oa(Xt.paint_symbol["icon-translate-anchor"]),"text-opacity":new sa(Xt.paint_symbol["text-opacity"]),"text-color":new sa(Xt.paint_symbol["text-color"],{runtimeType:ae,getOverride:function(t){return t.textColor},hasOverride:function(t){return !!t.textColor}}),"text-halo-color":new sa(Xt.paint_symbol["text-halo-color"]),"text-halo-width":new sa(Xt.paint_symbol["text-halo-width"]),"text-halo-blur":new sa(Xt.paint_symbol["text-halo-blur"]),"text-translate":new oa(Xt.paint_symbol["text-translate"]),"text-translate-anchor":new oa(Xt.paint_symbol["text-translate-anchor"]),"symbol-minzoom":new sa(Xt.paint_symbol["symbol-minzoom"]),"symbol-maxzoom":new sa(Xt.paint_symbol["symbol-maxzoom"])}),layout:Hp},Wp=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:ee,this.defaultValue=t;};Wp.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},Wp.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression);},Wp.prototype.outputDefined=function(){return !1},Wp.prototype.serialize=function(){return null},ri("FormatSectionOverride",Wp,{omit:["defaultValue"]});var $p=function(t){function e(e){t.call(this,e,Qp);}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 n=this.layout.get("text-writing-mode");if(n){for(var i=[],a=0,o=n;a<o.length;a+=1){var s=o[a];i.indexOf(s)<0&&i.push(s);}this.layout._values["text-writing-mode"]=i;}else this.layout._values["text-writing-mode"]=["horizontal"];}this._setPaintOverrides();},e.prototype.getValueAndResolveTokens=function(t,e,r,n){var i=this.layout.get(t).evaluate(e,{},r,n),a=this._unevaluatedLayout._values[t];return a.isDataDriven()||pn(a.value)||!i?i:Jp(e.properties,i)},e.prototype.createBucket=function(t){return new Kp(t)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return !1},e.prototype._setPaintOverrides=function(){for(var t=0,r=Qp.paint.overridableProperties;t<r.length;t+=1){var n=r[t];if(e.hasPaintOverride(this.layout,n)){var i,a=this.paint.get(n),o=new Wp(a),s=new ln(o,a.property.specification);i="constant"===a.value.kind||"source"===a.value.kind?new cn("source",s):new fn("composite",s,a.value.zoomStops,a.value._interpolationType),this.paint._values[n]=new ia(a.property,i,a.parameters);}}},e.prototype._handleOverridablePaintPropertyUpdate=function(t,r,n){return !(!this.layout||r.isDataDriven()||n.isDataDriven())&&e.hasPaintOverride(this.layout,t)},e.hasPaintOverride=function(t,e){var r=t.get("text-field"),n=Qp.paint.properties[e],i=!1,a=function(t){for(var e=0,r=t;e<r.length;e+=1)if(n.overrides&&n.overrides.hasOverride(r[e]))return void(i=!0)};if("constant"===r.value.kind&&r.value.value instanceof we)a(r.value.value.sections);else if("source"===r.value.kind){var o=function(t){i||(t instanceof ke&&ze(t.value)===le?a(t.value.sections):t instanceof Ce?a(t.sections):t.eachChild(o));},s=r.value;s._styleExpression&&o(s._styleExpression.expression);}return i},e}(ca),th={paint:new ha({"background-color":new oa(Xt.paint_background["background-color"]),"background-pattern":new la(Xt.paint_background["background-pattern"]),"background-opacity":new oa(Xt.paint_background["background-opacity"])})},eh=function(t){function e(e){t.call(this,e,th);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(ca),rh={paint:new ha({"raster-opacity":new oa(Xt.paint_raster["raster-opacity"]),"raster-hue-rotate":new oa(Xt.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new oa(Xt.paint_raster["raster-brightness-min"]),"raster-brightness-max":new oa(Xt.paint_raster["raster-brightness-max"]),"raster-saturation":new oa(Xt.paint_raster["raster-saturation"]),"raster-contrast":new oa(Xt.paint_raster["raster-contrast"]),"raster-resampling":new oa(Xt.paint_raster["raster-resampling"]),"raster-fade-duration":new oa(Xt.paint_raster["raster-fade-duration"])})},nh=function(t){function e(e){t.call(this,e,rh);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(ca),ih=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}(ca),ah=ma([{name:"a_pos",components:2,type:"Int16"},{name:"a_eoffset",components:2,type:"Float32"},{name:"a_normal",components:2,type:"Float32"}]),oh=ma([{name:"a_ecolor",components:1,type:"Float32"},{name:"a_erotate",components:1,type:"Float32"},{name:"a_esize",components:1,type:"Float32"}],4);function sh(t,e,r,n,i,a,o){t.emplaceBack(e,r,n,i,a,o);}var uh=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.indexArray=new Ta,this.segments=new $a,this.programConfigurations=new Mo(ah.members,t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id})),this.symbolIconArray={},this.symbolFeatures=[],this.layoutVertexArray=new ga,this.colorVertexArray=new Ia;};uh.prototype.populate=function(t,e,r){var n=this.layers[0],i=[],a=null;"circle"===n.type&&(a=n.layout.get("circle-sort-key"));for(var o=e.eleSymbolVertexs,s=0,u=t;s<u.length;s+=1){var l=u[s],p=l.feature,h=l.id,c=l.index,f=l.sourceLayerIndex,y=this.layers[0]._featureFilter.needGeometry,d={type:p.type,id:h,properties:p.properties,geometry:y?Uo(p):[]};if(this.layers[0]._featureFilter.filter(new Qi(this.zoom),d,r)){y||(d.geometry=Uo(p));var m=a?a.evaluate(d,{},r):void 0,v=n.getValueAndResolveTokens("esymbol-id",p);v&&(o[v]=!0),i.push({id:h,properties:p.properties,type:p.type,sourceLayerIndex:f,index:c,geometry:d.geometry,patterns:{},sortKey:m,symbolId:v});}}a&&i.sort((function(t,e){return t.sortKey-e.sortKey}));for(var g=0,x=i;g<x.length;g+=1){var b=x[g],w=b.geometry,_=b.index,A=b.sourceLayerIndex,S=t[_].feature;this.symbolFeatures.push(b),e.featureIndex.insert(S,w,_,A,this.index);}},uh.prototype.addFeatures=function(t,e){for(var r=0,n=this.symbolFeatures;r<n.length;r+=1){var i=n[r],a=i.symbolId;if(a){if(!this.symbolIconArray[a]){var o=t[a];if(!o){console.log("符号:"+a+"没有找到");continue}this.symbolIconArray[a]=this.getSymbolData(o[0]),this.symbolIconArray[a].CellsBound={right:o[1],left:o[2],top:o[3],bottom:o[4]};}this.addFeature(i,i.geometry,i.index,t,e);}}},uh.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r);},uh.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},uh.prototype.uploadPending=function(){return !this.uploaded||this.programConfigurations.needsUpload},uh.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ah.members),this.colorVertexBuffer=t.createVertexBuffer(this.colorVertexArray,oh.members,!0),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0;},uh.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.colorVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.colorVertexArray.clear());},uh.prototype.packUint8ToFloat=function(t,e,r,n){return [t,r]},uh.prototype.getLayoutValue=function(t,e,r){var n=this.layers[0],i=n.layout.get(t),a=e;return "constant"!==i.value.kind||i.value.value&&i.value.value.length>0?a=n.getValueAndResolveTokens(t,r):(i.value.value||0==i.value.value)&&i.value.value.toString().length&&(a=i.value.value),a},uh.prototype._perp2=function(t){return [-t[1],t[0]]},uh.prototype.countPath=function(t,e,r,n,i){for(var a=n||"miter",o=i||"square",s=2,u=t.length,l=t[u-2]==t[0]&&t[u-1]==t[1],p=[],h=0;h<u/2;h++){var c={x:t[2*h],y:t[2*h+1]},f={x:t[2*(h-1)],y:t[2*(h-1)+1]};h>=1&&c.x==f.x&&c.y==f.y||p.push(Ss(As(),c.x,c.y));}if(!((u=p.length)<(l?3:2))){"bevel"===a&&(s=1.05);var y,d,m,v,g,x={pointArray:[],indexArray:[],paintArray:[],index:0,color:r,normalVector:[],len:5},b=e/2;for(l&&(y=p[u-2],g=this._perp2(Ps(As(),Is(As(),p[0],y)))),h=0;h<u;h++){g&&(v=g),y&&(d=y),y=p[h],g=(m=l&&h==u-1?p[1]:p[h+1])?this._perp2(Ps(As(),Is(As(),m,y))):v,v=v||g;var w=zs(As(),v,g);0==w[0]&&0==w[1]||(w=Ps(As(),w));var _=Vs(v,g),A=Vs(w,g),S=v[0]*g[1]-v[1]*g[0]>0,z=b/Math.sqrt((_+1)/2),I=0!==A?1/A:1/0,k=d&&m,M=k?a:l?"butt":o;if(k&&"round"===M&&(I<1.05?M="miter":I<=2&&(M="fakeround")),"miter"===M&&I>s&&(M="bevel"),"bevel"===M&&(I<100&&I>2&&(M="flipbevel"),I<s&&(M="miter")),"miter"===M){if(w=ks(As(),w,z),d){var P=ks(As(),v,b);x=this.addCurrentVertex(y,w,0,0,x,P);}if(m){var V=ks(As(),g,b);x=this.addCurrentVertex(y,w,0,0,x,V);}}else if("flipbevel"===M){if(I>100)w=ks(As(),g,-1);else {var C=zs(As(),v,g),T=Ts(As(),v,g),E=z*Ms(C)/Ms(T);w=ks(As(),this._perp2(w),E*(S?-1:1));}this.addCurrentVertex(y,w,0,0,x),this.addCurrentVertex(y,ks(As(),w,-1),0,0,x);}else if("bevel"===M||"fakeround"===M){if(d&&(w=ks(As(),v,b),x=this.addCurrentVertex(y,w,0,0,x)),"fakeround"===M)for(var B=2*Math.sqrt(2-2*A),D=Math.round(180*B/Math.PI/20),L=1;L<D;L++){var F=L/D;if(.5!==F){var R=F-.5;F+=F*R*(F-1)*((1.0904+_*(_*(3.55645-1.43519*_)-3.2452))*R*R+(.848013+_*(.215638*_-1.06021)));}var O=Ts(As(),g,v);O=ks(As(),O,F),O=zs(As(),O,v),O=Ps(As(),O),O=ks(As(),O,b),x=this.addCurrentVertex(y,O,0,0,x);}m&&(w=ks(As(),g,b),x=this.addCurrentVertex(y,w,0,0,x));}else if("butt"===M)w=ks(As(),w,b),x=this.addCurrentVertex(y,w,0,0,x);else if("square"===M){var j=Ps(As(),Ts(As(),y,d||m));j=ks(As(),j,b),w=ks(As(),w,b),this.addCurrentVertex(y,w,j,0,x);}else "round"===M&&(d&&(this.addCurrentVertex(y,v,0,0,x),this.addCurrentVertex(y,v,1,1,x)),m&&(this.addCurrentVertex(y,g,-1,-1,x),this.addCurrentVertex(y,g,0,0,x)));}return x}},uh.prototype.addCurrentVertex=function(t,e,r,n,i,a){var o=zs(As(),t,e),s=Ts(As(),t,e);r&&(o=zs(As(),o,r),s=zs(As(),s,r));var u=i.index;i.pointArray=i.pointArray.concat([o[0],o[1]]).concat([s[0],s[1]]);var l=a||e;return i.paintArray=i.paintArray.concat(i.color).concat([l[0],l[1]]).concat(i.color).concat([0-l[0],0-l[1]]),u>0&&(i.indexArray=i.indexArray.concat([u-2,u-1,u]),i.indexArray=i.indexArray.concat([u-1,u,u+1])),i.index+=2,i},uh.prototype.getSymbolData=function(t){for(var e=[],r=[],n=[],i=(this.layers[0].paint.get("esymbol-color"),0);i<t.length;i++){var a=t[i],o=a[0]*a[1],s=a[3],u=a[4],l=[],p=[],h=[];if(7==a[2]||1==u){if(1==u||8==u){var c=[a[5],a[6]];l=a.slice(7);}else l=a.slice(5);p=Js(l);for(var f=0;f<l.length/2;f++)1==u||8==u?h.push(o,l[2*f]-c[0],l[2*f+1]-c[1]):h.push(o,0,0);}else {if(8==u)var y=this.countPath(a.slice(5),s,o,"bevel","butt");else y=this.countPath(a.slice(5),s,o);l=y.pointArray,p=y.indexArray,h=y.paintArray;}p=p.map((function(t){return e.length/2+t})),e=e.concat(l),r=r.concat(p),n=n.concat(h);}return {pointArray:e,indexArray:r,paintArray:n}},uh.prototype.addFeature=function(t,e,r,n,i){var a=this.getLayoutValue("esymbol-rotate",0,t),o=this.getLayoutValue("esymbol-size",1,t),s=this.getLayoutValue("esymbol-scaleable",!0,t),u=this.layers[0].paint.get("esymbol-color").parameters.zoom>=0;(a>360||a<-360)&&(a%=360),o<0&&(o=0-o),o*=s?1:-1;for(var l=0,p=e;l<p.length;l+=1)for(var h=0,c=p[l];h<c.length;h+=1){var f=c[h],y=f.x,d=f.y;if(!(y<0||y>=8192||d<0||d>=8192)){for(var m=this.symbolIconArray[t.symbolId],v=m.pointArray,g=m.indexArray,x=m.paintArray,b=this.segments.prepareSegment(v.length/2,this.layoutVertexArray,this.indexArray,t.sortKey),w=Number(b.vertexLength),_=0;_<g.length/3;_++){var A=3*_;this.indexArray.emplaceBack(w+g[A],w+g[A+1],w+g[A+2]),b.primitiveLength++;}for(var S=0;S<v.length/4;S++){var z=4*S,I=6*S;sh(this.layoutVertexArray,y,d,v[z],v[z+1],x[I+1],x[I+2]),sh(this.layoutVertexArray,y,d,v[z+2],v[z+3],x[I+4],x[I+5]),this.colorVertexArray.emplaceBack(!u&&x[I]>0?0-x[I]:x[I],a,o),this.colorVertexArray.emplaceBack(!u&&x[I+3]>0?0-x[I+3]:x[I+3],a,o),b.vertexLength+=2;}}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{});},ri("EleSymbolBucket",uh,{omit:["layers"]});var lh=new ha({"esymbol-sort-key":new sa(Xt.layout_esymbol["esymbol-sort-key"]),"esymbol-id":new sa(Xt.layout_esymbol["esymbol-id"]),"esymbol-rotate":new sa(Xt.layout_esymbol["esymbol-rotate"]),"esymbol-size":new sa(Xt.layout_esymbol["esymbol-size"]),"esymbol-scaleable":new sa(Xt.layout_esymbol["esymbol-scaleable"]),"allow-clip":new oa(Xt.layout_esymbol["allow-clip"])}),ph={paint:new ha({"esymbol-radius":new sa(Xt.paint_esymbol["esymbol-radius"]),"esymbol-color":new sa(Xt.paint_esymbol["esymbol-color"]),"esymbol-blur":new sa(Xt.paint_esymbol["esymbol-blur"]),"esymbol-opacity":new sa(Xt.paint_esymbol["esymbol-opacity"]),"esymbol-translate":new oa(Xt.paint_esymbol["esymbol-translate"]),"esymbol-translate-anchor":new oa(Xt.paint_esymbol["esymbol-translate-anchor"]),"esymbol-pitch-scale":new oa(Xt.paint_esymbol["esymbol-pitch-scale"]),"esymbol-pitch-alignment":new oa(Xt.paint_esymbol["esymbol-pitch-alignment"]),"esymbol-stroke-width":new sa(Xt.paint_esymbol["esymbol-stroke-width"]),"esymbol-stroke-color":new sa(Xt.paint_esymbol["esymbol-stroke-color"]),"esymbol-stroke-opacity":new sa(Xt.paint_esymbol["esymbol-stroke-opacity"]),"esymbol-minzoom":new sa(Xt.paint_esymbol["esymbol-minzoom"]),"esymbol-maxzoom":new sa(Xt.paint_esymbol["esymbol-maxzoom"])}),layout:lh};function hh(t,e){var r=_s([],[t.x,t.y,0,1],e);return new i(r[0]/r[3],r[1]/r[3])}var ch={circle:Bs,heatmap:Gs,hillshade:Xs,fill:Eu,"fill-extrusion":Hu,line:sl,symbol:$p,background:eh,raster:nh,esymbol:function(t){function e(e){t.call(this,e,ph);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new uh(t)},e.prototype.getValueAndResolveTokens=function(t,e){var r=this.layout.get(t).evaluate(e,{}),n=this._unevaluatedLayout._values[t];return n.isDataDriven()||pn(n.value)?r:Jp(e.properties,r)},e.prototype.queryRadius=function(t){var e=t,r=e.symbolFeatures,n=0,i=this.layout.get("esymbol-size").value,a=this.layout.get("esymbol-scaleable").value;if("constant"===i.kind)n=i.value;else for(var o=0;o<r.length;o++){var s=this.getValueAndResolveTokens("esymbol-size",r[o]);s>n&&(n=s);}return n=2*n*Math.sqrt(2),"constant"===a.kind?a.value&&(n*=Math.pow(2,e.zoom-18)):n=Math.max(n,n*Math.pow(2,e.zoom-18)),n+rs(this.paint.get("esymbol-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,a,o,s,u){var l=ns(t,this.paint.get("esymbol-translate"),this.paint.get("esymbol-translate-anchor"),a.angle,o),p=2*this.layout.get("esymbol-size").evaluate(e,r),h=this.layout.get("esymbol-scaleable").evaluate(e,r),c=this.layout.get("esymbol-id").evaluate(e,r);if(!c&&0!=c||!u||!u.symbolIconArray||!u.symbolIconArray[c])return !1;var f=u.symbolIconArray[c].CellsBound,y=f.right-f.left,d=f.top-f.bottom,m=y/d,v=this.layout.get("esymbol-rotate").evaluate(e,r);h&&(p*=Math.pow(2,a.zoom-18));for(var g="map"===this.paint.get("esymbol-pitch-alignment"),x=g?l:function(t,e){return t.map((function(t){return hh(t,e)}))}(l,s),b=g?p*o:p,w=0,_=n;w<_.length;w+=1)for(var A=0,S=_[w];A<S.length;A+=1){var z=S[A],I=g?z:hh(z,s),k=b,M=_s([],[z.x,z.y,0,1],s);"viewport"===this.paint.get("esymbol-pitch-scale")&&"map"===this.paint.get("esymbol-pitch-alignment")?k*=M[3]/a.cameraToCenterDistance:"map"===this.paint.get("esymbol-pitch-scale")&&"viewport"===this.paint.get("esymbol-pitch-alignment")&&(k*=a.cameraToCenterDistance/M[3]);var P=k*=2,V=k;m<=1?P=k*m:V=k/m;var C=Math.abs(f.right)/y*P,T=Math.abs(f.left)/y*P,E=Math.abs(f.top)/d*V,B=Math.abs(f.bottom)/d*V,D=[[{x:I.x+C,y:I.y+B},{x:I.x-T,y:I.y+B},{x:I.x-T,y:I.y-E},{x:I.x+C,y:I.y-E}]];if(0!=v&&v%360!=0){v=v/180*Math.PI;for(var L=0;L<D[0].length;L++){var F=Cs(As(),[D[0][L].x,D[0][L].y],[I.x,I.y],v);D[0][L]={x:F[0],y:F[1]};}}if(D[0].push(D[0][0]),Yo(x,D))return !0}return !1},e}(ca),eline:sl},fh=self.HTMLImageElement,yh=self.HTMLCanvasElement,dh=self.HTMLVideoElement,mh=self.ImageData,vh=self.ImageBitmap,gh=function(t,e,r,n){this.context=t,this.format=r,this.texture=t.gl.createTexture(),this.update(e,n);};gh.prototype.update=function(t,e,r){var n=t.width,i=t.height,a=!(this.size&&this.size[0]===n&&this.size[1]===i||r),o=this.context,s=o.gl;if(this.useMipmap=Boolean(e&&e.useMipmap),s.bindTexture(s.TEXTURE_2D,this.texture),o.pixelStoreUnpackFlipY.set(!1),o.pixelStoreUnpack.set(1),o.pixelStoreUnpackPremultiplyAlpha.set(this.format===s.RGBA&&(!e||!1!==e.premultiply)),a)this.size=[n,i],t instanceof fh||t instanceof yh||t instanceof dh||t instanceof mh||vh&&t instanceof vh?s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,s.UNSIGNED_BYTE,t):s.texImage2D(s.TEXTURE_2D,0,this.format,n,i,0,this.format,s.UNSIGNED_BYTE,t.data);else {var u=r||{x:0,y:0},l=u.x,p=u.y;t instanceof fh||t instanceof yh||t instanceof dh||t instanceof mh||vh&&t instanceof vh?s.texSubImage2D(s.TEXTURE_2D,0,l,p,s.RGBA,s.UNSIGNED_BYTE,t):s.texSubImage2D(s.TEXTURE_2D,0,l,p,n,i,s.RGBA,s.UNSIGNED_BYTE,t.data);}this.useMipmap&&this.isSizePowerOfTwo()&&s.generateMipmap(s.TEXTURE_2D);},gh.prototype.bind=function(t,e,r){var n=this.context.gl;n.bindTexture(n.TEXTURE_2D,this.texture),r!==n.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(r=n.LINEAR),t!==this.filter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,t),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,r||t),this.filter=t),e!==this.wrap&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,e),this.wrap=e);},gh.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},gh.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null;};var xh=function(t,e){this.width=t,this.height=e,this.nextRow=0,this.image=new Us({width:t,height:e}),this.positions={},this.uploaded=!1;};xh.prototype.getDash=function(t,e){var r=this.getKey(t,e);return this.positions[r]},xh.prototype.trim=function(){var t,e=this.width,r=this.height=(t=this.nextRow)<=1?1:Math.pow(2,Math.ceil(Math.log(t)/Math.LN2));this.image.resize({width:e,height:r});},xh.prototype.getKey=function(t,e){return t.join(",")+e},xh.prototype.getDashRanges=function(t,e,r){var n=[],i=t.length%2==1?-t[t.length-1]*r:0,a=t[0]*r,o=!0;n.push({left:i,right:a,isDash:o,zeroLength:0===t[0]});for(var s=t[0],u=1;u<t.length;u++){var l=t[u];n.push({left:i=s*r,right:a=(s+=l)*r,isDash:o=!o,zeroLength:0===l});}return n},xh.prototype.addRoundDash=function(t,e,r){for(var n=e/2,i=-r;i<=r;i++)for(var a=this.width*(this.nextRow+r+i),o=0,s=t[o],u=0;u<this.width;u++){u/s.right>1&&(s=t[++o]);var l=Math.abs(u-s.left),p=Math.abs(u-s.right),h=Math.min(l,p),c=void 0,f=i/r*(n+1);if(s.isDash){var y=n-Math.abs(f);c=Math.sqrt(h*h+y*y);}else c=n-Math.sqrt(h*h+f*f);this.image.data[a+u]=Math.max(0,Math.min(255,c+128));}},xh.prototype.addRegularDash=function(t,e){for(var r=t.length-1;r>=0;--r){var n=t[r],i=t[r+1];n.zeroLength?t.splice(r,1):i&&i.isDash===n.isDash&&(i.left=n.left,t.splice(r,1));}var a=t[0],o=t[t.length-1];a.isDash===o.isDash&&(a.left=o.left-this.width,o.right=a.right+this.width);for(var s=this.width*this.nextRow,u=0,l=t[u],p=0;p<this.width;p++){p/l.right>1&&(l=t[++u]);var h=Math.abs(p-l.left),c=Math.abs(p-l.right),f=Math.min(h,c);this.image.data[s+p]=Math.max(0,Math.min(255,(l.isDash?f:-f)+e+128));}},xh.prototype.addDash=function(t,e){var r=this.getKey(t,e);if(this.positions[r])return this.positions[r];var n="round"===e,i=n?7:0,a=2*i+1;if(this.nextRow+a>this.height)return S("LineAtlas out of space"),null;0===t.length&&t.push(1);for(var o=0,s=0;s<t.length;s++)t[s]<0&&(S("Negative value is found in line dasharray, replacing values with 0"),t[s]=0),o+=t[s];if(0!==o){var u=this.width/o,l=this.getDashRanges(t,this.width,u);n?this.addRoundDash(l,u,i):this.addRegularDash(l,"square"===e?.5*u:0);}var p=this.nextRow+i;this.nextRow+=a;var h={tl:[p,i],br:[o,0]};return this.positions[r]=h,h},ri("LineAtlas",xh);var bh=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();});};bh.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));},bh.prototype.remove=function(){delete this._channel,this._callback=function(){};};var wh=function(){this.tasks={},this.taskQueue=[],v(["process"],this),this.invoker=new bh(this.process),this.nextId=0;};wh.prototype.add=function(t,e){var r,n,i,a,o=this,s=this.nextId++;return this.tasks[s]={fn:t,metadata:e,priority:(r=e,n=r.type,i=r.isSymbolTile,a=r.zoom,a=a||0,"message"===n?0:"maybePrepare"!==n||i?"parseTile"!==n||i?"parseTile"===n&&i?300-a:"maybePrepare"===n&&i?400-a:500:200-a:100-a),id:s},this.taskQueue.push(s),this.invoker.trigger(),{cancel:function(){delete o.tasks[s];}}},wh.prototype.process=function(){var t=this;try{if(this.taskQueue=this.taskQueue.filter((function(e){return !!t.tasks[e]})),!this.taskQueue.length)return;var e=this.pick();if(null===e)return;var r=this.tasks[e];if(delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),!r)return;r.fn();}finally{}},wh.prototype.pick=function(){for(var t=null,e=1/0,r=0;r<this.taskQueue.length;r++){var n=this.tasks[this.taskQueue[r]];n.priority<e&&(e=n.priority,t=r);}if(null===t)return null;var i=this.taskQueue[t];return this.taskQueue.splice(t,1),i},wh.prototype.remove=function(){this.invoker.remove();};var _h=function(t,e,r){this.target=t,this.parent=e,this.mapId=r,this.callbacks={},this.cancelCallbacks={},v(["receive"],this),this.target.addEventListener("message",this.receive,!1),this.globalScope=k()?t:self,this.scheduler=new wh;};_h.prototype.send=function(t,e,r,n,i,a){var o=this;void 0===i&&(i=!1);var s=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(r.metadata=a,this.callbacks[s]=r);var u,l=V(this.globalScope)?void 0:[];return (u=e)&&"undefined"!=typeof ArrayBuffer&&(u instanceof ArrayBuffer||u.constructor&&"ArrayBuffer"===u.constructor.name)&&(e=e.slice(0)),this.target.postMessage({id:s,type:t,hasCallback:!!r,targetMapId:n,mustQueue:i,sourceMapId:this.mapId,data:oi(e,l)},l),{cancel:function(){r&&delete o.callbacks[s],o.target.postMessage({id:s,type:"<cancel>",targetMapId:n,sourceMapId:o.mapId});}}},_h.prototype.receive=function(t){var e=this,r=t.data,n=r.id;if(n&&(!r.targetMapId||this.mapId===r.targetMapId))if("<cancel>"===r.type){var i=this.cancelCallbacks[n];delete this.cancelCallbacks[n],i&&i.cancel();}else if(k()||r.mustQueue){var a=this.callbacks[n];this.cancelCallbacks[n]=this.scheduler.add((function(){return e.processTask(n,r)}),a&&a.metadata||{type:"message"});}else this.processTask(n,r);},_h.prototype.processTask=function(t,e){var r=this;if("<response>"===e.type){var n=this.callbacks[t];delete this.callbacks[t],n&&(e.error?n(si(e.error)):n(null,si(e.data)));}else {var i=V(this.globalScope)?void 0:[],a=e.hasCallback?function(e,n){delete r.cancelCallbacks[t],r.target.postMessage({id:t,type:"<response>",sourceMapId:r.mapId,error:e?oi(e):null,data:oi(n,i)},i);}:function(t){},o=si(e.data);if(this.parent[e.type])this.parent[e.type](e.sourceMapId,o,a);else if(this.parent.getWorkerSource){var s=e.type.split(".");this.parent.getWorkerSource(e.sourceMapId,s[0],o.source)[s[1]](o,a);}else a(new Error("Could not find function "+e.type));}},_h.prototype.remove=function(){this.scheduler.remove(),this.target.removeEventListener("message",this.receive,!1);};var Ah=function(t,e){this.points=t,this.planes=e;};Ah.fromInvProjectionMatrix=function(t,e,r){var n=Math.pow(2,r),i=[[-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(e){return _s([],e,t)})).map((function(t){return 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,1/t[3]/e*n)})),a=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(t){var e,r,n=function(t,e){var r=e[0],n=e[1],i=e[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t}([],function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],u=r[2];return t[0]=i*u-a*s,t[1]=a*o-n*u,t[2]=n*s-i*o,t}([],ws([],i[t[0]],i[t[1]]),ws([],i[t[2]],i[t[1]]))),a=-((e=n)[0]*(r=i[t[1]])[0]+e[1]*r[1]+e[2]*r[2]);return n.concat(a)}));return new Ah(i,a)};var Sh=function(t,e){this.min=t,this.max=e,this.center=function(t,e,r){return t[0]=.5*e[0],t[1]=.5*e[1],t[2]=.5*e[2],t}([],function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}([],this.min,this.max));};Sh.prototype.quadrant=function(t){for(var e=[t%2==0,t<2],r=xs(this.min),n=xs(this.max),i=0;i<e.length;i++)r[i]=e[i]?this.min[i]:this.center[i],n[i]=e[i]?this.center[i]:this.max[i];return n[2]=this.max[2],new Sh(r,n)},Sh.prototype.distanceX=function(t){return Math.max(Math.min(this.max[0],t[0]),this.min[0])-t[0]},Sh.prototype.distanceY=function(t){return Math.max(Math.min(this.max[1],t[1]),this.min[1])-t[1]},Sh.prototype.intersects=function(t){for(var e,r,n=[[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,a=0;a<t.planes.length;a++){for(var o=t.planes[a],s=0,u=0;u<n.length;u++)s+=(e=o)[0]*(r=n[u])[0]+e[1]*r[1]+e[2]*r[2]+e[3]*r[3]>=0;if(0===s)return 0;s!==n.length&&(i=!1);}if(i)return 2;for(var l=0;l<3;l++){for(var p=Number.MAX_VALUE,h=-Number.MAX_VALUE,c=0;c<t.points.length;c++){var f=t.points[c][l]-this.min[l];p=Math.min(p,f),h=Math.max(h,f);}if(h<0||p>this.max[l]-this.min[l])return 0}return 1};var zh=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]));};zh.prototype.setNorthEast=function(t){return this._ne=t instanceof Ih?new Ih(t.lng,t.lat):Ih.convert(t),this},zh.prototype.setSouthWest=function(t){return this._sw=t instanceof Ih?new Ih(t.lng,t.lat):Ih.convert(t),this},zh.prototype.extend=function(t){var e,r,n=this._sw,i=this._ne;if(t instanceof Ih)e=t,r=t;else {if(!(t instanceof zh))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(zh.convert(t)):this.extend(Ih.convert(t)):this;if(r=t._ne,!(e=t._sw)||!r)return this}return n||i?(n.lng=Math.min(e.lng,n.lng),n.lat=Math.min(e.lat,n.lat),i.lng=Math.max(r.lng,i.lng),i.lat=Math.max(r.lat,i.lat)):(this._sw=new Ih(e.lng,e.lat),this._ne=new Ih(r.lng,r.lat)),this},zh.prototype.getCenter=function(){return new Ih((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},zh.prototype.getSouthWest=function(){return this._sw},zh.prototype.getNorthEast=function(){return this._ne},zh.prototype.getNorthWest=function(){return new Ih(this.getWest(),this.getNorth())},zh.prototype.getSouthEast=function(){return new Ih(this.getEast(),this.getSouth())},zh.prototype.getWest=function(){return this._sw.lng},zh.prototype.getSouth=function(){return this._sw.lat},zh.prototype.getEast=function(){return this._ne.lng},zh.prototype.getNorth=function(){return this._ne.lat},zh.prototype.toArray=function(){return [this._sw.toArray(),this._ne.toArray()]},zh.prototype.toString=function(){return "LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},zh.prototype.isEmpty=function(){return !(this._sw&&this._ne)},zh.prototype.contains=function(t){var e=Ih.convert(t),r=e.lng,n=e.lat,i=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(i=this._sw.lng>=r&&r>=this._ne.lng),this._sw.lat<=n&&n<=this._ne.lat&&i},zh.convert=function(t){return !t||t instanceof zh?t:new zh(t)};var Ih=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");this.lng=+t,this.lat=+e;};function kh(t,e,r){var n=2*Math.PI*6378137/256/Math.pow(2,r);return [t*n-2*Math.PI*6378137/2,e*n-2*Math.PI*6378137/2]}Ih.prototype.wrap=function(){return new Ih(l(this.lng,-180,180),this.lat)},Ih.prototype.toArray=function(){return [this.lng,this.lat]},Ih.prototype.toString=function(){return "LngLat("+this.lng+", "+this.lat+")"},Ih.prototype.distanceTo=function(t){var e=Math.PI/180,r=this.lat*e,n=t.lat*e,i=Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos((t.lng-this.lng)*e);return 6371008.8*Math.acos(Math.min(i,1))},Ih.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 zh(new Ih(this.lng-r,this.lat-e),new Ih(this.lng+r,this.lat+e))},Ih.convert=function(t){if(t instanceof Ih)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new Ih(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new Ih(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 Mh=2*Math.PI*6371008.8;function Ph(t){return Mh*Math.cos(t*Math.PI/180)}function Vh(t){return (180+t)/360}function Ch(t){return -90==t?1:90==t?0:(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Th(t,e){return t/Ph(e)}function Eh(t){return 360*t-180}function Bh(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}function Dh(t,e){return t*Ph(Bh(e))}function Lh(t){return 1/Math.cos(t*Math.PI/180)}var Fh=function(t,e,r){void 0===r&&(r=0),this.x=+t,this.y=+e,this.z=+r;};Fh.fromLngLat=function(t,e){void 0===e&&(e=0);var r=Ih.convert(t);return new Fh(Vh(r.lng),Ch(r.lat),Th(e,r.lat))},Fh.prototype.toLngLat=function(){return new Ih(Eh(this.x),Bh(this.y))},Fh.prototype.toAltitude=function(){return Dh(this.z,this.y)},Fh.prototype.meterInMercatorCoordinateUnits=function(){return 1/Mh*Lh(Bh(this.y))};var Rh=function(t,e,r,n){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===n&&(n=0),isNaN(t)||t<0||isNaN(e)||e<0||isNaN(r)||r<0||isNaN(n)||n<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=n;};Rh.prototype.interpolate=function(t,e,r){return null!=e.top&&null!=t.top&&(this.top=ur(t.top,e.top,r)),null!=e.bottom&&null!=t.bottom&&(this.bottom=ur(t.bottom,e.bottom,r)),null!=e.left&&null!=t.left&&(this.left=ur(t.left,e.left,r)),null!=e.right&&null!=t.right&&(this.right=ur(t.right,e.right,r)),this},Rh.prototype.getCenter=function(t,e){var r=u((this.left+t-this.right)/2,0,t),n=u((this.top+e-this.bottom)/2,0,e);return new i(r,n)},Rh.prototype.equals=function(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right},Rh.prototype.clone=function(){return new Rh(this.top,this.bottom,this.left,this.right)},Rh.prototype.toJSON=function(){return {top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var Oh=function(t,e,r,n,i){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===i||i,this._minZoom=t||0,this._maxZoom=e||22,this._minPitch=null==r?0:r,this._maxPitch=null==n?60:n,this.setMaxBounds(),this.width=0,this.height=0,this._center=new Ih(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Rh,this._posMatrixCache={},this._alignedPosMatrixCache={};},jh={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}};Oh.prototype.clone=function(){var t=new Oh(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},jh.minZoom.get=function(){return this._minZoom},jh.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t));},jh.maxZoom.get=function(){return this._maxZoom},jh.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t));},jh.minPitch.get=function(){return this._minPitch},jh.minPitch.set=function(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t));},jh.maxPitch.get=function(){return this._maxPitch},jh.maxPitch.set=function(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t));},jh.renderWorldCopies.get=function(){return this._renderWorldCopies},jh.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t;},jh.worldSize.get=function(){return this.tileSize*this.scale},jh.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},jh.size.get=function(){return new i(this.width,this.height)},jh.bearing.get=function(){return -this.angle/Math.PI*180},jh.bearing.set=function(t){var e=-l(t,-180,180)*Math.PI/180;this.angle!==e&&(this._unmodified=!1,this.angle=e,this._calcMatrices(),this.rotationMatrix=ss(),us(this.rotationMatrix,this.rotationMatrix,this.angle));},jh.pitch.get=function(){return this._pitch/Math.PI*180},jh.pitch.set=function(t){var e=u(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==e&&(this._unmodified=!1,this._pitch=e,this._calcMatrices());},jh.fov.get=function(){return this._fov/Math.PI*180},jh.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());},jh.zoom.get=function(){return this._zoom},jh.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());},jh.center.get=function(){return this._center},jh.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices());},jh.padding.get=function(){return this._edgeInsets.toJSON()},jh.padding.set=function(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices());},jh.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},Oh.prototype.isPaddingEqual=function(t){return this._edgeInsets.equals(t)},Oh.prototype.interpolatePadding=function(t,e,r){this._unmodified=!1,this._edgeInsets.interpolate(t,e,r),this._constrain(),this._calcMatrices();},Oh.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)},Oh.prototype.getVisibleUnwrappedCoordinates=function(t){var e=[new ic(0,t)];if(this._renderWorldCopies)for(var r=this.pointCoordinate(new i(0,0)),n=this.pointCoordinate(new i(this.width,0)),a=this.pointCoordinate(new i(this.width,this.height)),o=this.pointCoordinate(new i(0,this.height)),s=Math.floor(Math.min(r.x,n.x,a.x,o.x)),u=Math.floor(Math.max(r.x,n.x,a.x,o.x)),l=s-1;l<=u+1;l++)0!==l&&e.push(new ic(l,t));return e},Oh.prototype.coveringTiles=function(t){if("Sg4326"==t.reference)return this.gaode_coveringTiles(t);var e=this.coveringZoomLevel(t),r=e;if(void 0!==t.minzoom&&e<t.minzoom)return [];void 0!==t.maxzoom&&e>t.maxzoom&&(e=t.maxzoom);var n=Fh.fromLngLat(this.center),i=Math.pow(2,e),a=[i*n.x,i*n.y,0],o=Ah.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,e),s=t.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(s=e);var u=function(t){return {aabb:new Sh([t*i,0,0],[(t+1)*i,i,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}},l=[],p=[],h=e,c=t.reparseOverscaled?r:e;if(this._renderWorldCopies)for(var f=1;f<=3;f++)l.push(u(-f)),l.push(u(f));for(l.push(u(0));l.length>0;){var y=l.pop(),d=y.x,m=y.y,v=y.fullyVisible;if(!v){var g=y.aabb.intersects(o);if(0===g)continue;v=2===g;}var x=y.aabb.distanceX(a),b=y.aabb.distanceY(a),w=Math.max(Math.abs(x),Math.abs(b));if(y.zoom===h||w>3+(1<<h-y.zoom)-2&&y.zoom>=s)p.push({tileID:new ac(y.zoom===h?c:y.zoom,y.wrap,y.zoom,d,m),distanceSq:Es([a[0]-.5-d,a[1]-.5-m])});else for(var _=0;_<4;_++){var A=(d<<1)+_%2,S=(m<<1)+(_>>1);l.push({aabb:y.aabb.quadrant(_),zoom:y.zoom+1,x:A,y:S,wrap:y.wrap,fullyVisible:v});}}return p.sort((function(t,e){return t.distanceSq-e.distanceSq})).map((function(t){return t.tileID}))},Oh.prototype.gaode_coveringTiles=function(t){var e=this.coveringZoomLevel(t),r=e;if(void 0!==t.minzoom&&e<t.minzoom)return [];void 0!==t.maxzoom&&e>t.maxzoom&&(e=t.maxzoom);var n=Fh.fromLngLat(this.center),i=[],a=this.getBounds(),o=[e],s=t.zoomRule;if(s){o=[];for(var u=0,l=s.length;u<l;u++)for(var p=s[u],h=Object.keys(p),c=0,f=h.length;c<f;c++)if(h[c].indexOf(e)>=0){var y=p[h[c]];o.indexOf(y)<0&&o.push(Number(y));break}}for(var d=t.reparseOverscaled?r:e,m=0,v=o.length;m<v;m++)this.gaode_calulate_xy(i,o[m],a,t,s[m],n,d);return i.sort((function(t,e){return t.distanceSq-e.distanceSq})).map((function(t){return t.tileID}))},Oh.prototype.gaode_calulate_xy=function(t,e,r,n,i,a,o){var s=n.reference,u=n.sourceID,l=Eo(e,r._ne.lng,r._ne.lat),p=Eo(e,r._sw.lng,r._sw.lat),h=Math.pow(2,e),c=Math.max(l.x,p.x),f=Math.min(l.x,p.x),y=Math.max(l.y,p.y),d=Math.min(l.y,p.y);this._renderWorldCopies?f<=0&&f--:(c=Math.min(c,h-1),f=Math.max(f,0),y=Math.min(y,h-1),d=Math.max(d,0));var m=[h*a.x,h*a.y,0];i=JSON.stringify(i);for(var v=f;v<=c;v++)for(var g=d;g<=y;g++){var x=Oo(v,g,e,"all"),b=v,w=0;this._renderWorldCopies&&((b%=h)<0&&(b+=h),w=Math.floor(v/h)),t.push({tileID:new ac(e,w,e,b,g,s,u,i,[x.top,x.height],o),distanceSq:Es([m[0]-v-.5,m[1]-x.top-x.height/2])});}},Oh.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices();},jh.unmodified.get=function(){return this._unmodified},Oh.prototype.zoomScale=function(t){return Math.pow(2,t)},Oh.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},Oh.prototype.project=function(t){var e=u(t.lat,-this.maxValidLatitude,this.maxValidLatitude);return new i(Vh(t.lng)*this.worldSize,Ch(e)*this.worldSize)},Oh.prototype.unproject=function(t){return new Fh(t.x/this.worldSize,t.y/this.worldSize).toLngLat()},jh.point.get=function(){return this.project(this.center)},Oh.prototype.setLocationAtPoint=function(t,e){var r=this.pointCoordinate(e),n=this.pointCoordinate(this.centerPoint),i=this.locationCoordinate(t),a=new Fh(i.x-(r.x-n.x),i.y-(r.y-n.y));this.center=this.coordinateLocation(a),this._renderWorldCopies&&(this.center=this.center.wrap());},Oh.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},Oh.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},Oh.prototype.locationCoordinate=function(t){return Fh.fromLngLat(t)},Oh.prototype.coordinateLocation=function(t){return t.toLngLat()},Oh.prototype.pointCoordinate=function(t){var e=[t.x,t.y,0,1],r=[t.x,t.y,1,1];_s(e,e,this.pixelMatrixInverse),_s(r,r,this.pixelMatrixInverse);var n=e[3],i=r[3],a=e[1]/n,o=r[1]/i,s=e[2]/n,u=r[2]/i,l=s===u?0:(0-s)/(u-s);return new Fh(ur(e[0]/n,r[0]/i,l)/this.worldSize,ur(a,o,l)/this.worldSize)},Oh.prototype.coordinatePoint=function(t){var e=[t.x*this.worldSize,t.y*this.worldSize,0,1];return _s(e,e,this.pixelMatrix),new i(e[0]/e[3],e[1]/e[3])},Oh.prototype.getBounds=function(){return (new zh).extend(this.pointLocation(new i(0,0))).extend(this.pointLocation(new i(this.width,0))).extend(this.pointLocation(new i(this.width,this.height))).extend(this.pointLocation(new i(0,this.height)))},Oh.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new zh([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},Oh.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]);},Oh.prototype.calculatePosMatrix=function(t,e){void 0===e&&(e=!1);var r=t.canonical,n="Sg4326"==r.reference;n&&(e=!0);var i=t.key,a=e?this._alignedPosMatrixCache:this._posMatrixCache;if(a[i])return a[i];var o=this.worldSize/this.zoomScale(r.z),s=r.x+Math.pow(2,r.z)*t.wrap,u=ps(new Float64Array(16));if(n){var l=r._tileY;fs(u,u,[s*o,l[0]*o,0]),ys(u,u,[1,l[1],1]);}else fs(u,u,[s*o,r.y*o,0]);return ys(u,u,[o/8192,o/8192,1]),cs(u,e?this.alignedProjMatrix:this.projMatrix,u),a[i]=new Float32Array(u),a[i]},Oh.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},Oh.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var t,e,r,n,a=-90,o=90,s=-180,u=180,l=this.size,p=this._unmodified;if(this.latRange){var h=this.latRange;a=Ch(h[1])*this.worldSize,t=(o=Ch(h[0])*this.worldSize)-a<l.y?l.y/(o-a):0;}if(this.lngRange){var c=this.lngRange;s=Vh(c[0])*this.worldSize,e=(u=Vh(c[1])*this.worldSize)-s<l.x?l.x/(u-s):0;}var f=this.point,y=Math.max(e||0,t||0);if(y)return this.center=this.unproject(new i(e?(u+s)/2:f.x,t?(o+a)/2:f.y)),this.zoom+=this.scaleZoom(y),this._unmodified=p,void(this._constraining=!1);if(this.latRange){var d=f.y,m=l.y/2;d-m<a&&(n=a+m),d+m>o&&(n=o-m);}if(this.lngRange){var v=f.x,g=l.x/2;v-g<s&&(r=s+g),v+g>u&&(r=u-g);}void 0===r&&void 0===n||(this.center=this.unproject(new i(void 0!==r?r:f.x,void 0!==n?n:f.y))),this._unmodified=p,this._constraining=!1;}},Oh.prototype._calcMatrices=function(){if(this.height){var t=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var e=Math.PI/2+this._pitch,r=this._fov*(.5+t.y/this.height),n=Math.sin(r)*this.cameraToCenterDistance/Math.sin(u(Math.PI-e-r,.01,Math.PI-.01)),i=this.point,a=i.x,o=i.y,s=1.01*(Math.cos(Math.PI/2-this._pitch)*n+this.cameraToCenterDistance),l=this.height/50,p=new Float64Array(16);vs(p,this._fov,this.width/this.height,l,s),p[8]=2*-t.x/this.width,p[9]=2*t.y/this.height,ys(p,p,[1,-1,1]),fs(p,p,[0,0,-this.cameraToCenterDistance]),ds(p,p,this._pitch),ms(p,p,this.angle),fs(p,p,[-a,-o,0]),this.mercatorMatrix=ys([],p,[this.worldSize,this.worldSize,this.worldSize]),ys(p,p,[1,1,Th(1,this.center.lat)*this.worldSize,1]),this.projMatrix=p,this.invProjMatrix=hs([],this.projMatrix);var h=this.width%2/2,c=this.height%2/2,f=Math.cos(this.angle),y=Math.sin(this.angle),d=a-Math.round(a)+f*h+y*c,m=o-Math.round(o)+f*c+y*h,v=new Float64Array(p);if(fs(v,v,[d>.5?d-1:d,m>.5?m-1:m,0]),this.alignedProjMatrix=v,ys(p=ls(),p,[this.width/2,-this.height/2,1]),fs(p,p,[1,-1,0]),this.labelPlaneMatrix=p,ys(p=ls(),p,[1,-1,1]),fs(p,p,[-1,-1,0]),ys(p,p,[2/this.width,2/this.height,1]),this.glCoordMatrix=p,this.pixelMatrix=cs(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(p=hs(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=p,this._posMatrixCache={},this._alignedPosMatrixCache={};}},Oh.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var t=this.pointCoordinate(new i(0,0)),e=[t.x*this.worldSize,t.y*this.worldSize,0,1];return _s(e,e,this.pixelMatrix)[3]/this.cameraToCenterDistance},Oh.prototype.getCameraPoint=function(){var t=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new i(0,t))},Oh.prototype.getCameraQueryGeometry=function(t){var e=this.getCameraPoint();if(1===t.length)return [t[0],e];for(var r=e.x,n=e.y,a=e.x,o=e.y,s=0,u=t;s<u.length;s+=1){var l=u[s];r=Math.min(r,l.x),n=Math.min(n,l.y),a=Math.max(a,l.x),o=Math.max(o,l.y);}return [new i(r,n),new i(a,n),new i(a,o),new i(r,o),new i(r,n)]},Object.defineProperties(Oh.prototype,jh),Oh.prototype.type="EPSG:3857";var Uh={Transform:Oh,Coordinate:Fh,xFromLng:Vh,yFromLat:Ch,zFromAltitude:Th,lngFromX:Eh,latFromY:Bh,altitudeFromZ:Dh,scale:Lh},qh=2*Math.PI*6378137;function Nh(t){return qh*Math.cos(t*Math.PI/180)}function Zh(t){return (180+t)/360}function Gh(t){return (90-t)/360}function Yh(t,e){return t/Nh(e)}function Xh(t){return 360*t-180}function Kh(t){return 90-360*t}function Jh(t,e){return t*Nh(Kh(e))}function Hh(t){return 1/Math.cos(t*Math.PI/180)}var Qh=function(t,e,r){void 0===r&&(r=0),this.x=+t,this.y=+e,this.z=+r;};Qh.fromLngLat=function(t,e){void 0===e&&(e=0);var r=Ih.convert(t);return new Qh(Zh(r.lng),Gh(r.lat),Yh(e,r.lat))},Qh.prototype.toLngLat=function(){return new Ih(Xh(this.x),Kh(this.y))},Qh.prototype.toAltitude=function(){return Jh(this.z,this.y)},Qh.prototype.meterInMercatorCoordinateUnits=function(){return 1/qh*Hh(Kh(this.y))};var Wh=function(t,e,r,n,i){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===i||i,this._minZoom=t||0,this._maxZoom=e||22,this._minPitch=null==r?0:r,this._maxPitch=null==n?60:n,this.setMaxBounds(),this.width=0,this.height=0,this._center=new Ih(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Rh,this._posMatrixCache={},this._alignedPosMatrixCache={};},$h={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}};Wh.prototype.clone=function(){var t=new Wh(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},$h.minZoom.get=function(){return this._minZoom},$h.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t));},$h.maxZoom.get=function(){return this._maxZoom},$h.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t));},$h.minPitch.get=function(){return this._minPitch},$h.minPitch.set=function(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t));},$h.maxPitch.get=function(){return this._maxPitch},$h.maxPitch.set=function(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t));},$h.renderWorldCopies.get=function(){return this._renderWorldCopies},$h.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t;},$h.worldSize.get=function(){return this.tileSize*this.scale},$h.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},$h.size.get=function(){return new i(this.width,this.height)},$h.bearing.get=function(){return -this.angle/Math.PI*180},$h.bearing.set=function(t){var e=-l(t,-180,180)*Math.PI/180;this.angle!==e&&(this._unmodified=!1,this.angle=e,this._calcMatrices(),this.rotationMatrix=ss(),us(this.rotationMatrix,this.rotationMatrix,this.angle));},$h.pitch.get=function(){return this._pitch/Math.PI*180},$h.pitch.set=function(t){var e=u(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==e&&(this._unmodified=!1,this._pitch=e,this._calcMatrices());},$h.fov.get=function(){return this._fov/Math.PI*180},$h.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());},$h.zoom.get=function(){return this._zoom},$h.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());},$h.center.get=function(){return this._center},$h.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices());},$h.padding.get=function(){return this._edgeInsets.toJSON()},$h.padding.set=function(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices());},$h.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},Wh.prototype.isPaddingEqual=function(t){return this._edgeInsets.equals(t)},Wh.prototype.interpolatePadding=function(t,e,r){this._unmodified=!1,this._edgeInsets.interpolate(t,e,r),this._constrain(),this._calcMatrices();},Wh.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)},Wh.prototype.getVisibleUnwrappedCoordinates=function(t){var e=[new ic(0,t)];if(this._renderWorldCopies)for(var r=this.pointCoordinate(new i(0,0)),n=this.pointCoordinate(new i(this.width,0)),a=this.pointCoordinate(new i(this.width,this.height)),o=this.pointCoordinate(new i(0,this.height)),s=Math.floor(Math.min(r.x,n.x,a.x,o.x)),u=Math.floor(Math.max(r.x,n.x,a.x,o.x)),l=s-1;l<=u+1;l++)0!==l&&e.push(new ic(l,t));return e},Wh.prototype.coveringTiles=function(t){var e=this.coveringZoomLevel(t),r=e;if(void 0!==t.minzoom&&e<t.minzoom)return [];void 0!==t.maxzoom&&e>t.maxzoom&&(e=t.maxzoom);var n=Qh.fromLngLat(this.center),i=Math.pow(2,e),a=[i*n.x,i*n.y,0],o=Ah.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,e),s=t.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(s=e);var u=function(t){return {aabb:new Sh([t*i,0,0],[(t+1)*i,i,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}},l=[],p=[],h=e,c=t.reparseOverscaled?r:e;if(this._renderWorldCopies)for(var f=1;f<=3;f++)l.push(u(-f)),l.push(u(f));for(l.push(u(0));l.length>0;){var y=l.pop(),d=y.x,m=y.y,v=y.fullyVisible;if(!v){var g=y.aabb.intersects(o);if(0===g)continue;v=2===g;}var x=y.aabb.distanceX(a),b=y.aabb.distanceY(a),w=Math.max(Math.abs(x),Math.abs(b));if(y.zoom===h||w>3+(1<<h-y.zoom)-2&&y.zoom>=s)p.push({tileID:new ac(y.zoom===h?c:y.zoom,y.wrap,y.zoom,d,m),distanceSq:Es([a[0]-.5-d,a[1]-.5-m])});else for(var _=0;_<4;_++){var A=(d<<1)+_%2,S=(m<<1)+(_>>1);l.push({aabb:y.aabb.quadrant(_),zoom:y.zoom+1,x:A,y:S,wrap:y.wrap,fullyVisible:v});}}return p.sort((function(t,e){return t.distanceSq-e.distanceSq})).map((function(t){return t.tileID}))},Wh.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices();},$h.unmodified.get=function(){return this._unmodified},Wh.prototype.zoomScale=function(t){return Math.pow(2,t)},Wh.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},Wh.prototype.project=function(t){var e=u(t.lat,-this.maxValidLatitude,this.maxValidLatitude);return new i(Zh(t.lng)*this.worldSize,Gh(e)*this.worldSize)},Wh.prototype.unproject=function(t){return new Qh(t.x/this.worldSize,t.y/this.worldSize).toLngLat()},$h.point.get=function(){return this.project(this.center)},Wh.prototype.setLocationAtPoint=function(t,e){var r=this.pointCoordinate(e),n=this.pointCoordinate(this.centerPoint),i=this.locationCoordinate(t),a=new Qh(i.x-(r.x-n.x),i.y-(r.y-n.y));this.center=this.coordinateLocation(a),this._renderWorldCopies&&(this.center=this.center.wrap());},Wh.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},Wh.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},Wh.prototype.locationCoordinate=function(t){return Qh.fromLngLat(t)},Wh.prototype.coordinateLocation=function(t){return t.toLngLat()},Wh.prototype.pointCoordinate=function(t){var e=[t.x,t.y,0,1],r=[t.x,t.y,1,1];_s(e,e,this.pixelMatrixInverse),_s(r,r,this.pixelMatrixInverse);var n=e[3],i=r[3],a=e[1]/n,o=r[1]/i,s=e[2]/n,u=r[2]/i,l=s===u?0:(0-s)/(u-s);return new Qh(ur(e[0]/n,r[0]/i,l)/this.worldSize,ur(a,o,l)/this.worldSize)},Wh.prototype.coordinatePoint=function(t){var e=[t.x*this.worldSize,t.y*this.worldSize,0,1];return _s(e,e,this.pixelMatrix),new i(e[0]/e[3],e[1]/e[3])},Wh.prototype.getBounds=function(){return (new zh).extend(this.pointLocation(new i(0,0))).extend(this.pointLocation(new i(this.width,0))).extend(this.pointLocation(new i(this.width,this.height))).extend(this.pointLocation(new i(0,this.height)))},Wh.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new zh([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},Wh.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]);},Wh.prototype.calculatePosMatrix=function(t,e){void 0===e&&(e=!1);var r=t.key,n=e?this._alignedPosMatrixCache:this._posMatrixCache;if(n[r])return n[r];var i=t.canonical,a=this.worldSize/this.zoomScale(i.z),o=i.x+Math.pow(2,i.z)*t.wrap,s=ps(new Float64Array(16));return fs(s,s,[o*a,i.y*a,0]),ys(s,s,[a/8192,a/8192,1]),cs(s,e?this.alignedProjMatrix:this.projMatrix,s),n[r]=new Float32Array(s),n[r]},Wh.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},Wh.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var t,e,r,n,a=-90,o=90,s=-180,u=180,l=this.size,p=this._unmodified;if(this.latRange){var h=this.latRange;a=Gh(h[1])*this.worldSize,t=(o=Gh(h[0])*this.worldSize)-a<l.y?l.y/(o-a):0;}if(this.lngRange){var c=this.lngRange;s=Zh(c[0])*this.worldSize,e=(u=Zh(c[1])*this.worldSize)-s<l.x?l.x/(u-s):0;}var f=this.point,y=Math.max(e||0,t||0);if(y)return this.center=this.unproject(new i(e?(u+s)/2:f.x,t?(o+a)/2:f.y)),this.zoom+=this.scaleZoom(y),this._unmodified=p,void(this._constraining=!1);if(this.latRange){var d=f.y,m=l.y/2;d-m<a&&(n=a+m),d+m>o&&(n=o-m);}if(this.lngRange){var v=f.x,g=l.x/2;v-g<s&&(r=s+g),v+g>u&&(r=u-g);}void 0===r&&void 0===n||(this.center=this.unproject(new i(void 0!==r?r:f.x,void 0!==n?n:f.y))),this._unmodified=p,this._constraining=!1;}},Wh.prototype._calcMatrices=function(){if(this.height){var t=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var e=Math.PI/2+this._pitch,r=this._fov*(.5+t.y/this.height),n=Math.sin(r)*this.cameraToCenterDistance/Math.sin(u(Math.PI-e-r,.01,Math.PI-.01)),i=this.point,a=i.x,o=i.y,s=1.01*(Math.cos(Math.PI/2-this._pitch)*n+this.cameraToCenterDistance),l=this.height/50,p=new Float64Array(16);vs(p,this._fov,this.width/this.height,l,s),p[8]=2*-t.x/this.width,p[9]=2*t.y/this.height,ys(p,p,[1,-1,1]),fs(p,p,[0,0,-this.cameraToCenterDistance]),ds(p,p,this._pitch),ms(p,p,this.angle),fs(p,p,[-a,-o,0]),this.mercatorMatrix=ys([],p,[this.worldSize,this.worldSize,this.worldSize]),ys(p,p,[1,1,Yh(1,this.center.lat)*this.worldSize,1]),this.projMatrix=p,this.invProjMatrix=hs([],this.projMatrix);var h=this.width%2/2,c=this.height%2/2,f=Math.cos(this.angle),y=Math.sin(this.angle),d=a-Math.round(a)+f*h+y*c,m=o-Math.round(o)+f*c+y*h,v=new Float64Array(p);if(fs(v,v,[d>.5?d-1:d,m>.5?m-1:m,0]),this.alignedProjMatrix=v,ys(p=ls(),p,[this.width/2,-this.height/2,1]),fs(p,p,[1,-1,0]),this.labelPlaneMatrix=p,ys(p=ls(),p,[1,-1,1]),fs(p,p,[-1,-1,0]),ys(p,p,[2/this.width,2/this.height,1]),this.glCoordMatrix=p,this.pixelMatrix=cs(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(p=hs(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=p,this._posMatrixCache={},this._alignedPosMatrixCache={};}},Wh.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var t=this.pointCoordinate(new i(0,0)),e=[t.x*this.worldSize,t.y*this.worldSize,0,1];return _s(e,e,this.pixelMatrix)[3]/this.cameraToCenterDistance},Wh.prototype.getCameraPoint=function(){var t=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new i(0,t))},Wh.prototype.getCameraQueryGeometry=function(t){var e=this.getCameraPoint();if(1===t.length)return [t[0],e];for(var r=e.x,n=e.y,a=e.x,o=e.y,s=0,u=t;s<u.length;s+=1){var l=u[s];r=Math.min(r,l.x),n=Math.min(n,l.y),a=Math.max(a,l.x),o=Math.max(o,l.y);}return [new i(r,n),new i(a,n),new i(a,o),new i(r,o),new i(r,n)]},Object.defineProperties(Wh.prototype,$h),Wh.prototype.type="EPSG:4326";var tc={"EPSG:3857":Uh,"EPSG:4326":{Transform:Wh,Coordinate:Qh,xFromLng:Zh,yFromLat:Gh,zFromAltitude:Yh,lngFromX:Xh,latFromY:Kh,altitudeFromZ:Jh,scale:Hh}},ec={parse:null,transform:null,key:"EPSG:3857"};function rc(t){var e=t.crs,r=t.minZoom,n=t.maxZoom,i=t.minPitch,a=t.maxPitch,o=t.renderWorldCopies;if(Object.prototype.hasOwnProperty.call(tc,e))return "EPSG:4326"==e&&(t.renderWorldCopies=!1),ec.key=e,ec.parse=tc[e],ec.transform=new tc[e].Transform(r,n,i,a,o),ec.transform;throw new Error(e+"不存在此crs类型")}var nc=function(t,e,r,n,i,a){this.z=t,this.x=e,this.y=r,this.reference=n,this.sourceID=i,this._tileY=a,this.key=oc(0,t,t,e,r,this.sourceID);};nc.prototype.equals=function(t){var e=this.sourceID;return e?this.z===t.z&&this.x===t.x&&this.y===t.y&&e===t.sourceID:this.z===t.z&&this.x===t.x&&this.y===t.y},nc.prototype.url=function(t,e){var r,n,i,a,o,s=(n=this.y,i=this.z,a=kh(256*(r=this.x),256*(n=Math.pow(2,i)-n-1),i),o=kh(256*(r+1),256*(n+1),i),a[0]+","+a[1]+","+o[0]+","+o[1]),u=function(t,e,r){for(var n,i="",a=t;a>0;a--)i+=(e&(n=1<<a-1)?1:0)+(r&n?2:0);return i}(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("{quadkey}",u).replace("{bbox-epsg-3857}",s).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))},nc.prototype.getTilePoint=function(t){var e=Math.pow(2,this.z);if("Sg4326"==this.reference){var r=this._tileY;return new i(8192*(t.x*e-this.x),(t.y*e-r[0])/r[1]*8192)}return new i(8192*(t.x*e-this.x),8192*(t.y*e-this.y))},nc.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var ic=function(t,e){this.wrap=t,this.canonical=e,this.key=oc(t,e.z,e.z,e.x,e.y,e.sourceID);},ac=function(t,e,r,n,i,a,o,s,u,l){this.reference=a,this.sourceID=o,this.zoomRule=s,this._tileY=u,this._mapZoom=l,this.overscaledZ=t,this.wrap=e,this.canonical=new nc(r,+n,+i,a,o,u),this.key=oc(e,t,r,n,i,o);};function oc(t,e,r,n,i,a){(t*=2)<0&&(t=-1*t-1);var o=1<<r,s=(o*o*t+o*i+n).toString(36)+r.toString(36)+e.toString(36);return a&&(s+=a.toString(36)),s}function sc(t,e,r,n,i){this.properties={},this.extent=r,this.type=0,this._pbf=t,this._geometry=-1,this._keys=n,this._values=i,t.readFields(uc,this,e);}function uc(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 n=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[n]=i;}}(r,e):3==t?e.type=r.readVarint():4==t&&(e._geometry=r.pos);}function lc(t){for(var e,r,n=0,i=0,a=t.length,o=a-1;i<a;o=i++)n+=((r=t[o]).x-(e=t[i]).x)*(e.y+r.y);return n}function pc(t,e,r){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(hc,this,e),this.length=this._features.length,this.tileID=r;}function hc(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 n=t.readVarint()>>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null;}return e}(r));}ac.prototype.equals=function(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)},ac.prototype.scaledTo=function(t,e){e||(e=0),t+=e;var r=this.zoomRule;if(r&&r.length>0){r=JSON.parse(r);var n=0;for(var i in r){if(0==n&&i.indexOf(t)>=0){n=1;break}if(1==n){t=r[i]||0,n=2;break}}}var a=this.canonical.z-t;return t>this.canonical.z?new ac(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y,this.reference,this.sourceID,this.zoomRule,this._tileY,this._mapZoom):new ac(t,this.wrap,t,this.canonical.x>>a,this.canonical.y>>a,this.reference,this.sourceID,this.zoomRule,this._tileY,this._mapZoom)},ac.prototype.calculateScaledKey=function(t,e){var r=this.canonical.z-t;return t>this.canonical.z?oc(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y,this.sourceID):oc(this.wrap*+e,t,t,this.canonical.x>>r,this.canonical.y>>r,this.sourceID)},ac.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},ac.prototype.children=function(t){if(this.overscaledZ>=t)return [new ac(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y,this.reference,this.sourceID,this.zoomRule,this._tileY,this._mapZoom)];var e=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return [new ac(e,this.wrap,e,r,n,this.reference,this.sourceID,this.zoomRule,this._tileY,this._mapZoom),new ac(e,this.wrap,e,r+1,n,this.reference,this.sourceID,this.zoomRule,this._tileY,this._mapZoom),new ac(e,this.wrap,e,r,n+1,this.reference,this.sourceID,this.zoomRule,this._tileY,this._mapZoom),new ac(e,this.wrap,e,r+1,n+1,this.reference,this.sourceID,this.zoomRule,this._tileY,this._mapZoom)]},ac.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))},ac.prototype.wrapped=function(){return new ac(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y,this.reference,this.sourceID,this.zoomRule,this._tileY,this._mapZoom)},ac.prototype.unwrapTo=function(t){return new ac(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y,this.reference,this.sourceID,this.zoomRule,this._tileY,this._mapZoom)},ac.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},ac.prototype.toUnwrapped=function(){return new ic(this.wrap,this.canonical)},ac.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},ac.prototype.getTilePoint=function(t){return this.canonical.getTilePoint(new(0,ec.parse.Coordinate)(t.x-this.wrap,t.y))},ri("CanonicalTileID",nc),ri("OverscaledTileID",ac,{omit:["posMatrix"]}),sc.types=["Unknown","Point","LineString","Polygon"],sc.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,r=t.readVarint()+t.pos,n=1,a=0,o=0,s=0,u=[];t.pos<r;){if(a<=0){var l=t.readVarint();n=7&l,a=l>>3;}if(a--,1===n||2===n)o+=t.readSVarint(),s+=t.readSVarint(),1===n&&(e&&u.push(e),e=[]),e.push(new i(o,s));else {if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone());}}return e&&u.push(e),u},sc.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,a=0,o=1/0,s=-1/0,u=1/0,l=-1/0;t.pos<e;){if(n<=0){var p=t.readVarint();r=7&p,n=p>>3;}if(n--,1===r||2===r)(i+=t.readSVarint())<o&&(o=i),i>s&&(s=i),(a+=t.readSVarint())<u&&(u=a),a>l&&(l=a);else if(7!==r)throw new Error("unknown command "+r)}return [o,u,s,l]},sc.prototype.toGeoJSON=function(t,e,r){var n,i,a=this.extent*Math.pow(2,r),o=this.extent*t,s=this.extent*e,u=this.loadGeometry(),l=sc.types[this.type],p=this.tileID&&"Sg4326"==this.tileID.reference,h=this.properties.resolution,c=Number(this.type);function f(n){for(var i=0;i<n.length;i++){var u=n[i];if(p){var l=Fo(r,c,t,e,u.x,u.y,h);n[i]=[l.lon,l.lat];}else n[i]=[360*(u.x+o)/a-180,360/Math.PI*Math.atan(Math.exp((180-360*(u.y+s)/a)*Math.PI/180))-90];}}switch(this.type){case 1:var y=[];for(n=0;n<u.length;n++)y[n]=u[n][0];f(u=y);break;case 2:for(n=0;n<u.length;n++)f(u[n]);break;case 3:for(u=function(t){var e=t.length;if(e<=1)return [t];for(var r,n,i=[],a=0;a<e;a++){var o=lc(t[a]);0!==o&&(void 0===n&&(n=o<0),n===o<0?(r&&i.push(r),r=[t[a]]):r.push(t[a]));}return r&&i.push(r),i}(u),n=0;n<u.length;n++)for(i=0;i<u[n].length;i++)f(u[n][i]);}1===u.length?u=u[0]:l="Multi"+l;var d={type:"Feature",geometry:{type:l,coordinates:u},properties:this.properties};return "id"in this&&(d.id=this.id),d},pc.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,r=new sc(this._pbf,e,this.extent,this._keys,this._values);return this.tileID&&(r.tileID=this.tileID),r};var cc={VectorTile:function(t,e,r){this.layers=t.readFields((function(t,e,n){if(3===t){var i=new pc(n,n.readVarint()+n.pos,r);i.length&&(e[i.name]=i);}}),{},e);},VectorTileFeature:sc,VectorTileLayer:pc},fc=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;}};fc.prototype.encode=function(t){return this._stringToNumber[t]},fc.prototype.decode=function(t){return this._numberToString[t]};var yc=function(t,e,r,n,i){this.type="Feature",this._vectorTileFeature=t,t._z=e,t._x=r,t._y=n,this.properties=t.properties,this.id=i;},dc={geometry:{configurable:!0}};dc.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},dc.geometry.set=function(t){this._geometry=t;},yc.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(yc.prototype,dc);var mc=function(t,e,r){this.tileID=t,this.uid=y(),this.uses=0,this.tileSize=e,this.tileZoom=r,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.expiredRequestCount=0,this.state="loading";};mc.prototype.registerFadeDuration=function(t){var e=t+this.timeAdded;e<U.now()||this.fadeEndTime&&e<this.fadeEndTime||(this.fadeEndTime=e);},mc.prototype.wasRequested=function(){return "errored"===this.state||"loaded"===this.state||"reloading"===this.state},mc.prototype.loadVectorData=function(t,e,r){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){for(var n in t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestFeatureIndex.rawTileData=t.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=function(t,e){var r={};if(!e)return r;for(var n=function(){var t=a[i],n=t.layerIds.map((function(t){return e.getLayer(t)})).filter(Boolean);if(0!==n.length){t.layers=n,t.stateDependentLayerIds&&(t.stateDependentLayers=t.stateDependentLayerIds.map((function(t){return n.filter((function(e){return e.id===t}))[0]})));for(var o=0,s=n;o<s.length;o+=1)r[s[o].id]=t;}},i=0,a=t;i<a.length;i+=1)n();return r}(t.buckets,e.style),this.hasSymbolBuckets=!1,this.buckets){var i=this.buckets[n];if(i instanceof Kp){if(this.hasSymbolBuckets=!0,!r)break;i.justReloaded=!0;}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(var a in this.buckets){var o=this.buckets[a];if(o instanceof Kp&&o.hasRTLText){this.hasRTLText=!0,Hi.isLoading()||Hi.isLoaded()||"deferred"!==Ki()||Ji();break}}for(var s in this.queryPadding=0,this.buckets){var u=this.buckets[s];this.queryPadding=Math.max(this.queryPadding,e.style.getLayer(s).queryRadius(u));}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage),t.lineAtlas&&(this.lineAtlas=t.lineAtlas);}else this.collisionBoxArray=new Na;},mc.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.lineAtlas&&(this.lineAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.lineAtlasTexture&&this.lineAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded";},mc.prototype.getBucket=function(t){return this.buckets[t.id]},mc.prototype.upload=function(t){for(var e in this.buckets){var r=this.buckets[e];r.uploadPending()&&r.upload(t);}var n=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new gh(t,this.imageAtlas.image,n.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new gh(t,this.glyphAtlasImage,n.ALPHA),this.glyphAtlasImage=null),this.lineAtlas&&!this.lineAtlas.uploaded&&(this.lineAtlasTexture=new gh(t,this.lineAtlas.image,n.ALPHA),this.lineAtlas.uploaded=!0);},mc.prototype.prepare=function(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture);},mc.prototype.queryRenderedFeatures=function(t,e,r,n,i,a,o,s,u,l){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:n,cameraQueryGeometry:i,scale:a,tileSize:this.tileSize,pixelPosMatrix:l,transform:s,params:o,queryPadding:this.queryPadding*u},t,e,r,this.buckets):{}},mc.prototype.querySourceFeatures=function(t,e){var r=this.latestFeatureIndex;if(r&&r.rawTileData){var n=r.loadVTLayers(),i=e?e.sourceLayer:"",a=n._geojsonTileLayer||n[i];if(a)for(var o=Sn(e&&e.filter),s=this.tileID.canonical,u=s.z,l=s.x,p=s.y,h={z:u,x:l,y:p},c=0;c<a.length;c++){var f=a.feature(c);if(o.filter(new Qi(this.tileID.overscaledZ),f)){var y=r.getId(f,i),d=new yc(f,u,l,p,y);d.tile=h,t.push(d);}}}},mc.prototype.hasData=function(){return "loaded"===this.state||"reloading"===this.state||"expired"===this.state},mc.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},mc.prototype.setExpiryData=function(t){var e=this.expirationTime;if(t.cacheControl){var r=M(t.cacheControl);r["max-age"]&&(this.expirationTime=Date.now()+1e3*r["max-age"]);}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){var n=Date.now(),i=!1;if(this.expirationTime>n)i=!1;else if(e)if(this.expirationTime<e)i=!0;else {var a=this.expirationTime-e;a?this.expirationTime=n+Math.max(a,3e4):i=!0;}else i=!0;i?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0;}},mc.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)},mc.prototype.setFeatureState=function(t,e){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData&&0!==Object.keys(t).length){var r=this.latestFeatureIndex.loadVTLayers();for(var n in this.buckets)if(e.style.hasLayer(n)){var i=this.buckets[n],a=i.layers[0].sourceLayer||"_geojsonTileLayer",o=r[a],s=t[a];if(o&&s&&0!==Object.keys(s).length){i.update(s,o,this.imageAtlas&&this.imageAtlas.patternPositions||{});var u=e&&e.style&&e.style.getLayer(n);u&&(this.queryPadding=Math.max(this.queryPadding,u.queryRadius(i)));}}}},mc.prototype.holdingForFade=function(){return void 0!==this.symbolFadeHoldUntil},mc.prototype.symbolFadeFinished=function(){return !this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<U.now()},mc.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0;},mc.prototype.setHoldDuration=function(t){this.symbolFadeHoldUntil=U.now()+t;},mc.prototype.setDependencies=function(t,e){for(var r={},n=0,i=e;n<i.length;n+=1)r[i[n]]=!0;this.dependencies[t]=r;},mc.prototype.hasDependency=function(t,e){for(var r=0,n=t;r<n.length;r+=1){var i=this.dependencies[n[r]];if(i)for(var a=0,o=e;a<o.length;a+=1)if(i[o[a]])return !0}return !1};var vc=function(){this.state={},this.stateChanges={},this.deletedStates={};};vc.prototype.updateState=function(t,e,r){var n=String(e);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][n]=this.stateChanges[t][n]||{},c(this.stateChanges[t][n],r),null===this.deletedStates[t])for(var i in this.deletedStates[t]={},this.state[t])i!==n&&(this.deletedStates[t][i]=null);else if(this.deletedStates[t]&&null===this.deletedStates[t][n])for(var a in this.deletedStates[t][n]={},this.state[t][n])r[a]||(this.deletedStates[t][n][a]=null);else for(var o in r)this.deletedStates[t]&&this.deletedStates[t][n]&&null===this.deletedStates[t][n][o]&&delete this.deletedStates[t][n][o];},vc.prototype.removeFeatureState=function(t,e,r){if(null!==this.deletedStates[t]){var n=String(e);if(this.deletedStates[t]=this.deletedStates[t]||{},r&&void 0!==e)null!==this.deletedStates[t][n]&&(this.deletedStates[t][n]=this.deletedStates[t][n]||{},this.deletedStates[t][n][r]=null);else if(void 0!==e)if(this.stateChanges[t]&&this.stateChanges[t][n])for(r in this.deletedStates[t][n]={},this.stateChanges[t][n])this.deletedStates[t][n][r]=null;else this.deletedStates[t][n]=null;else this.deletedStates[t]=null;}},vc.prototype.getState=function(t,e){var r=String(e),n=c({},(this.state[t]||{})[r],(this.stateChanges[t]||{})[r]);if(null===this.deletedStates[t])return {};if(this.deletedStates[t]){var i=this.deletedStates[t][e];if(null===i)return {};for(var a in i)delete n[a];}return n},vc.prototype.initializeTileState=function(t,e){t.setFeatureState(this.state,e);},vc.prototype.coalesceChanges=function(t,e){var r={};for(var n in this.stateChanges){this.state[n]=this.state[n]||{};var i={};for(var a in this.stateChanges[n])this.state[n][a]||(this.state[n][a]={}),c(this.state[n][a],this.stateChanges[n][a]),i[a]=this.state[n][a];r[n]=i;}for(var o in this.deletedStates){this.state[o]=this.state[o]||{};var s={};if(null===this.deletedStates[o])for(var u in this.state[o])s[u]={},this.state[o][u]={};else for(var l in this.deletedStates[o]){if(null===this.deletedStates[o][l])this.state[o][l]={};else for(var p=0,h=Object.keys(this.deletedStates[o][l]);p<h.length;p+=1)delete this.state[o][l][h[p]];s[l]=this.state[o][l];}r[o]=r[o]||{},c(r[o],s);}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(r).length)for(var f in t)t[f].setFeatureState(r,e);};var gc=function(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new Qn(8192,16,0),this.grid3D=new Qn(8192,16,0),this.featureIndexArray=new Qa,this.promoteId=e;};function xc(t,e,r,n,i){return x(t,(function(t,a){var o=e instanceof aa?e.get(a):null;return o&&o.evaluate?o.evaluate(r,n,i):o}))}function bc(t){for(var e=1/0,r=1/0,n=-1/0,i=-1/0,a=0,o=t;a<o.length;a+=1){var s=o[a];e=Math.min(e,s.x),r=Math.min(r,s.y),n=Math.max(n,s.x),i=Math.max(i,s.y);}return {minX:e,minY:r,maxX:n,maxY:i}}function wc(t,e){return e-t}gc.prototype.insert=function(t,e,r,n,i,a){var o=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,n,i);for(var s=a?this.grid3D:this.grid,u=0;u<e.length;u++){for(var l=e[u],p=[1/0,1/0,-1/0,-1/0],h=0;h<l.length;h++){var c=l[h];p[0]=Math.min(p[0],c.x),p[1]=Math.min(p[1],c.y),p[2]=Math.max(p[2],c.x),p[3]=Math.max(p[3],c.y);}p[0]<8192&&p[1]<8192&&p[2]>=0&&p[3]>=0&&s.insert(o,p[0],p[1],p[2],p[3]);}},gc.prototype.loadVTLayers=function(){if(!this.vtLayers){var t=this.tileID,e=t.canonical,r=t.reference,n=t._tileY;this.vtLayers=new cc.VectorTile(new gl(this.rawTileData),null,{reference:r,_tileY:n,x:e.x,y:e.y,z:e.z}).layers,this.sourceLayerCoder=new fc(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]);}return this.vtLayers},gc.prototype.query=function(t,e,r,n,a){var o=this;this.loadVTLayers();for(var s=t.params||{},u=8192/t.tileSize/t.scale,l=Sn(s.filter),p=t.queryGeometry,h=t.queryPadding*u,c=bc(p),f=this.grid.query(c.minX-h,c.minY-h,c.maxX+h,c.maxY+h),y=bc(t.cameraQueryGeometry),d=this.grid3D.query(y.minX-h,y.minY-h,y.maxX+h,y.maxY+h,(function(e,r,n,a){return function(t,e,r,n,a){for(var o=0,s=t;o<s.length;o+=1){var u=s[o];if(e<=u.x&&r<=u.y&&n>=u.x&&a>=u.y)return !0}var l=[new i(e,r),new i(e,a),new i(n,a),new i(n,r)];if(t.length>2)for(var p=0,h=l;p<h.length;p+=1)if($o(t,h[p]))return !0;for(var c=0;c<t.length-1;c++)if(ts(t[c],t[c+1],l))return !0;return !1}(t.cameraQueryGeometry,e-h,r-h,n+h,a+h)})),m=0,v=d;m<v.length;m+=1)f.push(v[m]);f.sort(wc);for(var g,x={},b=function(i){var h=f[i];if(h!==g){g=h;var c=o.featureIndexArray.get(h),y=null;o.loadMatchingFeature(x,c.bucketIndex,c.sourceLayerIndex,c.featureIndex,l,s.layers,s.availableImages,e,r,n,(function(e,r,n){return y||(y=Uo(e)),r.queryIntersectsFeature(p,e,n,y,o.z,t.transform,u,t.pixelPosMatrix,a[r.id])}));}},w=0;w<f.length;w++)b(w);return x},gc.prototype.loadMatchingFeature=function(t,e,r,n,i,a,o,s,u,l,p){var h=this.bucketLayerIDs[e];if(!a||function(t,e){for(var r=0;r<t.length;r++)if(e.indexOf(t[r])>=0)return !0;return !1}(a,h)){var c=this.sourceLayerCoder.decode(r),f=this.vtLayers[c].feature(n);if(i.filter(new Qi(this.tileID.overscaledZ),f))for(var y=this.getId(f,c),d=0;d<h.length;d++){var m=h[d];if(!(a&&a.indexOf(m)<0)){var v=s[m];if(v){var g={};void 0!==y&&l&&(g=l.getState(v.sourceLayer||"_geojsonTileLayer",y));var x=u[m];x.paint=xc(x.paint,v.paint,f,g,o),x.layout=xc(x.layout,v.layout,f,g,o);var b=!p||p(f,v,g);if(b){var w=new yc(f,this.z,this.x,this.y,y);w.layer=x;var _=t[m];void 0===_&&(_=t[m]=[]),_.push({featureIndex:n,feature:w,intersectionZ:b});}}}}}},gc.prototype.lookupSymbolFeatures=function(t,e,r,n,i,a,o,s){var u={};this.loadVTLayers();for(var l=Sn(i),p=0,h=t;p<h.length;p+=1)this.loadMatchingFeature(u,r,n,h[p],l,a,o,s,e);return u},gc.prototype.hasLayer=function(t){for(var e=0,r=this.bucketLayerIDs;e<r.length;e+=1)for(var n=0,i=r[e];n<i.length;n+=1)if(t===i[n])return !0;return !1},gc.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},ri("FeatureIndex",gc,{omit:["rawTileData","sourceLayerCoder"]});var _c=function(t){var e={},r=[];for(var n in t){var i=t[n],a=e[n]={};for(var o in i){var s=i[+o];if(s&&0!==s.bitmap.width&&0!==s.bitmap.height){var u=s.metrics.localGlyph?2:1,l={x:0,y:0,w:s.bitmap.width+2*u,h:s.bitmap.height+2*u};r.push(l),a[o]={rect:l,metrics:s.metrics};}}}var p=Ol(r),h=new Us({width:p.w||1,height:p.h||1});for(var c in t){var f=t[c];for(var y in f){var d=f[+y];if(d&&0!==d.bitmap.width&&0!==d.bitmap.height){var m=e[c][y].rect,v=d.metrics.localGlyph?2:1;Us.copy(d.bitmap,h,{x:0,y:0},{x:m.x+v,y:m.y+v},d.bitmap);}}}this.image=h,this.positions=e;};ri("GlyphAtlas",_c);var Sc=function(t){var e=t.tileID,r=e.canonical,n=e._mapZoom;this.tileID=new ac(e.overscaledZ,e.wrap,r.z,r.x,r.y,e.reference,e.sourceID,e.zoomRule,e._tileY,n),this.uid=t.uid,this.zoom=n||t.zoom,this.pixelRatio=t.pixelRatio,this.tileSize=t.tileSize,this.source=t.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=t.showCollisionBoxes,this.collectResourceTiming=!!t.collectResourceTiming,this.returnDependencies=!!t.returnDependencies,this.promoteId=t.promoteId,this.isSymbolTile=t.isSymbolTile;};function zc(t,e,r){for(var n=new Qi(e),i=0,a=t;i<a.length;i+=1)a[i].recalculate(n,r);}Sc.prototype.parse=function(t,e,r,n,i){var a=this;this.status="parsing",this.data=t;var o=this.tileID,s=o._mapZoom||this.zoom,u=this.overscaling,l=e._xml,p="Sg4326"==o.reference,c=new Na,f=new fc(Object.keys(t.layers).sort()),y=new gc(o,this.promoteId);y.bucketLayerIDs=[];var d,m,v,g,b={},w=new xh(256,256),_={featureIndex:y,iconDependencies:{},patternDependencies:{},glyphDependencies:{},lineAtlas:w,availableImages:r,eleSymbolVertexs:{}},A=e.familiesBySource[this.source];for(var S in A){var z=t.layers[S];if(z){for(var I=!1,k=!1,M=0,P=A[S];M<P.length;M+=1)"symbol"===P[M][0].type?I=!0:k=!0;if((!0!==this.isSymbolTile||I)&&(!1!==this.isSymbolTile||k)){for(var V=f.encode(S),C=[],T=0,B=0,D=z.length;B<D;B++){var L=z.feature(B),F=y.getId(L,S);if(p){var R=L.properties,O=R.maxzoom,j=R.minzoom,U=0,q=25;if(j>=0?U=j<=3?0:j-1:j=0,O>=0&&(q=O>=19?25:O>U?3==L.type?O+1:O:U+1),s<U||s>=q)continue;if(null==(R=E(R,l,s,p)))continue}C.push({feature:L,id:F,index:B,sourceLayerIndex:V,order:T}),T++;}if(C.length>0){p&&C.length>1&&C[0].feature.properties.paintLevel&&C.sort((function(t,e){return t.feature.properties.paintLevel-e.feature.properties.paintLevel}));for(var N=0,Z=A[S].length;N<Z;N++){var G=A[S][N],Y=G[0];void 0!==this.isSymbolTile&&"symbol"===Y.type!==this.isSymbolTile||Y.minzoom&&s<Math.floor(Y.minzoom)||Y.maxzoom&&s>=Y.maxzoom||"none"!==Y.visibility&&(zc(G,s,r),(b[Y.id]=Y.createBucket({index:y.bucketLayerIDs.length,layers:G,zoom:s,pixelRatio:this.pixelRatio,overscaling:u,collisionBoxArray:c,sourceLayerIndex:V,sourceID:this.source})).populate(C,_,o.canonical),y.bucketLayerIDs.push(G.map((function(t){return t.id}))));}}}}}w.trim();var X={type:"maybePrepare",isSymbolTile:this.isSymbolTile,zoom:this.zoom},K=x(_.glyphDependencies,(function(t){return Object.keys(t).map(Number)}));Object.keys(K).length?n.send("getGlyphs",{uid:this.uid,stacks:K},(function(t,e){d||(d=t,m=e,$.call(a));}),void 0,void 0,X):m={};var J=Object.keys(_.iconDependencies);J.length?n.send("getImages",{icons:J,source:this.source,tileID:o,type:"icons"},(function(t,e){d||(d=t,v=e,$.call(a));}),void 0,void 0,X):v={};var H,Q=Object.keys(_.patternDependencies);Q.length?n.send("getImages",{icons:Q,source:this.source,tileID:o,type:"patterns"},(function(t,e){d||(d=t,g=e,$.call(a));}),void 0,void 0,X):g={};var W=Object.keys(_.eleSymbolVertexs);function $(){if(d)return i(d);if(m&&v&&g&&H){var t=new _c(m),e=new ql(v,g);for(var n in b){var a=b[n];a instanceof Kp?(zc(a.layers,s,r),Lp(a,m,t.positions,v,e.iconPositions,this.showCollisionBoxes,o.canonical)):a instanceof uh?a.addFeatures(H,o.canonical):a.hasPattern&&(a instanceof nl||a instanceof Vu||a instanceof Xu)&&(zc(a.layers,s,r),a.addFeatures(_,o.canonical,e.patternPositions));}this.status="done",i(null,{buckets:h(b).filter((function(t){return !t.isEmpty()})),featureIndex:y,collisionBoxArray:c,glyphAtlasImage:t.image,lineAtlas:w,imageAtlas:e,glyphMap:this.returnDependencies?m:null,iconMap:this.returnDependencies?v:null,glyphPositions:this.returnDependencies?t.positions:null});}}W.length?n.send("getEleSymbolVertexs",{eleSymbolVertexs:W},(function(t,e){d||(d=t,H=e,$.call(a));}),void 0,void 0,X):H={},$.call(this);};var Ic=self.performance,kc=function(t){this._marks={start:[t.url,"start"].join("#"),end:[t.url,"end"].join("#"),measure:t.url.toString()},Ic.mark(this._marks.start);};kc.prototype.finish=function(){Ic.mark(this._marks.end);var t=Ic.getEntriesByName(this._marks.measure);return 0===t.length&&(Ic.measure(this._marks.measure,this._marks.start,this._marks.end),t=Ic.getEntriesByName(this._marks.measure),Ic.clearMarks(this._marks.start),Ic.clearMarks(this._marks.end),Ic.clearMeasures(this._marks.measure)),t};var Mc=function(t){this.entries={},this.scheduler=t;};function Pc(t,e,r){var n=JSON.stringify(t.request);return t.data&&(this.deduped.entries[n]={result:[null,t.data]}),this.deduped.request(n,{type:"parseTile",isSymbolTile:t.isSymbolTile,zoom:t.tileZoom},(function(e){var n=Ot(t.request,(function(n,i,a,o){if(n)e(n);else if(i){var s=t.tileID,u=s.canonical,l=s.reference,p=s._tileY;e(null,{vectorTile:r?void 0:new cc.VectorTile(new gl(i),null,{reference:l,_tileY:p,x:u.x,y:u.y,z:u.z}),rawData:i,cacheControl:a,expires:o});}}));return function(){n.cancel(),e();}}),e)}Mc.prototype.request=function(t,e,r,n){var i=this,a=this.entries[t]=this.entries[t]||{callbacks:[]};if(a.result){var o=a.result,s=o[0],u=o[1];return this.scheduler?this.scheduler.add((function(){n(s,u);}),e):n(s,u),function(){}}return a.callbacks.push(n),a.cancel||(a.cancel=r((function(r,n){a.result=[r,n];for(var o=function(){var t=u[s];i.scheduler?i.scheduler.add((function(){t(r,n);}),e):t(r,n);},s=0,u=a.callbacks;s<u.length;s+=1)o();setTimeout((function(){return delete i.entries[t]}),3e3);}))),function(){a.result||(a.callbacks=a.callbacks.filter((function(t){return t!==n})),a.callbacks.length||(a.cancel(),delete i.entries[t]));}};var Vc=function(t,e,r,n){this.actor=t,this.layerIndex=e,this.availableImages=r,this.loadVectorData=n||Pc,this.loading={},this.loaded={},this.deduped=new Mc(t.scheduler);};Vc.prototype.loadTile=function(t,e){var r=this,n=t.uid,i=!!(t&&t.request&&t.request.collectResourceTiming)&&new kc(t.request),a=this.loading[n]=new Sc(t);a.abort=this.loadVectorData(t,(function(o,s){var u=!r.loading[n];if(delete r.loading[n],u||o||!s)return a.status="done",u||(r.loaded[n]=a),e(o);var l=s.rawData,p={};s.expires&&(p.expires=s.expires),s.cacheControl&&(p.cacheControl=s.cacheControl);var h={};if(i){var f=i.finish();f&&(h.resourceTiming=JSON.parse(JSON.stringify(f)));}var y=t.tileID,d=y.canonical,m=y.reference,v=y._tileY;a.vectorTile=s.vectorTile||new cc.VectorTile(new gl(l),null,{reference:m,_tileY:v,x:d.x,y:d.y,z:d.z}),a.parse(a.vectorTile,r.layerIndex,r.availableImages,r.actor,(function(t,r){if(t||!r)return e(t);e(null,c({rawTileData:l.slice(0)},r,p,h));})),r.loaded=r.loaded||{},r.loaded[n]=a;}));},Vc.prototype.reloadTile=function(t,e){var r=this,n=this.loaded,i=t.uid,a=this;if(n&&n[i]){var o=n[i];o.showCollisionBoxes=t.showCollisionBoxes,o.tileID=t.tileID;var s=function(t,n){var i=o.reloadCallback;i&&(delete o.reloadCallback,o.parse(o.vectorTile,a.layerIndex,r.availableImages,a.actor,i)),e(t,n);};"parsing"===o.status?o.reloadCallback=s:"done"===o.status&&(o.vectorTile?o.parse(o.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s());}},Vc.prototype.abortTile=function(t,e){var r=t.uid,n=this.loading[r];n&&(n.abort&&n.abort(),delete this.loading[r]),e();},Vc.prototype.removeTile=function(t,e){var r=this.loaded,n=t.uid;r&&r[n]&&delete r[n],e();};var Cc=function(t,e,r){if(this.uid=t,e.height!==e.width)throw new RangeError("DEM tiles must be square");if(r&&"sgmap"!==r&&"terrarium"!==r)return S('"'+r+'" is not a valid encoding type. Valid types include "sgmap" and "terrarium".');this.stride=e.height;var n=this.dim=e.height-2;this.data=new Uint32Array(e.data.buffer),this.encoding=r||"sgmap";for(var i=0;i<n;i++)this.data[this._idx(-1,i)]=this.data[this._idx(0,i)],this.data[this._idx(n,i)]=this.data[this._idx(n-1,i)],this.data[this._idx(i,-1)]=this.data[this._idx(i,0)],this.data[this._idx(i,n)]=this.data[this._idx(i,n-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(n,-1)]=this.data[this._idx(n-1,0)],this.data[this._idx(-1,n)]=this.data[this._idx(0,n-1)],this.data[this._idx(n,n)]=this.data[this._idx(n-1,n-1)];};Cc.prototype.get=function(t,e){var r=new Uint8Array(this.data.buffer),n=4*this._idx(t,e);return ("terrarium"===this.encoding?this._unpackTerrarium:this._unpacksgmap)(r[n],r[n+1],r[n+2])},Cc.prototype.getUnpackVector=function(){return "terrarium"===this.encoding?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},Cc.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)},Cc.prototype._unpacksgmap=function(t,e,r){return (256*t*256+256*e+r)/10-1e4},Cc.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},Cc.prototype.getPixels=function(){return new qs({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Cc.prototype.backfillBorder=function(t,e,r){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var n=e*this.dim,i=e*this.dim+this.dim,a=r*this.dim,o=r*this.dim+this.dim;switch(e){case-1:n=i-1;break;case 1:i=n+1;}switch(r){case-1:a=o-1;break;case 1:o=a+1;}for(var s=-e*this.dim,u=-r*this.dim,l=a;l<o;l++)for(var p=n;p<i;p++)this.data[this._idx(p,l)]=t.data[this._idx(p+s,l+u)];},ri("DEMData",Cc);var Tc=["background","symbol","line","fill","fill-extrusion","circle","heatmap","raster","hillshade","esymbol"],Ec=[],Bc=[],Dc="",Lc=[],Fc=[];function Rc(t,e,r,n,i,a){var o=i-r,s=a-n;if(0!==o||0!==s){var u=((t-r)*o+(e-n)*s)/(o*o+s*s);u>1?(r=i,n=a):u>0&&(r+=o*u,n+=s*u);}return (o=t-r)*o+(s=e-n)*s}function Oc(t,e,r,n){var i={id:void 0===t?null:t,type:e,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,r=t.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)jc(t,e);else if("Polygon"===r||"MultiLineString"===r)for(var n=0;n<e.length;n++)jc(t,e[n]);else if("MultiPolygon"===r)for(n=0;n<e.length;n++)for(var i=0;i<e[n].length;i++)jc(t,e[n][i]);}(i),i}function jc(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 Uc(t,e,r,n){if(e.geometry){rc(r);var i=e.geometry.coordinates,a=e.geometry.type,o=Math.pow(r.tolerance/((1<<r.maxZoom)*r.extent),2),s=[],u=e.id;if(r.promoteId?u=e.properties[r.promoteId]:r.generateId&&(u=n||0),"Point"===a)qc(i,s);else if("MultiPoint"===a)for(var l=0;l<i.length;l++)qc(i[l],s);else if("LineString"===a)Nc(i,s,o,!1);else if("MultiLineString"===a){if(r.lineMetrics){for(l=0;l<i.length;l++)Nc(i[l],s=[],o,!1),t.push(Oc(u,"LineString",s,e.properties));return}Zc(i,s,o,!1);}else if("Polygon"===a)Zc(i,s,o,!0);else {if("MultiPolygon"!==a){if("GeometryCollection"===a){for(l=0;l<e.geometry.geometries.length;l++)Uc(t,{id:u,geometry:e.geometry.geometries[l],properties:e.properties},r,n);return}throw new Error("Input data is not a valid GeoJSON object.")}for(l=0;l<i.length;l++){var p=[];Zc(i[l],p,o,!0),s.push(p);}}t.push(Oc(u,a,s,e.properties));}}function qc(t,e){e.push(Gc(t[0])),e.push(Yc(t[1])),e.push(0);}function Nc(t,e,r,n){for(var i,a,o=0,s=0;s<t.length;s++){var u=Gc(t[s][0]),l=Yc(t[s][1]);e.push(u),e.push(l),e.push(0),s>0&&(o+=n?(i*l-u*a)/2:Math.sqrt(Math.pow(u-i,2)+Math.pow(l-a,2))),i=u,a=l;}var p=e.length-3;e[2]=1,function t(e,r,n,i){for(var a,o=i,s=n-r>>1,u=n-r,l=e[r],p=e[r+1],h=e[n],c=e[n+1],f=r+3;f<n;f+=3){var y=Rc(e[f],e[f+1],l,p,h,c);if(y>o)a=f,o=y;else if(y===o){var d=Math.abs(f-s);d<u&&(a=f,u=d);}}o>i&&(a-r>3&&t(e,r,a,i),e[a+2]=o,n-a>3&&t(e,a,n,i));}(e,0,p,r),e[p+2]=1,e.size=Math.abs(o),e.start=0,e.end=e.size;}function Zc(t,e,r,n){for(var i=0;i<t.length;i++){var a=[];Nc(t[i],a,r,n),e.push(a);}}function Gc(t){return (0,ec.parse.xFromLng)(t)}function Yc(t){return (0,ec.parse.yFromLat)(t)}function Xc(t,e,r,n,i,a,o,s){if(n/=e,a>=(r/=e)&&o<n)return t;if(o<r||a>=n)return null;for(var u=[],l=0;l<t.length;l++){var p=t[l],h=p.geometry,c=p.type,f=0===i?p.minX:p.minY,y=0===i?p.maxX:p.maxY;if(f>=r&&y<n)u.push(p);else if(!(y<r||f>=n)){var d=[];if("Point"===c||"MultiPoint"===c)Kc(h,d,r,n,i);else if("LineString"===c)Jc(h,d,r,n,i,!1,s.lineMetrics);else if("MultiLineString"===c)Qc(h,d,r,n,i,!1);else if("Polygon"===c)Qc(h,d,r,n,i,!0);else if("MultiPolygon"===c)for(var m=0;m<h.length;m++){var v=[];Qc(h[m],v,r,n,i,!0),v.length&&d.push(v);}if(d.length){if(s.lineMetrics&&"LineString"===c){for(m=0;m<d.length;m++)u.push(Oc(p.id,c,d[m],p.tags));continue}"LineString"!==c&&"MultiLineString"!==c||(1===d.length?(c="LineString",d=d[0]):c="MultiLineString"),"Point"!==c&&"MultiPoint"!==c||(c=3===d.length?"Point":"MultiPoint"),u.push(Oc(p.id,c,d,p.tags));}}}return u.length?u:null}function Kc(t,e,r,n,i){for(var a=0;a<t.length;a+=3){var o=t[a+i];o>=r&&o<=n&&(e.push(t[a]),e.push(t[a+1]),e.push(t[a+2]));}}function Jc(t,e,r,n,i,a,o){for(var s,u,l=Hc(t),p=0===i?$c:tf,h=t.start,c=0;c<t.length-3;c+=3){var f=t[c],y=t[c+1],d=t[c+2],m=t[c+3],v=t[c+4],g=0===i?f:y,x=0===i?m:v,b=!1;o&&(s=Math.sqrt(Math.pow(f-m,2)+Math.pow(y-v,2))),g<r?x>r&&(u=p(l,f,y,m,v,r),o&&(l.start=h+s*u)):g>n?x<n&&(u=p(l,f,y,m,v,n),o&&(l.start=h+s*u)):Wc(l,f,y,d),x<r&&g>=r&&(u=p(l,f,y,m,v,r),b=!0),x>n&&g<=n&&(u=p(l,f,y,m,v,n),b=!0),!a&&b&&(o&&(l.end=h+s*u),e.push(l),l=Hc(t)),o&&(h+=s);}var w=t.length-3;f=t[w],y=t[w+1],d=t[w+2],(g=0===i?f:y)>=r&&g<=n&&Wc(l,f,y,d),w=l.length-3,a&&w>=3&&(l[w]!==l[0]||l[w+1]!==l[1])&&Wc(l,l[0],l[1],l[2]),l.length&&e.push(l);}function Hc(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function Qc(t,e,r,n,i,a){for(var o=0;o<t.length;o++)Jc(t[o],e,r,n,i,a,!1);}function Wc(t,e,r,n){t.push(e),t.push(r),t.push(n);}function $c(t,e,r,n,i,a){var o=(a-e)/(n-e);return t.push(a),t.push(r+(i-r)*o),t.push(1),o}function tf(t,e,r,n,i,a){var o=(a-r)/(i-r);return t.push(e+(n-e)*o),t.push(a),t.push(1),o}function ef(t,e){for(var r=[],n=0;n<t.length;n++){var i,a=t[n],o=a.type;if("Point"===o||"MultiPoint"===o||"LineString"===o)i=rf(a.geometry,e);else if("MultiLineString"===o||"Polygon"===o){i=[];for(var s=0;s<a.geometry.length;s++)i.push(rf(a.geometry[s],e));}else if("MultiPolygon"===o)for(i=[],s=0;s<a.geometry.length;s++){for(var u=[],l=0;l<a.geometry[s].length;l++)u.push(rf(a.geometry[s][l],e));i.push(u);}r.push(Oc(a.id,o,i,a.tags));}return r}function rf(t,e){var r=[];r.size=t.size,void 0!==t.start&&(r.start=t.start,r.end=t.end);for(var n=0;n<t.length;n+=3)r.push(t[n]+e,t[n+1],t[n+2]);return r}function nf(t,e){if(t.transformed)return t;var r,n,i,a=1<<t.z,o=t.x,s=t.y;for(r=0;r<t.features.length;r++){var u=t.features[r],l=u.geometry,p=u.type;if(u.geometry=[],1===p)for(n=0;n<l.length;n+=2)u.geometry.push(af(l[n],l[n+1],e,a,o,s));else for(n=0;n<l.length;n++){var h=[];for(i=0;i<l[n].length;i+=2)h.push(af(l[n][i],l[n][i+1],e,a,o,s));u.geometry.push(h);}}return t.transformed=!0,t}function af(t,e,r,n,i,a){return [Math.round(r*(t*n-i)),Math.round(r*(e*n-a))]}function of(t,e,r,n,i){for(var a=e===i.maxZoom?0:i.tolerance/((1<<e)*i.extent),o={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:n,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},s=0;s<t.length;s++){o.numFeatures++,sf(o,t[s],a,i);var u=t[s].minX,l=t[s].minY,p=t[s].maxX,h=t[s].maxY;u<o.minX&&(o.minX=u),l<o.minY&&(o.minY=l),p>o.maxX&&(o.maxX=p),h>o.maxY&&(o.maxY=h);}return o}function sf(t,e,r,n){var i=e.geometry,a=e.type,o=[];if("Point"===a||"MultiPoint"===a)for(var s=0;s<i.length;s+=3)o.push(i[s]),o.push(i[s+1]),t.numPoints++,t.numSimplified++;else if("LineString"===a)uf(o,i,t,r,!1,!1);else if("MultiLineString"===a||"Polygon"===a)for(s=0;s<i.length;s++)uf(o,i[s],t,r,"Polygon"===a,0===s);else if("MultiPolygon"===a)for(var u=0;u<i.length;u++){var l=i[u];for(s=0;s<l.length;s++)uf(o,l[s],t,r,!0,0===s);}if(o.length){var p=e.tags||null;if("LineString"===a&&n.lineMetrics){for(var h in p={},e.tags)p[h]=e.tags[h];p.sgmap_clip_start=i.start/i.size,p.sgmap_clip_end=i.end/i.size;}var c={geometry:o,type:"Polygon"===a||"MultiPolygon"===a?3:"LineString"===a||"MultiLineString"===a?2:1,tags:p};null!==e.id&&(c.id=e.id),t.features.push(c);}}function uf(t,e,r,n,i,a){var o=n*n;if(n>0&&e.size<(i?o:n))r.numPoints+=e.length/3;else {for(var s=[],u=0;u<e.length;u+=3)(0===n||e[u+2]>o)&&(r.numSimplified++,s.push(e[u]),s.push(e[u+1])),r.numPoints++;i&&function(t,e){for(var r=0,n=0,i=t.length,a=i-2;n<i;a=n,n+=2)r+=(t[n]-t[a])*(t[n+1]+t[a+1]);if(r>0===e)for(n=0,i=t.length;n<i/2;n+=2){var o=t[n],s=t[n+1];t[n]=t[i-2-n],t[n+1]=t[i-1-n],t[i-2-n]=o,t[i-1-n]=s;}}(s,a),t.push(s);}}function lf(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 n=function(t,e){var r=[];if("FeatureCollection"===t.type)for(var n=0;n<t.features.length;n++)Uc(r,t.features[n],e,n);else Uc(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),(n=function(t,e){var r=e.buffer/e.extent,n=t,i=Xc(t,1,-1-r,r,0,-1,2,e),a=Xc(t,1,1-r,2+r,0,-1,2,e);return (i||a)&&(n=Xc(t,1,-r,1+r,0,-1,2,e)||[],i&&(n=ef(i,1).concat(n)),a&&(n=n.concat(ef(a,-1)))),n}(n,e)).length&&this.splitTile(n,0,0,0),r&&(n.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 pf(t,e,r){return 32*((1<<t)*r+e)+t}lf.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},lf.prototype.splitTile=function(t,e,r,n,i,a,o){for(var s=[t,e,r,n],u=this.options,l=u.debug;s.length;){n=s.pop(),r=s.pop(),e=s.pop(),t=s.pop();var p=1<<e,h=pf(e,r,n),c=this.tiles[h];if(!c&&(l>1&&console.time("creation"),c=this.tiles[h]=of(t,e,r,n,u),this.tileCoords.push({z:e,x:r,y:n}),l)){l>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,c.numFeatures,c.numPoints,c.numSimplified),console.timeEnd("creation"));var f="z"+e;this.stats[f]=(this.stats[f]||0)+1,this.total++;}if(c.source=t,i){if(e===u.maxZoom||e===i)continue;var y=1<<i-e;if(r!==Math.floor(a/y)||n!==Math.floor(o/y))continue}else if(e===u.indexMaxZoom||c.numPoints<=u.indexMaxPoints)continue;if(c.source=null,0!==t.length){l>1&&console.time("clipping");var d,m,v,g,x,b,w=.5*u.buffer/u.extent,_=.5-w,A=.5+w,S=1+w;d=m=v=g=null,x=Xc(t,p,r-w,r+A,0,c.minX,c.maxX,u),b=Xc(t,p,r+_,r+S,0,c.minX,c.maxX,u),t=null,x&&(d=Xc(x,p,n-w,n+A,1,c.minY,c.maxY,u),m=Xc(x,p,n+_,n+S,1,c.minY,c.maxY,u),x=null),b&&(v=Xc(b,p,n-w,n+A,1,c.minY,c.maxY,u),g=Xc(b,p,n+_,n+S,1,c.minY,c.maxY,u),b=null),l>1&&console.timeEnd("clipping"),s.push(d||[],e+1,2*r,2*n),s.push(m||[],e+1,2*r,2*n+1),s.push(v||[],e+1,2*r+1,2*n),s.push(g||[],e+1,2*r+1,2*n+1);}}},lf.prototype.getTile=function(t,e,r){var n=this.options,i=n.extent,a=n.debug;if(t<0||t>24)return null;var o=1<<t,s=pf(t,e=(e%o+o)%o,r);if(this.tiles[s])return nf(this.tiles[s],i);a>1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var u,l=t,p=e,h=r;!u&&l>0;)l--,p=Math.floor(p/2),h=Math.floor(h/2),u=this.tiles[pf(l,p,h)];return u&&u.source?(a>1&&console.log("found parent tile z%d-%d-%d",l,p,h),a>1&&console.time("drilling down"),this.splitTile(u.source,l,p,h,t,e,r),a>1&&console.timeEnd("drilling down"),this.tiles[s]?nf(this.tiles[s],i):null):null},t.Actor=_h,t.BufferTostyle=function(t){function e(t,e,n){e[Fc[t]]=n.readMessage(r,{}),delete e[Fc[t]].zoomRange;}function r(t,e,r){0===t?e.zoomRange=r.readString().split(",").map((function(t){return t.replace(/_/g,",")})):e[e.zoomRange[t-1]]=r.readMessage(n,{});}function n(t,e,r){e[Lc[t]]=JSON.parse(r.readString());}function i(t,e,r){e[t]=r.readMessage(a,{});}function a(t,e,r){1===t&&(e.id=r.readString()),2===t&&(e.type=Tc[r.readVarint()]),3===t&&(e.source=Dc[r.readVarint()]),4===t&&(e["source-layer"]=r.readString()),5===t&&(e.minzoom=r.readVarint()),6===t&&(e.maxzoom=r.readVarint()),7===t&&(e.layout=r.readMessage(o,{})),8===t&&(e.paint=r.readMessage(s,{})),9===t&&(e.filter=JSON.parse(r.readString()));}function o(t,e,r){e[Ec[t]]=JSON.parse(r.readString());}function s(t,e,r){e[Bc[t]]=JSON.parse(r.readString());}var u=t.readFields((function(t,r,n){1===t?(r._layout=n.readString().split(","),Ec=r._layout):2===t?(r._paint=n.readString().split(","),Bc=r._paint):3===t?(r._source=n.readString(),Dc=r._source.split(",")):4===t?r.layers=n.readMessage(i,[]):5===t?r.created=n.readString():6===t?r.draft=n.readBoolean():7===t?r.glyphs=n.readString():8===t?r.id=n.readString():9===t?r.modified=n.readString():10===t?r.owner=n.readString():11===t?r.scheme=n.readString():12===t?r.sources=JSON.parse(n.readString()):13===t?r.sprite=n.readString():14===t?r.type=n.readString():15===t?r.url=n.readString():16===t?r.version=n.readVarint():17===t?r.minZoom=n.readVarint():18===t?r.maxZoom=n.readVarint():19===t?(r._xml_keys=n.readString().split(","),Lc=r._xml_keys):20===t?(r._xml_ids=n.readString().split(","),Fc=r._xml_ids):21===t&&(r.xml=n.readMessage(e,{}));}),{});return delete u._paint,delete u._layout,delete u._source,delete u._xml_keys,delete u._xml_ids,u},t.CanonicalTileID=nc,t.Color=ge,t.DEMData=Cc,t.DataConstantProperty=oa,t.DedupedRequest=Mc,t.EXTENT=8192,t.ErrorEvent=Gt,t.EvaluationParameters=Qi,t.Event=Zt,t.Evented=Yt,t.GlyphManager=_p,t.ImagePosition=jl,t.LineAtlas=xh,t.LngLat=Ih,t.LngLatBounds=zh,t.LocalGlyphMode=wp,t.ONE_EM=24,t.OverscaledTileID=ac,t.Point=i,t.Point$1=i,t.Properties=ha,t.Protobuf=gl,t.RGBAImage=qs,t.RequestManager=K,t.RequestPerformance=kc,t.ResourceType=Et,t.SegmentVector=$a,t.SourceFeatureState=vc,t.StructArrayLayout1ui2=Oa,t.StructArrayLayout2f1f2i16=Va,t.StructArrayLayout2f8=ja,t.StructArrayLayout2i4=xa,t.StructArrayLayout3ui6=Ta,t.StructArrayLayout4i8=ba,t.Texture=gh,t.Tile=mc,t.Transitionable=ta,t.Uniform1f=fo,t.Uniform1i=co,t.Uniform2f=yo,t.Uniform3f=mo,t.Uniform4f=vo,t.UniformColor=go,t.UniformMatrix4f=bo,t.ValidationError=Kt,t.VectorTileWorkerSource=Vc,t.WritingMode=Nl,t.ZoomHistory=ui,t._addCustomSource=function(t){!Tt(t)&&Ct.push(t);},t._removeCustomSource=function(t){Tt(t)&&Ct.splice(Ct.indexOf(t),1);},t.addDynamicAttributes=Zp,t.addWaterMarkLayer=function(t){var e=JSON.parse(window.atob(q.ACCESS_TOKEN.split(".")[1]));if(e&&"N"===e.Issuance){var r=parseInt((new Date).getTime()/1e4).toString(32);new Promise((function(t,e){var r=document.createElement("img");r.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoQAAAKEBAMAAABsmTZ8AAAALVBMVEUAAACbm5v////m5ub////V1dX////y8vLHx8f////////////////////////QyUlqAAAAD3RSTlMAKSkpJCkeKSkWIQsbEBOI1dPrAAARDUlEQVR42uzBgQAAAACAoP2pF6kCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGD24EAAAAAAAMj/tRFUVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVYU9OBAAAAAAAPJ/bQRVVVVVVVVVVVVVVVVVVVXYtZvXpsE4DuBBhtCXFbpR7HH7Jm1tncI6xB4l9CK+QDNEj6OI91ZEr5uIHscQwYMwggiCiIgIKsIYIngrIoK3MkTwv/B5fr+kSZo8Tcew6yTfg027Pm3y8Xn5PdmSJEmSJEmSJEmSJEmSJEmS/ynZpsz2vtqkY9vEJ7OpxWdWU6WnTU+OQ+a8Niokdsl7PhPbJj5pQ2H4+KaI87O9i1owbcgsaB+q2vTkuH716tX6aA7IlH2EQ21mn4zOUy2cNhSGpLRGhzkY/UjCLDChbphuKnPFI8zn81YMoRBb9ROWgm2OQx3WDyWFVWn4M0DdJ6VbKytdJtzTUR0iXBbfPHfGrHQvahPJDJSpDhPO3gzFIxRvmR9JeGdUuhGE3/T8PRi9Nvw57yrViTCL5QfYiSAEWhuGNoHQgFPEChGmMBxjfEI9rww3DcXs5IVh2a74qIcJd3VxVIsibOSLZPuPw5eqyIkIwpVgztX+IWEa63lpCEnixgoSZuUPC9gOE9LXn9EUOTzCyvBblsKEWZ5HD064e5LRgoSguIS7JXrReB0i1OWHRo/kqSKcOx0m5HWjemDCHFp5Sl1NmDGJuYiLIULZugjJHM40EW4shAi5ArIOTngMjUjCjnhl0AvfYp3Ow3gdIpS41iktIlNFSEQhQmp7YMKMzd2wACVhdDdkQoNOo6xFZZoI62vxhL39E3JyJnWxDenVhUwnRKh9cLqhb1He6tAUg5Z4zyQmQyacA6WVd092cTxCbMYSHscr7zPmwSkV4UtJUdSkoAufrppQxna64doQ4UK7I/QVxfVkCXNieTWJ0Gg2hwiL0OIIcyZQ6w0TLhdiCDnvUBJNbEm4yTZhQi59CjCabkwiNMzSPcUe/d8Q0rJgCkI+2WMeIZXTRAiKVDwBQJ55wYgjvGzjeh3GjktIUG8rVO713DNQEmq/0LCqbUlINlGE3A0t+EKEoCxoikyWUCyw18XT++KugY+QyGpxhJDL6ioW/IS8BGyQmZqQ0wbW2uqB7HbDAj77NlnULenImiBh+aYIiPC5OGr7CCuB1SNFhFUXSqN8kY2plBUHPwKEDV64/YRciHTLN2VuXBhJmDMNjQmFRxQhd0NrKXpVnJsAoWouVBJmda6o09TMKbtMt1dC5LGf8LrbziPkTjgPN5fVhNL7FBNWxGcqCGdwHzuHTji/QpG9Y5WOlhWEQoLP7NhJX9lnyiZy9IgHHyElRPidt74rnLN1PFMQcnqxhBmzW9YOnTCcOMJvi/L5tkPY8t7TjSFMQeJ7KdbVRQ0/xBFqe9g+ioS7HSoLlYRLtoLQrqwPVUZKwnb59ViEqZp2lAjditleprLwk4oQuBtJ+Etc/ZiEOYAMYwm1nSknxEMR8VT86yM0ZVkIE5dUhI18FKFBwziQByrCN/o1MlQTpuBmYboJRcgNwIAwM1iAa/0ownkSDBPSli0YNBWEopK+hqVxCUHxyolJl9bFhxR5ec5RcIO3SNv9ZnNHrMREkq3IVlevFy0Ym2FCL/c6QUISLHZBuUsvvY0i5JJZGFZHEVbc3nb4hDG3GbY6fAuY9i1EktYHRlATSoIwIT3K0BvrZxR14RYNeQuXxyH0qLyt1cTChLRJJ0LejQbPwl52b4ZwMdPdpM7IQU8z5S+IZF0oHmD6CDcwTOi0e4BLqKzTK5vRhLOCiYhhHg1C1R6Z49yTq1KHpPfsLXoLanB3EliKrfLWEKH4qPvcu9CiIb2k2OC9dXiKwD4JZ0rTRzgLZ/S9dgjRE4OLwndr/ohfkRNh7RHQCNzVHiKsmSeLoD5db3E37SsI22g532rvm5A/LyYTnQuzzpnKu29kB9IO3m4GHW95gsUownIadR7B7I+LqktOmRX6DutM+z8g5LWDR7JNhB8xUJir+gm9EuleKZJQs/HCqw3rNfUlZ6Gv0ww8HqFvST4UwnD8hG/oknkk82D/CgrPAX7CLFxBKAjT1d9Ay11Uyn11r3kHXS50mpqQy/6jQLjrrh1Y45XFqoGySEp+Qm0wg6kI39vAbacPF7rAy75y4H0XK1P91EhC7//Ru46uPn2Eg4nPOp2B90cMPC/Wt/2E4jVua3yPJDSeAbqvilwFYCp7zRbOoq8m5LI/gpBXOWUmT5jhiY8EePYpgNWkBfoBwm8nnbYzkYRApRG8yXAOUBJmbJTjbjPMHAXCv+yc28sMYRzHJ2lrnQpN5pLv7Nq1DrUjcbltUo5lJS63TUoOZSVuZyUut01KDmmTcmyTXMjFJilJSXIhSnLDX2Ge3/d55pmx5nUoQ9rvBW97mHfm8zzP7/g8b6FiY0CdemAslRSGhSmEs/2F3gwILUAv/mFXtu0qovFfIEx8IqgRobR15jDSSyMswj02A8K6rbTGBQfXICxMbrp7PfoNhJV/DuFgGX1sXT0AP71IGcNZVcY06Q4e4M+AsBoTtDaxl4GQ+k2EHpzcNBsJVT0kpOk065x51YUuHpOBqxIVSfJ6S9MIH00gZMZjFnJMUDkWrmrECP1EyiOaN/odhOLy/hbC0J1EWERIhP7CXs3kxt0Go2w6ZIvwLUqpDt5y4W8RYicrYKcDKK0L1WvZCF+t+HmEvrTPvKgBphHmL3YnA7S/ZawfrIWzuCoxCxvpCwQt+kmEAGrftOLDNMKjMgXDCGMXgJqIvRkQdnDrpxEyu5I5oLf75KX5I4dii9wL4jMIj0Zx3Y4Ig9LIhIguPghaF04KoX8WKYT+hoVphGUVCpZ1AqNUwbVshM0uxj+JcB63ErgwWwpyQ2iPxyxAlXD05t+3uMqosG4QYqtKTqigMajyyZMIIy+L1G4GQkFiW1IXwFHrUzYC9zMRLoDXLb38KYRMAfhNJqHjsZOTZgN3dTc21JPjlhPpibaFc2BSkyY+SNnLDWVDn1i53kqLkLFe92kSIQSVRVgDtnyhDeSwjN5tnp2BUMImF8t/D2HQXuXkpFc+sPx9tLtlyEI8N3/P78A/hRHXMdXaskZzOCpYEIo3sQip4HoKYcjYMc6Rb150ivuYo5gqbhZChk1nAI1w0c8iZOLZZt6UgzpHvcCWOPSu2+IQ5XAhrup17EltYfNY329ZUPlJoz33CRYaR5NCuFO9tMYiVE+6cV8T8EM6dkKYiAttRNr6OYRzRwYhtwm0GsincM2h2wU5UALUSaH0Cus4R+h3l3CXqy579SD9vWrC7BfVFKYW1VIIeSxEI0yD2sA6+AwIh/WfRzjoxwgHGiHysYasIQQVcZxN1pNbtSIXIHRg3SNCM76s3Mv8or35AhyPcxqkN8ed3SU8LMJX5d1ru4wKeytmrjLz3gzC3kwI76MdI7y3TF5CUMrlHCOL+iDCCygv5KxhRoI2bWFAhMbX2e0yQYN1vUS5P0gjVOonEfLS3i6h2JgRYVGMAzt4PullIVwFNGKEs6pE6CIXjzKb0Iiwf1/ZrpZMFZmOKxlZgwj1lMUbhJoX6cyqhAmCN5MImyg1aZIMwoL5srsWwLaXMyDUkWfnJxCi0ltqEL5rluW8RCVyRTucPy4muotLGqHT8VXsdscpsLRak/zONQgLuozUPGrqh4aOJXjHhNa+2oTTiABjRxLhR05hlrmAypFMhLS8i2uCsPwDhDsXrSFCDHUBslZRn85hKQ/rsk/YIJyHelADDjrs8uKlWnhLDMJZvDfnlelHrdZN0tASdAxC6JU6AG6MYoTi4S3EPcCqLIS0vIvWdDacPat6DIHq+APqnwmEG9QFiBAVcKT9fOo1fPreCoPQ+Qg8Q4Btarc1w77BslZNI3y8jOWtogBmTMJajiVoEMZ/m2FwMkDphW2C4tgGEtftkzVZCGl5e0s7YEKDDowsQho+TyEjwijiDGAKQF4OVUP2N4MbMcIFWFXw3S7gm2k2q4z9RMhnUuXWIeNtnU8TLQnGCBPlPi8ADMIH1xDphK3+o52FsAiO4hPuVfEwxAWtYQJh3Bv7jJ26e80vVvMpvLLVgc8aocLxoeCLlTJ5RQEoEKF+pjZPATOf1jPBEjSsUnPpVCmxXf38NTA90Y3VLIQcXnzQBTcXwFYzLBbhwCDssrdqA/p6Ln08LkG3VLQI5xoDza1IUa6HVRrhLF/bx6Efd4u3m4d1uyTozPsGIc/4pMleiihW1tGGZLkTDq8H7tZUsE/2SmmE5gkIjhfkqT1beP+j4uiK/yfCoE8nzRRkmVAdRzfZ0Aij9So05nC4OeAHaVGFIK+Zbl3MAQERYWm/lszEnXL8pDOJ0HAyvZnhUekPeLj6DUIbIy1et5BiGkPxVMcf1T1aPN0eDiAb4yBplQRXTEn6RLgVOyWKLcpblNcVhs3d/N9uzo7PxKHK2UCESKnOCmkGQv66NWa3ZhBKpTeNcK4J8z1i0wlS1STsDedPq3lU+13QLonoYZQLYTHroUOEWyoMt4dIeVQcjihDEaQ4HHtgFHI2MKZcm9JOvrAhY08Ne4W6nO4pLi76aYT34qPzsNv12CTTT/aHNR9+SOumqZyW83ZKuMwa9iplHYkQVSbSOpvzNEPlRWYlM3pey91N6U1yv3oemQEfQQ2k1CEZVLD6FTeTaoRzYMzfNWKTjoJ8NKfq/1soO80qZUoe1EtewIIREcqAu2YLpsfx54n0giU4cS3Ohl9EyLyJw/tWfmNrDepqowlD9tA4P9S5flYUfDOi2PRSvZ9XJ/QTyvGeNyvB+vio28VmxyL0aao1uh5MilIaTbiBpAji1xEO63RL58BAYKxSQw+3wbOeRMiKsIfaqAid7dSe87v0RTlogOPdqzLkVkxBXvmgkzUIq7RNQ59UNuEkHcrW76S2EwPyawg5v8R5FeCz0UDn21thLDFG4vBleaMv9uMUULrLoMI8RR56DLxkUSSpQHUVS8+dJEKWacaMq1u10YAuMz0J+VRJySL8dYTzm9gp7mzIedag8+O+Yc5PU+88I92e5rqAlR/egq7F5aG5neUSINZTD4QPzpxa30kj9EOpwj6WOPdq5CjV/AhWTlyR09PKRfsXEdIjV0JlROcglH4OQ7AWVPYupRGz3l0a7A5Q66emsJdXL3n+VU7GDclIJXLECzigFuEmVGU+FRF6XekoRVC/d5sfsS5J5zTkwwxqJpQV1PDy6EcjVY9GbCsTgagCOKtK+7HU5DDd2kh+a+lwwj75XPx5qghUjq2lutBc0ggbn7AXbTmG3kKfDr28qPbdbYE4wUvxamPbR55QVmjNncIQSC747vAY9Mnjs4Hpz802N1scpabw8dBFw8lVxSFilcZOGqEunw5R4l2bfP8csPJ7E3sfKHs1XuNUaf+kOvIOIaX1VtAVAM3rHqL1XKisXd8FthtY/GlyJUB9OGcVL/CRDl3I+kOk87BaCCF+3gEfbhLiBQPowJXkNb4HanbmO8651WLYMDa4+rJe6Hi1at8FNXef+ta/o/jP4X7s88msmXz6a9fY9r2apX1nQvL7OjGLthqdaFguO1btLBvv/JOa6/wNjZyppppqqqmmmmqqqaaaaqqppprqK3twIAAAAAAA5P/aCKqqqqqqqqqqqqqqqqqqKu3BIQEAAACAoP+vPWEEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAX+2FAZTI0w4qAAAAAElFTkSuQmCC",r.onload=function(){t(r);},r.onerror=function(t){e(t);};})).then((function(e){t.getLayer(r)||(t.addImage(r,e,{pixelRatio:2}),t.addLayer({id:r,type:"background",paint:{"background-pattern":r}}));})).catch((function(t){}));}},t.asyncAll=p,t.bezier=o,t.bindAll=v,t.browser=U,t.cacheEntryPossiblyAdded=function(t){++mt>ct&&(t.getActor().send("enforceCacheSizeLimit",ht),mt=0);},t.checkCustomTileSource=function(t,e,r){if("raster"==e.type){var n=e.tiles;if(n)if(Tt(t))e.tilesecurity=!1;else {for(var i=!0,a=0;a<n.length;a++){var o=n[a].split(".");if("sg"!=o[o.length-1]){i=!1;break}}if(!i)throw delete r._userDatas.sources[t],new Error("source:"+t+" 非标准数据源");e.tilesecurity=!0;}}},t.clamp=u,t.clearTileCache=function(t){var e=self.caches.delete("sgmap-tiles");t&&e.catch(t).then((function(){return t()}));},t.clipLine=yp,t.clone=function(t){var e=new os(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=w,t.collisionCircleLayout=fl,t.config=ec,t.config$1=q,t.create=ls,t.create$1=function(){var t=new os(9);return os!=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.createCommonjsModule=e,t.createExpression=hn,t.createLayout=ma,t.createStyleLayer=function(t){return "custom"===t.type?new ih(t):new ch[t.type](t)},t.crs=rc,t.decodeFeatures=function(t){var e;t.features&&t.features.length>0&&(e=function(t){return Array.isArray(t)?e(t[0]):"string"==typeof t&&isNaN(t)})(t.features[0].geometry.coordinates)&&t.features.forEach((function(t){var e,r;r=Vt((e=t).geometry.coordinates),e.geometry.coordinates=r;}));},t.deepEqual=function t(e,r){if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return !1;for(var n=0;n<e.length;n++)if(!t(e[n],r[n]))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 i in e)if(!t(e[i],r[i]))return !1;return !0}return e===r},t.earcut=Js,t.earthRadius=6371008.8,t.ease=s,t.emitValidationErrors=Hn,t.endsWith=g,t.enforceCacheSizeLimit=function(t){ft(),it&&it.then((function(e){e.keys().then((function(r){for(var n=0;n<r.length-t;n++)e.delete(r[n]);}));}));},t.evaluateSizeForFeature=ap,t.evaluateSizeForZoom=op,t.evaluateVariableOffset=Dp,t.evented=Xi,t.extend=c,t.featureFilter=Sn,t.filterObject=b,t.formatAjax=function(t){return "string"==typeof t?{method:"GET",url:t}:(t.method||(t.method="GET"),t.data&&(t.body=t.body?Object.assign({},t.data,t.body):t.data,delete t.data),"GET"===t.method.toUpperCase()&&(t.url=kt({url:t.url,params:t.body}),delete t.body),t)},t.fromRotation=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},t.geojsonvt=function(t,e){return new lf(t,e)},t.getAnchorAlignment=tp,t.getAnchorJustification=Fp,t.getArrayBuffer=Ot,t.getImage=Ut,t.getJSON=function(t,e){return Rt(c(t,{type:"json"}),e)},t.getRTLTextPluginStatus=Ki,t.getReferrer=Dt,t.getVideo=function(t,e){var r,n,i=self.document.createElement("video");i.muted=!0,i.onloadstart=function(){e(null,i);};for(var a=0;a<t.length;a++){var o=self.document.createElement("source");r=t[a],n=void 0,(n=self.document.createElement("a")).href=r,(n.protocol!==self.document.location.protocol||n.host!==self.document.location.host)&&(i.crossOrigin="Anonymous"),o.src=t[a],i.appendChild(o);}return {cancel:function(){}}},t.identity=ps,t.initApiURI=function(t,e){for(var r=document.getElementsByTagName("script"),n=[],i=-1;++i<r.length;){var a=r[i];a.src&&/http[s]?\:\/\/[\w\d\.\:-]+\/(maps\?v=[\d\.]+|api\/gl\/epgis-[\d\.]+\.min\.js)/.test(a.src)&&-1!==a.src.indexOf(t)&&n.push(/http[s]?\:\/\/[\w\d\.\:-]+/.exec(a.src)[0]);}Mt("识别SDK JS加载的路径"),Mt(n),0===n.length?console.warn("版本没有匹配"):(e.API_URL=n[0],function(t,e){var r=t.API_URL,n=document.createElement("link");n.setAttribute("rel","stylesheet"),n.setAttribute("href",r+"/api/gl/epgis-"+e+".min.css"),(document.head||document.getElementsByTagName("head")[0]).appendChild(n);}(e,t));},t.invert=hs,t.isIE11=T,t.issgmapURL=J,t.keysDifference=function(t,e){var r=[];for(var n in t)n in e||r.push(n);return r},t.loadVectorTile=Pc,t.makeRequest=Rt,t.mul=gs,t.multiply=cs,t.mvt=cc,t.number=ur,t.offscreenCanvasSupported=vt,t.ortho=function(t,e,r,n,i,a,o){var s=1/(e-r),u=1/(n-i),l=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*u,t[14]=(o+a)*l,t[15]=1,t},t.pbf=gl,t.pick=function(t,e){for(var r={},n=0;n<e.length;n++){var i=e[n];i in t&&(r[i]=t[i]);}return r},t.plugin=Hi,t.polygonIntersectsPolygon=Zo,t.postMapLoadEvent=pt,t.postTurnstileEvent=ut,t.potpack=Ol,t.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],t.registerForPluginStateChange=function(t){return t({pluginStatus:Ni,pluginURL:Zi}),Xi.on("pluginStateChange",t),t},t.rotateZ=ms,t.scale=ys,t.setCacheLimits=function(t,e){ht=t,ct=e;},t.setRTLTextPlugin=function(t,e,r){if(void 0===r&&(r=!1),"deferred"===Ni||"loading"===Ni||"loaded"===Ni)throw new Error("setRTLTextPlugin cannot be called multiple times.");Zi=U.resolveURL(t),Ni="deferred",qi=e,Yi(),r||Ji();},t.sphericalToCartesian=function(t){var e=t[0],r=t[1],n=t[2];return r+=90,r*=Math.PI/180,n*=Math.PI/180,{x:e*Math.cos(r)*Math.sin(n),y:e*Math.sin(r)*Math.sin(n),z:e*Math.cos(n)}},t.styleSpec=Xt,t.symbolSize=sp,t.transformMat3=function(t,e,r){var n=e[0],i=e[1],a=e[2];return t[0]=n*r[0]+i*r[3]+a*r[6],t[1]=n*r[1]+i*r[4]+a*r[7],t[2]=n*r[2]+i*r[5]+a*r[8],t},t.transformMat4=_s,t.translate=fs,t.triggerPluginCompletionEvent=Gi,t.uniqueId=y,t.unwrapExports=function(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t},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=Xn,t.validateStyle=Yn,t.values=h,t.vectorTile=Nu,t.version="3.0.18.1",t.warnOnce=S,t.webpSupported=N,t.window=self,t.wrap=l;}));
define(["./shared"],(function(e){"use strict";function t(e){var r=typeof e;if("number"===r||"boolean"===r||"string"===r||null==e)return JSON.stringify(e);if(Array.isArray(e)){for(var o="[",i=0,n=e;i<n.length;i+=1)o+=t(n[i])+",";return o+"]"}for(var s=Object.keys(e).sort(),a="{",u=0;u<s.length;u++)a+=JSON.stringify(s[u])+":"+t(e[s[u]])+",";return a+"}"}function r(r){for(var o="",i=0,n=e.refProperties;i<n.length;i+=1)o+="/"+t(r[n[i]]);return o}var o=function(e){this.keyCache={},e&&this.replace(e);};o.prototype.replace=function(e){this._layerConfigs={},this._layers={},this.update(e,[]);},o.prototype.update=function(t,o){for(var i=this,n=0,s=t;n<s.length;n+=1){var a=s[n];this._layerConfigs[a.id]=a;var u=this._layers[a.id]=e.createStyleLayer(a);u._featureFilter=e.featureFilter(u.filter),this.keyCache[a.id]&&delete this.keyCache[a.id];}for(var h=0,l=o;h<l.length;h+=1){var p=l[h];delete this.keyCache[p],delete this._layerConfigs[p],delete this._layers[p];}this.familiesBySource={};for(var c=0,f=function(e,t){for(var o={},i=0;i<e.length;i++){var n=t&&t[e[i].id]||r(e[i]);t&&(t[e[i].id]=n);var s=o[n];s||(s=o[n]=[]),s.push(e[i]);}var a=[];for(var u in o)a.push(o[u]);return a}(e.values(this._layerConfigs),this.keyCache);c<f.length;c+=1){var d=f[c].map((function(e){return i._layers[e.id]})),g=d[0];if("none"!==g.visibility){var v=g.source||"",y=this.familiesBySource[v];y||(y=this.familiesBySource[v]={});var m=g.sourceLayer||"_geojsonTileLayer",w=y[m];w||(w=y[m]=[]),w.push(d);}}};var i=e.window.ImageBitmap,n=function(){this.loaded={};};function s(e,t){if(0!==e.length){a(e[0],t);for(var r=1;r<e.length;r++)a(e[r],!t);}}function a(e,t){for(var r=0,o=0,i=e.length,n=i-1;o<i;n=o++)r+=(e[o][0]-e[n][0])*(e[n][1]+e[o][1]);r>=0!=!!t&&e.reverse();}n.prototype.loadTile=function(t,r){var o=t.uid,n=t.encoding,s=t.rawImageData,a=i&&s instanceof i?this.getImageData(s):s,u=new e.DEMData(o,a,n);this.loaded=this.loaded||{},this.loaded[o]=u,r(null,u);},n.prototype.getImageData=function(t){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(t.width,t.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=t.width,this.offscreenCanvas.height=t.height,this.offscreenCanvasContext.drawImage(t,0,0,t.width,t.height);var r=this.offscreenCanvasContext.getImageData(-1,-1,t.width+2,t.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new e.RGBAImage({width:r.width,height:r.height},r.data)},n.prototype.removeTile=function(e){var t=this.loaded,r=e.uid;t&&t[r]&&delete t[r];};var u=e.mvt.VectorTileFeature.prototype.toGeoJSON,h=function(t){this._feature=t,this.extent=e.EXTENT,this.type=t.type,this.properties=t.tags,"id"in t&&!isNaN(t.id)&&(this.id=parseInt(t.id,10));};h.prototype.loadGeometry=function(){if(1===this._feature.type){for(var t=[],r=0,o=this._feature.geometry;r<o.length;r+=1){var i=o[r];t.push([new e.Point$1(i[0],i[1])]);}return t}for(var n=[],s=0,a=this._feature.geometry;s<a.length;s+=1){for(var u=[],h=0,l=a[s];h<l.length;h+=1){var p=l[h];u.push(new e.Point$1(p[0],p[1]));}n.push(u);}return n},h.prototype.toGeoJSON=function(e,t,r){return u.call(this,e,t,r)};var l=function(t){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=e.EXTENT,this.length=t.length,this._features=t;};l.prototype.feature=function(e){return new h(this._features[e])};var p=e.vectorTile.VectorTileFeature,c=f;function f(e,t){this.options=t||{},this.features=e,this.length=e.length;}function d(e,t){this.id="number"==typeof e.id?e.id:void 0,this.type=e.type,this.rawGeometry=1===e.type?[e.geometry]:e.geometry,this.properties=e.tags,this.extent=t||4096;}f.prototype.feature=function(e){return new d(this.features[e],this.options.extent)},d.prototype.loadGeometry=function(){var t=this.rawGeometry;this.geometry=[];for(var r=0;r<t.length;r++){for(var o=t[r],i=[],n=0;n<o.length;n++)i.push(new e.Point$1(o[n][0],o[n][1]));this.geometry.push(i);}return this.geometry},d.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var e=this.geometry,t=1/0,r=-1/0,o=1/0,i=-1/0,n=0;n<e.length;n++)for(var s=e[n],a=0;a<s.length;a++){var u=s[a];t=Math.min(t,u.x),r=Math.max(r,u.x),o=Math.min(o,u.y),i=Math.max(i,u.y);}return [t,o,r,i]},d.prototype.toGeoJSON=p.prototype.toGeoJSON;var g=y,v=c;function y(t){var r=new e.Protobuf;return function(e,t){for(var r in e.layers)t.writeMessage(3,m,e.layers[r]);}(t,r),r.finish()}function m(e,t){var r;t.writeVarintField(15,e.version||1),t.writeStringField(1,e.name||""),t.writeVarintField(5,e.extent||4096);var o={keys:[],values:[],keycache:{},valuecache:{}};for(r=0;r<e.length;r++)o.feature=e.feature(r),t.writeMessage(2,w,o);var i=o.keys;for(r=0;r<i.length;r++)t.writeStringField(3,i[r]);var n=o.values;for(r=0;r<n.length;r++)t.writeMessage(4,C,n[r]);}function w(e,t){var r=e.feature;void 0!==r.id&&t.writeVarintField(1,r.id),t.writeMessage(2,S,e),t.writeVarintField(3,r.type),t.writeMessage(4,k,r);}function S(e,t){var r=e.feature,o=e.keys,i=e.values,n=e.keycache,s=e.valuecache;for(var a in r.properties){var u=n[a];void 0===u&&(o.push(a),n[a]=u=o.length-1),t.writeVarint(u);var h=r.properties[a],l=typeof h;"string"!==l&&"boolean"!==l&&"number"!==l&&(h=JSON.stringify(h));var p=l+":"+h,c=s[p];void 0===c&&(i.push(h),s[p]=c=i.length-1),t.writeVarint(c);}}function x(e,t){return (t<<3)+(7&e)}function _(e){return e<<1^e>>31}function k(e,t){for(var r=e.loadGeometry(),o=e.type,i=0,n=0,s=r.length,a=0;a<s;a++){var u=r[a],h=1;1===o&&(h=u.length),t.writeVarint(x(1,h));for(var l=3===o?u.length-1:u.length,p=0;p<l;p++){1===p&&1!==o&&t.writeVarint(x(2,l-1));var c=u[p].x-i,f=u[p].y-n;t.writeVarint(_(c)),t.writeVarint(_(f)),i+=c,n+=f;}3===o&&t.writeVarint(x(7,1));}}function C(e,t){var r=typeof e;"string"===r?t.writeStringField(1,e):"boolean"===r?t.writeBooleanField(7,e):"number"===r&&(e%1!=0?t.writeDoubleField(3,e):e<0?t.writeSVarintField(6,e):t.writeVarintField(5,e));}function T(e,t,r,o){I(e,r,o),I(t,2*r,2*o),I(t,2*r+1,2*o+1);}function I(e,t,r){var o=e[t];e[t]=e[r],e[r]=o;}function b(e,t,r,o){var i=e-r,n=t-o;return i*i+n*n}g.fromVectorTileJs=y,g.fromGeojsonVt=function(e,t){t=t||{};var r={};for(var o in e)r[o]=new c(e[o].features,t),r[o].name=o,r[o].version=t.version,r[o].extent=t.extent;return y({layers:r})},g.GeoJSONWrapper=v;var M=function(e){return e[0]},O=function(e){return e[1]},L=function(e,t,r,o,i){void 0===t&&(t=M),void 0===r&&(r=O),void 0===o&&(o=64),void 0===i&&(i=Float64Array),this.nodeSize=o,this.points=e;for(var n=e.length<65536?Uint16Array:Uint32Array,s=this.ids=new n(e.length),a=this.coords=new i(2*e.length),u=0;u<e.length;u++)s[u]=u,a[2*u]=t(e[u]),a[2*u+1]=r(e[u]);!function e(t,r,o,i,n,s){if(!(n-i<=o)){var a=i+n>>1;!function e(t,r,o,i,n,s){for(;n>i;){if(n-i>600){var a=n-i+1,u=o-i+1,h=Math.log(a),l=.5*Math.exp(2*h/3),p=.5*Math.sqrt(h*l*(a-l)/a)*(u-a/2<0?-1:1);e(t,r,o,Math.max(i,Math.floor(o-u*l/a+p)),Math.min(n,Math.floor(o+(a-u)*l/a+p)),s);}var c=r[2*o+s],f=i,d=n;for(T(t,r,i,o),r[2*n+s]>c&&T(t,r,i,n);f<d;){for(T(t,r,f,d),f++,d--;r[2*f+s]<c;)f++;for(;r[2*d+s]>c;)d--;}r[2*i+s]===c?T(t,r,i,d):T(t,r,++d,n),d<=o&&(i=d+1),o<=d&&(n=d-1);}}(t,r,a,i,n,s%2),e(t,r,o,i,a-1,s+1),e(t,r,o,a+1,n,s+1);}}(s,a,o,0,s.length-1,0);};L.prototype.range=function(e,t,r,o){return function(e,t,r,o,i,n,s){for(var a,u,h=[0,e.length-1,0],l=[];h.length;){var p=h.pop(),c=h.pop(),f=h.pop();if(c-f<=s)for(var d=f;d<=c;d++)u=t[2*d+1],(a=t[2*d])>=r&&a<=i&&u>=o&&u<=n&&l.push(e[d]);else {var g=Math.floor((f+c)/2);u=t[2*g+1],(a=t[2*g])>=r&&a<=i&&u>=o&&u<=n&&l.push(e[g]);var v=(p+1)%2;(0===p?r<=a:o<=u)&&(h.push(f),h.push(g-1),h.push(v)),(0===p?i>=a:n>=u)&&(h.push(g+1),h.push(c),h.push(v));}}return l}(this.ids,this.coords,e,t,r,o,this.nodeSize)},L.prototype.within=function(e,t,r){return function(e,t,r,o,i,n){for(var s=[0,e.length-1,0],a=[],u=i*i;s.length;){var h=s.pop(),l=s.pop(),p=s.pop();if(l-p<=n)for(var c=p;c<=l;c++)b(t[2*c],t[2*c+1],r,o)<=u&&a.push(e[c]);else {var f=Math.floor((p+l)/2),d=t[2*f],g=t[2*f+1];b(d,g,r,o)<=u&&a.push(e[f]);var v=(h+1)%2;(0===h?r-i<=d:o-i<=g)&&(s.push(p),s.push(f-1),s.push(v)),(0===h?r+i>=d:o+i>=g)&&(s.push(f+1),s.push(l),s.push(v));}}return a}(this.ids,this.coords,e,t,r,this.nodeSize)};var P={minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(e){return e}},N=function(e){this.options=V(Object.create(P),e),this.trees=new Array(this.options.maxZoom+1);};function D(e,t,r,o,i){return {x:e,y:t,zoom:1/0,id:r,parentId:-1,numPoints:o,properties:i}}function E(e,t){var r=e.geometry.coordinates,o=r[1];return {x:G(r[0]),y:W(o),zoom:1/0,index:t,parentId:-1}}function F(e){return {type:"Feature",id:e.id,properties:J(e),geometry:{type:"Point",coordinates:[(o=e.x,360*(o-.5)),(t=e.y,r=(180-360*t)*Math.PI/180,360*Math.atan(Math.exp(r))/Math.PI-90)]}};var t,r,o;}function J(e){var t=e.numPoints,r=t>=1e4?Math.round(t/1e3)+"k":t>=1e3?Math.round(t/100)/10+"k":t;return V(V({},e.properties),{cluster:!0,cluster_id:e.id,point_count:t,point_count_abbreviated:r})}function G(e){return e/360+.5}function W(e){var t=Math.sin(e*Math.PI/180),r=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return r<0?0:r>1?1:r}function V(e,t){for(var r in t)e[r]=t[r];return e}function Z(e){return e.x}function z(e){return e.y}function j(e,t){var r=e.tileID.canonical;if(!this._geoJSONIndex)return t(null,null);var o=this._geoJSONIndex.getTile(r.z,r.x,r.y);if(!o)return t(null,null);var i=new l(o.features),n=g(i);0===n.byteOffset&&n.byteLength===n.buffer.byteLength||(n=new Uint8Array(n)),t(null,{vectorTile:i,rawData:n.buffer});}N.prototype.load=function(e){var t=this.options,r=t.log,o=t.minZoom,i=t.maxZoom,n=t.nodeSize;r&&console.time("total time");var s="prepare "+e.length+" points";r&&console.time(s),this.points=e;for(var a=[],u=0;u<e.length;u++)e[u].geometry&&a.push(E(e[u],u));this.trees[i+1]=new L(a,Z,z,n,Float32Array),r&&console.timeEnd(s);for(var h=i;h>=o;h--){var l=+Date.now();a=this._cluster(a,h),this.trees[h]=new L(a,Z,z,n,Float32Array),r&&console.log("z%d: %d clusters in %dms",h,a.length,+Date.now()-l);}return r&&console.timeEnd("total time"),this},N.prototype.getClusters=function(e,t){var r=((e[0]+180)%360+360)%360-180,o=Math.max(-90,Math.min(90,e[1])),i=180===e[2]?180:((e[2]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)r=-180,i=180;else if(r>i){var s=this.getClusters([r,o,180,n],t),a=this.getClusters([-180,o,i,n],t);return s.concat(a)}for(var u=this.trees[this._limitZoom(t)],h=[],l=0,p=u.range(G(r),W(n),G(i),W(o));l<p.length;l+=1){var c=u.points[p[l]];h.push(c.numPoints?F(c):this.points[c.index]);}return h},N.prototype.getChildren=function(e){var t=this._getOriginId(e),r=this._getOriginZoom(e),o="No cluster with the specified id.",i=this.trees[r];if(!i)throw new Error(o);var n=i.points[t];if(!n)throw new Error(o);for(var s=this.options.radius/(this.options.extent*Math.pow(2,r-1)),a=[],u=0,h=i.within(n.x,n.y,s);u<h.length;u+=1){var l=i.points[h[u]];l.parentId===e&&a.push(l.numPoints?F(l):this.points[l.index]);}if(0===a.length)throw new Error(o);return a},N.prototype.getLeaves=function(e,t,r){var o=[];return this._appendLeaves(o,e,t=t||10,r=r||0,0),o},N.prototype.getTile=function(e,t,r){var o=this.trees[this._limitZoom(e)],i=Math.pow(2,e),n=this.options,s=n.radius/n.extent,a=(r-s)/i,u=(r+1+s)/i,h={features:[]};return this._addTileFeatures(o.range((t-s)/i,a,(t+1+s)/i,u),o.points,t,r,i,h),0===t&&this._addTileFeatures(o.range(1-s/i,a,1,u),o.points,i,r,i,h),t===i-1&&this._addTileFeatures(o.range(0,a,s/i,u),o.points,-1,r,i,h),h.features.length?h:null},N.prototype.getClusterExpansionZoom=function(e){for(var t=this._getOriginZoom(e)-1;t<=this.options.maxZoom;){var r=this.getChildren(e);if(t++,1!==r.length)break;e=r[0].properties.cluster_id;}return t},N.prototype._appendLeaves=function(e,t,r,o,i){for(var n=0,s=this.getChildren(t);n<s.length;n+=1){var a=s[n],u=a.properties;if(u&&u.cluster?i+u.point_count<=o?i+=u.point_count:i=this._appendLeaves(e,u.cluster_id,r,o,i):i<o?i++:e.push(a),e.length===r)break}return i},N.prototype._addTileFeatures=function(e,t,r,o,i,n){for(var s=0,a=e;s<a.length;s+=1){var u=t[a[s]],h=u.numPoints,l={type:1,geometry:[[Math.round(this.options.extent*(u.x*i-r)),Math.round(this.options.extent*(u.y*i-o))]],tags:h?J(u):this.points[u.index].properties},p=void 0;h?p=u.id:this.options.generateId?p=u.index:this.points[u.index].id&&(p=this.points[u.index].id),void 0!==p&&(l.id=p),n.features.push(l);}},N.prototype._limitZoom=function(e){return Math.max(this.options.minZoom,Math.min(e,this.options.maxZoom+1))},N.prototype._cluster=function(e,t){for(var r=[],o=this.options,i=o.reduce,n=o.radius/(o.extent*Math.pow(2,t)),s=0;s<e.length;s++){var a=e[s];if(!(a.zoom<=t)){a.zoom=t;for(var u=this.trees[t+1],h=u.within(a.x,a.y,n),l=a.numPoints||1,p=a.x*l,c=a.y*l,f=i&&l>1?this._map(a,!0):null,d=(s<<5)+(t+1)+this.points.length,g=0,v=h;g<v.length;g+=1){var y=u.points[v[g]];if(!(y.zoom<=t)){y.zoom=t;var m=y.numPoints||1;p+=y.x*m,c+=y.y*m,l+=m,y.parentId=d,i&&(f||(f=this._map(a,!0)),i(f,this._map(y)));}}1===l?r.push(a):(a.parentId=d,r.push(D(p/l,c/l,d,l,f)));}}return r},N.prototype._getOriginId=function(e){return e-this.points.length>>5},N.prototype._getOriginZoom=function(e){return (e-this.points.length)%32},N.prototype._map=function(e,t){if(e.numPoints)return t?V({},e.properties):e.properties;var r=this.points[e.index].properties,o=this.options.map(r);return t&&o===r?V({},o):o};var A=function(t){function r(e,r,o,i){t.call(this,e,r,o,j),i&&(this.loadGeoJSON=i);}return t&&(r.__proto__=t),(r.prototype=Object.create(t&&t.prototype)).constructor=r,r.prototype.loadData=function(e,t){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=t,this._pendingLoadDataParams=e,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData());},r.prototype._loadData=function(){var t=this;if(this._pendingCallback&&this._pendingLoadDataParams){var r=this._pendingCallback,o=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var i=!!(o&&o.request&&o.request.collectResourceTiming)&&new e.RequestPerformance(o.request);this.loadGeoJSON(o,(function(n,a){if(n||!a)return r(n);if("object"!=typeof a)return r(new Error("Input data given to '"+o.source+"' is not a valid GeoJSON object."));e.decodeFeatures(a),function e(t,r){var o,i=t&&t.type;if("FeatureCollection"===i)for(o=0;o<t.features.length;o++)e(t.features[o],r);else if("GeometryCollection"===i)for(o=0;o<t.geometries.length;o++)e(t.geometries[o],r);else if("Feature"===i)e(t.geometry,r);else if("Polygon"===i)s(t.coordinates,r);else if("MultiPolygon"===i)for(o=0;o<t.coordinates.length;o++)s(t.coordinates[o],r);return t}(a,!0);try{t._geoJSONIndex=o.cluster?new N(function(t){var r=t.superclusterOptions,o=t.clusterProperties;if(!o||!r)return r;for(var i={},n={},s={accumulated:null,zoom:0},a={properties:null},u=Object.keys(o),h=0,l=u;h<l.length;h+=1){var p=l[h],c=o[p],f=c[0],d=e.createExpression(c[1]),g=e.createExpression("string"==typeof f?[f,["accumulated"],["get",p]]:f);i[p]=d.value,n[p]=g.value;}return r.map=function(e){a.properties=e;for(var t={},r=0,o=u;r<o.length;r+=1){var n=o[r];t[n]=i[n].evaluate(s,a);}return t},r.reduce=function(e,t){a.properties=t;for(var r=0,o=u;r<o.length;r+=1){var i=o[r];s.accumulated=e[i],e[i]=n[i].evaluate(s,a);}},r}(o)).load(a.features):e.geojsonvt(a,o.geojsonVtOptions);}catch(n){return r(n)}t.loaded={};var u={};if(i){var h=i.finish();h&&(u.resourceTiming={},u.resourceTiming[o.source]=JSON.parse(JSON.stringify(h)));}r(null,u);}));}},r.prototype.coalesce=function(){"Coalescing"===this._state?this._state="Idle":"NeedsLoadData"===this._state&&(this._state="Coalescing",this._loadData());},r.prototype.reloadTile=function(e,r){var o=this.loaded;return o&&o[e.uid]?t.prototype.reloadTile.call(this,e,r):this.loadTile(e,r)},r.prototype.loadGeoJSON=function(t,r){if(t.request)e.getJSON(t.request,r);else {if("string"!=typeof t.data)return r(new Error("Input data given to '"+t.source+"' is not a valid GeoJSON object."));try{return r(null,JSON.parse(t.data))}catch(e){return r(new Error("Input data given to '"+t.source+"' is not a valid GeoJSON object."))}}},r.prototype.removeSource=function(e,t){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),t();},r.prototype.getClusterExpansionZoom=function(e,t){try{t(null,this._geoJSONIndex.getClusterExpansionZoom(e.clusterId));}catch(e){t(e);}},r.prototype.getClusterChildren=function(e,t){try{t(null,this._geoJSONIndex.getChildren(e.clusterId));}catch(e){t(e);}},r.prototype.getClusterLeaves=function(e,t){try{t(null,this._geoJSONIndex.getLeaves(e.clusterId,e.limit,e.offset));}catch(e){t(e);}},r}(e.VectorTileWorkerSource),B=function(t){var r=this;this.self=t,this.actor=new e.Actor(t,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:e.VectorTileWorkerSource,geojson:A},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(e,t){if(r.workerSourceTypes[e])throw new Error('Worker source with name "'+e+'" already registered.');r.workerSourceTypes[e]=t;},this.self.registerRTLTextPlugin=function(t){if(e.plugin.isParsed())throw new Error("RTL text plugin already registered.");e.plugin.applyArabicShaping=t.applyArabicShaping,e.plugin.processBidirectionalText=t.processBidirectionalText,e.plugin.processStyledBidirectionalText=t.processStyledBidirectionalText;};};return B.prototype.checkIfReady=function(e,t,r){r();},B.prototype.setReferrer=function(e,t){this.referrer=t;},B.prototype.setImages=function(e,t,r){for(var o in this.availableImages[e]=t,this.workerSources[e]){var i=this.workerSources[e][o];for(var n in i)i[n].availableImages=t;}r();},B.prototype.setLayers=function(e,t,r){this.getLayerIndex(e).replace(t),r();},B.prototype.setXml=function(e,t,r){this.getLayerIndex(e)._xml=t,r();},B.prototype.setLayersbuffer=function(t,r,o){var i=e.BufferTostyle(new e.Protobuf(r)),n=this.getLayerIndex(t);n.replace(i.layers),n._xml=i.xml,o();},B.prototype.updateLayers=function(e,t,r){this.getLayerIndex(e).update(t.layers,t.removedIds),r();},B.prototype.loadTile=function(e,t,r){this.getWorkerSource(e,t.type,t.source).loadTile(t,r);},B.prototype.loadDEMTile=function(e,t,r){this.getDEMWorkerSource(e,t.source).loadTile(t,r);},B.prototype.reloadTile=function(e,t,r){this.getWorkerSource(e,t.type,t.source).reloadTile(t,r);},B.prototype.abortTile=function(e,t,r){this.getWorkerSource(e,t.type,t.source).abortTile(t,r);},B.prototype.removeTile=function(e,t,r){this.getWorkerSource(e,t.type,t.source).removeTile(t,r);},B.prototype.removeDEMTile=function(e,t){this.getDEMWorkerSource(e,t.source).removeTile(t);},B.prototype.removeSource=function(e,t,r){if(this.workerSources[e]&&this.workerSources[e][t.type]&&this.workerSources[e][t.type][t.source]){var o=this.workerSources[e][t.type][t.source];delete this.workerSources[e][t.type][t.source],void 0!==o.removeSource?o.removeSource(t,r):r();}},B.prototype.loadWorkerSource=function(e,t,r){try{this.self.importScripts(t.url),r();}catch(e){r(e.toString());}},B.prototype.syncRTLPluginState=function(t,r,o){try{e.plugin.setState(r);var i=e.plugin.getPluginURL();if(e.plugin.isLoaded()&&!e.plugin.isParsed()&&null!=i){this.self.importScripts(i);var n=e.plugin.isParsed();o(n?void 0:new Error("RTL Text Plugin failed to import scripts from "+i),n);}}catch(e){o(e.toString());}},B.prototype.getAvailableImages=function(e){var t=this.availableImages[e];return t||(t=[]),t},B.prototype.getLayerIndex=function(e){var t=this.layerIndexes[e];return t||(t=this.layerIndexes[e]=new o),t},B.prototype.getWorkerSource=function(e,t,r){var o=this;return this.workerSources[e]||(this.workerSources[e]={}),this.workerSources[e][t]||(this.workerSources[e][t]={}),this.workerSources[e][t][r]||(this.workerSources[e][t][r]=new this.workerSourceTypes[t]({send:function(t,r,i,n,s,a){o.actor.send(t,r,i,e,n,a);},scheduler:this.actor.scheduler},this.getLayerIndex(e),this.getAvailableImages(e))),this.workerSources[e][t][r]},B.prototype.getDEMWorkerSource=function(e,t){return this.demWorkerSources[e]||(this.demWorkerSources[e]={}),this.demWorkerSources[e][t]||(this.demWorkerSources[e][t]=new n),this.demWorkerSources[e][t]},B.prototype.enforceCacheSizeLimit=function(t,r){e.enforceCacheSizeLimit(r);},"undefined"!=typeof WorkerGlobalScope&&void 0!==e.window&&e.window instanceof WorkerGlobalScope&&(e.window.worker=new B(e.window)),B}));
define(["./shared"],(function(t){"use strict";var e=t.createCommonjsModule((function(t){function e(t){return !i(t)}function i(t){return "undefined"==typeof window||"undefined"==typeof document?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return !1;var t,e,i=new Blob([""],{type:"text/javascript"}),r=URL.createObjectURL(i);try{e=new Worker(r),t=!0;}catch(e){t=!1;}return e&&e.terminate(),URL.revokeObjectURL(r),t}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var t=document.createElement("canvas");t.width=t.height=1;var e=t.getContext("2d");if(!e)return !1;var i=e.getImageData(0,0,1,1);return i&&i.width===t.width}()?(void 0===r[i=t&&t.failIfMajorPerformanceCaveat]&&(r[i]=function(t){var i=function(t){var i=document.createElement("canvas"),r=Object.create(e.webGLContextAttributes);return r.failIfMajorPerformanceCaveat=t,i.probablySupportsContext?i.probablySupportsContext("webgl",r)||i.probablySupportsContext("experimental-webgl",r):i.supportsContext?i.supportsContext("webgl",r)||i.supportsContext("experimental-webgl",r):i.getContext("webgl",r)||i.getContext("experimental-webgl",r)}(t);if(!i)return !1;var r=i.createShader(i.VERTEX_SHADER);return !(!r||i.isContextLost())&&(i.shaderSource(r,"void main() {}"),i.compileShader(r),!0===i.getShaderParameter(r,i.COMPILE_STATUS))}(i)),r[i]?void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var i;}t.exports?t.exports=e:window&&(window.sgmap=window.sgmap||{},window.sgmap.supported=e,window.sgmap.notSupportedReason=i);var r={};e.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};})),r={create:function(e,i,r){var o=t.window.document.createElement(e);return void 0!==i&&(o.className=i),r&&r.appendChild(o),o},createNS:function(e,i){return t.window.document.createElementNS(e,i)}},o=t.window.document.documentElement.style;function n(t){if(!o)return t[0];for(var e=0;e<t.length;e++)if(t[e]in o)return t[e];return t[0]}var a,s=n(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);r.disableDrag=function(){o&&s&&(a=o[s],o[s]="none");},r.enableDrag=function(){o&&s&&(o[s]=a);};var c=n(["transform","WebkitTransform"]);r.setTransform=function(t,e){t.style[c]=e;};var l=!1;try{var u=Object.defineProperty({},"passive",{get:function(){l=!0;}});t.window.addEventListener("test",u,u),t.window.removeEventListener("test",u,u);}catch(t){l=!1;}r.addEventListener=function(t,e,i,r){void 0===r&&(r={}),t.addEventListener(e,i,"passive"in r&&l?r:r.capture);},r.removeEventListener=function(t,e,i,r){void 0===r&&(r={}),t.removeEventListener(e,i,"passive"in r&&l?r:r.capture);};var h=function(e){e.preventDefault(),e.stopPropagation(),t.window.removeEventListener("click",h,!0);};function p(e,i,r){var o,n,a,s=t.browser.devicePixelRatio>1?"@2x":"",c=i.normalizeSpriteURL(e,s,".json"),l=i.normalizeSpriteURL(e,s,".png");e.indexOf("http")>=0&&(c=e+".json",l=e+".png");var u=t.getJSON(i.transformRequest(c,t.ResourceType.SpriteJSON),(function(t,e){u=null,a||(a=t,o=e,p());})),h=t.getImage(i.transformRequest(l,t.ResourceType.SpriteImage),(function(t,e){h=null,a||(a=t,n=e,p());}));function p(){if(a)r(a);else if(o&&n){var e=t.browser.getImageData(n),i={};for(var s in o){var c=o[s],l=c.width,u=c.height,h=c.x,p=c.y,f=c.sdf,d=c.pixelRatio,_=c.stretchX,m=c.stretchY,g=c.content,v=new t.RGBAImage({width:l,height:u});t.RGBAImage.copy(e,v,{x:h,y:p},{x:0,y:0},{width:l,height:u}),i[s]={data:v,pixelRatio:d,sdf:f,stretchX:_,stretchY:m,content:g};}r(null,i);}}return {cancel:function(){u&&(u.cancel(),u=null),h&&(h.cancel(),h=null);}}}function f(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",h,!0),t.window.setTimeout((function(){t.window.removeEventListener("click",h,!0);}),0);},r.mousePos=function(e,i){var r=e.getBoundingClientRect();return new t.Point(i.clientX-r.left-e.clientLeft,i.clientY-r.top-e.clientTop)},r.touchPos=function(e,i){for(var r=e.getBoundingClientRect(),o=[],n=0;n<i.length;n++)o.push(new t.Point(i[n].clientX-r.left-e.clientLeft,i[n].clientY-r.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 d=function(e){function i(){e.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.RGBAImage({width:1,height:1}),this.dirty=!0;}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.isLoaded=function(){return this.loaded},i.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t,t)){for(var e=0,i=this.requestors;e<i.length;e+=1){var r=i[e];this._notify(r.ids,r.callback);}this.requestors=[];}},i.prototype.getImage=function(t){return this.images[t]},i.prototype.addImage=function(t,e){this._validate(t,e)&&(this.images[t]=e);},i.prototype._validate=function(e,i){var r=!0;return this._validateStretch(i.stretchX,i.data&&i.data.width)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "stretchX" value'))),r=!1),this._validateStretch(i.stretchY,i.data&&i.data.height)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "stretchY" value'))),r=!1),this._validateContent(i.content,i)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "content" value'))),r=!1),r},i.prototype._validateStretch=function(t,e){if(!t)return !0;for(var i=0,r=0,o=t;r<o.length;r+=1){var n=o[r];if(n[0]<i||n[1]<n[0]||e<n[1])return !1;i=n[1];}return !0},i.prototype._validateContent=function(t,e){return !(t&&(4!==t.length||t[0]<0||e.data.width<t[0]||t[1]<0||e.data.height<t[1]||t[2]<0||e.data.width<t[2]||t[3]<0||e.data.height<t[3]||t[2]<t[0]||t[3]<t[1]))},i.prototype.updateImage=function(t,e){e.version=this.images[t].version+1,this.images[t]=e,this.updatedImages[t]=!0;},i.prototype.removeImage=function(t){var e=this.images[t];delete this.images[t],delete this.patterns[t],e.userImage&&e.userImage.onRemove&&e.userImage.onRemove();},i.prototype.listImages=function(){return Object.keys(this.images)},i.prototype.getImages=function(t,e){var i=!0;if(!this.isLoaded())for(var r=0,o=t;r<o.length;r+=1)this.images[o[r]]||(i=!1);this.isLoaded()||i?this._notify(t,e):this.requestors.push({ids:t,callback:e});},i.prototype._notify=function(e,i){for(var r={},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?r[a]={data:s.data.clone(),pixelRatio:s.pixelRatio,sdf:s.sdf,version:s.version,stretchX:s.stretchX,stretchY:s.stretchY,content:s.content,hasRenderCallback:Boolean(s.userImage&&s.userImage.render)}:t.warnOnce('Image "'+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.');}i(null,r);},i.prototype.getPixelSize=function(){var t=this.atlasImage;return {width:t.width,height:t.height}},i.prototype.getPattern=function(e){var i=this.patterns[e],r=this.getImage(e);if(!r)return null;if(i&&i.position.version===r.version)return i.position;if(i)i.position.version=r.version;else {var o={w:r.data.width+2,h:r.data.height+2,x:0,y:0},n=new t.ImagePosition(o,r);this.patterns[e]={bin:o,position:n};}return this._updatePatternAtlas(),this.patterns[e].position},i.prototype.bind=function(e){var i=e.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new t.Texture(e,this.atlasImage,i.RGBA),this.atlasTexture.bind(i.LINEAR,i.CLAMP_TO_EDGE);},i.prototype._updatePatternAtlas=function(){var e=[];for(var i in this.patterns)e.push(this.patterns[i].bin);var r=t.potpack(e),o=r.w,n=r.h,a=this.atlasImage;for(var s in a.resize({width:o||1,height:n||1}),this.patterns){var c=this.patterns[s].bin,l=c.x+1,u=c.y+1,h=this.images[s].data,p=h.width,f=h.height;t.RGBAImage.copy(h,a,{x:0,y:0},{x:l,y:u},{width:p,height:f}),t.RGBAImage.copy(h,a,{x:0,y:f-1},{x:l,y:u-1},{width:p,height:1}),t.RGBAImage.copy(h,a,{x:0,y:0},{x:l,y:u+f},{width:p,height:1}),t.RGBAImage.copy(h,a,{x:p-1,y:0},{x:l-1,y:u},{width:1,height:f}),t.RGBAImage.copy(h,a,{x:0,y:0},{x:l+p,y:u},{width:1,height:f});}this.dirty=!0;},i.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={};},i.prototype.dispatchRenderCallbacks=function(t){for(var e=0,i=t;e<i.length;e+=1){var r=i[e];if(!this.callbackDispatchedThisFrame[r]){this.callbackDispatchedThisFrame[r]=!0;var o=this.images[r];f(o)&&this.updateImage(r,o);}}},i}(t.Evented),_=function(){this.specification=t.styleSpec.light.position;};_.prototype.possiblyEvaluate=function(e,i){return t.sphericalToCartesian(e.expression.evaluate(i))},_.prototype.interpolate=function(e,i,r){return {x:t.number(e.x,i.x,r),y:t.number(e.y,i.y,r),z:t.number(e.z,i.z,r)}};var m=new t.Properties({anchor:new t.DataConstantProperty(t.styleSpec.light.anchor),position:new _,color:new t.DataConstantProperty(t.styleSpec.light.color),intensity:new t.DataConstantProperty(t.styleSpec.light.intensity)}),g=function(e){function i(i){e.call(this),this._transitionable=new t.Transitionable(m),this.setLight(i),this._transitioning=this._transitionable.untransitioned();}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.getLight=function(){return this._transitionable.serialize()},i.prototype.setLight=function(e,i){if(void 0===i&&(i={}),!this._validate(t.validateLight,e,i))for(var r in e){var o=e[r];t.endsWith(r,"-transition")?this._transitionable.setTransition(r.slice(0,-"-transition".length),o):this._transitionable.setValue(r,o);}},i.prototype.updateTransitions=function(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning);},i.prototype.hasTransition=function(){return this._transitioning.hasTransition()},i.prototype.recalculate=function(t){this.properties=this._transitioning.possiblyEvaluate(t);},i.prototype._validate=function(e,i,r){return (!r||!1!==r.validate)&&t.emitValidationErrors(this,e.call(t.validateStyle,t.extend({value:i,style:{glyphs:!0,sprite:!0},styleSpec:t.styleSpec})))},i}(t.Evented),v=function e(i,r){var o=this;this.workerPool=i,this.actors=[],this.currentActor=0,this.id=t.uniqueId();for(var n=this.workerPool.acquire(this.id),a=0;a<n.length;a++){var s=new e.Actor(n[a],r,this.id);s.name="Worker "+a,this.actors.push(s);}this.ready=!1,this.broadcast("checkIfReady",null,(function(){o.ready=!0;}));};function y(e,i,r,o){var n=i*(t.EXTENT/(e.tileSize*Math.pow(2,r-e.tileID.overscaledZ)));return "xy"==o?"Sg4326"==e.tileID.reference?[n,n/e.tileID._tileY[1]]:[n,n]:n}v.prototype.broadcast=function(e,i,r){t.asyncAll(this.actors,(function(t,r){t.send(e,i,r);}),r=r||function(){});},v.prototype.getActor=function(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]},v.prototype.remove=function(){this.actors.forEach((function(t){t.remove();})),this.actors=[],this.workerPool.release(this.id);},v.Actor=t.Actor;var b=2*Math.PI*t.earthRadius;function w(t){return b*Math.cos(t*Math.PI/180)}function x(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}var T=function(t,e,i){void 0===i&&(i=0),this.x=+t,this.y=+e,this.z=+i;};function S(e,i,r){var o=function(o,n){if(o)return r(o);if(n){var a=t.pick(t.extend(n,e),["tiles","minzoom","maxzoom","attribution","sgmap_logo","bounds","scheme","tileSize","encoding","tilesecurity","traffic","zoomRule","reference"]);2==n.reference&&(a.reference="Sg4326"),n.vector_layers&&(a.vectorLayers=n.vector_layers,a.vectorLayerIds=a.vectorLayers.map((function(t){return t.id}))),a.tiles=i.canonicalizeTileset(a,e.url),r(null,a);}};return e.url?t.getJSON(i.transformRequest(i.normalizeSourceURL(e.url),t.ResourceType.Source),o):t.browser.frame((function(){return o(null,e)}))}T.fromLngLat=function(e,i){void 0===i&&(i=0);var r=t.LngLat.convert(e);return new T((180+r.lng)/360,(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r.lat*Math.PI/360)))/360,function(t,e){return t/w(e)}(i,r.lat))},T.prototype.toLngLat=function(){return new t.LngLat(360*this.x-180,x(this.y))},T.prototype.toAltitude=function(){return this.z*w(x(this.y))},T.prototype.meterInMercatorCoordinateUnits=function(){return 1/b*(t=x(this.y),1/Math.cos(t*Math.PI/180));var t;};var E=function(e,i,r){this.bounds=t.LngLatBounds.convert(this.validateBounds(e)),this.minzoom=i||0,this.maxzoom=r||24;};E.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]},E.prototype.contains=function(e){var i=Math.pow(2,e.z),r=t.config.parse,o=r.xFromLng,n=r.yFromLat,a=Math.floor(o(this.bounds.getWest())*i),s=Math.floor(n(this.bounds.getNorth())*i),c=Math.ceil(o(this.bounds.getEast())*i),l=Math.ceil(n(this.bounds.getSouth())*i);return e.x>=a&&e.x<c&&e.y>=s&&e.y<l};var A=function(e){function i(i,r,o,n){if(e.call(this),this.id=i,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(r,["url","scheme","tileSize","promoteId"])),this._options=t.extend({type:"vector"},r),this._collectResourceTiming=r.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(n),this._tileWorkers={},this._deduped=new t.DedupedRequest;}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.load=function(){var e=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=S(this._options,this.map._requestManager,(function(i,r){e._tileJSONRequest=null,e._loaded=!0,i?e.fire(new t.ErrorEvent(i)):r&&(t.extend(e,r),r.bounds&&(e.tileBounds=new E(r.bounds,e.minzoom,e.maxzoom)),t.postTurnstileEvent(r.tiles,e.map._requestManager._customAccessToken),t.postMapLoadEvent(r.tiles,e.map._getMapId(),e.map._requestManager._skuToken,e.map._requestManager._customAccessToken),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})));}));},i.prototype.loaded=function(){return this._loaded},i.prototype.hasTile=function(t){return !this.tileBounds||this.tileBounds.contains(t.canonical)},i.prototype.onAdd=function(t){this.map=t,this.load();},i.prototype.setSourceProperty=function(t){this._tileJSONRequest&&this._tileJSONRequest.cancel(),t();for(var e=0,i=this.map.style._getSourceCaches(this.id);e<i.length;e+=1)i[e].clearTiles();this.load();},i.prototype.setTiles=function(t){var e=this;return this.setSourceProperty((function(){e._options.tiles=t;})),this},i.prototype.setUrl=function(t){var e=this;return this.setSourceProperty((function(){e.url=t,e._options.url=t;})),this},i.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null);},i.prototype.serialize=function(){return t.extend({},this._options)},i.prototype.loadTile=function(e,i){var r=this,o=e.tileID.canonical,n=this.map._requestManager.normalizeTileURL(o.url(this.tiles,this.scheme,e)),a={request:t.extend(this.map._requestManager.transformRequest(n,t.ResourceType.Tile),{tilesecurity:this.tilesecurity,zxy:o,traffic:this.traffic,reference:this.reference}),uid:e.uid,tileID:e.tileID,tileZoom:e.tileZoom,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,isSymbolTile:e.isSymbolTile};if(a.request.collectResourceTiming=this._collectResourceTiming,e.actor&&"expired"!==e.state)"loading"===e.state?e.reloadCallback=i:e.request=e.actor.send("reloadTile",a,c.bind(this));else if(e.actor=this._tileWorkers[n]=this._tileWorkers[n]||this.dispatcher.getActor(),this.dispatcher.ready)e.request=e.actor.send("loadTile",a,c.bind(this));else {var s=t.loadVectorTile.call({deduped:this._deduped},a,(function(t,i){t||!i?c.call(r,t):(a.data={cacheControl:i.cacheControl,expires:i.expires,rawData:i.rawData.slice(0)},e.actor&&e.actor.send("loadTile",a,c.bind(r)));}),!0);e.request={cancel:s};}function c(r,o){return delete e.request,e.aborted?i(null):r&&404!==r.status?i(r):(o&&o.resourceTiming&&(e.resourceTiming=o.resourceTiming),this.map._refreshExpiredTiles&&o&&e.setExpiryData(o),e.loadVectorData(o,this.map.painter),t.cacheEntryPossiblyAdded(this.dispatcher),i(null),void(e.reloadCallback&&(this.loadTile(e,e.reloadCallback),e.reloadCallback=null)))}},i.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.actor&&t.actor.send("abortTile",{uid:t.uid,type:this.type,source:this.id},void 0);},i.prototype.unloadTile=function(t){t.unloadVectorData(),t.actor&&t.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id},void 0);},i.prototype.hasTransition=function(){return !1},i.prototype.afterUpdate=function(){this._tileWorkers={};},i}(t.Evented),k=function(e){function i(i,r,o,n){e.call(this),this.id=i,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"},r),t.extend(this,t.pick(r,["url","scheme","tileSize"]));}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.load=function(){var e=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=S(this._options,this.map._requestManager,(function(i,r){e._tileJSONRequest=null,e._loaded=!0,i?e.fire(new t.ErrorEvent(i)):r&&(t.extend(e,r),r.bounds&&(e.tileBounds=new E(r.bounds,e.minzoom,e.maxzoom)),t.postTurnstileEvent(r.tiles),t.postMapLoadEvent(r.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"})));}));},i.prototype.loaded=function(){return this._loaded},i.prototype.onAdd=function(t){this.map=t,this.load();},i.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null);},i.prototype.serialize=function(){return t.extend({},this._options)},i.prototype.hasTile=function(t){return !this.tileBounds||this.tileBounds.contains(t.canonical)},i.prototype.loadTile=function(e,i){var r=this,o=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);e.request=t.getImage(t.extend(this.map._requestManager.transformRequest(o,t.ResourceType.Tile),{tilesecurity:this.tilesecurity,zxy:e.tileID.canonical,traffic:this.traffic,reference:this.reference}),(function(o,n){if(delete e.request,e.aborted)e.state="unloaded",i(null);else if(o)e.state="errored",i(o);else if(n){r.map._refreshExpiredTiles&&e.setExpiryData(n),delete n.cacheControl,delete n.expires;var a=r.map.painter.context,s=a.gl;e.texture=r.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(r.dispatcher),i(null);}}));},i.prototype.abortTile=function(t,e){t.request&&(t.request.cancel(),delete t.request),e();},i.prototype.unloadTile=function(t,e){t.texture&&this.map.painter.saveTileTexture(t.texture),e();},i.prototype.hasTransition=function(){return !1},i}(t.Evented),I=function(e){function i(i,r,o,n){e.call(this,i,r,o,n),this.type="raster-dem",this.maxzoom=22,this._options=t.extend({type:"raster-dem"},r),this.encoding=r.encoding||"sgmap";}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.serialize=function(){return {type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},i.prototype.loadTile=function(e,i){var r=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);function o(t,r){t&&(e.state="errored",i(t)),r&&(e.dem=r,e.needsHillshadePrepare=!0,e.state="loaded",i(null));}e.request=t.getImage(this.map._requestManager.transformRequest(r,t.ResourceType.Tile),function(r,n){if(delete e.request,e.aborted)e.state="unloaded",i(null);else if(r)e.state="errored",i(r);else if(n){this.map._refreshExpiredTiles&&e.setExpiryData(n),delete n.cacheControl,delete n.expires;var a=t.window.ImageBitmap&&n instanceof t.window.ImageBitmap&&t.offscreenCanvasSupported()?n:t.browser.getImageData(n,1),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);},i.prototype._getNeighboringTiles=function(e){var i=e.canonical,r=Math.pow(2,i.z),o=(i.x-1+r)%r,n=0===i.x?e.wrap-1:e.wrap,a=(i.x+1+r)%r,s=i.x+1===r?e.wrap+1:e.wrap,c={};return c[new t.OverscaledTileID(e.overscaledZ,n,i.z,o,i.y).key]={backfilled:!1},c[new t.OverscaledTileID(e.overscaledZ,s,i.z,a,i.y).key]={backfilled:!1},i.y>0&&(c[new t.OverscaledTileID(e.overscaledZ,n,i.z,o,i.y-1).key]={backfilled:!1},c[new t.OverscaledTileID(e.overscaledZ,e.wrap,i.z,i.x,i.y-1).key]={backfilled:!1},c[new t.OverscaledTileID(e.overscaledZ,s,i.z,a,i.y-1).key]={backfilled:!1}),i.y+1<r&&(c[new t.OverscaledTileID(e.overscaledZ,n,i.z,o,i.y+1).key]={backfilled:!1},c[new t.OverscaledTileID(e.overscaledZ,e.wrap,i.z,i.x,i.y+1).key]={backfilled:!1},c[new t.OverscaledTileID(e.overscaledZ,s,i.z,a,i.y+1).key]={backfilled:!1}),c},i.prototype.unloadTile=function(t){t.demTexture&&this.map.painter.saveTileTexture(t.demTexture),t.fbo&&(t.fbo.destroy(),delete t.fbo),t.dem&&delete t.dem,delete t.neighboringTiles,t.state="unloaded",t.actor&&t.actor.send("removeDEMTile",{uid:t.uid,source:this.id});},i}(k),B=function(e){function i(i,r,o,n){e.call(this),this.id=i,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._loaded=!1,this.actor=o.getActor(),this.setEventedParent(n),this._data=r.data,this._options=t.extend({},r),this._collectResourceTiming=r.collectResourceTiming,this._resourceTiming=[],void 0!==r.maxzoom&&(this.maxzoom=r.maxzoom),r.type&&(this.type=r.type),r.attribution&&(this.attribution=r.attribution),this.promoteId=r.promoteId;var a=t.EXTENT/this.tileSize;this.workerOptions=t.extend({source:this.id,cluster:r.cluster||!1,geojsonVtOptions:{buffer:(void 0!==r.buffer?r.buffer:128)*a,tolerance:(void 0!==r.tolerance?r.tolerance:.375)*a,extent:t.EXTENT,maxZoom:this.maxzoom,lineMetrics:r.lineMetrics||!1,generateId:r.generateId||!1},superclusterOptions:{maxZoom:void 0!==r.clusterMaxZoom?Math.min(r.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,extent:t.EXTENT,radius:(r.clusterRadius||50)*a,log:!1,generateId:r.generateId||!1},clusterProperties:r.clusterProperties},r.workerOptions);}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.load=function(){var e=this;this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(i){if(i)e.fire(new t.ErrorEvent(i));else {var r={dataType:"source",sourceDataType:"metadata"};e._collectResourceTiming&&e._resourceTiming&&e._resourceTiming.length>0&&(r.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new t.Event("data",r));}}));},i.prototype.onAdd=function(t){this.map=t,this.load();},i.prototype.setData=function(e){var i=this;return this._data=e,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(e){if(e)i.fire(new t.ErrorEvent(e));else {var r={dataType:"source",sourceDataType:"content"};i._collectResourceTiming&&i._resourceTiming&&i._resourceTiming.length>0&&(r.resourceTiming=i._resourceTiming,i._resourceTiming=[]),i.fire(new t.Event("data",r));}})),this},i.prototype.getClusterExpansionZoom=function(t,e){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},e),this},i.prototype.getClusterChildren=function(t,e){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},e),this},i.prototype.getClusterLeaves=function(t,e,i,r){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:i},r),this},i.prototype._updateWorkerData=function(e){var i=this;this._loaded=!1;var r=t.extend({},this.workerOptions);r.geojsonVtOptions.crs=this.map.transform.type;var o=this._data;"string"==typeof o?(r.request=this.map._requestManager.transformRequest(t.browser.resolveURL(o),t.ResourceType.Source),r.request.collectResourceTiming=this._collectResourceTiming):r.data=JSON.stringify(o),this.actor.send(this.type+".loadData",r,(function(t,o){i._removed||o&&o.abandoned||(i._loaded=!0,o&&o.resourceTiming&&o.resourceTiming[i.id]&&(i._resourceTiming=o.resourceTiming[i.id].slice(0)),i.actor.send(i.type+".coalesce",{source:r.source},null),e(t));}));},i.prototype.loaded=function(){return this._loaded},i.prototype.loadTile=function(e,i){var r=this,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?i(null):t?i(t):(e.loadVectorData(n,r.map.painter,"reloadTile"===o),i(null))}));},i.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0;},i.prototype.unloadTile=function(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id});},i.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id});},i.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},i.prototype.hasTransition=function(){return !1},i}(t.Evented),P=t.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),C=function(e){function i(t,i,r,o){e.call(this),this.id=t,this.dispatcher=r,this.coordinates=i.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(o),this.options=i;}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.load=function(e,i){var r=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this.url=this.options.url,t.getImage(this.map._requestManager.transformRequest(this.url,t.ResourceType.Image),(function(o,n){r._loaded=!0,o?r.fire(new t.ErrorEvent(o)):n&&(r.image=n,e&&(r.coordinates=e),i&&i(),r._finishLoading());}));},i.prototype.loaded=function(){return this._loaded},i.prototype.updateImage=function(t){var e=this;return this.image&&t.url?(this.options.url=t.url,this.load(t.coordinates,(function(){e.texture=null;})),this):this},i.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})));},i.prototype.onAdd=function(t){this.map=t,this.load();},i.prototype.setCoordinates=function(e){var i=this;this.coordinates=e;var r=e.map(t.config.parse.Coordinate.fromLngLat);this.tileID=function(e){for(var i=1/0,r=1/0,o=-1/0,n=-1/0,a=0,s=e;a<s.length;a+=1){var c=s[a];i=Math.min(i,c.x),r=Math.min(r,c.y),o=Math.max(o,c.x),n=Math.max(n,c.y);}var l=Math.max(o-i,n-r),u=Math.max(0,Math.floor(-Math.log(l)/Math.LN2)),h=Math.pow(2,u);return new t.CanonicalTileID(u,Math.floor((i+o)/2*h),Math.floor((r+n)/2*h))}(r),this.minzoom=this.maxzoom=this.tileID.z;var o=r.map((function(t){return i.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},i.prototype.prepare=function(){if(0!==Object.keys(this.tiles).length&&this.image){var e=this.map.painter.context,i=e.gl;for(var r in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,P.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new t.Texture(e,this.image,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE)),this.tiles){var o=this.tiles[r];"loaded"!==o.state&&(o.state="loaded",o.texture=this.texture);}}},i.prototype.loadTile=function(t,e){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={},e(null)):(t.state="errored",e(null));},i.prototype.serialize=function(){return {type:"image",url:this.options.url,coordinates:this.coordinates}},i.prototype.hasTransition=function(){return !1},i}(t.Evented),z=function(e){function i(t,i,r,o){e.call(this,t,i,r,o),this.roundZoom=!0,this.type="video",this.options=i;}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.load=function(){var e=this;this._loaded=!1;var i=this.options;this.urls=[];for(var r=0,o=i.urls;r<o.length;r+=1)this.urls.push(this.map._requestManager.transformRequest(o[r],t.ResourceType.Source).url);t.getVideo(this.urls,(function(i,r){e._loaded=!0,i?e.fire(new t.ErrorEvent(i)):r&&(e.video=r,e.video.loop=!0,e.video.addEventListener("playing",(function(){e.map.triggerRepaint();})),e.map&&e.video.play(),e._finishLoading());}));},i.prototype.pause=function(){this.video&&this.video.pause();},i.prototype.play=function(){this.video&&this.video.play();},i.prototype.seek=function(e){if(this.video){var i=this.video.seekable;e<i.start(0)||e>i.end(0)?this.fire(new t.ErrorEvent(new t.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+i.start(0)+" and "+i.end(0)+"-second mark."))):this.video.currentTime=e;}},i.prototype.getVideo=function(){return this.video},i.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)));},i.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var e=this.map.painter.context,i=e.gl;for(var r in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,P.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE),i.texSubImage2D(i.TEXTURE_2D,0,0,0,i.RGBA,i.UNSIGNED_BYTE,this.video)):(this.texture=new t.Texture(e,this.video,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE)),this.tiles){var o=this.tiles[r];"loaded"!==o.state&&(o.state="loaded",o.texture=this.texture);}}},i.prototype.serialize=function(){return {type:"video",urls:this.urls,coordinates:this.coordinates}},i.prototype.hasTransition=function(){return this.video&&!this.video.paused},i}(C),D=function(e){function i(i,r,o,n){e.call(this,i,r,o,n),r.coordinates?Array.isArray(r.coordinates)&&4===r.coordinates.length&&!r.coordinates.some((function(t){return !Array.isArray(t)||2!==t.length||t.some((function(t){return "number"!=typeof t}))}))||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+i,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+i,null,'missing required property "coordinates"'))),r.animate&&"boolean"!=typeof r.animate&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+i,null,'optional "animate" property must be a boolean value'))),r.canvas?"string"==typeof r.canvas||r.canvas instanceof t.window.HTMLCanvasElement||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+i,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+i,null,'missing required property "canvas"'))),this.options=r,this.animate=void 0===r.animate||r.animate;}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof t.window.HTMLCanvasElement?this.options.canvas:t.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint();},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1);},this._finishLoading());},i.prototype.getCanvas=function(){return this.canvas},i.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play();},i.prototype.onRemove=function(){this.pause();},i.prototype.prepare=function(){var e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){var i=this.map.painter.context,r=i.gl;for(var o in this.boundsBuffer||(this.boundsBuffer=i.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(i,this.canvas,r.RGBA,{premultiply:!0}),this.tiles){var n=this.tiles[o];"loaded"!==n.state&&(n.state="loaded",n.texture=this.texture);}}},i.prototype.serialize=function(){return {type:"canvas",coordinates:this.coordinates}},i.prototype.hasTransition=function(){return this._playing},i.prototype._hasInvalidDimensions=function(){for(var t=0,e=[this.canvas.width,this.canvas.height];t<e.length;t+=1){var i=e[t];if(isNaN(i)||i<=0)return !0}return !1},i}(C),M={vector:A,raster:k,"raster-dem":I,geojson:B,video:z,image:C,canvas:D};function R(e,i){var r=t.identity([]);return t.translate(r,r,[1,1,0]),t.scale(r,r,[.5*e.width,.5*e.height,1]),t.multiply(r,r,e.calculatePosMatrix(i.toUnwrapped()))}function L(t,e,i,r,o,n){var a=function(t,e,i){if(t)for(var r=0,o=t;r<o.length;r+=1){var n=e[o[r]];if(n&&n.source===i&&"fill-extrusion"===n.type)return !0}else for(var a in e){var s=e[a];if(s.source===i&&"fill-extrusion"===s.type)return !0}return !1}(o&&o.layers,e,t.id),s=n.maxPitchScaleFactor(),c=t.tilesIn(r,s,a);c.sort(F);for(var l=[],u=0,h=c;u<h.length;u+=1){var p=h[u];l.push({wrappedTileID:p.tileID.wrapped().key,queryResults:p.tile.queryRenderedFeatures(e,i,t._state,p.queryGeometry,p.cameraQueryGeometry,p.scale,o,n,s,R(t.transform,p.tileID))});}var f=function(t){for(var e={},i={},r=0,o=t;r<o.length;r+=1){var n=o[r],a=n.queryResults,s=n.wrappedTileID,c=i[s]=i[s]||{};for(var l in a)for(var u=a[l],h=c[l]=c[l]||{},p=e[l]=e[l]||[],f=0,d=u;f<d.length;f+=1){var _=d[f];h[_.featureIndex]||(h[_.featureIndex]=!0,p.push(_));}}return e}(l);for(var d in f)f[d].forEach((function(e){var i=e.feature,r=t.getFeatureState(i.layer["source-layer"],i.id);i.source=i.layer.source,i.layer["source-layer"]&&(i.sourceLayer=i.layer["source-layer"]),i.state=r;}));return f}function O(t,e){for(var i=t.getRenderableIds().map((function(e){return t.getTileByID(e)})),r=[],o={},n=0;n<i.length;n++){var a=i[n],s=a.tileID.canonical.key;o[s]||(o[s]=!0,a.querySourceFeatures(r,e));}return r}function F(t,e){var i=t.tileID,r=e.tileID;return i.overscaledZ-r.overscaledZ||i.canonical.y-r.canonical.y||i.wrap-r.wrap||i.canonical.x-r.canonical.x}var U=function(t,e){this.max=t,this.onRemove=e,this.reset();};U.prototype.reset=function(){for(var t in this.data)for(var e=0,i=this.data[t];e<i.length;e+=1){var r=i[e];r.timeout&&clearTimeout(r.timeout),this.onRemove(r.value);}return this.data={},this.order=[],this},U.prototype.add=function(t,e,i){var r=this,o=t.wrapped().key;void 0===this.data[o]&&(this.data[o]=[]);var n={value:e,timeout:void 0};if(void 0!==i&&(n.timeout=setTimeout((function(){r.remove(t,n);}),i)),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},U.prototype.has=function(t){return t.wrapped().key in this.data},U.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},U.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},U.prototype.getByKey=function(t){var e=this.data[t];return e?e[0].value:null},U.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},U.prototype.remove=function(t,e){if(!this.has(t))return this;var i=t.wrapped().key,r=void 0===e?0:this.data[i].indexOf(e),o=this.data[i][r];return this.data[i].splice(r,1),o.timeout&&clearTimeout(o.timeout),0===this.data[i].length&&delete this.data[i],this.onRemove(o.value),this.order.splice(this.order.indexOf(i),1),this},U.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},U.prototype.filter=function(t){var e=[];for(var i in this.data)for(var r=0,o=this.data[i];r<o.length;r+=1){var n=o[r];t(n.value)||e.push(n);}for(var a=0,s=e;a<s.length;a+=1){var c=s[a];this.remove(c.value.tileID,c);}};var N=function(t,e,i){this.context=t;var r=t.gl;this.buffer=r.createBuffer(),this.dynamicDraw=Boolean(i),this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),r.bufferData(r.ELEMENT_ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?r.DYNAMIC_DRAW:r.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer;};N.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer);},N.prototype.updateData=function(t){var e=this.context.gl;this.context.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer);},N.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer);};var j={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},V=function(t,e,i,r){this.length=e.length,this.attributes=i,this.itemSize=e.bytesPerElement,this.dynamicDraw=r,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 i=0;i<this.attributes.length;i++){var r=e.attributes[this.attributes[i].name];void 0!==r&&t.enableVertexAttribArray(r);}},V.prototype.setVertexAttribPointers=function(t,e,i){for(var r=0;r<this.attributes.length;r++){var o=this.attributes[r],n=e.attributes[o.name];void 0!==n&&t.vertexAttribPointer(n,o.components,t[j[o.type]],!1,this.itemSize,o.offset+this.itemSize*(i||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 Z=function(e){function i(){e.apply(this,arguments);}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.getDefault=function(){return t.Color.transparent},i.prototype.set=function(t){var e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1);},i}(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 1},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.clearDepth(t),this.current=t,this.dirty=!1);},e}(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 0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.clearStencil(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 [!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),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 !0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.depthMask(t),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(){return 255},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.stencilMask(t),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 {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),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(){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),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 !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),$=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),it=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return !1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.BLEND):e.disable(e.BLEND),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(){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 i(){e.apply(this,arguments);}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.getDefault=function(){return t.Color.transparent},i.prototype.set=function(t){var e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1);},i}(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),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.CCW},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(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 null},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.useProgram(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(){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),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(){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),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){if(t!==this.current||this.dirty){var e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,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.bindRenderbuffer(e.RENDERBUFFER,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.bindTexture(e.TEXTURE_2D,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){if(t!==this.current||this.dirty){var e=this.gl;e.bindBuffer(e.ARRAY_BUFFER,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){var e=this.gl;e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1;},e}(q),gt=function(t){function e(e){t.call(this,e),this.vao=e.extVertexArrayObject;}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){this.vao&&(t!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(t),this.current=t,this.dirty=!1);},e}(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 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),yt=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return !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),bt=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return !1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1;}},e}(q),wt=function(t){function e(e,i){t.call(this,e),this.context=e,this.parent=i;}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e}(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.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}(wt),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.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}(wt),St=function(t,e,i,r){this.context=t,this.width=e,this.height=i;var o=this.framebuffer=t.gl.createFramebuffer();this.colorAttachment=new xt(t,o),r&&(this.depthAttachment=new Tt(t,o));};St.prototype.destroy=function(){var t=this.context.gl,e=this.colorAttachment.get();if(e&&t.deleteTexture(e),this.depthAttachment){var i=this.depthAttachment.get();i&&t.deleteRenderbuffer(i);}t.deleteFramebuffer(this.framebuffer);};var Et=function(t,e,i){this.func=t,this.mask=e,this.range=i;};Et.ReadOnly=!1,Et.ReadWrite=!0,Et.disabled=new Et(519,Et.ReadOnly,[0,1]);var At=function(t,e,i,r,o,n){this.test=t,this.ref=e,this.mask=i,this.fail=r,this.depthFail=o,this.pass=n;};At.disabled=new At({func:519,mask:0},0,0,7680,7680,7680);var kt=function(t,e,i){this.blendFunction=t,this.blendColor=e,this.mask=i;};kt.disabled=new kt(kt.Replace=[1,0],t.Color.transparent,[!1,!1,!1,!1]),kt.unblended=new kt(kt.Replace,t.Color.transparent,[!0,!0,!0,!0]),kt.alphaBlended=new kt([1,771],t.Color.transparent,[!0,!0,!0,!0]);var It=function(t,e,i){this.enable=t,this.mode=e,this.frontFace=i;};It.disabled=new It(!1,1029,2305),It.backCCW=new It(!0,1029,2305);var Bt=function(t){this.gl=t,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new Z(this),this.clearDepth=new G(this),this.clearStencil=new H(this),this.colorMask=new W(this),this.depthMask=new X(this),this.stencilMask=new K(this),this.stencilFunc=new Y(this),this.stencilOp=new J(this),this.stencilTest=new Q(this),this.depthRange=new $(this),this.depthTest=new tt(this),this.depthFunc=new et(this),this.blend=new it(this),this.blendFunc=new rt(this),this.blendColor=new ot(this),this.blendEquation=new nt(this),this.cullFace=new at(this),this.cullFaceSide=new st(this),this.frontFace=new ct(this),this.program=new lt(this),this.activeTexture=new ut(this),this.viewport=new ht(this),this.bindFramebuffer=new pt(this),this.bindRenderbuffer=new ft(this),this.bindTexture=new dt(this),this.bindVertexBuffer=new _t(this),this.bindElementBuffer=new mt(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new gt(this),this.pixelStoreUnpack=new vt(this),this.pixelStoreUnpackPremultiplyAlpha=new yt(this),this.pixelStoreUnpackFlipY=new bt(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");};Bt.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();},Bt.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;},Bt.prototype.createIndexBuffer=function(t,e){return new N(this,t,e)},Bt.prototype.createVertexBuffer=function(t,e,i){return new V(this,t,e,i)},Bt.prototype.createRenderbuffer=function(t,e,i){var r=this.gl,o=r.createRenderbuffer();return this.bindRenderbuffer.set(o),r.renderbufferStorage(r.RENDERBUFFER,t,e,i),this.bindRenderbuffer.set(null),o},Bt.prototype.createFramebuffer=function(t,e,i){return new St(this,t,e,i)},Bt.prototype.clear=function(t){var e=t.color,i=t.depth,r=this.gl,o=0;e&&(o|=r.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),void 0!==i&&(o|=r.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(i),this.depthMask.set(!0)),r.clear(o);},Bt.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));},Bt.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);},Bt.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);},Bt.prototype.setColorMode=function(e){t.deepEqual(e.blendFunction,kt.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask);},Bt.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null);};var Pt=function(e){function i(i,r,o){var n=this;e.call(this),this.id=i,this._onlySymbols=o,r.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));})),r.on("error",(function(){n._sourceErrored=!0;})),this._source=r,this._tiles={},this._cache=new U(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new t.SourceFeatureState,this._mergeTile=[],this._mergeCallback=[];}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.onAdd=function(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null;},i.prototype.onRemove=function(t){this._source&&this._source.onRemove&&this._source.onRemove(t);},i.prototype.loaded=function(){if(this._sourceErrored)return !0;if(!this._sourceLoaded)return !1;if(!this._source.loaded())return !1;for(var t in this._tiles){var e=this._tiles[t];if("loaded"!==e.state&&"errored"!==e.state)return !1}return !0},i.prototype.getSource=function(){return this._source},i.prototype.pause=function(){this._paused=!0;},i.prototype.resume=function(){if(this._paused){var t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform);}},i.prototype._loadTile=function(t,e){return t.isSymbolTile=this._onlySymbols,this._source.loadTile(t,e)},i.prototype._unloadTile=function(t){if(this._source.unloadTile)return this._source.unloadTile(t,(function(){}))},i.prototype._abortTile=function(t){if(this._source.abortTile)return this._source.abortTile(t,(function(){}))},i.prototype.serialize=function(){return this._source.serialize()},i.prototype.prepare=function(t){for(var e in this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null),this._tiles){var i=this._tiles[e];i.upload(t),i.prepare(this.map.style.imageManager);}},i.prototype.getIds=function(){return t.values(this._tiles).map((function(t){return t.tileID})).sort(Ct).map((function(t){return t.key}))},i.prototype.getRenderableIds=function(e){var i=this,r=[];for(var o in this._tiles)this._isIdRenderable(o,e)&&r.push(this._tiles[o]);return e?r.sort((function(e,r){var o=e.tileID,n=r.tileID,a=new t.Point(o.canonical.x,o.canonical.y)._rotate(i.transform.angle),s=new t.Point(n.canonical.x,n.canonical.y)._rotate(i.transform.angle);return o.overscaledZ-n.overscaledZ||s.y-a.y||s.x-a.x})).map((function(t){return t.tileID.key})):r.map((function(t){return t.tileID})).sort(Ct).map((function(t){return t.key}))},i.prototype.hasRenderableParent=function(t){var e=this.findLoadedParent(t,0);return !!e&&this._isIdRenderable(e.tileID.key)},i.prototype._isIdRenderable=function(t,e){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(e||!this._tiles[t].holdingForFade())},i.prototype.reload=function(){if(this._paused)this._shouldReloadOnResume=!0;else for(var t in this._cache.reset(),this._tiles)"errored"!==this._tiles[t].state&&this._reloadTile(t,"reloading");},i.prototype._reloadTile=function(t,e){var i=this._tiles[t];i&&("loading"!==i.state&&(i.state=e),this._loadTile(i,this._tileLoaded.bind(this,i,t,e)));},i.prototype._tileLoaded=function(e,i,r,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"===r&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(i,e),"raster-dem"===this.getSource().type&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),this._source.fire(new t.Event("data",{dataType:"source",tile:e,coord:e.tileID}));},i.prototype._backfillDEM=function(t){for(var e=this.getRenderableIds(),i=0;i<e.length;i++){var r=e[i];if(t.neighboringTiles&&t.neighboringTiles[r]){var o=this.getTileByID(r);n(t,o),n(o,t);}}function n(t,e){t.needsHillshadePrepare=!0;var i=e.tileID.canonical.x-t.tileID.canonical.x,r=e.tileID.canonical.y-t.tileID.canonical.y,o=Math.pow(2,t.tileID.canonical.z),n=e.tileID.key;0===i&&0===r||Math.abs(r)>1||(Math.abs(i)>1&&(1===Math.abs(i+o)?i+=o:1===Math.abs(i-o)&&(i-=o)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,i,r),t.neighboringTiles&&t.neighboringTiles[n]&&(t.neighboringTiles[n].backfilled=!0)));}},i.prototype.getTile=function(t){return this.getTileByID(t.key)},i.prototype.getTileByID=function(t){return this._tiles[t]},i.prototype._retainLoadedChildren=function(t,e,i,r){for(var o in this._tiles){var n=this._tiles[o];if(!(r[o]||!n.hasData()||n.tileID.overscaledZ<=e||n.tileID.overscaledZ>i)){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 c=a;c.overscaledZ>e;)if(t[(c=c.scaledTo(c.overscaledZ,-1)).key]){r[a.key]=a;break}}}},i.prototype.findLoadedParent=function(t,e){if(t.key in this._loadedParentTiles){var i=this._loadedParentTiles[t.key];return i&&i.tileID.overscaledZ>=e?i:null}for(var r=t.overscaledZ-1;r>=e;r--){var o=t.scaledTo(r),n=this._getLoadedTile(o);if(n)return n}},i.prototype._getLoadedTile=function(t){var e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(t.wrapped().key)},i.prototype.updateCacheSize=function(t,e){e=e||this._source.tileSize;var i=Math.ceil(t.width/e)+1,r=Math.ceil(t.height/e)+1,o=Math.floor(i*r*5),n="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,o):o;this._cache.setMaxSize(n);},i.prototype.handleWrapJump=function(t){var e=Math.round((t-(void 0===this._prevLng?t:this._prevLng))/360);if(this._prevLng=t,e){var i={};for(var r in this._tiles){var o=this._tiles[r];o.tileID=o.tileID.unwrapTo(o.tileID.wrap+e),i[o.tileID.key]=o;}for(var n in this._tiles=i,this._timers)clearTimeout(this._timers[n]),delete this._timers[n];for(var a in this._tiles)this._setTileReloadTimer(a,this._tiles[a]);}},i.prototype.update=function(e,r){var o=this;if(this.transform=e,this._sourceLoaded&&!this._paused){var n;this.updateCacheSize(e,r),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?n=e.getVisibleUnwrappedCoordinates(this._source.tileID).map((function(e){return new t.OverscaledTileID(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y,e.reference,e.sourceID,e.zoomRule,e._tileY,e._mapZoom)})):(n=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,reference:this._source.reference,zoomRule:this._source.zoomRule,sourceID:this._source.id}),this._source.hasTile&&(n=n.filter((function(t){return o._source.hasTile(t)})))):n=[];var a=e.coveringZoomLevel(this._source),s=Math.max(a-i.maxOverzooming,this._source.minzoom),c=Math.max(a+i.maxUnderzooming,this._source.minzoom),l=this._updateRetainedTiles(n,a);if(zt(this._source.type)){for(var u={},h={},p=0,f=Object.keys(l);p<f.length;p+=1){var d=f[p],_=l[d],m=this._tiles[d];if(m&&!(m.fadeEndTime&&m.fadeEndTime<=t.browser.now())){var g=this.findLoadedParent(_,s);g&&(this._addTile(g.tileID),u[g.tileID.key]=g.tileID),h[d]=_;}}for(var v in this._retainLoadedChildren(h,a,c,l),u)l[v]||(this._coveredTiles[v]=!0,l[v]=u[v]);}for(var y in l)this._tiles[y].clearFadeHold();for(var b=0,w=t.keysDifference(this._tiles,l);b<w.length;b+=1){var x=w[b],T=this._tiles[x];T.hasSymbolBuckets&&!T.holdingForFade()?T.setHoldDuration(this.map._fadeDuration):T.hasSymbolBuckets&&!T.symbolFadeFinished()||this._removeTile(x);}this._updateLoadedParentTileCache(),n=[],this._onlySymbols&&this._source.afterUpdate&&this._source.afterUpdate();}},i.prototype.releaseSymbolFadeTiles=function(){for(var t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t);},i.prototype._updateRetainedTiles=function(t,e){for(var r="Sg4326"==this._source.reference,o={},n={},a=Math.max(e-i.maxOverzooming,this._source.minzoom),s=Math.max(e+i.maxUnderzooming,this._source.minzoom),c={},l=0,u=t;l<u.length;l+=1){var h=u[l],p=this._addTile(h);o[h.key]=h,r&&this._tiles[h.key]&&"reloading"!=p.state&&(p.tileZoom!=e||p.tileID._mapZoom!=e)&&(p.tileZoom=e,p.tileID._mapZoom=e,this._reloadTile(h.key,"reloading")),p.hasData()||e<this._source.maxzoom&&(c[h.key]=h);}this._retainLoadedChildren(c,e,s,o);for(var f=0,d=t;f<d.length;f+=1){var _=d[f],m=this._tiles[_.key];if(!m.hasData()){if(e+1>this._source.maxzoom){var g=_.children(this._source.maxzoom)[0],v=this.getTile(g);if(v&&v.hasData()){o[g.key]=g;continue}}else {var y=_.children(this._source.maxzoom);if(o[y[0].key]&&o[y[1].key]&&o[y[2].key]&&o[y[3].key])continue}for(var b=m.wasRequested(),w=_.overscaledZ-1;w>=a;--w){var x=_.scaledTo(w);if(n[x.key])break;if(n[x.key]=!0,!(m=this.getTile(x))&&b&&(m=this._addTile(x)),m&&(o[x.key]=x,b=m.wasRequested(),m.hasData()))break}}}return o},i.prototype._updateLoadedParentTileCache=function(){for(var t in this._loadedParentTiles={},this._tiles){for(var e=[],i=void 0,r=this._tiles[t].tileID;r.overscaledZ>0;){if(r.key in this._loadedParentTiles){i=this._loadedParentTiles[r.key];break}e.push(r.key);var o=r.scaledTo(r.overscaledZ,-1);if(i=this._getLoadedTile(o))break;r=o;}for(var n=0,a=e;n<a.length;n+=1)this._loadedParentTiles[a[n]]=i;}},i.prototype._addTile=function(e){var i=this._tiles[e.key];if(i)return i;(i=this._cache.getAndRemove(e))&&(this._setTileReloadTimer(e.key,i),i.tileID=e,this._state.initializeTileState(i,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,i)));var r=Boolean(i);return r||(i=new t.Tile(e,this._source.tileSize*e.overscaleFactor(),this.transform.tileZoom),this._loadTile(i,this._tileLoaded.bind(this,i,e.key,i.state))),i?(i.uses++,this._tiles[e.key]=i,r||this._source.fire(new t.Event("dataloading",{tile:i,coord:i.tileID,dataType:"source"})),i):null},i.prototype._setTileReloadTimer=function(t,e){var i=this;t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);var r=e.getExpiryTimeout();r&&(this._timers[t]=setTimeout((function(){i._reloadTile(t,"expired"),delete i._timers[t];}),r));},i.prototype._removeTile=function(t){var e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),e.uses>0||(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))));},i.prototype.clearTiles=function(){for(var t in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(t);this._cache.reset();},i.prototype.tilesIn=function(e,i,r){var o=this,n=[],a=this.transform;if(!a)return n;for(var s=r?a.getCameraQueryGeometry(e):e,c=e.map((function(t){return a.pointCoordinate(t)})),l=s.map((function(t){return a.pointCoordinate(t)})),u=this.getIds(),h=1/0,p=1/0,f=-1/0,d=-1/0,_=0,m=l;_<m.length;_+=1){var g=m[_];h=Math.min(h,g.x),p=Math.min(p,g.y),f=Math.max(f,g.x),d=Math.max(d,g.y);}for(var v=t.config.parse.Coordinate,y=function(e){var r=o._tiles[u[e]];if(!r.holdingForFade()){var s=r.tileID,_=Math.pow(2,a.zoom-r.tileID.overscaledZ),m=i*r.queryPadding*t.EXTENT/r.tileSize/_,g=[s.getTilePoint(new v(h,p)),s.getTilePoint(new v(f,d))];if(g[0].x-m<t.EXTENT&&g[0].y-m<t.EXTENT&&g[1].x+m>=0&&g[1].y+m>=0){var y=c.map((function(t){return s.getTilePoint(t)})),b=l.map((function(t){return s.getTilePoint(t)}));n.push({tile:r,tileID:s,queryGeometry:y,cameraQueryGeometry:b,scale:_});}}},b=0;b<u.length;b++)y(b);return n},i.prototype.getVisibleCoordinates=function(t){for(var e=this,i=this.getRenderableIds(t).map((function(t){return e._tiles[t].tileID})),r=0,o=i;r<o.length;r+=1){var n=o[r];n.posMatrix=this.transform.calculatePosMatrix(n.toUnwrapped());}return i},i.prototype.hasTransition=function(){if(this._source.hasTransition())return !0;if(zt(this._source.type))for(var e in this._tiles){var i=this._tiles[e];if(void 0!==i.fadeEndTime&&i.fadeEndTime>=t.browser.now())return !0}return !1},i.prototype.setFeatureState=function(t,e,i){this._state.updateState(t=t||"_geojsonTileLayer",e,i);},i.prototype.removeFeatureState=function(t,e,i){this._state.removeFeatureState(t=t||"_geojsonTileLayer",e,i);},i.prototype.getFeatureState=function(t,e){return this._state.getState(t=t||"_geojsonTileLayer",e)},i.prototype.setDependencies=function(t,e,i){var r=this._tiles[t];r&&r.setDependencies(e,i);},i.prototype.reloadTilesForDependencies=function(t,e){for(var i in this._tiles)this._tiles[i].hasDependency(t,e)&&this._reloadTile(i,"reloading");this._cache.filter((function(i){return !i.hasDependency(t,e)}));},i}(t.Evented);function Ct(t,e){var i=Math.abs(2*t.wrap)-+(t.wrap<0),r=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||r-i||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function zt(t){return "raster"===t||"image"===t||"video"===t}function Dt(){return new t.window.Worker(lf.workerUrl)}Pt.maxOverzooming=10,Pt.maxUnderzooming=3;var Mt,Rt=function(){this.active={};};function Lt(e,i){var r={};for(var o in e)"ref"!==o&&(r[o]=e[o]);return t.refProperties.forEach((function(t){t in i&&(r[t]=i[t]);})),r}function Ot(t){t=t.slice();for(var e=Object.create(null),i=0;i<t.length;i++)e[t[i].id]=t[i];for(var r=0;r<t.length;r++)"ref"in t[r]&&(t[r]=Lt(t[r],e[t[r].ref]));return t}Rt.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length<Rt.workerCount;)this.workers.push(new Dt);return this.active[t]=!0,this.workers.slice()},Rt.prototype.release=function(t){delete this.active[t],0===this.numActive()&&(this.workers.forEach((function(t){t.terminate();})),this.workers=null);},Rt.prototype.isPreloaded=function(){return !!this.active.sgmap_preloaded_worker_pool},Rt.prototype.numActive=function(){return Object.keys(this.active).length},Rt.workerCount=2;var Ft={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 Ut(t,e,i){i.push({command:Ft.addSource,args:[t,e[t]]});}function Nt(t,e,i){e.push({command:Ft.removeSource,args:[t]}),i[t]=!0;}function jt(t,e,i,r){Nt(t,i,r),Ut(t,e,i);}function Vt(e,i,r){var o;for(o in e[r])if(e[r].hasOwnProperty(o)&&"data"!==o&&!t.deepEqual(e[r][o],i[r][o]))return !1;for(o in i[r])if(i[r].hasOwnProperty(o)&&"data"!==o&&!t.deepEqual(e[r][o],i[r][o]))return !1;return !0}function qt(e,i,r,o,n,a){var s;for(s in i=i||{},e=e||{})e.hasOwnProperty(s)&&(t.deepEqual(e[s],i[s])||r.push({command:a,args:[o,s,i[s],n]}));for(s in i)i.hasOwnProperty(s)&&!e.hasOwnProperty(s)&&(t.deepEqual(e[s],i[s])||r.push({command:a,args:[o,s,i[s],n]}));}function Zt(t){return t.id}function Gt(t,e){return t[e.id]=e,t}var Ht=function(t,e){this.reset(t,e);};Ht.prototype.reset=function(t,e){this.points=t||[],this._distances=[0];for(var i=1;i<this.points.length;i++)this._distances[i]=this._distances[i-1]+this.points[i].dist(this.points[i-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;},Ht.prototype.lerp=function(e){if(1===this.points.length)return this.points[0];e=t.clamp(e,0,1);for(var i=1,r=this._distances[i],o=e*this.paddedLength+this.padding;r<o&&i<this._distances.length;)r=this._distances[++i];var n=i-1,a=this._distances[n],s=r-a,c=s>0?(o-a)/s:0;return this.points[n].mult(1-c).add(this.points[i].mult(c))};var Wt=function(t,e,i){var r=this.boxCells=[],o=this.circleCells=[];this.xCellCount=Math.ceil(t/i),this.yCellCount=Math.ceil(e/i);for(var n=0;n<this.xCellCount*this.yCellCount;n++)r.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 Xt(e,i,r,o,n){var a=t.create();return i?(Array.isArray(n)||(n=[n,n]),t.scale(a,a,[1/n[0],1/n[1],1]),r||t.rotateZ(a,a,o.angle)):t.multiply(a,o.labelPlaneMatrix,e),a}function Kt(e,i,r,o,n){if(i){var a=t.clone(e);return Array.isArray(n)||(n=[n,n]),t.scale(a,a,[n[0],n[1],1]),r||t.rotateZ(a,a,-o.angle),a}return o.glCoordMatrix}function Yt(e,i){var r=[e.x,e.y,0,1];se(r,r,i);var o=r[3];return {point:new t.Point(r[0]/o,r[1]/o),signedDistanceFromCamera:o}}function Jt(t,e){return .5+t/e*.5}function Qt(t,e){var i=t[0]/t[3],r=t[1]/t[3];return i>=-e[0]&&i<=e[0]&&r>=-e[1]&&r<=e[1]}function $t(e,i,r,o,n,a,s,c){var l=o?e.textSizeData:e.iconSizeData,u=t.evaluateSizeForZoom(l,r.transform.zoom),h=[256/r.width*2+1,256/r.height*2+1],p=o?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;p.clear();for(var f=e.lineVertexArray,d=o?e.text.placedSymbolArray:e.icon.placedSymbolArray,_=r.transform.width/r.transform.height,m=!1,g=0;g<d.length;g++){var v=d.get(g);if(v.hidden||v.writingMode===t.WritingMode.vertical&&!m)ae(v.numGlyphs,p);else {m=!1;var y=[v.anchorX,v.anchorY,0,1];if(t.transformMat4(y,y,i),Qt(y,h)){var b=Jt(r.transform.cameraToCenterDistance,y[3]),w=t.evaluateSizeForFeature(l,u,v),x=s?w/b:w*b,T=new t.Point(v.anchorX,v.anchorY),S=Yt(T,n).point,E={},A=ie(v,x,!1,c,i,n,a,e.glyphOffsetArray,f,p,S,T,E,_);m=A.useVertical,(A.notEnoughRoom||m||A.needsFlipping&&ie(v,x,!0,c,i,n,a,e.glyphOffsetArray,f,p,S,T,E,_).notEnoughRoom)&&ae(v.numGlyphs,p);}else ae(v.numGlyphs,p);}}o?e.text.dynamicLayoutVertexBuffer.updateData(p):e.icon.dynamicLayoutVertexBuffer.updateData(p);}function te(t,e,i,r,o,n,a,s,c,l,u){var h=s.glyphStartIndex+s.numGlyphs,p=s.lineStartIndex,f=s.lineStartIndex+s.lineLength,d=e.getoffsetX(s.glyphStartIndex),_=e.getoffsetX(h-1),m=oe(t*d,i,r,o,n,a,s.segment,p,f,c,l,u);if(!m)return null;var g=oe(t*_,i,r,o,n,a,s.segment,p,f,c,l,u);return g?{first:m,last:g}:null}function ee(e,i,r,o){return e===t.WritingMode.horizontal&&Math.abs(r.y-i.y)>Math.abs(r.x-i.x)*o?{useVertical:!0}:(e===t.WritingMode.vertical?i.y<r.y:i.x>r.x)?{needsFlipping:!0}:null}function ie(e,i,r,o,n,a,s,c,l,u,h,p,f,d){var _,m=i/24,g=e.lineOffsetX*m,v=e.lineOffsetY*m;if(e.numGlyphs>1){var y=e.glyphStartIndex+e.numGlyphs,b=e.lineStartIndex,w=e.lineStartIndex+e.lineLength,x=te(m,c,g,v,r,h,p,e,l,a,f);if(!x)return {notEnoughRoom:!0};var T=Yt(x.first.point,s).point,S=Yt(x.last.point,s).point;if(o&&!r){var E=ee(e.writingMode,T,S,d);if(E)return E}_=[x.first];for(var A=e.glyphStartIndex+1;A<y-1;A++)_.push(oe(m*c.getoffsetX(A),g,v,r,h,p,e.segment,b,w,l,a,f));_.push(x.last);}else {if(o&&!r){var k=Yt(p,n).point,I=e.lineStartIndex+e.segment+1,B=new t.Point(l.getx(I),l.gety(I)),P=Yt(B,n),C=P.signedDistanceFromCamera>0?P.point:re(p,B,k,1,n),z=ee(e.writingMode,k,C,d);if(z)return z}var D=oe(m*c.getoffsetX(e.glyphStartIndex),g,v,r,h,p,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,l,a,f);if(!D)return {notEnoughRoom:!0};_=[D];}for(var M=0,R=_;M<R.length;M+=1){var L=R[M];t.addDynamicAttributes(u,L.point,L.angle);}return {}}function re(t,e,i,r,o){var n=Yt(t.add(t.sub(e)._unit()),o).point,a=i.sub(n);return i.add(a._mult(r/a.mag()))}function oe(e,i,r,o,n,a,s,c,l,u,h,p){var f=o?e-i:e+i,d=f>0?1:-1,_=0;o&&(d*=-1,_=Math.PI),d<0&&(_+=Math.PI);for(var m=d>0?c+s:c+s+1,g=n,v=n,y=0,b=0,w=Math.abs(f),x=[];y+b<=w;){if((m+=d)<c||m>=l)return null;if(v=g,x.push(g),void 0===(g=p[m])){var T=new t.Point(u.getx(m),u.gety(m)),S=Yt(T,h);if(S.signedDistanceFromCamera>0)g=p[m]=S.point;else {var E=m-d;g=re(0===y?a:new t.Point(u.getx(E),u.gety(E)),T,v,w-y+1,h);}}y+=b,b=v.dist(g);}var A=(w-y)/b,k=g.sub(v),I=k.mult(A)._add(v);I._add(k._unit()._perp()._mult(r*d));var B=_+Math.atan2(g.y-v.y,g.x-v.x);return x.push(I),{point:I,angle:B,path:x}}Wt.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Wt.prototype.insert=function(t,e,i,r,o){this._forEachCell(e,i,r,o,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(i),this.bboxes.push(r),this.bboxes.push(o);},Wt.prototype.insertCircle=function(t,e,i,r){this._forEachCell(e-r,i-r,e+r,i+r,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(i),this.circles.push(r);},Wt.prototype._insertBoxCell=function(t,e,i,r,o,n){this.boxCells[o].push(n);},Wt.prototype._insertCircleCell=function(t,e,i,r,o,n){this.circleCells[o].push(n);},Wt.prototype._query=function(t,e,i,r,o,n){if(i<0||t>this.width||r<0||e>this.height)return !o&&[];var a=[];if(t<=0&&e<=0&&this.width<=i&&this.height<=r){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 c=0;c<this.circleKeys.length;c++){var l=this.circles[3*c],u=this.circles[3*c+1],h=this.circles[3*c+2];a.push({key:this.circleKeys[c],x1:l-h,y1:u-h,x2:l+h,y2:u+h});}return n?a.filter(n):a}return this._forEachCell(t,e,i,r,this._queryCell,a,{hitTest:o,seenUids:{box:{},circle:{}}},n),o?a.length>0:a},Wt.prototype._queryCircle=function(t,e,i,r,o){var n=t-i,a=t+i,s=e-i,c=e+i;if(a<0||n>this.width||c<0||s>this.height)return !r&&[];var l=[];return this._forEachCell(n,s,a,c,this._queryCellCircle,l,{hitTest:r,circle:{x:t,y:e,radius:i},seenUids:{box:{},circle:{}}},o),r?l.length>0:l},Wt.prototype.query=function(t,e,i,r,o){return this._query(t,e,i,r,!1,o)},Wt.prototype.hitTest=function(t,e,i,r,o){return this._query(t,e,i,r,!0,o)},Wt.prototype.hitTestCircle=function(t,e,i,r){return this._queryCircle(t,e,i,!0,r)},Wt.prototype._queryCell=function(t,e,i,r,o,n,a,s){var c=a.seenUids,l=this.boxCells[o];if(null!==l)for(var u=this.bboxes,h=0,p=l;h<p.length;h+=1){var f=p[h];if(!c.box[f]){c.box[f]=!0;var d=4*f;if(t<=u[d+2]&&e<=u[d+3]&&i>=u[d+0]&&r>=u[d+1]&&(!s||s(this.boxKeys[f]))){if(a.hitTest)return n.push(!0),!0;n.push({key:this.boxKeys[f],x1:u[d],y1:u[d+1],x2:u[d+2],y2:u[d+3]});}}}var _=this.circleCells[o];if(null!==_)for(var m=this.circles,g=0,v=_;g<v.length;g+=1){var y=v[g];if(!c.circle[y]){c.circle[y]=!0;var b=3*y;if(this._circleAndRectCollide(m[b],m[b+1],m[b+2],t,e,i,r)&&(!s||s(this.circleKeys[y]))){if(a.hitTest)return n.push(!0),!0;var w=m[b],x=m[b+1],T=m[b+2];n.push({key:this.circleKeys[y],x1:w-T,y1:x-T,x2:w+T,y2:x+T});}}}},Wt.prototype._queryCellCircle=function(t,e,i,r,o,n,a,s){var c=a.circle,l=a.seenUids,u=this.boxCells[o];if(null!==u)for(var h=this.bboxes,p=0,f=u;p<f.length;p+=1){var d=f[p];if(!l.box[d]){l.box[d]=!0;var _=4*d;if(this._circleAndRectCollide(c.x,c.y,c.radius,h[_+0],h[_+1],h[_+2],h[_+3])&&(!s||s(this.boxKeys[d])))return n.push(!0),!0}}var m=this.circleCells[o];if(null!==m)for(var g=this.circles,v=0,y=m;v<y.length;v+=1){var b=y[v];if(!l.circle[b]){l.circle[b]=!0;var w=3*b;if(this._circlesCollide(g[w],g[w+1],g[w+2],c.x,c.y,c.radius)&&(!s||s(this.circleKeys[b])))return n.push(!0),!0}}},Wt.prototype._forEachCell=function(t,e,i,r,o,n,a,s){for(var c=this._convertToXCellCoord(t),l=this._convertToYCellCoord(e),u=this._convertToXCellCoord(i),h=this._convertToYCellCoord(r),p=c;p<=u;p++)for(var f=l;f<=h;f++)if(o.call(this,t,e,i,r,this.xCellCount*f+p,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,i,r,o,n){var a=r-t,s=o-e,c=i+n;return c*c>a*a+s*s},Wt.prototype._circleAndRectCollide=function(t,e,i,r,o,n,a){var s=(n-r)/2,c=Math.abs(t-(r+s));if(c>s+i)return !1;var l=(a-o)/2,u=Math.abs(e-(o+l));if(u>l+i)return !1;if(c<=s||u<=l)return !0;var h=c-s,p=u-l;return h*h+p*p<=i*i};var ne=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ae(t,e){for(var i=0;i<t;i++){var r=e.length;e.resize(r+4),e.float32.set(ne,3*r);}}function se(t,e,i){var r=e[0],o=e[1];return t[0]=i[0]*r+i[4]*o+i[12],t[1]=i[1]*r+i[5]*o+i[13],t[3]=i[3]*r+i[7]*o+i[15],t}var ce=function(t,e,i){void 0===e&&(e=new Wt(t.width+200,t.height+200,25)),void 0===i&&(i=new Wt(t.width+200,t.height+200,25)),this.transform=t,this.grid=e,this.ignoredGrid=i,this.pitchfactor=Math.cos(t._pitch)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+100,this.screenBottomBoundary=t.height+100,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200;};ce.prototype.placeCollisionBox=function(t,e,i,r,o){var n=this.projectAndGetPerspectiveRatio(r,t.anchorPointX,t.anchorPointY),a=i*n.perspectiveRatio,s=t.x1*a+n.point.x,c=t.y1*a+n.point.y,l=t.x2*a+n.point.x,u=t.y2*a+n.point.y;return !this.isInsideGrid(s,c,l,u)||!e&&this.grid.hitTest(s,c,l,u,o)?{box:[],offscreen:!1}:{box:[s,c,l,u],offscreen:this.isOffscreen(s,c,l,u)}},ce.prototype.placeCollisionCircles=function(e,i,r,o,n,a,s,c,l,u,h,p,f){var d=[],_=new t.Point(i.anchorX,i.anchorY),m=Yt(_,a),g=Jt(this.transform.cameraToCenterDistance,m.signedDistanceFromCamera),v=(u?n/g:n*g)/t.ONE_EM,y=Yt(_,s).point,b=te(v,o,i.lineOffsetX*v,i.lineOffsetY*v,!1,y,_,i,r,s,{}),w=!1,x=!1,T=!0;if(b){for(var S=.5*p*g+f,E=new t.Point(-100,-100),A=new t.Point(this.screenRightBoundary,this.screenBottomBoundary),k=new Ht,I=b.first,B=b.last,P=[],C=I.path.length-1;C>=1;C--)P.push(I.path[C]);for(var z=1;z<B.path.length;z++)P.push(B.path[z]);var D=2.5*S;if(c){var M=P.map((function(t){return Yt(t,c)}));P=M.some((function(t){return t.signedDistanceFromCamera<=0}))?[]:M.map((function(t){return t.point}));}var R=[];if(P.length>0){for(var L=P[0].clone(),O=P[0].clone(),F=1;F<P.length;F++)L.x=Math.min(L.x,P[F].x),L.y=Math.min(L.y,P[F].y),O.x=Math.max(O.x,P[F].x),O.y=Math.max(O.y,P[F].y);R=L.x>=E.x&&O.x<=A.x&&L.y>=E.y&&O.y<=A.y?[P]:O.x<E.x||L.x>A.x||O.y<E.y||L.y>A.y?[]:t.clipLine([P],E.x,E.y,A.x,A.y);}for(var U=0,N=R;U<N.length;U+=1){var j;k.reset(N[U],.25*S),j=k.length<=.5*S?1:Math.ceil(k.paddedLength/D)+1;for(var V=0;V<j;V++){var q=V/Math.max(j-1,1),Z=k.lerp(q),G=Z.x+100,H=Z.y+100;d.push(G,H,S,0);var W=G-S,X=H-S,K=G+S,Y=H+S;if(T=T&&this.isOffscreen(W,X,K,Y),x=x||this.isInsideGrid(W,X,K,Y),!e&&this.grid.hitTestCircle(G,H,S,h)&&(w=!0,!l))return {circles:[],offscreen:!1,collisionDetected:w}}}}return {circles:!l&&w||!x?[]:d,offscreen:T,collisionDetected:w}},ce.prototype.queryRenderedSymbols=function(e){if(0===e.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return {};for(var i=[],r=1/0,o=1/0,n=-1/0,a=-1/0,s=0,c=e;s<c.length;s+=1){var l=c[s],u=new t.Point(l.x+100,l.y+100);r=Math.min(r,u.x),o=Math.min(o,u.y),n=Math.max(n,u.x),a=Math.max(a,u.y),i.push(u);}for(var h={},p={},f=0,d=this.grid.query(r,o,n,a).concat(this.ignoredGrid.query(r,o,n,a));f<d.length;f+=1){var _=d[f],m=_.key;if(void 0===h[m.bucketInstanceId]&&(h[m.bucketInstanceId]={}),!h[m.bucketInstanceId][m.featureIndex]){var g=[new t.Point(_.x1,_.y1),new t.Point(_.x2,_.y1),new t.Point(_.x2,_.y2),new t.Point(_.x1,_.y2)];t.polygonIntersectsPolygon(i,g)&&(h[m.bucketInstanceId][m.featureIndex]=!0,void 0===p[m.bucketInstanceId]&&(p[m.bucketInstanceId]=[]),p[m.bucketInstanceId].push(m.featureIndex));}}return p},ce.prototype.insertCollisionBox=function(t,e,i,r,o){(e?this.ignoredGrid:this.grid).insert({bucketInstanceId:i,featureIndex:r,collisionGroupID:o},t[0],t[1],t[2],t[3]);},ce.prototype.insertCollisionCircles=function(t,e,i,r,o){for(var n=e?this.ignoredGrid:this.grid,a={bucketInstanceId:i,featureIndex:r,collisionGroupID:o},s=0;s<t.length;s+=4)n.insertCircle(a,t[s],t[s+1],t[s+2]);},ce.prototype.projectAndGetPerspectiveRatio=function(e,i,r){var o=[i,r,0,1];return se(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}},ce.prototype.isOffscreen=function(t,e,i,r){return i<100||t>=this.screenRightBoundary||r<100||e>this.screenBottomBoundary},ce.prototype.isInsideGrid=function(t,e,i,r){return i>=0&&t<this.gridRightBoundary&&r>=0&&e<this.gridBottomBoundary},ce.prototype.getViewportMatrix=function(){var e=t.identity([]);return t.translate(e,e,[-100,-100,0]),e};var le=function(t,e,i,r){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?e:-e))):r&&i?1:0,this.placed=i;};le.prototype.isHidden=function(){return 0===this.opacity&&!this.placed};var ue=function(t,e,i,r,o){this.text=new le(t?t.text:null,e,i,o),this.icon=new le(t?t.icon:null,e,r,o);};ue.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var he=function(t,e,i){this.text=t,this.icon=e,this.skipFade=i;},pe=function(){this.invProjMatrix=t.create(),this.viewportMatrix=t.create(),this.circles=[];},fe=function(t,e,i,r,o){this.bucketInstanceId=t,this.featureIndex=e,this.sourceLayerIndex=i,this.bucketIndex=r,this.tileID=o;},de=function(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={};};function _e(e,i,r,o,n){var a=t.getAnchorAlignment(e),s=-(a.horizontalAlign-.5)*i,c=-(a.verticalAlign-.5)*r,l=t.evaluateVariableOffset(e,o);return new t.Point(s+l[0]*n,c+l[1]*n)}function me(e,i,r,o,n,a){var s=e.x1,c=e.x2,l=e.y1,u=e.y2,h=e.anchorPointX,p=e.anchorPointY,f=new t.Point(i,r);return o&&f._rotate(n?a:-a),{x1:s+f.x,y1:l+f.y,x2:c+f.x,y2:u+f.y,anchorPointX:h,anchorPointY:p}}de.prototype.get=function(t){if(this.crossSourceCollisions)return {ID:0,predicate:null};if(!this.collisionGroups[t]){var e=++this.maxGroupID;this.collisionGroups[t]={ID:e,predicate:function(t){return t.collisionGroupID===e}};}return this.collisionGroups[t]};var ge=function(t,e,i,r){this.transform=t.clone(),this.collisionIndex=new ce(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=e,this.retainedQueryData={},this.collisionGroups=new de(i),this.collisionCircleArrays={},this.prevPlacement=r,r&&(r.prevPlacement=void 0),this.placedOrientations={};};function ve(t,e,i,r,o){t.emplaceBack(e?1:0,i?1:0,r||0,o||0),t.emplaceBack(e?1:0,i?1:0,r||0,o||0),t.emplaceBack(e?1:0,i?1:0,r||0,o||0),t.emplaceBack(e?1:0,i?1:0,r||0,o||0);}ge.prototype.getBucketParts=function(e,i,r,o){var n=r.getBucket(i),a=r.latestFeatureIndex;if(n&&a&&i.id===n.layerIds[0]){var s=r.collisionBoxArray,c=n.layers[0].layout,l=Math.pow(2,this.transform.zoom-r.tileID.overscaledZ),u=r.tileSize/t.EXTENT,h=this.transform.calculatePosMatrix(r.tileID.toUnwrapped()),p="map"===c.get("text-pitch-alignment"),f="map"===c.get("text-rotation-alignment"),d=y(r,1,this.transform.zoom,"xy"),_=Xt(h,p,f,this.transform,d),m=null;if(p){var g=Kt(h,p,f,this.transform,d);m=t.multiply([],this.transform.labelPlaneMatrix,g);}this.retainedQueryData[n.bucketInstanceId]=new fe(n.bucketInstanceId,a,n.sourceLayerIndex,n.index,r.tileID);var v={bucket:n,layout:c,posMatrix:h,textLabelPlaneMatrix:_,labelToScreenMatrix:m,scale:l,textPixelRatio:u,holdingForFade:r.holdingForFade(),collisionBoxArray:s,partiallyEvaluatedTextSize:t.evaluateSizeForZoom(n.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(n.sourceID)};if(o)for(var b=0,w=n.sortKeyRanges;b<w.length;b+=1){var x=w[b];e.push({sortKey:x.sortKey,symbolInstanceStart:x.symbolInstanceStart,symbolInstanceEnd:x.symbolInstanceEnd,parameters:v});}else e.push({symbolInstanceStart:0,symbolInstanceEnd:n.symbolInstances.length,parameters:v});}},ge.prototype.attemptAnchorPlacement=function(t,e,i,r,o,n,a,s,c,l,u,h,p,f,d){var _,m=[h.textOffset0,h.textOffset1],g=_e(t,i,r,m,o),v=this.collisionIndex.placeCollisionBox(me(e,g.x,g.y,n,a,this.transform.angle),u,s,c,l.predicate);if(!d||0!==this.collisionIndex.placeCollisionBox(me(d,g.x,g.y,n,a,this.transform.angle),u,s,c,l.predicate).box.length)return v.box.length>0?(this.prevPlacement&&this.prevPlacement.variableOffsets[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID].text&&(_=this.prevPlacement.variableOffsets[h.crossTileID].anchor),this.variableOffsets[h.crossTileID]={textOffset:m,width:i,height:r,anchor:t,textBoxScale:o,prevAnchor:_},this.markUsedJustification(p,t,h,f),p.allowVerticalPlacement&&(this.markUsedOrientation(p,f,h),this.placedOrientations[h.crossTileID]=f),{shift:g,placedGlyphBoxes:v}):void 0},ge.prototype.placeLayerBucketPart=function(e,i,r){var o=this,n=e.parameters,a=n.bucket,s=n.layout,c=n.posMatrix,l=n.textLabelPlaneMatrix,u=n.labelToScreenMatrix,h=n.textPixelRatio,p=n.holdingForFade,f=n.collisionBoxArray,d=n.partiallyEvaluatedTextSize,_=n.collisionGroup,m=s.get("text-optional"),g=s.get("icon-optional"),v=s.get("text-allow-overlap"),y=s.get("icon-allow-overlap"),b="map"===s.get("text-rotation-alignment"),w="map"===s.get("text-pitch-alignment"),x="none"!==s.get("icon-text-fit"),T="viewport-y"===s.get("symbol-z-order"),S=v&&(y||!a.hasIconData()||g),E=y&&(v||!a.hasTextData()||m);!a.collisionArrays&&f&&a.deserializeCollisionBoxes(f);var A=this.transform.zoom,k=a.feature_values.map((function(t){return t[0]})),I=function(e,n){if(!i[e.crossTileID])if(p)o.placements[e.crossTileID]=new he(!1,!1,!1);else {var f=k.indexOf(e.featureIndex);if(f>=0){var T=a.feature_values[f];if(T&&(A<T[1]||A>T[2]))return}var I,B=!1,P=!1,C=!0,z=null,D={box:null,offscreen:null},M={box:null,offscreen:null},R=null,L=null,O=0,F=0,U=0;n.textFeatureIndex?O=n.textFeatureIndex:e.useRuntimeCollisionCircles&&(O=e.featureIndex),n.verticalTextFeatureIndex&&(F=n.verticalTextFeatureIndex);var N=n.textBox;if(N){var j=function(i){var r=t.WritingMode.horizontal;if(a.allowVerticalPlacement&&!i&&o.prevPlacement){var n=o.prevPlacement.placedOrientations[e.crossTileID];n&&(o.placedOrientations[e.crossTileID]=n,o.markUsedOrientation(a,r=n,e));}return r},V=function(i,r){if(a.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&n.verticalTextBox)for(var o=0,s=a.writingModes;o<s.length&&(s[o]===t.WritingMode.vertical?(D=r(),M=D):D=i(),!(D&&D.box&&D.box.length));o+=1);else D=i();};if(s.get("text-variable-anchor")){var q=s.get("text-variable-anchor");if(o.prevPlacement&&o.prevPlacement.variableOffsets[e.crossTileID]){var Z=o.prevPlacement.variableOffsets[e.crossTileID];q.indexOf(Z.anchor)>0&&(q=q.filter((function(t){return t!==Z.anchor}))).unshift(Z.anchor);}var G=function(t,i,r){for(var n=t.x2-t.x1,s=t.y2-t.y1,l=e.textBoxScale,u=x&&!y?i:null,p={box:[],offscreen:!1},f=v?2*q.length:q.length,d=0;d<f;++d){var m=o.attemptAnchorPlacement(q[d%q.length],t,n,s,l,b,w,h,c,_,d>=q.length,e,a,r,u);if(m&&(p=m.placedGlyphBoxes)&&p.box&&p.box.length){B=!0,z=m.shift;break}}return p};V((function(){return G(N,n.iconBox,t.WritingMode.horizontal)}),(function(){var i=n.verticalTextBox;return a.allowVerticalPlacement&&!(D&&D.box&&D.box.length)&&e.numVerticalGlyphVertices>0&&i?G(i,n.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null}})),D&&(B=D.box,C=D.offscreen);var H=j(D&&D.box);if(!B&&o.prevPlacement){var W=o.prevPlacement.variableOffsets[e.crossTileID];W&&(o.variableOffsets[e.crossTileID]=W,o.markUsedJustification(a,W.anchor,e,H));}}else {var X=function(t,i){var r=o.collisionIndex.placeCollisionBox(t,v,h,c,_.predicate);return r&&r.box&&r.box.length&&(o.markUsedOrientation(a,i,e),o.placedOrientations[e.crossTileID]=i),r};V((function(){return X(N,t.WritingMode.horizontal)}),(function(){var i=n.verticalTextBox;return a.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&i?X(i,t.WritingMode.vertical):{box:null,offscreen:null}})),j(D&&D.box&&D.box.length);}}if(B=(I=D)&&I.box&&I.box.length>0,C=I&&I.offscreen,e.useRuntimeCollisionCircles){var K=a.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex),Y=t.evaluateSizeForFeature(a.textSizeData,d,K),J=s.get("text-padding");R=o.collisionIndex.placeCollisionCircles(v,K,a.lineVertexArray,a.glyphOffsetArray,Y,c,l,u,r,w,_.predicate,e.collisionCircleDiameter,J),B=v||R.circles.length>0&&!R.collisionDetected,C=C&&R.offscreen;}if(n.iconFeatureIndex&&(U=n.iconFeatureIndex),n.iconBox){var Q=function(t){var e=x&&z?me(t,z.x,z.y,b,w,o.transform.angle):t;return o.collisionIndex.placeCollisionBox(e,y,h,c,_.predicate)};P=M&&M.box&&M.box.length&&n.verticalIconBox?(L=Q(n.verticalIconBox)).box.length>0:(L=Q(n.iconBox)).box.length>0,C=C&&L.offscreen;}var $=m||0===e.numHorizontalGlyphVertices&&0===e.numVerticalGlyphVertices,tt=g||0===e.numIconVertices;if($||tt?tt?$||(P=P&&B):B=P&&B:P=B=P&&B,B&&I&&I.box&&o.collisionIndex.insertCollisionBox(I.box,s.get("text-ignore-placement"),a.bucketInstanceId,M&&M.box&&F?F:O,_.ID),P&&L&&o.collisionIndex.insertCollisionBox(L.box,s.get("icon-ignore-placement"),a.bucketInstanceId,U,_.ID),R&&(B&&o.collisionIndex.insertCollisionCircles(R.circles,s.get("text-ignore-placement"),a.bucketInstanceId,O,_.ID),r)){var et=a.bucketInstanceId,it=o.collisionCircleArrays[et];void 0===it&&(it=o.collisionCircleArrays[et]=new pe);for(var rt=0;rt<R.circles.length;rt+=4)it.circles.push(R.circles[rt+0]),it.circles.push(R.circles[rt+1]),it.circles.push(R.circles[rt+2]),it.circles.push(R.collisionDetected?1:0);}o.placements[e.crossTileID]=new he(B||S,P||E,C||a.justReloaded),i[e.crossTileID]=!0;}};if(T)for(var B=a.getSortedSymbolIndexes(this.transform.angle),P=B.length-1;P>=0;--P){var C=B[P];I(a.symbolInstances.get(C),a.collisionArrays[C]);}else for(var z=e.symbolInstanceStart;z<e.symbolInstanceEnd;z++)I(a.symbolInstances.get(z),a.collisionArrays[z]);if(r&&a.bucketInstanceId in this.collisionCircleArrays){var D=this.collisionCircleArrays[a.bucketInstanceId];t.invert(D.invProjMatrix,c),D.viewportMatrix=this.collisionIndex.getViewportMatrix();}a.justReloaded=!1;},ge.prototype.markUsedJustification=function(e,i,r,o){var n;n=o===t.WritingMode.vertical?r.verticalPlacedTextSymbolIndex:{left:r.leftJustifiedTextSymbolIndex,center:r.centerJustifiedTextSymbolIndex,right:r.rightJustifiedTextSymbolIndex}[t.getAnchorJustification(i)];for(var a=0,s=[r.leftJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.rightJustifiedTextSymbolIndex,r.verticalPlacedTextSymbolIndex];a<s.length;a+=1){var c=s[a];c>=0&&(e.text.placedSymbolArray.get(c).crossTileID=n>=0&&c!==n?0:r.crossTileID);}},ge.prototype.markUsedOrientation=function(e,i,r){for(var o=i===t.WritingMode.horizontal||i===t.WritingMode.horizontalOnly?i:0,n=i===t.WritingMode.vertical?i:0,a=0,s=[r.leftJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.rightJustifiedTextSymbolIndex];a<s.length;a+=1)e.text.placedSymbolArray.get(s[a]).placedOrientation=o;r.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(r.verticalPlacedTextSymbolIndex).placedOrientation=n);},ge.prototype.commit=function(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;var e=this.prevPlacement,i=!1;this.prevZoomAdjustment=e?e.zoomAdjustment(this.transform.zoom):0;var r=e?e.symbolFadeChange(t):1,o=e?e.opacities:{},n=e?e.variableOffsets:{},a=e?e.placedOrientations:{};for(var s in this.placements){var c=this.placements[s],l=o[s];l?(this.opacities[s]=new ue(l,r,c.text,c.icon),i=i||c.text!==l.text.placed||c.icon!==l.icon.placed):(this.opacities[s]=new ue(null,r,c.text,c.icon,c.skipFade),i=i||c.text||c.icon);}for(var u in o){var h=o[u];if(!this.opacities[u]){var p=new ue(h,r,!1,!1);p.isHidden()||(this.opacities[u]=p,i=i||h.text.placed||h.icon.placed);}}for(var f in n)this.variableOffsets[f]||!this.opacities[f]||this.opacities[f].isHidden()||(this.variableOffsets[f]=n[f]);for(var d in a)this.placedOrientations[d]||!this.opacities[d]||this.opacities[d].isHidden()||(this.placedOrientations[d]=a[d]);i?this.lastPlacementChangeTime=t:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=e?e.lastPlacementChangeTime:t);},ge.prototype.updateLayerOpacities=function(t,e){for(var i={},r=0,o=e;r<o.length;r+=1){var n=o[r],a=n.getBucket(t);a&&n.latestFeatureIndex&&t.id===a.layerIds[0]&&this.updateBucketOpacities(a,i,n.collisionBoxArray);}},ge.prototype.updateBucketOpacities=function(e,i,r){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 ue(null,0,!1,!1,!0),s=n.get("text-allow-overlap"),c=n.get("icon-allow-overlap"),l=n.get("text-variable-anchor"),u="map"===n.get("text-rotation-alignment"),h="map"===n.get("text-pitch-alignment"),p="none"!==n.get("icon-text-fit"),f=new ue(null,0,s&&(c||!e.hasIconData()||n.get("icon-optional")),c&&(s||!e.hasTextData()||n.get("text-optional")),!0);!e.collisionArrays&&r&&(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData())&&e.deserializeCollisionBoxes(r);for(var d=function(t,e,i){for(var r=0;r<e/4;r++)t.opacityVertexArray.emplaceBack(i);},_=function(r){var n=e.symbolInstances.get(r),s=n.numHorizontalGlyphVertices,c=n.numVerticalGlyphVertices,_=n.crossTileID,m=o.opacities[_];i[_]?m=a:m||(o.opacities[_]=m=f),i[_]=!0;var g=n.numIconVertices>0,v=o.placedOrientations[n.crossTileID],y=v===t.WritingMode.vertical,b=v===t.WritingMode.horizontal||v===t.WritingMode.horizontalOnly;if(s>0||c>0){var w=Ae(m.text);d(e.text,s,y?ke:w),d(e.text,c,b?ke:w);var x=m.text.isHidden();[n.rightJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.leftJustifiedTextSymbolIndex].forEach((function(t){t>=0&&(e.text.placedSymbolArray.get(t).hidden=x||y?1:0);})),n.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(n.verticalPlacedTextSymbolIndex).hidden=x||b?1:0);var T=o.variableOffsets[n.crossTileID];T&&o.markUsedJustification(e,T.anchor,n,v);var S=o.placedOrientations[n.crossTileID];S&&(o.markUsedJustification(e,"left",n,S),o.markUsedOrientation(e,S,n));}if(g){var E=Ae(m.icon),A=!(p&&n.verticalPlacedIconSymbolIndex&&y);n.placedIconSymbolIndex>=0&&(d(e.icon,n.numIconVertices,A?E:ke),e.icon.placedSymbolArray.get(n.placedIconSymbolIndex).hidden=m.icon.isHidden()),n.verticalPlacedIconSymbolIndex>=0&&(d(e.icon,n.numVerticalIconVertices,A?ke:E),e.icon.placedSymbolArray.get(n.verticalPlacedIconSymbolIndex).hidden=m.icon.isHidden());}if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){var k=e.collisionArrays[r];if(k){var I=new t.Point(0,0);if(k.textBox||k.verticalTextBox){var B=!0;if(l){var P=o.variableOffsets[_];P?(I=_e(P.anchor,P.width,P.height,P.textOffset,P.textBoxScale),u&&I._rotate(h?o.transform.angle:-o.transform.angle)):B=!1;}k.textBox&&ve(e.textCollisionBox.collisionVertexArray,m.text.placed,!B||y,I.x,I.y),k.verticalTextBox&&ve(e.textCollisionBox.collisionVertexArray,m.text.placed,!B||b,I.x,I.y);}var C=Boolean(!b&&k.verticalIconBox);k.iconBox&&ve(e.iconCollisionBox.collisionVertexArray,m.icon.placed,C,p?I.x:0,p?I.y:0),k.verticalIconBox&&ve(e.iconCollisionBox.collisionVertexArray,m.icon.placed,!C,p?I.x:0,p?I.y:0);}}},m=0;m<e.symbolInstances.length;m++)_(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 g=this.collisionCircleArrays[e.bucketInstanceId];e.placementInvProjMatrix=g.invProjMatrix,e.placementViewportMatrix=g.viewportMatrix,e.collisionCircleArray=g.circles,delete this.collisionCircleArrays[e.bucketInstanceId];}},ge.prototype.symbolFadeChange=function(t){return 0===this.fadeDuration?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment},ge.prototype.zoomAdjustment=function(t){return Math.max(0,(this.transform.zoom-t)/1.5)},ge.prototype.hasTransitions=function(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration},ge.prototype.stillRecent=function(t,e){var i=this.zoomAtLastRecencyCheck===e?1-this.zoomAdjustment(e):1;return this.zoomAtLastRecencyCheck=e,this.commitTime+this.fadeDuration*i>t},ge.prototype.setStale=function(){this.stale=!0;};var ye=Math.pow(2,25),be=Math.pow(2,24),we=Math.pow(2,17),xe=Math.pow(2,16),Te=Math.pow(2,9),Se=Math.pow(2,8),Ee=Math.pow(2,1);function Ae(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;var e=t.placed?1:0,i=Math.floor(127*t.opacity);return i*ye+e*be+i*we+e*xe+i*Te+e*Se+i*Ee+e}var ke=0,Ie=function(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&void 0!==t.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[];};Ie.prototype.continuePlacement=function(t,e,i,r,o){for(var n=this._bucketParts;this._currentTileIndex<t.length;)if(e.getBucketParts(n,r,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,i),this._currentPartIndex++,o())return !0;return !1};var Be=function(t,e,i,r,o,n,a){this.placement=new ge(t,o,n,a),this._currentPlacementIndex=e.length-1,this._forceFullPlacement=i,this._showCollisionBoxes=r,this._done=!1;};Be.prototype.isDone=function(){return this._done},Be.prototype.continuePlacement=function(e,i,r){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=i[e[this._currentPlacementIndex]],c=this.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=c)&&(!s.maxzoom||s.maxzoom>c)){if(this._inProgressLayer||(this._inProgressLayer=new Ie(s)),!(r[s.source].length<=0)&&this._inProgressLayer.continuePlacement(r[s.source],this.placement,this._showCollisionBoxes,s,a))return;this._inProgressLayer=null,delete this._inProgressLayer;}this._currentPlacementIndex--;}this._done=!0;},Be.prototype.commit=function(t){return this.placement.commit(t),this.placement};var Pe=512/t.EXTENT/2,Ce=function(t,e,i){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=i;for(var r=0;r<e.length;r++){var o=e.get(r),n=o.key;this.indexedSymbolInstances[n]||(this.indexedSymbolInstances[n]=[]),this.indexedSymbolInstances[n].push({crossTileID:o.crossTileID,coord:this.getScaledCoordinates(o,t)});}};Ce.prototype.getScaledCoordinates=function(e,i){var r=Pe/Math.pow(2,i.canonical.z-this.tileID.canonical.z);return {x:Math.floor((i.canonical.x*t.EXTENT+e.anchorX)*r),y:Math.floor((i.canonical.y*t.EXTENT+e.anchorY)*r)}},Ce.prototype.findMatches=function(t,e,i){for(var r=this.tileID.canonical.z<e.canonical.z?1:Math.pow(2,this.tileID.canonical.z-e.canonical.z),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),c=0,l=a;c<l.length;c+=1){var u=l[c];if(Math.abs(u.coord.x-s.x)<=r&&Math.abs(u.coord.y-s.y)<=r&&!i[u.crossTileID]){i[u.crossTileID]=!0,n.crossTileID=u.crossTileID;break}}}}};var ze=function(){this.maxCrossTileID=0;};ze.prototype.generate=function(){return ++this.maxCrossTileID};var De=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0;};De.prototype.handleWrapJump=function(t){var e=Math.round((t-this.lng)/360);if(0!==e)for(var i in this.indexes){var r=this.indexes[i],o={};for(var n in r){var a=r[n];a.tileID=a.tileID.unwrapTo(a.tileID.wrap+e),o[a.tileID.key]=a;}this.indexes[i]=o;}this.lng=t;},De.prototype.addBucket=function(t,e,i){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===e.bucketInstanceId)return !1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key]);}for(var r=0;r<e.symbolInstances.length;r++)e.symbolInstances.get(r).crossTileID=0;this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]={});var 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 c=a[s];c.tileID.isChildOf(t)&&c.findMatches(e.symbolInstances,t,o);}else {var l=a[t.scaledTo(Number(n)).key];l&&l.findMatches(e.symbolInstances,t,o);}}for(var u=0;u<e.symbolInstances.length;u++){var h=e.symbolInstances.get(u);h.crossTileID||(h.crossTileID=i.generate(),o[h.crossTileID]=!0);}return void 0===this.indexes[t.overscaledZ]&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new Ce(t,e.symbolInstances,e.bucketInstanceId),!0},De.prototype.removeBucketCrossTileIDs=function(t,e){for(var i in e.indexedSymbolInstances)for(var r=0,o=e.indexedSymbolInstances[i];r<o.length;r+=1)delete this.usedCrossTileIDs[t][o[r].crossTileID];},De.prototype.removeStaleBuckets=function(t){var e=!1;for(var i in this.indexes){var r=this.indexes[i];for(var o in r)t[r[o].bucketInstanceId]||(this.removeBucketCrossTileIDs(i,r[o]),delete r[o],e=!0);}return e};var Me=function(){this.layerIndexes={},this.crossTileIDs=new ze,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={};};Me.prototype.addLayer=function(t,e,i){var r=this.layerIndexes[t.id];void 0===r&&(r=this.layerIndexes[t.id]=new De);var o=!1,n={};r.handleWrapJump(i);for(var a=0,s=e;a<s.length;a+=1){var c=s[a],l=c.getBucket(t);l&&t.id===l.layerIds[0]&&(l.bucketInstanceId||(l.bucketInstanceId=++this.maxBucketInstanceId),r.addBucket(c.tileID,l,this.crossTileIDs)&&(o=!0),n[l.bucketInstanceId]=!0);}return r.removeStaleBuckets(n)&&(o=!0),o},Me.prototype.pruneUnusedLayers=function(t){var e={};for(var i in t.forEach((function(t){e[t]=!0;})),this.layerIndexes)e[i]||delete this.layerIndexes[i];};var Re=function(e,i){return t.emitValidationErrors(e,i&&i.filter((function(t){return "source.canvas"!==t.identifier})))},Le=t.pick(Ft,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),Oe=t.pick(Ft,["setCenter","setZoom","setBearing","setPitch"]),Fe=function(){var e={},i=t.styleSpec.$version;for(var r in t.styleSpec.$root){var o,n=t.styleSpec.$root[r];if(n.required)null!=(o="version"===r?i:"array"===n.type?[]:{})&&(e[r]=o);}return e}(),Ue=function(e){function i(r,o){var n=this;void 0===o&&(o={}),e.call(this),this.map=r,this.dispatcher=new v((Mt||(Mt=new Rt),Mt),this),this.imageManager=new d,this.imageManager.setEventedParent(this),this.glyphManager=new t.GlyphManager(r._requestManager,o.localFontFamily?t.LocalGlyphMode.all:o.localIdeographFontFamily?t.LocalGlyphMode.ideographs:t.LocalGlyphMode.none,o.localFontFamily||o.localIdeographFontFamily),this.lineAtlas=new t.LineAtlas(256,512),this.crossTileSymbolIndex=new Me,this._layers={},this._serializedLayers={},this._order=[],this._sourceCaches={},this._otherSourceCaches={},this._symbolSourceCaches={},this.zoomHistory=new t.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",t.getReferrer());var a=this;this._rtlTextPluginCallback=i.registerForPluginStateChange((function(e){a.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:e.pluginStatus,pluginURL:e.pluginURL},(function(e,i){if(t.triggerPluginCompletionEvent(e),i&&i.every((function(t){return t})))for(var r in a._sourceCaches){var o=a._sourceCaches[r],n=o.getSource().type;"vector"!==n&&"geojson"!==n||o.reload();}}));})),this.on("data",(function(t){if("source"===t.dataType&&"metadata"===t.sourceDataType){var e=n.getSource(t.sourceId);if(e&&e.vectorLayerIds)for(var i in n._layers){var r=n._layers[i];r.source===e.id&&n._validateLayer(r);}}}));}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.loadURL=function(e,i){var r=this;void 0===i&&(i={}),this.fire(new t.Event("dataloading",{dataType:"style"}));var o="boolean"==typeof i.validate?i.validate:!t.issgmapURL(e);e.indexOf(".sg")==e.length-3||(e=this.map._requestManager.normalizeStyleURL(e,i.accessToken));var n=this.map._requestManager.transformRequest(e,t.ResourceType.Style);this._request=e.indexOf(".sg")==e.length-3?t.getArrayBuffer(n,(function(e,i,n,a){if(r._request=null,e)r.fire(new t.ErrorEvent(e));else if(i){var s=t.BufferTostyle(new t.Protobuf(i));r._load(s,o,i);}})):t.getJSON(n,(function(e,i){r._request=null,e?r.fire(new t.ErrorEvent(e)):i&&r._load(i,o);}));},i.prototype.loadJSON=function(e,i){var r=this;void 0===i&&(i={}),this.fire(new t.Event("dataloading",{dataType:"style"})),this._request=t.browser.frame((function(){r._request=null,r._load(e,!1!==i.validate);}));},i.prototype.loadEmpty=function(){this.fire(new t.Event("dataloading",{dataType:"style"})),this._load(Fe,!1);},i.prototype._resetOldstyle=function(t){return t?t.map((function(t){var e=t.paint&&t.paint["line-pattern-mode"];if(null!=e||null!=e){var i=t.paint["line-pattern"];"number"==typeof e&&"string"==typeof i?(t.paint["line-pattern"]=0==e||3==e?i:"dash_100_0",t.paint["line-outline-pattern"]=1==e||3==e?i:"dash_100_0"):(e=JSON.parse(JSON.stringify(e)),i=JSON.parse(JSON.stringify(i)),t.paint["line-pattern"]=["match",e,[0,3],i,"dash_100_0"],t.paint["line-outline-pattern"]=["match",e,[1,3],i,"dash_100_0"]),delete t.paint["line-pattern-mode"];}return t})):[]},i.prototype._load=function(e,i,r){for(var o in e.layers=this._resetOldstyle(e.layers),this._loaded=!0,this.stylesheet=e,e.sources)this.addSource(o,e.sources[o],{validate:!1});this._changed=!1,e.sprite?this._loadSprite(e.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(e.glyphs);var n=Ot(this.stylesheet.layers);this._order=n.map((function(t){return t.id})),this._layers={},this._serializedLayers={};for(var a=0,s=n;a<s.length;a+=1){var c=s[a];(c=t.createStyleLayer(c)).setEventedParent(this,{layer:{id:c.id}}),this._layers[c.id]=c,this._serializedLayers[c.id]=c.serialize();}r?this.dispatcher.broadcast("setLayersbuffer",t.isIE11()?[].slice.call(new Uint8Array(data)):r.slice(0)):(this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),e.xml&&this.dispatcher.broadcast("setXml",e.xml)),this.light=new g(this.stylesheet.light),this.fire(new t.Event("data",{dataType:"style"})),this.fire(new t.Event("style.load"));},i.prototype._loadSprite=function(e){var i=this;this._spriteRequest=p(e,this.map._requestManager,(function(e,r){if(i._spriteRequest=null,e)i.fire(new t.ErrorEvent(e));else if(r)for(var o in r)i.getImage(o)||i.imageManager.addImage(o,r[o]);i.imageManager.setLoaded(!0),i._availableImages=i.imageManager.listImages(),i.dispatcher.broadcast("setImages",i._availableImages),i.fire(new t.Event("data",{dataType:"style"}));}));},i.prototype._validateLayer=function(e){var i=this.getSource(e.source);if(i){var r=e.sourceLayer;r&&("geojson"===i.type||i.vectorLayerIds&&-1===i.vectorLayerIds.indexOf(r))&&this.fire(new t.ErrorEvent(new Error('Source layer "'+r+'" does not exist on source "'+i.id+'" as specified by style layer "'+e.id+'"')));}},i.prototype.loaded=function(){if(!this._loaded)return !1;if(Object.keys(this._updatedSources).length)return !1;for(var t in this._sourceCaches)if(!this._sourceCaches[t].loaded())return !1;return !!this.imageManager.isLoaded()},i.prototype._serializeLayers=function(t){for(var e=[],i=0,r=t;i<r.length;i+=1){var o=this._layers[r[i]];"custom"!==o.type&&e.push(o.serialize());}return e},i.prototype.hasTransitions=function(){if(this.light&&this.light.hasTransition())return !0;for(var t in this._sourceCaches)if(this._sourceCaches[t].hasTransition())return !0;for(var e in this._layers)if(this._layers[e].hasTransition())return !0;return !1},i.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},i.prototype.update=function(e){if(this._loaded){var i=this._changed;if(this._changed){var r=Object.keys(this._updatedLayers),o=Object.keys(this._removedLayers);for(var n in (r.length||o.length)&&this._updateWorkerLayers(r,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 c={};for(var l in this._sourceCaches){var u=this._sourceCaches[l];c[l]=u.used,u.used=!1;}for(var h=0,p=this._order;h<p.length;h+=1){var f=this._layers[p[h]];if(f.recalculate(e,this._availableImages),!f.isHidden(e.zoom)){var d=this._getLayerSourceCache(f);d&&(d.used=!0);}}for(var _ in c){var m=this._sourceCaches[_];c[_]!==m.used&&m.getSource().fire(new t.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:m.getSource().id}));}this.light.recalculate(e),this.z=e.zoom,i&&this.fire(new t.Event("data",{dataType:"style"}));}},i.prototype._updateTilesForChangedImages=function(){var t=Object.keys(this._changedImages);if(t.length){for(var e in this._sourceCaches)this._sourceCaches[e].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={};}},i.prototype._updateWorkerLayers=function(t,e){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(t),removedIds:e});},i.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={};},i.prototype.setState=function(e,i){var r=this;if(this._checkLoaded(),Re(this,t.validateStyle(e)))return !1;(e=t.clone$1(e)).layers=Ot(e.layers);var o=function(e,i){if(!e)return [{command:Ft.setStyle,args:[i]}];var r=[];try{if(!t.deepEqual(e.version,i.version))return [{command:Ft.setStyle,args:[i]}];t.deepEqual(e.center,i.center)||r.push({command:Ft.setCenter,args:[i.center]}),t.deepEqual(e.zoom,i.zoom)||r.push({command:Ft.setZoom,args:[i.zoom]}),t.deepEqual(e.bearing,i.bearing)||r.push({command:Ft.setBearing,args:[i.bearing]}),t.deepEqual(e.pitch,i.pitch)||r.push({command:Ft.setPitch,args:[i.pitch]}),t.deepEqual(e.sprite,i.sprite)||r.push({command:Ft.setSprite,args:[i.sprite]}),t.deepEqual(e.glyphs,i.glyphs)||r.push({command:Ft.setGlyphs,args:[i.glyphs]}),t.deepEqual(e.transition,i.transition)||r.push({command:Ft.setTransition,args:[i.transition]}),t.deepEqual(e.light,i.light)||r.push({command:Ft.setLight,args:[i.light]});var o={},n=[];!function(e,i,r,o){var n;for(n in i=i||{},e=e||{})e.hasOwnProperty(n)&&(i.hasOwnProperty(n)||Nt(n,r,o));for(n in i)i.hasOwnProperty(n)&&(e.hasOwnProperty(n)?t.deepEqual(e[n],i[n])||("geojson"===e[n].type&&"geojson"===i[n].type&&Vt(e,i,n)?r.push({command:Ft.setGeoJSONSourceData,args:[n,i[n].data]}):jt(n,i,r,o)):Ut(n,i,r));}(e.sources,i.sources,n,o);var a=[];e.layers&&e.layers.forEach((function(t){o[t.source]?r.push({command:Ft.removeLayer,args:[t.id]}):a.push(t);})),r=r.concat(n),function(e,i,r){i=i||[];var o,n,a,s,c,l,u,h=(e=e||[]).map(Zt),p=i.map(Zt),f=e.reduce(Gt,{}),d=i.reduce(Gt,{}),_=h.slice(),m=Object.create(null);for(o=0,n=0;o<h.length;o++)d.hasOwnProperty(a=h[o])?n++:(r.push({command:Ft.removeLayer,args:[a]}),_.splice(_.indexOf(a,n),1));for(o=0,n=0;o<p.length;o++)_[_.length-1-o]!==(a=p[p.length-1-o])&&(f.hasOwnProperty(a)?(r.push({command:Ft.removeLayer,args:[a]}),_.splice(_.lastIndexOf(a,_.length-n),1)):n++,r.push({command:Ft.addLayer,args:[d[a],l=_[_.length-o]]}),_.splice(_.length-o,0,a),m[a]=!0);for(o=0;o<p.length;o++)if(s=f[a=p[o]],c=d[a],!m[a]&&!t.deepEqual(s,c))if(t.deepEqual(s.source,c.source)&&t.deepEqual(s["source-layer"],c["source-layer"])&&t.deepEqual(s.type,c.type)){for(u in qt(s.layout,c.layout,r,a,null,Ft.setLayoutProperty),qt(s.paint,c.paint,r,a,null,Ft.setPaintProperty),t.deepEqual(s.filter,c.filter)||r.push({command:Ft.setFilter,args:[a,c.filter]}),t.deepEqual(s.minzoom,c.minzoom)&&t.deepEqual(s.maxzoom,c.maxzoom)||r.push({command:Ft.setLayerZoomRange,args:[a,c.minzoom,c.maxzoom]}),s)s.hasOwnProperty(u)&&"layout"!==u&&"paint"!==u&&"filter"!==u&&"metadata"!==u&&"minzoom"!==u&&"maxzoom"!==u&&(0===u.indexOf("paint.")?qt(s[u],c[u],r,a,u.slice(6),Ft.setPaintProperty):t.deepEqual(s[u],c[u])||r.push({command:Ft.setLayerProperty,args:[a,u,c[u]]}));for(u in c)c.hasOwnProperty(u)&&!s.hasOwnProperty(u)&&"layout"!==u&&"paint"!==u&&"filter"!==u&&"metadata"!==u&&"minzoom"!==u&&"maxzoom"!==u&&(0===u.indexOf("paint.")?qt(s[u],c[u],r,a,u.slice(6),Ft.setPaintProperty):t.deepEqual(s[u],c[u])||r.push({command:Ft.setLayerProperty,args:[a,u,c[u]]}));}else r.push({command:Ft.removeLayer,args:[a]}),l=_[_.lastIndexOf(a)+1],r.push({command:Ft.addLayer,args:[c,l]});}(a,i.layers,r);}catch(t){console.warn("Unable to compute style diff:",t),r=[{command:Ft.setStyle,args:[i]}];}return r}(this.serialize(),e).filter((function(t){return !(t.command in Oe)}));if(0===o.length)return !1;var n=o.filter((function(t){return !(t.command in Le)}));if(n.length>0)throw new Error("Unimplemented: "+n.map((function(t){return t.command})).join(", ")+".");return o.forEach((function(t){"setTransition"!==t.command&&r[t.command].apply(r,t.args);})),this.stylesheet=e,!0},i.prototype.addImage=function(e,i){if(this.getImage(e))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(e,i),this._afterImageUpdated(e);},i.prototype.updateImage=function(t,e){this.imageManager.updateImage(t,e);},i.prototype.getImage=function(t){return this.imageManager.getImage(t)},i.prototype.removeImage=function(e){if(!this.getImage(e))return this.fire(new t.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(e),this._afterImageUpdated(e);},i.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"}));},i.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},i.prototype.addSource=function(e,i,r){var o=this;if(void 0===r&&(r={}),this._checkLoaded(),void 0!==this.getSource(e))throw new Error("There is already a source with this ID");if(!i.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(i).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(i.type)>=0&&this._validate(t.validateStyle.source,"sources."+e,i,null,r))){i.tiles&&t.checkCustomTileSource(e,i,this.map),this.map&&this.map._collectResourceTiming&&(i.collectResourceTiming=!0);var n=function(e,i,r,o){var n=new M[i.type](e,i,r,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}(e,i,this.dispatcher,this);n.setEventedParent(this,(function(){return {isSourceLoaded:o.loaded(),source:n.serialize(),sourceId:e}}));var a=function(t){var i=(t?"symbol:":"other:")+e,r=o._sourceCaches[i]=new Pt(i,n,t);(t?o._symbolSourceCaches:o._otherSourceCaches)[e]=r,r.style=o,r.onAdd(o.map);};a(!1),"vector"!==i.type&&"geojson"!==i.type||a(!0),n.onAdd&&n.onAdd(this.map),this._changed=!0;}},i.prototype.removeSource=function(e){this._checkLoaded();var i=this.getSource(e);if(void 0===i)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.')));for(var o=0,n=this._getSourceCaches(e);o<n.length;o+=1){var a=n[o];delete this._sourceCaches[a.id],delete this._updatedSources[a.id],a.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:a.getSource().id})),a.setEventedParent(null),a.clearTiles();}delete this._otherSourceCaches[e],delete this._symbolSourceCaches[e],i.setEventedParent(null),i.onRemove&&i.onRemove(this.map),this._changed=!0;},i.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.getSource(t).setData(e),this._changed=!0;},i.prototype.getSource=function(t){var e=this._getSourceCache(t);return e&&e.getSource()},i.prototype.addLayer=function(e,i,r){void 0===r&&(r={}),this._checkLoaded();var o=e.id;if(this.getLayer(o))this.fire(new t.ErrorEvent(new Error('Layer with id "'+o+'" already exists on this map')));else {var n;if("esymbol"===e.type||"eline"===e.type){if(!t.window.SGMap.pluginData&&!this.arrowVertexArray)return void this.fire(new t.ErrorEvent(new Error("请预先加载电网符号绘制插件")));!this.arrowVertexArray&&t.window.SGMap.pluginData&&this.getArrowVertexArray();}if("custom"===e.type){if(Re(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},r))return;n=t.createStyleLayer(e),this._validateLayer(n),n.setEventedParent(this,{layer:{id:o}}),this._serializedLayers[n.id]=n.serialize();}var a=i?this._order.indexOf(i):this._order.length;if(i&&-1===a)this.fire(new t.ErrorEvent(new Error('Layer with id "'+i+'" does not exist on this map.')));else {this._order.splice(a,0,o),this._layerOrderChanged=!0,this._layers[o]=n;var s=this._getLayerSourceCache(n);if(this._removedLayers[o]&&n.source&&s&&"custom"!==n.type){var c=this._removedLayers[o];delete this._removedLayers[o],c.type!==n.type?this._updatedSources[n.source]="clear":(this._updatedSources[n.source]="reload",s.pause());}this._updateLayer(n),n.onAdd&&n.onAdd(this.map);}}},i.prototype.moveLayer=function(e,i){if(this._checkLoaded(),this._changed=!0,this._layers[e]){if(e!==i)if(i&&-1===this._order.indexOf(i))this.fire(new t.ErrorEvent(new Error('Layer with id "'+i+'" does not exist on this map.')));else {var r=this._order.indexOf(e);this._order.splice(r,1);var o=i?this._order.indexOf(i):this._order.length;i&&-1===o?this.fire(new t.ErrorEvent(new Error('Layer with id "'+i+'" 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.")));},i.prototype.removeLayer=function(e){this._checkLoaded();var i=this._layers[e];if(i){i.setEventedParent(null);var r=this._order.indexOf(e);this._order.splice(r,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=i,delete this._layers[e],delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],i.onRemove&&i.onRemove(this.map);}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be removed.")));},i.prototype.getLayer=function(t){return this._layers[t]},i.prototype.hasLayer=function(t){return t in this._layers},i.prototype.setLayerZoomRange=function(e,i,r){this._checkLoaded();var o=this.getLayer(e);o?o.minzoom===i&&o.maxzoom===r||(null!=i&&(o.minzoom=i),null!=r&&(o.maxzoom=r),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.")));},i.prototype.setFilter=function(e,i,r){void 0===r&&(r={}),this._checkLoaded();var o=this.getLayer(e);if(o){if(!t.deepEqual(o.filter,i))return null==i?(o.filter=void 0,void this._updateLayer(o)):void(this._validate(t.validateStyle.filter,"layers."+o.id+".filter",i,null,r)||(o.filter=t.clone$1(i),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.")));},i.prototype.getFilter=function(e){return t.clone$1(this.getLayer(e).filter)},i.prototype.setLayoutProperty=function(e,i,r,o){void 0===o&&(o={}),this._checkLoaded();var n=this.getLayer(e);n?t.deepEqual(n.getLayoutProperty(i),r)||(n.setLayoutProperty(i,r,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.")));},i.prototype.getLayoutProperty=function(e,i){var r=this.getLayer(e);if(r)return r.getLayoutProperty(i);this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style.")));},i.prototype.setPaintProperty=function(e,i,r,o){void 0===o&&(o={}),this._checkLoaded();var n=this.getLayer(e);n?t.deepEqual(n.getPaintProperty(i),r)||(n.setPaintProperty(i,r,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.")));},i.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},i.prototype.setFeatureState=function(e,i){this._checkLoaded();var r=e.source,o=e.sourceLayer,n=this.getSource(r);if(void 0!==n){var a=n.type;if("geojson"===a&&o)this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));else if("vector"!==a||o){void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided.")));for(var s=0,c=this._getSourceCaches(r);s<c.length;s+=1)c[s].setFeatureState(o,e.id,i);}else this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));}else this.fire(new t.ErrorEvent(new Error("The source '"+r+"' does not exist in the map's style.")));},i.prototype.removeFeatureState=function(e,i){this._checkLoaded();var r=e.source,o=this.getSource(r);if(void 0!==o){var n=o.type,a="vector"===n?e.sourceLayer:void 0;if("vector"!==n||a)if(i&&"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.")));else for(var s=0,c=this._getSourceCaches(r);s<c.length;s+=1)c[s].removeFeatureState(a,e.id,i);else this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));}else this.fire(new t.ErrorEvent(new Error("The source '"+r+"' does not exist in the map's style.")));},i.prototype.getFeatureState=function(e){this._checkLoaded();var i=e.source,r=e.sourceLayer,o=this.getSource(i);if(void 0!==o){if("vector"!==o.type||r)return void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),this._getSourceCaches(i)[0].getFeatureState(r,e.id);this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));}else this.fire(new t.ErrorEvent(new Error("The source '"+i+"' does not exist in the map's style.")));},i.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},i.prototype.serialize=function(){var e={};for(var i in this._sourceCaches){var r=this._sourceCaches[i].getSource();e[r.id]||(e[r.id]=r.serialize());}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:e,layers:this._serializeLayers(this._order),xml:this.stylesheet.xml},(function(t){return void 0!==t}))},i.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0;var e=this._getLayerSourceCache(t);t.source&&!this._updatedSources[t.source]&&e&&"raster"!==e.getSource().type&&(this._updatedSources[t.source]="reload",e.pause()),this._changed=!0;},i.prototype._flattenAndSortRenderedFeatures=function(t){for(var e=this,i=function(t){return "fill-extrusion"===e._layers[t].type},r={},o=[],n=this._order.length-1;n>=0;n--){var a=this._order[n];if(i(a)){r[a]=n;for(var s=0,c=t;s<c.length;s+=1){var l=c[s][a];if(l)for(var u=0,h=l;u<h.length;u+=1)o.push(h[u]);}}}o.sort((function(t,e){return e.intersectionZ-t.intersectionZ}));for(var p=[],f=this._order.length-1;f>=0;f--){var d=this._order[f];if(i(d))for(var _=o.length-1;_>=0;_--){var m=o[_].feature;if(r[m.layer.id]<f)break;p.push(m),o.pop();}else for(var g=0,v=t;g<v.length;g+=1){var y=v[g][d];if(y)for(var b=0,w=y;b<w.length;b+=1)p.push(w[b].feature);}}return p},i.prototype.queryRenderedFeatures=function(e,i,r){i&&i.filter&&this._validate(t.validateStyle.filter,"queryRenderedFeatures.filter",i.filter,null,i);var o={};if(i&&i.layers){if(!Array.isArray(i.layers))return this.fire(new t.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(var n=0,a=i.layers;n<a.length;n+=1){var s=a[n],c=this._layers[s];if(!c)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[c.source]=!0;}}var l=[];for(var u in i.availableImages=this._availableImages,this._sourceCaches){var h=this._sourceCaches[u].getSource().id;i.layers&&!o[h]||l.push(L(this._sourceCaches[u],this._layers,this._serializedLayers,e,i,r));}return this.placement&&l.push(function(t,e,i,r,o,n,a){for(var s={},c=n.queryRenderedSymbols(r),l=[],u=0,h=Object.keys(c).map(Number);u<h.length;u+=1)l.push(a[h[u]]);l.sort(F);for(var p=function(){var i=d[f],r=i.featureIndex.lookupSymbolFeatures(c[i.bucketInstanceId],e,i.bucketIndex,i.sourceLayerIndex,o.filter,o.layers,o.availableImages,t);for(var n in r){var a=s[n]=s[n]||[],l=r[n];l.sort((function(t,e){var r=i.featureSortOrder;if(r){var o=r.indexOf(t.featureIndex);return r.indexOf(e.featureIndex)-o}return e.featureIndex-t.featureIndex}));for(var u=0,h=l;u<h.length;u+=1)a.push(h[u]);}},f=0,d=l;f<d.length;f+=1)p();var _=function(e){s[e].forEach((function(r){var o=r.feature,n=i(t[e]).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 m in s)_(m);return s}(this._layers,this._serializedLayers,this._getLayerSourceCache.bind(this),e,i,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(l)},i.prototype.querySourceFeatures=function(e,i){i&&i.filter&&this._validate(t.validateStyle.filter,"querySourceFeatures.filter",i.filter,null,i);for(var r=[],o=0,n=this._getSourceCaches(e);o<n.length;o+=1)r=r.concat(O(n[o],i));return r},i.prototype.addSourceType=function(t,e,r){return i.getSourceType(t)?r(new Error('A source type called "'+t+'" already exists.')):(i.setSourceType(t,e),e.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:t,url:e.workerSourceURL},r):r(null,null))},i.prototype.getLight=function(){return this.light.getLight()},i.prototype.setLight=function(e,i){void 0===i&&(i={}),this._checkLoaded();var r=this.light.getLight(),o=!1;for(var n in e)if(!t.deepEqual(e[n],r[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,i),this.light.updateTransitions(a);}},i.prototype._validate=function(e,i,r,o,n){return void 0===n&&(n={}),(!n||!1!==n.validate)&&Re(this,e.call(t.validateStyle,t.extend({key:i,style:this.serialize(),value:r,styleSpec:t.styleSpec},o)))},i.prototype._remove=function(){for(var e in this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),t.evented.off("pluginStateChange",this._rtlTextPluginCallback),this._layers)this._layers[e].setEventedParent(null);for(var i in this._sourceCaches)this._sourceCaches[i].clearTiles(),this._sourceCaches[i].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove();},i.prototype._clearSource=function(t){for(var e=0,i=this._getSourceCaches(t);e<i.length;e+=1)i[e].clearTiles();},i.prototype._reloadSource=function(t){for(var e=0,i=this._getSourceCaches(t);e<i.length;e+=1){var r=i[e];r.resume(),r.reload();}},i.prototype._updateSources=function(t){for(var e in this._sourceCaches)this._sourceCaches[e].update(t);},i.prototype._generateCollisionBoxes=function(){for(var t in this._sourceCaches){var e=this._sourceCaches[t];e.resume(),e.reload();}},i.prototype._updatePlacement=function(e,i,r,o,n){void 0===n&&(n=!1);for(var a=!1,s=!1,c={},l=0,u=this._order;l<u.length;l+=1){var h=this._layers[u[l]];if("symbol"===h.type){if(!c[h.source]){var p=this._getLayerSourceCache(h);if(!p)continue;c[h.source]=p.getRenderableIds(!0).map((function(t){return p.getTileByID(t)})).sort((function(t,e){return e.tileID.overscaledZ-t.tileID.overscaledZ||(t.tileID.isLessThan(e.tileID)?-1:1)}));}var f=this.crossTileSymbolIndex.addLayer(h,c[h.source],e.center.lng);a=a||f;}}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((n=n||this._layerOrderChanged||0===r)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(t.browser.now(),e.zoom))&&(this.pauseablePlacement=new Be(e,this._order,n,i,r,o,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,c),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(t.browser.now()),s=!0),a&&this.pauseablePlacement.placement.setStale()),s||a)for(var d=0,_=this._order;d<_.length;d+=1){var m=this._layers[_[d]];"symbol"===m.type&&this.placement.updateLayerOpacities(m,c[m.source]);}return !this.pauseablePlacement.isDone()||this.placement.hasTransitions(t.browser.now())},i.prototype._releaseSymbolFadeTiles=function(){for(var t in this._sourceCaches)this._sourceCaches[t].releaseSymbolFadeTiles();},i.prototype.getImages=function(t,e,i){this.imageManager.getImages(e.icons,i),this._updateTilesForChangedImages();var r=function(t){t&&t.setDependencies(e.tileID.key,e.type,e.icons);};r(this._otherSourceCaches[e.source]),r(this._symbolSourceCaches[e.source]);},i.prototype.getGlyphs=function(t,e,i){this.glyphManager.getGlyphs(e.stacks,i);},i.prototype.getResource=function(e,i,r){return t.makeRequest(i,r)},i.prototype._getSourceCache=function(t){return this._otherSourceCaches[t]},i.prototype._getLayerSourceCache=function(t){return "symbol"===t.type?this._symbolSourceCaches[t.source]:this._otherSourceCaches[t.source]},i.prototype._getSourceCaches=function(t){var e=[];return this._otherSourceCaches[t]&&e.push(this._otherSourceCaches[t]),this._symbolSourceCaches[t]&&e.push(this._symbolSourceCaches[t]),e},i.prototype.getArrowVertexArray=function(){this.arrowVertexArray=t.window.SGMap.pluginData.esymbolData;var e=t.window.SGMap.pluginData.elineData;for(var i in e){var r=e[i].width,o=e[i].height,n=new Uint8Array(e[i].data);this.map.hasImage(i)||this.map.addImage(i,{width:r,height:o,data:n},{sdf:!0});}},i.prototype.getEleSymbolVertexs=function(t,e,i){var r={};if(this.arrowVertexArray&&0!=this.arrowVertexArray.length){for(var o=0;o<e.eleSymbolVertexs.length;o++){var n=e.eleSymbolVertexs[o],a=this.arrowVertexArray[0].indexOf(n);a<0?console.log("符号:"+n+"没有找到"):r[n]=[this.arrowVertexArray[a/5+1],this.arrowVertexArray[0][a+1],this.arrowVertexArray[0][a+2],this.arrowVertexArray[0][a+3],this.arrowVertexArray[0][a+4]];}return i(null,r)}},i}(t.Evented);Ue.getSourceType=function(t){return M[t]},Ue.setSourceType=function(t,e){M[t]=e;},Ue.registerForPluginStateChange=t.registerForPluginStateChange;var Ne=t.createLayout([{name:"a_pos",type:"Int16",components:2}]),je=_i("#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;}"),Ve=_i("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);}"),qe=_i("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);}"),Ze=_i("varying vec3 v_data;\n#pragma sgmap: define highp vec4 color\n#pragma sgmap: define mediump float radius\n#pragma sgmap: define lowp float blur\n#pragma sgmap: define lowp float opacity\n#pragma sgmap: define highp vec4 stroke_color\n#pragma sgmap: define mediump float stroke_width\n#pragma sgmap: define lowp float stroke_opacity\nvoid main() {\n#pragma sgmap: initialize highp vec4 color\n#pragma sgmap: initialize mediump float radius\n#pragma sgmap: initialize lowp float blur\n#pragma sgmap: initialize lowp float opacity\n#pragma sgmap: initialize highp vec4 stroke_color\n#pragma sgmap: initialize mediump float stroke_width\n#pragma sgmap: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=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;\r\nuniform bool u_scale_with_map;\r\nuniform bool u_pitch_with_map;\r\nuniform vec2 u_extrude_scale;\r\nuniform lowp float u_device_pixel_ratio;\r\nuniform highp float u_camera_to_center_distance;\r\nattribute vec2 a_pos;\r\nvarying vec3 v_data;\r\n#pragma sgmap: define highp vec4 color\r\n#pragma sgmap: define mediump float radius\r\n#pragma sgmap: define lowp float blur\r\n#pragma sgmap: define lowp float opacity\r\n#pragma sgmap: define highp vec4 stroke_color\r\n#pragma sgmap: define mediump float stroke_width\r\n#pragma sgmap: define lowp float stroke_opacity\r\nvoid main(void) {\r\n#pragma sgmap: initialize highp vec4 color\r\n#pragma sgmap: initialize mediump float radius\r\n#pragma sgmap: initialize lowp float blur\r\n#pragma sgmap: initialize lowp float opacity\r\n#pragma sgmap: initialize highp vec4 stroke_color\r\n#pragma sgmap: initialize mediump float stroke_width\r\n#pragma sgmap: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);\r\nif (u_pitch_with_map) {\r\nvec2 corner_position=circle_center;\r\nif (u_scale_with_map) {\r\ncorner_position+=extrude*(radius+stroke_width)*u_extrude_scale;\r\n} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);\r\ncorner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);\r\n}\r\ngl_Position=u_matrix*vec4(corner_position,0,1);\r\n} else {\r\ngl_Position=u_matrix*vec4(circle_center,0,1);\r\nif (u_scale_with_map) {\r\ngl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;\r\n} else {\r\ngl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;\r\n}\r\n}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);\r\nv_data=vec3(extrude.x,extrude.y,antialiasblur);\r\n}"),Ge=_i("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);}"),He=_i("uniform highp float u_intensity;varying vec2 v_extrude;\n#pragma sgmap: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma sgmap: 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 sgmap: define highp float weight\n#pragma sgmap: 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 sgmap: initialize highp float weight\n#pragma sgmap: 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;}"),We=_i("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;}"),Xe=_i("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;}"),Ke=_i("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);}"),Ye=_i("uniform highp vec4 u_color;\r\nuniform sampler2D u_overlay;\r\nvarying vec2 v_uv;\r\nvoid main() {\r\nvec4 overlay_color=texture2D(u_overlay,v_uv);\r\ngl_FragColor=mix(u_color,overlay_color,overlay_color.a);\r\n}","attribute vec2 a_pos;\r\nattribute vec2 a_uv;\r\nvarying vec2 v_uv;\r\nuniform mat4 u_matrix;\r\nuniform float u_overlay_scale;\r\nvoid main() {v_uv=a_uv;\r\ngl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);\r\n}"),Je=_i("#pragma sgmap: define highp vec4 color\n#pragma sgmap: define lowp float opacity\nvoid main() {\n#pragma sgmap: initialize highp vec4 color\n#pragma sgmap: 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 sgmap: define highp vec4 color\n#pragma sgmap: define lowp float opacity\nvoid main() {\n#pragma sgmap: initialize highp vec4 color\n#pragma sgmap: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),Qe=_i("varying vec2 v_pos;\n#pragma sgmap: define highp vec4 outline_color\n#pragma sgmap: define lowp float opacity\nvoid main() {\n#pragma sgmap: initialize highp vec4 outline_color\n#pragma sgmap: 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 sgmap: define highp vec4 outline_color\n#pragma sgmap: define lowp float opacity\nvoid main() {\n#pragma sgmap: initialize highp vec4 outline_color\n#pragma sgmap: 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;}","fillOutline"),$e=_i("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 sgmap: define lowp float opacity\n#pragma sgmap: define lowp vec4 pattern_from\n#pragma sgmap: define lowp vec4 pattern_to\nvoid main() {\n#pragma sgmap: initialize lowp float opacity\n#pragma sgmap: initialize mediump vec4 pattern_from\n#pragma sgmap: 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 sgmap: define lowp float opacity\n#pragma sgmap: define lowp vec4 pattern_from\n#pragma sgmap: define lowp vec4 pattern_to\n#pragma sgmap: define lowp float pixel_ratio_from\n#pragma sgmap: define lowp float pixel_ratio_to\nvoid main() {\n#pragma sgmap: initialize lowp float opacity\n#pragma sgmap: initialize mediump vec4 pattern_from\n#pragma sgmap: initialize mediump vec4 pattern_to\n#pragma sgmap: initialize lowp float pixel_ratio_from\n#pragma sgmap: 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;}","fillOutlinePattern"),ti=_i("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma sgmap: define lowp float opacity\n#pragma sgmap: define lowp vec4 pattern_from\n#pragma sgmap: define lowp vec4 pattern_to\nvoid main() {\n#pragma sgmap: initialize lowp float opacity\n#pragma sgmap: initialize mediump vec4 pattern_from\n#pragma sgmap: 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 sgmap: define lowp float opacity\n#pragma sgmap: define lowp vec4 pattern_from\n#pragma sgmap: define lowp vec4 pattern_to\n#pragma sgmap: define lowp float pixel_ratio_from\n#pragma sgmap: define lowp float pixel_ratio_to\nvoid main() {\n#pragma sgmap: initialize lowp float opacity\n#pragma sgmap: initialize mediump vec4 pattern_from\n#pragma sgmap: initialize mediump vec4 pattern_to\n#pragma sgmap: initialize lowp float pixel_ratio_from\n#pragma sgmap: 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);}","fillPattern"),ei=_i("varying vec4 v_color;\r\nvoid main() {\r\ngl_FragColor=v_color*zoom_opacity;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform vec3 u_lightcolor;\r\nuniform lowp vec3 u_lightpos;\r\nuniform lowp float u_lightintensity;\r\nuniform float u_vertical_gradient;\r\nuniform lowp float u_opacity;\r\nattribute vec2 a_pos;\r\nattribute vec4 a_normal_ed;\r\nvarying vec4 v_color;\r\n#pragma sgmap: define highp float base\r\n#pragma sgmap: define highp float height\r\n#pragma sgmap: define highp vec4 color\r\n#pragma sgmap: define highp vec4 topcolor\r\nvoid main() {\r\n#pragma sgmap: initialize highp float base\r\n#pragma sgmap: initialize highp float height\r\n#pragma sgmap: initialize highp vec4 color\r\n#pragma sgmap: initialize highp vec4 topcolor\r\nvec3 normal=a_normal_ed.xyz;\r\nbase=max(0.0,base);\r\nheight=max(0.0,height);\r\nfloat t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);vec3 ambientLightColor=u_lightcolor;\r\nfloat ambientStrength=u_lightintensity+0.39;\r\nvec3 ambient=ambientStrength*ambientLightColor;vec3 lightDir=u_lightpos;\r\nvec3 lightColor=u_lightcolor;\r\nfloat lightStrength=0.1;\r\nfloat nDotL=max(dot(normal/16384.0,lightDir),0.0);\r\nvec3 diff=lightStrength*lightColor*nDotL;\r\nv_color=t > 0.0 ? (topcolor.a==0.0?color: topcolor): color ;\r\nv_color.rgb*=diff+ambient;\r\nv_color*=u_opacity;\r\n}","fillExtrusion"),ii=_i("uniform vec2 u_texsize;\r\nuniform float u_fade;\r\nuniform sampler2D u_image;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\nvarying vec4 v_lighting;\r\nvarying float flag_top;\n#pragma sgmap: define lowp float base\r\n#pragma sgmap: define lowp float height\r\n#pragma sgmap: define lowp vec4 pattern_from\r\n#pragma sgmap: define lowp vec4 pattern_to\r\n#pragma sgmap: define lowp float pixel_ratio_from\r\n#pragma sgmap: define lowp float pixel_ratio_to\r\n#pragma sgmap: define highp vec4 color\r\n#pragma sgmap: define highp vec4 topcolor\r\nvoid main() {\r\n#pragma sgmap: initialize lowp float base\r\n#pragma sgmap: initialize lowp float height\r\n#pragma sgmap: initialize mediump vec4 pattern_from\r\n#pragma sgmap: initialize mediump vec4 pattern_to\r\n#pragma sgmap: initialize lowp float pixel_ratio_from\r\n#pragma sgmap: initialize lowp float pixel_ratio_to\r\n#pragma sgmap: initialize highp vec4 color\r\n#pragma sgmap: initialize highp vec4 topcolor\r\nvec2 pattern_tl_a=pattern_from.xy;\r\nvec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nvec2 imagecoord=mod(v_pos_a,1.0);\r\nvec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);\r\nvec4 color1=texture2D(u_image,pos);\r\nvec2 imagecoord_b=mod(v_pos_b,1.0);\r\nvec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);\r\nvec4 color2=texture2D(u_image,pos2);\r\nvec4 mixedColor=mix(color1,color2,u_fade);vec4 buildTopColor=v_lighting;\r\nif(topcolor.a!=0.0){\r\nbuildTopColor= topcolor*buildTopColor;}\r\ngl_FragColor=flag_top+0.005>=1.0? buildTopColor : (mixedColor*v_lighting);\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform vec2 u_pixel_coord_upper;\r\nuniform vec2 u_pixel_coord_lower;\r\nuniform float u_height_factor;\r\nuniform vec3 u_scale;\r\nuniform float u_vertical_gradient;\r\nuniform lowp float u_opacity;\r\nuniform vec3 u_lightcolor;\r\nuniform lowp vec3 u_lightpos;\r\nuniform lowp float u_lightintensity;\r\nattribute vec2 a_pos;\r\nattribute vec4 a_normal_ed;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\nvarying vec4 v_lighting;\r\nvarying float flag_top;\n#pragma sgmap: define lowp float base\r\n#pragma sgmap: define lowp float height\r\n#pragma sgmap: define lowp vec4 pattern_from\r\n#pragma sgmap: define lowp vec4 pattern_to\r\n#pragma sgmap: define lowp float pixel_ratio_from\r\n#pragma sgmap: define lowp float pixel_ratio_to\r\n#pragma sgmap: define highp vec4 color\r\n#pragma sgmap: define highp vec4 topcolor\r\nvoid main() {\r\n#pragma sgmap: initialize lowp float base\r\n#pragma sgmap: initialize lowp float height\r\n#pragma sgmap: initialize mediump vec4 pattern_from\r\n#pragma sgmap: initialize mediump vec4 pattern_to\r\n#pragma sgmap: initialize lowp float pixel_ratio_from\r\n#pragma sgmap: initialize lowp float pixel_ratio_to\r\n#pragma sgmap: initialize highp vec4 color\r\n#pragma sgmap: initialize highp vec4 topcolor\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nfloat tileRatio=u_scale.x;\r\nfloat fromScale=u_scale.y;\r\nfloat toScale=u_scale.z;\r\nvec3 normal=a_normal_ed.xyz;\r\nfloat edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;\r\nvec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\r\nbase=max(0.0,base);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);\r\nflag_top=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0 ?1.0 :0.0;vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\r\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=tileRatio*pos/display_size_a;\r\nv_pos_b=tileRatio*pos/display_size_b;v_lighting=vec4(0.0,0.0,0.0,1.0);vec3 ambientLightColor=u_lightcolor;\r\nfloat ambientStrength=u_lightintensity+0.39;\r\nvec3 ambient=ambientStrength*ambientLightColor;vec3 lightDir=u_lightpos;\r\nvec3 lightColor=u_lightcolor;\r\nfloat lightStrength=0.1;\r\nfloat nDotL=max(dot(normal/16384.0,lightDir),0.0);\r\nvec3 diff=lightStrength*lightColor*nDotL;\r\nv_lighting.rgb+=diff+ambient;\r\nv_lighting*=u_opacity;\r\n}","fillExtrusionPattern"),ri=_i("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform float u_maxzoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggeration=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/ pow(2.0,(u_zoom-u_maxzoom)*exaggeration+19.2562-u_zoom);gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),oi=_i("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;}"),ni=_i("uniform lowp float u_device_pixel_ratio;\r\nvarying vec2 v_width2;\r\nvarying vec2 v_normal;\r\nvarying float v_gamma_scale;\r\n#pragma sgmap: define highp vec4 color\r\n#pragma sgmap: define lowp float blur\r\n#pragma sgmap: define lowp float opacity\r\nvoid main() {\r\n#pragma sgmap: initialize highp vec4 color\r\n#pragma sgmap: initialize lowp float blur\r\n#pragma sgmap: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;\r\nfloat alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);\r\ngl_FragColor=color*(alpha*opacity);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","\n#define scale 0.015873016\r\nattribute vec2 a_pos_normal;\r\nattribute vec4 a_data;\r\nuniform mat4 u_matrix;\r\nuniform mediump vec2 u_ratio;\r\nuniform vec2 u_units_to_pixels;\r\nuniform lowp float u_device_pixel_ratio;\r\nvarying vec2 v_normal;\r\nvarying vec2 v_width2;\r\nvarying float v_gamma_scale;\r\nvarying highp float v_linesofar;\r\n#pragma sgmap: define highp vec4 color\r\n#pragma sgmap: define lowp float blur\r\n#pragma sgmap: define lowp float opacity\r\n#pragma sgmap: define mediump float gapwidth\r\n#pragma sgmap: define lowp float offset\r\n#pragma sgmap: define mediump float width\r\nvoid main() {\r\n#pragma sgmap: initialize highp vec4 color\r\n#pragma sgmap: initialize lowp float blur\r\n#pragma sgmap: initialize lowp float opacity\r\n#pragma sgmap: initialize mediump float gapwidth\r\n#pragma sgmap: initialize lowp float offset\r\n#pragma sgmap: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;\r\nvec2 a_extrude=a_data.xy-128.0;\r\nfloat a_direction=mod(a_data.z,4.0)-1.0;\r\nv_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;\r\nvec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;\r\nnormal.y=normal.y*2.0-1.0;\r\nv_normal=normal;gapwidth=gapwidth/2.0;\r\nfloat halfwidth=width/2.0;\r\noffset=-1.0*offset;\r\nfloat inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);\r\nfloat outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;\r\nmediump float t=1.0-abs(u);\r\nmediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);\r\nvec4 projected_extrude=u_matrix*vec4(dist.x/u_ratio.x,dist.y/u_ratio.y,0.0,0.0);\r\ngl_Position=u_matrix*vec4(pos.x+offset2.x/u_ratio.x,pos.y+offset2.y/u_ratio.y,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);\r\nfloat extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);\r\nv_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\r\nv_width2=vec2(outset,inset);\r\n}"),ai=_i("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp float v_lineprogress;\n#pragma sgmap: define lowp float blur\n#pragma sgmap: define lowp float opacity\nvoid main() {\n#pragma sgmap: initialize lowp float blur\n#pragma sgmap: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,vec2(v_lineprogress,0.5));gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define MAX_LINE_DISTANCE 32767.0\n#define scale 0.015873016\r\nattribute vec2 a_pos_normal;\r\nattribute vec4 a_data;\r\nuniform mat4 u_matrix;\r\nuniform mediump vec2 u_ratio;\r\nuniform lowp float u_device_pixel_ratio;\r\nuniform vec2 u_units_to_pixels;\r\nvarying vec2 v_normal;\r\nvarying vec2 v_width2;\r\nvarying float v_gamma_scale;\r\nvarying highp float v_lineprogress;\r\n#pragma sgmap: define lowp float blur\r\n#pragma sgmap: define lowp float opacity\r\n#pragma sgmap: define mediump float gapwidth\r\n#pragma sgmap: define lowp float offset\r\n#pragma sgmap: define mediump float width\r\nvoid main() {\r\n#pragma sgmap: initialize lowp float blur\r\n#pragma sgmap: initialize lowp float opacity\r\n#pragma sgmap: initialize mediump float gapwidth\r\n#pragma sgmap: initialize lowp float offset\r\n#pragma sgmap: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;\r\nvec2 a_extrude=a_data.xy-128.0;\r\nfloat a_direction=mod(a_data.z,4.0)-1.0;\r\nv_lineprogress=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0/MAX_LINE_DISTANCE;\r\nvec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;\r\nnormal.y=normal.y*2.0-1.0;\r\nv_normal=normal;gapwidth=gapwidth/2.0;\r\nfloat halfwidth=width/2.0;\r\noffset=-1.0*offset;\r\nfloat inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);\r\nfloat outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;\r\nmediump float t=1.0-abs(u);\r\nmediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);\r\nvec4 projected_extrude=u_matrix*vec4(dist.x/u_ratio.x,dist.y/u_ratio.y,0.0,0.0);\r\ngl_Position=u_matrix*vec4(pos.x+offset2.x/u_ratio.x,pos.y+offset2.y/u_ratio.y,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);\r\nfloat extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);\r\nv_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\r\nv_width2=vec2(outset,inset);\r\n}"),si=_i("uniform lowp float u_device_pixel_ratio;\r\nuniform vec2 u_texsize;\r\nuniform float u_fade;\r\nuniform mediump vec3 u_scale;\r\nuniform sampler2D u_image;\r\nuniform float u_use_color;uniform lowp float u_outline;varying vec2 v_normal;\r\nvarying vec2 v_width2;\r\nvarying float v_linesofar;\r\nvarying float v_gamma_scale;\r\nvarying float v_width;\n#pragma sgmap: define highp vec4 color\r\n#pragma sgmap: define lowp vec4 pattern_from\r\n#pragma sgmap: define lowp vec4 pattern_to\r\n#pragma sgmap: define lowp float pixel_ratio_from\r\n#pragma sgmap: define lowp float pixel_ratio_to\r\n#pragma sgmap: define lowp float blur\r\n#pragma sgmap: define lowp float opacity\r\nvoid main() {\n#pragma sgmap: initialize highp vec4 color\r\n#pragma sgmap: initialize mediump vec4 pattern_from\r\n#pragma sgmap: initialize mediump vec4 pattern_to\r\n#pragma sgmap: initialize lowp float pixel_ratio_from\r\n#pragma sgmap: initialize lowp float pixel_ratio_to\r\n#pragma sgmap: initialize lowp float blur\r\n#pragma sgmap: initialize lowp float opacity\r\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)/u_device_pixel_ratio;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/u_device_pixel_ratio;\r\nvec2 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);\r\nfloat 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;\r\nfloat alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);\r\nfloat x_a=mod(v_linesofar/pattern_size_a.x,1.0);\r\nfloat x_b=mod(v_linesofar/pattern_size_b.x,1.0);\r\nfloat y=0.5*v_normal.y+0.5;\r\nfloat y_a=0.5+(v_normal.y*clamp(v_width2.s,0.0,(pattern_size_a.y+2.0)/2.0)/pattern_size_a.y);\r\nfloat y_b=0.5+(v_normal.y*clamp(v_width2.s,0.0,(pattern_size_b.y+2.0)/2.0)/pattern_size_b.y);\r\nvec2 texel_size=1.0/u_texsize;\r\nvec2 pos_a=mix(pattern_tl_a*texel_size ,pattern_br_a*texel_size,vec2(x_a,y));\r\nvec2 pos_b=mix(pattern_tl_b*texel_size ,pattern_br_b*texel_size,vec2(x_b,y));\r\nvec4 img_color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);\r\nif(u_use_color==1.0 ){gl_FragColor= color*img_color*alpha*opacity;\r\n}else{\r\ngl_FragColor=img_color*alpha*opacity;\r\n}\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\r\nattribute vec2 a_pos_normal;\r\nattribute vec4 a_data;\r\nuniform mat4 u_matrix;\r\nuniform vec2 u_units_to_pixels;\r\nuniform mediump vec2 u_ratio;uniform lowp float u_device_pixel_ratio;\r\nvarying vec2 v_normal;\r\nvarying vec2 v_width2;\r\nvarying float v_linesofar;\r\nvarying float v_gamma_scale;\r\nvarying float v_width;\r\n#pragma sgmap: define lowp float blur\r\n#pragma sgmap: define lowp float opacity\r\n#pragma sgmap: define lowp float offset\r\n#pragma sgmap: define mediump float gapwidth\r\n#pragma sgmap: define mediump float width\r\n#pragma sgmap: define lowp float floorwidth\r\n#pragma sgmap: define lowp vec4 pattern_from\r\n#pragma sgmap: define lowp vec4 pattern_to\r\n#pragma sgmap: define lowp float pixel_ratio_from\r\n#pragma sgmap: define lowp float pixel_ratio_to\n#pragma sgmap: define highp vec4 color\r\nvoid main() {\r\n#pragma sgmap: initialize lowp float blur\r\n#pragma sgmap: initialize lowp float opacity\r\n#pragma sgmap: initialize lowp float offset\r\n#pragma sgmap: initialize mediump float gapwidth\r\n#pragma sgmap: initialize mediump float width\r\n#pragma sgmap: initialize lowp float floorwidth\r\n#pragma sgmap: initialize mediump vec4 pattern_from\r\n#pragma sgmap: initialize mediump vec4 pattern_to\r\n#pragma sgmap: initialize lowp float pixel_ratio_from\r\n#pragma sgmap: initialize lowp float pixel_ratio_to\n#pragma sgmap: initialize highp vec4 color\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;\r\nvec2 a_extrude=a_data.xy-128.0;\r\nfloat a_direction=mod(a_data.z,4.0)-1.0;\r\nfloat a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;\r\nnormal.y=normal.y*2.0-1.0;\r\nv_normal=normal;gapwidth=gapwidth/2.0;\r\nfloat halfwidth=width/2.0;\r\noffset=-1.0*offset;\r\nfloat inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);\r\nfloat outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;\r\nmediump float t=1.0-abs(u);\r\nmediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);\r\nvec4 projected_extrude=u_matrix*vec4(dist.x/u_ratio.x,dist.y/u_ratio.y,0.0,0.0);\r\ngl_Position=u_matrix*vec4(pos.x+offset2.x/u_ratio.x,pos.y+offset2.y/u_ratio.y,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);\r\nfloat extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);\r\nv_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\r\nv_linesofar=a_linesofar;\r\nv_width2=vec2(outset,inset);\r\nv_width=floorwidth;\r\n}"),ci=_i("\nuniform lowp float u_device_pixel_ratio;\r\nuniform sampler2D u_image;\r\nuniform float u_mix;\r\nuniform vec3 u_scale;\r\nvarying vec2 v_normal;\r\nvarying vec2 v_width2;\r\nvarying vec2 v_tex_a;\r\nvarying vec2 v_tex_b;\r\nvarying float v_gamma_scale;\r\n#pragma sgmap: define highp vec4 color\r\n#pragma sgmap: define lowp float blur\r\n#pragma sgmap: define lowp float opacity\r\n#pragma sgmap: define mediump float width\r\n#pragma sgmap: define lowp float floorwidth\r\n#pragma sgmap: define lowp vec4 dash_from\r\n#pragma sgmap: define lowp vec4 dash_to\r\nvoid main() {\r\n#pragma sgmap: initialize highp vec4 color\r\n#pragma sgmap: initialize lowp float blur\r\n#pragma sgmap: initialize lowp float opacity\r\n#pragma sgmap: initialize mediump float width\r\n#pragma sgmap: initialize lowp float floorwidth\r\n#pragma sgmap: initialize mediump vec4 dash_from\r\n#pragma sgmap: initialize mediump vec4 dash_to\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;\r\nfloat alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);\r\nfloat sdfdist_a=texture2D(u_image,v_tex_a).a;\r\nfloat sdfdist_b=texture2D(u_image,v_tex_b).a;\r\nfloat sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);\r\nfloat sdfwidth=min(dash_from.z*u_scale.y,dash_to.z*u_scale.z);\r\nfloat sdfgamma=1.0/(2.0*u_device_pixel_ratio)/sdfwidth;\r\nalpha*=smoothstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);\r\ngl_FragColor=color*(alpha*opacity);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","\n#define EXTRUDE_SCALE 0.015873016\r\n#define LINE_DISTANCE_SCALE 2.0\r\nattribute vec2 a_pos_normal;\r\nattribute vec4 a_data;\r\nuniform mat4 u_matrix;\r\nuniform mediump vec2 u_ratio;\r\nuniform lowp float u_device_pixel_ratio;\r\nuniform vec2 u_units_to_pixels;\r\nuniform vec2 u_texsize;\r\nuniform mediump vec3 u_scale;\r\nvarying vec2 v_normal;\r\nvarying vec2 v_width2;\r\nvarying vec2 v_tex_a;\r\nvarying vec2 v_tex_b;\r\nvarying float v_gamma_scale;\r\n#pragma sgmap: define highp vec4 color\r\n#pragma sgmap: define lowp float blur\r\n#pragma sgmap: define lowp float opacity\r\n#pragma sgmap: define mediump float gapwidth\r\n#pragma sgmap: define lowp float offset\r\n#pragma sgmap: define mediump float width\r\n#pragma sgmap: define lowp float floorwidth\r\n#pragma sgmap: define lowp vec4 dash_from\r\n#pragma sgmap: define lowp vec4 dash_to\r\nvoid main() {\r\n#pragma sgmap: initialize highp vec4 color\r\n#pragma sgmap: initialize lowp float blur\r\n#pragma sgmap: initialize lowp float opacity\r\n#pragma sgmap: initialize mediump float gapwidth\r\n#pragma sgmap: initialize lowp float offset\r\n#pragma sgmap: initialize mediump float width\r\n#pragma sgmap: initialize lowp float floorwidth\r\n#pragma sgmap: initialize mediump vec4 dash_from\r\n#pragma sgmap: initialize mediump vec4 dash_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;\r\nvec2 a_extrude=a_data.xy-128.0;\r\nfloat a_direction=mod(a_data.z,4.0)-1.0;\r\nfloat a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;\r\nvec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;\r\nnormal.y=normal.y*2.0-1.0;\r\nv_normal=normal;gapwidth=gapwidth/2.0;\r\nfloat halfwidth=width/2.0;\r\noffset=-1.0*offset;\r\nfloat inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);\r\nfloat outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*EXTRUDE_SCALE;mediump float u=0.5*a_direction;\r\nmediump float t=1.0-abs(u);\r\nmediump vec2 offset2=offset*a_extrude*EXTRUDE_SCALE*normal.y*mat2(t,-u,u,t);\r\nvec4 projected_extrude=u_matrix*vec4(dist.x/u_ratio.x,dist.y/u_ratio.y,0.0,0.0);\r\ngl_Position=u_matrix*vec4(pos.x+offset2.x/u_ratio.x,pos.y+offset2.y/u_ratio.y,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);\r\nfloat extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);\r\nv_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\r\nfloat tileZoomRatio=u_scale.x;\r\nfloat fromScale=u_scale.y;\r\nfloat toScale=u_scale.z;\r\nfloat widthA=dash_from.z*fromScale;\r\nfloat widthB=dash_to.z*toScale;\r\nfloat heightA=dash_from.y;\r\nfloat heightB=dash_to.y;\r\nv_tex_a=vec2(a_linesofar*(tileZoomRatio/widthA)/floorwidth,(-normal.y*heightA+dash_from.x+0.5)/u_texsize.y);\r\nv_tex_b=vec2(a_linesofar*(tileZoomRatio/widthB)/floorwidth,(-normal.y*heightB+dash_to.x+0.5)/u_texsize.y);\r\nv_width2=vec2(outset,inset);\r\n}"),li=_i("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;}"),ui=_i("uniform sampler2D u_texture;\r\nvarying vec2 v_tex;\r\nvarying float v_fade_opacity;\r\n#pragma sgmap: define lowp float opacity\r\nvoid main() {\r\n#pragma sgmap: initialize lowp float opacity\r\nlowp float alpha=opacity*v_fade_opacity;\r\ngl_FragColor=texture2D(u_texture,v_tex)*alpha*zoom_opacity;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","const float PI=3.141592653589793;\r\nattribute vec4 a_pos_offset;\r\nattribute vec4 a_data;\r\nattribute vec4 a_pixeloffset;\r\nattribute vec3 a_projected_pos;\r\nattribute float a_fade_opacity;\r\nuniform bool u_is_size_zoom_constant;\r\nuniform bool u_is_size_feature_constant;\r\nuniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;\r\nuniform highp float u_pitch;\r\nuniform bool u_rotate_symbol;\r\nuniform highp float u_aspect_ratio;\r\nuniform float u_fade_change;\r\nuniform mat4 u_matrix;\r\nuniform mat4 u_label_plane_matrix;\r\nuniform mat4 u_coord_matrix;\r\nuniform bool u_is_text;\r\nuniform bool u_pitch_with_map;\r\nuniform vec2 u_texsize;\r\nvarying vec2 v_tex;\r\nvarying float v_fade_opacity;\r\n#pragma sgmap: define lowp float opacity\r\nvoid main() {\r\n#pragma sgmap: initialize lowp float opacity\r\nvec2 a_pos=a_pos_offset.xy;\r\nvec2 a_offset=a_pos_offset.zw;\r\nvec2 a_tex=a_data.xy;\r\nvec2 a_size=a_data.zw;\r\nfloat a_size_min=floor(a_size[0]*0.5);\r\nvec2 a_pxoffset=a_pixeloffset.xy;\r\nvec2 a_minFontScale=a_pixeloffset.zw/256.0;\r\nhighp float segment_angle=-a_projected_pos[2];\r\nfloat size;\r\nif (!u_is_size_zoom_constant && !u_is_size_feature_constant) {\r\nsize=mix(a_size_min,a_size[1],u_size_t)/128.0;\r\n} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {\r\nsize=a_size_min/128.0;\r\n} else {\r\nsize=u_size;\r\n}\r\nvec4 projectedPoint=u_matrix*vec4(a_pos,0,1);\r\nhighp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\r\ncamera_to_anchor_distance/u_camera_to_center_distance :\r\nu_camera_to_center_distance/camera_to_anchor_distance;\r\nhighp float perspective_ratio=clamp(\r\n0.5+0.5*distance_ratio,0.0,4.0);\r\nsize*=perspective_ratio;\r\nfloat fontScale=u_is_text ? size/24.0 : size;\r\nhighp float symbol_rotation=0.0;\r\nif (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);\r\nvec2 a=projectedPoint.xy/projectedPoint.w;\r\nvec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;\r\nsymbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);\r\n}\r\nhighp float angle_sin=sin(segment_angle+symbol_rotation);\r\nhighp float angle_cos=cos(segment_angle+symbol_rotation);\r\nmat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);\r\nvec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);\r\ngl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);\r\nv_tex=a_tex/u_texsize;\r\nvec2 fade_opacity=unpack_opacity(a_fade_opacity);\r\nfloat fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;\r\nv_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));\r\n}","symbolIcon"),hi=_i("#define SDF_PX 8.0\r\nuniform bool u_is_halo;\r\nuniform sampler2D u_texture;\r\nuniform highp float u_gamma_scale;\r\nuniform lowp float u_device_pixel_ratio;\r\nuniform bool u_is_text;\r\nuniform highp float u_scale_ratio;varying vec2 v_data0;\r\nvarying vec3 v_data1;\r\nvarying float v_scaleable;\n#pragma sgmap: define highp vec4 fill_color\r\n#pragma sgmap: define highp vec4 halo_color\r\n#pragma sgmap: define lowp float opacity\r\n#pragma sgmap: define lowp float halo_width\r\n#pragma sgmap: define lowp float halo_blur\r\nvoid main() {\r\n#pragma sgmap: initialize highp vec4 fill_color\r\n#pragma sgmap: initialize highp vec4 halo_color\r\n#pragma sgmap: initialize lowp float opacity\r\n#pragma sgmap: initialize lowp float halo_width\r\n#pragma sgmap: initialize lowp float halo_blur\r\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;\r\nvec2 tex=v_data0.xy;\r\nfloat gamma_scale=v_data1.x;\r\nfloat size=v_data1.y;\r\nfloat fade_opacity=v_data1[2];\r\nfloat fontScale=u_is_text ? size/24.0*(v_scaleable==0.0?u_scale_ratio:1.0): size;\r\nlowp vec4 color=fill_color;\r\nhighp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);\r\nlowp float buff=(256.0-64.0)/256.0;\r\nif (u_is_halo) {\r\ncolor=halo_color;\r\ngamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);\r\nbuff=(6.0-halo_width/fontScale)/SDF_PX;\r\n}\r\nlowp float dist=texture2D(u_texture,tex).a;\r\nhighp float gamma_scaled=gamma*gamma_scale;\r\nhighp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);\r\ngl_FragColor=color*(alpha*opacity*fade_opacity*zoom_opacity);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","const float PI=3.141592653589793;\r\nattribute vec4 a_pos_offset;\r\nattribute vec4 a_data;\r\nattribute vec4 a_pixeloffset;\r\nattribute vec3 a_projected_pos;\r\nattribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;\r\nuniform bool u_is_size_feature_constant;\r\nuniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;\r\nuniform mat4 u_label_plane_matrix;\r\nuniform mat4 u_coord_matrix;\r\nuniform bool u_is_text;\r\nuniform bool u_pitch_with_map;\r\nuniform highp float u_pitch;\r\nuniform bool u_rotate_symbol;\r\nuniform highp float u_aspect_ratio;\r\nuniform highp float u_camera_to_center_distance;\r\nuniform float u_fade_change;\r\nuniform vec2 u_texsize;\r\nuniform highp float u_scale_ratio;varying vec2 v_data0;\r\nvarying vec3 v_data1;\r\nvarying float v_scaleable;\n#pragma sgmap: define highp vec4 fill_color\r\n#pragma sgmap: define highp vec4 halo_color\r\n#pragma sgmap: define lowp float opacity\r\n#pragma sgmap: define lowp float halo_width\r\n#pragma sgmap: define lowp float halo_blur\r\nvoid main() {\r\n#pragma sgmap: initialize highp vec4 fill_color\r\n#pragma sgmap: initialize highp vec4 halo_color\r\n#pragma sgmap: initialize lowp float opacity\r\n#pragma sgmap: initialize lowp float halo_width\r\n#pragma sgmap: initialize lowp float halo_blur\r\nvec2 a_pos=a_pos_offset.xy;\r\nvec2 a_offset=a_pos_offset.zw;\r\nvec2 a_tex=a_data.xy;\r\nvec2 a_size=a_data.zw;\r\nfloat a_size_min=floor(a_size[0]*0.5);\r\nvec2 a_pxoffset=a_pixeloffset.xy;\r\nhighp float segment_angle=-a_projected_pos[2];\r\nfloat a_scaleable=1.0;\r\nif(a_projected_pos[2]+100.0<=0.0){\r\na_scaleable=0.0;\r\nsegment_angle=a_projected_pos[2]+100.0;\r\n}\r\nfloat size;\r\nif (!u_is_size_zoom_constant && !u_is_size_feature_constant) {\r\nsize=mix(a_size_min,a_size[1],u_size_t)/128.0;\r\n} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {\r\nsize=a_size_min/128.0;\r\n} else {\r\nsize=u_size;\r\n}\r\nvec4 projectedPoint=u_matrix*vec4(a_pos,0,1);\r\nhighp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\r\ncamera_to_anchor_distance/u_camera_to_center_distance :\r\nu_camera_to_center_distance/camera_to_anchor_distance;\r\nhighp float perspective_ratio=clamp(\r\n0.5+0.5*distance_ratio,0.0,4.0);\r\nsize*=perspective_ratio;\r\nfloat fontScale=u_is_text ? size/24.0*(a_scaleable==0.0?u_scale_ratio:1.0) : size;\r\nv_scaleable=a_scaleable;highp float symbol_rotation=0.0;\r\nif (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);\r\nvec2 a=projectedPoint.xy/projectedPoint.w;\r\nvec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;\r\nsymbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);\r\n}\r\nhighp float angle_sin=sin(segment_angle+symbol_rotation);\r\nhighp float angle_cos=cos(segment_angle+symbol_rotation);\r\nmat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);\r\nvec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);\r\ngl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);\r\nfloat gamma_scale=gl_Position.w;\r\nvec2 fade_opacity=unpack_opacity(a_fade_opacity);\r\nfloat fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;\r\nfloat interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));\r\nv_data0=a_tex/u_texsize;\r\nv_data1=vec3(gamma_scale,size,interpolated_fade_opacity);\r\n}","symbolSDF"),pi=_i("#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 sgmap: define highp vec4 fill_color\n#pragma sgmap: define highp vec4 halo_color\n#pragma sgmap: define lowp float opacity\n#pragma sgmap: define lowp float halo_width\n#pragma sgmap: define lowp float halo_blur\nvoid main() {\n#pragma sgmap: initialize highp vec4 fill_color\n#pragma sgmap: initialize highp vec4 halo_color\n#pragma sgmap: initialize lowp float opacity\n#pragma sgmap: initialize lowp float halo_width\n#pragma sgmap: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;\n#pragma sgmap: define highp vec4 fill_color\n#pragma sgmap: define highp vec4 halo_color\n#pragma sgmap: define lowp float opacity\n#pragma sgmap: define lowp float halo_width\n#pragma sgmap: define lowp float halo_blur\nvoid main() {\n#pragma sgmap: initialize highp vec4 fill_color\n#pragma sgmap: initialize highp vec4 halo_color\n#pragma sgmap: initialize lowp float opacity\n#pragma sgmap: initialize lowp float halo_width\n#pragma sgmap: 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);}","symbolTextAndIcon"),fi=_i("uniform lowp float u_device_pixel_ratio;\r\nvarying vec3 v_data;\r\nvarying vec3 v_normal;\r\nvarying float v_gap;\r\nvarying vec4 v_ecolor;\r\n#pragma sgmap: define highp vec4 color\r\n#pragma sgmap: define lowp float blur\r\n#pragma sgmap: define lowp float opacity\r\nvoid main() {\r\n#pragma sgmap: initialize highp vec4 color\r\n#pragma sgmap: initialize lowp float blur\r\n#pragma sgmap: initialize lowp float opacity\r\nfloat extrude_length=length(v_normal);float gap=v_gap;float antiblur;\r\nif(v_gap==0.0 || 1.0-extrude_length>=gap){\r\nantiblur=1.0;\r\n}else{antiblur=smoothstep(0.0,gap,1.0-extrude_length);\r\n}\r\ngl_FragColor=v_ecolor*(opacity*zoom_opacity)*antiblur;\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","\n#define scale 0.015873016\r\nconst float PI=3.141592653589793;\r\nattribute vec2 a_pos;\r\nattribute vec2 a_eoffset;attribute vec4 a_normal;attribute float a_ecolor;attribute float a_erotate;attribute float a_esize;uniform vec2 u_units_to_pixels;\r\nuniform mat4 u_label_plane_matrix;\r\nuniform mat4 u_coord_matrix;\r\nuniform lowp float u_device_pixel_ratio;\r\nuniform highp float u_scale_ratio;varying vec3 v_normal;\r\nvarying float v_gap;varying vec4 v_ecolor;\r\n#pragma sgmap: define highp vec4 color\r\n#pragma sgmap: define lowp float blur\r\n#pragma sgmap: define lowp float opacity\r\n#pragma sgmap: define mediump float gapwidth\r\n#pragma sgmap: define lowp float offset\r\n#pragma sgmap: define mediump float width\r\nvoid main() {\r\n#pragma sgmap: initialize highp vec4 color\r\n#pragma sgmap: initialize lowp float blur\r\n#pragma sgmap: initialize lowp float opacity\r\n#pragma sgmap: initialize mediump float gapwidth\r\n#pragma sgmap: initialize lowp float offset\r\n#pragma sgmap: initialize mediump float width\r\nfloat symbol_size=abs(a_esize);\r\nfloat scale_ratio=1.0;if(a_esize>=0.0){\r\nscale_ratio=u_scale_ratio;\r\n}\r\nfloat ANTIALIASING=1.3/u_device_pixel_ratio;\r\nhighp float angle_sin=sin((a_erotate/180.0)*PI);\r\nhighp float angle_cos=cos((a_erotate/180.0)*PI);\r\nmat2 rotation_matrix=mat2(angle_cos,angle_sin,-1.0*angle_sin,angle_cos);\r\nvec3 normal=normalize(vec3(a_normal));vec4 projected_pos=u_label_plane_matrix*vec4(a_pos.xy,0.0,1.0);\r\nvec4 geoPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_eoffset*scale_ratio*symbol_size),0.0,1.0);\r\nvec4 new_vect=u_coord_matrix*vec4(rotation_matrix*(a_normal.xy*scale_ratio*symbol_size),0.0,0.0);\r\nfloat halp=length(new_vect.xy);vec2 blurNormal=new_vect.xy/length( new_vect.xy/geoPos.w*u_units_to_pixels)*ANTIALIASING;float blurLength=length(blurNormal.xy);v_gap=blurLength/(halp+blurLength);v_normal=normal;\r\nif(a_normal.x==0.0 && a_normal.y==0.0){v_gap=0.0;\r\nblurNormal=vec2(0.0,0.0);\r\n}\r\nif(a_ecolor>=0.0){\r\nv_ecolor=color;\r\n}else{\r\nfloat staticColor=a_ecolor;if(a_ecolor==-0.1){\r\nstaticColor=0.0;\r\n}float color_b=mod(0.0-staticColor,256.0);\r\nfloat color_g=mod(0.0-staticColor-color_b,256.0*256.0)/256.0;\r\nfloat color_r=(0.0-staticColor-color_b-color_g*256.0)/(256.0*256.0);\r\nv_ecolor=vec4( color_r/256.0,color_g/256.0,color_b/256.0,1.0);\r\n}\r\ngl_Position=geoPos+vec4(blurNormal.xy,0.0,0.0);\r\n}","eleSymbol");function di(t,e,i){if(!i)return t;var r=t.indexOf("#pragma sgmap: define"),o=(t=t.slice(0,r=r>=0?r:0)+"\n #pragma sgmap: define lowp float minzoom\n #pragma sgmap: define lowp float maxzoom\n uniform lowp float u_featureZoom;\n "+t.slice(r)).indexOf("#pragma sgmap: initialize");if(o<0&&(o=t.indexOf("void main() {")+"void main() {".length),t=t.slice(0,o)+"\n #pragma sgmap: initialize lowp float minzoom\n #pragma sgmap: initialize lowp float maxzoom\n "+t.slice(o),"fragment"==e){var n="#pragma sgmap: initialize lowp float opacity",a=t.indexOf(n);a<0&&(a=t.indexOf(n="#pragma sgmap: initialize lowp float maxzoom"));var s="fill"==i?"(maxzoom+1.0)":"maxzoom";t=t.slice(0,a+=n.length)+"\n float feature_maxzoom = (maxzoom>=19.0)? 25.0: (maxzoom>minzoom?"+s+":(minzoom+1.0));\n float feature_minzoom = (minzoom<=3.0)? 0.0: (minzoom-1.0);\n float zoom_opacity= 1.0;\n #ifndef HAS_UNIFORM_u_opacity\n if(u_featureZoom+0.005<feature_minzoom || u_featureZoom+0.005>feature_maxzoom){\n zoom_opacity=0.0;\n }else{\n zoom_opacity=1.0;\n }\n #else\n if(u_featureZoom+0.005<feature_minzoom || u_featureZoom+0.005>feature_maxzoom){\n opacity=0.0;\n zoom_opacity=0.0;\n }else{\n zoom_opacity=1.0;\n }\n #endif"+t.slice(a);}return t}function _i(t,e,i){var r=/#pragma sgmap: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,o={};return t=di(t,"fragment",i),e=di(e,"vertex",i),{fragmentSource:t=t.replace(r,(function(t,e,i,r,n){return o[n]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+n+"\nvarying "+i+" "+r+" "+n+";\n#else\nuniform "+i+" "+r+" u_"+n+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+n+"\n "+i+" "+r+" "+n+" = u_"+n+";\n#endif\n"})),vertexSource:e=e.replace(r,(function(t,e,i,r,n){var a="float"===r?"vec2":"vec4",s=n.match(/color/)?"color":a;return o[n]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+n+"\nuniform lowp float u_"+n+"_t;\nattribute "+i+" "+a+" a_"+n+";\nvarying "+i+" "+r+" "+n+";\n#else\nuniform "+i+" "+r+" u_"+n+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+n+"\n "+n+" = a_"+n+";\n#else\n "+i+" "+r+" "+n+" = u_"+n+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+n+"\n "+n+" = unpack_mix_"+s+"(a_"+n+", u_"+n+"_t);\n#else\n "+i+" "+r+" "+n+" = u_"+n+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+n+"\nuniform lowp float u_"+n+"_t;\nattribute "+i+" "+a+" a_"+n+";\n#else\nuniform "+i+" "+r+" u_"+n+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+n+"\n "+i+" "+r+" "+n+" = a_"+n+";\n#else\n "+i+" "+r+" "+n+" = u_"+n+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+n+"\n "+i+" "+r+" "+n+" = unpack_mix_"+s+"(a_"+n+", u_"+n+"_t);\n#else\n "+i+" "+r+" "+n+" = u_"+n+";\n#endif\n"}))}}var mi=Object.freeze({__proto__:null,prelude:je,background:Ve,backgroundPattern:qe,circle:Ze,clippingMask:Ge,heatmap:He,heatmapTexture:We,collisionBox:Xe,collisionCircle:Ke,debug:Ye,fill:Je,fillOutline:Qe,fillOutlinePattern:$e,fillPattern:ti,fillExtrusion:ei,fillExtrusionPattern:ii,hillshadePrepare:ri,hillshade:oi,line:ni,lineGradient:ai,linePattern:si,lineSDF:ci,raster:li,symbolIcon:ui,symbolSDF:hi,symbolTextAndIcon:pi,eleSymbol:fi}),gi=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null;};gi.prototype.bind=function(t,e,i,r,o,n,a,s){this.context=t;for(var c=this.boundPaintVertexBuffers.length!==r.length,l=0;!c&&l<r.length;l++)this.boundPaintVertexBuffers[l]!==r[l]&&(c=!0);t.extVertexArrayObject&&this.vao&&this.boundProgram===e&&this.boundLayoutVertexBuffer===i&&!c&&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,i,r,o,n,a,s);},gi.prototype.freshBind=function(t,e,i,r,o,n,a){var s,c=t.numAttributes,l=this.context,u=l.gl;if(l.extVertexArrayObject)this.vao&&this.destroy(),this.vao=l.extVertexArrayObject.createVertexArrayOES(),l.bindVertexArrayOES.set(this.vao),s=0,this.boundProgram=t,this.boundLayoutVertexBuffer=e,this.boundPaintVertexBuffers=i,this.boundIndexBuffer=r,this.boundVertexOffset=o,this.boundDynamicVertexBuffer=n,this.boundDynamicVertexBuffer2=a;else {s=l.currentNumAttributes||0;for(var h=c;h<s;h++)u.disableVertexAttribArray(h);}e.enableAttributes(u,t);for(var p=0,f=i;p<f.length;p+=1)f[p].enableAttributes(u,t);n&&n.enableAttributes(u,t),a&&a.enableAttributes(u,t),e.bind(),e.setVertexAttribPointers(u,t,o);for(var d=0,_=i;d<_.length;d+=1){var m=_[d];m.bind(),m.setVertexAttribPointers(u,t,o);}n&&(n.bind(),n.setVertexAttribPointers(u,t,o)),r&&r.bind(),a&&(a.bind(),a.setVertexAttribPointers(u,t,o)),l.currentNumAttributes=c;},gi.prototype.destroy=function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null);};var vi=function(t,e,i,r,o){var n=t.gl;this.program=n.createProgram();var a=i?i.defines():[];o&&a.push("#define OVERDRAW_INSPECTOR;");var s=a.concat(je.fragmentSource,e.fragmentSource).join("\n"),c=a.concat(je.vertexSource,e.vertexSource).join("\n"),l=n.createShader(n.FRAGMENT_SHADER);if(n.isContextLost())this.failedToCreate=!0;else {n.shaderSource(l,s),n.compileShader(l),n.attachShader(this.program,l);var u=n.createShader(n.VERTEX_SHADER);if(n.isContextLost())this.failedToCreate=!0;else {n.shaderSource(u,c),n.compileShader(u),n.attachShader(this.program,u);for(var h=i?i.layoutAttributes:[],p=0;p<h.length;p++)n.bindAttribLocation(this.program,p,h[p].name);n.linkProgram(this.program),n.deleteShader(u),n.deleteShader(l),this.numAttributes=n.getProgramParameter(this.program,n.ACTIVE_ATTRIBUTES),this.attributes={};for(var f={},d=0;d<this.numAttributes;d++){var _=n.getActiveAttrib(this.program,d);_&&(this.attributes[_.name]=n.getAttribLocation(this.program,_.name));}for(var m=n.getProgramParameter(this.program,n.ACTIVE_UNIFORMS),g=0;g<m;g++){var v=n.getActiveUniform(this.program,g);v&&(f[v.name]=n.getUniformLocation(this.program,v.name));}this.fixedUniforms=r(t,f),this.binderUniforms=i?i.getUniforms(t,f):[];}}};vi.prototype.draw=function(t,e,i,r,o,n,a,s,c,l,u,h,p,f,d,_){var m,g=t.gl;if(!this.failedToCreate){for(var v in t.program.set(this.program),t.setDepthMode(i),t.setStencilMode(r),t.setColorMode(o),t.setCullFace(n),this.fixedUniforms)this.fixedUniforms[v].set(a[v]);f&&f.setUniforms(t,this.binderUniforms,h,{zoom:p});for(var y=(m={},m[g.LINES]=2,m[g.TRIANGLES]=3,m[g.LINE_STRIP]=1,m)[e],b=0,w=u.get();b<w.length;b+=1){var x=w[b],T=x.vaos||(x.vaos={});(T[s]||(T[s]=new gi)).bind(t,this,c,f?f.getPaintVertexBuffers():[],l,x.vertexOffset,d,_),g.drawElements(e,x.primitiveLength*y,g.UNSIGNED_SHORT,x.primitiveOffset*y*2);}}};var yi=function(e,i,r,o){var n=i.style.light,a=n.properties.get("position"),s=[a.x,a.y,a.z],c=t.create$1();"viewport"===n.properties.get("anchor")&&t.fromRotation(c,-i.transform.angle),t.transformMat3(s,s,c);var l=n.properties.get("color");return {u_matrix:e,u_lightpos:s,u_lightintensity:n.properties.get("intensity"),u_lightcolor:[l.r,l.g,l.b],u_vertical_gradient:+r,u_opacity:o,u_featureZoom:i.transform.zoom}},bi=function(e,i,r,o,n,a,s){return t.extend(yi(e,i,r,o),wi(a,i,s),{u_height_factor:-Math.pow(2,n.overscaledZ)/s.tileSize/8})},wi=function(t,e,i){var r=1/y(i,1,18),o=Math.pow(2,i.tileID.overscaledZ),n=i.tileSize*Math.pow(2,e.transform.tileZoom)/o,a=n*(i.tileID.canonical.x+i.tileID.wrap*o),s=n*i.tileID.canonical.y;return {u_image:0,u_texsize:i.imageAtlasTexture.size,u_scale:[r,t.fromScale,t.toScale],u_fade:t.t,u_pixel_coord_upper:[a>>16,s>>16],u_pixel_coord_lower:[65535&a,65535&s]}},xi=function(t,e){return {u_matrix:t,u_featureZoom:e.transform.zoom}},Ti=function(e,i,r,o){return t.extend(xi(e,i),function(t,e,i){var r=1/y(i,1,e.transform.tileZoom),o=Math.pow(2,i.tileID.overscaledZ),n=i.tileSize*Math.pow(2,e.transform.tileZoom)/o,a=n*(i.tileID.canonical.x+i.tileID.wrap*o),s=n*i.tileID.canonical.y;return {u_image:0,u_texsize:i.imageAtlasTexture.size,u_scale:[r,t.fromScale,t.toScale],u_fade:t.t,u_pixel_coord_upper:[a>>16,s>>16],u_pixel_coord_lower:[65535&a,65535&s]}}(r,i,o))},Si=function(t,e,i){return {u_matrix:t,u_world:e,u_featureZoom:i.transform.zoom}},Ei=function(e,i,r,o,n){return t.extend(Ti(e,i,r,o),{u_world:n})},Ai=function(e,i,r,o){var n,a,s=e.transform;if("map"===o.paint.get("circle-pitch-alignment")){var c=y(r,1,s.zoom,"xy");n=!0,a=[c[0],c[1]];}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(i.posMatrix,r,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,u_featureZoom:e.transform.zoom}},ki=function(t,e,i){var r=y(i,1,e.zoom),o=Math.pow(2,e.zoom-i.tileID.overscaledZ),n=i.tileID.overscaleFactor();return {u_matrix:t,u_camera_to_center_distance:e.cameraToCenterDistance,u_pixels_to_tile_units:r,u_extrude_scale:[e.pixelsToGLUnits[0]/(r*o),e.pixelsToGLUnits[1]/(r*o)],u_overscale_factor:n}},Ii=function(t,e,i){return {u_matrix:t,u_inv_matrix:e,u_camera_to_center_distance:i.cameraToCenterDistance,u_viewport_size:[i.width,i.height]}},Bi=function(t,e,i){return void 0===i&&(i=1),{u_matrix:t,u_color:e,u_overlay:0,u_overlay_scale:i}},Pi=function(t){return {u_matrix:t}},Ci=function(t,e,i,r){return {u_matrix:t,u_extrude_scale:y(e,1,i),u_intensity:r,u_featureZoom:i}},zi=function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_ratio:new t.Uniform2f(e,i.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,i.u_units_to_pixels),u_featureZoom:new t.Uniform1f(e,i.u_featureZoom)}},Di=function(e,i,r,o){var n=e.transform;return {u_matrix:Ui(e,i,r),u_ratio:Fi(i,e.transform),u_device_pixel_ratio:t.browser.devicePixelRatio,u_units_to_pixels:[1/n.pixelsToGLUnits[0],1/n.pixelsToGLUnits[1]],u_featureZoom:e.transform.zoom}},Mi=function(e,i,r,o){return t.extend(Di(e,i,r),{u_image:0})},Ri=function(e,i,r,o,n,a){var s=e.transform,c=Oi(i,s);return {u_matrix:Ui(e,i,r),u_texsize:i.imageAtlasTexture.size,u_ratio:Fi(i,e.transform),u_device_pixel_ratio:t.browser.devicePixelRatio,u_image:0,u_scale:[c,o.fromScale,o.toScale],u_fade:o.t,u_units_to_pixels:[1/s.pixelsToGLUnits[0],1/s.pixelsToGLUnits[1]],u_use_color:n||"eline"==r.type&&r.paint&&r.paint._values.hasOwnProperty("line-color")?1:0,u_featureZoom:e.transform.zoom,u_outline:a||0}},Li=function(e,i,r,o,n,a){var s=e.transform,c=Oi(i,e.transform);return {u_matrix:Ui(e,i,r),u_ratio:Fi(i,e.transform),u_device_pixel_ratio:t.browser.devicePixelRatio,u_units_to_pixels:[1/s.pixelsToGLUnits[0],1/s.pixelsToGLUnits[1]],u_image:0,u_mix:n.t,u_featureZoom:e.transform.zoom,u_texsize:i.lineAtlasTexture.size,u_scale:[c,n.fromScale,n.toScale]}};function Oi(t,e){return 1/y(t,1,e.tileZoom)}function Fi(t,e){var i=y(t,1,e.zoom,"xy");return [1/i[0],1/i[1]]}function Ui(t,e,i){return t.translatePosMatrix(e.tileID.posMatrix,e,i.paint.get("line-translate"),i.paint.get("line-translate-anchor"))}var Ni=function(t,e,i,r,o){return {u_matrix:t,u_tl_parent:e,u_scale_parent:i,u_buffer_scale:1,u_fade_t:r.mix,u_opacity:r.opacity*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:ji(o.paint.get("raster-hue-rotate"))};var n,a;};function ji(t){t*=Math.PI/180;var e=Math.sin(t),i=Math.cos(t);return [(2*i+1)/3,(-Math.sqrt(3)*e-i+1)/3,(Math.sqrt(3)*e-i+1)/3]}var Vi,qi=function(t,e,i,r,o,n,a,s,c,l,u){var h=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:h.cameraToCenterDistance,u_pitch:h.pitch/360*2*Math.PI,u_rotate_symbol:+i,u_aspect_ratio:h.width/h.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:+c,u_pitch_with_map:+r,u_texsize:l,u_texture:0,u_scale_ratio:u||1,u_featureZoom:o.transform.zoom}},Zi=function(e,i,r,o,n,a,s,c,l,u,h,p){var f=n.transform;return t.extend(qi(e,i,r,o,n,a,s,c,l,u,p),{u_gamma_scale:o?Math.cos(f._pitch)*f.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:+h})},Gi=function(e,i,r,o,n,a,s,c,l,u,h){return t.extend(Zi(e,i,r,o,n,a,s,c,!0,l,!0,h),{u_texsize_icon:u,u_texture_icon:1})},Hi=function(t,e,i){return {u_matrix:t,u_opacity:e,u_color:i}},Wi=function(e,i,r,o,n,a){return t.extend(function(t,e,i,r){var o=i.imageManager.getPattern(t.from.toString()),n=i.imageManager.getPattern(t.to.toString()),a=i.imageManager.getPixelSize(),s=a.width,c=a.height,l=Math.pow(2,r.tileID.overscaledZ),u=r.tileSize*Math.pow(2,i.transform.tileZoom)/l,h=u*(r.tileID.canonical.x+r.tileID.wrap*l),p=u*r.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,c],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/y(r,1,i.transform.tileZoom),u_pixel_coord_upper:[h>>16,p>>16],u_pixel_coord_lower:[65535&h,65535&p]}}(o,a,r,n),{u_matrix:e,u_opacity:i})},Xi=function(e,i,r,o,n,a,s){var c,l,u=e.transform;if("map"===o.paint.get("esymbol-pitch-alignment")){var h=y(r,1,u.zoom,"xy");c=!0,l=[h[0],h[1]];}else c=!1,l=u.pixelsToGLUnits;return {u_camera_to_center_distance:u.cameraToCenterDistance,u_scale_with_map:+("map"===o.paint.get("esymbol-pitch-scale")),u_matrix:e.translatePosMatrix(i.posMatrix,r,o.paint.get("esymbol-translate"),o.paint.get("esymbol-translate-anchor")),u_pitch_with_map:+c,u_device_pixel_ratio:t.browser.devicePixelRatio,u_extrude_scale:l,u_label_plane_matrix:n,u_coord_matrix:a,u_scale_ratio:s||1,u_units_to_pixels:[1/u.pixelsToGLUnits[0],1/u.pixelsToGLUnits[1]],u_featureZoom:e.transform.zoom}},Ki={fillExtrusion:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_lightpos:new t.Uniform3f(e,i.u_lightpos),u_lightintensity:new t.Uniform1f(e,i.u_lightintensity),u_lightcolor:new t.Uniform3f(e,i.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,i.u_vertical_gradient),u_opacity:new t.Uniform1f(e,i.u_opacity),u_featureZoom:new t.Uniform1f(e,i.u_featureZoom)}},fillExtrusionPattern:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_lightpos:new t.Uniform3f(e,i.u_lightpos),u_lightintensity:new t.Uniform1f(e,i.u_lightintensity),u_lightcolor:new t.Uniform3f(e,i.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,i.u_vertical_gradient),u_height_factor:new t.Uniform1f(e,i.u_height_factor),u_image:new t.Uniform1i(e,i.u_image),u_texsize:new t.Uniform2f(e,i.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,i.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,i.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,i.u_scale),u_fade:new t.Uniform1f(e,i.u_fade),u_opacity:new t.Uniform1f(e,i.u_opacity),u_featureZoom:new t.Uniform1f(e,i.u_featureZoom)}},fill:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_featureZoom:new t.Uniform1f(e,i.u_featureZoom)}},fillPattern:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_image:new t.Uniform1i(e,i.u_image),u_texsize:new t.Uniform2f(e,i.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,i.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,i.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,i.u_scale),u_fade:new t.Uniform1f(e,i.u_fade),u_featureZoom:new t.Uniform1f(e,i.u_featureZoom)}},fillOutline:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_world:new t.Uniform2f(e,i.u_world),u_featureZoom:new t.Uniform1f(e,i.u_featureZoom)}},fillOutlinePattern:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_world:new t.Uniform2f(e,i.u_world),u_image:new t.Uniform1i(e,i.u_image),u_texsize:new t.Uniform2f(e,i.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,i.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,i.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,i.u_scale),u_fade:new t.Uniform1f(e,i.u_fade),u_featureZoom:new t.Uniform1f(e,i.u_featureZoom)}},circle:function(e,i){return {u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(e,i.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(e,i.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(e,i.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_featureZoom:new t.Uniform1f(e,i.u_featureZoom)}},collisionBox:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_pixels_to_tile_units:new t.Uniform1f(e,i.u_pixels_to_tile_units),u_extrude_scale:new t.Uniform2f(e,i.u_extrude_scale),u_overscale_factor:new t.Uniform1f(e,i.u_overscale_factor)}},collisionCircle:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_inv_matrix:new t.UniformMatrix4f(e,i.u_inv_matrix),u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_viewport_size:new t.Uniform2f(e,i.u_viewport_size)}},debug:function(e,i){return {u_color:new t.UniformColor(e,i.u_color),u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_overlay:new t.Uniform1i(e,i.u_overlay),u_overlay_scale:new t.Uniform1f(e,i.u_overlay_scale)}},clippingMask:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix)}},heatmap:function(e,i){return {u_extrude_scale:new t.Uniform1f(e,i.u_extrude_scale),u_intensity:new t.Uniform1f(e,i.u_intensity),u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_featureZoom:new t.Uniform1f(e,i.u_featureZoom)}},heatmapTexture:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_world:new t.Uniform2f(e,i.u_world),u_image:new t.Uniform1i(e,i.u_image),u_color_ramp:new t.Uniform1i(e,i.u_color_ramp),u_opacity:new t.Uniform1f(e,i.u_opacity),u_featureZoom:new t.Uniform1f(e,i.u_featureZoom)}},hillshade:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_image:new t.Uniform1i(e,i.u_image),u_latrange:new t.Uniform2f(e,i.u_latrange),u_light:new t.Uniform2f(e,i.u_light),u_shadow:new t.UniformColor(e,i.u_shadow),u_highlight:new t.UniformColor(e,i.u_highlight),u_accent:new t.UniformColor(e,i.u_accent)}},hillshadePrepare:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_image:new t.Uniform1i(e,i.u_image),u_dimension:new t.Uniform2f(e,i.u_dimension),u_zoom:new t.Uniform1f(e,i.u_zoom),u_maxzoom:new t.Uniform1f(e,i.u_maxzoom),u_unpack:new t.Uniform4f(e,i.u_unpack),u_featureZoom:new t.Uniform1f(e,i.u_featureZoom)}},line:zi,lineGradient:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_ratio:new t.Uniform2f(e,i.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,i.u_units_to_pixels),u_image:new t.Uniform1i(e,i.u_image),u_featureZoom:new t.Uniform1f(e,i.u_featureZoom)}},linePattern:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_texsize:new t.Uniform2f(e,i.u_texsize),u_ratio:new t.Uniform2f(e,i.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_image:new t.Uniform1i(e,i.u_image),u_units_to_pixels:new t.Uniform2f(e,i.u_units_to_pixels),u_scale:new t.Uniform3f(e,i.u_scale),u_fade:new t.Uniform1f(e,i.u_fade),u_use_color:new t.Uniform1f(e,i.u_use_color),u_featureZoom:new t.Uniform1f(e,i.u_featureZoom),u_outline:new t.Uniform1f(e,i.u_outline)}},lineSDF:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_ratio:new t.Uniform2f(e,i.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,i.u_units_to_pixels),u_image:new t.Uniform1i(e,i.u_image),u_mix:new t.Uniform1f(e,i.u_mix),u_featureZoom:new t.Uniform1f(e,i.u_featureZoom),u_texsize:new t.Uniform2f(e,i.u_texsize),u_scale:new t.Uniform3f(e,i.u_scale)}},raster:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_tl_parent:new t.Uniform2f(e,i.u_tl_parent),u_scale_parent:new t.Uniform1f(e,i.u_scale_parent),u_buffer_scale:new t.Uniform1f(e,i.u_buffer_scale),u_fade_t:new t.Uniform1f(e,i.u_fade_t),u_opacity:new t.Uniform1f(e,i.u_opacity),u_image0:new t.Uniform1i(e,i.u_image0),u_image1:new t.Uniform1i(e,i.u_image1),u_brightness_low:new t.Uniform1f(e,i.u_brightness_low),u_brightness_high:new t.Uniform1f(e,i.u_brightness_high),u_saturation_factor:new t.Uniform1f(e,i.u_saturation_factor),u_contrast_factor:new t.Uniform1f(e,i.u_contrast_factor),u_spin_weights:new t.Uniform3f(e,i.u_spin_weights)}},symbolIcon:function(e,i){return {u_is_size_zoom_constant:new t.Uniform1i(e,i.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,i.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,i.u_size_t),u_size:new t.Uniform1f(e,i.u_size),u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,i.u_pitch),u_rotate_symbol:new t.Uniform1i(e,i.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,i.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,i.u_fade_change),u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,i.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,i.u_coord_matrix),u_is_text:new t.Uniform1i(e,i.u_is_text),u_pitch_with_map:new t.Uniform1i(e,i.u_pitch_with_map),u_texsize:new t.Uniform2f(e,i.u_texsize),u_texture:new t.Uniform1i(e,i.u_texture),u_scale_ratio:new t.Uniform1f(e,i.u_scale_ratio),u_featureZoom:new t.Uniform1f(e,i.u_featureZoom)}},symbolSDF:function(e,i){return {u_is_size_zoom_constant:new t.Uniform1i(e,i.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,i.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,i.u_size_t),u_size:new t.Uniform1f(e,i.u_size),u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,i.u_pitch),u_rotate_symbol:new t.Uniform1i(e,i.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,i.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,i.u_fade_change),u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,i.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,i.u_coord_matrix),u_is_text:new t.Uniform1i(e,i.u_is_text),u_pitch_with_map:new t.Uniform1i(e,i.u_pitch_with_map),u_texsize:new t.Uniform2f(e,i.u_texsize),u_texture:new t.Uniform1i(e,i.u_texture),u_gamma_scale:new t.Uniform1f(e,i.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,i.u_is_halo),u_scale_ratio:new t.Uniform1f(e,i.u_scale_ratio),u_featureZoom:new t.Uniform1f(e,i.u_featureZoom)}},symbolTextAndIcon:function(e,i){return {u_is_size_zoom_constant:new t.Uniform1i(e,i.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,i.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,i.u_size_t),u_size:new t.Uniform1f(e,i.u_size),u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,i.u_pitch),u_rotate_symbol:new t.Uniform1i(e,i.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,i.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,i.u_fade_change),u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,i.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,i.u_coord_matrix),u_is_text:new t.Uniform1i(e,i.u_is_text),u_pitch_with_map:new t.Uniform1i(e,i.u_pitch_with_map),u_texsize:new t.Uniform2f(e,i.u_texsize),u_texsize_icon:new t.Uniform2f(e,i.u_texsize_icon),u_texture:new t.Uniform1i(e,i.u_texture),u_texture_icon:new t.Uniform1i(e,i.u_texture_icon),u_gamma_scale:new t.Uniform1f(e,i.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,i.u_is_halo),u_scale_ratio:new t.Uniform1f(e,i.u_scale_ratio),u_featureZoom:new t.Uniform1f(e,i.u_featureZoom)}},background:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_opacity:new t.Uniform1f(e,i.u_opacity),u_color:new t.UniformColor(e,i.u_color)}},backgroundPattern:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_opacity:new t.Uniform1f(e,i.u_opacity),u_image:new t.Uniform1i(e,i.u_image),u_pattern_tl_a:new t.Uniform2f(e,i.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(e,i.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(e,i.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(e,i.u_pattern_br_b),u_texsize:new t.Uniform2f(e,i.u_texsize),u_mix:new t.Uniform1f(e,i.u_mix),u_pattern_size_a:new t.Uniform2f(e,i.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(e,i.u_pattern_size_b),u_scale_a:new t.Uniform1f(e,i.u_scale_a),u_scale_b:new t.Uniform1f(e,i.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(e,i.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,i.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(e,i.u_tile_units_to_pixels)}},eleSymbol:function(e,i){return {u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(e,i.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(e,i.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(e,i.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,i.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,i.u_coord_matrix),u_scale_ratio:new t.Uniform1f(e,i.u_scale_ratio),u_units_to_pixels:new t.Uniform2f(e,i.u_units_to_pixels),u_featureZoom:new t.Uniform1f(e,i.u_featureZoom)}},outline:zi};function Yi(e,i,r,o,n,a,s){for(var c=e.context,l=c.gl,u=e.useProgram("collisionBox"),h=[],p=0,f=0,d=0;d<o.length;d++){var _=o[d],m=i.getTile(_),g=m.getBucket(r);if(g){var v=_.posMatrix;0===n[0]&&0===n[1]||(v=e.translatePosMatrix(_.posMatrix,m,n,a));var y=s?g.textCollisionBox:g.iconCollisionBox,b=g.collisionCircleArray;if(b.length>0){var w=t.create(),x=v;t.mul(w,g.placementInvProjMatrix,e.transform.glCoordMatrix),t.mul(w,w,g.placementViewportMatrix),h.push({circleArray:b,circleOffset:f,transform:x,invTransform:w}),f=p+=b.length/4;}y&&u.draw(c,l.LINES,Et.disabled,At.disabled,e.colorModeForRenderPass(),It.disabled,ki(v,e.transform,m),r.id,y.layoutVertexBuffer,y.indexBuffer,y.segments,null,e.transform.zoom,null,null,y.collisionVertexBuffer);}}if(s&&h.length){var T=e.useProgram("collisionCircle"),S=new t.StructArrayLayout2f1f2i16;S.resize(4*p),S._trim();for(var E=0,A=0,k=h;A<k.length;A+=1)for(var I=k[A],B=0;B<I.circleArray.length/4;B++){var P=4*B,C=I.circleArray[P+0],z=I.circleArray[P+1],D=I.circleArray[P+2],M=I.circleArray[P+3];S.emplace(E++,C,z,D,M,0),S.emplace(E++,C,z,D,M,1),S.emplace(E++,C,z,D,M,2),S.emplace(E++,C,z,D,M,3);}(!Vi||Vi.length<2*p)&&(Vi=function(e){var i=2*e,r=new t.StructArrayLayout3ui6;r.resize(i),r._trim();for(var o=0;o<i;o++){var n=6*o;r.uint16[n+0]=4*o+0,r.uint16[n+1]=4*o+1,r.uint16[n+2]=4*o+2,r.uint16[n+3]=4*o+2,r.uint16[n+4]=4*o+3,r.uint16[n+5]=4*o+0;}return r}(p));for(var R=c.createIndexBuffer(Vi,!0),L=c.createVertexBuffer(S,t.collisionCircleLayout.members,!0),O=0,F=h;O<F.length;O+=1){var U=F[O],N=Ii(U.transform,U.invTransform,e.transform);T.draw(c,l.TRIANGLES,Et.disabled,At.disabled,e.colorModeForRenderPass(),It.disabled,N,r.id,L,R,t.SegmentVector.simpleSegment(0,2*U.circleOffset,U.circleArray.length,U.circleArray.length/2),null,e.transform.zoom,null,null,null);}L.destroy(),R.destroy();}}var Ji=t.identity(new Float32Array(16));function Qi(e,i,r,o,n,a){var s=t.getAnchorAlignment(e),c=-(s.horizontalAlign-.5)*i,l=-(s.verticalAlign-.5)*r,u=t.evaluateVariableOffset(e,o);return new t.Point((c/n+u[0])*a,(l/n+u[1])*a)}function $i(e,i,r,o,n,a,s,c,l,u,h){var p=e.text.placedSymbolArray,f=e.text.dynamicLayoutVertexArray,d=e.icon.dynamicLayoutVertexArray,_={};f.clear();for(var m=0;m<p.length;m++){var g=p.get(m),v=g.hidden||!g.crossTileID||e.allowVerticalPlacement&&!g.placedOrientation?null:o[g.crossTileID];if(v){var y=new t.Point(g.anchorX,g.anchorY),b=Yt(y,r?c:s),w=Jt(a.cameraToCenterDistance,b.signedDistanceFromCamera),x=n.evaluateSizeForFeature(e.textSizeData,u,g)*w/t.ONE_EM;r&&(x*=e.tilePixelRatio/l);for(var T=Qi(v.anchor,v.width,v.height,v.textOffset,v.textBoxScale,x),S=r?Yt(y.add(T),s).point:b.point.add(i?T.rotate(-a.angle):T),E=e.allowVerticalPlacement&&g.placedOrientation===t.WritingMode.vertical?Math.PI/2:0,A=0;A<g.numGlyphs;A++)t.addDynamicAttributes(f,S,E);h&&g.associatedIconIndex>=0&&(_[g.associatedIconIndex]={shiftedAnchor:S,angle:E});}else ae(g.numGlyphs,f);}if(h){d.clear();for(var k=e.icon.placedSymbolArray,I=0;I<k.length;I++){var B=k.get(I);if(B.hidden)ae(B.numGlyphs,d);else {var P=_[I];if(P)for(var C=0;C<B.numGlyphs;C++)t.addDynamicAttributes(d,P.shiftedAnchor,P.angle);else ae(B.numGlyphs,d);}}e.icon.dynamicLayoutVertexBuffer.updateData(d);}e.text.dynamicLayoutVertexBuffer.updateData(f);}function tr(t,e,i){return i.iconsInText&&e?"symbolTextAndIcon":t?"symbolSDF":"symbolIcon"}function er(e,i,r,o,n,a,s,c,l,u,h,p){for(var f=e.context,d=f.gl,_=e.transform,m="map"===c,g="map"===l,v=m&&"point"!==r.layout.get("symbol-placement"),b=m&&!g&&!v,w=void 0!==r.layout.get("symbol-sort-key").constantOr(1),x=e.depthModeForSublayer(0,Et.ReadOnly),T=r.layout.get("text-variable-anchor"),S=[],E=0,A=o;E<A.length;E+=1){var k=A[E],I=i.getTile(k),B=I.getBucket(r);if(B){var P=n?B.text:B.icon;if(P&&P.segments.get().length){var C=P.programConfigurations.get(r.id),z=n||B.sdfIcons,D=n?B.textSizeData:B.iconSizeData,M=g||0!==_.pitch,R=e.useProgram(tr(z,n,B),C),L=t.evaluateSizeForZoom(D,_.zoom),O=void 0,F=[0,0],U=void 0,N=void 0,j=null,V=void 0;if(n)U=I.glyphAtlasTexture,N=d.LINEAR,O=I.glyphAtlasTexture.size,B.iconsInText&&(F=I.imageAtlasTexture.size,j=I.imageAtlasTexture,V=M||e.options.rotating||e.options.zooming||"composite"===D.kind||"camera"===D.kind?d.LINEAR:d.NEAREST);else {var q=1!==r.layout.get("icon-size").constantOr(0)||B.iconsNeedLinear;U=I.imageAtlasTexture,N=z||e.options.rotating||e.options.zooming||q||M?d.LINEAR:d.NEAREST,O=I.imageAtlasTexture.size;}var Z=y(I,1,e.transform.zoom,"xy"),G=Xt(k.posMatrix,g,m,e.transform,Z),H=Kt(k.posMatrix,g,m,e.transform,Z),W=T&&B.hasTextData(),X="none"!==r.layout.get("icon-text-fit")&&W&&B.hasIconData();v&&$t(B,k.posMatrix,e,n,G,H,g,u);var K=e.translatePosMatrix(k.posMatrix,I,a,s),Y=v||n&&T||X?Ji:G,J=e.translatePosMatrix(H,I,a,s,!0),Q=z&&0!==r.paint.get(n?"text-halo-width":"icon-halo-width").constantOr(1),$=1;if(0!=r.layout.get("symbol-scaleable").constantOr(0)&&B.collisionArrays){n&&e.transform.zoom>18&&($=Math.pow(2,e.transform.zoom-19));var tt=I.latestFeatureIndex.loadVTLayers()._geojsonTileLayer;if(tt&&1!=$)for(var et=0;et<tt.length;++et)if(r.layout.get("symbol-scaleable").evaluate(tt.feature(et),{}))for(var it=0;it<B.collisionArrays.length;it++){var rt=B.collisionArrays[it];rt.textBox&&(rt.oldBox||(rt.oldBox=JSON.parse(JSON.stringify(rt.textBox))),rt.textBox.x1=rt.oldBox.x1*$,rt.textBox.y1=rt.oldBox.y1*$,rt.textBox.x2=rt.oldBox.x2*$,rt.textBox.y2=rt.oldBox.y2*$);}}var ot={program:R,buffers:P,uniformValues:z?B.iconsInText?Gi(D.kind,L,b,g,e,K,Y,J,O,F,$):Zi(D.kind,L,b,g,e,K,Y,J,n,O,!0,$):qi(D.kind,L,b,g,e,K,Y,J,n,O,$),atlasTexture:U,atlasTextureIcon:j,atlasInterpolation:N,atlasInterpolationIcon:V,isSDF:z,hasHalo:Q,coord:k};if(w)for(var nt=0,at=P.segments.get();nt<at.length;nt+=1){var st=at[nt];S.push({segments:new t.SegmentVector([st]),sortKey:st.sortKey,state:ot});}else S.push({segments:P.segments,sortKey:0,state:ot});}}}w&&S.sort((function(t,e){return t.sortKey-e.sortKey}));for(var ct=0,lt=S;ct<lt.length;ct+=1){var ut=lt[ct],ht=ut.state;if(f.activeTexture.set(d.TEXTURE0),ht.atlasTexture.bind(ht.atlasInterpolation,d.CLAMP_TO_EDGE),ht.atlasTextureIcon&&(f.activeTexture.set(d.TEXTURE1),ht.atlasTextureIcon&&ht.atlasTextureIcon.bind(ht.atlasInterpolationIcon,d.CLAMP_TO_EDGE)),ht.isSDF){var pt=ht.uniformValues;ht.hasHalo&&(pt.u_is_halo=1,ir(ht.buffers,ut.segments,r,e,ht.program,x,0,p,pt,ht.coord)),pt.u_is_halo=0;}ir(ht.buffers,ut.segments,r,e,ht.program,x,0,p,ht.uniformValues,ht.coord);}}function ir(t,e,i,r,o,n,a,s,c,l){var u=r.context,h=u.gl;r.beforeDrawMask(i,l),o.draw(u,h.TRIANGLES,n,r.eleSymbolstencilModel(i),s,It.disabled,c,i.id,t.layoutVertexBuffer,t.indexBuffer,e,i.paint,r.transform.zoom,t.programConfigurations.get(i.id),t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer);}function rr(t,e,i,r){if("translucent"===t.renderPass){var o=i.paint.get("line-opacity"),n=i.paint.get("line-width"),a=i.paint.get("line-outline-width");if(0!==o.constantOr(1)&&(0!==n.constantOr(1)||0!=a.constantOr(1))){var s=t.depthModeForSublayer(0,Et.ReadOnly),c=t.colorModeForRenderPass();0!==a.constantOr(1)&&or(t,e,i,r,s,c,!0),0!==n.constantOr(1)&&0!==o.constantOr(1)&&or(t,e,i,r,s,c,!1);}}}function or(e,i,r,o,n,a,s){var c=r.paint.get(s?"line-outline-dasharray":"line-dasharray"),l=c.constantOr(1),u=r.layout.get("line-cap"),h=r.paint.get(s?"line-outline-pattern":"line-pattern"),p=r.paint.get("line-pattern-color"),f=h.constantOr(1),d=r.paint.get("line-gradient"),_=r.getCrossfadeParameters(),m=f?"linePattern":l?"lineSDF":d?"lineGradient":"line",g=e.context,v=g.gl;if(d){g.activeTexture.set(v.TEXTURE0);var y=r.gradientTexture;if(!r.gradient)return;y||(y=r.gradientTexture=new t.Texture(g,r.gradient,v.RGBA)),y.bind(v.LINEAR,v.CLAMP_TO_EDGE);}for(var b=0,w=o;b<w.length;b+=1){var x=w[b],T=i.getTile(x);if(!f||T.patternsLoaded()){var S=T.getBucket(r);if(S){var E=s?S.programConfigurations_outline.get(r.id):S.programConfigurations.get(r.id),A=(e.context.program.get(),e.useProgram(m,E)),k=h.constantOr(null);if(k&&T.imageAtlas){var I=T.imageAtlas,B=I.patternPositions[k.to.toString()],P=I.patternPositions[k.from.toString()];B&&P&&E.setConstantPatternPositions(B,P);}var C=c.constantOr(null),z=u.constantOr(null);if(!f&&C&&z&&T.lineAtlas){var D=T.lineAtlas,M=D.getDash(C.to,z),R=D.getDash(C.from,z);M&&R&&E.setConstantPatternPositions(M,R);}var L=f?Ri(e,T,r,_,p,s?1:0):l?Li(e,T,r,0,_):d?Mi(e,T,r):Di(e,T,r);f?(g.activeTexture.set(v.TEXTURE0),T.imageAtlasTexture.bind(v.LINEAR,v.CLAMP_TO_EDGE),E.updatePaintBuffers(_)):l&&(g.activeTexture.set(v.TEXTURE0),T.lineAtlasTexture.bind(v.LINEAR,v.REPEAT),E.updatePaintBuffers(_)),e.beforeDrawMask(r,x),A.draw(g,v.TRIANGLES,n,e.stencilModeForClipping(x,r),a,It.disabled,L,r.id,S.layoutVertexBuffer,S.indexBuffer,S.segments,r.paint,e.transform.zoom,E);}}}}function nr(t,e,i,r,o,n,a){var s,c,l,u,h,p=t.context.gl,f=i.paint.get("fill-pattern"),d=f&&f.constantOr(1),_=i.getCrossfadeParameters();a?(c=d&&!i.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",s=p.LINES):(c=d?"fillPattern":"fill",s=p.TRIANGLES);for(var m=0,g=r;m<g.length;m+=1){var v=g[m],y=e.getTile(v);if(!d||y.patternsLoaded()){var b=y.getBucket(i);if(b){var w=b.programConfigurations.get(i.id),x=t.useProgram(c,w);d&&(t.context.activeTexture.set(p.TEXTURE0),y.imageAtlasTexture.bind(p.LINEAR,p.CLAMP_TO_EDGE),w.updatePaintBuffers(_));var T=f.constantOr(null);if(T&&y.imageAtlas){var S=y.imageAtlas,E=S.patternPositions[T.to.toString()],A=S.patternPositions[T.from.toString()];E&&A&&w.setConstantPatternPositions(E,A);}var k=t.translatePosMatrix(v.posMatrix,y,i.paint.get("fill-translate"),i.paint.get("fill-translate-anchor"));if(a){u=b.indexBuffer2,h=b.segments2;var I=[p.drawingBufferWidth,p.drawingBufferHeight];l="fillOutlinePattern"===c&&d?Ei(k,t,_,y,I):Si(k,I,t);}else u=b.indexBuffer,h=b.segments,l=d?Ti(k,t,_,y):xi(k,t);t.beforeDrawMask(i,v),x.draw(t.context,s,o,t.stencilModeForClipping(v,i),n,It.disabled,l,i.id,b.layoutVertexBuffer,u,h,i.paint,t.transform.zoom,w);}}}}function ar(t,e,i,r,o,n,a){for(var s=t.context,c=s.gl,l=i.paint.get("fill-extrusion-pattern"),u=l.constantOr(1),h=i.getCrossfadeParameters(),p=i.paint.get("fill-extrusion-opacity"),f=0,d=r;f<d.length;f+=1){var _=d[f],m=e.getTile(_),g=m.getBucket(i);if(g){var v=g.programConfigurations.get(i.id),y=t.useProgram(u?"fillExtrusionPattern":"fillExtrusion",v);u&&(t.context.activeTexture.set(c.TEXTURE0),m.imageAtlasTexture.bind(c.LINEAR,c.CLAMP_TO_EDGE),v.updatePaintBuffers(h));var b=l.constantOr(null);if(b&&m.imageAtlas){var w=m.imageAtlas,x=w.patternPositions[b.to.toString()],T=w.patternPositions[b.from.toString()];x&&T&&v.setConstantPatternPositions(x,T);}var S=t.translatePosMatrix(_.posMatrix,m,i.paint.get("fill-extrusion-translate"),i.paint.get("fill-extrusion-translate-anchor")),E=i.paint.get("fill-extrusion-vertical-gradient"),A=u?bi(S,t,E,p,_,h,m):yi(S,t,E,p);y.draw(s,s.gl.TRIANGLES,o,n,a,It.backCCW,A,i.id,g.layoutVertexBuffer,g.indexBuffer,g.segments,i.paint,t.transform.zoom,v);}}}function sr(e,i,r,o,n,a){var s=e.context,c=s.gl,l=i.fbo;if(l){var u=e.useProgram("hillshade");s.activeTexture.set(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,l.colorAttachment.get());var h=function(e,i,r){var o=r.paint.get("hillshade-shadow-color"),n=r.paint.get("hillshade-highlight-color"),a=r.paint.get("hillshade-accent-color"),s=r.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===r.paint.get("hillshade-illumination-anchor")&&(s-=e.transform.angle);var c,l,u,h=!e.options.moving;return {u_matrix:e.transform.calculatePosMatrix(i.tileID.toUnwrapped(),h),u_image:0,u_latrange:(c=i.tileID,l=Math.pow(2,c.canonical.z),u=c.canonical.y,[new t.config.parse.Coordinate(0,u/l).toLngLat().lat,new t.config.parse.Coordinate(0,(u+1)/l).toLngLat().lat]),u_light:[r.paint.get("hillshade-exaggeration"),s],u_shadow:o,u_highlight:n,u_accent:a}}(e,i,r);u.draw(s,c.TRIANGLES,o,n,a,It.disabled,h,r.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments);}}function cr(e,i,r,o,n,a,s){var c=e.context,l=c.gl,u=i.dem;if(u&&u.data){var h=u.dim,p=u.stride,f=u.getPixels();if(c.activeTexture.set(l.TEXTURE1),c.pixelStoreUnpackPremultiplyAlpha.set(!1),i.demTexture=i.demTexture||e.getTileTexture(p),i.demTexture){var d=i.demTexture;d.update(f,{premultiply:!1}),d.bind(l.NEAREST,l.CLAMP_TO_EDGE);}else i.demTexture=new t.Texture(c,f,l.RGBA,{premultiply:!1}),i.demTexture.bind(l.NEAREST,l.CLAMP_TO_EDGE);c.activeTexture.set(l.TEXTURE0);var _=i.fbo;if(!_){var m=new t.Texture(c,{width:h,height:h,data:null},l.RGBA);m.bind(l.LINEAR,l.CLAMP_TO_EDGE),(_=i.fbo=c.createFramebuffer(h,h,!0)).colorAttachment.set(m.texture);}c.bindFramebuffer.set(_.framebuffer),c.viewport.set([0,0,h,h]),e.useProgram("hillshadePrepare").draw(c,l.TRIANGLES,n,a,s,It.disabled,function(e,i,r){var o=i.stride,n=t.create();return t.ortho(n,0,t.EXTENT,-t.EXTENT,0,0,1),t.translate(n,n,[0,-t.EXTENT,0]),{u_matrix:n,u_image:1,u_dimension:[o,o],u_zoom:e.overscaledZ,u_maxzoom:r,u_unpack:i.getUnpackVector(),u_featureZoom:e.overscaledZ}}(i.tileID,u,o),r.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments),i.needsHillshadePrepare=!1;}}function lr(e,i,r,o,n){var a=o.paint.get("raster-fade-duration");if(a>0){var s=t.browser.now(),c=(s-e.timeAdded)/a,l=i?(s-i.timeAdded)/a:-1,u=r.getSource(),h=n.coveringZoomLevel({tileSize:u.tileSize,roundZoom:u.roundZoom}),p=!i||Math.abs(i.tileID.overscaledZ-h)>Math.abs(e.tileID.overscaledZ-h),f=p&&e.refreshedUponExpiration?1:t.clamp(p?c:1-l,0,1);return e.refreshedUponExpiration&&c>=1&&(e.refreshedUponExpiration=!1),i?{opacity:1,mix:1-f}:{opacity:f,mix:0}}return {opacity:1,mix:0}}var ur=new t.Color(1,0,0,1),hr=new t.Color(0,1,0,1),pr=new t.Color(0,0,1,1),fr=new t.Color(1,0,1,1),dr=new t.Color(0,1,1,1);function _r(t,e,i,r){gr(t,0,e+i/2,t.transform.width,i,r);}function mr(t,e,i,r){gr(t,e-i/2,0,i,t.transform.height,r);}function gr(e,i,r,o,n,a){var s=e.context,c=s.gl;c.enable(c.SCISSOR_TEST),c.scissor(i*t.browser.devicePixelRatio,r*t.browser.devicePixelRatio,o*t.browser.devicePixelRatio,n*t.browser.devicePixelRatio),s.clear({color:a}),c.disable(c.SCISSOR_TEST);}function vr(e,i,r){var o=e.context,n=o.gl,a=r.posMatrix,s=e.useProgram("debug"),c=Et.disabled,l=At.disabled,u=e.colorModeForRenderPass();e.beforeDrawMask({type:"debug"},r),o.activeTexture.set(n.TEXTURE0),e.emptyTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE),s.draw(o,n.LINE_STRIP,c,l,u,It.disabled,Bi(a,t.Color.red),"$debug",e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments);var h=i.getTileByID(r.key).latestRawTileData,p=Math.floor((h&&h.byteLength||0)/1024),f=i.getTile(r).tileSize,d=512/Math.min(f,512)*(r.overscaledZ/e.transform.zoom)*.5;"Sg4326"==r.reference&&(d=1);var _=r.canonical.toString();r.overscaledZ!==r.canonical.z&&(_+=" => "+r.overscaledZ),function(t,e){t.initDebugOverlayCanvas();var i=t.debugOverlayCanvas,r=t.context.gl,o=t.debugOverlayCanvas.getContext("2d");o.clearRect(0,0,i.width,i.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(i),t.debugOverlayTexture.bind(r.LINEAR,r.CLAMP_TO_EDGE);}(e,_+" "+p+"kb"),s.draw(o,n.TRIANGLES,c,l,kt.alphaBlended,It.disabled,Bi(a,t.Color.transparent,d),"$debug",e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments);}var yr=function(t){this.id="LogoWebglLayer"+(new Date).getTime(),this.type="custom",this.renderingMode="2d",this.radio=t.devicePixelRatio,this.logoWidth=64,this.logoHeight=22,this.logoLeft=4,this.logoBottom=2,this.context=t.context,this.updateSize(t);};yr.prototype.updateSize=function(t){this.width=t.width,this.height=t.height;var e=t.logoSize?parseInt(t.logoSize)>20?t.logoSize:20:"";e&&(this.logoWidth=e*(this.logoWidth/this.logoHeight),this.logoHeight=e);},yr.prototype.onAdd=function(e,i){this.num=4;var r=i.createShader(i.VERTEX_SHADER);i.shaderSource(r,"\n uniform mat4 u_Matrix;\n attribute vec4 a_Position;\n attribute vec2 a_TexCoord;\n varying vec2 v_TexCoord;\n void main(){\n gl_Position = u_Matrix*a_Position;\n v_TexCoord = a_TexCoord;\n }"),i.compileShader(r);var o=i.createShader(i.FRAGMENT_SHADER);i.shaderSource(o,"\n precision mediump float;\n uniform sampler2D u_Sampler;\n varying vec2 v_TexCoord;\n void main(){\n gl_FragColor = texture2D(u_Sampler,v_TexCoord);\n }"),i.compileShader(o),this.program=i.createProgram(),i.attachShader(this.program,r),i.attachShader(this.program,o),i.linkProgram(this.program),this.vertexSizeBuffer=i.createBuffer(),this.a_Position=i.getAttribLocation(this.program,"a_Position"),this.a_TexCoord=i.getAttribLocation(this.program,"a_TexCoord"),this.u_Matrix=i.getUniformLocation(this.program,"u_Matrix");var n=this.logoLeft*this.radio,a=(this.logoLeft+this.logoWidth)*this.radio,s=(this.logoHeight+this.logoBottom)*this.radio,c=this.logoBottom*this.radio,l=new Float32Array([n,s,0,0,n,c,0,1,a,s,1,0,a,c,1,1]);i.bindBuffer(i.ARRAY_BUFFER,this.vertexSizeBuffer),i.bufferData(i.ARRAY_BUFFER,l,i.STATIC_DRAW),this.fsize=l.BYTES_PER_ELEMENT;var u=new Image;if(u.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPoAAABTCAYAAAC2/xobAAAACXBIWXMAAC4jAAAuIwF4pT92AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAFcVJREFUeNrsXW+MVcUVHxRbQWG3YqHWwK6JEayFfZBGUwX2kUrSJiqblEYNpi71Q0lL0/ULppjGp40m7hfXio1+sC6JRpqmcUETTbTJLqyY2oTddduKiU13MbSFWPoWGpFiur2/uzO7c8+dmTv3vbn3vgfzS25g35/77p05f37nzJlz501PTzMPD48LG5f4IfDw8Iru4eHhFd3Dw8MruoeHh1d0Dw8Pr+geHh5e0T08PLyie3h4eEX38PCK7uHh4RXdw8OjuTDfD4FHg6EUHK38/4N+OJpP0TGBXcFR5hPZUcD9TgbHRHCMciEacHju9uCo8Hts4a9N8d/p80KbCIxdd3C0kdf38vcmMvjNVi6X7fwoGhPkcIZ5OexeK/OJ6mxA4Zrk19Zf53m6uTK3GD7zdHD0pPBmWQhQEd5ZGPZRfkwolG0wwfBP8fOMOlLubn50sMbFJJdLyFW17rNB0TM8+qabAwPB0VrjPZZT/E6P4vvtwdEfHNWM77HKf6c14zkXYzKhuY5Bfs/is4Mprr+9zuvqyWGcs5i3nnrnJKuJhjCNNtmAjtaoBBMpf0cW1q4CBA+/V7K8t26iiBPcWJQTvmN7Dd0pr72/Dpnsn25u1OOMMqPuiH23aDnJJ2fZsX+dzZ0LtSyYz9asWGz6yBiniNUU1HQkwjE/Pc9eeud48O/nbNtt17K2qxfQ7zzI6ViJU9aWAmjhFP/9CcN99SdQW1UoEhsPi3xJLKR7Yv9H7Meb21jLwsuU4WYN94t7uf8CyGOM8TFuiBgdsc+LKuXGBL42coKdPvt5oaN1x9qlgSC1sw0rr6o1lhbA556SX7hnzxH2+sjJ8P+LA8Py9z230+/s5wm7wYLzFnv5XKli2AlLA/Qoz3FYGXgb/PCFcfby4eNsxZIFbN/OtSrDvElKbJalRGhVSrTSJN8jqt+CLI4fO8MOfniqYTR5YyCTq1csYneuXVZPricXRZ+gmVMMKCawaAWneO4Hq9l9gddV4DqDtysToxbxFF/d+XbkPt/YdTM1KGNc+F6lJ37/2OlZI+ESG1ZdpTJqU5rEX1rvJ4/VtOqenjjwEXs+GGuNh57FoUDhvtP73uzf64NrfjMYPwUTaEtgCj3c6MAA/E11TffsGSmEVdoChu75B1brnNGmtKs4rpfXYssjGNRGVHJgx6/Hw38Vyl5ReLsKFyCjp7O4zw6dkn87EPJMxukAY0/esypkMXIkw2kg9YD3q65tKrguCJ8iFOnhR9l0T/gXSpuk7BZos3j/Vc5YWK7j7BAwQjB6GmdUUY13noreRV/Yte9obFBBaUFNFEKjBejVsESxYO03qq2dEtUgdoa3pFZ81ysfBNeylApgOeXyT92A18tS+JAz0NB03X3Pxsu4NjFvH/R20rHSxowYb3FP4x+fYe8Hx4YUc1YnYLA+o/mTZlByKp8YM6IrnZytTBSl6GU6sMMk/vnR7W3s4S3Xp7fsgcDJ54KS7w7Okwa9994YJsqEJxceWCGAbdJAVlgO6637dq6bjU+zAOi7JsxKNLAJYyUMRncD6snl8h+Ye6rkyNcgaWqIiXMDQtzXj5yM5LHw78vBdStkvcxS1H+4VvQIrYVQUE9ek5I7BGgQJlw2GoeOnlIJr+C5P83r2hCT3bd+hqa9NHw8ovTbbr129r0k5nLvnmjiG+xHcX+TzE0RTTun/21Zj49YrcE9IokmG6I1yxclytb7x87ExgUG1uZ307DPWgFjExqcF1hk7nGPu9XjXhh1jyZXjp6KKVmRSi6ApRtZ0TUDqQxFBJ2iRsxEvVT33LpwvjJBJRSSjh0EzYb2gmpTPKxmPhULKu8iZrZWYsTPqnga/ybRbcwnwhMYS62if3w6Jo/6UOd8MHdHwwQhjMvxZ76Vm+xCPmVFH3awKpDrppbWBlDylNcRiz/T0utxg0FwmKCaFc49b03YevN+Sbn7WLRGPzPDLwyY8MQmJcbraYR8MiGLTufCpOjPvjUZ86p50fuEWo/GV/QmRGuSV6jXi1UDL+RK0SGcVGnAGgze3HnRDhjFwdC7no8plkjqNTpUBvPYJ2ebWpC9opuB2DNSAAIPDE88bknddRAFIa5iP5VwIq5XnH+Me/N210r+bPD7WSkzxmtFcC8IedYsn/F4SDDK6+6u8Pj++ArIQ/uOhodL7L7relMFoFf0HIGii0hVFSbl3cpt2i9c+cCbkb8VBTPW3l4GqqXMuYD4MqZmVaJH8upOqbpmCS8Ri3lpMmUBq5cvchra2OJXb0/m8jswippipuZWdGS7ay03pNSpnnNBoFJ49CFWQKkqjTdNeQUYBZo3wDKmhi1AwX/OFIUx8MhUWWPjPnw8ligUwgrvhHnRVZwJhiGW+mgBDq2Mg4K3NEhep9mRq6JDAFyVHbo8VwKQpPq3SrkQj/beuyqVMCKZh3VSrOmbkkFp42LqIR/W1xjAaL2hOocN7VYmIg8w9ucnO0Ol/UtvZ5hgw5hg/Vc+J5YHcyyYqRmoRoPBcir7io1cWMPPazw8dU9GbCebXEYJL6TZfBEDviOyyFh2c6HoKm++c3N7kvG5gr5Q78YOCLHwzllkjfPEfWEBzdLAIJ9UVaXVxGTlIi0RlmgSpV7RGwVyaScEHH/bCPcwqTJLE6qgIETJEIgAwZuDQqcFvmOzXq0ChLYZPHUa1iUbz4TdjolsizKlInIPuSo6soxpy1Z1A1bPuWgs2IigNE8lFIdI/b+I5e/eE98SDg9lKljCGvHG3qtihUBgHnKCDJtjZKNmsce/6UDzIzDkOJBTgEG0KfxCHghGmO5GLCrB6D16E+NZspxmyl3AIEC4TOEC3qdeiwoklPpC8t4qIL+hcgQYV7HMJkqSVWMBAwxWoIrJbbbrZgHf1z0Z5dw9CqHt8CRKxVyQTmBottxDDSjvKzvXhoqpA6g9jMHXdg3x1YrzM148UHC8TpUcqyCoq9co+Zj36BchqJCs0CSD4FFELbYNNEml3wXHd/2ox0MZHGGy853j2mVD2csjP6Lako36e0P5LDoOYRm3wyu6h9bzYDlLBznLH35evVV1K5vrud9Vg8ChU00/m1mdeORCG2MYR+SCcGBZFGXGuvp7quTYZwCqnpC138LqbL9VOHVvWRi1I43Smyu2M2xJuuWTqn3BjZPra11Ymz2mAqnI3A/xf+FRKqyGXmT8u/je4MXg5ZFIA623QdhGa/9HsV15RSBTj04TFRA83HTRWVpaE67xdPoJJJnppPLUeoHMLbLfKLKxNhZEyZHtVcSHo8zDWmlB31VdinQIm0YcnukrgPHHEp2im1FTKvqYTP2g0DRuQVM+2yUK13iJx1qUYmnWqK09lOvtt6odcqi/xnjaFtm8duSE0eimvceLDUisgYGCXSUpN2QcRUpV3upbVYuAJUoUzezibdSgA3k6PNeKPkhjPAyAvP4tJy/qAc7pYqcU4ijFgA8VKWRVzeYQeHUYJRsBoeu3GtbiFV0CEm/IoIOx2eyDFwou70AT7cpoF6OivbzrGL2PvoAkxurlixpyYsOMqLoMsV/6f3sRNFFHBcGIkjbl4PvUAymyvmBfVa/eTGKbR0LmlKTkcA6oh0fP/t2K9lVgXYjlUf+PZTXImQrCy9+4ayi2pNroio7gN9ZmFzeNG24kYLKw3dSwX7swRTeVoUKBadmrKkSRoVkPHvCqPQd4clOPATgrVAVCeSHPNiEUZAseHgYBhkHn8DDfquKnRqbuwhtGtkDC4uGGQVNeHzkRNumbLKB5vmhaAME30N/EzDO1+CuWuGscSL05hAPXLNdeg5Yjm6srAaa0/Q71Gq5XdOKFsUVXhIOYU+Q1EPK4oNY4Pw7ML5bo6BOLDmW8IpWFoldMFo48RKARkZrOuuwQOqmoccdWWCToZI+ja1oAAZJpO2ijwvugs4LPuJNxhuHcxscKcwovC3YE5cRYw+DWO9dwMCig6f10Vbg7Do6v1g0zRSo6tLhTleRI2rstngZie8OIU5E00Tw9xOgxoSTwchr61U28eilPgRsnLYnRvx5jhlwCffjA3c8ciYUf8BYJsTnNQTQtXO8Zl402SluFwQSDE11nZE9vmxjVGRbh5fNAFooemwxkiyGgU2fPK/toyzvTQFVNrZqEkst921DAYNuhE0+OwcQJ+vtu5VZqfLqIordSo5Ul6PlF0ZHwBHLP9pnk3JHZ8VLtZtPQ+wtC0WnDjY0OvSLCO1VLKSi/yJoLxrSRM6tG3vDjOhlXVim68EJQLlUsIlfM2TRdhCeXP0e9WJKRkCfttfhDDdtMXpxms9c7nlhK3WWPAWOG7bkRBhCMAzZSAI8TwV+vbpqApcOJZlVuUW0me9zZfIbDwiXsYNNly2kiDXKN5WJsZkHPQDghXOOhBnpKa+YePcvEVQJE9j+SGITFlY0EYiQFfSpLMWyu/eKSylbhoelz6OBd4PnpdzXtpPocX3IpL4ag6tQyq+TLFzntuw6Wh2w5DAsUFsfBo6esGnMMi/k5MHdtgu6LUKzZFb1ErW+WiasE9HNljSj6neuWRSiZ5jHF3TqFyHKrJ6Xt8CgqofhNEKp8s3I44tEozTQ8uMF1tr2FpXvMck1AklGn5IZ6iLoBRoVDJJExR4d4xZztzsFxzkDFHNmEp41O3TtMNHR9/vELMuj7qUenlAxCpLiPdmaxhu4yLqSlr7pED5QffepM1DLFY5iaAhhn1To0GkDgCa+KsTqXxXXAUYEBIl+CnYN4VBNyRKgTsS0Mg9KrHp3VLB69nOT91hRTITfIyDZAULzIuvSRkyraV1bFslkm42jG3TReEGzUJqi8nKa76CRrsiScvGsPxg2FKigWwjIX4vGE5S4wl7trYVVQQsiHnGHXNYnEdc0+HFHIPff4BxXJUQFsrKq1FVrjKTqNN4vZtYYJfyqiCOuWRhQdHv15FqN+XSr6Hl/ndjeEB1OOFzwLhJLSR/EkE+qMeEjSr8mt9DDNQyXzwgZeWgrjpeqSOsNk1tmc6mlWY3kvDIlQTlOGfYN6j8TsfeDYLYWwIs5HsRjmrZYGno2i6BEhUT17q6ClB3jlyK466r3D537Ht8+CBSTuvHFpvGhOI4kBoaBDFSNiqRIeT8FS+njeYpTQ+VQNI+D1kMQUCSps7EChiYv8y8yuxvn1JK0e5fdUU5ii6xcn5EQ0ipTD0Y2S17eJ84uAK0Vvp/H5QUW23VUiDueSt79ahAQD9PpAb+UJQ0a3N660sZkZzmjJBMoT2z5rMCIwCo8b4jwsubXtWkDP0cLHosQ9HhQ/1fPfVU0PYVgw36DWLlBj9nyMOWiAEXriu643PnGGykOjZdizTMbFKB/i3qy8OQwGhArKjmSMpiFDlSg6iWOjwqTJvpdtBCOLRJwpcSlaCcuGgSbm8B4+o9jp1sbHo5yk5GE5LclJ6IS/dWEhXcnQxgrLqJvY3JNh6wZi53oSbciuo7Dp2p/8Plzvh3GE4Zgs8ImsrmanWyUkNC52CXgqze4zgRFi7YnXWMp2EAHGRJDzLTHlHFwiTeISfdtpWCSMnZycC4tpgr8VcW0n0ywfznRROaEzfDEs5o0UUN5cAMTSnry8N8QcJR1pok1uRmG7Z53G+YcfubWQXJULRY/Rdrozpw46lujZLdGhmkRYaVo8Q+Io4/i4XC6kRkTX3gregQpY2GOcF/1ACOlON8TyiviwQxXz2zQEQeiE0Ac1CWkYDQzphpWZy3QnPz50blVqzLDTZF/ea+iuFL0nibab+mPrvEoexf74DVmw8bumhElWxTKqxKVqfZ4+KkjEhFjTnfPs8Z1uuMekOmxcgynmx+9gvEzZ5rhiRMULKwR5beIIsFJloOTQAw6pXgdEM+yHZj3+aWUlnU3MnkUzSRcxejcVGCqM2xImlwo1NsHkEc/QOB3KYereQru/uiqWUSUuqUDolJwmwMQSFI3ZsdMtaUxlocf3YaCx3IVYFV4IRjAN7aSfhZLlXShiyqek2SORKpkXxPiYA5TQgqqjYQXGEvG+TcKSXpcL5livRy/zOEmykieVMZxxcEBTD0QTSTc9NOSkftnUZALUP27lT2q9Du3+6moNnTIFyoBg+KiSY1x1T/7AfSXtdFPR0nCfdMgIzjhJMooqRNmrIUMP5oR7dN1UM6GhSPDeomAc5/4G1caYbAufnrosE+OSZmkNbADPn6dzrcnXTOSp6KUkobUZQAgEXe4SHtZmN5sJqECCFdUJAN2OqNnkYuWxsorPqYGB8uCeTDkKsdNNbqBpM5aq568lAMmvAX6A3UXW5KnBEZ5dtQW0XuBexXPadaEawhPZ8NB18UbDzNNxlUZiMG/qHh3M9VEl0VQAPUpfQBVUFrXwoqGiKU63DTN6AwomKDH+VVlaSplbpL+RNFN9jlJmU0gglNzGyIBCyuzAZtulTUqBzSxpbQ+OL3FW18c9TD9/P3Jvz+X4HHBT6CXKaB2NQy7AaoqLrcaXViqVeq7jchqj46IQC4rWPJtXf5l+B5tMdnBBmW3qcPlll4ZKt4J//+Tp/zqziAMPfoMta/mi8n28DuUOu9UEv/2Lrfq0MD57wzVXsJVfuZI9tvWG4F4Xxj6z+etXs9++9w927vP/hQIu3z+y1Lg39CZ7LPgdoazw4DN0dhnbu6MUu1aECH/861T4/i+/f5NOyWE85zFS5IPrwTXgaTRbb7lG9d3/BMcXEoZxkiv3z/jcwXujuu4zmsbgMlGmzAcG58Tpc+yfU+fCsckCdLx1c4gxeetPn4QdjRrZk/fv6GDfu/ka1dvb0yr6vOnp6XqvCT+YpnB3O7f8oP0jaShtLXBZkWcLZE1RE59V3KfAXm5wW7kCtqX8LuYDqydbJK89yhV6kKXvL2d8aCCM3THHzUENz2n/Q3DconpD1Azo+ugXARQe3REu4WkbUj7Nanh0lgtFR1XcqyniOdnaQzhfZB4ulFzOm4ykoOEl5r7jTCtTPMyjIFzHZure778A5nqM60/qDTsuYvQBpujlrqF/tFQWnmQTjeuyDuM4q5iyHNjtTaTkwpvaXnM3y6atVJUL5P6Cx+dBfn/dljLayBiqVclDwKM7OrqCY2Jajf7gaDV8F+9VgqM6nS1w/hL/zZLheoE+6Zrb+T3Q6xsNjm5+uMZgcAwY7qMnYT7KhvsblMYh66MrYZyzgmp8enKQsSxQqXceXFB3FW0r86SQ2BJZTfHdLun7nQ6t4QCbe443DT3KnMKOcg8wYPB0rUy9gaLEKeIWBSuo8M93Scky8Tut3OO082NQOhh/rUtKXIrY2RYliUlVa4y5XaDE7zPr9tm4t76E+evh19LWwB5ctP3qc8G6slB0j7k8RBoj55E/hHEtMdLWuyBUJZlxaoy9ont4XAS4xA+Bh4dXdA8PD6/oHh4eXtE9PDy8ont4eHhF9/Dw8Iru4eHhFd3Dw8MruoeHV3QPDw+v6B4eHs2F/wswAD9f5ORzGtg8AAAAAElFTkSuQmCC",u.complete)this.image=u,this.Texture=new t.Texture(this.context,this.image,i.RGBA),this.Texture.bind(i.LINEAR,i.CLAMP_TO_EDGE);else {var h=this,p=i;u.onload=function(){h.image=u,h.Texture=new t.Texture(h.context,h.image,p.RGBA),h.Texture.bind(p.LINEAR,p.CLAMP_TO_EDGE);};}},yr.prototype.onRemove=function(t,e){this.Texture&&this.Texture.destroy(),this.image=void 0;},yr.prototype.render=function(e,i){if(this.Texture){e.useProgram(this.program),e.bindBuffer(e.ARRAY_BUFFER,this.vertexSizeBuffer),e.vertexAttribPointer(this.a_Position,2,e.FLOAT,!1,4*this.fsize,0),e.enableVertexAttribArray(this.a_Position),e.vertexAttribPointer(this.a_TexCoord,2,e.FLOAT,!1,4*this.fsize,2*this.fsize),e.enableVertexAttribArray(this.a_TexCoord);var r=t.identity(new Array(16));t.translate(r,r,[-1,-1,0]),t.scale(r,r,[2/this.width,2/this.height,1]),e.uniformMatrix4fv(this.u_Matrix,!1,r),this.Texture.update(this.image,{useMipmap:!0}),e.drawArrays(e.TRIANGLE_STRIP,0,this.num);}};var br=t.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_uv",type:"Int16",components:2}]),wr={symbol:function(e,i,r,o,n){if("translucent"===e.renderPass){var a=e.colorModeForRenderPass();r.layout.get("text-variable-anchor")&&function(e,i,r,o,n,a,s){for(var c=i.transform,l="map"===n,u="map"===a,h=0,p=e;h<p.length;h+=1){var f=p[h],d=o.getTile(f),_=d.getBucket(r);if(_&&_.text&&_.text.segments.get().length){var m=t.evaluateSizeForZoom(_.textSizeData,c.zoom),g=y(d,1,i.transform.zoom,"xy"),v=Xt(f.posMatrix,u,l,i.transform,g),b="none"!==r.layout.get("icon-text-fit")&&_.hasIconData();if(m){var w=Math.pow(2,c.zoom-d.tileID.overscaledZ);$i(_,l,u,s,t.symbolSize,c,v,f.posMatrix,w,m,b);}}}}(o,e,r,i,r.layout.get("text-rotation-alignment"),r.layout.get("text-pitch-alignment"),n),0!==r.paint.get("icon-opacity").constantOr(1)&&er(e,i,r,o,!1,r.paint.get("icon-translate"),r.paint.get("icon-translate-anchor"),r.layout.get("icon-rotation-alignment"),r.layout.get("icon-pitch-alignment"),r.layout.get("icon-keep-upright"),0,a),0!==r.paint.get("text-opacity").constantOr(1)&&er(e,i,r,o,!0,r.paint.get("text-translate"),r.paint.get("text-translate-anchor"),r.layout.get("text-rotation-alignment"),r.layout.get("text-pitch-alignment"),r.layout.get("text-keep-upright"),0,a),i.map.showCollisionBoxes&&(Yi(e,i,r,o,r.paint.get("text-translate"),r.paint.get("text-translate-anchor"),!0),Yi(e,i,r,o,r.paint.get("icon-translate"),r.paint.get("icon-translate-anchor"),!1));}},circle:function(e,i,r,o){if("translucent"===e.renderPass){var n=r.paint.get("circle-opacity"),a=r.paint.get("circle-stroke-width"),s=r.paint.get("circle-stroke-opacity"),c=void 0!==r.layout.get("circle-sort-key").constantOr(1);if(0!==n.constantOr(1)||0!==a.constantOr(1)&&0!==s.constantOr(1)){for(var l=e.context,u=l.gl,h=e.depthModeForSublayer(0,Et.ReadOnly),p=e.colorModeForRenderPass(),f=[],d=0;d<o.length;d++){var _=o[d],m=i.getTile(_),g=m.getBucket(r);if(g){var v=g.programConfigurations.get(r.id),y={programConfiguration:v,program:e.useProgram("circle",v),layoutVertexBuffer:g.layoutVertexBuffer,indexBuffer:g.indexBuffer,uniformValues:Ai(e,_,m,r),coord:_};if(c)for(var b=0,w=g.segments.get();b<w.length;b+=1){var x=w[b];f.push({segments:new t.SegmentVector([x]),sortKey:x.sortKey,state:y});}else f.push({segments:g.segments,sortKey:0,state:y});}}c&&f.sort((function(t,e){return t.sortKey-e.sortKey}));for(var T=0,S=f;T<S.length;T+=1){var E=S[T],A=E.state,k=A.programConfiguration,I=A.program,B=A.layoutVertexBuffer,P=A.indexBuffer,C=A.uniformValues,z=E.segments;e.beforeDrawMask(r,A.coord),I.draw(l,u.TRIANGLES,h,e.eleSymbolstencilModel(r),p,It.disabled,C,r.id,B,P,z,r.paint,e.transform.zoom,k);}}}},heatmap:function(e,i,r,o){if(0!==r.paint.get("heatmap-opacity"))if("offscreen"===e.renderPass){var n=e.context,a=n.gl,s=At.disabled,c=new kt([a.ONE,a.ONE],t.Color.transparent,[!0,!0,!0,!0]);!function(t,e,i){var r=t.gl;t.activeTexture.set(r.TEXTURE1),t.viewport.set([0,0,e.width/4,e.height/4]);var o=i.heatmapFbo;if(o)r.bindTexture(r.TEXTURE_2D,o.colorAttachment.get()),t.bindFramebuffer.set(o.framebuffer);else {var n=r.createTexture();r.bindTexture(r.TEXTURE_2D,n),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),o=i.heatmapFbo=t.createFramebuffer(e.width/4,e.height/4,!1),function(t,e,i,r){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),r.colorAttachment.set(i);}(t,e,n,o);}}(n,e,r),n.clear({color:t.Color.transparent});for(var l=0;l<o.length;l++){var u=o[l];if(!i.hasRenderableParent(u)){var h=i.getTile(u),p=h.getBucket(r);if(p){var f=p.programConfigurations.get(r.id);e.useProgram("heatmap",f).draw(n,a.TRIANGLES,Et.disabled,s,c,It.disabled,Ci(u.posMatrix,h,e.transform.zoom,r.paint.get("heatmap-intensity")),r.id,p.layoutVertexBuffer,p.indexBuffer,p.segments,r.paint,e.transform.zoom,f);}}}n.viewport.set([0,0,e.width,e.height]);}else "translucent"===e.renderPass&&(e.context.setColorMode(e.colorModeForRenderPass()),function(e,i){var r=e.context,o=r.gl,n=i.heatmapFbo;if(n){r.activeTexture.set(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,n.colorAttachment.get()),r.activeTexture.set(o.TEXTURE1);var a=i.colorRampTexture;a||(a=i.colorRampTexture=new t.Texture(r,i.colorRamp,o.RGBA)),a.bind(o.LINEAR,o.CLAMP_TO_EDGE),e.useProgram("heatmapTexture").draw(r,o.TRIANGLES,Et.disabled,At.disabled,e.colorModeForRenderPass(),It.disabled,function(e,i,r,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:i.paint.get("heatmap-opacity"),u_featureZoom:e.transform.zoom}}(e,i),i.id,e.viewportBuffer,e.quadTriangleIndexBuffer,e.viewportSegments,i.paint,e.transform.zoom);}}(e,r));},line:rr,fill:function(e,i,r,o){var n=r.paint.get("fill-color"),a=r.paint.get("fill-opacity");if(0!==a.constantOr(1)){var s=e.colorModeForRenderPass(),c=r.paint.get("fill-pattern"),l=e.opaquePassEnabledForLayer()&&!c.constantOr(1)&&1===n.constantOr(t.Color.transparent).a&&1===a.constantOr(0)&&0==r.paint.get("fill-minzoom").constantOr(1)&&24==r.paint.get("fill-maxzoom").constantOr(1)?"opaque":"translucent";if(e.renderPass===l){var u=e.depthModeForSublayer(1,"opaque"===e.renderPass?Et.ReadWrite:Et.ReadOnly);nr(e,i,r,o,u,s,!1);}if("translucent"===e.renderPass&&r.paint.get("fill-antialias")){var h=e.depthModeForSublayer(r.getPaintProperty("fill-outline-color")?2:0,Et.ReadOnly);nr(e,i,r,o,h,s,!0);}}},"fill-extrusion":function(t,e,i,r){var o=i.paint.get("fill-extrusion-opacity");if(0!==o&&"translucent"===t.renderPass){var n=new Et(t.context.gl.LEQUAL,Et.ReadWrite,t.depthRangeFor3D);if(1!==o||i.paint.get("fill-extrusion-pattern").constantOr(1))ar(t,e,i,r,n,At.disabled,kt.disabled),ar(t,e,i,r,n,t.stencilModeFor3D(),t.colorModeForRenderPass());else {var a=t.colorModeForRenderPass();ar(t,e,i,r,n,At.disabled,a);}}},hillshade:function(t,e,i,r){if("offscreen"===t.renderPass||"translucent"===t.renderPass){for(var o=t.context,n=e.getSource().maxzoom,a=t.depthModeForSublayer(0,Et.ReadOnly),s=t.colorModeForRenderPass(),c="translucent"===t.renderPass?t.stencilConfigForOverlap(r):[{},r],l=c[0],u=0,h=c[1];u<h.length;u+=1){var p=h[u],f=e.getTile(p);f.needsHillshadePrepare&&"offscreen"===t.renderPass?cr(t,f,i,n,a,At.disabled,s):"translucent"===t.renderPass&&sr(t,f,i,a,l[p.overscaledZ],s);}o.viewport.set([0,0,t.width,t.height]);}},raster:function(t,e,i,r){if("translucent"===t.renderPass&&0!==i.paint.get("raster-opacity")&&r.length)for(var o=t.context,n=o.gl,a=e.getSource(),s=t.useProgram("raster"),c=t.colorModeForRenderPass(),l=a instanceof C?[{},r]:t.stencilConfigForOverlap(r),u=l[0],h=l[1],p=h[h.length-1].overscaledZ,f=!t.options.moving,d=0,_=h;d<_.length;d+=1){var m=_[d],g=t.depthModeForSublayer(m.overscaledZ-p,1===i.paint.get("raster-opacity")?Et.ReadWrite:Et.ReadOnly,n.LESS),v=e.getTile(m),y=t.transform.calculatePosMatrix(m.toUnwrapped(),f);v.registerFadeDuration(i.paint.get("raster-fade-duration"));var b=e.findLoadedParent(m,0),w=lr(v,b,e,i,t.transform),x=void 0,T=void 0,S="nearest"===i.paint.get("raster-resampling")?n.NEAREST:n.LINEAR;o.activeTexture.set(n.TEXTURE0),v.texture.bind(S,n.CLAMP_TO_EDGE,n.LINEAR_MIPMAP_NEAREST),o.activeTexture.set(n.TEXTURE1),b?(b.texture.bind(S,n.CLAMP_TO_EDGE,n.LINEAR_MIPMAP_NEAREST),x=Math.pow(2,b.tileID.overscaledZ-v.tileID.overscaledZ),T=[v.tileID.canonical.x*x%1,v.tileID.canonical.y*x%1]):v.texture.bind(S,n.CLAMP_TO_EDGE,n.LINEAR_MIPMAP_NEAREST);var E=Ni(y,T||[0,0],x||1,w,i);a instanceof C?s.draw(o,n.TRIANGLES,g,At.disabled,c,It.disabled,E,i.id,a.boundsBuffer,t.quadTriangleIndexBuffer,a.boundsSegments):s.draw(o,n.TRIANGLES,g,u[m.overscaledZ],c,It.disabled,E,i.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments);}},background:function(t,e,i,r){var o=i.paint.get("background-color"),n=i.paint.get("background-opacity");if(0!==n){var a=t.context,s=a.gl,c=t.transform,l=c.tileSize,u=i.paint.get("background-pattern");if(!t.isPatternMissing(u)){var h=!u&&1===o.a&&1===n&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(t.renderPass===h){var p=At.disabled,f=t.depthModeForSublayer(0,"opaque"===h?Et.ReadWrite:Et.ReadOnly),d=t.colorModeForRenderPass(),_=t.useProgram(u?"backgroundPattern":"background");if(!e||"Sg4326"!=e.getSource().reference||u){var m=r||c.coveringTiles({tileSize:l});u&&(a.activeTexture.set(s.TEXTURE0),t.imageManager.bind(t.context));for(var g=i.getCrossfadeParameters(),v=0,y=m;v<y.length;v+=1){var b=y[v],w=t.transform.calculatePosMatrix(b.toUnwrapped()),x=u?Wi(w,n,t,u,{tileID:b,tileSize:l},g):Hi(w,n,o);t.beforeDrawMask(i,b),_.draw(a,s.TRIANGLES,f,p,d,It.disabled,x,i.id,t.sgtileExtentBuffer,t.quadTriangleIndexBuffer,t.sgtileExtentSegments);}}else {var T=Hi(t.clearMaxtrix,n,o);_.draw(a,s.TRIANGLES,f,p,d,It.disabled,T,i.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments);}}}}},debug:function(t,e,i){for(var r=0;r<i.length;r++)vr(t,e,i[r]);},custom:function(t,e,i){var r=t.context,o=i.implementation;if("offscreen"===t.renderPass){var n=o.prerender;n&&(t.setCustomLayerDefaults(),r.setColorMode(t.colorModeForRenderPass()),n.call(o,r.gl,t.transform.customLayerMatrix()),r.setDirty(),t.setBaseState());}else if("translucent"===t.renderPass){t.setCustomLayerDefaults(),r.setColorMode(t.colorModeForRenderPass()),r.setStencilMode(At.disabled);var a="3d"===o.renderingMode?new Et(t.context.gl.LEQUAL,Et.ReadWrite,t.depthRangeFor3D):t.depthModeForSublayer(0,Et.ReadOnly);r.setDepthMode(a),o.render(r.gl,t.transform.customLayerMatrix()),r.setDirty(),t.setBaseState(),r.bindFramebuffer.set(null);}},esymbol:function(e,i,r,o){if("translucent"===e.renderPass){var n=r.paint.get("esymbol-opacity"),a=r.paint.get("esymbol-stroke-width"),s=r.paint.get("esymbol-stroke-opacity"),c=void 0!==r.layout.get("esymbol-sort-key").constantOr(1);if(0!==n.constantOr(1)||0!==a.constantOr(1)&&0!==s.constantOr(1)){for(var l=e.context,u=l.gl,h=e.depthModeForSublayer(0,Et.ReadOnly),p=e.colorModeForRenderPass(),f=[],d=0;d<o.length;d++){var _=o[d],m=i.getTile(_),g=m.getBucket(r);if(g){var v,b=g.programConfigurations.get(r.id),w=e.useProgram("eleSymbol",b),x=g.layoutVertexBuffer,T=g.indexBuffer,S=g.colorVertexBuffer,E=y(m,1,e.transform.zoom,"xy"),A=Xt(_.posMatrix,!0,!0,e.transform,E),k=Kt(_.posMatrix,!0,!0,e.transform,E),I=(e.translatePosMatrix(_.posMatrix,m,[0,0],"map"),A),B=e.translatePosMatrix(k,m,[0,0],"map",!0);v=Math.pow(2,e.transform.zoom-18);var P={programConfiguration:b,program:w,layoutVertexBuffer:x,indexBuffer:T,colorVertexBuffer:S,uniformValues:Xi(e,_,m,r,I,B,v),coord:_};if(c)for(var C=0,z=g.segments.get();C<z.length;C+=1){var D=z[C];f.push({segments:new t.SegmentVector([D]),sortKey:D.sortKey,state:P});}else f.push({segments:g.segments,sortKey:0,state:P});}}c&&f.sort((function(t,e){return t.sortKey-e.sortKey}));for(var M=0,R=f;M<R.length;M+=1){var L=R[M],O=L.state,F=O.programConfiguration,U=O.program,N=O.layoutVertexBuffer,j=O.indexBuffer,V=O.colorVertexBuffer,q=O.uniformValues,Z=L.segments;e.beforeDrawMask(r,O.coord),U.draw(l,u.TRIANGLES,h,e.eleSymbolstencilModel(r),p,It.disabled,q,r.id,N,j,Z,r.paint,e.transform.zoom,F,V);}}}},eline:rr},xr=function(t,e){this.context=new Bt(t),this.transform=e,this._tileTextures={},this.setup(),this.numSublayers=Pt.maxUnderzooming+Pt.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Me,this.gpuTimers={},this.sg4326TileBoundds={};};xr.prototype.resize=function(e,i){if(this.width=e*t.browser.devicePixelRatio,this.height=i*t.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var r=0,o=this.style._order;r<o.length;r+=1)this.style._layers[o[r]].resize();},xr.prototype.DrawTileMask=function(t){var e=this.context,i=e.gl,r=this._tileClippingMaskIDs[t.key];this.useProgram("clippingMask").draw(e,i.TRIANGLES,Et.disabled,new At({func:i.ALWAYS,mask:0},r,255,i.KEEP,i.KEEP,i.REPLACE),kt.disabled,It.disabled,Pi(t.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments);},xr.prototype.beforeDrawMask=function(e,i){var r=this.context.gl,o=i&&"Sg4326"==i.reference;if(this.allowclipMask&&e&&"background"!=e.type&&e.layout&&e.layout.get("allow-clip"))if("fill"!=e.type&&"line"!=e.type&&"eline"!=e.type){var n=this.transform.customLayerMatrix();t.translate(n,n,[this.firstPoint.x,this.firstPoint.y,0]),this.maskmatrix=n,this.drawMask(n,255,r.REPLACE,this.maskExtentBuffer,this.maskTriangleIndexBuffer,this.maskExtentSegments);}else {var a=i.canonical;if(this.geoJSONTile=this._geoJSONIndex.getTile(a.z,a.x,a.y),!this.geoJSONTile)return;var s=this.addMaskVertices(this.geoJSONTile.features);this.maskExtentBuffer1=s.maskExtentBuffer,this.maskTriangleIndexBuffer1=s.maskTriangleIndexBuffer,this.maskExtentSegments1=s.maskExtentSegments;var c=this._tileClippingMaskIDs[i.key];o?this.drawMask(i.posMatrix,255-c,r.REPLACE,this.maskExtentBuffer1,this.maskTriangleIndexBuffer1,this.maskExtentSegments1):(this.DrawTileMask(i),this.drawMask(i.posMatrix,c,r.INVERT,this.maskExtentBuffer1,this.maskTriangleIndexBuffer1,this.maskExtentSegments1));}},xr.prototype.drawMask=function(t,e,i,r,o,n){var a=this.context,s=a.gl;this.useProgram("clippingMask").draw(a,s.TRIANGLES,Et.disabled,new At({func:s.ALWAYS,mask:0},e||255,255,s.KEEP,s.KEEP,i||s.REPLACE),kt.disabled,It.disabled,Pi(t),"$clipping",r,o,n);},xr.prototype.removeMaskBuffer=function(){this.allowclipMask=!1,this.maskExtentBuffer&&(this.maskExtentBuffer.destroy(),this.maskTriangleIndexBuffer.destroy(),this.maskExtentSegments.destroy()),this.maskExtentBuffer1&&(this.maskExtentBuffer1.destroy(),this.maskTriangleIndexBuffer1.destroy(),this.maskExtentSegments1.destroy());},xr.prototype.addMaskVertices=function(e,i){var r=new t.StructArrayLayout2f8,o=this.context,n=0,a=[];if(0==i)for(var s=0;s<e.length;s++){for(var c=e[s].geometry.coordinates[0],l=[],u=0;u<c.length-1;u++){var h=this.transform.locationCoordinate(c[u]);0==s&&0==u&&(this.firstPoint=h),r.emplaceBack(h.x-this.firstPoint.x,h.y-this.firstPoint.y),l.push(h.x),l.push(h.y);}var p=t.earcut(l).map((function(t){return t+n}));a=a.concat(p),n+=c.length;}else for(var f=0;f<e.length;f++)for(var d=e[f].geometry,_=[],m=0;m<d.length;m++){for(var g=d[m],v=0;v<g.length-1;v++){var y=g[v][0],b=g[v][1];r.emplaceBack(y,b),_.push(y),_.push(b);}var w=t.earcut(_).map((function(t){return t+n}));a=a.concat(w),n+=g.length;}for(var x=t.createLayout([{name:"a_pos",type:"Float32",components:2}]),T=o.createVertexBuffer(r,x.members),S=new t.StructArrayLayout3ui6,E=0;E<a.length;E+=3)S.emplaceBack(a[E],a[E+1],a[E+2]);return {maskExtentBuffer:T,maskTriangleIndexBuffer:o.createIndexBuffer(S),maskExtentSegments:t.SegmentVector.simpleSegment(0,0,n,a.length/3)}},xr.prototype.addMaskBuffer=function(e){this.allowclipMask=!0;var i=this.style.getSource(e),r=i.serialize().data;this._geoJSONIndex=t.geojsonvt(r,i.workerOptions.geojsonVtOptions);var o=this.addMaskVertices(r.features,0);this.maskExtentBuffer=o.maskExtentBuffer,this.maskTriangleIndexBuffer=o.maskTriangleIndexBuffer,this.maskExtentSegments=o.maskExtentSegments;},xr.prototype.setup=function(){var e=this.context,i=new t.StructArrayLayout2i4;i.emplaceBack(0,0),i.emplaceBack(t.EXTENT,0),i.emplaceBack(0,t.EXTENT),i.emplaceBack(t.EXTENT,t.EXTENT),this.tileExtentBuffer=e.createVertexBuffer(i,Ne.members),this.tileExtentSegments=t.SegmentVector.simpleSegment(0,0,4,2);var r=new t.StructArrayLayout2i4;r.emplaceBack(0,0),r.emplaceBack(t.EXTENT,0),r.emplaceBack(0,t.EXTENT),r.emplaceBack(t.EXTENT,t.EXTENT),this.sgtileExtentBuffer=e.createVertexBuffer(r,Ne.members),this.sgtileExtentSegments=t.SegmentVector.simpleSegment(0,0,4,2);var o=new t.StructArrayLayout4i8;o.emplaceBack(0,0,0,0),o.emplaceBack(t.EXTENT,0,1,0),o.emplaceBack(0,t.EXTENT,0,1),o.emplaceBack(t.EXTENT,t.EXTENT,1,1),this.debugBuffer=e.createVertexBuffer(o,br.members),this.debugSegments=t.SegmentVector.simpleSegment(0,0,4,5);var n=new t.StructArrayLayout4i8;n.emplaceBack(0,0,0,0),n.emplaceBack(t.EXTENT,0,t.EXTENT,0),n.emplaceBack(0,t.EXTENT,0,t.EXTENT),n.emplaceBack(t.EXTENT,t.EXTENT,t.EXTENT,t.EXTENT),this.rasterBoundsBuffer=e.createVertexBuffer(n,P.members),this.rasterBoundsSegments=t.SegmentVector.simpleSegment(0,0,4,2);var a=new t.StructArrayLayout2i4;a.emplaceBack(0,0),a.emplaceBack(1,0),a.emplaceBack(0,1),a.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(a,Ne.members),this.viewportSegments=t.SegmentVector.simpleSegment(0,0,4,2);var s=new t.StructArrayLayout1ui2;s.emplaceBack(0),s.emplaceBack(1),s.emplaceBack(3),s.emplaceBack(2),s.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(s);var c=new t.StructArrayLayout3ui6;c.emplaceBack(0,1,2),c.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(c),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 At({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO);},xr.prototype.clearStencil=function(){var e,i=this.context,r=i.gl;this.nextStencilID=1,this.currentStencilSource=void 0,this.clearMaxtrix?e=this.clearMaxtrix:(e=t.create(),t.ortho(e,0,this.width,this.height,0,0,1),t.scale(e,e,[r.drawingBufferWidth,r.drawingBufferHeight,0]),this.clearMaxtrix=e),this.useProgram("clippingMask").draw(i,r.TRIANGLES,Et.disabled,this.stencilClearMode,kt.disabled,It.disabled,Pi(e),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments);},xr.prototype._renderTileClippingMasks=function(t,e,i){if(e&&this.currentStencilSource!==e.id&&t.isTileClipped()&&i&&i.length){this.currentStencilSource=e.id;var r=this.context,o=r.gl;this.nextStencilID+i.length>256&&this.clearStencil(),r.setColorMode(kt.disabled),r.setDepthMode(Et.disabled);var n=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var a=0,s=i;a<s.length;a+=1){var c=s[a];if("Sg4326"!=c.reference){var l=this._tileClippingMaskIDs[c.key]=this.nextStencilID++;n.draw(r,o.TRIANGLES,Et.disabled,new At({func:o.ALWAYS,mask:0},l,255,o.KEEP,o.KEEP,o.REPLACE),kt.disabled,It.disabled,Pi(c.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments);}}}},xr.prototype.stencilModeFor3D=function(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();var t=this.nextStencilID++,e=this.context.gl;return new At({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)},xr.prototype.eleSymbolstencilModel=function(t){var e=this.context.gl;return this.allowclipMask&&t&&t.layout.get("allow-clip")?new At({func:e.EQUAL,mask:255},255,0,e.KEEP,e.KEEP,e.REPLACE):At.disabled},xr.prototype.stencilModeForClipping=function(t,e){var i=this.context.gl;return this.allowclipMask&&e&&e.layout.get("allow-clip")?new At({func:i.EQUAL,mask:255},255-this._tileClippingMaskIDs[t.key],0,i.KEEP,i.KEEP,i.REPLACE):"Sg4326"==t.reference?At.disabled:new At({func:i.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,i.KEEP,i.KEEP,i.REPLACE)},xr.prototype.stencilConfigForOverlap=function(t){var e,i=this.context.gl,r=t.sort((function(t,e){return e.overscaledZ-t.overscaledZ})),o=r[r.length-1].overscaledZ,n=r[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 At({func:i.GEQUAL,mask:255},s+this.nextStencilID,255,i.KEEP,i.KEEP,i.REPLACE);return this.nextStencilID+=n,[a,r]}return [(e={},e[o]=At.disabled,e),r]},xr.prototype.colorModeForRenderPass=function(){var e=this.context.gl;return this._showOverdrawInspector?new kt([e.CONSTANT_COLOR,e.ONE],new t.Color(1/8,1/8,1/8,0),[!0,!0,!0,!0]):"opaque"===this.renderPass?kt.unblended:kt.alphaBlended},xr.prototype.depthModeForSublayer=function(t,e,i){if(!this.opaquePassEnabledForLayer())return Et.disabled;var r=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new Et(i||this.context.gl.LEQUAL,e,[r,r])},xr.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},xr.prototype.render=function(e,i){var r=this;this.style=e,this.options=i,this.lineAtlas=e.lineAtlas,this.imageManager=e.imageManager,this.glyphManager=e.glyphManager,this.symbolFadeChange=e.placement.symbolFadeChange(t.browser.now()),this.imageManager.beginFrame();var o=this.style._order,n=this.style._sourceCaches;for(var a in n){var s=n[a];s.used&&s.prepare(this.context);}var c={},l={},u={};for(var h in n){var p=n[h];c[h]=p.getVisibleCoordinates(),l[h]=c[h].slice().reverse(),u[h]=p.getVisibleCoordinates(!0).reverse();}this.opaquePassCutoff=1/0;for(var f=0;f<o.length;f++)if(this.style._layers[o[f]].is3D()){this.opaquePassCutoff=f;break}this.renderPass="offscreen";for(var d=0,_=o;d<_.length;d+=1){var m=this.style._layers[_[d]];if(m.hasOffscreenPass()&&!m.isHidden(this.transform.zoom)){var g=e._getLayerSourceCache(m),v=g?l[g.id]:void 0;("custom"===m.type||v.length)&&this.renderLayer(this,g,m,v);}}for(this.context.bindFramebuffer.set(null),this.context.clear({color:i.showOverdrawInspector?t.Color.black:t.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=i.showOverdrawInspector,this.depthRangeFor3D=[0,1-(e._order.length+2)*this.numSublayers*this.depthEpsilon],this.renderPass="opaque",this.currentLayer=o.length-1;this.currentLayer>=0;this.currentLayer--){var y=this.style._layers[o[this.currentLayer]];if(!y.isHidden(this.transform.zoom)){var b=e._getLayerSourceCache(y),w=b?l[b.id]:void 0;this._renderTileClippingMasks(y,b,w),this.renderLayer(this,b,y,w);}}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<o.length;this.currentLayer++){var x=this.style._layers[o[this.currentLayer]];if(!x.isHidden(this.transform.zoom)){var T=e._getLayerSourceCache(x),S=T?("symbol"===x.type?u:l)[T.id]:void 0;this._renderTileClippingMasks(x,T,T?c[T.id]:void 0),this.renderLayer(this,T,x,S);}}if(this.options.showTileBoundaries){var E=null;t.values(this.style._layers).forEach((function(t){var i=e._getLayerSourceCache(t);i&&!t.isHidden(r.transform.zoom)&&(!E||E.getSource().maxzoom<i.getSource().maxzoom)&&(E=i);})),E&&wr.debug(this,E,E.getVisibleCoordinates());}this.options.showPadding&&function(t){var e=t.transform.padding;_r(t,t.transform.height-(e.top||0),3,ur),_r(t,e.bottom||0,3,hr),mr(t,e.left||0,3,pr),mr(t,t.transform.width-(e.right||0),3,fr);var i=t.transform.centerPoint;!function(t,e,i,r){gr(t,e-1,i-10,2,20,r),gr(t,e-10,i-1,20,2,r);}(t,i.x,t.transform.height-i.y,dr);}(this);var A={context:this.context,devicePixelRatio:t.browser.devicePixelRatio,width:this.width,height:this.height,logoSize:i.logoSize||""};this.LogoLayer||(this.LogoLayer=t.createStyleLayer(new yr(A)),this.LogoLayer.onAdd({painter:{context:this.context}})),this.LogoLayer.implementation.updateSize(A),this.renderLayer(this,"",this.LogoLayer),this.context.setDefault();},xr.prototype.renderLayer=function(t,e,i,r){i.isHidden(this.transform.zoom)||("background"===i.type||"custom"===i.type||r.length)&&(this.id=i.id,this.gpuTimingStart(i),wr[i.type](t,e,i,r,this.style.placement.variableOffsets),this.gpuTimingEnd());},xr.prototype.gpuTimingStart=function(t){if(this.options.gpuTiming){var e=this.context.extTimerQuery,i=this.gpuTimers[t.id];i||(i=this.gpuTimers[t.id]={calls:0,cpuTime:0,query:e.createQueryEXT()}),i.calls++,e.beginQueryEXT(e.TIME_ELAPSED_EXT,i.query);}},xr.prototype.gpuTimingEnd=function(){if(this.options.gpuTiming){var t=this.context.extTimerQuery;t.endQueryEXT(t.TIME_ELAPSED_EXT);}},xr.prototype.collectGpuTimers=function(){var t=this.gpuTimers;return this.gpuTimers={},t},xr.prototype.queryGpuTimers=function(t){var e={};for(var i in t){var r=t[i],o=this.context.extTimerQuery,n=o.getQueryObjectEXT(r.query,o.QUERY_RESULT_EXT)/1e6;o.deleteQueryEXT(r.query),e[i]=n;}return e},xr.prototype.translatePosMatrix=function(e,i,r,o,n){if(!r[0]&&!r[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),c=Math.cos(a);r=[r[0]*c-r[1]*s,r[0]*s+r[1]*c];}var l=[n?r[0]:y(i,r[0],this.transform.zoom),n?r[1]:y(i,r[1],this.transform.zoom,"xy")[1],0],u=new Float32Array(16);return t.translate(u,e,l),u},xr.prototype.saveTileTexture=function(t){var e=this._tileTextures[t.size[0]];e?e.push(t):this._tileTextures[t.size[0]]=[t];},xr.prototype.getTileTexture=function(t){var e=this._tileTextures[t];return e&&e.length>0?e.pop():null},xr.prototype.isPatternMissing=function(t){if(!t)return !1;if(!t.from||!t.to)return !0;var e=this.imageManager.getPattern(t.from.toString()),i=this.imageManager.getPattern(t.to.toString());return !e||!i},xr.prototype.useProgram=function(t,e){this.cache=this.cache||{};var i=""+t+(e?e.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[i]||(this.cache[i]=new vi(this.context,mi[t],e,Ki[t],this._showOverdrawInspector)),this.cache[i]},xr.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();},xr.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);},xr.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));},xr.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy();},xr.prototype.setTileLoadedFlag=function(t){this.tileLoaded=t;};var Tr=function(e){var i,r,o,n;this._hashName=e&&encodeURIComponent(e),t.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=(i=this._updateHashUnthrottled.bind(this),r=!1,o=null,n=function(){o=null,r&&(i(),o=setTimeout(n,300),r=!1);},function(){return r=!0,o||n(),o});};Tr.prototype.addTo=function(e){return this._map=e,t.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},Tr.prototype.remove=function(){return t.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},Tr.prototype.getHashString=function(e){var i=this._map.getCenter(),r=Math.round(100*this._map.getZoom())/100,o=Math.ceil((r*Math.LN2+Math.log(512/360/.5))/Math.LN10),n=Math.pow(10,o),a=Math.round(i.lng*n)/n,s=Math.round(i.lat*n)/n,c=this._map.getBearing(),l=this._map.getPitch(),u="";if(u+=e?"/"+a+"/"+s+"/"+r:r+"/"+s+"/"+a,(c||l)&&(u+="/"+Math.round(10*c)/10),l&&(u+="/"+Math.round(l)),this._hashName){var h=this._hashName,p=!1,f=t.window.location.hash.slice(1).split("&").map((function(t){var e=t.split("=")[0];return e===h?(p=!0,e+"="+u):t})).filter((function(t){return t}));return p||f.push(h+"="+u),"#"+f.join("&")}return "#"+u},Tr.prototype._getCurrentHash=function(){var e,i=this,r=t.window.location.hash.replace("#","");return this._hashName?(r.split("&").map((function(t){return t.split("=")})).forEach((function(t){t[0]===i._hashName&&(e=t);})),(e&&e[1]||"").split("/")):r.split("/")},Tr.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},Tr.prototype._updateHashUnthrottled=function(){var e=this.getHashString();try{t.window.history.replaceState(t.window.history.state,"",e);}catch(t){}};var Sr={linearity:.3,easing:t.bezier(0,0,.3,1)},Er=t.extend({deceleration:2500,maxSpeed:1400},Sr),Ar=t.extend({deceleration:20,maxSpeed:1400},Sr),kr=t.extend({deceleration:1e3,maxSpeed:360},Sr),Ir=t.extend({deceleration:1e3,maxSpeed:90},Sr),Br=function(t){this._map=t,this.clear();};function Pr(t,e){(!t.duration||t.duration<e.duration)&&(t.duration=e.duration,t.easing=e.easing);}function Cr(e,i,r){var o=r.maxSpeed,n=r.linearity,a=r.deceleration,s=t.clamp(e*n/(i/1e3),-o,o),c=Math.abs(s)/(a*n);return {easing:r.easing,duration:1e3*c,amount:s*(c/2)}}Br.prototype.clear=function(){this._inertiaBuffer=[];},Br.prototype.record=function(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:t.browser.now(),settings:e});},Br.prototype._drainInertiaBuffer=function(){for(var e=this._inertiaBuffer,i=t.browser.now();e.length>0&&i-e[0].time>160;)e.shift();},Br.prototype._onMoveEnd=function(e){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var i={zoom:0,bearing:0,pitch:0,pan:new t.Point(0,0),pinchAround:void 0,around:void 0},r=0,o=this._inertiaBuffer;r<o.length;r+=1){var n=o[r].settings;i.zoom+=n.zoomDelta||0,i.bearing+=n.bearingDelta||0,i.pitch+=n.pitchDelta||0,n.panDelta&&i.pan._add(n.panDelta),n.around&&(i.around=n.around),n.pinchAround&&(i.pinchAround=n.pinchAround);}var a=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,s={};if(i.pan.mag()){var c=Cr(i.pan.mag(),a,t.extend({},Er,e||{}));s.offset=i.pan.mult(c.amount/i.pan.mag()),s.center=this._map.transform.center,Pr(s,c);}if(i.zoom){var l=Cr(i.zoom,a,Ar);s.zoom=this._map.transform.zoom+l.amount,Pr(s,l);}if(i.bearing){var u=Cr(i.bearing,a,kr);s.bearing=this._map.transform.bearing+t.clamp(u.amount,-179,179),Pr(s,u);}if(i.pitch){var h=Cr(i.pitch,a,Ir);s.pitch=this._map.transform.pitch+h.amount,Pr(s,h);}if(s.zoom||s.bearing){var p=void 0===i.pinchAround?i.around:i.pinchAround;s.around=p?this._map.unproject(p):this._map.getCenter();}return this.clear(),t.extend(s,{noMoveStart:!0})}};var zr=function(e){function i(i,o,n,a){void 0===a&&(a={});var s=r.mousePos(o.getCanvasContainer(),n),c=o.unproject(s);e.call(this,i,t.extend({point:s,lngLat:c,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),Dr=function(e){function i(i,o,n){var a="touchend"===i?n.changedTouches:n.touches,s=r.touchPos(o.getCanvasContainer(),a),c=s.map((function(t){return o.unproject(t)})),l=s.reduce((function(t,e,i,r){return t.add(e.div(r.length))}),new t.Point(0,0)),u=o.unproject(l);e.call(this,i,{points:s,point:l,lngLats:c,lngLat:u,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),Mr=function(t){function e(e,i,r){t.call(this,e,{originalEvent:r}),this._defaultPrevented=!1;}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var i={defaultPrevented:{configurable:!0}};return e.prototype.preventDefault=function(){this._defaultPrevented=!0;},i.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(e.prototype,i),e}(t.Event),Rr=function(t,e){this._map=t,this._clickTolerance=e.clickTolerance;};Rr.prototype.reset=function(){delete this._mousedownPos;},Rr.prototype.wheel=function(t){return this._firePreventable(new Mr(t.type,this._map,t))},Rr.prototype.mousedown=function(t,e){return this._mousedownPos=e,this._firePreventable(new zr(t.type,this._map,t))},Rr.prototype.mouseup=function(t){this._map.fire(new zr(t.type,this._map,t));},Rr.prototype.click=function(t,e){this._mousedownPos&&this._mousedownPos.dist(e)>=this._clickTolerance||this._map.fire(new zr(t.type,this._map,t));},Rr.prototype.dblclick=function(t){return this._firePreventable(new zr(t.type,this._map,t))},Rr.prototype.mouseover=function(t){this._map.fire(new zr(t.type,this._map,t));},Rr.prototype.mouseout=function(t){this._map.fire(new zr(t.type,this._map,t));},Rr.prototype.touchstart=function(t){return this._firePreventable(new Dr(t.type,this._map,t))},Rr.prototype.touchmove=function(t){this._map.fire(new Dr(t.type,this._map,t));},Rr.prototype.touchend=function(t){this._map.fire(new Dr(t.type,this._map,t));},Rr.prototype.touchcancel=function(t){this._map.fire(new Dr(t.type,this._map,t));},Rr.prototype._firePreventable=function(t){if(this._map.fire(t),t.defaultPrevented)return {}},Rr.prototype.isEnabled=function(){return !0},Rr.prototype.isActive=function(){return !1},Rr.prototype.enable=function(){},Rr.prototype.disable=function(){};var Lr=function(t){this._map=t;};Lr.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent;},Lr.prototype.mousemove=function(t){this._map.fire(new zr(t.type,this._map,t));},Lr.prototype.mousedown=function(){this._delayContextMenu=!0;},Lr.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new zr("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent);},Lr.prototype.contextmenu=function(t){this._delayContextMenu?this._contextMenuEvent=t:this._map.fire(new zr(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault();},Lr.prototype.isEnabled=function(){return !0},Lr.prototype.isActive=function(){return !1},Lr.prototype.enable=function(){},Lr.prototype.disable=function(){};var Or=function(t,e){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1;};function Fr(t,e){for(var i={},r=0;r<t.length;r++)i[t[r].identifier]=e[r];return i}Or.prototype.isEnabled=function(){return !!this._enabled},Or.prototype.isActive=function(){return !!this._active},Or.prototype.enable=function(){this.isEnabled()||(this._enabled=!0);},Or.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1);},Or.prototype.mousedown=function(t,e){this.isEnabled()&&t.shiftKey&&0===t.button&&(r.disableDrag(),this._startPos=this._lastPos=e,this._active=!0);},Or.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","sgmap-boxzoom",this._container),this._container.classList.add("sgmap-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),c=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=c-s+"px";}}},Or.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);}},Or.prototype.keydown=function(t){this._active&&27===t.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",t));},Or.prototype.reset=function(){this._active=!1,this._container.classList.remove("sgmap-crosshair"),this._box&&(r.remove(this._box),this._box=null),r.enableDrag(),delete this._startPos,delete this._lastPos;},Or.prototype._fireEvent=function(e,i){return this._map.fire(new t.Event(e,{originalEvent:i}))};var Ur=function(t){this.reset(),this.numTouches=t.numTouches;};Ur.prototype.reset=function(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1;},Ur.prototype.touchstart=function(e,i,r){(this.centroid||r.length>this.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=e.timeStamp),r.length===this.numTouches&&(this.centroid=function(e){for(var i=new t.Point(0,0),r=0,o=e;r<o.length;r+=1)i._add(o[r]);return i.div(e.length)}(i),this.touches=Fr(r,i)));},Ur.prototype.touchmove=function(t,e,i){if(!this.aborted&&this.centroid){var r=Fr(i,e);for(var o in this.touches){var n=r[o];(!n||n.dist(this.touches[o])>30)&&(this.aborted=!0);}}},Ur.prototype.touchend=function(t,e,i){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===i.length){var r=!this.aborted&&this.centroid;if(this.reset(),r)return r}};var Nr=function(t){this.singleTap=new Ur(t),this.numTaps=t.numTaps,this.reset();};Nr.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset();},Nr.prototype.touchstart=function(t,e,i){this.singleTap.touchstart(t,e,i);},Nr.prototype.touchmove=function(t,e,i){this.singleTap.touchmove(t,e,i);},Nr.prototype.touchend=function(t,e,i){var r=this.singleTap.touchend(t,e,i);if(r){var o=t.timeStamp-this.lastTime<500,n=!this.lastTap||this.lastTap.dist(r)<30;if(o&&n||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=r,this.count===this.numTaps)return this.reset(),r}};var jr=function(){this._zoomIn=new Nr({numTouches:1,numTaps:2}),this._zoomOut=new Nr({numTouches:2,numTaps:1}),this.reset();};jr.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset();},jr.prototype.touchstart=function(t,e,i){this._zoomIn.touchstart(t,e,i),this._zoomOut.touchstart(t,e,i);},jr.prototype.touchmove=function(t,e,i){this._zoomIn.touchmove(t,e,i),this._zoomOut.touchmove(t,e,i);},jr.prototype.touchend=function(t,e,i){var r=this,o=this._zoomIn.touchend(t,e,i),n=this._zoomOut.touchend(t,e,i);return o?(this._active=!0,t.preventDefault(),setTimeout((function(){return r.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 r.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()-1,around:e.unproject(n)},{originalEvent:t})}}):void 0},jr.prototype.touchcancel=function(){this.reset();},jr.prototype.enable=function(){this._enabled=!0;},jr.prototype.disable=function(){this._enabled=!1,this.reset();},jr.prototype.isEnabled=function(){return this._enabled},jr.prototype.isActive=function(){return this._active};var Vr=function(t){this.reset(),this._clickTolerance=t.clickTolerance||1;};Vr.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton;},Vr.prototype._correctButton=function(t,e){return !1},Vr.prototype._move=function(t,e){return {}},Vr.prototype.mousedown=function(t,e){if(!this._lastPoint){var i=r.mouseButton(t);this._correctButton(t,i)&&(this._lastPoint=e,this._eventButton=i);}},Vr.prototype.mousemoveWindow=function(t,e){var i=this._lastPoint;if(i&&(t.preventDefault(),this._moved||!(e.dist(i)<this._clickTolerance)))return this._moved=!0,this._lastPoint=e,this._move(i,e)},Vr.prototype.mouseupWindow=function(t){r.mouseButton(t)===this._eventButton&&(this._moved&&r.suppressClick(),this.reset());},Vr.prototype.enable=function(){this._enabled=!0;},Vr.prototype.disable=function(){this._enabled=!1,this.reset();},Vr.prototype.isEnabled=function(){return this._enabled},Vr.prototype.isActive=function(){return this._active};var qr=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,i){t.prototype.mousedown.call(this,e,i),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}(Vr),Zr=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 i=.8*(e.x-t.x);if(i)return this._active=!0,{bearingDelta:i}},e.prototype.contextmenu=function(t){t.preventDefault();},e}(Vr),Gr=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 i=-.5*(e.y-t.y);if(i)return this._active=!0,{pitchDelta:i}},e.prototype.contextmenu=function(t){t.preventDefault();},e}(Vr),Hr=function(t){this._minTouches=1,this._clickTolerance=t.clickTolerance||1,this.reset();};Hr.prototype.reset=function(){this._active=!1,this._touches={},this._sum=new t.Point(0,0);},Hr.prototype.touchstart=function(t,e,i){return this._calculateTransform(t,e,i)},Hr.prototype.touchmove=function(t,e,i){if(this._active)return t.preventDefault(),this._calculateTransform(t,e,i)},Hr.prototype.touchend=function(t,e,i){this._calculateTransform(t,e,i),this._active&&i.length<this._minTouches&&this.reset();},Hr.prototype.touchcancel=function(){this.reset();},Hr.prototype._calculateTransform=function(e,i,r){r.length>0&&(this._active=!0);var o=Fr(r,i),n=new t.Point(0,0),a=new t.Point(0,0),s=0;for(var c in o){var l=o[c],u=this._touches[c];u&&(n._add(l),a._add(l.sub(u)),s++,o[c]=l);}if(this._touches=o,!(s<this._minTouches)&&a.mag()){var h=a.div(s);if(this._sum._add(h),!(this._sum.mag()<this._clickTolerance))return {around:n.div(s),panDelta:h}}},Hr.prototype.enable=function(){this._enabled=!0;},Hr.prototype.disable=function(){this._enabled=!1,this.reset();},Hr.prototype.isEnabled=function(){return this._enabled},Hr.prototype.isActive=function(){return this._active};var Wr=function(){this.reset();};function Xr(t,e,i){for(var r=0;r<t.length;r++)if(t[r].identifier===i)return e[r]}function Kr(t,e){return Math.log(t/e)/Math.LN2}Wr.prototype.reset=function(){this._active=!1,delete this._firstTwoTouches;},Wr.prototype._start=function(t){},Wr.prototype._move=function(t,e,i){return {}},Wr.prototype.touchstart=function(t,e,i){this._firstTwoTouches||i.length<2||(this._firstTwoTouches=[i[0].identifier,i[1].identifier],this._start([e[0],e[1]]));},Wr.prototype.touchmove=function(t,e,i){if(this._firstTwoTouches){t.preventDefault();var r=this._firstTwoTouches,o=r[1],n=Xr(i,e,r[0]),a=Xr(i,e,o);if(n&&a){var s=this._aroundCenter?null:n.add(a).div(2);return this._move([n,a],s,t)}}},Wr.prototype.touchend=function(t,e,i){if(this._firstTwoTouches){var o=this._firstTwoTouches,n=o[1],a=Xr(i,e,o[0]),s=Xr(i,e,n);a&&s||(this._active&&r.suppressClick(),this.reset());}},Wr.prototype.touchcancel=function(){this.reset();},Wr.prototype.enable=function(t){this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around;},Wr.prototype.disable=function(){this._enabled=!1,this.reset();},Wr.prototype.isEnabled=function(){return this._enabled},Wr.prototype.isActive=function(){return this._active};var Yr=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 i=this._distance;if(this._distance=t[0].dist(t[1]),this._active||!(Math.abs(Kr(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Kr(this._distance,i),pinchAround:e}},e}(Wr);function Jr(t,e){return 180*t.angleWith(e)/Math.PI}var Qr=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 i=this._vector;if(this._vector=t[0].sub(t[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:Jr(this._vector,i),pinchAround:e}},e.prototype._isBelowThreshold=function(t){this._minDiameter=Math.min(this._minDiameter,t.mag());var e=25/(Math.PI*this._minDiameter)*360,i=Jr(t,this._startVector);return Math.abs(i)<e},e}(Wr);function $r(t){return Math.abs(t.y)>Math.abs(t.x)}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),this._valid=void 0,delete this._firstMove,delete this._lastPoints;},e.prototype._start=function(t){this._lastPoints=t,$r(t[0].sub(t[1]))&&(this._valid=!1);},e.prototype._move=function(t,e,i){var r=t[0].sub(this._lastPoints[0]),o=t[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(r,o,i.timeStamp),this._valid)return this._lastPoints=t,this._active=!0,{pitchDelta:(r.y+o.y)/2*-.5}},e.prototype.gestureBeginsVertically=function(t,e,i){if(void 0!==this._valid)return this._valid;var r=t.mag()>=2,o=e.mag()>=2;if(r||o){if(!r||!o)return void 0===this._firstMove&&(this._firstMove=i),i-this._firstMove<100&&void 0;var n=t.y>0==e.y>0;return $r(t)&&$r(e)&&n}},e}(Wr),eo={panStep:100,bearingStep:15,pitchStep:10},io=function(){var t=eo;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep;};function ro(t){return t*(2-t)}io.prototype.reset=function(){this._active=!1;},io.prototype.keydown=function(t){var e=this;if(!(t.altKey||t.ctrlKey||t.metaKey)){var i=0,r=0,o=0,n=0,a=0;switch(t.keyCode){case 61:case 107:case 171:case 187:i=1;break;case 189:case 109:case 173:i=-1;break;case 37:t.shiftKey?r=-1:(t.preventDefault(),n=-1);break;case 39:t.shiftKey?r=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 {cameraAnimation:function(s){var c=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:ro,zoom:i?Math.round(c)+i*(t.shiftKey?2:1):c,bearing:s.getBearing()+r*e._bearingStep,pitch:s.getPitch()+o*e._pitchStep,offset:[-n*e._panStep,-a*e._panStep],center:s.getCenter()},{originalEvent:t});}}}},io.prototype.enable=function(){this._enabled=!0;},io.prototype.disable=function(){this._enabled=!1,this.reset();},io.prototype.isEnabled=function(){return this._enabled},io.prototype.isActive=function(){return this._active};var oo=function(e,i){this._map=e,this._el=e.getCanvasContainer(),this._handler=i,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,t.bindAll(["_onWheel","_onTimeout","_onScrollFrame","_onScrollFinished"],this);};oo.prototype.setZoomRate=function(t){this._defaultZoomRate=t;},oo.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t;},oo.prototype.isEnabled=function(){return !!this._enabled},oo.prototype.isActive=function(){return !!this._active||void 0!==this._finishTimeout},oo.prototype.isZooming=function(){return !!this._zooming},oo.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around);},oo.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1);},oo.prototype.wheel=function(e){if(this.isEnabled()){var i=e.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,r=t.browser.now(),o=r-(this._lastWheelEventTime||0);this._lastWheelEventTime=r,0!==i&&i%4.000244140625==0?this._type="wheel":0!==i&&Math.abs(i)<4?this._type="trackpad":o>400?(this._type=null,this._lastValue=i,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(o*i)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,i+=this._lastValue)),e.shiftKey&&i&&(i/=4),this._type&&(this._lastWheelEvent=e,this._delta-=i,this._active||this._start(e)),e.preventDefault();}},oo.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t);},oo.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());}},oo.prototype.renderFrame=function(){return this._onScrollFrame()},oo.prototype._onScrollFrame=function(){var e=this;if(this._frameId&&(this._frameId=null,this.isActive())){var i=this._map.transform;if(0!==this._delta){var r="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,o=2/(1+Math.exp(-Math.abs(this._delta*r)));this._delta<0&&0!==o&&(o=1/o);var n="number"==typeof this._targetZoom?i.zoomScale(this._targetZoom):i.scale;this._targetZoom=Math.min(i.maxZoom,Math.max(i.minZoom,i.scaleZoom(n*o))),"wheel"===this._type&&(this._startZoom=i.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0;}var a,s="number"==typeof this._targetZoom?this._targetZoom:i.zoom,c=this._startZoom,l=this._easing,u=!1;if("wheel"===this._type&&c&&l){var h=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),p=l(h);a=t.number(c,s,p),h<1?this._frameId||(this._frameId=!0):u=!0;}else a=s,u=!0;return this._active=!0,u&&(this._active=!1,this._finishTimeout=setTimeout((function(){e._zooming=!1,e._handler._triggerRenderFrame(),delete e._targetZoom,delete e._finishTimeout;}),200)),{noInertia:!0,needsRenderFrame:!u,zoomDelta:a-i.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},oo.prototype._smoothOutEasing=function(e){var i=t.ease;if(this._prevEase){var r=this._prevEase,o=(t.browser.now()-r.start)/r.duration,n=r.easing(o+.01)-r.easing(o),a=.27/Math.sqrt(n*n+1e-4)*.01,s=Math.sqrt(.0729-a*a);i=t.bezier(a,s,.25,1);}return this._prevEase={start:t.browser.now(),duration:e,easing:i},i},oo.prototype.reset=function(){this._active=!1;};var no=function(t,e){this._clickZoom=t,this._tapZoom=e;};no.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable();},no.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable();},no.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},no.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var ao=function(){this.reset();};ao.prototype.reset=function(){this._active=!1;},ao.prototype.dblclick=function(t,e){return t.preventDefault(),{cameraAnimation:function(i){i.easeTo({duration:300,zoom:i.getZoom()+(t.shiftKey?-1:1),around:i.unproject(e)},{originalEvent:t});}}},ao.prototype.enable=function(){this._enabled=!0;},ao.prototype.disable=function(){this._enabled=!1,this.reset();},ao.prototype.isEnabled=function(){return this._enabled},ao.prototype.isActive=function(){return this._active};var so=function(){this._tap=new Nr({numTouches:1,numTaps:1}),this.reset();};so.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset();},so.prototype.touchstart=function(t,e,i){this._swipePoint||(this._tapTime&&t.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?i.length>0&&(this._swipePoint=e[0],this._swipeTouch=i[0].identifier):this._tap.touchstart(t,e,i));},so.prototype.touchmove=function(t,e,i){if(this._tapTime){if(this._swipePoint){if(i[0].identifier!==this._swipeTouch)return;var r=e[0],o=r.y-this._swipePoint.y;return this._swipePoint=r,t.preventDefault(),this._active=!0,{zoomDelta:o/128}}}else this._tap.touchmove(t,e,i);},so.prototype.touchend=function(t,e,i){this._tapTime?this._swipePoint&&0===i.length&&this.reset():this._tap.touchend(t,e,i)&&(this._tapTime=t.timeStamp);},so.prototype.touchcancel=function(){this.reset();},so.prototype.enable=function(){this._enabled=!0;},so.prototype.disable=function(){this._enabled=!1,this.reset();},so.prototype.isEnabled=function(){return this._enabled},so.prototype.isActive=function(){return this._active};var co=function(t,e,i){this._el=t,this._mousePan=e,this._touchPan=i;};co.prototype.enable=function(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("sgmap-touch-drag-pan");},co.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("sgmap-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 lo=function(t,e,i){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=i;};lo.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable();},lo.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable();},lo.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},lo.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var uo=function(t,e,i,r){this._el=t,this._touchZoom=e,this._touchRotate=i,this._tapDragZoom=r,this._rotationDisabled=!1,this._enabled=!0;};uo.prototype.enable=function(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("sgmap-touch-zoom-rotate");},uo.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("sgmap-touch-zoom-rotate");},uo.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},uo.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},uo.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable();},uo.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable();};var ho=function(t){return t.zoom||t.drag||t.pitch||t.rotate},po=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 fo(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}var _o=function(e,i){this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Br(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:!1}],[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],c=s[0];r.addEventListener(c,s[1],c===t.window.document?this.handleWindowEvent:this.handleEvent,s[2]);}};_o.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]);}},_o.prototype._addDefaultHandlers=function(t){var e=this._map,i=e.getCanvasContainer();this._add("mapEvent",new Rr(e,t));var r=e.boxZoom=new Or(e,t);this._add("boxZoom",r);var o=new jr,n=new ao;e.doubleClickZoom=new no(n,o),this._add("tapZoom",o),this._add("clickZoom",n);var a=new so;this._add("tapDragZoom",a);var s=e.touchPitch=new to;this._add("touchPitch",s);var c=new Zr(t),l=new Gr(t);e.dragRotate=new lo(t,c,l),this._add("mouseRotate",c,["mousePitch"]),this._add("mousePitch",l,["mouseRotate"]);var u=new qr(t),h=new Hr(t);e.dragPan=new co(i,u,h),this._add("mousePan",u),this._add("touchPan",h,["touchZoom","touchRotate"]);var p=new Qr,f=new Yr;e.touchZoomRotate=new uo(i,f,p,a),this._add("touchRotate",p,["touchPan","touchZoom"]),this._add("touchZoom",f,["touchPan","touchRotate"]);var d=e.scrollZoom=new oo(e,this);this._add("scrollZoom",d,["mousePan"]);var _=e.keyboard=new io;this._add("keyboard",_),this._add("blockableMapEvent",new Lr(e));for(var m=0,g=["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"];m<g.length;m+=1){var v=g[m];t.interactive&&t[v]&&e[v].enable(t[v]);}},_o.prototype._add=function(t,e,i){this._handlers.push({handlerName:t,handler:e,allowed:i}),this._handlersById[t]=e;},_o.prototype.stop=function(){if(!this._updatingCamera){for(var t=0,e=this._handlers;t<e.length;t+=1)e[t].handler.reset();this._inertia.clear(),this._fireEvents({},{}),this._changes=[];}},_o.prototype.isActive=function(){for(var t=0,e=this._handlers;t<e.length;t+=1)if(e[t].handler.isActive())return !0;return !1},_o.prototype.isZooming=function(){return !!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()},_o.prototype.isRotating=function(){return !!this._eventsInProgress.rotate},_o.prototype.isMoving=function(){return Boolean(ho(this._eventsInProgress))||this.isZooming()},_o.prototype._blockedByActive=function(t,e,i){for(var r in t)if(r!==i&&(!e||e.indexOf(r)<0))return !0;return !1},_o.prototype.handleWindowEvent=function(t){this.handleEvent(t,t.type+"Window");},_o.prototype._getMapTouches=function(t){for(var e=[],i=0,r=t;i<r.length;i+=1){var o=r[i];this._el.contains(o.target)&&e.push(o);}return e},_o.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,c=s?r.touchPos(this._el,s):r.mousePos(this._el,t),l=0,u=this._handlers;l<u.length;l+=1){var h=u[l],p=h.handlerName,f=h.handler,d=h.allowed;if(f.isEnabled()){var _=void 0;this._blockedByActive(a,d,p)?f.reset():f[e||t.type]&&(_=f[e||t.type](t,c,s),this.mergeHandlerResult(o,n,_,p,i),_&&_.needsRenderFrame&&this._triggerRenderFrame()),(_||f.isActive())&&(a[p]=f);}}var m={};for(var g in this._previousActiveHandlers)a[g]||(m[g]=i);this._previousActiveHandlers=a,(Object.keys(m).length||fo(o))&&(this._changes.push([o,n,m]),this._triggerRenderFrame()),(Object.keys(a).length||fo(o))&&this._map._stop(!0),this._updatingCamera=!1;var v=o.cameraAnimation;v&&(this._inertia.clear(),this._fireEvents({},{}),this._changes=[],v(this._map));}else this.stop();},_o.prototype.mergeHandlerResult=function(e,i,r,o,n){if(r){t.extend(e,r);var a={handlerName:o,originalEvent:r.originalEvent||n};void 0!==r.zoomDelta&&(i.zoom=a),void 0!==r.panDelta&&(i.drag=a),void 0!==r.pitchDelta&&(i.pitch=a),void 0!==r.bearingDelta&&(i.rotate=a);}},_o.prototype._applyChanges=function(){for(var e={},i={},r={},o=0,n=this._changes;o<n.length;o+=1){var a=n[o],s=a[0],c=a[1],l=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(i,c),t.extend(r,l);}this._updateMapTransform(e,i,r),this._changes=[];},_o.prototype._updateMapTransform=function(t,e,i){var r=this._map,o=r.transform;if(!fo(t))return this._fireEvents(e,i);var n=t.panDelta,a=t.zoomDelta,s=t.bearingDelta,c=t.pitchDelta,l=t.around,u=t.pinchAround;void 0!==u&&(l=u),r._stop(!0),l=l||r.transform.centerPoint;var h=o.pointLocation(n?l.sub(n):l);s&&(o.bearing+=s),c&&(o.pitch+=c),a&&(o.zoom+=a),o.setLocationAtPoint(h,l),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(e,i);},_o.prototype._fireEvents=function(e,i){var r=this,o=ho(this._eventsInProgress),n=ho(e),a={};for(var s in e)this._eventsInProgress[s]||(a[s+"start"]=e[s].originalEvent),this._eventsInProgress[s]=e[s];for(var c in !o&&n&&this._fireEvent("movestart",n.originalEvent),a)this._fireEvent(c,a[c]);for(var l in e.rotate&&(this._bearingChanged=!0),n&&this._fireEvent("move",n.originalEvent),e)this._fireEvent(l,e[l].originalEvent);var u,h={};for(var p in this._eventsInProgress){var f=this._eventsInProgress[p],d=f.handlerName,_=f.originalEvent;this._handlersById[d].isActive()||(delete this._eventsInProgress[p],h[p+"end"]=u=i[d]||_);}for(var m in h)this._fireEvent(m,h[m]);var g=ho(this._eventsInProgress);if((o||n)&&!g){this._updatingCamera=!0;var v=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),y=function(t){return 0!==t&&-r._bearingSnap<t&&t<r._bearingSnap};v?(y(v.bearing||this._map.getBearing())&&(v.bearing=0),this._map.easeTo(v,{originalEvent:u})):(this._map.fire(new t.Event("moveend",{originalEvent:u})),y(this._map.getBearing())&&this._map.resetNorth()),this._bearingChanged=!1,this._updatingCamera=!1;}},_o.prototype._fireEvent=function(e,i){this._map.fire(new t.Event(e,i?{originalEvent:i}:{}));},_o.prototype._triggerRenderFrame=function(){var t=this;void 0===this._frameId&&(this._frameId=this._map._requestRenderFrame((function(e){delete t._frameId,t.handleEvent(new po("renderFrame",{timeStamp:e})),t._applyChanges();})));};var mo=function(e){function i(i,r){e.call(this),this._moving=!1,this._zooming=!1,this.transform=i,this._bearingSnap=r.bearingSnap,t.bindAll(["_renderFrameCallback"],this);}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.getCenter=function(){return new t.LngLat(this.transform.center.lng,this.transform.center.lat)},i.prototype.setCenter=function(t,e){return this.jumpTo({center:t},e)},i.prototype.panBy=function(e,i,r){return e=t.Point.convert(e).mult(-1),this.panTo(this.transform.center,t.extend({offset:e},i),r)},i.prototype.panTo=function(e,i,r){return this.easeTo(t.extend({center:e},i),r)},i.prototype.getZoom=function(){return this.transform.zoom},i.prototype.setZoom=function(t,e){return this.jumpTo({zoom:t},e),this},i.prototype.zoomTo=function(e,i,r){return this.easeTo(t.extend({zoom:e},i),r)},i.prototype.zoomIn=function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},i.prototype.zoomOut=function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},i.prototype.getBearing=function(){return this.transform.bearing},i.prototype.setBearing=function(t,e){return this.jumpTo({bearing:t},e),this},i.prototype.getPadding=function(){return this.transform.padding},i.prototype.setPadding=function(t,e){return this.jumpTo({padding:t},e),this},i.prototype.rotateTo=function(e,i,r){return this.easeTo(t.extend({bearing:e},i),r)},i.prototype.resetNorth=function(e,i){return this.rotateTo(0,t.extend({duration:1e3},e),i),this},i.prototype.resetNorthPitch=function(e,i){return this.easeTo(t.extend({bearing:0,pitch:0,duration:1e3},e),i),this},i.prototype.snapToNorth=function(t,e){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,e):this},i.prototype.getPitch=function(){return this.transform.pitch},i.prototype.setPitch=function(t,e){return this.jumpTo({pitch:t},e),this},i.prototype.cameraForBounds=function(e,i){return e=t.LngLatBounds.convert(e),this._cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),0,i)},i.prototype._cameraForBoxAndBearing=function(e,i,r,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,c=s.padding,l=s.project(t.LngLat.convert(e)),u=s.project(t.LngLat.convert(i)),h=l.rotate(-r*Math.PI/180),p=u.rotate(-r*Math.PI/180),f=new t.Point(Math.max(h.x,p.x),Math.max(h.y,p.y)),d=new t.Point(Math.min(h.x,p.x),Math.min(h.y,p.y)),_=f.sub(d),m=(s.width-(c.left+c.right+o.padding.left+o.padding.right))/_.x,g=(s.height-(c.top+c.bottom+o.padding.top+o.padding.bottom))/_.y;if(!(g<0||m<0)){var v=Math.min(s.scaleZoom(s.scale*Math.min(m,g)),o.maxZoom),y=t.Point.convert(o.offset),b=new t.Point(y.x+(o.padding.left-o.padding.right)/2,y.y+(o.padding.top-o.padding.bottom)/2).mult(s.scale/s.zoomScale(v));return {center:s.unproject(l.add(u).div(2).sub(b)),zoom:v,bearing:r}}t.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.");},i.prototype.fitBounds=function(t,e,i){return this._fitInternal(this.cameraForBounds(t,e),e,i)},i.prototype.fitScreenCoordinates=function(e,i,r,o,n){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(t.Point.convert(e)),this.transform.pointLocation(t.Point.convert(i)),r,o),o,n)},i.prototype._fitInternal=function(e,i,r){return e?(delete(i=t.extend(e,i)).padding,i.linear?this.easeTo(i,r):this.flyTo(i,r)):this},i.prototype.jumpTo=function(e,i){this.stop();var r=this.transform,o=!1,n=!1,a=!1;return "zoom"in e&&r.zoom!==+e.zoom&&(o=!0,r.zoom=+e.zoom),void 0!==e.center&&(r.center=t.LngLat.convert(e.center)),"bearing"in e&&r.bearing!==+e.bearing&&(n=!0,r.bearing=+e.bearing),"pitch"in e&&r.pitch!==+e.pitch&&(a=!0,r.pitch=+e.pitch),null==e.padding||r.isPaddingEqual(e.padding)||(r.padding=e.padding),this.fire(new t.Event("movestart",i)).fire(new t.Event("move",i)),o&&this.fire(new t.Event("zoomstart",i)).fire(new t.Event("zoom",i)).fire(new t.Event("zoomend",i)),n&&this.fire(new t.Event("rotatestart",i)).fire(new t.Event("rotate",i)).fire(new t.Event("rotateend",i)),a&&this.fire(new t.Event("pitchstart",i)).fire(new t.Event("pitch",i)).fire(new t.Event("pitchend",i)),this.fire(new t.Event("moveend",i))},i.prototype.easeTo=function(e,i){var r=this;this._stop(!1,e.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(),c=this.getPadding(),l="zoom"in e?+e.zoom:n,u="bearing"in e?this._normalizeBearing(e.bearing,a):a,h="pitch"in e?+e.pitch:s,p="padding"in e?e.padding:o.padding,f=t.Point.convert(e.offset),d=o.centerPoint.add(f),_=o.pointLocation(d),m=t.LngLat.convert(e.center||_);this._normalizeCenter(m);var g,v,y=o.project(_),b=o.project(m).sub(y),w=o.zoomScale(l-n);e.around&&(g=t.LngLat.convert(e.around),v=o.locationPoint(g));var x={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||l!==n,this._rotating=this._rotating||a!==u,this._pitching=this._pitching||h!==s,this._padding=!o.isPaddingEqual(p),this._easeId=e.easeId,this._prepareEase(i,e.noMoveStart,x),clearTimeout(this._easeEndTimeoutID),this._ease((function(e){if(r._zooming&&(o.zoom=t.number(n,l,e)),r._rotating&&(o.bearing=t.number(a,u,e)),r._pitching&&(o.pitch=t.number(s,h,e)),r._padding&&(o.interpolatePadding(c,p,e),d=o.centerPoint.add(f)),g)o.setLocationAtPoint(g,v);else {var _=o.zoomScale(o.zoom-n),m=l>n?Math.min(2,w):Math.max(.5,w),x=Math.pow(m,1-e),T=o.unproject(y.add(b.mult(e*x)).mult(_));o.setLocationAtPoint(o.renderWorldCopies?T.wrap():T,d);}r._fireMoveEvents(i);}),(function(t){r._afterEase(i,t);}),e),this},i.prototype._prepareEase=function(e,i,r){void 0===r&&(r={}),this._moving=!0,i||r.moving||this.fire(new t.Event("movestart",e)),this._zooming&&!r.zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&!r.rotating&&this.fire(new t.Event("rotatestart",e)),this._pitching&&!r.pitching&&this.fire(new t.Event("pitchstart",e));},i.prototype._fireMoveEvents=function(e){this.fire(new t.Event("move",e)),this._zooming&&this.fire(new t.Event("zoom",e)),this._rotating&&this.fire(new t.Event("rotate",e)),this._pitching&&this.fire(new t.Event("pitch",e));},i.prototype._afterEase=function(e,i){if(!this._easeId||!i||this._easeId!==i){delete this._easeId;var r=this._zooming,o=this._rotating,n=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,r&&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));}},i.prototype.flyTo=function(e,i){var r=this;if(!e.essential&&t.browser.prefersReducedMotion){var o=t.pick(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(o,i)}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(),c=this.getPitch(),l=this.getPadding(),u="zoom"in e?t.clamp(+e.zoom,n.minZoom,n.maxZoom):a,h="bearing"in e?this._normalizeBearing(e.bearing,s):s,p="pitch"in e?+e.pitch:c,f="padding"in e?e.padding:n.padding,d=n.zoomScale(u-a),_=t.Point.convert(e.offset),m=n.centerPoint.add(_),g=n.pointLocation(m),v=t.LngLat.convert(e.center||g);this._normalizeCenter(v);var y=n.project(g),b=n.project(v).sub(y),w=e.curve,x=Math.max(n.width,n.height),T=x/d,S=b.mag();if("minZoom"in e){var E=t.clamp(Math.min(e.minZoom,a,u),n.minZoom,n.maxZoom),A=x/n.zoomScale(E-a);w=Math.sqrt(A/S*2);}var k=w*w;function I(t){var e=(T*T-x*x+(t?-1:1)*k*k*S*S)/(2*(t?T:x)*k*S);return Math.log(Math.sqrt(e*e+1)-e)}function B(t){return (Math.exp(t)-Math.exp(-t))/2}function P(t){return (Math.exp(t)+Math.exp(-t))/2}var C=I(0),z=function(t){return P(C)/P(C+w*t)},D=function(t){return x*((P(C)*(B(e=C+w*t)/P(e))-B(C))/k)/S;var e;},M=(I(1)-C)/w;if(Math.abs(S)<1e-6||!isFinite(M)){if(Math.abs(x-T)<1e-6)return this.easeTo(e,i);var R=T<x?-1:1;M=Math.abs(Math.log(T/x))/w,D=function(){return 0},z=function(t){return Math.exp(R*w*t)};}return e.duration="duration"in e?+e.duration:1e3*M/("screenSpeed"in e?+e.screenSpeed/w:+e.speed),e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=s!==h,this._pitching=p!==c,this._padding=!n.isPaddingEqual(f),this._prepareEase(i,!1),this._ease((function(e){var o=e*M,d=1/z(o);n.zoom=1===e?u:a+n.scaleZoom(d),r._rotating&&(n.bearing=t.number(s,h,e)),r._pitching&&(n.pitch=t.number(c,p,e)),r._padding&&(n.interpolatePadding(l,f,e),m=n.centerPoint.add(_));var g=1===e?v:n.unproject(y.add(b.mult(D(o))).mult(d));n.setLocationAtPoint(n.renderWorldCopies?g.wrap():g,m),r._fireMoveEvents(i);}),(function(){return r._afterEase(i)}),e),this},i.prototype.isEasing=function(){return !!this._easeFrameId},i.prototype.stop=function(){return this._stop()},i.prototype._stop=function(t,e){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var i=this._onEaseEnd;delete this._onEaseEnd,i.call(this,e);}if(!t){var r=this.handlers;r&&r.stop();}return this},i.prototype._ease=function(e,i,r){!1===r.animate||0===r.duration?(e(1),i()):(this._easeStart=t.browser.now(),this._easeOptions=r,this._onEaseFrame=e,this._onEaseEnd=i,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback));},i.prototype._renderFrameCallback=function(){var e=Math.min((t.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop();},i.prototype._normalizeBearing=function(e,i){e=t.wrap(e,-180,180);var r=Math.abs(e-i);return Math.abs(e-360-i)<r&&(e-=360),Math.abs(e+360-i)<r&&(e+=360),e},i.prototype._normalizeCenter=function(t){var e=this.transform;if(e.renderWorldCopies&&!e.lngRange){var i=t.lng-e.center.lng;t.lng+=i>180?-360:i<-180?360:0;}},i}(t.Evented),go=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_updateEditLink","_updateData","_updateCompact"],this);};go.prototype.getDefaultPosition=function(){return "bottom-right"},go.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=r.create("div","sgmap-ctrl sgmap-ctrl-attrib"),this._innerContainer=r.create("div","sgmap-ctrl-attrib-inner",this._container),e&&this._container.classList.add("sgmap-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},go.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;},go.prototype._updateEditLink=function(){var e=this._editLink;e||(e=this._editLink=this._container.querySelector(".sgmap-improve-map"));var i=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||t.config$1.ACCESS_TOKEN}];if(e){var r=i.reduce((function(t,e,r){return e.value&&(t+=e.key+"="+e.value+(r<i.length-1?"&":"")),t}),"?");e.href=t.config$1.FEEDBACK_URL+"/"+r+(this._map._hash?this._map._hash.getHashString(!0):""),e.rel="noopener nofollow";}},go.prototype._updateData=function(t){!t||"metadata"!==t.sourceDataType&&"style"!==t.dataType||(this._updateAttributions(),this._updateEditLink());},go.prototype._updateAttributions=function(){if(this._map.style){var t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map((function(t){return "string"!=typeof t?"":t}))):"string"==typeof this.options.customAttribution&&t.push(this.options.customAttribution)),this._map.style.stylesheet){var e=this._map.style.stylesheet;this.styleOwner=e.owner,this.styleId=e.id;}var i=this._map.style.sourceCaches;for(var r in i){var o=i[r];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,i){for(var r=i+1;r<t.length;r++)if(t[r].indexOf(e)>=0)return !1;return !0}))).join(" | ");a!==this._attribHTML&&(this._attribHTML=a,t.length?(this._innerContainer.innerHTML=a,this._container.classList.remove("sgmap-attrib-empty")):this._container.classList.add("sgmap-attrib-empty"),this._editLink=null);}},go.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("sgmap-compact"):this._container.classList.remove("sgmap-compact");};var vo=t.createCommonjsModule((function(t,e){!function(i,r){var o="model",n="name",a="type",s="vendor",c="version",l="mobile",u="tablet",h="smarttv",p=function(t){for(var e={},i=0;i<t.length;i++)e[t[i].toUpperCase()]=t[i];return e},f=function(t,e){return "string"==typeof t&&-1!==d(e).indexOf(d(t))},d=function(t){return t.toLowerCase()},_=function(t,e){if("string"==typeof t)return t=t.replace(/^\s\s*/,"").replace(/\s\s*$/,""),void 0===e?t:t.substring(0,255)},m=function(t,e){for(var i,r,o,n,a,s,c=0;c<e.length&&!a;){var l=e[c],u=e[c+1];for(i=r=0;i<l.length&&!a;)if(a=l[i++].exec(t))for(o=0;o<u.length;o++)s=a[++r],"object"==typeof(n=u[o])&&n.length>0?2===n.length?this[n[0]]="function"==typeof n[1]?n[1].call(this,s):n[1]:3===n.length?this[n[0]]="function"!=typeof n[1]||n[1].exec&&n[1].test?s?s.replace(n[1],n[2]):void 0:s?n[1].call(this,s,n[2]):void 0:4===n.length&&(this[n[0]]=s?n[3].call(this,s.replace(n[1],n[2])):void 0):this[n]=s||void 0;c+=2;}},g=function(t,e){for(var i in e)if("object"==typeof e[i]&&e[i].length>0){for(var r=0;r<e[i].length;r++)if(f(e[i][r],t))return "?"===i?void 0:i}else if(f(e[i],t))return "?"===i?void 0:i;return t},v={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},y={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[c,[n,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[c,[n,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[n,c],[/opios[\/ ]+([\w\.]+)/i],[c,[n,"Opera Mini"]],[/\bopr\/([\w\.]+)/i],[c,[n,"Opera"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[n,c],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[c,[n,"UCBrowser"]],[/\bqbcore\/([\w\.]+)/i],[c,[n,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[c,[n,"WeChat"]],[/konqueror\/([\w\.]+)/i],[c,[n,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[c,[n,"IE"]],[/yabrowser\/([\w\.]+)/i],[c,[n,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[n,/(.+)/,"$1 Secure Browser"],c],[/\bfocus\/([\w\.]+)/i],[c,[n,"Firefox Focus"]],[/\bopt\/([\w\.]+)/i],[c,[n,"Opera Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[c,[n,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[c,[n,"Dolphin"]],[/coast\/([\w\.]+)/i],[c,[n,"Opera Coast"]],[/miuibrowser\/([\w\.]+)/i],[c,[n,"MIUI Browser"]],[/fxios\/([-\w\.]+)/i],[c,[n,"Firefox"]],[/\bqihu|(qi?ho?o?|360)browser/i],[[n,"360 Browser"]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[n,/(.+)/,"$1 Browser"],c],[/(comodo_dragon)\/([\w\.]+)/i],[[n,/_/g," "],c],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[n,c],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i],[n],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[n,"Facebook"],c],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[n,c],[/\bgsa\/([\w\.]+) .*safari\//i],[c,[n,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[c,[n,"Chrome Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[n,"Chrome WebView"],c],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[c,[n,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[n,c],[/version\/([\w\.]+) .*mobile\/\w+ (safari)/i],[c,[n,"Mobile Safari"]],[/version\/([\w\.]+) .*(mobile ?safari|safari)/i],[c,n],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[n,[c,g,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[n,c],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[n,"Netscape"],c],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[c,[n,"Firefox Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[n,c]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[["architecture","amd64"]],[/(ia32(?=;))/i],[["architecture",d]],[/((?:i[346]|x)86)[;\)]/i],[["architecture","ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[["architecture","arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[["architecture","armhf"]],[/windows (ce|mobile); ppc;/i],[["architecture","arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[["architecture",/ower/,"",d]],[/(sun4\w)[;\)]/i],[["architecture","sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[["architecture",d]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[o,[s,"Samsung"],[a,u]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[o,[s,"Samsung"],[a,l]],[/\((ip(?:hone|od)[\w ]*);/i],[o,[s,"Apple"],[a,l]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[o,[s,"Apple"],[a,u]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[o,[s,"Huawei"],[a,u]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}-[atu]?[ln][01259x][012359][an]?)\b(?!.+d\/s)/i],[o,[s,"Huawei"],[a,l]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[o,/_/g," "],[s,"Xiaomi"],[a,l]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[o,/_/g," "],[s,"Xiaomi"],[a,u]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[o,[s,"OPPO"],[a,l]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[o,[s,"Vivo"],[a,l]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[o,[s,"Realme"],[a,l]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[o,[s,"Motorola"],[a,l]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[o,[s,"Motorola"],[a,u]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[o,[s,"LG"],[a,u]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[o,[s,"LG"],[a,l]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[o,[s,"Lenovo"],[a,u]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[o,/_/g," "],[s,"Nokia"],[a,l]],[/(pixel c)\b/i],[o,[s,"Google"],[a,u]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[o,[s,"Google"],[a,l]],[/droid.+ ([c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[o,[s,"Sony"],[a,l]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[o,"Xperia Tablet"],[s,"Sony"],[a,u]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[o,[s,"OnePlus"],[a,l]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[o,[s,"Amazon"],[a,u]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[o,/(.+)/g,"Fire Phone $1"],[s,"Amazon"],[a,l]],[/(playbook);[-\w\),; ]+(rim)/i],[o,s,[a,u]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[o,[s,"BlackBerry"],[a,l]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[o,[s,"ASUS"],[a,u]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[o,[s,"ASUS"],[a,l]],[/(nexus 9)/i],[o,[s,"HTC"],[a,u]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony)[-_ ]?([-\w]*)/i],[s,[o,/_/g," "],[a,l]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[o,[s,"Acer"],[a,u]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[o,[s,"Meizu"],[a,l]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[o,[s,"Sharp"],[a,l]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[s,o,[a,l]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[s,o,[a,u]],[/(surface duo)/i],[o,[s,"Microsoft"],[a,u]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[o,[s,"Fairphone"],[a,l]],[/(u304aa)/i],[o,[s,"AT&T"],[a,l]],[/\bsie-(\w*)/i],[o,[s,"Siemens"],[a,l]],[/\b(rct\w+) b/i],[o,[s,"RCA"],[a,u]],[/\b(venue[\d ]{2,7}) b/i],[o,[s,"Dell"],[a,u]],[/\b(q(?:mv|ta)\w+) b/i],[o,[s,"Verizon"],[a,u]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[o,[s,"Barnes & Noble"],[a,u]],[/\b(tm\d{3}\w+) b/i],[o,[s,"NuVision"],[a,u]],[/\b(k88) b/i],[o,[s,"ZTE"],[a,u]],[/\b(nx\d{3}j) b/i],[o,[s,"ZTE"],[a,l]],[/\b(gen\d{3}) b.+49h/i],[o,[s,"Swiss"],[a,l]],[/\b(zur\d{3}) b/i],[o,[s,"Swiss"],[a,u]],[/\b((zeki)?tb.*\b) b/i],[o,[s,"Zeki"],[a,u]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[s,"Dragon Touch"],o,[a,u]],[/\b(ns-?\w{0,9}) b/i],[o,[s,"Insignia"],[a,u]],[/\b((nxa|next)-?\w{0,9}) b/i],[o,[s,"NextBook"],[a,u]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[s,"Voice"],o,[a,l]],[/\b(lvtel\-)?(v1[12]) b/i],[[s,"LvTel"],o,[a,l]],[/\b(ph-1) /i],[o,[s,"Essential"],[a,l]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[o,[s,"Envizen"],[a,u]],[/\b(trio[-\w\. ]+) b/i],[o,[s,"MachSpeed"],[a,u]],[/\btu_(1491) b/i],[o,[s,"Rotor"],[a,u]],[/(shield[\w ]+) b/i],[o,[s,"Nvidia"],[a,u]],[/(sprint) (\w+)/i],[s,o,[a,l]],[/(kin\.[onetw]{3})/i],[[o,/\./g," "],[s,"Microsoft"],[a,l]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[o,[s,"Zebra"],[a,u]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[o,[s,"Zebra"],[a,l]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[s,o,[a,"console"]],[/droid.+; (shield) bui/i],[o,[s,"Nvidia"],[a,"console"]],[/(playstation [345portablevi]+)/i],[o,[s,"Sony"],[a,"console"]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[o,[s,"Microsoft"],[a,"console"]],[/smart-tv.+(samsung)/i],[s,[a,h]],[/hbbtv.+maple;(\d+)/i],[[o,/^/,"SmartTV"],[s,"Samsung"],[a,h]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[s,"LG"],[a,h]],[/(apple) ?tv/i],[s,[o,"Apple TV"],[a,h]],[/crkey/i],[[o,"Chromecast"],[s,"Google"],[a,h]],[/droid.+aft(\w)( bui|\))/i],[o,[s,"Amazon"],[a,h]],[/\(dtv[\);].+(aquos)/i],[o,[s,"Sharp"],[a,h]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[s,_],[o,_],[a,h]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[a,h]],[/((pebble))app/i],[s,o,[a,"wearable"]],[/droid.+; (glass) \d/i],[o,[s,"Google"],[a,"wearable"]],[/droid.+; (wt63?0{2,3})\)/i],[o,[s,"Zebra"],[a,"wearable"]],[/(quest( 2)?)/i],[o,[s,"Facebook"],[a,"wearable"]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[s,[a,"embedded"]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[o,[a,l]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[o,[a,u]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[a,u]],[/(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i],[[a,l]],[/(android[-\w\. ]{0,9});.+buil/i],[o,[s,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[c,[n,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[c,[n,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[n,c],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[c,n]],os:[[/microsoft (windows) (vista|xp)/i],[n,c],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[n,[c,g,v]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[n,"Windows"],[c,g,v]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[c,/_/g,"."],[n,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[n,"Mac OS"],[c,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[c,n],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[n,c],[/\(bb(10);/i],[c,[n,"BlackBerry"]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[c,[n,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[c,[n,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[c,[n,"webOS"]],[/crkey\/([\d\.]+)/i],[c,[n,"Chromecast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[n,"Chromium OS"],c],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[n,c],[/(sunos) ?([\w\.\d]*)/i],[[n,"Solaris"],c],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[n,c]]},b=function(t,e){if("object"==typeof t&&(e=t,t=void 0),!(this instanceof b))return new b(t,e).getResult();var r=t||(void 0!==i&&i.navigator&&i.navigator.userAgent?i.navigator.userAgent:""),o=e?function(t,e){var i={};for(var r in t)i[r]=e[r]&&e[r].length%2==0?e[r].concat(t[r]):t[r];return i}(y,e):y;return this.getBrowser=function(){var t,e={name:void 0,version:void 0};return m.call(e,r,o.browser),e.major="string"==typeof(t=e.version)?t.replace(/[^\d\.]/g,"").split(".")[0]:void 0,e},this.getCPU=function(){var t={architecture:void 0};return m.call(t,r,o.cpu),t},this.getDevice=function(){var t={vendor:void 0,model:void 0,type:void 0};return m.call(t,r,o.device),t},this.getEngine=function(){var t={name:void 0,version:void 0};return m.call(t,r,o.engine),t},this.getOS=function(){var t={name:void 0,version:void 0};return m.call(t,r,o.os),t},this.getResult=function(){return {ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return r},this.setUA=function(t){return r="string"==typeof t&&t.length>255?_(t,255):t,this},this.setUA(r),this};b.VERSION="1.0.2",b.BROWSER=p([n,c,"major"]),b.CPU=p(["architecture"]),b.DEVICE=p([o,s,a,"console",l,h,u,"wearable","embedded"]),b.ENGINE=b.OS=p([n,c]),t.exports&&(e=t.exports=b),e.UAParser=b;var w=void 0!==i&&(i.jQuery||i.Zepto);if(w&&!w.ua){var x=new b;w.ua=x.getResult(),w.ua.get=function(){return x.getUA()},w.ua.set=function(t){x.setUA(t);var e=x.getResult();for(var i in e)w.ua[i]=e[i];};}}("object"==typeof window?window:this);})),yo=function(e){this.options=e,this._UAParser=new vo,t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this),this.Year=(new Date).getFullYear();};yo.prototype.onAdd=function(t){if(this.isMob="mobile"==this._UAParser.getDevice().type,this._map=t,this._container=r.create("div","sgmap-logo-wrap"),!this.isMob){var e=r.create("p","sgmap-logo-copyright");e.innerText="© "+this.Year+" 亿力吉奥 -GS(2022)192号 - 甲测资字35100192",this._container.appendChild(e);}return this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},yo.prototype.onRemove=function(){r.remove(this._container),this._map.off("resize",this._updateCompact);},yo.prototype.getDefaultPosition=function(){return "bottom-left"},yo.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none");},yo.prototype._logoRequired=function(){if(this._map.style){var t=this._map.style._sourceCaches;for(var e in t)if(t[e].getSource().sgmap_logo)return !0;return !1}},yo.prototype._updateCompact=function(){var t=this._container.children;if(t.length){var e=t[0];this._map.getCanvasContainer().offsetWidth<250?e.classList.add("sgmap-compact"):e.classList.remove("sgmap-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,i=0,r=e?this._queue.concat(e):this._queue;i<r.length;i+=1){var o=r[i];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 i=0,r=e;i<r.length;i+=1){var o=r[i];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={"FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"sgmap 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"},xo=t.window.HTMLImageElement,To=t.window.HTMLElement,So=t.window.ImageBitmap,Eo={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:1,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",localFontFamily:null,transformRequest:null,accessToken:null,fadeDuration:300,crossSourceCollisions:!0,crs:"EPSG:3857"};function Ao(t){t.parentNode&&t.parentNode.removeChild(t);}var ko=function(e){function i(i){if(!t.config$1.ACCESS_TOKEN)throw new Error("请参考. See https://map.sgcc.com.cn/products/js-sdk/v3/# 进行登陆后获取资源");e.call(this,i),this._userDatas={layers:[],images:{},sources:{}};}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.setStyle=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];return this._userDatas={layers:[],images:{},sources:{}},e.prototype.setStyle.apply(this,t)},i.prototype.setBaseStyle=function(t,e,i){return this.setBaseMap(t,i)},i.prototype.addSource=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];var r=t[0];return this._userDatas.sources[r]=!0,e.prototype.addSource.apply(this,t)},i.prototype.removeSource=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];var r=t[0];return delete this._userDatas.sources[r],e.prototype.removeSource.apply(this,t)},i.prototype.addLayer=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];var r=t[0].id;return this._userDatas.layers.indexOf(r)<0&&this._userDatas.layers.push(r),e.prototype.addLayer.apply(this,t)},i.prototype.removeLayer=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];var r=t[0],o=this._userDatas.layers.indexOf(r);return o>=0&&this._userDatas.layers.splice(o,1),e.prototype.removeLayer.apply(this,t)},i.prototype.addImage=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];var r=t[0];return this._userDatas.images[r]=t,e.prototype.addImage.apply(this,t)},i.prototype.removeImage=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];var r=t[0];return delete this._userDatas.images[r],e.prototype.removeImage.apply(this,t)},i.prototype._loadStyle=function(e,i){var r=this,o=this._requestManager.normalizeStyleURL(e),n=this._requestManager.transformRequest(o,t.ResourceType.Style);t.getJSON(n,(function(e,o){e?r.fire(new t.ErrorEvent(e)):o&&i&&i(o);}));},i.prototype.setBaseMap=function(e,i){var r=this,o=r.getStyle(),n=r.style,a=JSON.parse(JSON.stringify(n.stylesheet)),s=function(e){for(var o=n._order[0],a=r._userDatas.layers.length,s=0;s<e.layers.length;s++){var c=e.layers[s];n.getLayer(c.id)||(a>0?n.addLayer(c,o):n.addLayer(c));}n.fire(new t.Event("data",{dataType:"style"})),n.fire(new t.Event("style.load")),r._update(!0),i&&i();},c=function(e){if(function(t){var e={};for(var i in o.layers.forEach((function(t){r._userDatas.layers.indexOf(t.id)<0?n.getLayer(t.id)&&n.removeLayer(t.id):"string"==typeof t.source&&(e[t.source]=!0);})),o.sources)e[i]||r._userDatas.sources[i]||n.getSource(i)&&n.removeSource(i);t.sprite&&a.sprite!=t.sprite&&r.listImages().forEach((function(t){r._userDatas.images[t]||n.removeImage(t);}));}(e),n.stylesheet=e,e.glyphs&&e.glyphs!=a.glyphs&&n.glyphManager.setURL(e.glyphs),e.xml&&n.dispatcher.broadcast("setXml",e.xml),n.light=new g(n.stylesheet.light),e.sources)for(var i in e.sources)!n.getSource(i)&&n.addSource(i,e.sources[i]);n._changed=!1,e.sprite&&a.sprite!=e.sprite?(n._spriteRequest&&(n._spriteRequest.cancel(),n._spriteRequest=null),n._spriteRequest=p(e.sprite,n.map._requestManager,(function(i,r){if(n._spriteRequest=null,i)n.fire(new t.ErrorEvent(i));else if(r){for(var o in r)n.getImage(o)||n.addImage(o,r[o]);s(e);}}))):s(e);};if(n._request&&n._request.cancel(),n._spriteRequest&&(n._spriteRequest.cancel(),n._spriteRequest=null),"string"==typeof e){var l=r._requestManager.normalizeStyleURL(e),u=r._requestManager.transformRequest(l,t.ResourceType.Style);n._request=t.getJSON(u,(function(e,i){n._request=null,e?n.fire(new t.ErrorEvent(e)):i&&c(i);}));}else c(e);},i.prototype.addEleSymbolVertexs=function(t,e){this.style.addEleSymbolVertexs(t,e);},i.prototype.addMask=function(t){if(t)return t?"geojson"!=t.type?void console.warn("Error:输入参数应为GeoJSON数据源"):this.hasMask()?void console.warn("Error:地图已经存在遮罩"):(t.maxzoom||(t.maxzoom=this.getMaxZoom()),this.style.addSource("__tileMask",t),this.painter.addMaskBuffer("__tileMask"),this._update(!0)):void 0;console.warn("Error:输入参数不能为空");},i.prototype.hasMask=function(){return !!this.style.getSource("__tileMask")},i.prototype.removeMask=function(){return this.hasMask()&&(this.style.removeSource("__tileMask"),this.painter.removeMaskBuffer()),this._update(!0)},i.prototype._addCustomSource=function(e){t._addCustomSource(e);},i.prototype._removeCustomSource=function(e){t._removeCustomSource(e);},i}(function(i){function o(e){var r=this;if(null!=(e=t.extend({},Eo,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=t.crs(e);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._isInitialLoad=!0,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._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 To))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container;}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return 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)),this.handlers=new _o(this,e),this._hash=e.hash&&new Tr("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._localFontFamily=e.localFontFamily,this._localIdeographFontFamily=e.localIdeographFontFamily,e.style&&this.setStyle(e.style,{localFontFamily:this._localFontFamily,localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new go({customAttribution:e.customAttribution})),this.addControl(new yo,e.logoPosition),this.on("style.load",(function(e){r.transform.unmodified&&r.jumpTo(r.style.stylesheet),t.addWaterMarkLayer(r);})),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,i){if(void 0===i&&e.getDefaultPosition&&(i=e.getDefaultPosition()),void 0===i&&(i="top-right"),!e||!e.onAdd)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var r=e.onAdd(this);this._controls.push(e);var o=this._controlPositions[i];return -1!==i.indexOf("bottom")?o.insertBefore(r,o.firstChild):o.appendChild(r),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 i=this._controls.indexOf(e);return i>-1&&this._controls.splice(i,1),e.onRemove(this),this},o.prototype.resize=function(e){var i=this._containerDimensions(),r=i[0],o=i[1];this._resizeCanvas(r,o),this.transform.resize(r,o),this.painter.resize(r,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?1:t)>=1&&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 1 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,i){var r,o=this;if("mouseenter"===t||"mouseover"===t){var n=!1;return {layer:e,listener:i,delegates:{mousemove:function(r){var a=o.getLayer(e)?o.queryRenderedFeatures(r.point,{layers:[e]}):[];a.length?n||(n=!0,i.call(o,new zr(t,o,r.originalEvent,{features:a}))):n=!1;},mouseout:function(){n=!1;}}}}if("mouseleave"===t||"mouseout"===t){var a=!1;return {layer:e,listener:i,delegates:{mousemove:function(r){(o.getLayer(e)?o.queryRenderedFeatures(r.point,{layers:[e]}):[]).length?a=!0:a&&(a=!1,i.call(o,new zr(t,o,r.originalEvent)));},mouseout:function(e){a&&(a=!1,i.call(o,new zr(t,o,e.originalEvent)));}}}}return {layer:e,listener:i,delegates:(r={},r[t]=function(t){var r=o.getLayer(e)?o.queryRenderedFeatures(t.point,{layers:[e]}):[];r.length&&(t.features=r,i.call(o,t),delete t.features);},r)}},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 c in s.delegates)o.off(c,s.delegates[c]);return n.splice(a,1),o}}}(this._delegatedListeners),this)},o.prototype.queryRenderedFeatures=function(e,i){if(!this.style)return [];var r;if(void 0!==i||void 0===e||e instanceof t.Point||Array.isArray(e)||(i=e,e=void 0),i=i||{},(e=e||[[0,0],[this.transform.width,this.transform.height]])instanceof t.Point||"number"==typeof e[0])r=[t.Point.convert(e)];else {var o=t.Point.convert(e[0]),n=t.Point.convert(e[1]);r=[o,new t.Point(n.x,o.y),n,new t.Point(o.x,n.y),o];}return this.style.queryRenderedFeatures(r,i,this.transform)},o.prototype.querySourceFeatures=function(t,e){return this.style.querySourceFeatures(t,e)},o.prototype.setStyle=function(e,i){return !1!==(i=t.extend({},{localIdeographFontFamily:this._localIdeographFontFamily,localFontFamily:this._localFontFamily},i)).diff&&i.localIdeographFontFamily===this._localIdeographFontFamily&&i.localFontFamily===this._localFontFamily&&this.style&&e?(this._diffStyle(e,i),this):(this._localIdeographFontFamily=i.localIdeographFontFamily,this._localFontFamily=i.localFontFamily,this._updateStyle(e,i))},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 Ue(this,e||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof t?this.style.loadURL(t):this.style.loadJSON(t),this):(delete this.style,this)},o.prototype._lazyInitEmptyStyle=function(){this.style||(this.style=new Ue(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty());},o.prototype._diffStyle=function(e,i){var r=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?r.fire(new t.ErrorEvent(e)):o&&r._updateDiff(o,i);}));}else "object"==typeof e&&this._updateDiff(e,i);},o.prototype._updateDiff=function(e,i){try{this.style.setState(e,i)&&(JSON.stringify(e.xml)==JSON.stringify(this.getStyle().xml)?(i.diff=!1,this._updateStyle(e,i)):this._update(!0));}catch(r){t.warnOnce("Unable to perform style diff: "+(r.message||r.error||r)+". Rebuilding the style from scratch."),this._updateStyle(e,i);}},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 i=this.style&&this.style._getSourceCaches(e);if(0!==i.length)return i.every((function(t){return t.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 i=t[e]._tiles;for(var r in i){var o=i[r];if("loaded"!==o.state&&"errored"!==o.state)return !1}}return !0},o.prototype.addSourceType=function(t,e,i){return this._lazyInitEmptyStyle(),this.style.addSourceType(t,e,i)},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,i,r){void 0===r&&(r={});var o=r.pixelRatio;void 0===o&&(o=1);var n=r.sdf;void 0===n&&(n=!1);var a=r.stretchX,s=r.stretchY,c=r.content;if(this._lazyInitEmptyStyle(),i instanceof xo||So&&i instanceof So){var l=t.browser.getImageData(i);this.style.addImage(e,{data:new t.RGBAImage({width:l.width,height:l.height},l.data),pixelRatio:o,stretchX:a,stretchY:s,content:c,sdf:n,version:0});}else {if(void 0===i.width||void 0===i.height)return this.fire(new t.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));var u=i;this.style.addImage(e,{data:new t.RGBAImage({width:i.width,height:i.height},new Uint8Array(i.data)),pixelRatio:o,stretchX:a,stretchY:s,content:c,sdf:n,version:0,userImage:u}),u.onAdd&&u.onAdd(this,e);}},o.prototype.updateImage=function(e,i){var r=this.style.getImage(e);if(!r)return this.fire(new t.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));var o=i instanceof xo||So&&i instanceof So?t.browser.getImageData(i):i,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!==r.data.width||a!==r.data.height?this.fire(new t.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image"))):(r.data.replace(s,!(i instanceof xo||So&&i instanceof So)),void this.style.updateImage(e,r))},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,i){t.getImage(this._requestManager.transformRequest(e,t.ResourceType.Image),i);},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,i){return this.style.setLayerZoomRange(t,e,i),this._update(!0)},o.prototype.setFilter=function(t,e,i){return void 0===i&&(i={}),this.style.setFilter(t,e,i),this._update(!0)},o.prototype.getFilter=function(t){return this.style.getFilter(t)},o.prototype.setPaintProperty=function(t,e,i,r){return void 0===r&&(r={}),this.style.setPaintProperty(t,e,i,r),this._update(!0)},o.prototype.getPaintProperty=function(t,e){return this.style.getPaintProperty(t,e)},o.prototype.setLayoutProperty=function(t,e,i,r){return void 0===r&&(r={}),this.style.setLayoutProperty(t,e,i,r),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._detectMissingCSS=function(){"rgb(250, 128, 114)"!==t.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")&&t.warnOnce("This page appears to be missing CSS declarations for sgmap JS, which may cause the map to display incorrectly. Please ensure your page includes sgmap.css, as described in https://www.sgmap.com/sgmap-js/api/.");},o.prototype._setupContainer=function(){var t=this._container;t.classList.add("sgmap-map"),(this._missingCSSCanary=r.create("div","sgmap-canary",t)).style.visibility="hidden",this._detectMissingCSS();var e=this._canvasContainer=r.create("div","sgmap-canvas-container",t);this._interactive&&e.classList.add("sgmap-interactive"),this._canvas=r.create("canvas","sgmap-canvas",e),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map");var i=this._containerDimensions();this._resizeCanvas(i[0],i[1]);var o=this._controlContainer=r.create("div","sgmap-control-container",t),n=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((function(t){n[t]=r.create("div","sgmap-ctrl-"+t,o);}));},o.prototype._resizeCanvas=function(e,i){var r=t.browser.devicePixelRatio||1;this._canvas.width=r*e,this._canvas.height=r*i,this._canvas.style.width=e+"px",this._canvas.style.height=i+"px";},o.prototype._setupPainter=function(){var i=t.extend({},e.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),r=this._canvas.getContext("webgl",i)||this._canvas.getContext("experimental-webgl",i);r?(this.painter=new xr(r,this.transform),t.webpSupported.testSupport(r)):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.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 i,r=this,o=0,n=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(i=n.createQueryEXT(),n.beginQueryEXT(n.TIME_ELAPSED_EXT,i),o=t.browser.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(e),!this._removed){var a=!1,s=this._isInitialLoad?0:this._fadeDuration;if(this.style&&this._styleDirty){this._styleDirty=!1;var c=this.transform.zoom,l=t.browser.now();this.style.zoomHistory.update(c,l);var u=new t.EvaluationParameters(c,{now:l,fadeDuration:s,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),h=u.crossFadingFactor();1===h&&h===this._crossFadingFactor||(a=!0,this._crossFadingFactor=h),this.style.update(u);}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,s,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:s,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 p=t.browser.now()-o;n.endQueryEXT(n.TIME_ELAPSED_EXT,i),setTimeout((function(){var e=n.getQueryObjectEXT(i,n.QUERY_RESULT_EXT)/1e6;n.deleteQueryEXT(i),r.fire(new t.Event("gpu-timing-frame",{cpuTime:p,gpuTime:e}));}),50);}if(this.listens("gpu-timing-layer")){var f=this.painter.collectGpuTimers();setTimeout((function(){var e=r.painter.queryGpuTimers(f);r.fire(new t.Event("gpu-timing-layer",{layerTimes:e}));}),50);}return this._sourcesDirty||this._styleDirty||this._placementDirty||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&(this._fullyLoaded||(this._fullyLoaded=!0),this._triggerFrame(!1),this.fire(new t.Event("idle")),this._isInitialLoad=!1,t.window.beginTime&&console.log("加载时间:",(new Date).getTime()-t.window.beginTime)),this}},o.prototype.remove=function(){this._hash&&this._hash.remove();for(var e=0,i=this._controls;e<i.length;e+=1)i[e].onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),void 0!==t.window&&(t.window.removeEventListener("resize",this._onWindowResize,!1),t.window.removeEventListener("online",this._onWindowOnline,!1));var r=this.painter.context.gl.getExtension("WEBGL_lose_context");r&&r.loseContext(),Ao(this._canvasContainer),Ao(this._controlContainer),Ao(this._missingCSSCanary),this._container.classList.remove("sgmap-map"),this._removed=!0,this.fire(new t.Event("remove"));},o.prototype.triggerRepaint=function(){this._triggerFrame(!0);},o.prototype._triggerFrame=function(e){var i=this;this._renderNextFrame=this._renderNextFrame||e,this.style&&!this._frame&&(this._frame=t.browser.frame((function(t){var e=!!i._renderNextFrame;i._frame=null,i._renderNextFrame=null,e&&i._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},n.vertices.set=function(t){this._vertices=t,this._update();},o.prototype._setCacheLimits=function(e,i){t.setCacheLimits(e,i);},n.version.get=function(){return t.version},Object.defineProperties(o.prototype,n),o}(mo)),Io={showCompass:!0,showZoom:!0,visualizePitch:!1},Bo=function(e){var i=this;this.options=t.extend({},Io,e),this._container=r.create("div","sgmap-ctrl sgmap-ctrl-group"),this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this.options.showZoom&&(t.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("sgmap-ctrl-zoom-in",(function(t){return i._map.zoomIn({},{originalEvent:t})})),r.create("span","sgmap-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden",!0),this._zoomOutButton=this._createButton("sgmap-ctrl-zoom-out",(function(t){return i._map.zoomOut({},{originalEvent:t})})),r.create("span","sgmap-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden",!0)),this.options.showCompass&&(t.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("sgmap-ctrl-compass",(function(t){i.options.visualizePitch?i._map.resetNorthPitch({},{originalEvent:t}):i._map.resetNorth({},{originalEvent:t});})),this._compassIcon=r.create("span","sgmap-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden",!0));};Bo.prototype._updateZoomButtons=function(){var t=this._map.getZoom();this._zoomInButton.disabled=t===this._map.getMaxZoom(),this._zoomOutButton.disabled=t===this._map.getMinZoom();},Bo.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;},Bo.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},Bo.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;},Bo.prototype._createButton=function(t,e){var i=r.create("button",t,this._container);return i.type="button",i.addEventListener("click",e),i},Bo.prototype._setButtonTitle=function(t,e){var i=this._map._getUIString("NavigationControl."+e);t.title=i,t.setAttribute("aria-label",i);};var Po=function(e,i,o){void 0===o&&(o=!1),this._clickTolerance=10,this.element=i,this.mouseRotate=new Zr({clickTolerance:e.dragRotate._mouseRotate._clickTolerance}),this.map=e,o&&(this.mousePitch=new Gr({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 Co(e,i,r){if(e=new t.LngLat(e.lng,e.lat),i){var o=new t.LngLat(e.lng-360,e.lat),n=new t.LngLat(e.lng+360,e.lat),a=r.locationPoint(e).distSqr(i);r.locationPoint(o).distSqr(i)<a?e=o:r.locationPoint(n).distSqr(i)<a&&(e=n);}for(;Math.abs(e.lng-r.center.lng)>180;){var s=r.locationPoint(e);if(s.x>=0&&s.y>=0&&s.x<=r.width&&s.y<=r.height)break;e.lng>r.center.lng?e.lng-=360:e.lng+=360;}return e}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 i=this.map,r=this.mouseRotate.mousemoveWindow(t,e);if(r&&r.bearingDelta&&i.setBearing(i.getBearing()+r.bearingDelta),this.mousePitch){var o=this.mousePitch.mousemoveWindow(t,e);o&&o.pitchDelta&&i.setPitch(i.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 Do(t,e,i){var r=t.classList;for(var o in zo)r.remove("sgmap-"+i+"-anchor-"+o);r.add("sgmap-"+i+"-anchor-"+e);}var Mo,Ro=function(e){function i(i,o){var n=this;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._draggable=i&&i.draggable||!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 a=r.createNS("http://www.w3.org/2000/svg","svg");a.setAttributeNS(null,"display","block"),a.setAttributeNS(null,"height","41px"),a.setAttributeNS(null,"width","27px"),a.setAttributeNS(null,"viewBox","0 0 27 41");var s=r.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"stroke","none"),s.setAttributeNS(null,"stroke-width","1"),s.setAttributeNS(null,"fill","none"),s.setAttributeNS(null,"fill-rule","evenodd");var c=r.createNS("http://www.w3.org/2000/svg","g");c.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 u=0,h=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];u<h.length;u+=1){var p=h[u],f=r.createNS("http://www.w3.org/2000/svg","ellipse");f.setAttributeNS(null,"opacity","0.04"),f.setAttributeNS(null,"cx","10.5"),f.setAttributeNS(null,"cy","5.80029008"),f.setAttributeNS(null,"rx",p.rx),f.setAttributeNS(null,"ry",p.ry),l.appendChild(f);}var d=r.createNS("http://www.w3.org/2000/svg","g");d.setAttributeNS(null,"fill",this._color);var _=r.createNS("http://www.w3.org/2000/svg","path");_.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(_);var m=r.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"opacity","0.25"),m.setAttributeNS(null,"fill","#000000");var g=r.createNS("http://www.w3.org/2000/svg","path");g.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(g);var v=r.createNS("http://www.w3.org/2000/svg","g");v.setAttributeNS(null,"transform","translate(6.0, 7.0)"),v.setAttributeNS(null,"fill","#FFFFFF");var y=r.createNS("http://www.w3.org/2000/svg","g");y.setAttributeNS(null,"transform","translate(8.0, 8.0)");var b=r.createNS("http://www.w3.org/2000/svg","circle");b.setAttributeNS(null,"fill","#000000"),b.setAttributeNS(null,"opacity","0.25"),b.setAttributeNS(null,"cx","5.5"),b.setAttributeNS(null,"cy","5.5"),b.setAttributeNS(null,"r","5.4999962");var w=r.createNS("http://www.w3.org/2000/svg","circle");w.setAttributeNS(null,"fill","#FFFFFF"),w.setAttributeNS(null,"cx","5.5"),w.setAttributeNS(null,"cy","5.5"),w.setAttributeNS(null,"r","5.4999962"),y.appendChild(b),y.appendChild(w),c.appendChild(l),c.appendChild(d),c.appendChild(m),c.appendChild(v),c.appendChild(y),a.appendChild(c),this._element.appendChild(a),this._offset=t.Point.convert(i&&i.offset||[0,-14]);}this._element.classList.add("sgmap-marker"),this._element.addEventListener("dragstart",(function(t){t.preventDefault();})),this._element.addEventListener("mousedown",(function(t){t.preventDefault();})),this._element.addEventListener("focus",(function(){var t=n._map.getContainer();t.scrollTop=0,t.scrollLeft=0;})),Do(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,i=t.charCode||t.keyCode;"Space"!==e&&"Enter"!==e&&32!==i&&13!==i||this.togglePopup();},i.prototype._onMapClick=function(t){var e=t.originalEvent.target,i=this._element;this._popup&&(e===i||i.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=Co(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){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._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._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),Lo={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Oo=0,Fo=!1,Uo=function(e){function i(){e.apply(this,arguments);}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype._parsePosition=function(e,i){t.makeRequest({method:"POST",url:t.config$1.API_URL+"/geoconv/v2",type:"json",body:"coords="+e.join(",")+"&from=1&encode=0",headers:{Authorization:t.config$1.ACCESS_TOKEN,"Content-Type":"application/x-www-form-urlencoded;charset=utf-8"}},i);},i.prototype._onSuccess=function(t){var i=this;this._parsePosition([t.coords.longitude,t.coords.latitude],(function(r,o){if(!r&&1e4===o.code){var n=o.value.map((function(t){return [t.x,t.y]}));e.prototype._onSuccess.call(i,{coords:{longitude:n[0][0],latitude:n[0][1],accuracy:t.coords.accuracy}});}}));},i}(function(e){function i(i){e.call(this),this.options=t.extend({},Lo,i),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","sgmap-ctrl sgmap-ctrl-group"),i=this._setupUI,void 0!==Mo?i(Mo):void 0!==t.window.navigator.permissions?t.window.navigator.permissions.query({name:"geolocation"}).then((function(t){i(Mo="denied"!==t.state);})):i(Mo=!!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,Oo=0,Fo=!1;},i.prototype._isOutOfMapMaxBounds=function(t){var e=this._map.getMaxBounds(),i=t.coords;return e&&(i.longitude<e.getWest()||i.longitude>e.getEast()||i.latitude<e.getSouth()||i.latitude>e.getNorth())},i.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("sgmap-ctrl-geolocate-active"),this._geolocateButton.classList.add("sgmap-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("sgmap-ctrl-geolocate-active"),this._geolocateButton.classList.add("sgmap-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("sgmap-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("sgmap-ctrl-geolocate-background"),this._geolocateButton.classList.add("sgmap-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("sgmap-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("sgmap-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("sgmap-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("sgmap-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("sgmap-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("sgmap-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("sgmap-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("sgmap-user-location-dot-stale"),this.fire(new t.Event("geolocate",e)),this._finish();}},i.prototype._updateCamera=function(e){var i=new t.LngLat(e.coords.longitude,e.coords.latitude),r=e.coords.accuracy,o=this._map.getBearing(),n=t.extend({bearing:o},this.options.fitBoundsOptions);this._map.fitBounds(i.toBounds(r),n,{geolocateSource:!0});},i.prototype._updateMarker=function(e){if(e){var i=new t.LngLat(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(i).addTo(this._map),this._userLocationDotMarker.setLngLat(i).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius();}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove();},i.prototype._updateCircleRadius=function(){var t=this._map._container.clientHeight/2,e=this._map.unproject([0,t]),i=this._map.unproject([1,t]),r=e.distanceTo(i),o=Math.ceil(2*this._accuracy/r);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("sgmap-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("sgmap-ctrl-geolocate-active"),this._geolocateButton.classList.remove("sgmap-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("sgmap-ctrl-geolocate-background"),this._geolocateButton.classList.remove("sgmap-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i),void 0!==this._geolocationWatchID&&this._clearWatch();}else {if(3===e.code&&Fo)return;this._setErrorState();}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("sgmap-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","sgmap-ctrl-geolocate",this._container),r.create("span","sgmap-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","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=r.create("div","sgmap-user-location-dot"),this._userLocationDotMarker=new Ro(this._dotElement),this._circleElement=r.create("div","sgmap-user-location-accuracy-circle"),this._accuracyCircleMarker=new Ro({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("sgmap-ctrl-geolocate-background"),i._geolocateButton.classList.remove("sgmap-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":Oo--,Fo=!1,this._watchState="OFF",this._geolocateButton.classList.remove("sgmap-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("sgmap-ctrl-geolocate-active"),this._geolocateButton.classList.remove("sgmap-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("sgmap-ctrl-geolocate-background"),this._geolocateButton.classList.remove("sgmap-ctrl-geolocate-background-error"),this.fire(new t.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("sgmap-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("sgmap-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("sgmap-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("sgmap-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("sgmap-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("sgmap-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("sgmap-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("sgmap-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("sgmap-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("sgmap-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++Oo>1?(e={maximumAge:6e5,timeout:0},Fo=!0):(e=this.options.positionOptions,Fo=!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("sgmap-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null);},i}(t.Evented)),No=function(){t.bindAll(["_onClickPitch","_changeIcon"],this);};No.prototype.getDefaultPosition=function(){return "bottom-right"},No.prototype.onAdd=function(t){return this._map=t,this._container=r.create("div","sgmap-ctrl sgmap-ctrl-group"),this._pitchControlBtn=r.create("button","sgmap-ctrl-pitch-text",this._container),this._pitchControlBtn.innerHTML="2D",this._pitchControlBtn.addEventListener("click",this._onClickPitch),this._map.on("pitch",this._changeIcon),this._container},No.prototype.onRemove=function(){this._map.off("pitch",this._changeIcon),r.remove(this._container);},No.prototype._onClickPitch=function(){this._ispitch?(this._pitchControlBtn.innerHTML="2D",this._map.easeTo({pitch:0}),this._ispitch=!1):(this._pitchControlBtn.innerHTML="3D",this._map.easeTo({pitch:50}),this._ispitch=!0);},No.prototype._changeIcon=function(){0!=this._map.getPitch()?(this._pitchControlBtn.innerHTML="3D",this._ispitch=!0):(this._pitchControlBtn.innerHTML="2D",this._ispitch=!1);};var jo={maxWidth:100,unit:"metric"},Vo=function(e){this.options=t.extend({},jo,e),t.bindAll(["_onMove","setUnit"],this);};function qo(t,e,i){var r,o,n,a,s,c,l=i&&i.maxWidth||100,u=t._container.clientHeight/2,h=(r=t.unproject([0,u]),o=t.unproject([l,u]),n=Math.PI/180,a=r.lat*n,s=o.lat*n,c=Math.sin(a)*Math.sin(s)+Math.cos(a)*Math.cos(s)*Math.cos((o.lng-r.lng)*n),6371e3*Math.acos(Math.min(c,1)));if(i&&"imperial"===i.unit){var p=3.2808*h;p>5280?Zo(e,l,p/5280,"mi"):Zo(e,l,p,"ft");}else i&&"nautical"===i.unit?Zo(e,l,h/1852,"nm"):Zo(e,l,h,"m");}function Zo(t,e,i,r){var o,n,a,s=(o=i,(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))),c=s/i;"m"===r&&s>=1e3&&(s/=1e3,r="km"),t.parentElement.style.width=e*c+"px",t.innerHTML=s+r;}Vo.prototype.getDefaultPosition=function(){return "bottom-left"},Vo.prototype._onMove=function(){qo(this._map,this._scaleText,this.options);},Vo.prototype.onAdd=function(t){return this._map=t,this._container=r.create("div","sgmap-ctrl-scale-ruler",t.getContainer()),this._scaleText=r.create("div","sgmap-csr-text",this._container),r.create("div","sgmap-csr-barbg sgmap-csr-barbg--h",this._container),r.create("div","sgmap-csr-barbg sgmap-csr-barbg--r",this._container),r.create("div","sgmap-csr-barbg sgmap-csr-barbg--l",this._container),r.create("div","sgmap-csr-bar sgmap-csr-bar--h",this._container),r.create("div","sgmap-csr-bar sgmap-csr-bar--r",this._container),r.create("div","sgmap-csr-bar sgmap-csr-bar--l",this._container),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._scaleText,this.options);};var Go=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");};Go.prototype.onAdd=function(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","sgmap-ctrl sgmap-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},Go.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon);},Go.prototype._checkFullscreenSupport=function(){return !!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},Go.prototype._setupUI=function(){var e=this._fullscreenButton=r.create("button","sgmap-ctrl-fullscreen",this._controlContainer);r.create("span","sgmap-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);},Go.prototype._updateTitle=function(){var t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t;},Go.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Go.prototype._isFullscreen=function(){return this._fullscreen},Go.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("sgmap-ctrl-shrink"),this._fullscreenButton.classList.toggle("sgmap-ctrl-fullscreen"),this._updateTitle());},Go.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 Ho={closeButton:!0,closeOnClick:!0,className:"",maxWidth:"240px"},Wo=function(e){function i(i){e.call(this),this.options=t.extend(Object.create(Ho),i),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._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("sgmap-popup-track-pointer"),this._map._canvasContainer.classList.add("sgmap-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("sgmap-popup-track-pointer"),this._map._canvasContainer.classList.remove("sgmap-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("sgmap-popup-track-pointer"),this._map._canvasContainer.classList.add("sgmap-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 i,r=t.window.document.createDocumentFragment(),o=t.window.document.createElement("body");for(o.innerHTML=e;i=o.firstChild;)r.appendChild(i);return this.setDOMContent(r)},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){return this._createContent(),this._content.appendChild(t),this._update(),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.toggleClassName=function(t){if(this._container)return this._container.classList.toggle(t)},i.prototype._createContent=function(){this._content&&r.remove(this._content),this._content=r.create("div","sgmap-popup-content",this._container),this.options.closeButton&&(this._closeButton=r.create("button","sgmap-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClose));},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","sgmap-popup",this._map.getContainer()),this._tip=r.create("div","sgmap-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("sgmap-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=Co(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(i){if(i){if("number"==typeof i){var r=Math.round(Math.sqrt(.5*Math.pow(i,2)));return {center:new t.Point(0,0),top:new t.Point(0,i),"top-left":new t.Point(r,r),"top-right":new t.Point(-r,r),bottom:new t.Point(0,-i),"bottom-left":new t.Point(r,-r),"bottom-right":new t.Point(-r,-r),left:new t.Point(i,0),right:new t.Point(-i,0)}}if(i instanceof t.Point||Array.isArray(i)){var o=t.Point.convert(i);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(i.center||[0,0]),top:t.Point.convert(i.top||[0,0]),"top-left":t.Point.convert(i["top-left"]||[0,0]),"top-right":t.Point.convert(i["top-right"]||[0,0]),bottom:t.Point.convert(i.bottom||[0,0]),"bottom-left":t.Point.convert(i["bottom-left"]||[0,0]),"bottom-right":t.Point.convert(i["bottom-right"]||[0,0]),left:t.Point.convert(i.left||[0,0]),right:t.Point.convert(i.right||[0,0])}}return e(new t.Point(0,0))}(this.options.offset);if(!n){var s,c=this._container.offsetWidth,l=this._container.offsetHeight;s=o.y+a.bottom.y<l?["top"]:o.y>this._map.transform.height-l?["bottom"]:[],o.x<c/2?s.push("left"):o.x>this._map.transform.width-c/2&&s.push("right"),n=0===s.length?"bottom":s.join("-");}var u=o.add(a[n]).round();r.setTransform(this._container,zo[n]+" translate("+u.x+"px,"+u.y+"px)"),Do(this._container,n,"popup");}},i.prototype._onClose=function(){this.remove();},i}(t.Evented),Xo=t.createCommonjsModule((function(e,i){e.exports=function(){function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,r=new Array(e);i<e;i++)r[i]=t[i];return r}function i(t,i){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,i){if(t){if("string"==typeof t)return e(t,i);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)?e(t,i):void 0}}(t))||i&&t&&"number"==typeof t.length){r&&(t=r);var o=0,n=function(){};return {s:n,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return {s:function(){r=t[Symbol.iterator]();},n:function(){var t=r.next();return s=t.done,t},e:function(t){c=!0,a=t;},f:function(){try{s||null==r.return||r.return();}finally{if(c)throw a}}}}var r=null,o=r=r||function(){var t,e,i,r,o,n,a,s,c,l,u,h,p,f,d,_,m,g,v,y,b,w,x,T,S,E,A,k,I,B,P,C,z,D,M,R,L,O,F,U,N,j,V,q,Z,G,H,W,X,K,Y,J,Q,$,tt,et,it,rt,ot,nt,at,st,ct,lt,ut,ht,pt,ft,dt,_t,mt,gt,vt,yt,bt,wt,xt,Tt,St,Et,At,kt,It,Bt,Pt,Ct=Ct||(t=Math,e=Object.create||function(t){var e;return zt.prototype=t,e=new zt,zt.prototype=null,e},r=(i={}).lib={},o=r.Base={extend:function(t){var i=e(this);return t&&i.mixIn(t),i.hasOwnProperty("init")&&this.init!==i.init||(i.init=function(){i.$super.init.apply(this,arguments);}),(i.init.prototype=i).$super=this,i},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString);},clone:function(){return this.init.prototype.extend(this)}},n=r.WordArray=o.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length;},toString:function(t){return (t||s).stringify(this)},concat:function(t){var e=this.words,i=t.words,r=this.sigBytes,o=t.sigBytes;if(this.clamp(),r%4)for(var n=0;n<o;n++)e[r+n>>>2]|=(i[n>>>2]>>>24-n%4*8&255)<<24-(r+n)%4*8;else for(n=0;n<o;n+=4)e[r+n>>>2]=i[n>>>2];return this.sigBytes+=o,this},clamp:function(){var e=this.words,i=this.sigBytes;e[i>>>2]&=4294967295<<32-i%4*8,e.length=t.ceil(i/4);},clone:function(){var t=o.clone.call(this);return t.words=this.words.slice(0),t},random:function(e){for(var i=[],r=function(e){e=e;var i=987654321,r=4294967295;return function(){var o=((i=36969*(65535&i)+(i>>16)&r)<<16)+(e=18e3*(65535&e)+(e>>16)&r)&r;return o/=4294967296,(o+=.5)*(.5<t.random()?1:-1)}},o=0;o<e;o+=4){var a=r(4294967296*(s||t.random())),s=987654071*a();i.push(4294967296*a()|0);}return new n.init(i,e)}}),a=i.enc={},s=a.Hex={stringify:function(t){for(var e=t.words,i=t.sigBytes,r=[],o=0;o<i;o++){var n=e[o>>>2]>>>24-o%4*8&255;r.push((n>>>4).toString(16)),r.push((15&n).toString(16));}return r.join("")},parse:function(t){for(var e=t.length,i=[],r=0;r<e;r+=2)i[r>>>3]|=parseInt(t.substr(r,2),16)<<24-r%8*4;return new n.init(i,e/2)}},c=a.Latin1={stringify:function(t){for(var e=t.words,i=t.sigBytes,r=[],o=0;o<i;o++)r.push(String.fromCharCode(e[o>>>2]>>>24-o%4*8&255));return r.join("")},parse:function(t){for(var e=t.length,i=[],r=0;r<e;r++)i[r>>>2]|=(255&t.charCodeAt(r))<<24-r%4*8;return new n.init(i,e)}},l=a.Utf8={stringify:function(t){try{return decodeURIComponent(escape(c.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return c.parse(unescape(encodeURIComponent(t)))}},u=r.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new n.init,this._nDataBytes=0;},_append:function(t){"string"==typeof t&&(t=l.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes;},_process:function(e){var i=this._data,r=i.words,o=i.sigBytes,a=this.blockSize,s=o/(4*a),c=(s=e?t.ceil(s):t.max((0|s)-this._minBufferSize,0))*a,l=t.min(4*c,o);if(c){for(var u=0;u<c;u+=a)this._doProcessBlock(r,u);var h=r.splice(0,c);i.sigBytes-=l;}return new n.init(h,l)},clone:function(){var t=o.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0}),r.Hasher=u.extend({cfg:o.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset();},reset:function(){u.reset.call(this),this._doReset();},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(e,i){return new t.init(i).finalize(e)}},_createHmacHelper:function(t){return function(e,i){return new h.HMAC.init(t,i).finalize(e)}}}),h=i.algo={},i);function zt(){}function Dt(t,e,i){return t&e|~t&i}function Mt(t,e,i){return t&i|e&~i}function Rt(t,e){return t<<e|t>>>32-e}function Lt(t,e,i,r){var o,n=this._iv;n?(o=n.slice(0),this._iv=void 0):o=this._prevBlock,r.encryptBlock(o,0);for(var a=0;a<i;a++)t[e+a]^=o[a];}function Ot(t){var e,i,r;return 255==(t>>24&255)?(i=t>>8&255,r=255&t,255==(e=t>>16&255)?(e=0,255===i?(i=0,255===r?r=0:++r):++i):++e,t=0,t+=e<<16,t+=i<<8,t+=r):t+=1<<24,t}function Ft(){for(var t=this._X,e=this._C,i=0;i<8;i++)bt[i]=e[i];for(e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0<bt[0]>>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0<bt[1]>>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0<bt[2]>>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0<bt[3]>>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0<bt[4]>>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0<bt[5]>>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0<bt[6]>>>0?1:0)|0,this._b=e[7]>>>0<bt[7]>>>0?1:0,i=0;i<8;i++){var r=t[i]+e[i],o=65535&r,n=r>>>16;wt[i]=((o*o>>>17)+o*n>>>15)+n*n^((4294901760&r)*r|0)+((65535&r)*r|0);}t[0]=wt[0]+(wt[7]<<16|wt[7]>>>16)+(wt[6]<<16|wt[6]>>>16)|0,t[1]=wt[1]+(wt[0]<<8|wt[0]>>>24)+wt[7]|0,t[2]=wt[2]+(wt[1]<<16|wt[1]>>>16)+(wt[0]<<16|wt[0]>>>16)|0,t[3]=wt[3]+(wt[2]<<8|wt[2]>>>24)+wt[1]|0,t[4]=wt[4]+(wt[3]<<16|wt[3]>>>16)+(wt[2]<<16|wt[2]>>>16)|0,t[5]=wt[5]+(wt[4]<<8|wt[4]>>>24)+wt[3]|0,t[6]=wt[6]+(wt[5]<<16|wt[5]>>>16)+(wt[4]<<16|wt[4]>>>16)|0,t[7]=wt[7]+(wt[6]<<8|wt[6]>>>24)+wt[5]|0;}function Ut(){for(var t=this._X,e=this._C,i=0;i<8;i++)It[i]=e[i];for(e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0<It[0]>>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0<It[1]>>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0<It[2]>>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0<It[3]>>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0<It[4]>>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0<It[5]>>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0<It[6]>>>0?1:0)|0,this._b=e[7]>>>0<It[7]>>>0?1:0,i=0;i<8;i++){var r=t[i]+e[i],o=65535&r,n=r>>>16;Bt[i]=((o*o>>>17)+o*n>>>15)+n*n^((4294901760&r)*r|0)+((65535&r)*r|0);}t[0]=Bt[0]+(Bt[7]<<16|Bt[7]>>>16)+(Bt[6]<<16|Bt[6]>>>16)|0,t[1]=Bt[1]+(Bt[0]<<8|Bt[0]>>>24)+Bt[7]|0,t[2]=Bt[2]+(Bt[1]<<16|Bt[1]>>>16)+(Bt[0]<<16|Bt[0]>>>16)|0,t[3]=Bt[3]+(Bt[2]<<8|Bt[2]>>>24)+Bt[1]|0,t[4]=Bt[4]+(Bt[3]<<16|Bt[3]>>>16)+(Bt[2]<<16|Bt[2]>>>16)|0,t[5]=Bt[5]+(Bt[4]<<8|Bt[4]>>>24)+Bt[3]|0,t[6]=Bt[6]+(Bt[5]<<16|Bt[5]>>>16)+(Bt[4]<<16|Bt[4]>>>16)|0,t[7]=Bt[7]+(Bt[6]<<8|Bt[6]>>>24)+Bt[5]|0;}return p=Ct.lib.WordArray,Ct.enc.Base64={stringify:function(t){var e=t.words,i=t.sigBytes,r=this._map;t.clamp();for(var o=[],n=0;n<i;n+=3)for(var a=(e[n>>>2]>>>24-n%4*8&255)<<16|(e[n+1>>>2]>>>24-(n+1)%4*8&255)<<8|e[n+2>>>2]>>>24-(n+2)%4*8&255,s=0;s<4&&n+.75*s<i;s++)o.push(r.charAt(a>>>6*(3-s)&63));var c=r.charAt(64);if(c)for(;o.length%4;)o.push(c);return o.join("")},parse:function(t){var e=t.length,i=this._map,r=this._reverseMap;if(!r){r=this._reverseMap=[];for(var o=0;o<i.length;o++)r[i.charCodeAt(o)]=o;}var n,a=i.charAt(64);return !a||-1!==(n=t.indexOf(a))&&(e=n),function(t,e,i){for(var r=[],o=0,n=0;n<e;n++){var a,s;n%4&&(a=i[t.charCodeAt(n-1)]<<n%4*2,s=i[t.charCodeAt(n)]>>>6-n%4*2,r[o>>>2]|=(a|s)<<24-o%4*8,o++);}return p.create(r,o)}(t,e,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},function(t){var e=Ct,i=e.lib,r=i.WordArray,o=i.Hasher,n=e.algo,a=[];!function(){for(var e=0;e<64;e++)a[e]=4294967296*t.abs(t.sin(e+1))|0;}();var s=n.MD5=o.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878]);},_doProcessBlock:function(t,e){for(var i=0;i<16;i++){var r=e+i,o=t[r];t[r]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8);}var n=this._hash.words,s=t[e+0],p=t[e+1],f=t[e+2],d=t[e+3],_=t[e+4],m=t[e+5],g=t[e+6],v=t[e+7],y=t[e+8],b=t[e+9],w=t[e+10],x=t[e+11],T=t[e+12],S=t[e+13],E=t[e+14],A=t[e+15],k=c(k=n[0],P=n[1],B=n[2],I=n[3],s,7,a[0]),I=c(I,k,P,B,p,12,a[1]),B=c(B,I,k,P,f,17,a[2]),P=c(P,B,I,k,d,22,a[3]);k=c(k,P,B,I,_,7,a[4]),I=c(I,k,P,B,m,12,a[5]),B=c(B,I,k,P,g,17,a[6]),P=c(P,B,I,k,v,22,a[7]),k=c(k,P,B,I,y,7,a[8]),I=c(I,k,P,B,b,12,a[9]),B=c(B,I,k,P,w,17,a[10]),P=c(P,B,I,k,x,22,a[11]),k=c(k,P,B,I,T,7,a[12]),I=c(I,k,P,B,S,12,a[13]),B=c(B,I,k,P,E,17,a[14]),k=l(k,P=c(P,B,I,k,A,22,a[15]),B,I,p,5,a[16]),I=l(I,k,P,B,g,9,a[17]),B=l(B,I,k,P,x,14,a[18]),P=l(P,B,I,k,s,20,a[19]),k=l(k,P,B,I,m,5,a[20]),I=l(I,k,P,B,w,9,a[21]),B=l(B,I,k,P,A,14,a[22]),P=l(P,B,I,k,_,20,a[23]),k=l(k,P,B,I,b,5,a[24]),I=l(I,k,P,B,E,9,a[25]),B=l(B,I,k,P,d,14,a[26]),P=l(P,B,I,k,y,20,a[27]),k=l(k,P,B,I,S,5,a[28]),I=l(I,k,P,B,f,9,a[29]),B=l(B,I,k,P,v,14,a[30]),k=u(k,P=l(P,B,I,k,T,20,a[31]),B,I,m,4,a[32]),I=u(I,k,P,B,y,11,a[33]),B=u(B,I,k,P,x,16,a[34]),P=u(P,B,I,k,E,23,a[35]),k=u(k,P,B,I,p,4,a[36]),I=u(I,k,P,B,_,11,a[37]),B=u(B,I,k,P,v,16,a[38]),P=u(P,B,I,k,w,23,a[39]),k=u(k,P,B,I,S,4,a[40]),I=u(I,k,P,B,s,11,a[41]),B=u(B,I,k,P,d,16,a[42]),P=u(P,B,I,k,g,23,a[43]),k=u(k,P,B,I,b,4,a[44]),I=u(I,k,P,B,T,11,a[45]),B=u(B,I,k,P,A,16,a[46]),k=h(k,P=u(P,B,I,k,f,23,a[47]),B,I,s,6,a[48]),I=h(I,k,P,B,v,10,a[49]),B=h(B,I,k,P,E,15,a[50]),P=h(P,B,I,k,m,21,a[51]),k=h(k,P,B,I,T,6,a[52]),I=h(I,k,P,B,d,10,a[53]),B=h(B,I,k,P,w,15,a[54]),P=h(P,B,I,k,p,21,a[55]),k=h(k,P,B,I,y,6,a[56]),I=h(I,k,P,B,A,10,a[57]),B=h(B,I,k,P,g,15,a[58]),P=h(P,B,I,k,S,21,a[59]),k=h(k,P,B,I,_,6,a[60]),I=h(I,k,P,B,x,10,a[61]),B=h(B,I,k,P,f,15,a[62]),P=h(P,B,I,k,b,21,a[63]),n[0]=n[0]+k|0,n[1]=n[1]+P|0,n[2]=n[2]+B|0,n[3]=n[3]+I|0;},_doFinalize:function(){var e=this._data,i=e.words,r=8*this._nDataBytes,o=8*e.sigBytes;i[o>>>5]|=128<<24-o%32;var n=t.floor(r/4294967296),a=r;i[15+(64+o>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),i[14+(64+o>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),e.sigBytes=4*(i.length+1),this._process();for(var s=this._hash,c=s.words,l=0;l<4;l++){var u=c[l];c[l]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8);}return s},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});function c(t,e,i,r,o,n,a){var s=t+(e&i|~e&r)+o+a;return (s<<n|s>>>32-n)+e}function l(t,e,i,r,o,n,a){var s=t+(e&r|i&~r)+o+a;return (s<<n|s>>>32-n)+e}function u(t,e,i,r,o,n,a){var s=t+(e^i^r)+o+a;return (s<<n|s>>>32-n)+e}function h(t,e,i,r,o,n,a){var s=t+(i^(e|~r))+o+a;return (s<<n|s>>>32-n)+e}e.MD5=o._createHelper(s),e.HmacMD5=o._createHmacHelper(s);}(Math),d=(f=Ct).lib,_=d.WordArray,g=[],v=f.algo.SHA1=(m=d.Hasher).extend({_doReset:function(){this._hash=new _.init([1732584193,4023233417,2562383102,271733878,3285377520]);},_doProcessBlock:function(t,e){for(var i,r=this._hash.words,o=r[0],n=r[1],a=r[2],s=r[3],c=r[4],l=0;l<80;l++){g[l]=l<16?0|t[e+l]:(i=g[l-3]^g[l-8]^g[l-14]^g[l-16])<<1|i>>>31;var u=(o<<5|o>>>27)+c+g[l];u+=l<20?1518500249+(n&a|~n&s):l<40?1859775393+(n^a^s):l<60?(n&a|n&s|a&s)-1894007588:(n^a^s)-899497514,c=s,s=a,a=n<<30|n>>>2,n=o,o=u;}r[0]=r[0]+o|0,r[1]=r[1]+n|0,r[2]=r[2]+a|0,r[3]=r[3]+s|0,r[4]=r[4]+c|0;},_doFinalize:function(){var t=this._data,e=t.words,i=8*this._nDataBytes,r=8*t.sigBytes;return e[r>>>5]|=128<<24-r%32,e[14+(64+r>>>9<<4)]=Math.floor(i/4294967296),e[15+(64+r>>>9<<4)]=i,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=m.clone.call(this);return t._hash=this._hash.clone(),t}}),f.SHA1=m._createHelper(v),f.HmacSHA1=m._createHmacHelper(v),function(t){var e=Ct,i=e.lib,r=i.WordArray,o=i.Hasher,n=e.algo,a=[],s=[];!function(){function e(t){return 4294967296*(t-(0|t))|0}for(var i=2,r=0;r<64;)!function(e){for(var i=t.sqrt(e),r=2;r<=i;r++)if(!(e%r))return;return 1}(i)||(r<8&&(a[r]=e(t.pow(i,.5))),s[r]=e(t.pow(i,1/3)),r++),i++;}();var c=[],l=n.SHA256=o.extend({_doReset:function(){this._hash=new r.init(a.slice(0));},_doProcessBlock:function(t,e){for(var i,r,o,n,a=this._hash.words,l=a[0],u=a[1],h=a[2],p=a[3],f=a[4],d=a[5],_=a[6],m=a[7],g=0;g<64;g++){g<16?c[g]=0|t[e+g]:(r=((i=c[g-15])<<25|i>>>7)^(i<<14|i>>>18)^i>>>3,n=((o=c[g-2])<<15|o>>>17)^(o<<13|o>>>19)^o>>>10,c[g]=r+c[g-7]+n+c[g-16]);var v=l&u^l&h^u&h,y=m+((f<<26|f>>>6)^(f<<21|f>>>11)^(f<<7|f>>>25))+(f&d^~f&_)+s[g]+c[g];m=_,_=d,d=f,f=p+y|0,p=h,h=u,u=l,l=y+(((l<<30|l>>>2)^(l<<19|l>>>13)^(l<<10|l>>>22))+v)|0;}a[0]=a[0]+l|0,a[1]=a[1]+u|0,a[2]=a[2]+h|0,a[3]=a[3]+p|0,a[4]=a[4]+f|0,a[5]=a[5]+d|0,a[6]=a[6]+_|0,a[7]=a[7]+m|0;},_doFinalize:function(){var e=this._data,i=e.words,r=8*this._nDataBytes,o=8*e.sigBytes;return i[o>>>5]|=128<<24-o%32,i[14+(64+o>>>9<<4)]=t.floor(r/4294967296),i[15+(64+o>>>9<<4)]=r,e.sigBytes=4*i.length,this._process(),this._hash},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA256=o._createHelper(l),e.HmacSHA256=o._createHmacHelper(l);}(Math),function(){var t=Ct.lib.WordArray,e=Ct.enc;function i(t){return t<<8&4278255360|t>>>8&16711935}e.Utf16=e.Utf16BE={stringify:function(t){for(var e=t.words,i=t.sigBytes,r=[],o=0;o<i;o+=2)r.push(String.fromCharCode(e[o>>>2]>>>16-o%4*8&65535));return r.join("")},parse:function(e){for(var i=e.length,r=[],o=0;o<i;o++)r[o>>>1]|=e.charCodeAt(o)<<16-o%2*16;return t.create(r,2*i)}},e.Utf16LE={stringify:function(t){for(var e=t.words,r=t.sigBytes,o=[],n=0;n<r;n+=2){var a=i(e[n>>>2]>>>16-n%4*8&65535);o.push(String.fromCharCode(a));}return o.join("")},parse:function(e){for(var r=e.length,o=[],n=0;n<r;n++)o[n>>>1]|=i(e.charCodeAt(n)<<16-n%2*16);return t.create(o,2*r)}};}(),"function"==typeof ArrayBuffer&&(b=(y=Ct.lib.WordArray).init,(y.init=function(t){if(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),(t instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array)&&(t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength)),t instanceof Uint8Array){for(var e=t.byteLength,i=[],r=0;r<e;r++)i[r>>>2]|=t[r]<<24-r%4*8;b.call(this,i,e);}else b.apply(this,arguments);}).prototype=y),x=(w=Ct).lib,S=x.Hasher,E=w.algo,A=(T=x.WordArray).create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),k=T.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),I=T.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),B=T.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),P=T.create([0,1518500249,1859775393,2400959708,2840853838]),C=T.create([1352829926,1548603684,1836072691,2053994217,0]),z=E.RIPEMD160=S.extend({_doReset:function(){this._hash=T.create([1732584193,4023233417,2562383102,271733878,3285377520]);},_doProcessBlock:function(t,e){for(var i=0;i<16;i++){var r=e+i,o=t[r];t[r]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8);}var n,a,s,c,l,u,h=this._hash.words,p=P.words,f=C.words,d=A.words,_=k.words,m=I.words,g=B.words,v=n=h[0],y=a=h[1],b=s=h[2],w=c=h[3],x=l=h[4];for(i=0;i<80;i+=1)u=n+t[e+d[i]]|0,u+=i<16?(a^s^c)+p[0]:i<32?Dt(a,s,c)+p[1]:i<48?((a|~s)^c)+p[2]:i<64?Mt(a,s,c)+p[3]:(a^(s|~c))+p[4],u=(u=Rt(u|=0,m[i]))+l|0,n=l,l=c,c=Rt(s,10),s=a,a=u,u=v+t[e+_[i]]|0,u+=i<16?(y^(b|~w))+f[0]:i<32?Mt(y,b,w)+f[1]:i<48?((y|~b)^w)+f[2]:i<64?Dt(y,b,w)+f[3]:(y^b^w)+f[4],u=(u=Rt(u|=0,g[i]))+x|0,v=x,x=w,w=Rt(b,10),b=y,y=u;u=h[1]+s+w|0,h[1]=h[2]+c+x|0,h[2]=h[3]+l+v|0,h[3]=h[4]+n+y|0,h[4]=h[0]+a+b|0,h[0]=u;},_doFinalize:function(){var t=this._data,e=t.words,i=8*this._nDataBytes,r=8*t.sigBytes;e[r>>>5]|=128<<24-r%32,e[14+(64+r>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),t.sigBytes=4*(e.length+1),this._process();for(var o=this._hash,n=o.words,a=0;a<5;a++){var s=n[a];n[a]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8);}return o},clone:function(){var t=S.clone.call(this);return t._hash=this._hash.clone(),t}}),w.RIPEMD160=S._createHelper(z),w.HmacRIPEMD160=S._createHmacHelper(z),D=Ct.enc.Utf8,Ct.algo.HMAC=Ct.lib.Base.extend({init:function(t,e){t=this._hasher=new t.init,"string"==typeof e&&(e=D.parse(e));var i=t.blockSize,r=4*i;e.sigBytes>r&&(e=t.finalize(e)),e.clamp();for(var o=this._oKey=e.clone(),n=this._iKey=e.clone(),a=o.words,s=n.words,c=0;c<i;c++)a[c]^=1549556828,s[c]^=909522486;o.sigBytes=n.sigBytes=r,this.reset();},reset:function(){var t=this._hasher;t.reset(),t.update(this._iKey);},update:function(t){return this._hasher.update(t),this},finalize:function(t){var e=this._hasher,i=e.finalize(t);return e.reset(),e.finalize(this._oKey.clone().concat(i))}}),R=(M=Ct).lib,O=R.WordArray,U=(F=M.algo).HMAC,N=F.PBKDF2=(L=R.Base).extend({cfg:L.extend({keySize:4,hasher:F.SHA1,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t);},compute:function(t,e){for(var i=this.cfg,r=U.create(i.hasher,t),o=O.create(),n=O.create([1]),a=o.words,s=n.words,c=i.keySize,l=i.iterations;a.length<c;){var u=r.update(e).finalize(n);r.reset();for(var h=u.words,p=h.length,f=u,d=1;d<l;d++){f=r.finalize(f),r.reset();for(var _=f.words,m=0;m<p;m++)h[m]^=_[m];}o.concat(u),s[0]++;}return o.sigBytes=4*c,o}}),M.PBKDF2=function(t,e,i){return N.create(i).compute(t,e)},V=(j=Ct).lib,Z=V.WordArray,H=(G=j.algo).EvpKDF=(q=V.Base).extend({cfg:q.extend({keySize:4,hasher:G.MD5,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t);},compute:function(t,e){for(var i=this.cfg,r=i.hasher.create(),o=Z.create(),n=o.words,a=i.keySize,s=i.iterations;n.length<a;){c&&r.update(c);var c=r.update(t).finalize(e);r.reset();for(var l=1;l<s;l++)c=r.finalize(c),r.reset();o.concat(c);}return o.sigBytes=4*a,o}}),j.EvpKDF=function(t,e,i){return H.create(i).compute(t,e)},X=(W=Ct).lib.WordArray,J=(K=W.algo).SHA224=(Y=K.SHA256).extend({_doReset:function(){this._hash=new X.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]);},_doFinalize:function(){var t=Y._doFinalize.call(this);return t.sigBytes-=4,t}}),W.SHA224=Y._createHelper(J),W.HmacSHA224=Y._createHmacHelper(J),$=(Q=Ct.lib).Base,tt=Q.WordArray,(et=Ct.x64={}).Word=$.extend({init:function(t,e){this.high=t,this.low=e;}}),et.WordArray=$.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:8*t.length;},toX32:function(){for(var t=this.words,e=t.length,i=[],r=0;r<e;r++){var o=t[r];i.push(o.high),i.push(o.low);}return tt.create(i,this.sigBytes)},clone:function(){for(var t=$.clone.call(this),e=t.words=this.words.slice(0),i=e.length,r=0;r<i;r++)e[r]=e[r].clone();return t}}),function(t){var e=Ct,i=e.lib,r=i.WordArray,o=i.Hasher,n=e.x64.Word,a=e.algo,s=[],c=[],l=[];!function(){for(var t=1,e=0,i=0;i<24;i++){s[t+5*e]=(i+1)*(i+2)/2%64;var r=(2*t+3*e)%5;t=e%5,e=r;}for(t=0;t<5;t++)for(e=0;e<5;e++)c[t+5*e]=e+(2*t+3*e)%5*5;for(var o=1,a=0;a<24;a++){for(var u,h=0,p=0,f=0;f<7;f++)1&o&&((u=(1<<f)-1)<32?p^=1<<u:h^=1<<u-32),128&o?o=o<<1^113:o<<=1;l[a]=n.create(h,p);}}();var u=[];!function(){for(var t=0;t<25;t++)u[t]=n.create();}();var h=a.SHA3=o.extend({cfg:o.cfg.extend({outputLength:512}),_doReset:function(){for(var t=this._state=[],e=0;e<25;e++)t[e]=new n.init;this.blockSize=(1600-2*this.cfg.outputLength)/32;},_doProcessBlock:function(t,e){for(var i=this._state,r=this.blockSize/2,o=0;o<r;o++){var n=16711935&((n=t[e+2*o])<<8|n>>>24)|4278255360&(n<<24|n>>>8),a=16711935&((a=t[e+2*o+1])<<8|a>>>24)|4278255360&(a<<24|a>>>8);(I=i[o]).high^=a,I.low^=n;}for(var h=0;h<24;h++){for(var p=0;p<5;p++){for(var f=0,d=0,_=0;_<5;_++)f^=(I=i[p+5*_]).high,d^=I.low;var m=u[p];m.high=f,m.low=d;}for(p=0;p<5;p++){var g=u[(p+4)%5],v=u[(p+1)%5],y=v.high,b=v.low;for(f=g.high^(y<<1|b>>>31),d=g.low^(b<<1|y>>>31),_=0;_<5;_++)(I=i[p+5*_]).high^=f,I.low^=d;}for(var w=1;w<25;w++){var x=(I=i[w]).high,T=I.low,S=s[w];d=S<32?(f=x<<S|T>>>32-S,T<<S|x>>>32-S):(f=T<<S-32|x>>>64-S,x<<S-32|T>>>64-S);var E=u[c[w]];E.high=f,E.low=d;}var A=u[0],k=i[0];for(A.high=k.high,A.low=k.low,p=0;p<5;p++)for(_=0;_<5;_++){var I=i[w=p+5*_],B=u[w],P=u[(p+1)%5+5*_],C=u[(p+2)%5+5*_];I.high=B.high^~P.high&C.high,I.low=B.low^~P.low&C.low;}var z=l[h];(I=i[0]).high^=z.high,I.low^=z.low;}},_doFinalize:function(){var e=this._data,i=e.words,o=8*e.sigBytes,n=32*this.blockSize;i[o>>>5]|=1<<24-o%32,i[(t.ceil((1+o)/n)*n>>>5)-1]|=128,e.sigBytes=4*i.length,this._process();for(var a=this._state,s=this.cfg.outputLength/8,c=s/8,l=[],u=0;u<c;u++){var h=a[u],p=16711935&((p=h.high)<<8|p>>>24)|4278255360&(p<<24|p>>>8),f=16711935&((f=h.low)<<8|f>>>24)|4278255360&(f<<24|f>>>8);l.push(f),l.push(p);}return new r.init(l,s)},clone:function(){for(var t=o.clone.call(this),e=t._state=this._state.slice(0),i=0;i<25;i++)e[i]=e[i].clone();return t}});e.SHA3=o._createHelper(h),e.HmacSHA3=o._createHmacHelper(h);}(Math),function(){var t=Ct,e=t.lib.Hasher,i=t.x64,r=i.Word,o=i.WordArray,n=t.algo;function a(){return r.create.apply(r,arguments)}var s=[a(1116352408,3609767458),a(1899447441,602891725),a(3049323471,3964484399),a(3921009573,2173295548),a(961987163,4081628472),a(1508970993,3053834265),a(2453635748,2937671579),a(2870763221,3664609560),a(3624381080,2734883394),a(310598401,1164996542),a(607225278,1323610764),a(1426881987,3590304994),a(1925078388,4068182383),a(2162078206,991336113),a(2614888103,633803317),a(3248222580,3479774868),a(3835390401,2666613458),a(4022224774,944711139),a(264347078,2341262773),a(604807628,2007800933),a(770255983,1495990901),a(1249150122,1856431235),a(1555081692,3175218132),a(1996064986,2198950837),a(2554220882,3999719339),a(2821834349,766784016),a(2952996808,2566594879),a(3210313671,3203337956),a(3336571891,1034457026),a(3584528711,2466948901),a(113926993,3758326383),a(338241895,168717936),a(666307205,1188179964),a(773529912,1546045734),a(1294757372,1522805485),a(1396182291,2643833823),a(1695183700,2343527390),a(1986661051,1014477480),a(2177026350,1206759142),a(2456956037,344077627),a(2730485921,1290863460),a(2820302411,3158454273),a(3259730800,3505952657),a(3345764771,106217008),a(3516065817,3606008344),a(3600352804,1432725776),a(4094571909,1467031594),a(275423344,851169720),a(430227734,3100823752),a(506948616,1363258195),a(659060556,3750685593),a(883997877,3785050280),a(958139571,3318307427),a(1322822218,3812723403),a(1537002063,2003034995),a(1747873779,3602036899),a(1955562222,1575990012),a(2024104815,1125592928),a(2227730452,2716904306),a(2361852424,442776044),a(2428436474,593698344),a(2756734187,3733110249),a(3204031479,2999351573),a(3329325298,3815920427),a(3391569614,3928383900),a(3515267271,566280711),a(3940187606,3454069534),a(4118630271,4000239992),a(116418474,1914138554),a(174292421,2731055270),a(289380356,3203993006),a(460393269,320620315),a(685471733,587496836),a(852142971,1086792851),a(1017036298,365543100),a(1126000580,2618297676),a(1288033470,3409855158),a(1501505948,4234509866),a(1607167915,987167468),a(1816402316,1246189591)],c=[];!function(){for(var t=0;t<80;t++)c[t]=a();}();var l=n.SHA512=e.extend({_doReset:function(){this._hash=new o.init([new r.init(1779033703,4089235720),new r.init(3144134277,2227873595),new r.init(1013904242,4271175723),new r.init(2773480762,1595750129),new r.init(1359893119,2917565137),new r.init(2600822924,725511199),new r.init(528734635,4215389547),new r.init(1541459225,327033209)]);},_doProcessBlock:function(t,e){for(var i=this._hash.words,r=i[0],o=i[1],n=i[2],a=i[3],l=i[4],u=i[5],h=i[6],p=i[7],f=r.high,d=r.low,_=o.high,m=o.low,g=n.high,v=n.low,y=a.high,b=a.low,w=l.high,x=l.low,T=u.high,S=u.low,E=h.high,A=h.low,k=p.high,I=p.low,B=f,P=d,C=_,z=m,D=g,M=v,R=y,L=b,O=w,F=x,U=T,N=S,j=E,V=A,q=k,Z=I,G=0;G<80;G++){var H,W,X,K,Y,J,Q,$,tt,et,it,rt,ot,nt,at,st=c[G];G<16?(at=st.high=0|t[e+2*G],nt=st.low=0|t[e+2*G+1]):(K=((W=(H=c[G-15]).high)>>>1|(X=H.low)<<31)^(W>>>8|X<<24)^W>>>7,tt=((Q=(J=c[G-2]).high)>>>19|($=J.low)<<13)^(Q<<3|$>>>29)^Q>>>6,at=(at=(at=K+(it=c[G-7]).high+((nt=(Y=(X>>>1|W<<31)^(X>>>8|W<<24)^(X>>>7|W<<25))+it.low)>>>0<Y>>>0?1:0))+tt+((nt+=et=($>>>19|Q<<13)^($<<3|Q>>>29)^($>>>6|Q<<26))>>>0<et>>>0?1:0))+(rt=c[G-16]).high+((nt+=ot=rt.low)>>>0<ot>>>0?1:0),st.high=at,st.low=nt);var ct=O&U^~O&j,lt=F&N^~F&V,ut=B&C^B&D^C&D,ht=(P>>>28|B<<4)^(P<<30|B>>>2)^(P<<25|B>>>7),pt=s[G],ft=pt.low,dt=Z+((F>>>14|O<<18)^(F>>>18|O<<14)^(F<<23|O>>>9)),_t=q+((O>>>14|F<<18)^(O>>>18|F<<14)^(O<<23|F>>>9))+(dt>>>0<Z>>>0?1:0),mt=ht+(P&z^P&M^z&M);q=j,Z=V,j=U,V=N,U=O,N=F,O=R+(_t=(_t=(_t=_t+ct+((dt+=lt)>>>0<lt>>>0?1:0))+pt.high+((dt+=ft)>>>0<ft>>>0?1:0))+at+((dt+=nt)>>>0<nt>>>0?1:0))+((F=L+dt|0)>>>0<L>>>0?1:0)|0,R=D,L=M,D=C,M=z,C=B,z=P,B=_t+(((B>>>28|P<<4)^(B<<30|P>>>2)^(B<<25|P>>>7))+ut+(mt>>>0<ht>>>0?1:0))+((P=dt+mt|0)>>>0<dt>>>0?1:0)|0;}d=r.low=d+P,r.high=f+B+(d>>>0<P>>>0?1:0),m=o.low=m+z,o.high=_+C+(m>>>0<z>>>0?1:0),v=n.low=v+M,n.high=g+D+(v>>>0<M>>>0?1:0),b=a.low=b+L,a.high=y+R+(b>>>0<L>>>0?1:0),x=l.low=x+F,l.high=w+O+(x>>>0<F>>>0?1:0),S=u.low=S+N,u.high=T+U+(S>>>0<N>>>0?1:0),A=h.low=A+V,h.high=E+j+(A>>>0<V>>>0?1:0),I=p.low=I+Z,p.high=k+q+(I>>>0<Z>>>0?1:0);},_doFinalize:function(){var t=this._data,e=t.words,i=8*this._nDataBytes,r=8*t.sigBytes;return e[r>>>5]|=128<<24-r%32,e[30+(128+r>>>10<<5)]=Math.floor(i/4294967296),e[31+(128+r>>>10<<5)]=i,t.sigBytes=4*e.length,this._process(),this._hash.toX32()},clone:function(){var t=e.clone.call(this);return t._hash=this._hash.clone(),t},blockSize:32});t.SHA512=e._createHelper(l),t.HmacSHA512=e._createHmacHelper(l);}(),rt=(it=Ct).x64,ot=rt.Word,nt=rt.WordArray,ct=(at=it.algo).SHA384=(st=at.SHA512).extend({_doReset:function(){this._hash=new nt.init([new ot.init(3418070365,3238371032),new ot.init(1654270250,914150663),new ot.init(2438529370,812702999),new ot.init(355462360,4144912697),new ot.init(1731405415,4290775857),new ot.init(2394180231,1750603025),new ot.init(3675008525,1694076839),new ot.init(1203062813,3204075428)]);},_doFinalize:function(){var t=st._doFinalize.call(this);return t.sigBytes-=16,t}}),it.SHA384=st._createHelper(ct),it.HmacSHA384=st._createHmacHelper(ct),Ct.lib.Cipher||function(){var t=Ct,e=t.lib,i=e.Base,r=e.WordArray,o=e.BufferedBlockAlgorithm,n=t.enc.Base64,a=t.algo.EvpKDF,s=e.Cipher=o.extend({cfg:i.extend(),createEncryptor:function(t,e){return this.create(this._ENC_XFORM_MODE,t,e)},createDecryptor:function(t,e){return this.create(this._DEC_XFORM_MODE,t,e)},init:function(t,e,i){this.cfg=this.cfg.extend(i),this._xformMode=t,this._key=e,this.reset();},reset:function(){o.reset.call(this),this._doReset();},process:function(t){return this._append(t),this._process()},finalize:function(t){return t&&this._append(t),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(t){return {encrypt:function(e,i,r){return c(i).encrypt(t,e,i,r)},decrypt:function(e,i,r){return c(i).decrypt(t,e,i,r)}}}});function c(t){return "string"==typeof t?y:g}e.StreamCipher=s.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var l,u=t.mode={},h=e.BlockCipherMode=i.extend({createEncryptor:function(t,e){return this.Encryptor.create(t,e)},createDecryptor:function(t,e){return this.Decryptor.create(t,e)},init:function(t,e){this._cipher=t,this._iv=e;}}),p=u.CBC=((l=h.extend()).Encryptor=l.extend({processBlock:function(t,e){var i=this._cipher,r=i.blockSize;f.call(this,t,e,r),i.encryptBlock(t,e),this._prevBlock=t.slice(e,e+r);}}),l.Decryptor=l.extend({processBlock:function(t,e){var i=this._cipher,r=i.blockSize,o=t.slice(e,e+r);i.decryptBlock(t,e),f.call(this,t,e,r),this._prevBlock=o;}}),l);function f(t,e,i){var r,o=this._iv;o?(r=o,this._iv=void 0):r=this._prevBlock;for(var n=0;n<i;n++)t[e+n]^=r[n];}var d=(t.pad={}).Pkcs7={pad:function(t,e){for(var i=4*e,o=i-t.sigBytes%i,n=o<<24|o<<16|o<<8|o,a=[],s=0;s<o;s+=4)a.push(n);var c=r.create(a,o);t.concat(c);},unpad:function(t){t.sigBytes-=255&t.words[t.sigBytes-1>>>2];}},_=(e.BlockCipher=s.extend({cfg:s.cfg.extend({mode:p,padding:d}),reset:function(){s.reset.call(this);var t,e=this.cfg,i=e.iv,r=e.mode;this._xformMode==this._ENC_XFORM_MODE?t=r.createEncryptor:(t=r.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==t?this._mode.init(this,i&&i.words):(this._mode=t.call(r,this,i&&i.words),this._mode.__creator=t);},_doProcessBlock:function(t,e){this._mode.processBlock(t,e);},_doFinalize:function(){var t,e=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(e.pad(this._data,this.blockSize),t=this._process(!0)):(t=this._process(!0),e.unpad(t)),t},blockSize:4}),e.CipherParams=i.extend({init:function(t){this.mixIn(t);},toString:function(t){return (t||this.formatter).stringify(this)}})),m=(t.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext,i=t.salt;return (i?r.create([1398893684,1701076831]).concat(i).concat(e):e).toString(n)},parse:function(t){var e,i=n.parse(t),o=i.words;return 1398893684==o[0]&&1701076831==o[1]&&(e=r.create(o.slice(2,4)),o.splice(0,4),i.sigBytes-=16),_.create({ciphertext:i,salt:e})}},g=e.SerializableCipher=i.extend({cfg:i.extend({format:m}),encrypt:function(t,e,i,r){r=this.cfg.extend(r);var o=t.createEncryptor(i,r),n=o.finalize(e),a=o.cfg;return _.create({ciphertext:n,key:i,iv:a.iv,algorithm:t,mode:a.mode,padding:a.padding,blockSize:t.blockSize,formatter:r.format})},decrypt:function(t,e,i,r){return r=this.cfg.extend(r),e=this._parse(e,r.format),t.createDecryptor(i,r).finalize(e.ciphertext)},_parse:function(t,e){return "string"==typeof t?e.parse(t,this):t}}),v=(t.kdf={}).OpenSSL={execute:function(t,e,i,o){o=o||r.random(8);var n=a.create({keySize:e+i}).compute(t,o),s=r.create(n.words.slice(e),4*i);return n.sigBytes=4*e,_.create({key:n,iv:s,salt:o})}},y=e.PasswordBasedCipher=g.extend({cfg:g.cfg.extend({kdf:v}),encrypt:function(t,e,i,r){var o=(r=this.cfg.extend(r)).kdf.execute(i,t.keySize,t.ivSize);r.iv=o.iv;var n=g.encrypt.call(this,t,e,o.key,r);return n.mixIn(o),n},decrypt:function(t,e,i,r){r=this.cfg.extend(r),e=this._parse(e,r.format);var o=r.kdf.execute(i,t.keySize,t.ivSize,e.salt);return r.iv=o.iv,g.decrypt.call(this,t,e,o.key,r)}});}(),Ct.mode.CFB=((lt=Ct.lib.BlockCipherMode.extend()).Encryptor=lt.extend({processBlock:function(t,e){var i=this._cipher,r=i.blockSize;Lt.call(this,t,e,r,i),this._prevBlock=t.slice(e,e+r);}}),lt.Decryptor=lt.extend({processBlock:function(t,e){var i=this._cipher,r=i.blockSize,o=t.slice(e,e+r);Lt.call(this,t,e,r,i),this._prevBlock=o;}}),lt),Ct.mode.ECB=((ut=Ct.lib.BlockCipherMode.extend()).Encryptor=ut.extend({processBlock:function(t,e){this._cipher.encryptBlock(t,e);}}),ut.Decryptor=ut.extend({processBlock:function(t,e){this._cipher.decryptBlock(t,e);}}),ut),Ct.pad.AnsiX923={pad:function(t,e){var i=t.sigBytes,r=4*e,o=r-i%r,n=i+o-1;t.clamp(),t.words[n>>>2]|=o<<24-n%4*8,t.sigBytes+=o;},unpad:function(t){t.sigBytes-=255&t.words[t.sigBytes-1>>>2];}},Ct.pad.Iso10126={pad:function(t,e){var i=4*e,r=i-t.sigBytes%i;t.concat(Ct.lib.WordArray.random(r-1)).concat(Ct.lib.WordArray.create([r<<24],1));},unpad:function(t){t.sigBytes-=255&t.words[t.sigBytes-1>>>2];}},Ct.pad.Iso97971={pad:function(t,e){t.concat(Ct.lib.WordArray.create([2147483648],1)),Ct.pad.ZeroPadding.pad(t,e);},unpad:function(t){Ct.pad.ZeroPadding.unpad(t),t.sigBytes--;}},Ct.mode.OFB=(pt=(ht=Ct.lib.BlockCipherMode.extend()).Encryptor=ht.extend({processBlock:function(t,e){var i=this._cipher,r=i.blockSize,o=this._iv,n=this._keystream;o&&(n=this._keystream=o.slice(0),this._iv=void 0),i.encryptBlock(n,0);for(var a=0;a<r;a++)t[e+a]^=n[a];}}),ht.Decryptor=pt,ht),Ct.pad.NoPadding={pad:function(){},unpad:function(){}},ft=Ct.lib.CipherParams,dt=Ct.enc.Hex,Ct.format.Hex={stringify:function(t){return t.ciphertext.toString(dt)},parse:function(t){var e=dt.parse(t);return ft.create({ciphertext:e})}},function(){var t=Ct,e=t.lib.BlockCipher,i=t.algo,r=[],o=[],n=[],a=[],s=[],c=[],l=[],u=[],h=[],p=[];!function(){for(var t=[],e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;var i=0,f=0;for(e=0;e<256;e++){var d=(d=f^f<<1^f<<2^f<<3^f<<4)>>>8^255&d^99;r[i]=d;var _=t[o[d]=i],m=t[_],g=t[m],v=257*t[d]^16843008*d;n[i]=v<<24|v>>>8,a[i]=v<<16|v>>>16,s[i]=v<<8|v>>>24,c[i]=v,l[d]=(v=16843009*g^65537*m^257*_^16843008*i)<<24|v>>>8,u[d]=v<<16|v>>>16,h[d]=v<<8|v>>>24,p[d]=v,i?(i=_^t[t[t[g^_]]],f^=t[t[f]]):i=f=1;}}();var f=[0,1,2,4,8,16,32,64,128,27,54],d=i.AES=e.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var t=this._keyPriorReset=this._key,e=t.words,i=t.sigBytes/4,o=4*(1+(this._nRounds=6+i)),n=this._keySchedule=[],a=0;a<o;a++)a<i?n[a]=e[a]:(d=n[a-1],a%i?6<i&&a%i==4&&(d=r[d>>>24]<<24|r[d>>>16&255]<<16|r[d>>>8&255]<<8|r[255&d]):(d=r[(d=d<<8|d>>>24)>>>24]<<24|r[d>>>16&255]<<16|r[d>>>8&255]<<8|r[255&d],d^=f[a/i|0]<<24),n[a]=n[a-i]^d);for(var s=this._invKeySchedule=[],c=0;c<o;c++){var d;a=o-c,d=c%4?n[a]:n[a-4],s[c]=c<4||a<=4?d:l[r[d>>>24]]^u[r[d>>>16&255]]^h[r[d>>>8&255]]^p[r[255&d]];}}},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,n,a,s,c,r);},decryptBlock:function(t,e){var i=t[e+1];t[e+1]=t[e+3],t[e+3]=i,this._doCryptBlock(t,e,this._invKeySchedule,l,u,h,p,o),i=t[e+1],t[e+1]=t[e+3],t[e+3]=i;},_doCryptBlock:function(t,e,i,r,o,n,a,s){for(var c=this._nRounds,l=t[e]^i[0],u=t[e+1]^i[1],h=t[e+2]^i[2],p=t[e+3]^i[3],f=4,d=1;d<c;d++){var _=r[l>>>24]^o[u>>>16&255]^n[h>>>8&255]^a[255&p]^i[f++],m=r[u>>>24]^o[h>>>16&255]^n[p>>>8&255]^a[255&l]^i[f++],g=r[h>>>24]^o[p>>>16&255]^n[l>>>8&255]^a[255&u]^i[f++],v=r[p>>>24]^o[l>>>16&255]^n[u>>>8&255]^a[255&h]^i[f++];l=_,u=m,h=g,p=v;}_=(s[l>>>24]<<24|s[u>>>16&255]<<16|s[h>>>8&255]<<8|s[255&p])^i[f++],m=(s[u>>>24]<<24|s[h>>>16&255]<<16|s[p>>>8&255]<<8|s[255&l])^i[f++],g=(s[h>>>24]<<24|s[p>>>16&255]<<16|s[l>>>8&255]<<8|s[255&u])^i[f++],v=(s[p>>>24]<<24|s[l>>>16&255]<<16|s[u>>>8&255]<<8|s[255&h])^i[f++],t[e]=_,t[e+1]=m,t[e+2]=g,t[e+3]=v;},keySize:8});t.AES=e._createHelper(d);}(),function(){var t=Ct,e=t.lib,i=e.WordArray,r=e.BlockCipher,o=t.algo,n=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],a=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],s=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],c=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],l=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],u=o.DES=r.extend({_doReset:function(){for(var t=this._key.words,e=[],i=0;i<56;i++){var r=n[i]-1;e[i]=t[r>>>5]>>>31-r%32&1;}for(var o=this._subKeys=[],c=0;c<16;c++){var l=o[c]=[],u=s[c];for(i=0;i<24;i++)l[i/6|0]|=e[(a[i]-1+u)%28]<<31-i%6,l[4+(i/6|0)]|=e[28+(a[i+24]-1+u)%28]<<31-i%6;for(l[0]=l[0]<<1|l[0]>>>31,i=1;i<7;i++)l[i]=l[i]>>>4*(i-1)+3;l[7]=l[7]<<5|l[7]>>>27;}var h=this._invSubKeys=[];for(i=0;i<16;i++)h[i]=o[15-i];},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._subKeys);},decryptBlock:function(t,e){this._doCryptBlock(t,e,this._invSubKeys);},_doCryptBlock:function(t,e,i){this._lBlock=t[e],this._rBlock=t[e+1],h.call(this,4,252645135),h.call(this,16,65535),p.call(this,2,858993459),p.call(this,8,16711935),h.call(this,1,1431655765);for(var r=0;r<16;r++){for(var o=i[r],n=this._lBlock,a=this._rBlock,s=0,u=0;u<8;u++)s|=c[u][((a^o[u])&l[u])>>>0];this._lBlock=a,this._rBlock=n^s;}var f=this._lBlock;this._lBlock=this._rBlock,this._rBlock=f,h.call(this,1,1431655765),p.call(this,8,16711935),p.call(this,2,858993459),h.call(this,16,65535),h.call(this,4,252645135),t[e]=this._lBlock,t[e+1]=this._rBlock;},keySize:2,ivSize:2,blockSize:2});function h(t,e){var i=(this._lBlock>>>t^this._rBlock)&e;this._rBlock^=i,this._lBlock^=i<<t;}function p(t,e){var i=(this._rBlock>>>t^this._lBlock)&e;this._lBlock^=i,this._rBlock^=i<<t;}t.DES=r._createHelper(u);var f=o.TripleDES=r.extend({_doReset:function(){var t=this._key.words;this._des1=u.createEncryptor(i.create(t.slice(0,2))),this._des2=u.createEncryptor(i.create(t.slice(2,4))),this._des3=u.createEncryptor(i.create(t.slice(4,6)));},encryptBlock:function(t,e){this._des1.encryptBlock(t,e),this._des2.decryptBlock(t,e),this._des3.encryptBlock(t,e);},decryptBlock:function(t,e){this._des3.decryptBlock(t,e),this._des2.encryptBlock(t,e),this._des1.decryptBlock(t,e);},keySize:6,ivSize:2,blockSize:2});t.TripleDES=r._createHelper(f);}(),function(){var t=Ct,e=t.lib.StreamCipher,i=t.algo,r=i.RC4=e.extend({_doReset:function(){for(var t=this._key,e=t.words,i=t.sigBytes,r=this._S=[],o=0;o<256;o++)r[o]=o;o=0;for(var n=0;o<256;o++){var a=o%i,s=r[o];r[o]=r[n=(n+r[o]+(e[a>>>2]>>>24-a%4*8&255))%256],r[n]=s;}this._i=this._j=0;},_doProcessBlock:function(t,e){t[e]^=o.call(this);},keySize:8,ivSize:0});function o(){for(var t=this._S,e=this._i,i=this._j,r=0,o=0;o<4;o++){i=(i+t[e=(e+1)%256])%256;var n=t[e];t[e]=t[i],t[i]=n,r|=t[(t[e]+t[i])%256]<<24-8*o;}return this._i=e,this._j=i,r}t.RC4=e._createHelper(r);var n=i.RC4Drop=r.extend({cfg:r.cfg.extend({drop:192}),_doReset:function(){r._doReset.call(this);for(var t=this.cfg.drop;0<t;t--)o.call(this);}});t.RC4Drop=e._createHelper(n);}(),Ct.mode.CTRGladman=(mt=(_t=Ct.lib.BlockCipherMode.extend()).Encryptor=_t.extend({processBlock:function(t,e){var i,r=this._cipher,o=r.blockSize,n=this._iv,a=this._counter;n&&(a=this._counter=n.slice(0),this._iv=void 0),0===((i=a)[0]=Ot(i[0]))&&(i[1]=Ot(i[1]));var s=a.slice(0);r.encryptBlock(s,0);for(var c=0;c<o;c++)t[e+c]^=s[c];}}),_t.Decryptor=mt,_t),vt=(gt=Ct).lib.StreamCipher,yt=[],bt=[],wt=[],xt=gt.algo.Rabbit=vt.extend({_doReset:function(){for(var t=this._key.words,e=this.cfg.iv,i=0;i<4;i++)t[i]=16711935&(t[i]<<8|t[i]>>>24)|4278255360&(t[i]<<24|t[i]>>>8);var r=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],o=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];for(i=this._b=0;i<4;i++)Ft.call(this);for(i=0;i<8;i++)o[i]^=r[i+4&7];if(e){var n=e.words,a=n[0],s=n[1],c=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),l=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),u=c>>>16|4294901760&l,h=l<<16|65535&c;for(o[0]^=c,o[1]^=u,o[2]^=l,o[3]^=h,o[4]^=c,o[5]^=u,o[6]^=l,o[7]^=h,i=0;i<4;i++)Ft.call(this);}},_doProcessBlock:function(t,e){var i=this._X;Ft.call(this),yt[0]=i[0]^i[5]>>>16^i[3]<<16,yt[1]=i[2]^i[7]>>>16^i[5]<<16,yt[2]=i[4]^i[1]>>>16^i[7]<<16,yt[3]=i[6]^i[3]>>>16^i[1]<<16;for(var r=0;r<4;r++)yt[r]=16711935&(yt[r]<<8|yt[r]>>>24)|4278255360&(yt[r]<<24|yt[r]>>>8),t[e+r]^=yt[r];},blockSize:4,ivSize:2}),gt.Rabbit=vt._createHelper(xt),Ct.mode.CTR=(St=(Tt=Ct.lib.BlockCipherMode.extend()).Encryptor=Tt.extend({processBlock:function(t,e){var i=this._cipher,r=i.blockSize,o=this._iv,n=this._counter;o&&(n=this._counter=o.slice(0),this._iv=void 0);var a=n.slice(0);i.encryptBlock(a,0),n[r-1]=n[r-1]+1|0;for(var s=0;s<r;s++)t[e+s]^=a[s];}}),Tt.Decryptor=St,Tt),At=(Et=Ct).lib.StreamCipher,kt=[],It=[],Bt=[],Pt=Et.algo.RabbitLegacy=At.extend({_doReset:function(){for(var t=this._key.words,e=this.cfg.iv,i=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],r=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]],o=this._b=0;o<4;o++)Ut.call(this);for(o=0;o<8;o++)r[o]^=i[o+4&7];if(e){var n=e.words,a=n[0],s=n[1],c=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),l=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),u=c>>>16|4294901760&l,h=l<<16|65535&c;for(r[0]^=c,r[1]^=u,r[2]^=l,r[3]^=h,r[4]^=c,r[5]^=u,r[6]^=l,r[7]^=h,o=0;o<4;o++)Ut.call(this);}},_doProcessBlock:function(t,e){var i=this._X;Ut.call(this),kt[0]=i[0]^i[5]>>>16^i[3]<<16,kt[1]=i[2]^i[7]>>>16^i[5]<<16,kt[2]=i[4]^i[1]>>>16^i[7]<<16,kt[3]=i[6]^i[3]>>>16^i[1]<<16;for(var r=0;r<4;r++)kt[r]=16711935&(kt[r]<<8|kt[r]>>>24)|4278255360&(kt[r]<<24|kt[r]>>>8),t[e+r]^=kt[r];},blockSize:4,ivSize:2}),Et.RabbitLegacy=At._createHelper(Pt),Ct.pad.ZeroPadding={pad:function(t,e){var i=4*e;t.clamp(),t.sigBytes+=i-(t.sigBytes%i||i);},unpad:function(t){for(var e=t.words,i=t.sigBytes-1;!(e[i>>>2]>>>24-i%4*8&255);)i--;t.sigBytes=i+1;}},Ct}(),n=null,a=(n||(function(t){!function(){function e(t,e){return t<<(e%=32)|t>>>32-e}function i(t){return a[(4026531840&t)>>>28][(251658240&t)>>>24]<<24|a[(15728640&t)>>>20][(983040&t)>>>16]<<16|a[(61440&t)>>>12][(3840&t)>>>8]<<8|a[(240&t)>>>4][(15&t)>>>0]<<0}var r=t,o=r.lib.BlockCipher,n=r.algo,a=new Array;a[0]=new Array(214,144,233,254,204,225,61,183,22,182,20,194,40,251,44,5),a[1]=new Array(43,103,154,118,42,190,4,195,170,68,19,38,73,134,6,153),a[2]=new Array(156,66,80,244,145,239,152,122,51,84,11,67,237,207,172,98),a[3]=new Array(228,179,28,169,201,8,232,149,128,223,148,250,117,143,63,166),a[4]=new Array(71,7,167,252,243,115,23,186,131,89,60,25,230,133,79,168),a[5]=new Array(104,107,129,178,113,100,218,139,248,235,15,75,112,86,157,53),a[6]=new Array(30,36,14,94,99,88,209,162,37,34,124,59,1,33,120,135),a[7]=new Array(212,0,70,87,159,211,39,82,76,54,2,231,160,196,200,158),a[8]=new Array(234,191,138,210,64,199,56,181,163,247,242,206,249,97,21,161),a[9]=new Array(224,174,93,164,155,52,26,85,173,147,50,48,245,140,177,227),a[10]=new Array(29,246,226,46,130,102,202,96,192,41,35,171,13,83,78,111),a[11]=new Array(213,219,55,69,222,253,142,47,3,255,106,114,109,108,91,81),a[12]=new Array(141,27,175,146,187,221,188,127,17,217,92,65,31,16,90,216),a[13]=new Array(10,193,49,136,165,205,123,189,45,116,208,18,184,229,180,176),a[14]=new Array(137,105,151,74,12,150,119,126,101,185,241,9,197,110,198,132),a[15]=new Array(24,240,125,236,58,220,77,32,121,238,95,62,215,203,57,72);var s=[462357,472066609,943670861,1415275113,1886879365,2358483617,2830087869,3301692121,3773296373,4228057617,404694573,876298825,1347903077,1819507329,2291111581,2762715833,3234320085,3705924337,4177462797,337322537,808926789,1280531041,1752135293,2223739545,2695343797,3166948049,3638552301,4110090761,269950501,741554753,1213159005,1684763257],c=[2746333894,1453994832,1736282519,2993693404],l=n.SM4=o.extend({_doReset:function(){for(var t=function(t){var r=new Array,o=new Array;r[0]=t[0]^c[0],r[1]=t[1]^c[1],r[2]=t[2]^c[2],r[3]=t[3]^c[3];for(var n,a=0;a<32;a++)r[a+4]=r[a]^(n=i(n=r[a+1]^r[a+2]^r[a+3]^s[a]))^e(n,13)^e(n,23),o[a]=r[a+4].toString(16);return o}(this._key.words),r=this._SK=[],o=0;o<t.length;o++)r[o]=t[o];var n=this._invSK=[];for(o=t.length-1;0<=o;o--)n[t.length-1-o]=t[o];},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._SK);},decryptBlock:function(t,e){this._doCryptBlock(t,e,this._invSK);},_doCryptBlock:function(t,r,o){var n=[];n[0]=t[r],n[1]=t[r+1],n[2]=t[r+2],n[3]=t[r+3];for(var a,s=0;s<32;s++)n[s+4]=n[s]^(a=i(a=n[s+1]^n[s+2]^n[s+3]^parseInt(o[s],16)))^e(a,2)^e(a,10)^e(a,18)^e(a,24);t[r]=n[35],t[r+1]=n[34],t[r+2]=n[33],t[r+3]=n[32];},keySize:4,ivSize:4,blockSize:4});r.SM4=o._createHelper(l);}();}(o),n=o.SM4),n),s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0!==t.window?t.window:{};function c(t,e){return t(e={exports:{}},e.exports),e.exports}var l=c((function(t){var e,i;e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i={rotl:function(t,e){return t<<e|t>>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&i.rotl(t,8)|4278255360&i.rotl(t,24);for(var e=0;e<t.length;e++)t[e]=i.endian(t[e]);return t},randomBytes:function(t){for(var e=[];0<t;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],i=0,r=0;i<t.length;i++,r+=8)e[r>>>5]|=t[i]<<24-r%32;return e},wordsToBytes:function(t){for(var e=[],i=0;i<32*t.length;i+=8)e.push(t[i>>>5]>>>24-i%32&255);return e},bytesToHex:function(t){for(var e=[],i=0;i<t.length;i++)e.push((t[i]>>>4).toString(16)),e.push((15&t[i]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],i=0;i<t.length;i+=2)e.push(parseInt(t.substr(i,2),16));return e},bytesToBase64:function(t){for(var i=[],r=0;r<t.length;r+=3)for(var o=t[r]<<16|t[r+1]<<8|t[r+2],n=0;n<4;n++)i.push(8*r+6*n<=8*t.length?e.charAt(o>>>6*(3-n)&63):"=");return i.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var i=[],r=0,o=0;r<t.length;o=++r%4)0!=o&&i.push((e.indexOf(t.charAt(r-1))&Math.pow(2,-2*o+8)-1)<<2*o|e.indexOf(t.charAt(r))>>>6-2*o);return i}},t.exports=i;})),u={utf8:{stringToBytes:function(t){return u.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(u.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],i=0;i<t.length;i++)e.push(255&t.charCodeAt(i));return e},bytesToString:function(t){for(var e=[],i=0;i<t.length;i++)e.push(String.fromCharCode(t[i]));return e.join("")}}},h=u,p=function(t){return null!=t&&(f(t)||"function"==typeof(e=t).readFloatLE&&"function"==typeof e.slice&&f(e.slice(0,0))||!!t._isBuffer);var e;};function f(t){return !!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}var d,_,m,g,v,y,b,w,x,T,S,E,A=c((function(t){var e,i,r,o,n;e=l,i=h.utf8,r=p,o=h.bin,(n=function(t,a){t.constructor==String?t=a&&"binary"===a.encoding?o.stringToBytes(t):i.stringToBytes(t):r(t)?t=Array.prototype.slice.call(t,0):Array.isArray(t)||(t=t.toString());for(var s=e.bytesToWords(t),c=8*t.length,l=1732584193,u=-271733879,h=-1732584194,p=271733878,f=0;f<s.length;f++)s[f]=16711935&(s[f]<<8|s[f]>>>24)|4278255360&(s[f]<<24|s[f]>>>8);s[c>>>5]|=128<<c%32,s[14+(64+c>>>9<<4)]=c;var d=n._ff,_=n._gg,m=n._hh,g=n._ii;for(f=0;f<s.length;f+=16){var v=l,y=u,b=h,w=p;l=d(l,u,h,p,s[f+0],7,-680876936),p=d(p,l,u,h,s[f+1],12,-389564586),h=d(h,p,l,u,s[f+2],17,606105819),u=d(u,h,p,l,s[f+3],22,-1044525330),l=d(l,u,h,p,s[f+4],7,-176418897),p=d(p,l,u,h,s[f+5],12,1200080426),h=d(h,p,l,u,s[f+6],17,-1473231341),u=d(u,h,p,l,s[f+7],22,-45705983),l=d(l,u,h,p,s[f+8],7,1770035416),p=d(p,l,u,h,s[f+9],12,-1958414417),h=d(h,p,l,u,s[f+10],17,-42063),u=d(u,h,p,l,s[f+11],22,-1990404162),l=d(l,u,h,p,s[f+12],7,1804603682),p=d(p,l,u,h,s[f+13],12,-40341101),h=d(h,p,l,u,s[f+14],17,-1502002290),l=_(l,u=d(u,h,p,l,s[f+15],22,1236535329),h,p,s[f+1],5,-165796510),p=_(p,l,u,h,s[f+6],9,-1069501632),h=_(h,p,l,u,s[f+11],14,643717713),u=_(u,h,p,l,s[f+0],20,-373897302),l=_(l,u,h,p,s[f+5],5,-701558691),p=_(p,l,u,h,s[f+10],9,38016083),h=_(h,p,l,u,s[f+15],14,-660478335),u=_(u,h,p,l,s[f+4],20,-405537848),l=_(l,u,h,p,s[f+9],5,568446438),p=_(p,l,u,h,s[f+14],9,-1019803690),h=_(h,p,l,u,s[f+3],14,-187363961),u=_(u,h,p,l,s[f+8],20,1163531501),l=_(l,u,h,p,s[f+13],5,-1444681467),p=_(p,l,u,h,s[f+2],9,-51403784),h=_(h,p,l,u,s[f+7],14,1735328473),l=m(l,u=_(u,h,p,l,s[f+12],20,-1926607734),h,p,s[f+5],4,-378558),p=m(p,l,u,h,s[f+8],11,-2022574463),h=m(h,p,l,u,s[f+11],16,1839030562),u=m(u,h,p,l,s[f+14],23,-35309556),l=m(l,u,h,p,s[f+1],4,-1530992060),p=m(p,l,u,h,s[f+4],11,1272893353),h=m(h,p,l,u,s[f+7],16,-155497632),u=m(u,h,p,l,s[f+10],23,-1094730640),l=m(l,u,h,p,s[f+13],4,681279174),p=m(p,l,u,h,s[f+0],11,-358537222),h=m(h,p,l,u,s[f+3],16,-722521979),u=m(u,h,p,l,s[f+6],23,76029189),l=m(l,u,h,p,s[f+9],4,-640364487),p=m(p,l,u,h,s[f+12],11,-421815835),h=m(h,p,l,u,s[f+15],16,530742520),l=g(l,u=m(u,h,p,l,s[f+2],23,-995338651),h,p,s[f+0],6,-198630844),p=g(p,l,u,h,s[f+7],10,1126891415),h=g(h,p,l,u,s[f+14],15,-1416354905),u=g(u,h,p,l,s[f+5],21,-57434055),l=g(l,u,h,p,s[f+12],6,1700485571),p=g(p,l,u,h,s[f+3],10,-1894986606),h=g(h,p,l,u,s[f+10],15,-1051523),u=g(u,h,p,l,s[f+1],21,-2054922799),l=g(l,u,h,p,s[f+8],6,1873313359),p=g(p,l,u,h,s[f+15],10,-30611744),h=g(h,p,l,u,s[f+6],15,-1560198380),u=g(u,h,p,l,s[f+13],21,1309151649),l=g(l,u,h,p,s[f+4],6,-145523070),p=g(p,l,u,h,s[f+11],10,-1120210379),h=g(h,p,l,u,s[f+2],15,718787259),u=g(u,h,p,l,s[f+9],21,-343485551),l=l+v>>>0,u=u+y>>>0,h=h+b>>>0,p=p+w>>>0;}return e.endian([l,u,h,p])})._ff=function(t,e,i,r,o,n,a){var s=t+(e&i|~e&r)+(o>>>0)+a;return (s<<n|s>>>32-n)+e},n._gg=function(t,e,i,r,o,n,a){var s=t+(e&r|i&~r)+(o>>>0)+a;return (s<<n|s>>>32-n)+e},n._hh=function(t,e,i,r,o,n,a){var s=t+(e^i^r)+(o>>>0)+a;return (s<<n|s>>>32-n)+e},n._ii=function(t,e,i,r,o,n,a){var s=t+(i^(e|~r))+(o>>>0)+a;return (s<<n|s>>>32-n)+e},n._blocksize=16,n._digestsize=16,t.exports=function(t,i){if(null==t)throw new Error("Illegal argument "+t);var r=e.wordsToBytes(n(t,i));return i&&i.asBytes?r:i&&i.asString?o.bytesToString(r):e.bytesToHex(r)};})),k=k||(d=Math,m=(_={}).lib={},g=m.Base={extend:function(t){I.prototype=this;var e=new I;return t&&e.mixIn(t),e.hasOwnProperty("init")||(e.init=function(){e.$super.init.apply(this,arguments);}),(e.init.prototype=e).$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString);},clone:function(){return this.init.prototype.extend(this)}},v=m.WordArray=g.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length;},toString:function(t){return (t||b).stringify(this)},concat:function(t){var e=this.words,i=t.words,r=this.sigBytes,o=t.sigBytes;if(this.clamp(),r%4)for(var n=0;n<o;n++)e[r+n>>>2]|=(i[n>>>2]>>>24-n%4*8&255)<<24-(r+n)%4*8;else if(65535<i.length)for(n=0;n<o;n+=4)e[r+n>>>2]=i[n>>>2];else e.push.apply(e,i);return this.sigBytes+=o,this},clamp:function(){var t=this.words,e=this.sigBytes;t[e>>>2]&=4294967295<<32-e%4*8,t.length=d.ceil(e/4);},clone:function(){var t=g.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],i=0;i<t;i+=4)e.push(4294967296*d.random()|0);return new v.init(e,t)}}),y=_.enc={},b=y.Hex={stringify:function(t){for(var e=t.words,i=t.sigBytes,r=[],o=0;o<i;o++){var n=e[o>>>2]>>>24-o%4*8&255;r.push((n>>>4).toString(16)),r.push((15&n).toString(16));}return r.join("")},parse:function(t){for(var e=t.length,i=[],r=0;r<e;r+=2)i[r>>>3]|=parseInt(t.substr(r,2),16)<<24-r%8*4;return new v.init(i,e/2)}},w=y.Latin1={stringify:function(t){for(var e=t.words,i=t.sigBytes,r=[],o=0;o<i;o++)r.push(String.fromCharCode(e[o>>>2]>>>24-o%4*8&255));return r.join("")},parse:function(t){for(var e=t.length,i=[],r=0;r<e;r++)i[r>>>2]|=(255&t.charCodeAt(r))<<24-r%4*8;return new v.init(i,e)}},x=y.Utf8={stringify:function(t){try{return decodeURIComponent(escape(w.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return w.parse(unescape(encodeURIComponent(t)))}},T=m.BufferedBlockAlgorithm=g.extend({reset:function(){this._data=new v.init,this._nDataBytes=0;},_append:function(t){"string"==typeof t&&(t=x.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes;},_process:function(t){var e=this._data,i=e.words,r=e.sigBytes,o=this.blockSize,n=r/(4*o),a=(n=t?d.ceil(n):d.max((0|n)-this._minBufferSize,0))*o,s=d.min(4*a,r);if(a){for(var c=0;c<a;c+=o)this._doProcessBlock(i,c);var l=i.splice(0,a);e.sigBytes-=s;}return new v.init(l,s)},clone:function(){var t=g.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0}),m.Hasher=T.extend({cfg:g.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset();},reset:function(){T.reset.call(this),this._doReset();},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(e,i){return new t.init(i).finalize(e)}},_createHmacHelper:function(t){return function(e,i){return new S.HMAC.init(t,i).finalize(e)}}}),S=_.algo={},_);function I(){}function B(){this.BYTE_LENGTH=64,this.xBuf=new Array,this.xBufOff=0,this.byteCount=0,this.DIGEST_LENGTH=32,this.v0=[1937774191,1226093241,388252375,3666478592,2842636476,372324522,3817729613,2969243214],this.v0=[1937774191,1226093241,388252375,-628488704,-1452330820,372324522,-477237683,-1325724082],this.v=new Array(8),this.v_=new Array(8),this.X0=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.X=new Array(68),this.xOff=0,this.T_00_15=2043430169,this.T_16_63=2055708042,0<arguments.length?this.InitDigest(arguments[0]):this.Init();}function P(t,e,i){null!=t&&("number"==typeof t?this.fromNumber(t,e,i):this.fromString(t,null==e&&"string"!=typeof t?256:e));}function C(){return new P(null)}function z(t){return F.charAt(t)}function D(t,e){var i=U[t.charCodeAt(e)];return null==i?-1:i}function M(t){var e=C();return e.fromInt(t),e}function R(t){var e,i=1;return 0!=(e=t>>>16)&&(t=e,i+=16),0!=(e=t>>8)&&(t=e,i+=8),0!=(e=t>>4)&&(t=e,i+=4),0!=(e=t>>2)&&(t=e,i+=2),0!=(e=t>>1)&&(t=e,i+=1),i}function L(t){this.m=t;}function O(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t;}B.prototype={Init:function(){this.xBuf=new Array(4),this.Reset();},InitDigest:function(t){this.xBuf=new Array(t.xBuf.length),Array.Copy(t.xBuf,0,this.xBuf,0,t.xBuf.length),this.xBufOff=t.xBufOff,this.byteCount=t.byteCount,Array.Copy(t.X,0,this.X,0,t.X.length),this.xOff=t.xOff,Array.Copy(t.v,0,this.v,0,t.v.length);},GetDigestSize:function(){return this.DIGEST_LENGTH},Reset:function(){this.byteCount=0,this.xBufOff=0,Array.Clear(this.xBuf,0,this.xBuf.length),Array.Copy(this.v0,0,this.v,0,this.v0.length),this.xOff=0,Array.Copy(this.X0,0,this.X,0,this.X0.length);},GetByteLength:function(){return this.BYTE_LENGTH},ProcessBlock:function(){for(var t=this.X,e=new Array(64),i=16;i<68;i++)t[i]=this.P1(t[i-16]^t[i-9]^this.ROTATE(t[i-3],15))^this.ROTATE(t[i-13],7)^t[i-6];for(i=0;i<64;i++)e[i]=t[i]^t[i+4];var r,o,n,a,s,c=this.v,l=this.v_;for(Array.Copy(c,0,l,0,this.v0.length),i=0;i<16;i++)s=this.ROTATE(l[0],12),r=epgis_Int32.parse(epgis_Int32.parse(s+l[4])+this.ROTATE(this.T_00_15,i)),o=(r=this.ROTATE(r,7))^s,n=epgis_Int32.parse(epgis_Int32.parse(this.FF_00_15(l[0],l[1],l[2])+l[3])+o)+e[i],a=epgis_Int32.parse(epgis_Int32.parse(this.GG_00_15(l[4],l[5],l[6])+l[7])+r)+t[i],l[3]=l[2],l[2]=this.ROTATE(l[1],9),l[1]=l[0],l[0]=n,l[7]=l[6],l[6]=this.ROTATE(l[5],19),l[5]=l[4],l[4]=this.P0(a);for(i=16;i<64;i++)s=this.ROTATE(l[0],12),r=epgis_Int32.parse(epgis_Int32.parse(s+l[4])+this.ROTATE(this.T_16_63,i)),o=(r=this.ROTATE(r,7))^s,n=epgis_Int32.parse(epgis_Int32.parse(this.FF_16_63(l[0],l[1],l[2])+l[3])+o)+e[i],a=epgis_Int32.parse(epgis_Int32.parse(this.GG_16_63(l[4],l[5],l[6])+l[7])+r)+t[i],l[3]=l[2],l[2]=this.ROTATE(l[1],9),l[1]=l[0],l[0]=n,l[7]=l[6],l[6]=this.ROTATE(l[5],19),l[5]=l[4],l[4]=this.P0(a);for(i=0;i<8;i++)c[i]^=epgis_Int32.parse(l[i]);this.xOff=0,Array.Copy(this.X0,0,this.X,0,this.X0.length);},ProcessWord:function(t,e){var i=t[e]<<24;i|=(255&t[++e])<<16,i|=(255&t[++e])<<8,i|=255&t[++e],this.X[this.xOff]=i,16==++this.xOff&&this.ProcessBlock();},ProcessLength:function(t){14<this.xOff&&this.ProcessBlock(),this.X[14]=this.URShiftLong(t,32),this.X[15]=4294967295&t;},IntToBigEndian:function(t,e,i){e[i]=epgis_Int32.parseByte(this.URShift(t,24)),e[++i]=epgis_Int32.parseByte(this.URShift(t,16)),e[++i]=epgis_Int32.parseByte(this.URShift(t,8)),e[++i]=epgis_Int32.parseByte(t);},DoFinal:function(t,e){this.Finish();for(var i=0;i<8;i++)this.IntToBigEndian(this.v[i],t,e+4*i);return this.Reset(),this.DIGEST_LENGTH},Update:function(t){this.xBuf[this.xBufOff++]=t,this.xBufOff==this.xBuf.length&&(this.ProcessWord(this.xBuf,0),this.xBufOff=0),this.byteCount++;},BlockUpdate:function(t,e,i){for(;0!=this.xBufOff&&0<i;)this.Update(t[e]),e++,i--;for(;i>this.xBuf.length;)this.ProcessWord(t,e),e+=this.xBuf.length,i-=this.xBuf.length,this.byteCount+=this.xBuf.length;for(;0<i;)this.Update(t[e]),e++,i--;},Finish:function(){var t=this.byteCount<<3;for(this.Update(128);0!=this.xBufOff;)this.Update(0);this.ProcessLength(t),this.ProcessBlock();},ROTATE:function(t,e){return t<<e|this.URShift(t,32-e)},P0:function(t){return t^this.ROTATE(t,9)^this.ROTATE(t,17)},P1:function(t){return t^this.ROTATE(t,15)^this.ROTATE(t,23)},FF_00_15:function(t,e,i){return t^e^i},FF_16_63:function(t,e,i){return t&e|t&i|e&i},GG_00_15:function(t,e,i){return t^e^i},GG_16_63:function(t,e,i){return t&e|~t&i},URShift:function(t,e){return (t>epgis_Int32.maxValue||t<epgis_Int32.minValue)&&(t=epgis_Int32.parse(t)),0<=t?t>>e:(t>>e)+(2<<~e)},URShiftLong:function(t,e){var i=new P;if(i.fromInt(t),0<=i.signum())u=i.shiftRight(e).intValue();else {var r=new P;r.fromInt(2);var o=~e,n="";if(o<0){for(var a=64+o,s=0;s<a;s++)n+="0";var c=new P;c.fromInt(t>>e);var l=new P("10"+n,2),u=(n=l.toRadix(10),l.add(c).toRadix(10));}else u=(t>>e)+(n=r.shiftLeft(~e).intValue());}return u},GetZ:function(t,e){var i=k.enc.Utf8.parse("1234567812345678"),r=4*i.words.length*8;this.Update(r>>8&255),this.Update(255&r);var o=this.GetWords(i.toString());this.BlockUpdate(o,0,o.length);var n=this.GetWords(t.curve.a.toBigInteger().toRadix(16)),a=this.GetWords(t.curve.b.toBigInteger().toRadix(16)),s=this.GetWords(t.getX().toBigInteger().toRadix(16)),c=this.GetWords(t.getY().toBigInteger().toRadix(16)),l=this.GetWords(e.substr(0,64)),u=this.GetWords(e.substr(64,64));this.BlockUpdate(n,0,n.length),this.BlockUpdate(a,0,a.length),this.BlockUpdate(s,0,s.length),this.BlockUpdate(c,0,c.length),this.BlockUpdate(l,0,l.length),this.BlockUpdate(u,0,u.length);var h=new Array(this.GetDigestSize());return this.DoFinal(h,0),h},GetWords:function(t){for(var e=[],i=t.length,r=0;r<i;r+=2)e[e.length]=parseInt(t.substr(r,2),16);return e},GetHex:function(t){for(var e=[],i=0,r=0;r<2*t.length;r+=2)e[r>>>3]|=parseInt(t[i])<<24-r%8*4,i++;return new k.lib.WordArray.init(e,t.length)}},Array.Clear=function(t,e,i){for(var r in t)t[r]=null;},Array.Copy=function(t,e,i,r,o){for(var n=t.slice(e,e+o),a=0;a<n.length;a++)i[r]=n[a],r++;},window.epgis_Int32={minValue:-parseInt("10000000000000000000000000000000",2),maxValue:parseInt("1111111111111111111111111111111",2),parse:function(t){if(t<this.minValue){for(var e=(o=new Number(-t).toString(2)).substr(o.length-31,31),i="",r=0;r<e.length;r++)i+="0"==e.substr(r,1)?"1":"0";return parseInt(i,2)+1}if(t>this.maxValue){var o;for(e=(o=Number(t).toString(2)).substr(o.length-31,31),i="",r=0;r<e.length;r++)i+="0"==e.substr(r,1)?"1":"0";return -(parseInt(i,2)+1)}return t},parseByte:function(t){if(t<0){for(var e=(o=new Number(-t).toString(2)).substr(o.length-8,8),i="",r=0;r<e.length;r++)i+="0"==e.substr(r,1)?"1":"0";return parseInt(i,2)+1}if(255<t){var o=Number(t).toString(2);return parseInt(o.substr(o.length-8,8),2)}return t}},E="Microsoft Internet Explorer"==navigator.appName?(P.prototype.am=function(t,e,i,r,o,n){for(var a=32767&e,s=e>>15;0<=--n;){var c=32767&this[t],l=this[t++]>>15,u=s*c+l*a;o=((c=a*c+((32767&u)<<15)+i[r]+(1073741823&o))>>>30)+(u>>>15)+s*l+(o>>>30),i[r++]=1073741823&c;}return o},30):"Netscape"!=navigator.appName?(P.prototype.am=function(t,e,i,r,o,n){for(;0<=--n;){var a=e*this[t++]+i[r]+o;o=Math.floor(a/67108864),i[r++]=67108863&a;}return o},26):(P.prototype.am=function(t,e,i,r,o,n){for(var a=16383&e,s=e>>14;0<=--n;){var c=16383&this[t],l=this[t++]>>14,u=s*c+l*a;o=((c=a*c+((16383&u)<<14)+i[r]+o)>>28)+(u>>14)+s*l,i[r++]=268435455&c;}return o},28),P.prototype.DB=E,P.prototype.DM=(1<<E)-1,P.prototype.DV=1<<E,P.prototype.FV=Math.pow(2,52),P.prototype.F1=52-E,P.prototype.F2=2*E-52;for(var F="0123456789abcdefghijklmnopqrstuvwxyz",U=new Array,N="0".charCodeAt(0),j=0;j<=9;++j)U[N++]=j;for(N="a".charCodeAt(0),j=10;j<36;++j)U[N++]=j;for(N="A".charCodeAt(0),j=10;j<36;++j)U[N++]=j;function V(t,e){return t&e}function q(t,e){return t|e}function Z(t,e){return t^e}function G(t,e){return t&~e}function H(){}function W(t){return t}function X(t){this.r2=C(),this.q3=C(),P.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t;}L.prototype.convert=function(t){return t.s<0||0<=t.compareTo(this.m)?t.mod(this.m):t},L.prototype.revert=function(t){return t},L.prototype.reduce=function(t){t.divRemTo(this.m,null,t);},L.prototype.mulTo=function(t,e,i){t.multiplyTo(e,i),this.reduce(i);},L.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e);},O.prototype.convert=function(t){var e=C();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&0<e.compareTo(P.ZERO)&&this.m.subTo(e,e),e},O.prototype.revert=function(t){var e=C();return t.copyTo(e),this.reduce(e),e},O.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var i=32767&t[e],r=i*this.mpl+((i*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(t[i=e+this.m.t]+=this.m.am(0,r,t,e,0,this.m.t);t[i]>=t.DV;)t[i]-=t.DV,t[++i]++;}t.clamp(),t.drShiftTo(this.m.t,t),0<=t.compareTo(this.m)&&t.subTo(this.m,t);},O.prototype.mulTo=function(t,e,i){t.multiplyTo(e,i),this.reduce(i);},O.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e);},P.prototype.copyTo=function(t){for(var e=this.t-1;0<=e;--e)t[e]=this[e];t.t=this.t,t.s=this.s;},P.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,0<t?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0;},P.prototype.fromString=function(t,e){var i;if(16==e)i=4;else if(8==e)i=3;else if(256==e)i=8;else if(2==e)i=1;else if(32==e)i=5;else {if(4!=e)return void this.fromRadix(t,e);i=2;}this.t=0,this.s=0;for(var r=t.length,o=!1,n=0;0<=--r;){var a=8==i?255&t[r]:D(t,r);a<0?"-"==t.charAt(r)&&(o=!0):(o=!1,0==n?this[this.t++]=a:n+i>this.DB?(this[this.t-1]|=(a&(1<<this.DB-n)-1)<<n,this[this.t++]=a>>this.DB-n):this[this.t-1]|=a<<n,(n+=i)>=this.DB&&(n-=this.DB));}8==i&&0!=(128&t[0])&&(this.s=-1,0<n&&(this[this.t-1]|=(1<<this.DB-n)-1<<n)),this.clamp(),o&&P.ZERO.subTo(this,this);},P.prototype.clamp=function(){for(var t=this.s&this.DM;0<this.t&&this[this.t-1]==t;)--this.t;},P.prototype.dlShiftTo=function(t,e){for(var i=this.t-1;0<=i;--i)e[i+t]=this[i];for(i=t-1;0<=i;--i)e[i]=0;e.t=this.t+t,e.s=this.s;},P.prototype.drShiftTo=function(t,e){for(var i=t;i<this.t;++i)e[i-t]=this[i];e.t=Math.max(this.t-t,0),e.s=this.s;},P.prototype.lShiftTo=function(t,e){for(var i=t%this.DB,r=this.DB-i,o=(1<<r)-1,n=Math.floor(t/this.DB),a=this.s<<i&this.DM,s=this.t-1;0<=s;--s)e[s+n+1]=this[s]>>r|a,a=(this[s]&o)<<i;for(s=n-1;0<=s;--s)e[s]=0;e[n]=a,e.t=this.t+n+1,e.s=this.s,e.clamp();},P.prototype.rShiftTo=function(t,e){e.s=this.s;var i=Math.floor(t/this.DB);if(i>=this.t)e.t=0;else {var r=t%this.DB,o=this.DB-r,n=(1<<r)-1;e[0]=this[i]>>r;for(var a=i+1;a<this.t;++a)e[a-i-1]|=(this[a]&n)<<o,e[a-i]=this[a]>>r;0<r&&(e[this.t-i-1]|=(this.s&n)<<o),e.t=this.t-i,e.clamp();}},P.prototype.subTo=function(t,e){for(var i=0,r=0,o=Math.min(t.t,this.t);i<o;)r+=this[i]-t[i],e[i++]=r&this.DM,r>>=this.DB;if(t.t<this.t){for(r-=t.s;i<this.t;)r+=this[i],e[i++]=r&this.DM,r>>=this.DB;r+=this.s;}else {for(r+=this.s;i<t.t;)r-=t[i],e[i++]=r&this.DM,r>>=this.DB;r-=t.s;}e.s=r<0?-1:0,r<-1?e[i++]=this.DV+r:0<r&&(e[i++]=r),e.t=i,e.clamp();},P.prototype.multiplyTo=function(t,e){var i=this.abs(),r=t.abs(),o=i.t;for(e.t=o+r.t;0<=--o;)e[o]=0;for(o=0;o<r.t;++o)e[o+i.t]=i.am(0,r[o],e,o,0,i.t);e.s=0,e.clamp(),this.s!=t.s&&P.ZERO.subTo(e,e);},P.prototype.squareTo=function(t){for(var e=this.abs(),i=t.t=2*e.t;0<=--i;)t[i]=0;for(i=0;i<e.t-1;++i){var r=e.am(i,e[i],t,2*i,0,1);(t[i+e.t]+=e.am(i+1,2*e[i],t,2*i+1,r,e.t-i-1))>=e.DV&&(t[i+e.t]-=e.DV,t[i+e.t+1]=1);}0<t.t&&(t[t.t-1]+=e.am(i,e[i],t,2*i,0,1)),t.s=0,t.clamp();},P.prototype.divRemTo=function(t,e,i){var r=t.abs();if(!(r.t<=0)){var o=this.abs();if(o.t<r.t)return null!=e&&e.fromInt(0),void(null!=i&&this.copyTo(i));null==i&&(i=C());var n=C(),a=this.s,s=t.s,c=this.DB-R(r[r.t-1]);0<c?(r.lShiftTo(c,n),o.lShiftTo(c,i)):(r.copyTo(n),o.copyTo(i));var l=n.t,u=n[l-1];if(0!=u){var h=u*(1<<this.F1)+(1<l?n[l-2]>>this.F2:0),p=this.FV/h,f=(1<<this.F1)/h,d=1<<this.F2,_=i.t,m=_-l,g=null==e?C():e;for(n.dlShiftTo(m,g),0<=i.compareTo(g)&&(i[i.t++]=1,i.subTo(g,i)),P.ONE.dlShiftTo(l,g),g.subTo(n,n);n.t<l;)n[n.t++]=0;for(;0<=--m;){var v=i[--_]==u?this.DM:Math.floor(i[_]*p+(i[_-1]+d)*f);if((i[_]+=n.am(0,v,i,m,0,l))<v)for(n.dlShiftTo(m,g),i.subTo(g,i);i[_]<--v;)i.subTo(g,i);}null!=e&&(i.drShiftTo(l,e),a!=s&&P.ZERO.subTo(e,e)),i.t=l,i.clamp(),0<c&&i.rShiftTo(c,i),a<0&&P.ZERO.subTo(i,i);}}},P.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return 0<(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)?this.DV-e:-e},P.prototype.isEven=function(){return 0==(0<this.t?1&this[0]:this.s)},P.prototype.exp=function(t,e){if(4294967295<t||t<1)return P.ONE;var i,r=C(),o=C(),n=e.convert(this),a=R(t)-1;for(n.copyTo(r);0<=--a;)e.sqrTo(r,o),0<(t&1<<a)?e.mulTo(o,n,r):(i=r,r=o,o=i);return e.revert(r)},P.prototype.toString=function(t){if(this.s<0)return "-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else {if(4!=t)return this.toRadix(t);e=2;}var i,r=(1<<e)-1,o=!1,n="",a=this.t,s=this.DB-a*this.DB%e;if(0<a--)for(s<this.DB&&0<(i=this[a]>>s)&&(o=!0,n=z(i));0<=a;)s<e?(i=(this[a]&(1<<s)-1)<<e-s,i|=this[--a]>>(s+=this.DB-e)):(i=this[a]>>(s-=e)&r,s<=0&&(s+=this.DB,--a)),0<i&&(o=!0),o&&(n+=z(i));return o?n:"0"},P.prototype.negate=function(){var t=C();return P.ZERO.subTo(this,t),t},P.prototype.abs=function(){return this.s<0?this.negate():this},P.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var i=this.t;if(0!=(e=i-t.t))return this.s<0?-e:e;for(;0<=--i;)if(0!=(e=this[i]-t[i]))return e;return 0},P.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+R(this[this.t-1]^this.s&this.DM)},P.prototype.mod=function(t){var e=C();return this.abs().divRemTo(t,null,e),this.s<0&&0<e.compareTo(P.ZERO)&&t.subTo(e,e),e},P.prototype.modPowInt=function(t,e){var i=new(t<256||e.isEven()?L:O)(e);return this.exp(t,i)},P.ZERO=M(0),P.ONE=M(1),H.prototype.convert=W,H.prototype.revert=W,H.prototype.mulTo=function(t,e,i){t.multiplyTo(e,i);},H.prototype.sqrTo=function(t,e){t.squareTo(e);},X.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=C();return t.copyTo(e),this.reduce(e),e},X.prototype.revert=function(t){return t},X.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);0<=t.compareTo(this.m);)t.subTo(this.m,t);},X.prototype.mulTo=function(t,e,i){t.multiplyTo(e,i),this.reduce(i);},X.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e);};var K=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],Y=(1<<26)/K[K.length-1];P.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},P.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||36<t)return "0";var e=this.chunkSize(t),i=Math.pow(t,e),r=M(i),o=C(),n=C(),a="";for(this.divRemTo(r,o,n);0<o.signum();)a=(i+n.intValue()).toString(t).substr(1)+a,o.divRemTo(r,o,n);return n.intValue().toString(t)+a},P.prototype.fromRadix=function(t,e){this.fromInt(0),null==e&&(e=10);for(var i=this.chunkSize(e),r=Math.pow(e,i),o=!1,n=0,a=0,s=0;s<t.length;++s){var c=D(t,s);c<0?"-"==t.charAt(s)&&0==this.signum()&&(o=!0):(a=e*a+c,++n>=i&&(this.dMultiply(r),this.dAddOffset(a,0),a=n=0));}0<n&&(this.dMultiply(Math.pow(e,n)),this.dAddOffset(a,0)),o&&P.ZERO.subTo(this,this);},P.prototype.fromNumber=function(t,e,i){if("number"==typeof e)if(t<2)this.fromInt(1);else for(this.fromNumber(t,i),this.testBit(t-1)||this.bitwiseTo(P.ONE.shiftLeft(t-1),q,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(P.ONE.shiftLeft(t-1),this);else {var r=new Array,o=7&t;r.length=1+(t>>3),e.nextBytes(r),0<o?r[0]&=(1<<o)-1:r[0]=0,this.fromString(r,256);}},P.prototype.bitwiseTo=function(t,e,i){for(var r,o=Math.min(t.t,this.t),n=0;n<o;++n)i[n]=e(this[n],t[n]);if(t.t<this.t){for(r=t.s&this.DM,n=o;n<this.t;++n)i[n]=e(this[n],r);i.t=this.t;}else {for(r=this.s&this.DM,n=o;n<t.t;++n)i[n]=e(r,t[n]);i.t=t.t;}i.s=e(this.s,t.s),i.clamp();},P.prototype.changeBit=function(t,e){var i=P.ONE.shiftLeft(t);return this.bitwiseTo(i,e,i),i},P.prototype.addTo=function(t,e){for(var i=0,r=0,o=Math.min(t.t,this.t);i<o;)r+=this[i]+t[i],e[i++]=r&this.DM,r>>=this.DB;if(t.t<this.t){for(r+=t.s;i<this.t;)r+=this[i],e[i++]=r&this.DM,r>>=this.DB;r+=this.s;}else {for(r+=this.s;i<t.t;)r+=t[i],e[i++]=r&this.DM,r>>=this.DB;r+=t.s;}e.s=r<0?-1:0,0<r?e[i++]=r:r<-1&&(e[i++]=this.DV+r),e.t=i,e.clamp();},P.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp();},P.prototype.dAddOffset=function(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e];}},P.prototype.multiplyLowerTo=function(t,e,i){var r,o=Math.min(this.t+t.t,e);for(i.s=0,i.t=o;0<o;)i[--o]=0;for(r=i.t-this.t;o<r;++o)i[o+this.t]=this.am(0,t[o],i,o,0,this.t);for(r=Math.min(t.t,e);o<r;++o)this.am(0,t[o],i,o,0,e-o);i.clamp();},P.prototype.multiplyUpperTo=function(t,e,i){--e;var r=i.t=this.t+t.t-e;for(i.s=0;0<=--r;)i[r]=0;for(r=Math.max(e-this.t,0);r<t.t;++r)i[this.t+r-e]=this.am(e-r,t[r],i,0,0,this.t+r-e);i.clamp(),i.drShiftTo(1,i);},P.prototype.modInt=function(t){if(t<=0)return 0;var e=this.DV%t,i=this.s<0?t-1:0;if(0<this.t)if(0==e)i=this[0]%t;else for(var r=this.t-1;0<=r;--r)i=(e*i+this[r])%t;return i},P.prototype.millerRabin=function(t){var e=this.subtract(P.ONE),i=e.getLowestSetBit();if(i<=0)return !1;var r=e.shiftRight(i);K.length<(t=t+1>>1)&&(t=K.length);for(var o=C(),n=0;n<t;++n){o.fromInt(K[Math.floor(Math.random()*K.length)]);var a=o.modPow(r,this);if(0!=a.compareTo(P.ONE)&&0!=a.compareTo(e)){for(var s=1;s++<i&&0!=a.compareTo(e);)if(0==(a=a.modPowInt(2,this)).compareTo(P.ONE))return !1;if(0!=a.compareTo(e))return !1}}return !0},P.prototype.clone=function(){var t=C();return this.copyTo(t),t},P.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return -1}else {if(1==this.t)return this[0];if(0==this.t)return 0}return (this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},P.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},P.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},P.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},P.prototype.toByteArray=function(){var t=this.t,e=new Array;e[0]=this.s;var i,r=this.DB-t*this.DB%8,o=0;if(0<t--)for(r<this.DB&&(i=this[t]>>r)!=(this.s&this.DM)>>r&&(e[o++]=i|this.s<<this.DB-r);0<=t;)r<8?(i=(this[t]&(1<<r)-1)<<8-r,i|=this[--t]>>(r+=this.DB-8)):(i=this[t]>>(r-=8)&255,r<=0&&(r+=this.DB,--t)),0!=(128&i)&&(i|=-256),0==o&&(128&this.s)!=(128&i)&&++o,(0<o||i!=this.s)&&(e[o++]=i);return e},P.prototype.equals=function(t){return 0==this.compareTo(t)},P.prototype.min=function(t){return this.compareTo(t)<0?this:t},P.prototype.max=function(t){return 0<this.compareTo(t)?this:t},P.prototype.and=function(t){var e=C();return this.bitwiseTo(t,V,e),e},P.prototype.or=function(t){var e=C();return this.bitwiseTo(t,q,e),e},P.prototype.xor=function(t){var e=C();return this.bitwiseTo(t,Z,e),e},P.prototype.andNot=function(t){var e=C();return this.bitwiseTo(t,G,e),e},P.prototype.not=function(){for(var t=C(),e=0;e<this.t;++e)t[e]=this.DM&~this[e];return t.t=this.t,t.s=~this.s,t},P.prototype.shiftLeft=function(t){var e=C();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e},P.prototype.shiftRight=function(t){var e=C();return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e},P.prototype.getLowestSetBit=function(){for(var t=0;t<this.t;++t)if(0!=this[t])return t*this.DB+function(t){if(0==t)return -1;var e=0;return 0==(65535&t)&&(t>>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}(this[t]);return this.s<0?this.t*this.DB:-1},P.prototype.bitCount=function(){for(var t=0,e=this.s&this.DM,i=0;i<this.t;++i)t+=function(t){for(var e=0;0!=t;)t&=t-1,++e;return e}(this[i]^e);return t},P.prototype.testBit=function(t){var e=Math.floor(t/this.DB);return e>=this.t?0!=this.s:0!=(this[e]&1<<t%this.DB)},P.prototype.setBit=function(t){return this.changeBit(t,q)},P.prototype.clearBit=function(t){return this.changeBit(t,G)},P.prototype.flipBit=function(t){return this.changeBit(t,Z)},P.prototype.add=function(t){var e=C();return this.addTo(t,e),e},P.prototype.subtract=function(t){var e=C();return this.subTo(t,e),e},P.prototype.multiply=function(t){var e=C();return this.multiplyTo(t,e),e},P.prototype.divide=function(t){var e=C();return this.divRemTo(t,e,null),e},P.prototype.remainder=function(t){var e=C();return this.divRemTo(t,null,e),e},P.prototype.divideAndRemainder=function(t){var e=C(),i=C();return this.divRemTo(t,e,i),new Array(e,i)},P.prototype.modPow=function(t,e){var i,r,o=t.bitLength(),n=M(1);if(o<=0)return n;i=o<18?1:o<48?3:o<144?4:o<768?5:6,r=new(o<8?L:e.isEven()?X:O)(e);var a=new Array,s=3,c=i-1,l=(1<<i)-1;if(a[1]=r.convert(this),1<i){var u=C();for(r.sqrTo(a[1],u);s<=l;)a[s]=C(),r.mulTo(u,a[s-2],a[s]),s+=2;}var h,p,f=t.t-1,d=!0,_=C();for(o=R(t[f])-1;0<=f;){for(c<=o?h=t[f]>>o-c&l:(h=(t[f]&(1<<o+1)-1)<<c-o,0<f&&(h|=t[f-1]>>this.DB+o-c)),s=i;0==(1&h);)h>>=1,--s;if((o-=s)<0&&(o+=this.DB,--f),d)a[h].copyTo(n),d=!1;else {for(;1<s;)r.sqrTo(n,_),r.sqrTo(_,n),s-=2;0<s?r.sqrTo(n,_):(p=n,n=_,_=p),r.mulTo(_,a[h],n);}for(;0<=f&&0==(t[f]&1<<o);)r.sqrTo(n,_),p=n,n=_,_=p,--o<0&&(o=this.DB-1,--f);}return r.revert(n)},P.prototype.modInverse=function(t){var e=t.isEven();if(this.isEven()&&e||0==t.signum())return P.ZERO;for(var i=t.clone(),r=this.clone(),o=M(1),n=M(0),a=M(0),s=M(1);0!=i.signum();){for(;i.isEven();)i.rShiftTo(1,i),e?(o.isEven()&&n.isEven()||(o.addTo(this,o),n.subTo(t,n)),o.rShiftTo(1,o)):n.isEven()||n.subTo(t,n),n.rShiftTo(1,n);for(;r.isEven();)r.rShiftTo(1,r),e?(a.isEven()&&s.isEven()||(a.addTo(this,a),s.subTo(t,s)),a.rShiftTo(1,a)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);0<=i.compareTo(r)?(i.subTo(r,i),e&&o.subTo(a,o),n.subTo(s,n)):(r.subTo(i,r),e&&a.subTo(o,a),s.subTo(n,s));}return 0!=r.compareTo(P.ONE)?P.ZERO:0<=s.compareTo(t)?s.subtract(t):s.signum()<0?(s.addTo(t,s),s.signum()<0?s.add(t):s):s},P.prototype.pow=function(t){return this.exp(t,new H)},P.prototype.gcd=function(t){var e,i=this.s<0?this.negate():this.clone(),r=t.s<0?t.negate():t.clone();i.compareTo(r)<0&&(e=i,i=r,r=e);var o=i.getLowestSetBit(),n=r.getLowestSetBit();if(n<0)return i;for(o<n&&(n=o),0<n&&(i.rShiftTo(n,i),r.rShiftTo(n,r));0<i.signum();)0<(o=i.getLowestSetBit())&&i.rShiftTo(o,i),0<(o=r.getLowestSetBit())&&r.rShiftTo(o,r),0<=i.compareTo(r)?(i.subTo(r,i),i.rShiftTo(1,i)):(r.subTo(i,r),r.rShiftTo(1,r));return 0<n&&r.lShiftTo(n,r),r},P.prototype.isProbablePrime=function(t){var e,i=this.abs();if(1==i.t&&i[0]<=K[K.length-1]){for(e=0;e<K.length;++e)if(i[0]==K[e])return !0;return !1}if(i.isEven())return !1;for(e=1;e<K.length;){for(var r=K[e],o=e+1;o<K.length&&r<Y;)r*=K[o++];for(r=i.modInt(r);e<o;)if(r%K[e++]==0)return !1}return i.millerRabin(t)},P.prototype.square=function(){var t=C();return this.squareTo(t),t};var J=function(t){return A(t)},Q=function(t){if(null==t||""==t)return "";var e=[],i=new B,r=k.enc.Utf8.parse(t);return r=i.GetWords(r.toString()),i.BlockUpdate(r,0,r.length),(i.DoFinal(e,0),i.GetHex(e)).toString()},$=function(t,e){if(!o)return null;var i=o.enc.Utf8.parse(e);return a.encrypt(o.enc.Utf8.parse(t),i,{mode:o.mode.ECB,padding:o.pad.Pkcs7}).ciphertext.toString(o.enc.Base64)},tt=function(t,e){if(!o)return null;var i=o.enc.Utf8.parse(e);return a.decrypt({ciphertext:o.enc.Base64.parse(t)},i,{mode:o.mode.ECB,padding:o.pad.Pkcs7}).toString(o.enc.Utf8)},et=function(t){var e=[];for(var i in t){var r=t[i];e.push("".concat(i,"=").concat(r));}return e.join("&")},it=function(){return window.SGMap},rt=c((function(t,e){!function(i,r){var o="function",n="model",a="name",s="type",c="vendor",l="version",u="architecture",h="console",p="mobile",f="tablet",d="smarttv",_="wearable",m={extend:function(t,e){var i={};for(var r in t)i[r]=e[r]&&e[r].length%2==0?e[r].concat(t[r]):t[r];return i},has:function(t,e){return "string"==typeof t&&-1!==e.toLowerCase().indexOf(t.toLowerCase())},lowerize:function(t){return t.toLowerCase()},major:function(t){return "string"==typeof t?t.replace(/[^\d\.]/g,"").split(".")[0]:r},trim:function(t){return t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},g={rgx:function(t,e){for(var i,n,a,s,c,l=0;l<e.length&&!s;){for(var u=e[l],h=e[l+1],p=i=0;p<u.length&&!s;)if(s=u[p++].exec(t))for(n=0;n<h.length;n++)c=s[++i],"object"==typeof(a=h[n])&&0<a.length?2==a.length?this[a[0]]=typeof a[1]==o?a[1].call(this,c):a[1]:3==a.length?this[a[0]]=typeof a[1]!=o||a[1].exec&&a[1].test?c?c.replace(a[1],a[2]):r:c?a[1].call(this,c,a[2]):r:4==a.length&&(this[a[0]]=c?a[3].call(this,c.replace(a[1],a[2])):r):this[a]=c||r;l+=2;}},str:function(t,e){for(var i in e)if("object"==typeof e[i]&&0<e[i].length){for(var o=0;o<e[i].length;o++)if(m.has(e[i][o],t))return "?"===i?r:i}else if(m.has(e[i],t))return "?"===i?r:i;return t}},v={browser:{oldsafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}}},device:{amazon:{model:{"Fire Phone":["SD","KF"]}},sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"}}}},y={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[a,l],[/(opios)[\/\s]+([\w\.]+)/i],[[a,"Opera Mini"],l],[/\s(opr)\/([\w\.]+)/i],[[a,"Opera"],l],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]*)/i,/(avant\s|iemobile|slim)(?:browser)?[\/\s]?([\w\.]*)/i,/(bidubrowser|baidubrowser)[\/\s]?([\w\.]+)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(rekonq)\/([\w\.]*)/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon)\/([\w\.-]+)/i],[a,l],[/(konqueror)\/([\w\.]+)/i],[[a,"Konqueror"],l],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[[a,"IE"],l],[/(edge|edgios|edga|edg)\/((\d+)?[\w\.]+)/i],[[a,"Edge"],l],[/(yabrowser)\/([\w\.]+)/i],[[a,"Yandex"],l],[/(Avast)\/([\w\.]+)/i],[[a,"Avast Secure Browser"],l],[/(AVG)\/([\w\.]+)/i],[[a,"AVG Secure Browser"],l],[/(puffin)\/([\w\.]+)/i],[[a,"Puffin"],l],[/(focus)\/([\w\.]+)/i],[[a,"Firefox Focus"],l],[/(opt)\/([\w\.]+)/i],[[a,"Opera Touch"],l],[/((?:[\s\/])uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i],[[a,"UCBrowser"],l],[/(comodo_dragon)\/([\w\.]+)/i],[[a,/_/g," "],l],[/(windowswechat qbcore)\/([\w\.]+)/i],[[a,"WeChat(Win) Desktop"],l],[/(micromessenger)\/([\w\.]+)/i],[[a,"WeChat"],l],[/(brave)\/([\w\.]+)/i],[[a,"Brave"],l],[/(qqbrowserlite)\/([\w\.]+)/i],[a,l],[/(QQ)\/([\d\.]+)/i],[a,l],[/m?(qqbrowser)[\/\s]?([\w\.]+)/i],[a,l],[/(baiduboxapp)[\/\s]?([\w\.]+)/i],[a,l],[/(2345Explorer)[\/\s]?([\w\.]+)/i],[a,l],[/(MetaSr)[\/\s]?([\w\.]+)/i],[a],[/(LBBROWSER)/i],[a],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[l,[a,"MIUI Browser"]],[/;fbav\/([\w\.]+);/i],[l,[a,"Facebook"]],[/safari\s(line)\/([\w\.]+)/i,/android.+(line)\/([\w\.]+)\/iab/i],[a,l],[/headlesschrome(?:\/([\w\.]+)|\s)/i],[l,[a,"Chrome Headless"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[a,/(.+)/,"$1 WebView"],l],[/((?:oculus|samsung)browser)\/([\w\.]+)/i],[[a,/(.+(?:g|us))(.+)/,"$1 $2"],l],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)*/i],[l,[a,"Android Browser"]],[/(sailfishbrowser)\/([\w\.]+)/i],[[a,"Sailfish Browser"],l],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i],[a,l],[/(dolfin)\/([\w\.]+)/i],[[a,"Dolphin"],l],[/(qihu|qhbrowser|qihoobrowser|360browser)/i],[[a,"360 Browser"]],[/((?:android.+)crmo|crios)\/([\w\.]+)/i],[[a,"Chrome"],l],[/(coast)\/([\w\.]+)/i],[[a,"Opera Coast"],l],[/fxios\/([\w\.-]+)/i],[l,[a,"Firefox"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],[l,[a,"Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],[l,a],[/webkit.+?(gsa)\/([\w\.]+).+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[[a,"GSA"],l],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[a,[l,g.str,v.browser.oldsafari.version]],[/(webkit|khtml)\/([\w\.]+)/i],[a,l],[/(navigator|netscape)\/([\w\.-]+)/i],[[a,"Netscape"],l],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)$/i,/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]*)/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[a,l]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[[u,"amd64"]],[/(ia32(?=;))/i],[[u,m.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[[u,"ia32"]],[/windows\s(ce|mobile);\sppc;/i],[[u,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[[u,/ower/,"",m.lowerize]],[/(sun4\w)[;\)]/i],[[u,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+[;l]))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],[[u,m.lowerize]]],device:[[/\((ipad|playbook);[\w\s\),;-]+(rim|apple)/i],[n,c,[s,f]],[/applecoremedia\/[\w\.]+ \((ipad)/],[n,[c,"Apple"],[s,f]],[/(apple\s{0,1}tv)/i],[[n,"Apple TV"],[c,"Apple"],[s,d]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad)/i,/(hp).+(tablet)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i],[c,n,[s,f]],[/(kf[A-z]+)\sbuild\/.+silk\//i],[n,[c,"Amazon"],[s,f]],[/(sd|kf)[0349hijorstuw]+\sbuild\/.+silk\//i],[[n,g.str,v.device.amazon.model],[c,"Amazon"],[s,p]],[/android.+aft([bms])\sbuild/i],[n,[c,"Amazon"],[s,d]],[/\((ip[honed|\s\w*]+);.+(apple)/i],[n,c,[s,p]],[/\((ip[honed|\s\w*]+);/i],[n,[c,"Apple"],[s,p]],[/(blackberry)[\s-]?(\w+)/i,/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[\s_-]?([\w-]*)/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i],[c,n,[s,p]],[/\(bb10;\s(\w+)/i],[n,[c,"BlackBerry"],[s,p]],[/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7|padfone|p00c)/i],[n,[c,"Asus"],[s,f]],[/(sony)\s(tablet\s[ps])\sbuild\//i,/(sony)?(?:sgp.+)\sbuild\//i],[[c,"Sony"],[n,"Xperia Tablet"],[s,f]],[/android.+\s([c-g]\d{4}|so[-l]\w+)(?=\sbuild\/|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[n,[c,"Sony"],[s,p]],[/\s(ouya)\s/i,/(nintendo)\s([wids3u]+)/i],[c,n,[s,h]],[/android.+;\s(shield)\sbuild/i],[n,[c,"Nvidia"],[s,h]],[/(playstation\s[34portablevi]+)/i],[n,[c,"Sony"],[s,h]],[/(sprint\s(\w+))/i],[[c,g.str,v.device.sprint.vendor],[n,g.str,v.device.sprint.model],[s,p]],[/(htc)[;_\s-]+([\w\s]+(?=\)|\sbuild)|\w+)/i,/(zte)-(\w*)/i,/(alcatel|geeksphone|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i],[c,[n,/_/g," "],[s,p]],[/(nexus\s9)/i],[n,[c,"HTC"],[s,f]],[/d\/huawei([\w\s-]+)[;\)]/i,/(nexus\s6p|vog-l29|ane-lx1|eml-l29|ele-l29)/i],[n,[c,"Huawei"],[s,p]],[/android.+(bah2?-a?[lw]\d{2})/i],[n,[c,"Huawei"],[s,f]],[/(microsoft);\s(lumia[\s\w]+)/i],[c,n,[s,p]],[/[\s\(;](xbox(?:\sone)?)[\s\);]/i],[n,[c,"Microsoft"],[s,h]],[/(kin\.[onetw]{3})/i],[[n,/\./g," "],[c,"Microsoft"],[s,p]],[/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?:?(\s4g)?)[\w\s]+build\//i,/mot[\s-]?(\w*)/i,/(XT\d{3,4}) build\//i,/(nexus\s6)/i],[n,[c,"Motorola"],[s,p]],[/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[n,[c,"Motorola"],[s,f]],[/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i],[[c,m.trim],[n,m.trim],[s,d]],[/hbbtv.+maple;(\d+)/i],[[n,/^/,"SmartTV"],[c,"Samsung"],[s,d]],[/\(dtv[\);].+(aquos)/i],[n,[c,"Sharp"],[s,d]],[/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n\d+|sgh-t8[56]9|nexus 10))/i,/((SM-T\w+))/i],[[c,"Samsung"],n,[s,f]],[/smart-tv.+(samsung)/i],[c,[s,d],n],[/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-\w[\w\d]+))/i,/(sam[sung]*)[\s-]*(\w+-?[\w-]*)/i,/sec-((sgh\w+))/i],[[c,"Samsung"],n,[s,p]],[/sie-(\w*)/i],[n,[c,"Siemens"],[s,p]],[/(maemo|nokia).*(n900|lumia\s\d+)/i,/(nokia)[\s_-]?([\w-]*)/i],[[c,"Nokia"],n,[s,p]],[/android[x\d\.\s;]+\s([ab][1-7]\-?[0178a]\d\d?)/i],[n,[c,"Acer"],[s,f]],[/android.+([vl]k\-?\d{3})\s+build/i],[n,[c,"LG"],[s,f]],[/android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i],[[c,"LG"],n,[s,f]],[/(lg) netcast\.tv/i],[c,n,[s,d]],[/(nexus\s[45])/i,/lg[e;\s\/-]+(\w*)/i,/android.+lg(\-?[\d\w]+)\s+build/i],[n,[c,"LG"],[s,p]],[/(lenovo)\s?(s(?:5000|6000)(?:[\w-]+)|tab(?:[\s\w]+))/i],[c,n,[s,f]],[/android.+(ideatab[a-z0-9\-\s]+)/i],[n,[c,"Lenovo"],[s,f]],[/(lenovo)[_\s-]?([\w-]+)/i],[c,n,[s,p]],[/linux;.+((jolla));/i],[c,n,[s,p]],[/((pebble))app\/[\d\.]+\s/i],[c,n,[s,_]],[/android.+;\s(oppo)\s?([\w\s]+)\sbuild/i],[c,n,[s,p]],[/crkey/i],[[n,"Chromecast"],[c,"Google"],[s,d]],[/android.+;\s(glass)\s\d/i],[n,[c,"Google"],[s,_]],[/android.+;\s(pixel c)[\s)]/i],[n,[c,"Google"],[s,f]],[/android.+;\s(pixel( [23])?( xl)?)[\s)]/i],[n,[c,"Google"],[s,p]],[/android.+;\s(\w+)\s+build\/hm\1/i,/android.+(hm[\s\-_]*note?[\s_]*(?:\d\w)?)\s+build/i,/android.+(mi[\s\-_]*(?:a\d|one|one[\s_]plus|note lte)?[\s_]*(?:\d?\w?)[\s_]*(?:plus)?)\s+build/i,/android.+(redmi[\s\-_]*(?:note)?(?:[\s_]?[\w\s]+))\s+build/i],[[n,/_/g," "],[c,"Xiaomi"],[s,p]],[/android.+(mi[\s\-_]*(?:pad)(?:[\s_]?[\w\s]+))\s+build/i],[[n,/_/g," "],[c,"Xiaomi"],[s,f]],[/android.+;\s(m[1-5]\snote)\sbuild/i],[n,[c,"Meizu"],[s,p]],[/(mz)-([\w-]{2,})/i],[[c,"Meizu"],n,[s,p]],[/android.+a000(1)\s+build/i,/android.+oneplus\s(a\d{4})[\s)]/i],[n,[c,"OnePlus"],[s,p]],[/android.+[;\/]\s*(RCT[\d\w]+)\s+build/i],[n,[c,"RCA"],[s,f]],[/android.+[;\/\s]+(Venue[\d\s]{2,7})\s+build/i],[n,[c,"Dell"],[s,f]],[/android.+[;\/]\s*(Q[T|M][\d\w]+)\s+build/i],[n,[c,"Verizon"],[s,f]],[/android.+[;\/]\s+(Barnes[&\s]+Noble\s+|BN[RT])(V?.*)\s+build/i],[[c,"Barnes & Noble"],n,[s,f]],[/android.+[;\/]\s+(TM\d{3}.*\b)\s+build/i],[n,[c,"NuVision"],[s,f]],[/android.+;\s(k88)\sbuild/i],[n,[c,"ZTE"],[s,f]],[/android.+[;\/]\s*(gen\d{3})\s+build.*49h/i],[n,[c,"Swiss"],[s,p]],[/android.+[;\/]\s*(zur\d{3})\s+build/i],[n,[c,"Swiss"],[s,f]],[/android.+[;\/]\s*((Zeki)?TB.*\b)\s+build/i],[n,[c,"Zeki"],[s,f]],[/(android).+[;\/]\s+([YR]\d{2})\s+build/i,/android.+[;\/]\s+(Dragon[\-\s]+Touch\s+|DT)(\w{5})\sbuild/i],[[c,"Dragon Touch"],n,[s,f]],[/android.+[;\/]\s*(NS-?\w{0,9})\sbuild/i],[n,[c,"Insignia"],[s,f]],[/android.+[;\/]\s*((NX|Next)-?\w{0,9})\s+build/i],[n,[c,"NextBook"],[s,f]],[/android.+[;\/]\s*(Xtreme\_)?(V(1[045]|2[015]|30|40|60|7[05]|90))\s+build/i],[[c,"Voice"],n,[s,p]],[/android.+[;\/]\s*(LVTEL\-)?(V1[12])\s+build/i],[[c,"LvTel"],n,[s,p]],[/android.+;\s(PH-1)\s/i],[n,[c,"Essential"],[s,p]],[/android.+[;\/]\s*(V(100MD|700NA|7011|917G).*\b)\s+build/i],[n,[c,"Envizen"],[s,f]],[/android.+[;\/]\s*(Le[\s\-]+Pan)[\s\-]+(\w{1,9})\s+build/i],[c,n,[s,f]],[/android.+[;\/]\s*(Trio[\s\-]*.*)\s+build/i],[n,[c,"MachSpeed"],[s,f]],[/android.+[;\/]\s*(Trinity)[\-\s]*(T\d{3})\s+build/i],[c,n,[s,f]],[/android.+[;\/]\s*TU_(1491)\s+build/i],[n,[c,"Rotor"],[s,f]],[/android.+(KS(.+))\s+build/i],[n,[c,"Amazon"],[s,f]],[/android.+(Gigaset)[\s\-]+(Q\w{1,9})\s+build/i],[c,n,[s,f]],[/\s(tablet|tab)[;\/]/i,/\s(mobile)(?:[;\/]|\ssafari)/i],[[s,m.lowerize],c,n],[/[\s\/\(](smart-?tv)[;\)]/i],[[s,d]],[/(android[\w\.\s\-]{0,9});.+build/i],[n,[c,"Generic"]]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[l,[a,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[l,[a,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[a,l],[/rv\:([\w\.]{1,9}).+(gecko)/i],[l,a]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[a,l],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s\w]*)/i,/(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[a,[l,g.str,v.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[a,"Windows"],[l,g.str,v.os.windows.version]],[/\((bb)(10);/i],[[a,"BlackBerry"],l],[/(blackberry)\w*\/?([\w\.]*)/i,/(tizen|kaios)[\/\s]([\w\.]+)/i,/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|sailfish|contiki)[\/\s-]?([\w\.]*)/i],[a,l],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]*)/i],[[a,"Symbian"],l],[/\((series40);/i],[a],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[a,"Firefox OS"],l],[/(nintendo|playstation)\s([wids34portablevu]+)/i,/(mint)[\/\s\(]?(\w*)/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|suse|opensuse|gentoo|(?=\s)arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?(?!chrom)([\w\.-]*)/i,/(hurd|linux)\s?([\w\.]*)/i,/(gnu)\s?([\w\.]*)/i],[a,l],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[a,"Chromium OS"],l],[/(sunos)\s?([\w\.\d]*)/i],[[a,"Solaris"],l],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]*)/i],[a,l],[/(haiku)\s(\w+)/i],[a,l],[/cfnetwork\/.+darwin/i,/ip[honead]{2,4}(?:.*os\s([\w]+)\slike\smac|;\sopera)/i],[[l,/_/g,"."],[a,"iOS"]],[/(mac\sos\sx)\s?([\w\s\.]*)/i,/(macintosh|mac(?=_powerpc)\s)/i],[[a,"Mac OS"],[l,/_/g,"."]],[/((?:open)?solaris)[\/\s-]?([\w\.]*)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.])*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms|fuchsia)/i,/(unix)\s?([\w\.]*)/i],[a,l]]},b=function(t,e){if("object"==typeof t&&(e=t,t=r),!(this instanceof b))return new b(t,e).getResult();var o=t||(i&&i.navigator&&i.navigator.userAgent?i.navigator.userAgent:""),n=e?m.extend(y,e):y;return this.getBrowser=function(){var t={name:r,version:r};return g.rgx.call(t,o,n.browser),t.major=m.major(t.version),t},this.getCPU=function(){var t={architecture:r};return g.rgx.call(t,o,n.cpu),t},this.getDevice=function(){var t={vendor:r,model:r,type:r};return g.rgx.call(t,o,n.device),t},this.getEngine=function(){var t={name:r,version:r};return g.rgx.call(t,o,n.engine),t},this.getOS=function(){var t={name:r,version:r};return g.rgx.call(t,o,n.os),t},this.getResult=function(){return {ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return o},this.setUA=function(t){return o=t,this},this};b.VERSION="0.7.22",b.BROWSER={NAME:a,MAJOR:"major",VERSION:l},b.CPU={ARCHITECTURE:u},b.DEVICE={MODEL:n,VENDOR:c,TYPE:s,CONSOLE:h,MOBILE:p,SMARTTV:d,TABLET:f,WEARABLE:_,EMBEDDED:"embedded"},b.ENGINE={NAME:a,VERSION:l},b.OS={NAME:a,VERSION:l},t.exports&&(e=t.exports=b),e.UAParser=b;var w,x=i&&(i.jQuery||i.Zepto);x&&!x.ua&&(w=new b,x.ua=w.getResult(),x.ua.get=function(){return w.getUA()},x.ua.set=function(t){w.setUA(t);var e=w.getResult();for(var i in e)x.ua[i]=e[i];});}("object"==typeof window?window:s);})),ot=function(){this._OPTS={isAuto:!0},this._firstLogin=!0,this._timer=null;};return ot.prototype.login=function(t,e,r){var o,n;this._opts=(o=this._OPTS,n=r,Object.assign=Object.assign||function(t,e){var r,o=i(e);try{for(o.s();!(r=o.n()).done;){var n=r.value;for(var a in t)t[a]=n[a];}}catch(t){o.e(t);}finally{o.f();}return t},Object.assign(o,n)),this._key=t,this._sn=e;var a=J(t+e).substring(5,21),s=Q(JSON.stringify({appKey:t,appSecret:e})),c=$(JSON.stringify({appKey:t,appSecret:e}),a);this._firstLogin&&(this._parseOpts(),this._firstLogin=!1);var l=s+c;it()._loader.config.enc=l;var u=this;return it().ajax({method:"POST",url:"".concat(it().config.API_URL,"/authentication/v2/login/sysLogin"),type:"json",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=utf-8"},body:et({key:t,enc:encodeURIComponent(l)})}).then((function(i){if("10000"!=i.code)throw new Error("校验错误");var r,o,n,s,c,l=JSON.parse(tt(i.resultValue.substring(64),a)).token;return u._setToken(l.accessToken,l.refreshToken),localStorage&&(it().plugin(["SGMap.Logan"]).then((function(){var i=new(it().Logan)({key:t,sn:e});i.addErrorListener(),it().Logan=i;})).catch((function(t){})),r=JSON.parse(localStorage.getItem("SGMAP_KEY")),o=window.location.origin,r?r[o]&&-1!=r[o].indexOf(u._key)||(r[o]?r[o].push(u._key):r[o]=[u._key],localStorage.setItem("SGMAP_KEY",JSON.stringify(r))):localStorage.setItem("SGMAP_KEY",JSON.stringify((c=[u._key],(s=o)in(n={})?Object.defineProperty(n,s,{value:c,enumerable:!0,configurable:!0,writable:!0}):n[s]=c,n)))),new Promise((function(t,e){t(i),e("error");}))})).catch((function(t){console.log(t);}))},ot.prototype.getAccessToken=function(){return it().config.ACCESS_TOKEN},ot.prototype._parseOpts=function(){this._opts.isAuto&&window&&this._initAutoLogin();},ot.prototype._initAutoLogin=function(){var t,e,i;t=window,e="online",i=this._autoLogin.bind(this),t.addEventListener?t.addEventListener(e,i,!1):t.attachEvent("on"+e,i);},ot.prototype._autoLogin=function(){this.login(this._key,this._sn);var t=null;this._opts&&this._opts.onAutoLogin&&(t=this._opts.onAutoLogin),t&&t(this);},ot.prototype._setToken=function(t,e){this._setConfigAccessToken(t);var i=this._accessToken,r=this._refreshToken;this._accessToken=t,this._refreshToken=e,i&&r&&this.loginoutToken(i,r),this._triggerTimer();},ot.prototype._setConfigAccessToken=function(t){it().config.ACCESS_TOKEN=t,it().accessToken=t;},ot.prototype._triggerTimer=function(){this._timer&&clearTimeout(this._timer);var t=this;this._timer=setTimeout((function(){t._refreshTokens();}),this._getInterval());},ot.prototype._getInterval=function(){var t=this._accessToken.split("."),e=JSON.parse(atob(t[1])),i=e.exp-e.iat-60;return 1e3*(2e6<i?2e6:i)},ot.prototype._refreshTokens=function(){var t=this;return it().ajax({url:"".concat(it().config.API_URL,"/authentication/token/refresh"),method:"POST",body:et({accessToken:t._accessToken,refreshToken:t._refreshToken}),headers:{Authorization:t._accessToken,"Content-Type":"application/x-www-form-urlencoded;charset=utf-8"}}).then((function(e){var i=JSON.parse(e);t._setToken(i.resultValue.accessToken,i.resultValue.refreshToken);})).catch((function(t){throw new Error(t)}))},ot.prototype.loginout=function(){return this.loginoutToken(this._accessToken,this._refreshToken)},ot.prototype.loginoutToken=function(t,e){var i=this._key,r=J(i+this._sn).substring(5,21),o=Q(JSON.stringify({accessToken:t,refreshToken:e}))+$(JSON.stringify({accessToken:t,refreshToken:e}),r);return it()._loader.config.enc=o,it().ajax({url:"".concat(it().config.API_URL,"/authentication/v2/sysLogout"),body:et({key:i,enc:encodeURIComponent(o)}),headers:{Authorization:this._accessToken,"Content-Type":"application/x-www-form-urlencoded;charset=utf-8"},method:"POST"}).then((function(t){return !0})).catch((function(t){throw new Error(t)}))},ot.prototype._loggerTask=function(){var t=new rt,e=[{ServiceName:"map_api_js",LogLevel:"info",Extension:{SDK_version:it().version,uaInfo:t.getBrowser(),initTime:(new Date).getTime(),pageTitle:document.title,key:this._key,referer:window.location.href}}],i=$(JSON.stringify(e),"JeF8U9wHFOMfs2Y8");return it().ajax({url:"".concat(it().config.API_URL,"/log/v1/collection"),data:i,type:"json",headers:{Authorization:this._accessToken},method:"POST"}).catch((function(t){throw new Error(t)}))},ot}();})),Ko=t.createCommonjsModule((function(e,r){!function(t,i){e.exports=i();}(0,(function(){var e={isDev:!1,apiUrl:"https://lbs.sgmap.cn",version:"1.3.0",expires:36e4,enc:"epgis"},r=null,o=r=r||function(){var t,e,i,r,o,n,a,s,c,l,u,h,p,f,d,_,m,g,v,y,b,w,x,T,S,E,A,k,I,B,P,C,z,D,M,R,L,O,F,U,N,j,V,q,Z,G,H,W,X,K,Y,J,Q,$,tt,et,it,rt,ot,nt,at,st,ct,lt,ut,ht,pt,ft,dt,_t,mt,gt,vt,yt,bt,wt,xt,Tt,St,Et,At,kt,It,Bt,Pt,Ct=Ct||(t=Math,e=Object.create||function(t){var e;return zt.prototype=t,e=new zt,zt.prototype=null,e},r=(i={}).lib={},o=r.Base={extend:function(t){var i=e(this);return t&&i.mixIn(t),i.hasOwnProperty("init")&&this.init!==i.init||(i.init=function(){i.$super.init.apply(this,arguments);}),(i.init.prototype=i).$super=this,i},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString);},clone:function(){return this.init.prototype.extend(this)}},n=r.WordArray=o.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length;},toString:function(t){return (t||s).stringify(this)},concat:function(t){var e=this.words,i=t.words,r=this.sigBytes,o=t.sigBytes;if(this.clamp(),r%4)for(var n=0;n<o;n++)e[r+n>>>2]|=(i[n>>>2]>>>24-n%4*8&255)<<24-(r+n)%4*8;else for(n=0;n<o;n+=4)e[r+n>>>2]=i[n>>>2];return this.sigBytes+=o,this},clamp:function(){var e=this.words,i=this.sigBytes;e[i>>>2]&=4294967295<<32-i%4*8,e.length=t.ceil(i/4);},clone:function(){var t=o.clone.call(this);return t.words=this.words.slice(0),t},random:function(e){for(var i=[],r=function(e){e=e;var i=987654321,r=4294967295;return function(){var o=((i=36969*(65535&i)+(i>>16)&r)<<16)+(e=18e3*(65535&e)+(e>>16)&r)&r;return o/=4294967296,(o+=.5)*(.5<t.random()?1:-1)}},o=0;o<e;o+=4){var a=r(4294967296*(s||t.random())),s=987654071*a();i.push(4294967296*a()|0);}return new n.init(i,e)}}),a=i.enc={},s=a.Hex={stringify:function(t){for(var e=t.words,i=t.sigBytes,r=[],o=0;o<i;o++){var n=e[o>>>2]>>>24-o%4*8&255;r.push((n>>>4).toString(16)),r.push((15&n).toString(16));}return r.join("")},parse:function(t){for(var e=t.length,i=[],r=0;r<e;r+=2)i[r>>>3]|=parseInt(t.substr(r,2),16)<<24-r%8*4;return new n.init(i,e/2)}},c=a.Latin1={stringify:function(t){for(var e=t.words,i=t.sigBytes,r=[],o=0;o<i;o++)r.push(String.fromCharCode(e[o>>>2]>>>24-o%4*8&255));return r.join("")},parse:function(t){for(var e=t.length,i=[],r=0;r<e;r++)i[r>>>2]|=(255&t.charCodeAt(r))<<24-r%4*8;return new n.init(i,e)}},l=a.Utf8={stringify:function(t){try{return decodeURIComponent(escape(c.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return c.parse(unescape(encodeURIComponent(t)))}},u=r.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new n.init,this._nDataBytes=0;},_append:function(t){"string"==typeof t&&(t=l.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes;},_process:function(e){var i=this._data,r=i.words,o=i.sigBytes,a=this.blockSize,s=o/(4*a),c=(s=e?t.ceil(s):t.max((0|s)-this._minBufferSize,0))*a,l=t.min(4*c,o);if(c){for(var u=0;u<c;u+=a)this._doProcessBlock(r,u);var h=r.splice(0,c);i.sigBytes-=l;}return new n.init(h,l)},clone:function(){var t=o.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0}),r.Hasher=u.extend({cfg:o.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset();},reset:function(){u.reset.call(this),this._doReset();},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(e,i){return new t.init(i).finalize(e)}},_createHmacHelper:function(t){return function(e,i){return new h.HMAC.init(t,i).finalize(e)}}}),h=i.algo={},i);function zt(){}function Dt(t,e,i){return t&e|~t&i}function Mt(t,e,i){return t&i|e&~i}function Rt(t,e){return t<<e|t>>>32-e}function Lt(t,e,i,r){var o,n=this._iv;n?(o=n.slice(0),this._iv=void 0):o=this._prevBlock,r.encryptBlock(o,0);for(var a=0;a<i;a++)t[e+a]^=o[a];}function Ot(t){var e,i,r;return 255==(t>>24&255)?(i=t>>8&255,r=255&t,255==(e=t>>16&255)?(e=0,255===i?(i=0,255===r?r=0:++r):++i):++e,t=0,t+=e<<16,t+=i<<8,t+=r):t+=1<<24,t}function Ft(){for(var t=this._X,e=this._C,i=0;i<8;i++)bt[i]=e[i];for(e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0<bt[0]>>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0<bt[1]>>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0<bt[2]>>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0<bt[3]>>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0<bt[4]>>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0<bt[5]>>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0<bt[6]>>>0?1:0)|0,this._b=e[7]>>>0<bt[7]>>>0?1:0,i=0;i<8;i++){var r=t[i]+e[i],o=65535&r,n=r>>>16;wt[i]=((o*o>>>17)+o*n>>>15)+n*n^((4294901760&r)*r|0)+((65535&r)*r|0);}t[0]=wt[0]+(wt[7]<<16|wt[7]>>>16)+(wt[6]<<16|wt[6]>>>16)|0,t[1]=wt[1]+(wt[0]<<8|wt[0]>>>24)+wt[7]|0,t[2]=wt[2]+(wt[1]<<16|wt[1]>>>16)+(wt[0]<<16|wt[0]>>>16)|0,t[3]=wt[3]+(wt[2]<<8|wt[2]>>>24)+wt[1]|0,t[4]=wt[4]+(wt[3]<<16|wt[3]>>>16)+(wt[2]<<16|wt[2]>>>16)|0,t[5]=wt[5]+(wt[4]<<8|wt[4]>>>24)+wt[3]|0,t[6]=wt[6]+(wt[5]<<16|wt[5]>>>16)+(wt[4]<<16|wt[4]>>>16)|0,t[7]=wt[7]+(wt[6]<<8|wt[6]>>>24)+wt[5]|0;}function Ut(){for(var t=this._X,e=this._C,i=0;i<8;i++)It[i]=e[i];for(e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0<It[0]>>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0<It[1]>>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0<It[2]>>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0<It[3]>>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0<It[4]>>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0<It[5]>>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0<It[6]>>>0?1:0)|0,this._b=e[7]>>>0<It[7]>>>0?1:0,i=0;i<8;i++){var r=t[i]+e[i],o=65535&r,n=r>>>16;Bt[i]=((o*o>>>17)+o*n>>>15)+n*n^((4294901760&r)*r|0)+((65535&r)*r|0);}t[0]=Bt[0]+(Bt[7]<<16|Bt[7]>>>16)+(Bt[6]<<16|Bt[6]>>>16)|0,t[1]=Bt[1]+(Bt[0]<<8|Bt[0]>>>24)+Bt[7]|0,t[2]=Bt[2]+(Bt[1]<<16|Bt[1]>>>16)+(Bt[0]<<16|Bt[0]>>>16)|0,t[3]=Bt[3]+(Bt[2]<<8|Bt[2]>>>24)+Bt[1]|0,t[4]=Bt[4]+(Bt[3]<<16|Bt[3]>>>16)+(Bt[2]<<16|Bt[2]>>>16)|0,t[5]=Bt[5]+(Bt[4]<<8|Bt[4]>>>24)+Bt[3]|0,t[6]=Bt[6]+(Bt[5]<<16|Bt[5]>>>16)+(Bt[4]<<16|Bt[4]>>>16)|0,t[7]=Bt[7]+(Bt[6]<<8|Bt[6]>>>24)+Bt[5]|0;}return p=Ct.lib.WordArray,Ct.enc.Base64={stringify:function(t){var e=t.words,i=t.sigBytes,r=this._map;t.clamp();for(var o=[],n=0;n<i;n+=3)for(var a=(e[n>>>2]>>>24-n%4*8&255)<<16|(e[n+1>>>2]>>>24-(n+1)%4*8&255)<<8|e[n+2>>>2]>>>24-(n+2)%4*8&255,s=0;s<4&&n+.75*s<i;s++)o.push(r.charAt(a>>>6*(3-s)&63));var c=r.charAt(64);if(c)for(;o.length%4;)o.push(c);return o.join("")},parse:function(t){var e=t.length,i=this._map,r=this._reverseMap;if(!r){r=this._reverseMap=[];for(var o=0;o<i.length;o++)r[i.charCodeAt(o)]=o;}var n,a=i.charAt(64);return !a||-1!==(n=t.indexOf(a))&&(e=n),function(t,e,i){for(var r=[],o=0,n=0;n<e;n++){var a,s;n%4&&(a=i[t.charCodeAt(n-1)]<<n%4*2,s=i[t.charCodeAt(n)]>>>6-n%4*2,r[o>>>2]|=(a|s)<<24-o%4*8,o++);}return p.create(r,o)}(t,e,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},function(t){var e=Ct,i=e.lib,r=i.WordArray,o=i.Hasher,n=e.algo,a=[];!function(){for(var e=0;e<64;e++)a[e]=4294967296*t.abs(t.sin(e+1))|0;}();var s=n.MD5=o.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878]);},_doProcessBlock:function(t,e){for(var i=0;i<16;i++){var r=e+i,o=t[r];t[r]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8);}var n=this._hash.words,s=t[e+0],p=t[e+1],f=t[e+2],d=t[e+3],_=t[e+4],m=t[e+5],g=t[e+6],v=t[e+7],y=t[e+8],b=t[e+9],w=t[e+10],x=t[e+11],T=t[e+12],S=t[e+13],E=t[e+14],A=t[e+15],k=c(k=n[0],P=n[1],B=n[2],I=n[3],s,7,a[0]),I=c(I,k,P,B,p,12,a[1]),B=c(B,I,k,P,f,17,a[2]),P=c(P,B,I,k,d,22,a[3]);k=c(k,P,B,I,_,7,a[4]),I=c(I,k,P,B,m,12,a[5]),B=c(B,I,k,P,g,17,a[6]),P=c(P,B,I,k,v,22,a[7]),k=c(k,P,B,I,y,7,a[8]),I=c(I,k,P,B,b,12,a[9]),B=c(B,I,k,P,w,17,a[10]),P=c(P,B,I,k,x,22,a[11]),k=c(k,P,B,I,T,7,a[12]),I=c(I,k,P,B,S,12,a[13]),B=c(B,I,k,P,E,17,a[14]),k=l(k,P=c(P,B,I,k,A,22,a[15]),B,I,p,5,a[16]),I=l(I,k,P,B,g,9,a[17]),B=l(B,I,k,P,x,14,a[18]),P=l(P,B,I,k,s,20,a[19]),k=l(k,P,B,I,m,5,a[20]),I=l(I,k,P,B,w,9,a[21]),B=l(B,I,k,P,A,14,a[22]),P=l(P,B,I,k,_,20,a[23]),k=l(k,P,B,I,b,5,a[24]),I=l(I,k,P,B,E,9,a[25]),B=l(B,I,k,P,d,14,a[26]),P=l(P,B,I,k,y,20,a[27]),k=l(k,P,B,I,S,5,a[28]),I=l(I,k,P,B,f,9,a[29]),B=l(B,I,k,P,v,14,a[30]),k=u(k,P=l(P,B,I,k,T,20,a[31]),B,I,m,4,a[32]),I=u(I,k,P,B,y,11,a[33]),B=u(B,I,k,P,x,16,a[34]),P=u(P,B,I,k,E,23,a[35]),k=u(k,P,B,I,p,4,a[36]),I=u(I,k,P,B,_,11,a[37]),B=u(B,I,k,P,v,16,a[38]),P=u(P,B,I,k,w,23,a[39]),k=u(k,P,B,I,S,4,a[40]),I=u(I,k,P,B,s,11,a[41]),B=u(B,I,k,P,d,16,a[42]),P=u(P,B,I,k,g,23,a[43]),k=u(k,P,B,I,b,4,a[44]),I=u(I,k,P,B,T,11,a[45]),B=u(B,I,k,P,A,16,a[46]),k=h(k,P=u(P,B,I,k,f,23,a[47]),B,I,s,6,a[48]),I=h(I,k,P,B,v,10,a[49]),B=h(B,I,k,P,E,15,a[50]),P=h(P,B,I,k,m,21,a[51]),k=h(k,P,B,I,T,6,a[52]),I=h(I,k,P,B,d,10,a[53]),B=h(B,I,k,P,w,15,a[54]),P=h(P,B,I,k,p,21,a[55]),k=h(k,P,B,I,y,6,a[56]),I=h(I,k,P,B,A,10,a[57]),B=h(B,I,k,P,g,15,a[58]),P=h(P,B,I,k,S,21,a[59]),k=h(k,P,B,I,_,6,a[60]),I=h(I,k,P,B,x,10,a[61]),B=h(B,I,k,P,f,15,a[62]),P=h(P,B,I,k,b,21,a[63]),n[0]=n[0]+k|0,n[1]=n[1]+P|0,n[2]=n[2]+B|0,n[3]=n[3]+I|0;},_doFinalize:function(){var e=this._data,i=e.words,r=8*this._nDataBytes,o=8*e.sigBytes;i[o>>>5]|=128<<24-o%32;var n=t.floor(r/4294967296),a=r;i[15+(64+o>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),i[14+(64+o>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),e.sigBytes=4*(i.length+1),this._process();for(var s=this._hash,c=s.words,l=0;l<4;l++){var u=c[l];c[l]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8);}return s},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});function c(t,e,i,r,o,n,a){var s=t+(e&i|~e&r)+o+a;return (s<<n|s>>>32-n)+e}function l(t,e,i,r,o,n,a){var s=t+(e&r|i&~r)+o+a;return (s<<n|s>>>32-n)+e}function u(t,e,i,r,o,n,a){var s=t+(e^i^r)+o+a;return (s<<n|s>>>32-n)+e}function h(t,e,i,r,o,n,a){var s=t+(i^(e|~r))+o+a;return (s<<n|s>>>32-n)+e}e.MD5=o._createHelper(s),e.HmacMD5=o._createHmacHelper(s);}(Math),d=(f=Ct).lib,_=d.WordArray,g=[],v=f.algo.SHA1=(m=d.Hasher).extend({_doReset:function(){this._hash=new _.init([1732584193,4023233417,2562383102,271733878,3285377520]);},_doProcessBlock:function(t,e){for(var i,r=this._hash.words,o=r[0],n=r[1],a=r[2],s=r[3],c=r[4],l=0;l<80;l++){g[l]=l<16?0|t[e+l]:(i=g[l-3]^g[l-8]^g[l-14]^g[l-16])<<1|i>>>31;var u=(o<<5|o>>>27)+c+g[l];u+=l<20?1518500249+(n&a|~n&s):l<40?1859775393+(n^a^s):l<60?(n&a|n&s|a&s)-1894007588:(n^a^s)-899497514,c=s,s=a,a=n<<30|n>>>2,n=o,o=u;}r[0]=r[0]+o|0,r[1]=r[1]+n|0,r[2]=r[2]+a|0,r[3]=r[3]+s|0,r[4]=r[4]+c|0;},_doFinalize:function(){var t=this._data,e=t.words,i=8*this._nDataBytes,r=8*t.sigBytes;return e[r>>>5]|=128<<24-r%32,e[14+(64+r>>>9<<4)]=Math.floor(i/4294967296),e[15+(64+r>>>9<<4)]=i,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=m.clone.call(this);return t._hash=this._hash.clone(),t}}),f.SHA1=m._createHelper(v),f.HmacSHA1=m._createHmacHelper(v),function(t){var e=Ct,i=e.lib,r=i.WordArray,o=i.Hasher,n=e.algo,a=[],s=[];!function(){function e(t){return 4294967296*(t-(0|t))|0}for(var i=2,r=0;r<64;)!function(e){for(var i=t.sqrt(e),r=2;r<=i;r++)if(!(e%r))return;return 1}(i)||(r<8&&(a[r]=e(t.pow(i,.5))),s[r]=e(t.pow(i,1/3)),r++),i++;}();var c=[],l=n.SHA256=o.extend({_doReset:function(){this._hash=new r.init(a.slice(0));},_doProcessBlock:function(t,e){for(var i,r,o,n,a=this._hash.words,l=a[0],u=a[1],h=a[2],p=a[3],f=a[4],d=a[5],_=a[6],m=a[7],g=0;g<64;g++){g<16?c[g]=0|t[e+g]:(r=((i=c[g-15])<<25|i>>>7)^(i<<14|i>>>18)^i>>>3,n=((o=c[g-2])<<15|o>>>17)^(o<<13|o>>>19)^o>>>10,c[g]=r+c[g-7]+n+c[g-16]);var v=l&u^l&h^u&h,y=m+((f<<26|f>>>6)^(f<<21|f>>>11)^(f<<7|f>>>25))+(f&d^~f&_)+s[g]+c[g];m=_,_=d,d=f,f=p+y|0,p=h,h=u,u=l,l=y+(((l<<30|l>>>2)^(l<<19|l>>>13)^(l<<10|l>>>22))+v)|0;}a[0]=a[0]+l|0,a[1]=a[1]+u|0,a[2]=a[2]+h|0,a[3]=a[3]+p|0,a[4]=a[4]+f|0,a[5]=a[5]+d|0,a[6]=a[6]+_|0,a[7]=a[7]+m|0;},_doFinalize:function(){var e=this._data,i=e.words,r=8*this._nDataBytes,o=8*e.sigBytes;return i[o>>>5]|=128<<24-o%32,i[14+(64+o>>>9<<4)]=t.floor(r/4294967296),i[15+(64+o>>>9<<4)]=r,e.sigBytes=4*i.length,this._process(),this._hash},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA256=o._createHelper(l),e.HmacSHA256=o._createHmacHelper(l);}(Math),function(){var t=Ct.lib.WordArray,e=Ct.enc;function i(t){return t<<8&4278255360|t>>>8&16711935}e.Utf16=e.Utf16BE={stringify:function(t){for(var e=t.words,i=t.sigBytes,r=[],o=0;o<i;o+=2)r.push(String.fromCharCode(e[o>>>2]>>>16-o%4*8&65535));return r.join("")},parse:function(e){for(var i=e.length,r=[],o=0;o<i;o++)r[o>>>1]|=e.charCodeAt(o)<<16-o%2*16;return t.create(r,2*i)}},e.Utf16LE={stringify:function(t){for(var e=t.words,r=t.sigBytes,o=[],n=0;n<r;n+=2){var a=i(e[n>>>2]>>>16-n%4*8&65535);o.push(String.fromCharCode(a));}return o.join("")},parse:function(e){for(var r=e.length,o=[],n=0;n<r;n++)o[n>>>1]|=i(e.charCodeAt(n)<<16-n%2*16);return t.create(o,2*r)}};}(),"function"==typeof ArrayBuffer&&(b=(y=Ct.lib.WordArray).init,(y.init=function(t){if(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),(t instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array)&&(t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength)),t instanceof Uint8Array){for(var e=t.byteLength,i=[],r=0;r<e;r++)i[r>>>2]|=t[r]<<24-r%4*8;b.call(this,i,e);}else b.apply(this,arguments);}).prototype=y),x=(w=Ct).lib,S=x.Hasher,E=w.algo,A=(T=x.WordArray).create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),k=T.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),I=T.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),B=T.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),P=T.create([0,1518500249,1859775393,2400959708,2840853838]),C=T.create([1352829926,1548603684,1836072691,2053994217,0]),z=E.RIPEMD160=S.extend({_doReset:function(){this._hash=T.create([1732584193,4023233417,2562383102,271733878,3285377520]);},_doProcessBlock:function(t,e){for(var i=0;i<16;i++){var r=e+i,o=t[r];t[r]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8);}var n,a,s,c,l,u,h=this._hash.words,p=P.words,f=C.words,d=A.words,_=k.words,m=I.words,g=B.words,v=n=h[0],y=a=h[1],b=s=h[2],w=c=h[3],x=l=h[4];for(i=0;i<80;i+=1)u=n+t[e+d[i]]|0,u+=i<16?(a^s^c)+p[0]:i<32?Dt(a,s,c)+p[1]:i<48?((a|~s)^c)+p[2]:i<64?Mt(a,s,c)+p[3]:(a^(s|~c))+p[4],u=(u=Rt(u|=0,m[i]))+l|0,n=l,l=c,c=Rt(s,10),s=a,a=u,u=v+t[e+_[i]]|0,u+=i<16?(y^(b|~w))+f[0]:i<32?Mt(y,b,w)+f[1]:i<48?((y|~b)^w)+f[2]:i<64?Dt(y,b,w)+f[3]:(y^b^w)+f[4],u=(u=Rt(u|=0,g[i]))+x|0,v=x,x=w,w=Rt(b,10),b=y,y=u;u=h[1]+s+w|0,h[1]=h[2]+c+x|0,h[2]=h[3]+l+v|0,h[3]=h[4]+n+y|0,h[4]=h[0]+a+b|0,h[0]=u;},_doFinalize:function(){var t=this._data,e=t.words,i=8*this._nDataBytes,r=8*t.sigBytes;e[r>>>5]|=128<<24-r%32,e[14+(64+r>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),t.sigBytes=4*(e.length+1),this._process();for(var o=this._hash,n=o.words,a=0;a<5;a++){var s=n[a];n[a]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8);}return o},clone:function(){var t=S.clone.call(this);return t._hash=this._hash.clone(),t}}),w.RIPEMD160=S._createHelper(z),w.HmacRIPEMD160=S._createHmacHelper(z),D=Ct.enc.Utf8,Ct.algo.HMAC=Ct.lib.Base.extend({init:function(t,e){t=this._hasher=new t.init,"string"==typeof e&&(e=D.parse(e));var i=t.blockSize,r=4*i;e.sigBytes>r&&(e=t.finalize(e)),e.clamp();for(var o=this._oKey=e.clone(),n=this._iKey=e.clone(),a=o.words,s=n.words,c=0;c<i;c++)a[c]^=1549556828,s[c]^=909522486;o.sigBytes=n.sigBytes=r,this.reset();},reset:function(){var t=this._hasher;t.reset(),t.update(this._iKey);},update:function(t){return this._hasher.update(t),this},finalize:function(t){var e=this._hasher,i=e.finalize(t);return e.reset(),e.finalize(this._oKey.clone().concat(i))}}),R=(M=Ct).lib,O=R.WordArray,U=(F=M.algo).HMAC,N=F.PBKDF2=(L=R.Base).extend({cfg:L.extend({keySize:4,hasher:F.SHA1,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t);},compute:function(t,e){for(var i=this.cfg,r=U.create(i.hasher,t),o=O.create(),n=O.create([1]),a=o.words,s=n.words,c=i.keySize,l=i.iterations;a.length<c;){var u=r.update(e).finalize(n);r.reset();for(var h=u.words,p=h.length,f=u,d=1;d<l;d++){f=r.finalize(f),r.reset();for(var _=f.words,m=0;m<p;m++)h[m]^=_[m];}o.concat(u),s[0]++;}return o.sigBytes=4*c,o}}),M.PBKDF2=function(t,e,i){return N.create(i).compute(t,e)},V=(j=Ct).lib,Z=V.WordArray,H=(G=j.algo).EvpKDF=(q=V.Base).extend({cfg:q.extend({keySize:4,hasher:G.MD5,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t);},compute:function(t,e){for(var i=this.cfg,r=i.hasher.create(),o=Z.create(),n=o.words,a=i.keySize,s=i.iterations;n.length<a;){c&&r.update(c);var c=r.update(t).finalize(e);r.reset();for(var l=1;l<s;l++)c=r.finalize(c),r.reset();o.concat(c);}return o.sigBytes=4*a,o}}),j.EvpKDF=function(t,e,i){return H.create(i).compute(t,e)},X=(W=Ct).lib.WordArray,J=(K=W.algo).SHA224=(Y=K.SHA256).extend({_doReset:function(){this._hash=new X.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]);},_doFinalize:function(){var t=Y._doFinalize.call(this);return t.sigBytes-=4,t}}),W.SHA224=Y._createHelper(J),W.HmacSHA224=Y._createHmacHelper(J),$=(Q=Ct.lib).Base,tt=Q.WordArray,(et=Ct.x64={}).Word=$.extend({init:function(t,e){this.high=t,this.low=e;}}),et.WordArray=$.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:8*t.length;},toX32:function(){for(var t=this.words,e=t.length,i=[],r=0;r<e;r++){var o=t[r];i.push(o.high),i.push(o.low);}return tt.create(i,this.sigBytes)},clone:function(){for(var t=$.clone.call(this),e=t.words=this.words.slice(0),i=e.length,r=0;r<i;r++)e[r]=e[r].clone();return t}}),function(t){var e=Ct,i=e.lib,r=i.WordArray,o=i.Hasher,n=e.x64.Word,a=e.algo,s=[],c=[],l=[];!function(){for(var t=1,e=0,i=0;i<24;i++){s[t+5*e]=(i+1)*(i+2)/2%64;var r=(2*t+3*e)%5;t=e%5,e=r;}for(t=0;t<5;t++)for(e=0;e<5;e++)c[t+5*e]=e+(2*t+3*e)%5*5;for(var o=1,a=0;a<24;a++){for(var u,h=0,p=0,f=0;f<7;f++)1&o&&((u=(1<<f)-1)<32?p^=1<<u:h^=1<<u-32),128&o?o=o<<1^113:o<<=1;l[a]=n.create(h,p);}}();var u=[];!function(){for(var t=0;t<25;t++)u[t]=n.create();}();var h=a.SHA3=o.extend({cfg:o.cfg.extend({outputLength:512}),_doReset:function(){for(var t=this._state=[],e=0;e<25;e++)t[e]=new n.init;this.blockSize=(1600-2*this.cfg.outputLength)/32;},_doProcessBlock:function(t,e){for(var i=this._state,r=this.blockSize/2,o=0;o<r;o++){var n=16711935&((n=t[e+2*o])<<8|n>>>24)|4278255360&(n<<24|n>>>8),a=16711935&((a=t[e+2*o+1])<<8|a>>>24)|4278255360&(a<<24|a>>>8);(I=i[o]).high^=a,I.low^=n;}for(var h=0;h<24;h++){for(var p=0;p<5;p++){for(var f=0,d=0,_=0;_<5;_++)f^=(I=i[p+5*_]).high,d^=I.low;var m=u[p];m.high=f,m.low=d;}for(p=0;p<5;p++){var g=u[(p+4)%5],v=u[(p+1)%5],y=v.high,b=v.low;for(f=g.high^(y<<1|b>>>31),d=g.low^(b<<1|y>>>31),_=0;_<5;_++)(I=i[p+5*_]).high^=f,I.low^=d;}for(var w=1;w<25;w++){var x=(I=i[w]).high,T=I.low,S=s[w];d=S<32?(f=x<<S|T>>>32-S,T<<S|x>>>32-S):(f=T<<S-32|x>>>64-S,x<<S-32|T>>>64-S);var E=u[c[w]];E.high=f,E.low=d;}var A=u[0],k=i[0];for(A.high=k.high,A.low=k.low,p=0;p<5;p++)for(_=0;_<5;_++){var I=i[w=p+5*_],B=u[w],P=u[(p+1)%5+5*_],C=u[(p+2)%5+5*_];I.high=B.high^~P.high&C.high,I.low=B.low^~P.low&C.low;}var z=l[h];(I=i[0]).high^=z.high,I.low^=z.low;}},_doFinalize:function(){var e=this._data,i=e.words,o=8*e.sigBytes,n=32*this.blockSize;i[o>>>5]|=1<<24-o%32,i[(t.ceil((1+o)/n)*n>>>5)-1]|=128,e.sigBytes=4*i.length,this._process();for(var a=this._state,s=this.cfg.outputLength/8,c=s/8,l=[],u=0;u<c;u++){var h=a[u],p=16711935&((p=h.high)<<8|p>>>24)|4278255360&(p<<24|p>>>8),f=16711935&((f=h.low)<<8|f>>>24)|4278255360&(f<<24|f>>>8);l.push(f),l.push(p);}return new r.init(l,s)},clone:function(){for(var t=o.clone.call(this),e=t._state=this._state.slice(0),i=0;i<25;i++)e[i]=e[i].clone();return t}});e.SHA3=o._createHelper(h),e.HmacSHA3=o._createHmacHelper(h);}(Math),function(){var t=Ct,e=t.lib.Hasher,i=t.x64,r=i.Word,o=i.WordArray,n=t.algo;function a(){return r.create.apply(r,arguments)}var s=[a(1116352408,3609767458),a(1899447441,602891725),a(3049323471,3964484399),a(3921009573,2173295548),a(961987163,4081628472),a(1508970993,3053834265),a(2453635748,2937671579),a(2870763221,3664609560),a(3624381080,2734883394),a(310598401,1164996542),a(607225278,1323610764),a(1426881987,3590304994),a(1925078388,4068182383),a(2162078206,991336113),a(2614888103,633803317),a(3248222580,3479774868),a(3835390401,2666613458),a(4022224774,944711139),a(264347078,2341262773),a(604807628,2007800933),a(770255983,1495990901),a(1249150122,1856431235),a(1555081692,3175218132),a(1996064986,2198950837),a(2554220882,3999719339),a(2821834349,766784016),a(2952996808,2566594879),a(3210313671,3203337956),a(3336571891,1034457026),a(3584528711,2466948901),a(113926993,3758326383),a(338241895,168717936),a(666307205,1188179964),a(773529912,1546045734),a(1294757372,1522805485),a(1396182291,2643833823),a(1695183700,2343527390),a(1986661051,1014477480),a(2177026350,1206759142),a(2456956037,344077627),a(2730485921,1290863460),a(2820302411,3158454273),a(3259730800,3505952657),a(3345764771,106217008),a(3516065817,3606008344),a(3600352804,1432725776),a(4094571909,1467031594),a(275423344,851169720),a(430227734,3100823752),a(506948616,1363258195),a(659060556,3750685593),a(883997877,3785050280),a(958139571,3318307427),a(1322822218,3812723403),a(1537002063,2003034995),a(1747873779,3602036899),a(1955562222,1575990012),a(2024104815,1125592928),a(2227730452,2716904306),a(2361852424,442776044),a(2428436474,593698344),a(2756734187,3733110249),a(3204031479,2999351573),a(3329325298,3815920427),a(3391569614,3928383900),a(3515267271,566280711),a(3940187606,3454069534),a(4118630271,4000239992),a(116418474,1914138554),a(174292421,2731055270),a(289380356,3203993006),a(460393269,320620315),a(685471733,587496836),a(852142971,1086792851),a(1017036298,365543100),a(1126000580,2618297676),a(1288033470,3409855158),a(1501505948,4234509866),a(1607167915,987167468),a(1816402316,1246189591)],c=[];!function(){for(var t=0;t<80;t++)c[t]=a();}();var l=n.SHA512=e.extend({_doReset:function(){this._hash=new o.init([new r.init(1779033703,4089235720),new r.init(3144134277,2227873595),new r.init(1013904242,4271175723),new r.init(2773480762,1595750129),new r.init(1359893119,2917565137),new r.init(2600822924,725511199),new r.init(528734635,4215389547),new r.init(1541459225,327033209)]);},_doProcessBlock:function(t,e){for(var i=this._hash.words,r=i[0],o=i[1],n=i[2],a=i[3],l=i[4],u=i[5],h=i[6],p=i[7],f=r.high,d=r.low,_=o.high,m=o.low,g=n.high,v=n.low,y=a.high,b=a.low,w=l.high,x=l.low,T=u.high,S=u.low,E=h.high,A=h.low,k=p.high,I=p.low,B=f,P=d,C=_,z=m,D=g,M=v,R=y,L=b,O=w,F=x,U=T,N=S,j=E,V=A,q=k,Z=I,G=0;G<80;G++){var H,W,X,K,Y,J,Q,$,tt,et,it,rt,ot,nt,at,st=c[G];G<16?(at=st.high=0|t[e+2*G],nt=st.low=0|t[e+2*G+1]):(K=((W=(H=c[G-15]).high)>>>1|(X=H.low)<<31)^(W>>>8|X<<24)^W>>>7,tt=((Q=(J=c[G-2]).high)>>>19|($=J.low)<<13)^(Q<<3|$>>>29)^Q>>>6,at=(at=(at=K+(it=c[G-7]).high+((nt=(Y=(X>>>1|W<<31)^(X>>>8|W<<24)^(X>>>7|W<<25))+it.low)>>>0<Y>>>0?1:0))+tt+((nt+=et=($>>>19|Q<<13)^($<<3|Q>>>29)^($>>>6|Q<<26))>>>0<et>>>0?1:0))+(rt=c[G-16]).high+((nt+=ot=rt.low)>>>0<ot>>>0?1:0),st.high=at,st.low=nt);var ct=O&U^~O&j,lt=F&N^~F&V,ut=B&C^B&D^C&D,ht=(P>>>28|B<<4)^(P<<30|B>>>2)^(P<<25|B>>>7),pt=s[G],ft=pt.low,dt=Z+((F>>>14|O<<18)^(F>>>18|O<<14)^(F<<23|O>>>9)),_t=q+((O>>>14|F<<18)^(O>>>18|F<<14)^(O<<23|F>>>9))+(dt>>>0<Z>>>0?1:0),mt=ht+(P&z^P&M^z&M);q=j,Z=V,j=U,V=N,U=O,N=F,O=R+(_t=(_t=(_t=_t+ct+((dt+=lt)>>>0<lt>>>0?1:0))+pt.high+((dt+=ft)>>>0<ft>>>0?1:0))+at+((dt+=nt)>>>0<nt>>>0?1:0))+((F=L+dt|0)>>>0<L>>>0?1:0)|0,R=D,L=M,D=C,M=z,C=B,z=P,B=_t+(((B>>>28|P<<4)^(B<<30|P>>>2)^(B<<25|P>>>7))+ut+(mt>>>0<ht>>>0?1:0))+((P=dt+mt|0)>>>0<dt>>>0?1:0)|0;}d=r.low=d+P,r.high=f+B+(d>>>0<P>>>0?1:0),m=o.low=m+z,o.high=_+C+(m>>>0<z>>>0?1:0),v=n.low=v+M,n.high=g+D+(v>>>0<M>>>0?1:0),b=a.low=b+L,a.high=y+R+(b>>>0<L>>>0?1:0),x=l.low=x+F,l.high=w+O+(x>>>0<F>>>0?1:0),S=u.low=S+N,u.high=T+U+(S>>>0<N>>>0?1:0),A=h.low=A+V,h.high=E+j+(A>>>0<V>>>0?1:0),I=p.low=I+Z,p.high=k+q+(I>>>0<Z>>>0?1:0);},_doFinalize:function(){var t=this._data,e=t.words,i=8*this._nDataBytes,r=8*t.sigBytes;return e[r>>>5]|=128<<24-r%32,e[30+(128+r>>>10<<5)]=Math.floor(i/4294967296),e[31+(128+r>>>10<<5)]=i,t.sigBytes=4*e.length,this._process(),this._hash.toX32()},clone:function(){var t=e.clone.call(this);return t._hash=this._hash.clone(),t},blockSize:32});t.SHA512=e._createHelper(l),t.HmacSHA512=e._createHmacHelper(l);}(),rt=(it=Ct).x64,ot=rt.Word,nt=rt.WordArray,ct=(at=it.algo).SHA384=(st=at.SHA512).extend({_doReset:function(){this._hash=new nt.init([new ot.init(3418070365,3238371032),new ot.init(1654270250,914150663),new ot.init(2438529370,812702999),new ot.init(355462360,4144912697),new ot.init(1731405415,4290775857),new ot.init(2394180231,1750603025),new ot.init(3675008525,1694076839),new ot.init(1203062813,3204075428)]);},_doFinalize:function(){var t=st._doFinalize.call(this);return t.sigBytes-=16,t}}),it.SHA384=st._createHelper(ct),it.HmacSHA384=st._createHmacHelper(ct),Ct.lib.Cipher||function(){var t=Ct,e=t.lib,i=e.Base,r=e.WordArray,o=e.BufferedBlockAlgorithm,n=t.enc.Base64,a=t.algo.EvpKDF,s=e.Cipher=o.extend({cfg:i.extend(),createEncryptor:function(t,e){return this.create(this._ENC_XFORM_MODE,t,e)},createDecryptor:function(t,e){return this.create(this._DEC_XFORM_MODE,t,e)},init:function(t,e,i){this.cfg=this.cfg.extend(i),this._xformMode=t,this._key=e,this.reset();},reset:function(){o.reset.call(this),this._doReset();},process:function(t){return this._append(t),this._process()},finalize:function(t){return t&&this._append(t),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(t){return {encrypt:function(e,i,r){return c(i).encrypt(t,e,i,r)},decrypt:function(e,i,r){return c(i).decrypt(t,e,i,r)}}}});function c(t){return "string"==typeof t?y:g}e.StreamCipher=s.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var l,u=t.mode={},h=e.BlockCipherMode=i.extend({createEncryptor:function(t,e){return this.Encryptor.create(t,e)},createDecryptor:function(t,e){return this.Decryptor.create(t,e)},init:function(t,e){this._cipher=t,this._iv=e;}}),p=u.CBC=((l=h.extend()).Encryptor=l.extend({processBlock:function(t,e){var i=this._cipher,r=i.blockSize;f.call(this,t,e,r),i.encryptBlock(t,e),this._prevBlock=t.slice(e,e+r);}}),l.Decryptor=l.extend({processBlock:function(t,e){var i=this._cipher,r=i.blockSize,o=t.slice(e,e+r);i.decryptBlock(t,e),f.call(this,t,e,r),this._prevBlock=o;}}),l);function f(t,e,i){var r,o=this._iv;o?(r=o,this._iv=void 0):r=this._prevBlock;for(var n=0;n<i;n++)t[e+n]^=r[n];}var d=(t.pad={}).Pkcs7={pad:function(t,e){for(var i=4*e,o=i-t.sigBytes%i,n=o<<24|o<<16|o<<8|o,a=[],s=0;s<o;s+=4)a.push(n);var c=r.create(a,o);t.concat(c);},unpad:function(t){t.sigBytes-=255&t.words[t.sigBytes-1>>>2];}},_=(e.BlockCipher=s.extend({cfg:s.cfg.extend({mode:p,padding:d}),reset:function(){s.reset.call(this);var t,e=this.cfg,i=e.iv,r=e.mode;this._xformMode==this._ENC_XFORM_MODE?t=r.createEncryptor:(t=r.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==t?this._mode.init(this,i&&i.words):(this._mode=t.call(r,this,i&&i.words),this._mode.__creator=t);},_doProcessBlock:function(t,e){this._mode.processBlock(t,e);},_doFinalize:function(){var t,e=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(e.pad(this._data,this.blockSize),t=this._process(!0)):(t=this._process(!0),e.unpad(t)),t},blockSize:4}),e.CipherParams=i.extend({init:function(t){this.mixIn(t);},toString:function(t){return (t||this.formatter).stringify(this)}})),m=(t.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext,i=t.salt;return (i?r.create([1398893684,1701076831]).concat(i).concat(e):e).toString(n)},parse:function(t){var e,i=n.parse(t),o=i.words;return 1398893684==o[0]&&1701076831==o[1]&&(e=r.create(o.slice(2,4)),o.splice(0,4),i.sigBytes-=16),_.create({ciphertext:i,salt:e})}},g=e.SerializableCipher=i.extend({cfg:i.extend({format:m}),encrypt:function(t,e,i,r){r=this.cfg.extend(r);var o=t.createEncryptor(i,r),n=o.finalize(e),a=o.cfg;return _.create({ciphertext:n,key:i,iv:a.iv,algorithm:t,mode:a.mode,padding:a.padding,blockSize:t.blockSize,formatter:r.format})},decrypt:function(t,e,i,r){return r=this.cfg.extend(r),e=this._parse(e,r.format),t.createDecryptor(i,r).finalize(e.ciphertext)},_parse:function(t,e){return "string"==typeof t?e.parse(t,this):t}}),v=(t.kdf={}).OpenSSL={execute:function(t,e,i,o){o=o||r.random(8);var n=a.create({keySize:e+i}).compute(t,o),s=r.create(n.words.slice(e),4*i);return n.sigBytes=4*e,_.create({key:n,iv:s,salt:o})}},y=e.PasswordBasedCipher=g.extend({cfg:g.cfg.extend({kdf:v}),encrypt:function(t,e,i,r){var o=(r=this.cfg.extend(r)).kdf.execute(i,t.keySize,t.ivSize);r.iv=o.iv;var n=g.encrypt.call(this,t,e,o.key,r);return n.mixIn(o),n},decrypt:function(t,e,i,r){r=this.cfg.extend(r),e=this._parse(e,r.format);var o=r.kdf.execute(i,t.keySize,t.ivSize,e.salt);return r.iv=o.iv,g.decrypt.call(this,t,e,o.key,r)}});}(),Ct.mode.CFB=((lt=Ct.lib.BlockCipherMode.extend()).Encryptor=lt.extend({processBlock:function(t,e){var i=this._cipher,r=i.blockSize;Lt.call(this,t,e,r,i),this._prevBlock=t.slice(e,e+r);}}),lt.Decryptor=lt.extend({processBlock:function(t,e){var i=this._cipher,r=i.blockSize,o=t.slice(e,e+r);Lt.call(this,t,e,r,i),this._prevBlock=o;}}),lt),Ct.mode.ECB=((ut=Ct.lib.BlockCipherMode.extend()).Encryptor=ut.extend({processBlock:function(t,e){this._cipher.encryptBlock(t,e);}}),ut.Decryptor=ut.extend({processBlock:function(t,e){this._cipher.decryptBlock(t,e);}}),ut),Ct.pad.AnsiX923={pad:function(t,e){var i=t.sigBytes,r=4*e,o=r-i%r,n=i+o-1;t.clamp(),t.words[n>>>2]|=o<<24-n%4*8,t.sigBytes+=o;},unpad:function(t){t.sigBytes-=255&t.words[t.sigBytes-1>>>2];}},Ct.pad.Iso10126={pad:function(t,e){var i=4*e,r=i-t.sigBytes%i;t.concat(Ct.lib.WordArray.random(r-1)).concat(Ct.lib.WordArray.create([r<<24],1));},unpad:function(t){t.sigBytes-=255&t.words[t.sigBytes-1>>>2];}},Ct.pad.Iso97971={pad:function(t,e){t.concat(Ct.lib.WordArray.create([2147483648],1)),Ct.pad.ZeroPadding.pad(t,e);},unpad:function(t){Ct.pad.ZeroPadding.unpad(t),t.sigBytes--;}},Ct.mode.OFB=(pt=(ht=Ct.lib.BlockCipherMode.extend()).Encryptor=ht.extend({processBlock:function(t,e){var i=this._cipher,r=i.blockSize,o=this._iv,n=this._keystream;o&&(n=this._keystream=o.slice(0),this._iv=void 0),i.encryptBlock(n,0);for(var a=0;a<r;a++)t[e+a]^=n[a];}}),ht.Decryptor=pt,ht),Ct.pad.NoPadding={pad:function(){},unpad:function(){}},ft=Ct.lib.CipherParams,dt=Ct.enc.Hex,Ct.format.Hex={stringify:function(t){return t.ciphertext.toString(dt)},parse:function(t){var e=dt.parse(t);return ft.create({ciphertext:e})}},function(){var t=Ct,e=t.lib.BlockCipher,i=t.algo,r=[],o=[],n=[],a=[],s=[],c=[],l=[],u=[],h=[],p=[];!function(){for(var t=[],e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;var i=0,f=0;for(e=0;e<256;e++){var d=(d=f^f<<1^f<<2^f<<3^f<<4)>>>8^255&d^99;r[i]=d;var _=t[o[d]=i],m=t[_],g=t[m],v=257*t[d]^16843008*d;n[i]=v<<24|v>>>8,a[i]=v<<16|v>>>16,s[i]=v<<8|v>>>24,c[i]=v,l[d]=(v=16843009*g^65537*m^257*_^16843008*i)<<24|v>>>8,u[d]=v<<16|v>>>16,h[d]=v<<8|v>>>24,p[d]=v,i?(i=_^t[t[t[g^_]]],f^=t[t[f]]):i=f=1;}}();var f=[0,1,2,4,8,16,32,64,128,27,54],d=i.AES=e.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var t=this._keyPriorReset=this._key,e=t.words,i=t.sigBytes/4,o=4*(1+(this._nRounds=6+i)),n=this._keySchedule=[],a=0;a<o;a++)a<i?n[a]=e[a]:(d=n[a-1],a%i?6<i&&a%i==4&&(d=r[d>>>24]<<24|r[d>>>16&255]<<16|r[d>>>8&255]<<8|r[255&d]):(d=r[(d=d<<8|d>>>24)>>>24]<<24|r[d>>>16&255]<<16|r[d>>>8&255]<<8|r[255&d],d^=f[a/i|0]<<24),n[a]=n[a-i]^d);for(var s=this._invKeySchedule=[],c=0;c<o;c++){var d;a=o-c,d=c%4?n[a]:n[a-4],s[c]=c<4||a<=4?d:l[r[d>>>24]]^u[r[d>>>16&255]]^h[r[d>>>8&255]]^p[r[255&d]];}}},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,n,a,s,c,r);},decryptBlock:function(t,e){var i=t[e+1];t[e+1]=t[e+3],t[e+3]=i,this._doCryptBlock(t,e,this._invKeySchedule,l,u,h,p,o),i=t[e+1],t[e+1]=t[e+3],t[e+3]=i;},_doCryptBlock:function(t,e,i,r,o,n,a,s){for(var c=this._nRounds,l=t[e]^i[0],u=t[e+1]^i[1],h=t[e+2]^i[2],p=t[e+3]^i[3],f=4,d=1;d<c;d++){var _=r[l>>>24]^o[u>>>16&255]^n[h>>>8&255]^a[255&p]^i[f++],m=r[u>>>24]^o[h>>>16&255]^n[p>>>8&255]^a[255&l]^i[f++],g=r[h>>>24]^o[p>>>16&255]^n[l>>>8&255]^a[255&u]^i[f++],v=r[p>>>24]^o[l>>>16&255]^n[u>>>8&255]^a[255&h]^i[f++];l=_,u=m,h=g,p=v;}_=(s[l>>>24]<<24|s[u>>>16&255]<<16|s[h>>>8&255]<<8|s[255&p])^i[f++],m=(s[u>>>24]<<24|s[h>>>16&255]<<16|s[p>>>8&255]<<8|s[255&l])^i[f++],g=(s[h>>>24]<<24|s[p>>>16&255]<<16|s[l>>>8&255]<<8|s[255&u])^i[f++],v=(s[p>>>24]<<24|s[l>>>16&255]<<16|s[u>>>8&255]<<8|s[255&h])^i[f++],t[e]=_,t[e+1]=m,t[e+2]=g,t[e+3]=v;},keySize:8});t.AES=e._createHelper(d);}(),function(){var t=Ct,e=t.lib,i=e.WordArray,r=e.BlockCipher,o=t.algo,n=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],a=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],s=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],c=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],l=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],u=o.DES=r.extend({_doReset:function(){for(var t=this._key.words,e=[],i=0;i<56;i++){var r=n[i]-1;e[i]=t[r>>>5]>>>31-r%32&1;}for(var o=this._subKeys=[],c=0;c<16;c++){var l=o[c]=[],u=s[c];for(i=0;i<24;i++)l[i/6|0]|=e[(a[i]-1+u)%28]<<31-i%6,l[4+(i/6|0)]|=e[28+(a[i+24]-1+u)%28]<<31-i%6;for(l[0]=l[0]<<1|l[0]>>>31,i=1;i<7;i++)l[i]=l[i]>>>4*(i-1)+3;l[7]=l[7]<<5|l[7]>>>27;}var h=this._invSubKeys=[];for(i=0;i<16;i++)h[i]=o[15-i];},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._subKeys);},decryptBlock:function(t,e){this._doCryptBlock(t,e,this._invSubKeys);},_doCryptBlock:function(t,e,i){this._lBlock=t[e],this._rBlock=t[e+1],h.call(this,4,252645135),h.call(this,16,65535),p.call(this,2,858993459),p.call(this,8,16711935),h.call(this,1,1431655765);for(var r=0;r<16;r++){for(var o=i[r],n=this._lBlock,a=this._rBlock,s=0,u=0;u<8;u++)s|=c[u][((a^o[u])&l[u])>>>0];this._lBlock=a,this._rBlock=n^s;}var f=this._lBlock;this._lBlock=this._rBlock,this._rBlock=f,h.call(this,1,1431655765),p.call(this,8,16711935),p.call(this,2,858993459),h.call(this,16,65535),h.call(this,4,252645135),t[e]=this._lBlock,t[e+1]=this._rBlock;},keySize:2,ivSize:2,blockSize:2});function h(t,e){var i=(this._lBlock>>>t^this._rBlock)&e;this._rBlock^=i,this._lBlock^=i<<t;}function p(t,e){var i=(this._rBlock>>>t^this._lBlock)&e;this._lBlock^=i,this._rBlock^=i<<t;}t.DES=r._createHelper(u);var f=o.TripleDES=r.extend({_doReset:function(){var t=this._key.words;this._des1=u.createEncryptor(i.create(t.slice(0,2))),this._des2=u.createEncryptor(i.create(t.slice(2,4))),this._des3=u.createEncryptor(i.create(t.slice(4,6)));},encryptBlock:function(t,e){this._des1.encryptBlock(t,e),this._des2.decryptBlock(t,e),this._des3.encryptBlock(t,e);},decryptBlock:function(t,e){this._des3.decryptBlock(t,e),this._des2.encryptBlock(t,e),this._des1.decryptBlock(t,e);},keySize:6,ivSize:2,blockSize:2});t.TripleDES=r._createHelper(f);}(),function(){var t=Ct,e=t.lib.StreamCipher,i=t.algo,r=i.RC4=e.extend({_doReset:function(){for(var t=this._key,e=t.words,i=t.sigBytes,r=this._S=[],o=0;o<256;o++)r[o]=o;o=0;for(var n=0;o<256;o++){var a=o%i,s=r[o];r[o]=r[n=(n+r[o]+(e[a>>>2]>>>24-a%4*8&255))%256],r[n]=s;}this._i=this._j=0;},_doProcessBlock:function(t,e){t[e]^=o.call(this);},keySize:8,ivSize:0});function o(){for(var t=this._S,e=this._i,i=this._j,r=0,o=0;o<4;o++){i=(i+t[e=(e+1)%256])%256;var n=t[e];t[e]=t[i],t[i]=n,r|=t[(t[e]+t[i])%256]<<24-8*o;}return this._i=e,this._j=i,r}t.RC4=e._createHelper(r);var n=i.RC4Drop=r.extend({cfg:r.cfg.extend({drop:192}),_doReset:function(){r._doReset.call(this);for(var t=this.cfg.drop;0<t;t--)o.call(this);}});t.RC4Drop=e._createHelper(n);}(),Ct.mode.CTRGladman=(mt=(_t=Ct.lib.BlockCipherMode.extend()).Encryptor=_t.extend({processBlock:function(t,e){var i,r=this._cipher,o=r.blockSize,n=this._iv,a=this._counter;n&&(a=this._counter=n.slice(0),this._iv=void 0),0===((i=a)[0]=Ot(i[0]))&&(i[1]=Ot(i[1]));var s=a.slice(0);r.encryptBlock(s,0);for(var c=0;c<o;c++)t[e+c]^=s[c];}}),_t.Decryptor=mt,_t),vt=(gt=Ct).lib.StreamCipher,yt=[],bt=[],wt=[],xt=gt.algo.Rabbit=vt.extend({_doReset:function(){for(var t=this._key.words,e=this.cfg.iv,i=0;i<4;i++)t[i]=16711935&(t[i]<<8|t[i]>>>24)|4278255360&(t[i]<<24|t[i]>>>8);var r=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],o=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];for(i=this._b=0;i<4;i++)Ft.call(this);for(i=0;i<8;i++)o[i]^=r[i+4&7];if(e){var n=e.words,a=n[0],s=n[1],c=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),l=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),u=c>>>16|4294901760&l,h=l<<16|65535&c;for(o[0]^=c,o[1]^=u,o[2]^=l,o[3]^=h,o[4]^=c,o[5]^=u,o[6]^=l,o[7]^=h,i=0;i<4;i++)Ft.call(this);}},_doProcessBlock:function(t,e){var i=this._X;Ft.call(this),yt[0]=i[0]^i[5]>>>16^i[3]<<16,yt[1]=i[2]^i[7]>>>16^i[5]<<16,yt[2]=i[4]^i[1]>>>16^i[7]<<16,yt[3]=i[6]^i[3]>>>16^i[1]<<16;for(var r=0;r<4;r++)yt[r]=16711935&(yt[r]<<8|yt[r]>>>24)|4278255360&(yt[r]<<24|yt[r]>>>8),t[e+r]^=yt[r];},blockSize:4,ivSize:2}),gt.Rabbit=vt._createHelper(xt),Ct.mode.CTR=(St=(Tt=Ct.lib.BlockCipherMode.extend()).Encryptor=Tt.extend({processBlock:function(t,e){var i=this._cipher,r=i.blockSize,o=this._iv,n=this._counter;o&&(n=this._counter=o.slice(0),this._iv=void 0);var a=n.slice(0);i.encryptBlock(a,0),n[r-1]=n[r-1]+1|0;for(var s=0;s<r;s++)t[e+s]^=a[s];}}),Tt.Decryptor=St,Tt),At=(Et=Ct).lib.StreamCipher,kt=[],It=[],Bt=[],Pt=Et.algo.RabbitLegacy=At.extend({_doReset:function(){for(var t=this._key.words,e=this.cfg.iv,i=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],r=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]],o=this._b=0;o<4;o++)Ut.call(this);for(o=0;o<8;o++)r[o]^=i[o+4&7];if(e){var n=e.words,a=n[0],s=n[1],c=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),l=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),u=c>>>16|4294901760&l,h=l<<16|65535&c;for(r[0]^=c,r[1]^=u,r[2]^=l,r[3]^=h,r[4]^=c,r[5]^=u,r[6]^=l,r[7]^=h,o=0;o<4;o++)Ut.call(this);}},_doProcessBlock:function(t,e){var i=this._X;Ut.call(this),kt[0]=i[0]^i[5]>>>16^i[3]<<16,kt[1]=i[2]^i[7]>>>16^i[5]<<16,kt[2]=i[4]^i[1]>>>16^i[7]<<16,kt[3]=i[6]^i[3]>>>16^i[1]<<16;for(var r=0;r<4;r++)kt[r]=16711935&(kt[r]<<8|kt[r]>>>24)|4278255360&(kt[r]<<24|kt[r]>>>8),t[e+r]^=kt[r];},blockSize:4,ivSize:2}),Et.RabbitLegacy=At._createHelper(Pt),Ct.pad.ZeroPadding={pad:function(t,e){var i=4*e;t.clamp(),t.sigBytes+=i-(t.sigBytes%i||i);},unpad:function(t){for(var e=t.words,i=t.sigBytes-1;!(e[i>>>2]>>>24-i%4*8&255);)i--;t.sigBytes=i+1;}},Ct}(),n=null,a=(n||(function(t){!function(){function e(t,e){return t<<(e%=32)|t>>>32-e}function i(t){return a[(4026531840&t)>>>28][(251658240&t)>>>24]<<24|a[(15728640&t)>>>20][(983040&t)>>>16]<<16|a[(61440&t)>>>12][(3840&t)>>>8]<<8|a[(240&t)>>>4][(15&t)>>>0]<<0}var r=t,o=r.lib.BlockCipher,n=r.algo,a=new Array;a[0]=new Array(214,144,233,254,204,225,61,183,22,182,20,194,40,251,44,5),a[1]=new Array(43,103,154,118,42,190,4,195,170,68,19,38,73,134,6,153),a[2]=new Array(156,66,80,244,145,239,152,122,51,84,11,67,237,207,172,98),a[3]=new Array(228,179,28,169,201,8,232,149,128,223,148,250,117,143,63,166),a[4]=new Array(71,7,167,252,243,115,23,186,131,89,60,25,230,133,79,168),a[5]=new Array(104,107,129,178,113,100,218,139,248,235,15,75,112,86,157,53),a[6]=new Array(30,36,14,94,99,88,209,162,37,34,124,59,1,33,120,135),a[7]=new Array(212,0,70,87,159,211,39,82,76,54,2,231,160,196,200,158),a[8]=new Array(234,191,138,210,64,199,56,181,163,247,242,206,249,97,21,161),a[9]=new Array(224,174,93,164,155,52,26,85,173,147,50,48,245,140,177,227),a[10]=new Array(29,246,226,46,130,102,202,96,192,41,35,171,13,83,78,111),a[11]=new Array(213,219,55,69,222,253,142,47,3,255,106,114,109,108,91,81),a[12]=new Array(141,27,175,146,187,221,188,127,17,217,92,65,31,16,90,216),a[13]=new Array(10,193,49,136,165,205,123,189,45,116,208,18,184,229,180,176),a[14]=new Array(137,105,151,74,12,150,119,126,101,185,241,9,197,110,198,132),a[15]=new Array(24,240,125,236,58,220,77,32,121,238,95,62,215,203,57,72);var s=[462357,472066609,943670861,1415275113,1886879365,2358483617,2830087869,3301692121,3773296373,4228057617,404694573,876298825,1347903077,1819507329,2291111581,2762715833,3234320085,3705924337,4177462797,337322537,808926789,1280531041,1752135293,2223739545,2695343797,3166948049,3638552301,4110090761,269950501,741554753,1213159005,1684763257],c=[2746333894,1453994832,1736282519,2993693404],l=n.SM4=o.extend({_doReset:function(){for(var t=function(t){var r=new Array,o=new Array;r[0]=t[0]^c[0],r[1]=t[1]^c[1],r[2]=t[2]^c[2],r[3]=t[3]^c[3];for(var n,a=0;a<32;a++)r[a+4]=r[a]^(n=i(n=r[a+1]^r[a+2]^r[a+3]^s[a]))^e(n,13)^e(n,23),o[a]=r[a+4].toString(16);return o}(this._key.words),r=this._SK=[],o=0;o<t.length;o++)r[o]=t[o];var n=this._invSK=[];for(o=t.length-1;0<=o;o--)n[t.length-1-o]=t[o];},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._SK);},decryptBlock:function(t,e){this._doCryptBlock(t,e,this._invSK);},_doCryptBlock:function(t,r,o){var n=[];n[0]=t[r],n[1]=t[r+1],n[2]=t[r+2],n[3]=t[r+3];for(var a,s=0;s<32;s++)n[s+4]=n[s]^(a=i(a=n[s+1]^n[s+2]^n[s+3]^parseInt(o[s],16)))^e(a,2)^e(a,10)^e(a,18)^e(a,24);t[r]=n[35],t[r+1]=n[34],t[r+2]=n[33],t[r+3]=n[32];},keySize:4,ivSize:4,blockSize:4});r.SM4=o._createHelper(l);}();}(o),n=o.SM4),n),s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0!==t.window?t.window:{};function c(t,e){return t(e={exports:{}},e.exports),e.exports}var l,u,h,p,f,d,_,m,g,v,y,b,w=c((function(t){var e,i;e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i={rotl:function(t,e){return t<<e|t>>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&i.rotl(t,8)|4278255360&i.rotl(t,24);for(var e=0;e<t.length;e++)t[e]=i.endian(t[e]);return t},randomBytes:function(t){for(var e=[];0<t;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],i=0,r=0;i<t.length;i++,r+=8)e[r>>>5]|=t[i]<<24-r%32;return e},wordsToBytes:function(t){for(var e=[],i=0;i<32*t.length;i+=8)e.push(t[i>>>5]>>>24-i%32&255);return e},bytesToHex:function(t){for(var e=[],i=0;i<t.length;i++)e.push((t[i]>>>4).toString(16)),e.push((15&t[i]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],i=0;i<t.length;i+=2)e.push(parseInt(t.substr(i,2),16));return e},bytesToBase64:function(t){for(var i=[],r=0;r<t.length;r+=3)for(var o=t[r]<<16|t[r+1]<<8|t[r+2],n=0;n<4;n++)i.push(8*r+6*n<=8*t.length?e.charAt(o>>>6*(3-n)&63):"=");return i.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var i=[],r=0,o=0;r<t.length;o=++r%4)0!=o&&i.push((e.indexOf(t.charAt(r-1))&Math.pow(2,-2*o+8)-1)<<2*o|e.indexOf(t.charAt(r))>>>6-2*o);return i}},t.exports=i;})),x={utf8:{stringToBytes:function(t){return x.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(x.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],i=0;i<t.length;i++)e.push(255&t.charCodeAt(i));return e},bytesToString:function(t){for(var e=[],i=0;i<t.length;i++)e.push(String.fromCharCode(t[i]));return e.join("")}}},T=x,S=function(t){return null!=t&&(E(t)||"function"==typeof(e=t).readFloatLE&&"function"==typeof e.slice&&E(e.slice(0,0))||!!t._isBuffer);var e;};function E(t){return !!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}function A(){}function k(t,e,i){null!=t&&("number"==typeof t?this.fromNumber(t,e,i):this.fromString(t,null==e&&"string"!=typeof t?256:e));}function I(){return new k(null)}function B(t){return R.charAt(t)}function P(t,e){var i=L[t.charCodeAt(e)];return null==i?-1:i}function C(t){var e=I();return e.fromInt(t),e}function z(t){var e,i=1;return 0!=(e=t>>>16)&&(t=e,i+=16),0!=(e=t>>8)&&(t=e,i+=8),0!=(e=t>>4)&&(t=e,i+=4),0!=(e=t>>2)&&(t=e,i+=2),0!=(e=t>>1)&&(t=e,i+=1),i}function D(t){this.m=t;}function M(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t;}c((function(t){var e,i,r,o,n;e=w,i=T.utf8,r=S,o=T.bin,(n=function t(n,a){n.constructor==String?n=a&&"binary"===a.encoding?o.stringToBytes(n):i.stringToBytes(n):r(n)?n=Array.prototype.slice.call(n,0):Array.isArray(n)||(n=n.toString());for(var s=e.bytesToWords(n),c=8*n.length,l=1732584193,u=-271733879,h=-1732584194,p=271733878,f=0;f<s.length;f++)s[f]=16711935&(s[f]<<8|s[f]>>>24)|4278255360&(s[f]<<24|s[f]>>>8);s[c>>>5]|=128<<c%32,s[14+(64+c>>>9<<4)]=c;var d=t._ff,_=t._gg,m=t._hh,g=t._ii;for(f=0;f<s.length;f+=16){var v=l,y=u,b=h,w=p;l=d(l,u,h,p,s[f+0],7,-680876936),p=d(p,l,u,h,s[f+1],12,-389564586),h=d(h,p,l,u,s[f+2],17,606105819),u=d(u,h,p,l,s[f+3],22,-1044525330),l=d(l,u,h,p,s[f+4],7,-176418897),p=d(p,l,u,h,s[f+5],12,1200080426),h=d(h,p,l,u,s[f+6],17,-1473231341),u=d(u,h,p,l,s[f+7],22,-45705983),l=d(l,u,h,p,s[f+8],7,1770035416),p=d(p,l,u,h,s[f+9],12,-1958414417),h=d(h,p,l,u,s[f+10],17,-42063),u=d(u,h,p,l,s[f+11],22,-1990404162),l=d(l,u,h,p,s[f+12],7,1804603682),p=d(p,l,u,h,s[f+13],12,-40341101),h=d(h,p,l,u,s[f+14],17,-1502002290),l=_(l,u=d(u,h,p,l,s[f+15],22,1236535329),h,p,s[f+1],5,-165796510),p=_(p,l,u,h,s[f+6],9,-1069501632),h=_(h,p,l,u,s[f+11],14,643717713),u=_(u,h,p,l,s[f+0],20,-373897302),l=_(l,u,h,p,s[f+5],5,-701558691),p=_(p,l,u,h,s[f+10],9,38016083),h=_(h,p,l,u,s[f+15],14,-660478335),u=_(u,h,p,l,s[f+4],20,-405537848),l=_(l,u,h,p,s[f+9],5,568446438),p=_(p,l,u,h,s[f+14],9,-1019803690),h=_(h,p,l,u,s[f+3],14,-187363961),u=_(u,h,p,l,s[f+8],20,1163531501),l=_(l,u,h,p,s[f+13],5,-1444681467),p=_(p,l,u,h,s[f+2],9,-51403784),h=_(h,p,l,u,s[f+7],14,1735328473),l=m(l,u=_(u,h,p,l,s[f+12],20,-1926607734),h,p,s[f+5],4,-378558),p=m(p,l,u,h,s[f+8],11,-2022574463),h=m(h,p,l,u,s[f+11],16,1839030562),u=m(u,h,p,l,s[f+14],23,-35309556),l=m(l,u,h,p,s[f+1],4,-1530992060),p=m(p,l,u,h,s[f+4],11,1272893353),h=m(h,p,l,u,s[f+7],16,-155497632),u=m(u,h,p,l,s[f+10],23,-1094730640),l=m(l,u,h,p,s[f+13],4,681279174),p=m(p,l,u,h,s[f+0],11,-358537222),h=m(h,p,l,u,s[f+3],16,-722521979),u=m(u,h,p,l,s[f+6],23,76029189),l=m(l,u,h,p,s[f+9],4,-640364487),p=m(p,l,u,h,s[f+12],11,-421815835),h=m(h,p,l,u,s[f+15],16,530742520),l=g(l,u=m(u,h,p,l,s[f+2],23,-995338651),h,p,s[f+0],6,-198630844),p=g(p,l,u,h,s[f+7],10,1126891415),h=g(h,p,l,u,s[f+14],15,-1416354905),u=g(u,h,p,l,s[f+5],21,-57434055),l=g(l,u,h,p,s[f+12],6,1700485571),p=g(p,l,u,h,s[f+3],10,-1894986606),h=g(h,p,l,u,s[f+10],15,-1051523),u=g(u,h,p,l,s[f+1],21,-2054922799),l=g(l,u,h,p,s[f+8],6,1873313359),p=g(p,l,u,h,s[f+15],10,-30611744),h=g(h,p,l,u,s[f+6],15,-1560198380),u=g(u,h,p,l,s[f+13],21,1309151649),l=g(l,u,h,p,s[f+4],6,-145523070),p=g(p,l,u,h,s[f+11],10,-1120210379),h=g(h,p,l,u,s[f+2],15,718787259),u=g(u,h,p,l,s[f+9],21,-343485551),l=l+v>>>0,u=u+y>>>0,h=h+b>>>0,p=p+w>>>0;}return e.endian([l,u,h,p])})._ff=function(t,e,i,r,o,n,a){var s=t+(e&i|~e&r)+(o>>>0)+a;return (s<<n|s>>>32-n)+e},n._gg=function(t,e,i,r,o,n,a){var s=t+(e&r|i&~r)+(o>>>0)+a;return (s<<n|s>>>32-n)+e},n._hh=function(t,e,i,r,o,n,a){var s=t+(e^i^r)+(o>>>0)+a;return (s<<n|s>>>32-n)+e},n._ii=function(t,e,i,r,o,n,a){var s=t+(i^(e|~r))+(o>>>0)+a;return (s<<n|s>>>32-n)+e},n._blocksize=16,n._digestsize=16,t.exports=function(t,i){if(null==t)throw new Error("Illegal argument "+t);var r=e.wordsToBytes(n(t,i));return i&&i.asBytes?r:i&&i.asString?o.bytesToString(r):e.bytesToHex(r)};})),l=Math,h=(u={}).lib={},p=h.Base={extend:function(t){A.prototype=this;var e=new A;return t&&e.mixIn(t),e.hasOwnProperty("init")||(e.init=function(){e.$super.init.apply(this,arguments);}),(e.init.prototype=e).$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString);},clone:function(){return this.init.prototype.extend(this)}},f=h.WordArray=p.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length;},toString:function(t){return (t||_).stringify(this)},concat:function(t){var e=this.words,i=t.words,r=this.sigBytes,o=t.sigBytes;if(this.clamp(),r%4)for(var n=0;n<o;n++)e[r+n>>>2]|=(i[n>>>2]>>>24-n%4*8&255)<<24-(r+n)%4*8;else if(65535<i.length)for(n=0;n<o;n+=4)e[r+n>>>2]=i[n>>>2];else e.push.apply(e,i);return this.sigBytes+=o,this},clamp:function(){var t=this.words,e=this.sigBytes;t[e>>>2]&=4294967295<<32-e%4*8,t.length=l.ceil(e/4);},clone:function(){var t=p.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],i=0;i<t;i+=4)e.push(4294967296*l.random()|0);return new f.init(e,t)}}),d=u.enc={},_=d.Hex={stringify:function(t){for(var e=t.words,i=t.sigBytes,r=[],o=0;o<i;o++){var n=e[o>>>2]>>>24-o%4*8&255;r.push((n>>>4).toString(16)),r.push((15&n).toString(16));}return r.join("")},parse:function(t){for(var e=t.length,i=[],r=0;r<e;r+=2)i[r>>>3]|=parseInt(t.substr(r,2),16)<<24-r%8*4;return new f.init(i,e/2)}},m=d.Latin1={stringify:function(t){for(var e=t.words,i=t.sigBytes,r=[],o=0;o<i;o++)r.push(String.fromCharCode(e[o>>>2]>>>24-o%4*8&255));return r.join("")},parse:function(t){for(var e=t.length,i=[],r=0;r<e;r++)i[r>>>2]|=(255&t.charCodeAt(r))<<24-r%4*8;return new f.init(i,e)}},g=d.Utf8={stringify:function(t){try{return decodeURIComponent(escape(m.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return m.parse(unescape(encodeURIComponent(t)))}},v=h.BufferedBlockAlgorithm=p.extend({reset:function(){this._data=new f.init,this._nDataBytes=0;},_append:function(t){"string"==typeof t&&(t=g.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes;},_process:function(t){var e=this._data,i=e.words,r=e.sigBytes,o=this.blockSize,n=r/(4*o),a=(n=t?l.ceil(n):l.max((0|n)-this._minBufferSize,0))*o,s=l.min(4*a,r);if(a){for(var c=0;c<a;c+=o)this._doProcessBlock(i,c);var u=i.splice(0,a);e.sigBytes-=s;}return new f.init(u,s)},clone:function(){var t=p.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0}),h.Hasher=v.extend({cfg:p.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset();},reset:function(){v.reset.call(this),this._doReset();},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(e,i){return new t.init(i).finalize(e)}},_createHmacHelper:function(t){return function(e,i){return new y.HMAC.init(t,i).finalize(e)}}}),y=u.algo={},Array.Clear=function(t,e,i){for(var r in t)t[r]=null;},Array.Copy=function(t,e,i,r,o){for(var n=t.slice(e,e+o),a=0;a<n.length;a++)i[r]=n[a],r++;},window.epgis_Int32={minValue:-parseInt("10000000000000000000000000000000",2),maxValue:parseInt("1111111111111111111111111111111",2),parse:function(t){if(t<this.minValue){for(var e=(o=new Number(-t).toString(2)).substr(o.length-31,31),i="",r=0;r<e.length;r++)i+="0"==e.substr(r,1)?"1":"0";return parseInt(i,2)+1}if(t>this.maxValue){var o;for(e=(o=Number(t).toString(2)).substr(o.length-31,31),i="",r=0;r<e.length;r++)i+="0"==e.substr(r,1)?"1":"0";return -(parseInt(i,2)+1)}return t},parseByte:function(t){if(t<0){for(var e=(o=new Number(-t).toString(2)).substr(o.length-8,8),i="",r=0;r<e.length;r++)i+="0"==e.substr(r,1)?"1":"0";return parseInt(i,2)+1}if(255<t){var o=Number(t).toString(2);return parseInt(o.substr(o.length-8,8),2)}return t}},b="Microsoft Internet Explorer"==navigator.appName?(k.prototype.am=function(t,e,i,r,o,n){for(var a=32767&e,s=e>>15;0<=--n;){var c=32767&this[t],l=this[t++]>>15,u=s*c+l*a;o=((c=a*c+((32767&u)<<15)+i[r]+(1073741823&o))>>>30)+(u>>>15)+s*l+(o>>>30),i[r++]=1073741823&c;}return o},30):"Netscape"!=navigator.appName?(k.prototype.am=function(t,e,i,r,o,n){for(;0<=--n;){var a=e*this[t++]+i[r]+o;o=Math.floor(a/67108864),i[r++]=67108863&a;}return o},26):(k.prototype.am=function(t,e,i,r,o,n){for(var a=16383&e,s=e>>14;0<=--n;){var c=16383&this[t],l=this[t++]>>14,u=s*c+l*a;o=((c=a*c+((16383&u)<<14)+i[r]+o)>>28)+(u>>14)+s*l,i[r++]=268435455&c;}return o},28),k.prototype.DB=b,k.prototype.DM=(1<<b)-1,k.prototype.DV=1<<b,k.prototype.FV=Math.pow(2,52),k.prototype.F1=52-b,k.prototype.F2=2*b-52;for(var R="0123456789abcdefghijklmnopqrstuvwxyz",L=new Array,O="0".charCodeAt(0),F=0;F<=9;++F)L[O++]=F;for(O="a".charCodeAt(0),F=10;F<36;++F)L[O++]=F;for(O="A".charCodeAt(0),F=10;F<36;++F)L[O++]=F;function U(t,e){return t&e}function N(t,e){return t|e}function j(t,e){return t^e}function V(t,e){return t&~e}function q(){}function Z(t){return t}function G(t){this.r2=I(),this.q3=I(),k.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t;}D.prototype.convert=function(t){return t.s<0||0<=t.compareTo(this.m)?t.mod(this.m):t},D.prototype.revert=function(t){return t},D.prototype.reduce=function(t){t.divRemTo(this.m,null,t);},D.prototype.mulTo=function(t,e,i){t.multiplyTo(e,i),this.reduce(i);},D.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e);},M.prototype.convert=function(t){var e=I();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&0<e.compareTo(k.ZERO)&&this.m.subTo(e,e),e},M.prototype.revert=function(t){var e=I();return t.copyTo(e),this.reduce(e),e},M.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var i=32767&t[e],r=i*this.mpl+((i*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(t[i=e+this.m.t]+=this.m.am(0,r,t,e,0,this.m.t);t[i]>=t.DV;)t[i]-=t.DV,t[++i]++;}t.clamp(),t.drShiftTo(this.m.t,t),0<=t.compareTo(this.m)&&t.subTo(this.m,t);},M.prototype.mulTo=function(t,e,i){t.multiplyTo(e,i),this.reduce(i);},M.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e);},k.prototype.copyTo=function(t){for(var e=this.t-1;0<=e;--e)t[e]=this[e];t.t=this.t,t.s=this.s;},k.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,0<t?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0;},k.prototype.fromString=function(t,e){var i;if(16==e)i=4;else if(8==e)i=3;else if(256==e)i=8;else if(2==e)i=1;else if(32==e)i=5;else {if(4!=e)return void this.fromRadix(t,e);i=2;}this.t=0,this.s=0;for(var r=t.length,o=!1,n=0;0<=--r;){var a=8==i?255&t[r]:P(t,r);a<0?"-"==t.charAt(r)&&(o=!0):(o=!1,0==n?this[this.t++]=a:n+i>this.DB?(this[this.t-1]|=(a&(1<<this.DB-n)-1)<<n,this[this.t++]=a>>this.DB-n):this[this.t-1]|=a<<n,(n+=i)>=this.DB&&(n-=this.DB));}8==i&&0!=(128&t[0])&&(this.s=-1,0<n&&(this[this.t-1]|=(1<<this.DB-n)-1<<n)),this.clamp(),o&&k.ZERO.subTo(this,this);},k.prototype.clamp=function(){for(var t=this.s&this.DM;0<this.t&&this[this.t-1]==t;)--this.t;},k.prototype.dlShiftTo=function(t,e){for(var i=this.t-1;0<=i;--i)e[i+t]=this[i];for(i=t-1;0<=i;--i)e[i]=0;e.t=this.t+t,e.s=this.s;},k.prototype.drShiftTo=function(t,e){for(var i=t;i<this.t;++i)e[i-t]=this[i];e.t=Math.max(this.t-t,0),e.s=this.s;},k.prototype.lShiftTo=function(t,e){for(var i=t%this.DB,r=this.DB-i,o=(1<<r)-1,n=Math.floor(t/this.DB),a=this.s<<i&this.DM,s=this.t-1;0<=s;--s)e[s+n+1]=this[s]>>r|a,a=(this[s]&o)<<i;for(s=n-1;0<=s;--s)e[s]=0;e[n]=a,e.t=this.t+n+1,e.s=this.s,e.clamp();},k.prototype.rShiftTo=function(t,e){e.s=this.s;var i=Math.floor(t/this.DB);if(i>=this.t)e.t=0;else {var r=t%this.DB,o=this.DB-r,n=(1<<r)-1;e[0]=this[i]>>r;for(var a=i+1;a<this.t;++a)e[a-i-1]|=(this[a]&n)<<o,e[a-i]=this[a]>>r;0<r&&(e[this.t-i-1]|=(this.s&n)<<o),e.t=this.t-i,e.clamp();}},k.prototype.subTo=function(t,e){for(var i=0,r=0,o=Math.min(t.t,this.t);i<o;)r+=this[i]-t[i],e[i++]=r&this.DM,r>>=this.DB;if(t.t<this.t){for(r-=t.s;i<this.t;)r+=this[i],e[i++]=r&this.DM,r>>=this.DB;r+=this.s;}else {for(r+=this.s;i<t.t;)r-=t[i],e[i++]=r&this.DM,r>>=this.DB;r-=t.s;}e.s=r<0?-1:0,r<-1?e[i++]=this.DV+r:0<r&&(e[i++]=r),e.t=i,e.clamp();},k.prototype.multiplyTo=function(t,e){var i=this.abs(),r=t.abs(),o=i.t;for(e.t=o+r.t;0<=--o;)e[o]=0;for(o=0;o<r.t;++o)e[o+i.t]=i.am(0,r[o],e,o,0,i.t);e.s=0,e.clamp(),this.s!=t.s&&k.ZERO.subTo(e,e);},k.prototype.squareTo=function(t){for(var e=this.abs(),i=t.t=2*e.t;0<=--i;)t[i]=0;for(i=0;i<e.t-1;++i){var r=e.am(i,e[i],t,2*i,0,1);(t[i+e.t]+=e.am(i+1,2*e[i],t,2*i+1,r,e.t-i-1))>=e.DV&&(t[i+e.t]-=e.DV,t[i+e.t+1]=1);}0<t.t&&(t[t.t-1]+=e.am(i,e[i],t,2*i,0,1)),t.s=0,t.clamp();},k.prototype.divRemTo=function(t,e,i){var r=t.abs();if(!(r.t<=0)){var o=this.abs();if(o.t<r.t)return null!=e&&e.fromInt(0),void(null!=i&&this.copyTo(i));null==i&&(i=I());var n=I(),a=this.s,s=t.s,c=this.DB-z(r[r.t-1]);0<c?(r.lShiftTo(c,n),o.lShiftTo(c,i)):(r.copyTo(n),o.copyTo(i));var l=n.t,u=n[l-1];if(0!=u){var h=u*(1<<this.F1)+(1<l?n[l-2]>>this.F2:0),p=this.FV/h,f=(1<<this.F1)/h,d=1<<this.F2,_=i.t,m=_-l,g=null==e?I():e;for(n.dlShiftTo(m,g),0<=i.compareTo(g)&&(i[i.t++]=1,i.subTo(g,i)),k.ONE.dlShiftTo(l,g),g.subTo(n,n);n.t<l;)n[n.t++]=0;for(;0<=--m;){var v=i[--_]==u?this.DM:Math.floor(i[_]*p+(i[_-1]+d)*f);if((i[_]+=n.am(0,v,i,m,0,l))<v)for(n.dlShiftTo(m,g),i.subTo(g,i);i[_]<--v;)i.subTo(g,i);}null!=e&&(i.drShiftTo(l,e),a!=s&&k.ZERO.subTo(e,e)),i.t=l,i.clamp(),0<c&&i.rShiftTo(c,i),a<0&&k.ZERO.subTo(i,i);}}},k.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return 0<(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)?this.DV-e:-e},k.prototype.isEven=function(){return 0==(0<this.t?1&this[0]:this.s)},k.prototype.exp=function(t,e){if(4294967295<t||t<1)return k.ONE;var i,r=I(),o=I(),n=e.convert(this),a=z(t)-1;for(n.copyTo(r);0<=--a;)e.sqrTo(r,o),0<(t&1<<a)?e.mulTo(o,n,r):(i=r,r=o,o=i);return e.revert(r)},k.prototype.toString=function(t){if(this.s<0)return "-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else {if(4!=t)return this.toRadix(t);e=2;}var i,r=(1<<e)-1,o=!1,n="",a=this.t,s=this.DB-a*this.DB%e;if(0<a--)for(s<this.DB&&0<(i=this[a]>>s)&&(o=!0,n=B(i));0<=a;)s<e?(i=(this[a]&(1<<s)-1)<<e-s,i|=this[--a]>>(s+=this.DB-e)):(i=this[a]>>(s-=e)&r,s<=0&&(s+=this.DB,--a)),0<i&&(o=!0),o&&(n+=B(i));return o?n:"0"},k.prototype.negate=function(){var t=I();return k.ZERO.subTo(this,t),t},k.prototype.abs=function(){return this.s<0?this.negate():this},k.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var i=this.t;if(0!=(e=i-t.t))return this.s<0?-e:e;for(;0<=--i;)if(0!=(e=this[i]-t[i]))return e;return 0},k.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+z(this[this.t-1]^this.s&this.DM)},k.prototype.mod=function(t){var e=I();return this.abs().divRemTo(t,null,e),this.s<0&&0<e.compareTo(k.ZERO)&&t.subTo(e,e),e},k.prototype.modPowInt=function(t,e){var i=new(t<256||e.isEven()?D:M)(e);return this.exp(t,i)},k.ZERO=C(0),k.ONE=C(1),q.prototype.convert=Z,q.prototype.revert=Z,q.prototype.mulTo=function(t,e,i){t.multiplyTo(e,i);},q.prototype.sqrTo=function(t,e){t.squareTo(e);},G.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=I();return t.copyTo(e),this.reduce(e),e},G.prototype.revert=function(t){return t},G.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);0<=t.compareTo(this.m);)t.subTo(this.m,t);},G.prototype.mulTo=function(t,e,i){t.multiplyTo(e,i),this.reduce(i);},G.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e);};var H=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],W=(1<<26)/H[H.length-1];k.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},k.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||36<t)return "0";var e=this.chunkSize(t),i=Math.pow(t,e),r=C(i),o=I(),n=I(),a="";for(this.divRemTo(r,o,n);0<o.signum();)a=(i+n.intValue()).toString(t).substr(1)+a,o.divRemTo(r,o,n);return n.intValue().toString(t)+a},k.prototype.fromRadix=function(t,e){this.fromInt(0),null==e&&(e=10);for(var i=this.chunkSize(e),r=Math.pow(e,i),o=!1,n=0,a=0,s=0;s<t.length;++s){var c=P(t,s);c<0?"-"==t.charAt(s)&&0==this.signum()&&(o=!0):(a=e*a+c,++n>=i&&(this.dMultiply(r),this.dAddOffset(a,0),a=n=0));}0<n&&(this.dMultiply(Math.pow(e,n)),this.dAddOffset(a,0)),o&&k.ZERO.subTo(this,this);},k.prototype.fromNumber=function(t,e,i){if("number"==typeof e)if(t<2)this.fromInt(1);else for(this.fromNumber(t,i),this.testBit(t-1)||this.bitwiseTo(k.ONE.shiftLeft(t-1),N,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(k.ONE.shiftLeft(t-1),this);else {var r=new Array,o=7&t;r.length=1+(t>>3),e.nextBytes(r),0<o?r[0]&=(1<<o)-1:r[0]=0,this.fromString(r,256);}},k.prototype.bitwiseTo=function(t,e,i){for(var r,o=Math.min(t.t,this.t),n=0;n<o;++n)i[n]=e(this[n],t[n]);if(t.t<this.t){for(r=t.s&this.DM,n=o;n<this.t;++n)i[n]=e(this[n],r);i.t=this.t;}else {for(r=this.s&this.DM,n=o;n<t.t;++n)i[n]=e(r,t[n]);i.t=t.t;}i.s=e(this.s,t.s),i.clamp();},k.prototype.changeBit=function(t,e){var i=k.ONE.shiftLeft(t);return this.bitwiseTo(i,e,i),i},k.prototype.addTo=function(t,e){for(var i=0,r=0,o=Math.min(t.t,this.t);i<o;)r+=this[i]+t[i],e[i++]=r&this.DM,r>>=this.DB;if(t.t<this.t){for(r+=t.s;i<this.t;)r+=this[i],e[i++]=r&this.DM,r>>=this.DB;r+=this.s;}else {for(r+=this.s;i<t.t;)r+=t[i],e[i++]=r&this.DM,r>>=this.DB;r+=t.s;}e.s=r<0?-1:0,0<r?e[i++]=r:r<-1&&(e[i++]=this.DV+r),e.t=i,e.clamp();},k.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp();},k.prototype.dAddOffset=function(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e];}},k.prototype.multiplyLowerTo=function(t,e,i){var r,o=Math.min(this.t+t.t,e);for(i.s=0,i.t=o;0<o;)i[--o]=0;for(r=i.t-this.t;o<r;++o)i[o+this.t]=this.am(0,t[o],i,o,0,this.t);for(r=Math.min(t.t,e);o<r;++o)this.am(0,t[o],i,o,0,e-o);i.clamp();},k.prototype.multiplyUpperTo=function(t,e,i){--e;var r=i.t=this.t+t.t-e;for(i.s=0;0<=--r;)i[r]=0;for(r=Math.max(e-this.t,0);r<t.t;++r)i[this.t+r-e]=this.am(e-r,t[r],i,0,0,this.t+r-e);i.clamp(),i.drShiftTo(1,i);},k.prototype.modInt=function(t){if(t<=0)return 0;var e=this.DV%t,i=this.s<0?t-1:0;if(0<this.t)if(0==e)i=this[0]%t;else for(var r=this.t-1;0<=r;--r)i=(e*i+this[r])%t;return i},k.prototype.millerRabin=function(t){var e=this.subtract(k.ONE),i=e.getLowestSetBit();if(i<=0)return !1;var r=e.shiftRight(i);H.length<(t=t+1>>1)&&(t=H.length);for(var o=I(),n=0;n<t;++n){o.fromInt(H[Math.floor(Math.random()*H.length)]);var a=o.modPow(r,this);if(0!=a.compareTo(k.ONE)&&0!=a.compareTo(e)){for(var s=1;s++<i&&0!=a.compareTo(e);)if(0==(a=a.modPowInt(2,this)).compareTo(k.ONE))return !1;if(0!=a.compareTo(e))return !1}}return !0},k.prototype.clone=function(){var t=I();return this.copyTo(t),t},k.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return -1}else {if(1==this.t)return this[0];if(0==this.t)return 0}return (this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},k.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},k.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},k.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},k.prototype.toByteArray=function(){var t=this.t,e=new Array;e[0]=this.s;var i,r=this.DB-t*this.DB%8,o=0;if(0<t--)for(r<this.DB&&(i=this[t]>>r)!=(this.s&this.DM)>>r&&(e[o++]=i|this.s<<this.DB-r);0<=t;)r<8?(i=(this[t]&(1<<r)-1)<<8-r,i|=this[--t]>>(r+=this.DB-8)):(i=this[t]>>(r-=8)&255,r<=0&&(r+=this.DB,--t)),0!=(128&i)&&(i|=-256),0==o&&(128&this.s)!=(128&i)&&++o,(0<o||i!=this.s)&&(e[o++]=i);return e},k.prototype.equals=function(t){return 0==this.compareTo(t)},k.prototype.min=function(t){return this.compareTo(t)<0?this:t},k.prototype.max=function(t){return 0<this.compareTo(t)?this:t},k.prototype.and=function(t){var e=I();return this.bitwiseTo(t,U,e),e},k.prototype.or=function(t){var e=I();return this.bitwiseTo(t,N,e),e},k.prototype.xor=function(t){var e=I();return this.bitwiseTo(t,j,e),e},k.prototype.andNot=function(t){var e=I();return this.bitwiseTo(t,V,e),e},k.prototype.not=function(){for(var t=I(),e=0;e<this.t;++e)t[e]=this.DM&~this[e];return t.t=this.t,t.s=~this.s,t},k.prototype.shiftLeft=function(t){var e=I();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e},k.prototype.shiftRight=function(t){var e=I();return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e},k.prototype.getLowestSetBit=function(){for(var t=0;t<this.t;++t)if(0!=this[t])return t*this.DB+function(t){if(0==t)return -1;var e=0;return 0==(65535&t)&&(t>>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}(this[t]);return this.s<0?this.t*this.DB:-1},k.prototype.bitCount=function(){for(var t=0,e=this.s&this.DM,i=0;i<this.t;++i)t+=function(t){for(var e=0;0!=t;)t&=t-1,++e;return e}(this[i]^e);return t},k.prototype.testBit=function(t){var e=Math.floor(t/this.DB);return e>=this.t?0!=this.s:0!=(this[e]&1<<t%this.DB)},k.prototype.setBit=function(t){return this.changeBit(t,N)},k.prototype.clearBit=function(t){return this.changeBit(t,V)},k.prototype.flipBit=function(t){return this.changeBit(t,j)},k.prototype.add=function(t){var e=I();return this.addTo(t,e),e},k.prototype.subtract=function(t){var e=I();return this.subTo(t,e),e},k.prototype.multiply=function(t){var e=I();return this.multiplyTo(t,e),e},k.prototype.divide=function(t){var e=I();return this.divRemTo(t,e,null),e},k.prototype.remainder=function(t){var e=I();return this.divRemTo(t,null,e),e},k.prototype.divideAndRemainder=function(t){var e=I(),i=I();return this.divRemTo(t,e,i),new Array(e,i)},k.prototype.modPow=function(t,e){var i,r,o=t.bitLength(),n=C(1);if(o<=0)return n;i=o<18?1:o<48?3:o<144?4:o<768?5:6,r=new(o<8?D:e.isEven()?G:M)(e);var a=new Array,s=3,c=i-1,l=(1<<i)-1;if(a[1]=r.convert(this),1<i){var u=I();for(r.sqrTo(a[1],u);s<=l;)a[s]=I(),r.mulTo(u,a[s-2],a[s]),s+=2;}var h,p,f=t.t-1,d=!0,_=I();for(o=z(t[f])-1;0<=f;){for(c<=o?h=t[f]>>o-c&l:(h=(t[f]&(1<<o+1)-1)<<c-o,0<f&&(h|=t[f-1]>>this.DB+o-c)),s=i;0==(1&h);)h>>=1,--s;if((o-=s)<0&&(o+=this.DB,--f),d)a[h].copyTo(n),d=!1;else {for(;1<s;)r.sqrTo(n,_),r.sqrTo(_,n),s-=2;0<s?r.sqrTo(n,_):(p=n,n=_,_=p),r.mulTo(_,a[h],n);}for(;0<=f&&0==(t[f]&1<<o);)r.sqrTo(n,_),p=n,n=_,_=p,--o<0&&(o=this.DB-1,--f);}return r.revert(n)},k.prototype.modInverse=function(t){var e=t.isEven();if(this.isEven()&&e||0==t.signum())return k.ZERO;for(var i=t.clone(),r=this.clone(),o=C(1),n=C(0),a=C(0),s=C(1);0!=i.signum();){for(;i.isEven();)i.rShiftTo(1,i),e?(o.isEven()&&n.isEven()||(o.addTo(this,o),n.subTo(t,n)),o.rShiftTo(1,o)):n.isEven()||n.subTo(t,n),n.rShiftTo(1,n);for(;r.isEven();)r.rShiftTo(1,r),e?(a.isEven()&&s.isEven()||(a.addTo(this,a),s.subTo(t,s)),a.rShiftTo(1,a)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);0<=i.compareTo(r)?(i.subTo(r,i),e&&o.subTo(a,o),n.subTo(s,n)):(r.subTo(i,r),e&&a.subTo(o,a),s.subTo(n,s));}return 0!=r.compareTo(k.ONE)?k.ZERO:0<=s.compareTo(t)?s.subtract(t):s.signum()<0?(s.addTo(t,s),s.signum()<0?s.add(t):s):s},k.prototype.pow=function(t){return this.exp(t,new q)},k.prototype.gcd=function(t){var e,i=this.s<0?this.negate():this.clone(),r=t.s<0?t.negate():t.clone();i.compareTo(r)<0&&(e=i,i=r,r=e);var o=i.getLowestSetBit(),n=r.getLowestSetBit();if(n<0)return i;for(o<n&&(n=o),0<n&&(i.rShiftTo(n,i),r.rShiftTo(n,r));0<i.signum();)0<(o=i.getLowestSetBit())&&i.rShiftTo(o,i),0<(o=r.getLowestSetBit())&&r.rShiftTo(o,r),0<=i.compareTo(r)?(i.subTo(r,i),i.rShiftTo(1,i)):(r.subTo(i,r),r.rShiftTo(1,r));return 0<n&&r.lShiftTo(n,r),r},k.prototype.isProbablePrime=function(t){var e,i=this.abs();if(1==i.t&&i[0]<=H[H.length-1]){for(e=0;e<H.length;++e)if(i[0]==H[e])return !0;return !1}if(i.isEven())return !1;for(e=1;e<H.length;){for(var r=H[e],o=e+1;o<H.length&&r<W;)r*=H[o++];for(r=i.modInt(r);e<o;)if(r%H[e++]==0)return !1}return i.millerRabin(t)},k.prototype.square=function(){var t=I();return this.squareTo(t),t};var X=function(){this.global=window,this.document=document,this.headerEle=document.head||document.getElementsByTagName("head")[0],this._eles=[];};function K(t){return (K="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}X.prototype.createScript=function(t){var e=this,i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,r=this.document.createElement("script");for(var o in r.charset="utf-8","string"==typeof t&&(t={src:t}),t)r.setAttribute(o,t[o]);r.onload=r.onreadystatechange=function(){r.readyState&&"loaded"!==r.readyState&&"complete"!==r.readyState||(i&&i(null,r),e.headerEle.removeChild(r));},r.onerror=function(t){i&&i(t);},this._eles.push(r),this.headerEle.appendChild(r);},X.prototype.runScript=function(t){var e=this.document.createElement("script");this.headerEle.appendChild(e),e.innerHTML=t;},X.prototype.createStyle=function(t){var e=this.document.createElement("style");e.innerHTML=t,this.headerEle.appendChild(e);},X.prototype.createLink=function(t){var e;this.headerEle?((e=this.document.createElement("link")).setAttribute("rel","stylesheet"),e.setAttribute("type","text/css"),e.setAttribute("href",t),this.headerEle.appendChild(e)):this.document.write("<link rel='stylesheet' href='"+t+"'/>");},X.prototype.blobURL=function(t,e,i){};var Y=c((function(t,e){!function(i,r){var o="function",n="undefined",a="object",s="string",c="model",l="name",u="type",h="vendor",p="version",f="architecture",d="console",_="mobile",m="tablet",g="smarttv",v="wearable",y="embedded",b="Amazon",w="Apple",x="BlackBerry",T="Browser",S="Chrome",E="Firefox",A="Google",k="Microsoft",I="Motorola",B="Opera",P="Samsung",C="Sony",z="Zebra",D="Facebook",M=function(t){for(var e={},i=0;i<t.length;i++)e[t[i].toUpperCase()]=t[i];return e},R=function(t,e){return K(t)===s&&-1!==L(e).indexOf(L(t))},L=function(t){return t.toLowerCase()},O=function(t,e){if(K(t)===s)return t=t.replace(/^\s\s*/,"").replace(/\s\s*$/,""),K(e)===n?t:t.substring(0,255)},F=function(t,e){for(var i,n,s,c,l,u=0;u<e.length&&!c;){for(var h=e[u],p=e[u+1],f=i=0;f<h.length&&!c;)if(c=h[f++].exec(t))for(n=0;n<p.length;n++)l=c[++i],K(s=p[n])===a&&0<s.length?2===s.length?this[s[0]]=K(s[1])==o?s[1].call(this,l):s[1]:3===s.length?this[s[0]]=K(s[1])!==o||s[1].exec&&s[1].test?l?l.replace(s[1],s[2]):r:l?s[1].call(this,l,s[2]):r:4===s.length&&(this[s[0]]=l?s[3].call(this,l.replace(s[1],s[2])):r):this[s]=l||r;u+=2;}},U=function(t,e){for(var i in e)if(K(e[i])===a&&0<e[i].length){for(var o=0;o<e[i].length;o++)if(R(e[i][o],t))return "?"===i?r:i}else if(R(e[i],t))return "?"===i?r:i;return t},N={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},j={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[p,[l,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[p,[l,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[l,p],[/opios[\/ ]+([\w\.]+)/i],[p,[l,B+" Mini"]],[/\bopr\/([\w\.]+)/i],[p,[l,B]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[l,p],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[p,[l,"UC"+T]],[/\bqbcore\/([\w\.]+)/i],[p,[l,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[p,[l,"WeChat"]],[/konqueror\/([\w\.]+)/i],[p,[l,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[p,[l,"IE"]],[/yabrowser\/([\w\.]+)/i],[p,[l,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[l,/(.+)/,"$1 Secure "+T],p],[/\bfocus\/([\w\.]+)/i],[p,[l,E+" Focus"]],[/\bopt\/([\w\.]+)/i],[p,[l,B+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[p,[l,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[p,[l,"Dolphin"]],[/coast\/([\w\.]+)/i],[p,[l,B+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[p,[l,"MIUI "+T]],[/fxios\/([-\w\.]+)/i],[p,[l,E]],[/\bqihu|(qi?ho?o?|360)browser/i],[[l,"360 "+T]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[l,/(.+)/,"$1 "+T],p],[/(comodo_dragon)\/([\w\.]+)/i],[[l,/_/g," "],p],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[l,p],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i],[l],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[l,D],p],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[l,p],[/\bgsa\/([\w\.]+) .*safari\//i],[p,[l,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[p,[l,S+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[l,S+" WebView"],p],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[p,[l,"Android "+T]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[l,p],[/version\/([\w\.]+) .*mobile\/\w+ (safari)/i],[p,[l,"Mobile Safari"]],[/version\/([\w\.]+) .*(mobile ?safari|safari)/i],[p,l],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[l,[p,U,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[l,p],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[l,"Netscape"],p],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[p,[l,E+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[l,p]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[f,"amd64"]],[/(ia32(?=;))/i],[[f,L]],[/((?:i[346]|x)86)[;\)]/i],[[f,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[f,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[f,"armhf"]],[/windows (ce|mobile); ppc;/i],[[f,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[f,/ower/,"",L]],[/(sun4\w)[;\)]/i],[[f,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[f,L]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[c,[h,P],[u,m]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[c,[h,P],[u,_]],[/\((ip(?:hone|od)[\w ]*);/i],[c,[h,w],[u,_]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[c,[h,w],[u,m]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[c,[h,"Huawei"],[u,m]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}-[atu]?[ln][01259x][012359][an]?)\b(?!.+d\/s)/i],[c,[h,"Huawei"],[u,_]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[c,/_/g," "],[h,"Xiaomi"],[u,_]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[c,/_/g," "],[h,"Xiaomi"],[u,m]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[c,[h,"OPPO"],[u,_]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[c,[h,"Vivo"],[u,_]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[c,[h,"Realme"],[u,_]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[c,[h,I],[u,_]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[c,[h,I],[u,m]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[c,[h,"LG"],[u,m]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[c,[h,"LG"],[u,_]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[c,[h,"Lenovo"],[u,m]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[c,/_/g," "],[h,"Nokia"],[u,_]],[/(pixel c)\b/i],[c,[h,A],[u,m]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[c,[h,A],[u,_]],[/droid.+ ([c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[c,[h,C],[u,_]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[c,"Xperia Tablet"],[h,C],[u,m]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[c,[h,"OnePlus"],[u,_]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[c,[h,b],[u,m]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[c,/(.+)/g,"Fire Phone $1"],[h,b],[u,_]],[/(playbook);[-\w\),; ]+(rim)/i],[c,h,[u,m]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[c,[h,x],[u,_]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[c,[h,"ASUS"],[u,m]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[c,[h,"ASUS"],[u,_]],[/(nexus 9)/i],[c,[h,"HTC"],[u,m]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony)[-_ ]?([-\w]*)/i],[h,[c,/_/g," "],[u,_]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[c,[h,"Acer"],[u,m]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[c,[h,"Meizu"],[u,_]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[c,[h,"Sharp"],[u,_]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[h,c,[u,_]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[h,c,[u,m]],[/(surface duo)/i],[c,[h,k],[u,m]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[c,[h,"Fairphone"],[u,_]],[/(u304aa)/i],[c,[h,"AT&T"],[u,_]],[/\bsie-(\w*)/i],[c,[h,"Siemens"],[u,_]],[/\b(rct\w+) b/i],[c,[h,"RCA"],[u,m]],[/\b(venue[\d ]{2,7}) b/i],[c,[h,"Dell"],[u,m]],[/\b(q(?:mv|ta)\w+) b/i],[c,[h,"Verizon"],[u,m]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[c,[h,"Barnes & Noble"],[u,m]],[/\b(tm\d{3}\w+) b/i],[c,[h,"NuVision"],[u,m]],[/\b(k88) b/i],[c,[h,"ZTE"],[u,m]],[/\b(nx\d{3}j) b/i],[c,[h,"ZTE"],[u,_]],[/\b(gen\d{3}) b.+49h/i],[c,[h,"Swiss"],[u,_]],[/\b(zur\d{3}) b/i],[c,[h,"Swiss"],[u,m]],[/\b((zeki)?tb.*\b) b/i],[c,[h,"Zeki"],[u,m]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[h,"Dragon Touch"],c,[u,m]],[/\b(ns-?\w{0,9}) b/i],[c,[h,"Insignia"],[u,m]],[/\b((nxa|next)-?\w{0,9}) b/i],[c,[h,"NextBook"],[u,m]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[h,"Voice"],c,[u,_]],[/\b(lvtel\-)?(v1[12]) b/i],[[h,"LvTel"],c,[u,_]],[/\b(ph-1) /i],[c,[h,"Essential"],[u,_]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[c,[h,"Envizen"],[u,m]],[/\b(trio[-\w\. ]+) b/i],[c,[h,"MachSpeed"],[u,m]],[/\btu_(1491) b/i],[c,[h,"Rotor"],[u,m]],[/(shield[\w ]+) b/i],[c,[h,"Nvidia"],[u,m]],[/(sprint) (\w+)/i],[h,c,[u,_]],[/(kin\.[onetw]{3})/i],[[c,/\./g," "],[h,k],[u,_]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[c,[h,z],[u,m]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[c,[h,z],[u,_]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[h,c,[u,d]],[/droid.+; (shield) bui/i],[c,[h,"Nvidia"],[u,d]],[/(playstation [345portablevi]+)/i],[c,[h,C],[u,d]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[c,[h,k],[u,d]],[/smart-tv.+(samsung)/i],[h,[u,g]],[/hbbtv.+maple;(\d+)/i],[[c,/^/,"SmartTV"],[h,P],[u,g]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[h,"LG"],[u,g]],[/(apple) ?tv/i],[h,[c,w+" TV"],[u,g]],[/crkey/i],[[c,S+"cast"],[h,A],[u,g]],[/droid.+aft(\w)( bui|\))/i],[c,[h,b],[u,g]],[/\(dtv[\);].+(aquos)/i],[c,[h,"Sharp"],[u,g]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[h,O],[c,O],[u,g]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[u,g]],[/((pebble))app/i],[h,c,[u,v]],[/droid.+; (glass) \d/i],[c,[h,A],[u,v]],[/droid.+; (wt63?0{2,3})\)/i],[c,[h,z],[u,v]],[/(quest( 2)?)/i],[c,[h,D],[u,v]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[h,[u,y]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[c,[u,_]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[c,[u,m]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[u,m]],[/(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i],[[u,_]],[/(android[-\w\. ]{0,9});.+buil/i],[c,[h,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[p,[l,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[p,[l,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[l,p],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[p,l]],os:[[/microsoft (windows) (vista|xp)/i],[l,p],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[l,[p,U,N]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[l,"Windows"],[p,U,N]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[p,/_/g,"."],[l,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[l,"Mac OS"],[p,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[p,l],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[l,p],[/\(bb(10);/i],[p,[l,x]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[p,[l,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[p,[l,E+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[p,[l,"webOS"]],[/crkey\/([\d\.]+)/i],[p,[l,S+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[l,"Chromium OS"],p],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[l,p],[/(sunos) ?([\w\.\d]*)/i],[[l,"Solaris"],p],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[l,p]]},V=function t(e,o){if(K(e)===a&&(o=e,e=r),!(this instanceof t))return new t(e,o).getResult();var d=e||(K(i)!==n&&i.navigator&&i.navigator.userAgent?i.navigator.userAgent:""),_=o?function(t,e){var i={};for(var r in t)i[r]=e[r]&&e[r].length%2==0?e[r].concat(t[r]):t[r];return i}(j,o):j;return this.getBrowser=function(){var t={};return t[l]=r,t[p]=r,F.call(t,d,_.browser),t.major=function(t){return K(t)===s?t.replace(/[^\d\.]/g,"").split(".")[0]:r}(t.version),t},this.getCPU=function(){var t={};return t[f]=r,F.call(t,d,_.cpu),t},this.getDevice=function(){var t={};return t[h]=r,t[c]=r,t[u]=r,F.call(t,d,_.device),t},this.getEngine=function(){var t={};return t[l]=r,t[p]=r,F.call(t,d,_.engine),t},this.getOS=function(){var t={};return t[l]=r,t[p]=r,F.call(t,d,_.os),t},this.getResult=function(){return {ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return d},this.setUA=function(t){return d=K(t)===s&&255<t.length?O(t,255):t,this},this.setUA(d),this};V.VERSION="1.0.2",V.BROWSER=M([l,p,"major"]),V.CPU=M([f]),V.DEVICE=M([c,h,u,d,_,g,m,v,y]),V.ENGINE=V.OS=M([l,p]),t.exports&&(e=t.exports=V),e.UAParser=V;var q,Z=K(i)!==n&&(i.jQuery||i.Zepto);Z&&!Z.ua&&(q=new V,Z.ua=q.getResult(),Z.ua.get=function(){return q.getUA()},Z.ua.set=function(t){q.setUA(t);var e=q.getResult();for(var i in e)Z.ua[i]=e[i];});}("object"===("undefined"==typeof window?"undefined":K(window))?window:s);})),J=window.localStorage,Q=function(){this.canuse=Object.prototype.hasOwnProperty.call(window,"localStorage")&&window.localStorage;};Q.prototype.setItem=function(t){var e={name:"",value:"",expires:"",startTime:(new Date).getTime()},i=Object.assign({},e,t);try{J.setItem(i.name,JSON.stringify(i));}catch(t){}},Q.prototype.getItem=function(t,i){var r=J.getItem(t);if(!r)return null;var o=JSON.parse(r);if(o.v!==i)return null;if(o.enc!==e.enc)return null;var n=(new Date).getTime()-o.startTime;return n>o.expires||o.expires!=e.expires||n<0?(J.removeItem(t),null):o.value},Q.prototype.removeItem=function(t){J.removeItem(t);},Q.prototype.clear=function(){J.clear();};var $=new Q,tt=function(t,e){return (Array.isArray(t)?t:[t]).filter((function(t){return $.getItem("_EPGIS_".concat(t),e)}))},et=function(t,e){return (Array.isArray(t)?t:[t]).filter((function(t){return !$.canuse||!$.getItem("_EPGIS_".concat(t),e)}))},it=function(t){var e=[];for(var i in t)e.push("".concat(i,"=").concat(t[i]));return e.join("&")},rt=new Y,ot=function(){return window.SGMap};Array.prototype.filter||(Array.prototype.filter=function(t){for(var e=[],i=-1;++i<this.length;)t(this[i])&&e.push(this[i]);return e}),Array.prototype.forEach||(Array.prototype.forEach=function(t){for(var e=-1;++e<this.length;)t(this[e]);}),Array.prototype.includes||(Array.prototype.includes=function(t){return 0<this.filter((function(e){return e===t})).length}),Array.prototype.reduce||(Array.prototype.reduce=function(t,e){for(var r=e;++i<this.length;)t(r,this[i]);return r}),Array.isArray||(Array.isArray=function(t){return "Array"===t.constructor.name}),Object.keys||(Object.keys=function(t){var e=[];for(var i in t)e.push(i);return e}),Function.prototype.bind||(Function.prototype.bind=function(t){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var e=Array.prototype.slice.call(arguments,1),i=this,r=function(){},o=function(){return i.apply(this instanceof r&&t?this:t,e.concat(Array.prototype.slice.call(arguments)))};return r.prototype=this.prototype,o.prototype=new r,o});var nt=function(){this._modules=[],this.core=new X,this.init();};nt.prototype.init=function(){},nt.prototype.loadModules=function(){var t=this,i=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;if(!i||0==i.length)return r("插件列表参数有误"),!1;var o={v:e.version};e.isDev&&(o.dev=1),$.canuse&&tt(i,e.version).forEach((function(i){t.run($.getItem("_EPGIS_".concat(i),e.version).code);}));var n=et(i,e.version);n.length&&(o.plugin=n),o.plugin?(o.access_token=ot().accessToken,o.rnd=Math.random(),o.cb="__jsload"+(new Date).getTime(),window[o.cb]=function(e){t.__jsload(e,i,r);},this.core.createScript("".concat(e.apiUrl,"/webplugin/?").concat(it(o)))):i&&i.length?r&&r(null,i):r&&r("没有传入插件名称");},nt.prototype.__jsload=function(t,e,i){if("{}"===JSON.stringify(t))i&&i("您使用的插件"+e.join(",")+",名称错误或者不存在请排查SGMap.plugin参数");else if(!1===t.success)i&&i(t.message);else {for(var r in t)this._parseSinglePlugin(r,t[r]);i&&i(null,Object.keys(t));}},nt.prototype._parseSinglePlugin=function(t,i){var r;this._modules.includes(t)?console.warn("插件".concat(t,"已经存在,并不会重复执行。请注意代码,不要重复加载。")):(r={notes:this.getNotes(i),code:i&&i.replace(/\/\*(\s|\S)*\*\//g,"")},$.canuse&&$.setItem({name:"_EPGIS_".concat(t),value:r,v:e.version,expires:e.expires,enc:e.enc}),this.run(r.code),this._modules.push(t));},nt.prototype.getRequire=function(t){var e=null;return t&&(e=t.split(" @").reduce((function(t,e){var i=e.split(/\s/);return 1<i.length?t[i[0]]=i[1]:t.title=i[0],t}),{})),e&&e.require?e.require.replace(/,{2,}/g,",").replace(/\s{2,}/g," ").replace(/\s/g,",").split(","):[]},nt.prototype.getNotes=function(t){var e=null;return t&&(e=t.match(/\/\*([\S\s]*)\*\//)),e?e[1]:""},nt.prototype.run=function(t){(function(t){return -1===t.indexOf("!function")})(t)&&(t=function(t,e){if(!o)return null;var i=o.enc.Utf8.parse("epgisgisaegismapssgcc");return a.decrypt({ciphertext:o.enc.Base64.parse(t)},i,{mode:o.mode.ECB,padding:o.pad.Pkcs7}).toString(o.enc.Utf8)}(t)),new Function("!function(){"+t+"}.bind((window||self).SGMap)()")();};var at=new nt,st=function(t,e){if("string"==typeof t&&(t=t.split(",")),Promise)return new Promise((function(i,r){at.loadModules(t,(function(t,o){t?(r(t),e&&e(t)):(i(o),e&&e(null,o));}));}));at.loadModules(t,e);};return st.config=e,st.Loader=nt,st.userAgent=rt,st.onError=function(t){window.onerror=function(e,i,r,o,n){t&&t(e,i,r,o,n?n.stack:null);},window.onunhandledrejection=function(e){t&&t(e.reason);};},st}));})),Yo=t.createCommonjsModule((function(e){var i=e.exports="undefined"!=typeof window&&window.Math==Math?window:void 0!==t.window&&t.window.Math==Math?t.window:Function("return this")();"number"==typeof __g&&(__g=i);})),Jo={}.hasOwnProperty,Qo=function(t,e){return Jo.call(t,e)},$o=function(t){try{return !!t()}catch(t){return !0}},tn=!$o((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})),en=t.createCommonjsModule((function(t){var e=t.exports={version:"2.6.12"};"number"==typeof __e&&(__e=e);})),rn=function(t){return "object"==typeof t?null!==t:"function"==typeof t},on=function(t){if(!rn(t))throw TypeError(t+" is not an object!");return t},nn=Yo.document,an=rn(nn)&&rn(nn.createElement),sn=function(t){return an?nn.createElement(t):{}},cn=!tn&&!$o((function(){return 7!=Object.defineProperty(sn("div"),"a",{get:function(){return 7}}).a})),ln=function(t,e){if(!rn(t))return t;var i,r;if(e&&"function"==typeof(i=t.toString)&&!rn(r=i.call(t)))return r;if("function"==typeof(i=t.valueOf)&&!rn(r=i.call(t)))return r;if(!e&&"function"==typeof(i=t.toString)&&!rn(r=i.call(t)))return r;throw TypeError("Can't convert object to primitive value")},un=Object.defineProperty,hn={f:tn?Object.defineProperty:function(t,e,i){if(on(t),e=ln(e,!0),on(i),cn)try{return un(t,e,i)}catch(t){}if("get"in i||"set"in i)throw TypeError("Accessors not supported!");return "value"in i&&(t[e]=i.value),t}},pn=function(t,e){return {enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},fn=tn?function(t,e,i){return hn.f(t,e,pn(1,i))}:function(t,e,i){return t[e]=i,t},dn=0,_n=Math.random(),mn=function(t){return "Symbol(".concat(void 0===t?"":t,")_",(++dn+_n).toString(36))},gn=t.createCommonjsModule((function(t){var e=Yo["__core-js_shared__"]||(Yo["__core-js_shared__"]={});(t.exports=function(t,i){return e[t]||(e[t]=void 0!==i?i:{})})("versions",[]).push({version:en.version,mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"});})),vn=gn("native-function-to-string",Function.toString),yn=t.createCommonjsModule((function(t){var e=mn("src"),i=(""+vn).split("toString");en.inspectSource=function(t){return vn.call(t)},(t.exports=function(t,r,o,n){var a="function"==typeof o;a&&(Qo(o,"name")||fn(o,"name",r)),t[r]!==o&&(a&&(Qo(o,e)||fn(o,e,t[r]?""+t[r]:i.join(String(r)))),t===Yo?t[r]=o:n?t[r]?t[r]=o:fn(t,r,o):(delete t[r],fn(t,r,o)));})(Function.prototype,"toString",(function(){return "function"==typeof this&&this[e]||vn.call(this)}));})),bn=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t},wn=function(t,e,i){if(bn(t),void 0===e)return t;switch(i){case 1:return function(i){return t.call(e,i)};case 2:return function(i,r){return t.call(e,i,r)};case 3:return function(i,r,o){return t.call(e,i,r,o)}}return function(){return t.apply(e,arguments)}},xn=function(t,e,i){var r,o,n,a,s=t&xn.F,c=t&xn.G,l=t&xn.P,u=t&xn.B,h=c?Yo:t&xn.S?Yo[e]||(Yo[e]={}):(Yo[e]||{}).prototype,p=c?en:en[e]||(en[e]={}),f=p.prototype||(p.prototype={});for(r in c&&(i=e),i)n=((o=!s&&h&&void 0!==h[r])?h:i)[r],a=u&&o?wn(n,Yo):l&&"function"==typeof n?wn(Function.call,n):n,h&&yn(h,r,n,t&xn.U),p[r]!=n&&fn(p,r,a),l&&f[r]!=n&&(f[r]=n);};Yo.core=en,xn.F=1,xn.G=2,xn.S=4,xn.P=8,xn.B=16,xn.W=32,xn.U=64,xn.R=128;var Tn=xn,Sn=t.createCommonjsModule((function(t){var e=mn("meta"),i=hn.f,r=0,o=Object.isExtensible||function(){return !0},n=!$o((function(){return o(Object.preventExtensions({}))})),a=function(t){i(t,e,{value:{i:"O"+ ++r,w:{}}});},s=t.exports={KEY:e,NEED:!1,fastKey:function(t,i){if(!rn(t))return "symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!Qo(t,e)){if(!o(t))return "F";if(!i)return "E";a(t);}return t[e].i},getWeak:function(t,i){if(!Qo(t,e)){if(!o(t))return !0;if(!i)return !1;a(t);}return t[e].w},onFreeze:function(t){return n&&s.NEED&&o(t)&&!Qo(t,e)&&a(t),t}};})),En=t.createCommonjsModule((function(t){var e=gn("wks"),i=Yo.Symbol,r="function"==typeof i;(t.exports=function(t){return e[t]||(e[t]=r&&i[t]||(r?i:mn)("Symbol."+t))}).store=e;})),An=hn.f,kn=En("toStringTag"),In=function(t,e,i){t&&!Qo(t=i?t:t.prototype,kn)&&An(t,kn,{configurable:!0,value:e});},Bn={f:En},Pn=hn.f,Cn=function(t){var e=en.Symbol||(en.Symbol=Yo.Symbol||{});"_"==t.charAt(0)||t in e||Pn(e,t,{value:Bn.f(t)});},zn={}.toString,Dn=function(t){return zn.call(t).slice(8,-1)},Mn=Object("z").propertyIsEnumerable(0)?Object:function(t){return "String"==Dn(t)?t.split(""):Object(t)},Rn=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},Ln=function(t){return Mn(Rn(t))},On=Math.ceil,Fn=Math.floor,Un=function(t){return isNaN(t=+t)?0:(t>0?Fn:On)(t)},Nn=Math.min,jn=function(t){return t>0?Nn(Un(t),9007199254740991):0},Vn=Math.max,qn=Math.min,Zn=function(t,e){return (t=Un(t))<0?Vn(t+e,0):qn(t,e)},Gn=function(t){return function(e,i,r){var o,n=Ln(e),a=jn(n.length),s=Zn(r,a);if(t&&i!=i){for(;a>s;)if((o=n[s++])!=o)return !0}else for(;a>s;s++)if((t||s in n)&&n[s]===i)return t||s||0;return !t&&-1}},Hn=gn("keys"),Wn=function(t){return Hn[t]||(Hn[t]=mn(t))},Xn=Gn(!1),Kn=Wn("IE_PROTO"),Yn=function(t,e){var i,r=Ln(t),o=0,n=[];for(i in r)i!=Kn&&Qo(r,i)&&n.push(i);for(;e.length>o;)Qo(r,i=e[o++])&&(~Xn(n,i)||n.push(i));return n},Jn="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),Qn=Object.keys||function(t){return Yn(t,Jn)},$n={f:Object.getOwnPropertySymbols},ta={f:{}.propertyIsEnumerable},ea=Array.isArray||function(t){return "Array"==Dn(t)},ia=function(t){return Object(Rn(t))},ra=tn?Object.defineProperties:function(t,e){on(t);for(var i,r=Qn(e),o=r.length,n=0;o>n;)hn.f(t,i=r[n++],e[i]);return t},oa=Yo.document,na=oa&&oa.documentElement,aa=Wn("IE_PROTO"),sa=function(){},ca=function(){var t,e=sn("iframe"),i=Jn.length;for(e.style.display="none",na.appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),ca=t.F;i--;)delete ca.prototype[Jn[i]];return ca()},la=Object.create||function(t,e){var i;return null!==t?(sa.prototype=on(t),i=new sa,sa.prototype=null,i[aa]=t):i=ca(),void 0===e?i:ra(i,e)},ua=Jn.concat("length","prototype"),ha={f:Object.getOwnPropertyNames||function(t){return Yn(t,ua)}},pa=ha.f,fa={}.toString,da="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],_a={f:function(t){return da&&"[object Window]"==fa.call(t)?function(t){try{return pa(t)}catch(t){return da.slice()}}(t):pa(Ln(t))}},ma=Object.getOwnPropertyDescriptor,ga={f:tn?ma:function(t,e){if(t=Ln(t),e=ln(e,!0),cn)try{return ma(t,e)}catch(t){}if(Qo(t,e))return pn(!ta.f.call(t,e),t[e])}},va=Sn.KEY,ya=ga.f,ba=hn.f,wa=_a.f,xa=Yo.Symbol,Ta=Yo.JSON,Sa=Ta&&Ta.stringify,Ea=En("_hidden"),Aa=En("toPrimitive"),ka={}.propertyIsEnumerable,Ia=gn("symbol-registry"),Ba=gn("symbols"),Pa=gn("op-symbols"),Ca=Object.prototype,za="function"==typeof xa&&!!$n.f,Da=Yo.QObject,Ma=!Da||!Da.prototype||!Da.prototype.findChild,Ra=tn&&$o((function(){return 7!=la(ba({},"a",{get:function(){return ba(this,"a",{value:7}).a}})).a}))?function(t,e,i){var r=ya(Ca,e);r&&delete Ca[e],ba(t,e,i),r&&t!==Ca&&ba(Ca,e,r);}:ba,La=function(t){var e=Ba[t]=la(xa.prototype);return e._k=t,e},Oa=za&&"symbol"==typeof xa.iterator?function(t){return "symbol"==typeof t}:function(t){return t instanceof xa},Fa=function(t,e,i){return t===Ca&&Fa(Pa,e,i),on(t),e=ln(e,!0),on(i),Qo(Ba,e)?(i.enumerable?(Qo(t,Ea)&&t[Ea][e]&&(t[Ea][e]=!1),i=la(i,{enumerable:pn(0,!1)})):(Qo(t,Ea)||ba(t,Ea,pn(1,{})),t[Ea][e]=!0),Ra(t,e,i)):ba(t,e,i)},Ua=function(t,e){on(t);for(var i,r=function(t){var e=Qn(t),i=$n.f;if(i)for(var r,o=i(t),n=ta.f,a=0;o.length>a;)n.call(t,r=o[a++])&&e.push(r);return e}(e=Ln(e)),o=0,n=r.length;n>o;)Fa(t,i=r[o++],e[i]);return t},Na=function(t){var e=ka.call(this,t=ln(t,!0));return !(this===Ca&&Qo(Ba,t)&&!Qo(Pa,t))&&(!(e||!Qo(this,t)||!Qo(Ba,t)||Qo(this,Ea)&&this[Ea][t])||e)},ja=function(t,e){if(t=Ln(t),e=ln(e,!0),t!==Ca||!Qo(Ba,e)||Qo(Pa,e)){var i=ya(t,e);return !i||!Qo(Ba,e)||Qo(t,Ea)&&t[Ea][e]||(i.enumerable=!0),i}},Va=function(t){for(var e,i=wa(Ln(t)),r=[],o=0;i.length>o;)Qo(Ba,e=i[o++])||e==Ea||e==va||r.push(e);return r},qa=function(t){for(var e,i=t===Ca,r=wa(i?Pa:Ln(t)),o=[],n=0;r.length>n;)!Qo(Ba,e=r[n++])||i&&!Qo(Ca,e)||o.push(Ba[e]);return o};za||(yn((xa=function(){if(this instanceof xa)throw TypeError("Symbol is not a constructor!");var t=mn(arguments.length>0?arguments[0]:void 0),e=function(i){this===Ca&&e.call(Pa,i),Qo(this,Ea)&&Qo(this[Ea],t)&&(this[Ea][t]=!1),Ra(this,t,pn(1,i));};return tn&&Ma&&Ra(Ca,t,{configurable:!0,set:e}),La(t)}).prototype,"toString",(function(){return this._k})),ga.f=ja,hn.f=Fa,ha.f=_a.f=Va,ta.f=Na,$n.f=qa,tn&&yn(Ca,"propertyIsEnumerable",Na,!0),Bn.f=function(t){return La(En(t))}),Tn(Tn.G+Tn.W+Tn.F*!za,{Symbol:xa});for(var Za="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),Ga=0;Za.length>Ga;)En(Za[Ga++]);for(var Ha=Qn(En.store),Wa=0;Ha.length>Wa;)Cn(Ha[Wa++]);Tn(Tn.S+Tn.F*!za,"Symbol",{for:function(t){return Qo(Ia,t+="")?Ia[t]:Ia[t]=xa(t)},keyFor:function(t){if(!Oa(t))throw TypeError(t+" is not a symbol!");for(var e in Ia)if(Ia[e]===t)return e},useSetter:function(){Ma=!0;},useSimple:function(){Ma=!1;}}),Tn(Tn.S+Tn.F*!za,"Object",{create:function(t,e){return void 0===e?la(t):Ua(la(t),e)},defineProperty:Fa,defineProperties:Ua,getOwnPropertyDescriptor:ja,getOwnPropertyNames:Va,getOwnPropertySymbols:qa});var Xa=$o((function(){$n.f(1);}));Tn(Tn.S+Tn.F*Xa,"Object",{getOwnPropertySymbols:function(t){return $n.f(ia(t))}}),Ta&&Tn(Tn.S+Tn.F*(!za||$o((function(){var t=xa();return "[null]"!=Sa([t])||"{}"!=Sa({a:t})||"{}"!=Sa(Object(t))}))),"JSON",{stringify:function(t){for(var e,i,r=arguments,o=[t],n=1;arguments.length>n;)o.push(r[n++]);if(i=e=o[1],(rn(e)||void 0!==t)&&!Oa(t))return ea(e)||(e=function(t,e){if("function"==typeof i&&(e=i.call(this,t,e)),!Oa(e))return e}),o[1]=e,Sa.apply(Ta,o)}}),xa.prototype[Aa]||fn(xa.prototype,Aa,xa.prototype.valueOf),In(xa,"Symbol"),In(Math,"Math",!0),In(Yo.JSON,"JSON",!0),Tn(Tn.S,"Object",{create:la}),Tn(Tn.S+Tn.F*!tn,"Object",{defineProperty:hn.f}),Tn(Tn.S+Tn.F*!tn,"Object",{defineProperties:ra});var Ka=function(t,e){var i=(en.Object||{})[t]||Object[t],r={};r[t]=e(i),Tn(Tn.S+Tn.F*$o((function(){i(1);})),"Object",r);},Ya=ga.f;Ka("getOwnPropertyDescriptor",(function(){return function(t,e){return Ya(Ln(t),e)}}));var Ja=Wn("IE_PROTO"),Qa=Object.prototype,$a=Object.getPrototypeOf||function(t){return t=ia(t),Qo(t,Ja)?t[Ja]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?Qa:null};Ka("getPrototypeOf",(function(){return function(t){return $a(ia(t))}})),Ka("keys",(function(){return function(t){return Qn(ia(t))}})),Ka("getOwnPropertyNames",(function(){return _a.f}));var ts=Sn.onFreeze;Ka("freeze",(function(t){return function(e){return t&&rn(e)?t(ts(e)):e}}));var es=Sn.onFreeze;Ka("seal",(function(t){return function(e){return t&&rn(e)?t(es(e)):e}}));var is=Sn.onFreeze;Ka("preventExtensions",(function(t){return function(e){return t&&rn(e)?t(is(e)):e}})),Ka("isFrozen",(function(t){return function(e){return !rn(e)||!!t&&t(e)}})),Ka("isSealed",(function(t){return function(e){return !rn(e)||!!t&&t(e)}})),Ka("isExtensible",(function(t){return function(e){return !!rn(e)&&(!t||t(e))}}));var rs=Object.assign,os=!rs||$o((function(){var t={},e={},i=Symbol(),r="abcdefghijklmnopqrst";return t[i]=7,r.split("").forEach((function(t){e[t]=t;})),7!=rs({},t)[i]||Object.keys(rs({},e)).join("")!=r}))?function(t,e){for(var i=arguments,r=ia(t),o=arguments.length,n=1,a=$n.f,s=ta.f;o>n;)for(var c,l=Mn(i[n++]),u=a?Qn(l).concat(a(l)):Qn(l),h=u.length,p=0;h>p;)c=u[p++],tn&&!s.call(l,c)||(r[c]=l[c]);return r}:rs;Tn(Tn.S+Tn.F,"Object",{assign:os});var ns=Object.is||function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e};Tn(Tn.S,"Object",{is:ns});var as=function(t,e){if(on(t),!rn(e)&&null!==e)throw TypeError(e+": can't set as prototype!")},ss={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,i){try{(i=wn(Function.call,ga.f(Object.prototype,"__proto__").set,2))(t,[]),e=!(t instanceof Array);}catch(t){e=!0;}return function(t,r){return as(t,r),e?t.__proto__=r:i(t,r),t}}({},!1):void 0),check:as};Tn(Tn.S,"Object",{setPrototypeOf:ss.set});var cs=En("toStringTag"),ls="Arguments"==Dn(function(){return arguments}()),us=function(t){var e,i,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(i=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),cs))?i:ls?Dn(e):"Object"==(r=Dn(e))&&"function"==typeof e.callee?"Arguments":r},hs={};hs[En("toStringTag")]="z",hs+""!="[object z]"&&yn(Object.prototype,"toString",(function(){return "[object "+us(this)+"]"}),!0);var ps=function(t,e,i){var r=void 0===i;switch(e.length){case 0:return r?t():t.call(i);case 1:return r?t(e[0]):t.call(i,e[0]);case 2:return r?t(e[0],e[1]):t.call(i,e[0],e[1]);case 3:return r?t(e[0],e[1],e[2]):t.call(i,e[0],e[1],e[2]);case 4:return r?t(e[0],e[1],e[2],e[3]):t.call(i,e[0],e[1],e[2],e[3])}return t.apply(i,e)},fs=[].slice,ds={},_s=function(t,e,i){if(!(e in ds)){for(var r=[],o=0;o<e;o++)r[o]="a["+o+"]";ds[e]=Function("F,a","return new F("+r.join(",")+")");}return ds[e](t,i)},ms=Function.bind||function(t){var e=bn(this),i=fs.call(arguments,1),r=function(){var o=i.concat(fs.call(arguments));return this instanceof r?_s(e,o.length,o):ps(e,o,t)};return rn(e.prototype)&&(r.prototype=e.prototype),r};Tn(Tn.P,"Function",{bind:ms});var gs=Function.prototype,vs=/^\s*function ([^ (]*)/;"name"in gs||tn&&(0,hn.f)(gs,"name",{configurable:!0,get:function(){try{return (""+this).match(vs)[1]}catch(t){return ""}}});var ys=En("hasInstance"),bs=Function.prototype;ys in bs||hn.f(bs,ys,{value:function(t){if("function"!=typeof this||!rn(t))return !1;if(!rn(this.prototype))return t instanceof this;for(;t=$a(t);)if(this.prototype===t)return !0;return !1}});var ws="\t\n\v\f\r    \u2028\u2029\ufeff",xs="["+ws+"]",Ts=RegExp("^"+xs+xs+"*"),Ss=RegExp(xs+xs+"*$"),Es=function(t,e,i){var r={},o=$o((function(){return !!ws[t]()||"…"!="…"[t]()})),n=r[t]=o?e(As):ws[t];i&&(r[i]=n),Tn(Tn.P+Tn.F*o,"String",r);},As=Es.trim=function(t,e){return t=String(Rn(t)),1&e&&(t=t.replace(Ts,"")),2&e&&(t=t.replace(Ss,"")),t},ks=Es,Is=Yo.parseInt,Bs=ks.trim,Ps=/^[-+]?0[xX]/,Cs=8!==Is(ws+"08")||22!==Is(ws+"0x16")?function(t,e){var i=Bs(String(t),3);return Is(i,e>>>0||(Ps.test(i)?16:10))}:Is;Tn(Tn.G+Tn.F*(parseInt!=Cs),{parseInt:Cs});var zs=Yo.parseFloat,Ds=ks.trim,Ms=1/zs(ws+"-0")!=-1/0?function(t){var e=Ds(String(t),3),i=zs(e);return 0===i&&"-"==e.charAt(0)?-0:i}:zs;Tn(Tn.G+Tn.F*(parseFloat!=Ms),{parseFloat:Ms});var Rs=ss.set,Ls=function(t,e,i){var r,o=e.constructor;return o!==i&&"function"==typeof o&&(r=o.prototype)!==i.prototype&&rn(r)&&Rs&&Rs(t,r),t},Os=ha.f,Fs=ga.f,Us=hn.f,Ns=ks.trim,js=Yo.Number,Vs=js,qs=js.prototype,Zs="Number"==Dn(la(qs)),Gs="trim"in String.prototype,Hs=function(t){var e=ln(t,!1);if("string"==typeof e&&e.length>2){var i,r,o,n=(e=Gs?e.trim():Ns(e,3)).charCodeAt(0);if(43===n||45===n){if(88===(i=e.charCodeAt(2))||120===i)return NaN}else if(48===n){switch(e.charCodeAt(1)){case 66:case 98:r=2,o=49;break;case 79:case 111:r=8,o=55;break;default:return +e}for(var a,s=e.slice(2),c=0,l=s.length;c<l;c++)if((a=s.charCodeAt(c))<48||a>o)return NaN;return parseInt(s,r)}}return +e};if(!js(" 0o1")||!js("0b1")||js("+0x1")){js=function(t){var e=arguments.length<1?0:t,i=this;return i instanceof js&&(Zs?$o((function(){qs.valueOf.call(i);})):"Number"!=Dn(i))?Ls(new Vs(Hs(e)),i,js):Hs(e)};for(var Ws,Xs=tn?Os(Vs):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),Ks=0;Xs.length>Ks;Ks++)Qo(Vs,Ws=Xs[Ks])&&!Qo(js,Ws)&&Us(js,Ws,Fs(Vs,Ws));js.prototype=qs,qs.constructor=js,yn(Yo,"Number",js);}var Ys=function(t,e){if("number"!=typeof t&&"Number"!=Dn(t))throw TypeError(e);return +t},Js=function(t){var e=String(Rn(this)),i="",r=Un(t);if(r<0||r==1/0)throw RangeError("Count can't be negative");for(;r>0;(r>>>=1)&&(e+=e))1&r&&(i+=e);return i},Qs=1..toFixed,$s=Math.floor,tc=[0,0,0,0,0,0],ec="Number.toFixed: incorrect invocation!",ic=function(t,e){for(var i=-1,r=e;++i<6;)tc[i]=(r+=t*tc[i])%1e7,r=$s(r/1e7);},rc=function(t){for(var e=6,i=0;--e>=0;)tc[e]=$s((i+=tc[e])/t),i=i%t*1e7;},oc=function(){for(var t=6,e="";--t>=0;)if(""!==e||0===t||0!==tc[t]){var i=String(tc[t]);e=""===e?i:e+Js.call("0",7-i.length)+i;}return e},nc=function(t,e,i){return 0===e?i:e%2==1?nc(t,e-1,i*t):nc(t*t,e/2,i)};Tn(Tn.P+Tn.F*(!!Qs&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!$o((function(){Qs.call({});}))),"Number",{toFixed:function(t){var e,i,r,o,n=Ys(this,ec),a=Un(t),s="",c="0";if(a<0||a>20)throw RangeError(ec);if(n!=n)return "NaN";if(n<=-1e21||n>=1e21)return String(n);if(n<0&&(s="-",n=-n),n>1e-21)if(i=(e=function(t){for(var e=0,i=t;i>=4096;)e+=12,i/=4096;for(;i>=2;)e+=1,i/=2;return e}(n*nc(2,69,1))-69)<0?n*nc(2,-e,1):n/nc(2,e,1),i*=4503599627370496,(e=52-e)>0){for(ic(0,i),r=a;r>=7;)ic(1e7,0),r-=7;for(ic(nc(10,r,1),0),r=e-1;r>=23;)rc(1<<23),r-=23;rc(1<<r),ic(1,1),rc(2),c=oc();}else ic(0,i),ic(1<<-e,0),c=oc()+Js.call("0",a);return a>0?s+((o=c.length)<=a?"0."+Js.call("0",a-o)+c:c.slice(0,o-a)+"."+c.slice(o-a)):s+c}});var ac=1..toPrecision;Tn(Tn.P+Tn.F*($o((function(){return "1"!==ac.call(1,void 0)}))||!$o((function(){ac.call({});}))),"Number",{toPrecision:function(t){var e=Ys(this,"Number#toPrecision: incorrect invocation!");return void 0===t?ac.call(e):ac.call(e,t)}}),Tn(Tn.S,"Number",{EPSILON:Math.pow(2,-52)});var sc=Yo.isFinite;Tn(Tn.S,"Number",{isFinite:function(t){return "number"==typeof t&&sc(t)}});var cc=Math.floor,lc=function(t){return !rn(t)&&isFinite(t)&&cc(t)===t};Tn(Tn.S,"Number",{isInteger:lc}),Tn(Tn.S,"Number",{isNaN:function(t){return t!=t}});var uc=Math.abs;Tn(Tn.S,"Number",{isSafeInteger:function(t){return lc(t)&&uc(t)<=9007199254740991}}),Tn(Tn.S,"Number",{MAX_SAFE_INTEGER:9007199254740991}),Tn(Tn.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991}),Tn(Tn.S+Tn.F*(Number.parseFloat!=Ms),"Number",{parseFloat:Ms}),Tn(Tn.S+Tn.F*(Number.parseInt!=Cs),"Number",{parseInt:Cs});var hc=Math.log1p||function(t){return (t=+t)>-1e-8&&t<1e-8?t-t*t/2:Math.log(1+t)},pc=Math.sqrt,fc=Math.acosh;Tn(Tn.S+Tn.F*!(fc&&710==Math.floor(fc(Number.MAX_VALUE))&&fc(1/0)==1/0),"Math",{acosh:function(t){return (t=+t)<1?NaN:t>94906265.62425156?Math.log(t)+Math.LN2:hc(t-1+pc(t-1)*pc(t+1))}});var dc=Math.asinh;Tn(Tn.S+Tn.F*!(dc&&1/dc(0)>0),"Math",{asinh:function t(e){return isFinite(e=+e)&&0!=e?e<0?-t(-e):Math.log(e+Math.sqrt(e*e+1)):e}});var _c=Math.atanh;Tn(Tn.S+Tn.F*!(_c&&1/_c(-0)<0),"Math",{atanh:function(t){return 0==(t=+t)?t:Math.log((1+t)/(1-t))/2}});var mc=Math.sign||function(t){return 0==(t=+t)||t!=t?t:t<0?-1:1};Tn(Tn.S,"Math",{cbrt:function(t){return mc(t=+t)*Math.pow(Math.abs(t),1/3)}}),Tn(Tn.S,"Math",{clz32:function(t){return (t>>>=0)?31-Math.floor(Math.log(t+.5)*Math.LOG2E):32}});var gc=Math.exp;Tn(Tn.S,"Math",{cosh:function(t){return (gc(t=+t)+gc(-t))/2}});var vc=Math.expm1,yc=!vc||vc(10)>22025.465794806718||vc(10)<22025.465794806718||-2e-17!=vc(-2e-17)?function(t){return 0==(t=+t)?t:t>-1e-6&&t<1e-6?t+t*t/2:Math.exp(t)-1}:vc;Tn(Tn.S+Tn.F*(yc!=Math.expm1),"Math",{expm1:yc});var bc=Math.pow,wc=bc(2,-52),xc=bc(2,-23),Tc=bc(2,127)*(2-xc),Sc=bc(2,-126),Ec=Math.fround||function(t){var e,i,r=Math.abs(t),o=mc(t);return r<Sc?o*(r/Sc/xc+1/wc-1/wc)*Sc*xc:(i=(e=(1+xc/wc)*r)-(e-r))>Tc||i!=i?o*(1/0):o*i};Tn(Tn.S,"Math",{fround:Ec});var Ac=Math.abs;Tn(Tn.S,"Math",{hypot:function(t,e){for(var i,r,o=arguments,n=0,a=0,s=arguments.length,c=0;a<s;)c<(i=Ac(o[a++]))?(n=n*(r=c/i)*r+1,c=i):n+=i>0?(r=i/c)*r:i;return c===1/0?1/0:c*Math.sqrt(n)}});var kc=Math.imul;Tn(Tn.S+Tn.F*$o((function(){return -5!=kc(4294967295,5)||2!=kc.length})),"Math",{imul:function(t,e){var i=+t,r=+e,o=65535&i,n=65535&r;return 0|o*n+((65535&i>>>16)*n+o*(65535&r>>>16)<<16>>>0)}}),Tn(Tn.S,"Math",{log10:function(t){return Math.log(t)*Math.LOG10E}}),Tn(Tn.S,"Math",{log1p:hc}),Tn(Tn.S,"Math",{log2:function(t){return Math.log(t)/Math.LN2}}),Tn(Tn.S,"Math",{sign:mc});var Ic=Math.exp;Tn(Tn.S+Tn.F*$o((function(){return -2e-17!=!Math.sinh(-2e-17)})),"Math",{sinh:function(t){return Math.abs(t=+t)<1?(yc(t)-yc(-t))/2:(Ic(t-1)-Ic(-t-1))*(Math.E/2)}});var Bc=Math.exp;Tn(Tn.S,"Math",{tanh:function(t){var e=yc(t=+t),i=yc(-t);return e==1/0?1:i==1/0?-1:(e-i)/(Bc(t)+Bc(-t))}}),Tn(Tn.S,"Math",{trunc:function(t){return (t>0?Math.floor:Math.ceil)(t)}});var Pc=String.fromCharCode,Cc=String.fromCodePoint;Tn(Tn.S+Tn.F*(!!Cc&&1!=Cc.length),"String",{fromCodePoint:function(t){for(var e,i=arguments,r=[],o=arguments.length,n=0;o>n;){if(e=+i[n++],Zn(e,1114111)!==e)throw RangeError(e+" is not a valid code point");r.push(e<65536?Pc(e):Pc(55296+((e-=65536)>>10),e%1024+56320));}return r.join("")}}),Tn(Tn.S,"String",{raw:function(t){for(var e=arguments,i=Ln(t.raw),r=jn(i.length),o=arguments.length,n=[],a=0;r>a;)n.push(String(i[a++])),a<o&&n.push(String(e[a]));return n.join("")}}),ks("trim",(function(t){return function(){return t(this,3)}}));var zc=function(t){return function(e,i){var r,o,n=String(Rn(e)),a=Un(i),s=n.length;return a<0||a>=s?t?"":void 0:(r=n.charCodeAt(a))<55296||r>56319||a+1===s||(o=n.charCodeAt(a+1))<56320||o>57343?t?n.charAt(a):r:t?n.slice(a,a+2):o-56320+(r-55296<<10)+65536}},Dc={},Mc={};fn(Mc,En("iterator"),(function(){return this}));var Rc=function(t,e,i){t.prototype=la(Mc,{next:pn(1,i)}),In(t,e+" Iterator");},Lc=En("iterator"),Oc=!([].keys&&"next"in[].keys()),Fc=function(){return this},Uc=function(t,e,i,r,o,n,a){Rc(i,e,r);var s,c,l,u=function(t){if(!Oc&&t in d)return d[t];switch(t){case"keys":case"values":return function(){return new i(this,t)}}return function(){return new i(this,t)}},h=e+" Iterator",p="values"==o,f=!1,d=t.prototype,_=d[Lc]||d["@@iterator"]||o&&d[o],m=_||u(o),g=o?p?u("entries"):m:void 0,v="Array"==e&&d.entries||_;if(v&&(l=$a(v.call(new t)))!==Object.prototype&&l.next&&(In(l,h,!0),"function"!=typeof l[Lc]&&fn(l,Lc,Fc)),p&&_&&"values"!==_.name&&(f=!0,m=function(){return _.call(this)}),(Oc||f||!d[Lc])&&fn(d,Lc,m),Dc[e]=m,Dc[h]=Fc,o)if(s={values:p?m:u("values"),keys:n?m:u("keys"),entries:g},a)for(c in s)c in d||yn(d,c,s[c]);else Tn(Tn.P+Tn.F*(Oc||f),e,s);return s},Nc=zc(!0);Uc(String,"String",(function(t){this._t=String(t),this._i=0;}),(function(){var t,e=this._t,i=this._i;return i>=e.length?{value:void 0,done:!0}:(t=Nc(e,i),this._i+=t.length,{value:t,done:!1})}));var jc=zc(!1);Tn(Tn.P,"String",{codePointAt:function(t){return jc(this,t)}});var Vc=En("match"),qc=function(t){var e;return rn(t)&&(void 0!==(e=t[Vc])?!!e:"RegExp"==Dn(t))},Zc=function(t,e,i){if(qc(e))throw TypeError("String#"+i+" doesn't accept regex!");return String(Rn(t))},Gc=En("match"),Hc=function(t){var e=/./;try{"/./"[t](e);}catch(i){try{return e[Gc]=!1,!"/./"[t](e)}catch(t){}}return !0},Wc="".endsWith;Tn(Tn.P+Tn.F*Hc("endsWith"),"String",{endsWith:function(t){var e=Zc(this,t,"endsWith"),i=arguments.length>1?arguments[1]:void 0,r=jn(e.length),o=void 0===i?r:Math.min(jn(i),r),n=String(t);return Wc?Wc.call(e,n,o):e.slice(o-n.length,o)===n}}),Tn(Tn.P+Tn.F*Hc("includes"),"String",{includes:function(t){return !!~Zc(this,t,"includes").indexOf(t,arguments.length>1?arguments[1]:void 0)}}),Tn(Tn.P,"String",{repeat:Js});var Xc="".startsWith;Tn(Tn.P+Tn.F*Hc("startsWith"),"String",{startsWith:function(t){var e=Zc(this,t,"startsWith"),i=jn(Math.min(arguments.length>1?arguments[1]:void 0,e.length)),r=String(t);return Xc?Xc.call(e,r,i):e.slice(i,i+r.length)===r}});var Kc=/"/g,Yc=function(t,e,i,r){var o=String(Rn(t)),n="<"+e;return ""!==i&&(n+=" "+i+'="'+String(r).replace(Kc,"&quot;")+'"'),n+">"+o+"</"+e+">"},Jc=function(t,e){var i={};i[t]=e(Yc),Tn(Tn.P+Tn.F*$o((function(){var e=""[t]('"');return e!==e.toLowerCase()||e.split('"').length>3})),"String",i);};Jc("anchor",(function(t){return function(e){return t(this,"a","name",e)}})),Jc("big",(function(t){return function(){return t(this,"big","","")}})),Jc("blink",(function(t){return function(){return t(this,"blink","","")}})),Jc("bold",(function(t){return function(){return t(this,"b","","")}})),Jc("fixed",(function(t){return function(){return t(this,"tt","","")}})),Jc("fontcolor",(function(t){return function(e){return t(this,"font","color",e)}})),Jc("fontsize",(function(t){return function(e){return t(this,"font","size",e)}})),Jc("italics",(function(t){return function(){return t(this,"i","","")}})),Jc("link",(function(t){return function(e){return t(this,"a","href",e)}})),Jc("small",(function(t){return function(){return t(this,"small","","")}})),Jc("strike",(function(t){return function(){return t(this,"strike","","")}})),Jc("sub",(function(t){return function(){return t(this,"sub","","")}})),Jc("sup",(function(t){return function(){return t(this,"sup","","")}})),Tn(Tn.S,"Date",{now:function(){return (new Date).getTime()}}),Tn(Tn.P+Tn.F*$o((function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})})),"Date",{toJSON:function(t){var e=ia(this),i=ln(e);return "number"!=typeof i||isFinite(i)?e.toISOString():null}});var Qc=Date.prototype.getTime,$c=Date.prototype.toISOString,tl=function(t){return t>9?t:"0"+t},el=$o((function(){return "0385-07-25T07:06:39.999Z"!=$c.call(new Date(-50000000000001))}))||!$o((function(){$c.call(new Date(NaN));}))?function(){if(!isFinite(Qc.call(this)))throw RangeError("Invalid time value");var t=this,e=t.getUTCFullYear(),i=t.getUTCMilliseconds(),r=e<0?"-":e>9999?"+":"";return r+("00000"+Math.abs(e)).slice(r?-6:-4)+"-"+tl(t.getUTCMonth()+1)+"-"+tl(t.getUTCDate())+"T"+tl(t.getUTCHours())+":"+tl(t.getUTCMinutes())+":"+tl(t.getUTCSeconds())+"."+(i>99?i:"0"+tl(i))+"Z"}:$c;Tn(Tn.P+Tn.F*(Date.prototype.toISOString!==el),"Date",{toISOString:el});var il=Date.prototype,rl=il.toString,ol=il.getTime;new Date(NaN)+""!="Invalid Date"&&yn(il,"toString",(function(){var t=ol.call(this);return t==t?rl.call(this):"Invalid Date"}));var nl=En("toPrimitive"),al=Date.prototype;nl in al||fn(al,nl,(function(t){if("string"!==t&&"number"!==t&&"default"!==t)throw TypeError("Incorrect hint");return ln(on(this),"number"!=t)})),Tn(Tn.S,"Array",{isArray:ea});var sl=function(t,e,i,r){try{return r?e(on(i)[0],i[1]):e(i)}catch(e){var o=t.return;throw void 0!==o&&on(o.call(t)),e}},cl=En("iterator"),ll=Array.prototype,ul=function(t){return void 0!==t&&(Dc.Array===t||ll[cl]===t)},hl=function(t,e,i){e in t?hn.f(t,e,pn(0,i)):t[e]=i;},pl=En("iterator"),fl=en.getIteratorMethod=function(t){if(null!=t)return t[pl]||t["@@iterator"]||Dc[us(t)]},dl=En("iterator"),_l=!1;try{var ml=[7][dl]();ml.return=function(){_l=!0;},Array.from(ml,(function(){throw 2}));}catch(t){}var gl=function(t,e){if(!e&&!_l)return !1;var i=!1;try{var r=[7],o=r[dl]();o.next=function(){return {done:i=!0}},r[dl]=function(){return o},t(r);}catch(t){}return i};Tn(Tn.S+Tn.F*!gl((function(t){Array.from(t);})),"Array",{from:function(t){var e,i,r,o,n=ia(t),a="function"==typeof this?this:Array,s=arguments.length,c=s>1?arguments[1]:void 0,l=void 0!==c,u=0,h=fl(n);if(l&&(c=wn(c,s>2?arguments[2]:void 0,2)),null==h||a==Array&&ul(h))for(i=new a(e=jn(n.length));e>u;u++)hl(i,u,l?c(n[u],u):n[u]);else for(o=h.call(n),i=new a;!(r=o.next()).done;u++)hl(i,u,l?sl(o,c,[r.value,u],!0):r.value);return i.length=u,i}}),Tn(Tn.S+Tn.F*$o((function(){function t(){}return !(Array.of.call(t)instanceof t)})),"Array",{of:function(){for(var t=arguments,e=0,i=arguments.length,r=new("function"==typeof this?this:Array)(i);i>e;)hl(r,e,t[e++]);return r.length=i,r}});var vl=function(t,e){return !!t&&$o((function(){e?t.call(null,(function(){}),1):t.call(null);}))},yl=[].join;Tn(Tn.P+Tn.F*(Mn!=Object||!vl(yl)),"Array",{join:function(t){return yl.call(Ln(this),void 0===t?",":t)}});var bl=[].slice;Tn(Tn.P+Tn.F*$o((function(){na&&bl.call(na);})),"Array",{slice:function(t,e){var i=jn(this.length),r=Dn(this);if(e=void 0===e?i:e,"Array"==r)return bl.call(this,t,e);for(var o=Zn(t,i),n=Zn(e,i),a=jn(n-o),s=new Array(a),c=0;c<a;c++)s[c]="String"==r?this.charAt(o+c):this[o+c];return s}});var wl=[].sort,xl=[1,2,3];Tn(Tn.P+Tn.F*($o((function(){xl.sort(void 0);}))||!$o((function(){xl.sort(null);}))||!vl(wl)),"Array",{sort:function(t){return void 0===t?wl.call(ia(this)):wl.call(ia(this),bn(t))}});var Tl=En("species"),Sl=function(t,e){return new(function(t){var e;return ea(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!ea(e.prototype)||(e=void 0),rn(e)&&null===(e=e[Tl])&&(e=void 0)),void 0===e?Array:e}(t))(e)},El=function(t,e){var i=1==t,r=2==t,o=3==t,n=4==t,a=6==t,s=5==t||a,c=e||Sl;return function(e,l,u){for(var h,p,f=ia(e),d=Mn(f),_=wn(l,u,3),m=jn(d.length),g=0,v=i?c(e,m):r?c(e,0):void 0;m>g;g++)if((s||g in d)&&(p=_(h=d[g],g,f),t))if(i)v[g]=p;else if(p)switch(t){case 3:return !0;case 5:return h;case 6:return g;case 2:v.push(h);}else if(n)return !1;return a?-1:o||n?n:v}},Al=El(0),kl=vl([].forEach,!0);Tn(Tn.P+Tn.F*!kl,"Array",{forEach:function(t){return Al(this,t,arguments[1])}});var Il=El(1);Tn(Tn.P+Tn.F*!vl([].map,!0),"Array",{map:function(t){return Il(this,t,arguments[1])}});var Bl=El(2);Tn(Tn.P+Tn.F*!vl([].filter,!0),"Array",{filter:function(t){return Bl(this,t,arguments[1])}});var Pl=El(3);Tn(Tn.P+Tn.F*!vl([].some,!0),"Array",{some:function(t){return Pl(this,t,arguments[1])}});var Cl=El(4);Tn(Tn.P+Tn.F*!vl([].every,!0),"Array",{every:function(t){return Cl(this,t,arguments[1])}});var zl=function(t,e,i,r,o){bn(e);var n=ia(t),a=Mn(n),s=jn(n.length),c=o?s-1:0,l=o?-1:1;if(i<2)for(;;){if(c in a){r=a[c],c+=l;break}if(c+=l,o?c<0:s<=c)throw TypeError("Reduce of empty array with no initial value")}for(;o?c>=0:s>c;c+=l)c in a&&(r=e(r,a[c],c,n));return r};Tn(Tn.P+Tn.F*!vl([].reduce,!0),"Array",{reduce:function(t){return zl(this,t,arguments.length,arguments[1],!1)}}),Tn(Tn.P+Tn.F*!vl([].reduceRight,!0),"Array",{reduceRight:function(t){return zl(this,t,arguments.length,arguments[1],!0)}});var Dl=Gn(!1),Ml=[].indexOf,Rl=!!Ml&&1/[1].indexOf(1,-0)<0;Tn(Tn.P+Tn.F*(Rl||!vl(Ml)),"Array",{indexOf:function(t){return Rl?Ml.apply(this,arguments)||0:Dl(this,t,arguments[1])}});var Ll=[].lastIndexOf,Ol=!!Ll&&1/[1].lastIndexOf(1,-0)<0;Tn(Tn.P+Tn.F*(Ol||!vl(Ll)),"Array",{lastIndexOf:function(t){if(Ol)return Ll.apply(this,arguments)||0;var e=Ln(this),i=jn(e.length),r=i-1;for(arguments.length>1&&(r=Math.min(r,Un(arguments[1]))),r<0&&(r=i+r);r>=0;r--)if(r in e&&e[r]===t)return r||0;return -1}});var Fl=[].copyWithin||function(t,e){var i=ia(this),r=jn(i.length),o=Zn(t,r),n=Zn(e,r),a=arguments.length>2?arguments[2]:void 0,s=Math.min((void 0===a?r:Zn(a,r))-n,r-o),c=1;for(n<o&&o<n+s&&(c=-1,n+=s-1,o+=s-1);s-- >0;)n in i?i[o]=i[n]:delete i[o],o+=c,n+=c;return i},Ul=En("unscopables"),Nl=Array.prototype;null==Nl[Ul]&&fn(Nl,Ul,{});var jl=function(t){Nl[Ul][t]=!0;};Tn(Tn.P,"Array",{copyWithin:Fl}),jl("copyWithin");var Vl=function(t){for(var e=ia(this),i=jn(e.length),r=arguments.length,o=Zn(r>1?arguments[1]:void 0,i),n=r>2?arguments[2]:void 0,a=void 0===n?i:Zn(n,i);a>o;)e[o++]=t;return e};Tn(Tn.P,"Array",{fill:Vl}),jl("fill");var ql=El(5),Zl=!0;"find"in[]&&Array(1).find((function(){Zl=!1;})),Tn(Tn.P+Tn.F*Zl,"Array",{find:function(t){return ql(this,t,arguments.length>1?arguments[1]:void 0)}}),jl("find");var Gl=El(6),Hl=!0;"findIndex"in[]&&Array(1).findIndex((function(){Hl=!1;})),Tn(Tn.P+Tn.F*Hl,"Array",{findIndex:function(t){return Gl(this,t,arguments.length>1?arguments[1]:void 0)}}),jl("findIndex");var Wl=En("species"),Xl=function(t){var e=Yo[t];tn&&e&&!e[Wl]&&hn.f(e,Wl,{configurable:!0,get:function(){return this}});};Xl("Array");var Kl=function(t,e){return {value:e,done:!!t}},Yl=Uc(Array,"Array",(function(t,e){this._t=Ln(t),this._i=0,this._k=e;}),(function(){var t=this._t,e=this._k,i=this._i++;return !t||i>=t.length?(this._t=void 0,Kl(1)):Kl(0,"keys"==e?i:"values"==e?t[i]:[i,t[i]])}),"values");Dc.Arguments=Dc.Array,jl("keys"),jl("values"),jl("entries");var Jl=function(){var t=on(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e},Ql=hn.f,$l=ha.f,tu=Yo.RegExp,eu=tu,iu=tu.prototype,ru=/a/g,ou=/a/g,nu=new tu(ru)!==ru;if(tn&&(!nu||$o((function(){return ou[En("match")]=!1,tu(ru)!=ru||tu(ou)==ou||"/a/i"!=tu(ru,"i")})))){tu=function(t,e){var i=this instanceof tu,r=qc(t),o=void 0===e;return !i&&r&&t.constructor===tu&&o?t:Ls(nu?new eu(r&&!o?t.source:t,e):eu((r=t instanceof tu)?t.source:t,r&&o?Jl.call(t):e),i?this:iu,tu)};for(var au=function(t){t in tu||Ql(tu,t,{configurable:!0,get:function(){return eu[t]},set:function(e){eu[t]=e;}});},su=$l(eu),cu=0;su.length>cu;)au(su[cu++]);iu.constructor=tu,tu.prototype=iu,yn(Yo,"RegExp",tu);}Xl("RegExp");var lu=RegExp.prototype.exec,uu=String.prototype.replace,hu=lu,pu=function(){var t=/a/,e=/b*/g;return lu.call(t,"a"),lu.call(e,"a"),0!==t.lastIndex||0!==e.lastIndex}(),fu=void 0!==/()??/.exec("")[1];(pu||fu)&&(hu=function(t){var e,i,r,o,n=this;return fu&&(i=new RegExp("^"+n.source+"$(?!\\s)",Jl.call(n))),pu&&(e=n.lastIndex),r=lu.call(n,t),pu&&r&&(n.lastIndex=n.global?r.index+r[0].length:e),fu&&r&&r.length>1&&uu.call(r[0],i,(function(){var t=arguments;for(o=1;o<arguments.length-2;o++)void 0===t[o]&&(r[o]=void 0);})),r});var du=hu;Tn({target:"RegExp",proto:!0,forced:du!==/./.exec},{exec:du}),tn&&"g"!=/./g.flags&&hn.f(RegExp.prototype,"flags",{configurable:!0,get:Jl});var _u=/./.toString,mu=function(t){yn(RegExp.prototype,"toString",t,!0);};$o((function(){return "/a/b"!=_u.call({source:"a",flags:"b"})}))?mu((function(){var t=on(this);return "/".concat(t.source,"/","flags"in t?t.flags:!tn&&t instanceof RegExp?Jl.call(t):void 0)})):"toString"!=_u.name&&mu((function(){return _u.call(this)}));var gu=zc(!0),vu=function(t,e,i){return e+(i?gu(t,e).length:1)},yu=RegExp.prototype.exec,bu=function(t,e){var i=t.exec;if("function"==typeof i){var r=i.call(t,e);if("object"!=typeof r)throw new TypeError("RegExp exec method returned something other than an Object or null");return r}if("RegExp"!==us(t))throw new TypeError("RegExp#exec called on incompatible receiver");return yu.call(t,e)},wu=En("species"),xu=!$o((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")})),Tu=function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var i="ab".split(t);return 2===i.length&&"a"===i[0]&&"b"===i[1]}(),Su=function(t,e,i){var r=En(t),o=!$o((function(){var e={};return e[r]=function(){return 7},7!=""[t](e)})),n=o?!$o((function(){var e=!1,i=/a/;return i.exec=function(){return e=!0,null},"split"===t&&(i.constructor={},i.constructor[wu]=function(){return i}),i[r](""),!e})):void 0;if(!o||!n||"replace"===t&&!xu||"split"===t&&!Tu){var a=/./[r],s=i(Rn,r,""[t],(function(t,e,i,r,n){return e.exec===du?o&&!n?{done:!0,value:a.call(e,i,r)}:{done:!0,value:t.call(i,e,r)}:{done:!1}})),c=s[1];yn(String.prototype,t,s[0]),fn(RegExp.prototype,r,2==e?function(t,e){return c.call(t,this,e)}:function(t){return c.call(t,this)});}};Su("match",1,(function(t,e,i,r){return [function(i){var r=t(this),o=null==i?void 0:i[e];return void 0!==o?o.call(i,r):new RegExp(i)[e](String(r))},function(t){var e=r(i,t,this);if(e.done)return e.value;var o=on(t),n=String(this);if(!o.global)return bu(o,n);var a=o.unicode;o.lastIndex=0;for(var s,c=[],l=0;null!==(s=bu(o,n));){var u=String(s[0]);c[l]=u,""===u&&(o.lastIndex=vu(n,jn(o.lastIndex),a)),l++;}return 0===l?null:c}]}));var Eu=Math.max,Au=Math.min,ku=Math.floor,Iu=/\$([$&`']|\d\d?|<[^>]*>)/g,Bu=/\$([$&`']|\d\d?)/g;Su("replace",2,(function(t,e,i,r){return [function(r,o){var n=t(this),a=null==r?void 0:r[e];return void 0!==a?a.call(r,n,o):i.call(String(n),r,o)},function(t,e){var n=r(i,t,this,e);if(n.done)return n.value;var a=on(t),s=String(this),c="function"==typeof e;c||(e=String(e));var l=a.global;if(l){var u=a.unicode;a.lastIndex=0;}for(var h=[];;){var p=bu(a,s);if(null===p)break;if(h.push(p),!l)break;""===String(p[0])&&(a.lastIndex=vu(s,jn(a.lastIndex),u));}for(var f,d="",_=0,m=0;m<h.length;m++){p=h[m];for(var g=String(p[0]),v=Eu(Au(Un(p.index),s.length),0),y=[],b=1;b<p.length;b++)y.push(void 0===(f=p[b])?f:String(f));var w=p.groups;if(c){var x=[g].concat(y,v,s);void 0!==w&&x.push(w);var T=String(e.apply(void 0,x));}else T=o(g,s,v,y,w,e);v>=_&&(d+=s.slice(_,v)+T,_=v+g.length);}return d+s.slice(_)}];function o(t,e,r,o,n,a){var s=r+t.length,c=o.length,l=Bu;return void 0!==n&&(n=ia(n),l=Iu),i.call(a,l,(function(i,a){var l;switch(a.charAt(0)){case"$":return "$";case"&":return t;case"`":return e.slice(0,r);case"'":return e.slice(s);case"<":l=n[a.slice(1,-1)];break;default:var u=+a;if(0===u)return i;if(u>c){var h=ku(u/10);return 0===h?i:h<=c?void 0===o[h-1]?a.charAt(1):o[h-1]+a.charAt(1):i}l=o[u-1];}return void 0===l?"":l}))}})),Su("search",1,(function(t,e,i,r){return [function(i){var r=t(this),o=null==i?void 0:i[e];return void 0!==o?o.call(i,r):new RegExp(i)[e](String(r))},function(t){var e=r(i,t,this);if(e.done)return e.value;var o=on(t),n=String(this),a=o.lastIndex;ns(a,0)||(o.lastIndex=0);var s=bu(o,n);return ns(o.lastIndex,a)||(o.lastIndex=a),null===s?-1:s.index}]}));var Pu=En("species"),Cu=function(t,e){var i,r=on(t).constructor;return void 0===r||null==(i=on(r)[Pu])?e:bn(i)},zu=Math.min,Du=[].push,Mu="length",Ru=!$o((function(){RegExp(4294967295,"y");}));Su("split",2,(function(t,e,i,r){var o;return o="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1)[Mu]||2!="ab".split(/(?:ab)*/)[Mu]||4!=".".split(/(.?)(.?)/)[Mu]||".".split(/()()/)[Mu]>1||"".split(/.?/)[Mu]?function(t,e){var r=String(this);if(void 0===t&&0===e)return [];if(!qc(t))return i.call(r,t,e);for(var o,n,a,s=[],c=0,l=void 0===e?4294967295:e>>>0,u=new RegExp(t.source,(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":"")+"g");(o=du.call(u,r))&&!((n=u.lastIndex)>c&&(s.push(r.slice(c,o.index)),o[Mu]>1&&o.index<r[Mu]&&Du.apply(s,o.slice(1)),a=o[0][Mu],c=n,s[Mu]>=l));)u.lastIndex===o.index&&u.lastIndex++;return c===r[Mu]?!a&&u.test("")||s.push(""):s.push(r.slice(c)),s[Mu]>l?s.slice(0,l):s}:"0".split(void 0,0)[Mu]?function(t,e){return void 0===t&&0===e?[]:i.call(this,t,e)}:i,[function(i,r){var n=t(this),a=null==i?void 0:i[e];return void 0!==a?a.call(i,n,r):o.call(String(n),i,r)},function(t,e){var n=r(o,t,this,e,o!==i);if(n.done)return n.value;var a=on(t),s=String(this),c=Cu(a,RegExp),l=a.unicode,u=new c(Ru?a:"^(?:"+a.source+")",(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.unicode?"u":"")+(Ru?"y":"g")),h=void 0===e?4294967295:e>>>0;if(0===h)return [];if(0===s.length)return null===bu(u,s)?[s]:[];for(var p=0,f=0,d=[];f<s.length;){u.lastIndex=Ru?f:0;var _,m=bu(u,Ru?s:s.slice(f));if(null===m||(_=zu(jn(u.lastIndex+(Ru?0:f)),s.length))===p)f=vu(s,f,l);else {if(d.push(s.slice(p,f)),d.length===h)return d;for(var g=1;g<=m.length-1;g++)if(d.push(m[g]),d.length===h)return d;f=p=_;}}return d.push(s.slice(p)),d}]}));var Lu,Ou,Fu,Uu=function(t,e,i,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(i+": incorrect invocation!");return t},Nu=t.createCommonjsModule((function(t){var e={},i={},r=t.exports=function(t,r,o,n,a){var s,c,l,u,h=a?function(){return t}:fl(t),p=wn(o,n,r?2:1),f=0;if("function"!=typeof h)throw TypeError(t+" is not iterable!");if(ul(h)){for(s=jn(t.length);s>f;f++)if((u=r?p(on(c=t[f])[0],c[1]):p(t[f]))===e||u===i)return u}else for(l=h.call(t);!(c=l.next()).done;)if((u=sl(l,p,c.value,r))===e||u===i)return u};r.BREAK=e,r.RETURN=i;})),ju=Yo.process,Vu=Yo.setImmediate,qu=Yo.clearImmediate,Zu=Yo.MessageChannel,Gu=Yo.Dispatch,Hu=0,Wu={},Xu=function(){var t=+this;if(Wu.hasOwnProperty(t)){var e=Wu[t];delete Wu[t],e();}},Ku=function(t){Xu.call(t.data);};Vu&&qu||(Vu=function(t){for(var e=arguments,i=[],r=1;arguments.length>r;)i.push(e[r++]);return Wu[++Hu]=function(){ps("function"==typeof t?t:Function(t),i);},Lu(Hu),Hu},qu=function(t){delete Wu[t];},"process"==Dn(ju)?Lu=function(t){ju.nextTick(wn(Xu,t,1));}:Gu&&Gu.now?Lu=function(t){Gu.now(wn(Xu,t,1));}:Zu?(Fu=(Ou=new Zu).port2,Ou.port1.onmessage=Ku,Lu=wn(Fu.postMessage,Fu,1)):Yo.addEventListener&&"function"==typeof postMessage&&!Yo.importScripts?(Lu=function(t){Yo.postMessage(t+"","*");},Yo.addEventListener("message",Ku,!1)):Lu="onreadystatechange"in sn("script")?function(t){na.appendChild(sn("script")).onreadystatechange=function(){na.removeChild(this),Xu.call(t);};}:function(t){setTimeout(wn(Xu,t,1),0);});var Yu={set:Vu,clear:qu},Ju=Yu.set,Qu=Yo.MutationObserver||Yo.WebKitMutationObserver,$u=Yo.process,th=Yo.Promise,eh="process"==Dn($u);function ih(t){var e,i;this.promise=new t((function(t,r){if(void 0!==e||void 0!==i)throw TypeError("Bad Promise constructor");e=t,i=r;})),this.resolve=bn(e),this.reject=bn(i);}var rh,oh,nh,ah,sh={f:function(t){return new ih(t)}},ch=function(t){try{return {e:!1,v:t()}}catch(t){return {e:!0,v:t}}},lh=Yo.navigator,uh=lh&&lh.userAgent||"",hh=function(t,e){if(on(t),rn(e)&&e.constructor===t)return e;var i=sh.f(t);return (0,i.resolve)(e),i.promise},ph=function(t,e,i){for(var r in e)yn(t,r,e[r],i);return t},fh=Yu.set,dh=function(){var t,e,i,r=function(){var r,o;for(eh&&(r=$u.domain)&&r.exit();t;){o=t.fn,t=t.next;try{o();}catch(r){throw t?i():e=void 0,r}}e=void 0,r&&r.enter();};if(eh)i=function(){$u.nextTick(r);};else if(!Qu||Yo.navigator&&Yo.navigator.standalone)if(th&&th.resolve){var o=th.resolve(void 0);i=function(){o.then(r);};}else i=function(){Ju.call(Yo,r);};else {var n=!0,a=document.createTextNode("");new Qu(r).observe(a,{characterData:!0}),i=function(){a.data=n=!n;};}return function(r){var o={fn:r,next:void 0};e&&(e.next=o),t||(t=o,i()),e=o;}}(),_h=Yo.TypeError,mh=Yo.process,gh=mh&&mh.versions,vh=gh&&gh.v8||"",yh=Yo.Promise,bh="process"==us(mh),wh=function(){},xh=oh=sh.f,Th=!!function(){try{var t=yh.resolve(1),e=(t.constructor={})[En("species")]=function(t){t(wh,wh);};return (bh||"function"==typeof PromiseRejectionEvent)&&t.then(wh)instanceof e&&0!==vh.indexOf("6.6")&&-1===uh.indexOf("Chrome/66")}catch(t){}}(),Sh=function(t){var e;return !(!rn(t)||"function"!=typeof(e=t.then))&&e},Eh=function(t,e){if(!t._n){t._n=!0;var i=t._c;dh((function(){for(var r=t._v,o=1==t._s,n=0,a=function(e){var i,n,a,s=o?e.ok:e.fail,c=e.resolve,l=e.reject,u=e.domain;try{s?(o||(2==t._h&&Ih(t),t._h=1),!0===s?i=r:(u&&u.enter(),i=s(r),u&&(u.exit(),a=!0)),i===e.promise?l(_h("Promise-chain cycle")):(n=Sh(i))?n.call(i,c,l):c(i)):l(r);}catch(t){u&&!a&&u.exit(),l(t);}};i.length>n;)a(i[n++]);t._c=[],t._n=!1,e&&!t._h&&Ah(t);}));}},Ah=function(t){fh.call(Yo,(function(){var e,i,r,o=t._v,n=kh(t);if(n&&(e=ch((function(){bh?mh.emit("unhandledRejection",o,t):(i=Yo.onunhandledrejection)?i({promise:t,reason:o}):(r=Yo.console)&&r.error&&r.error("Unhandled promise rejection",o);})),t._h=bh||kh(t)?2:1),t._a=void 0,n&&e.e)throw e.v}));},kh=function(t){return 1!==t._h&&0===(t._a||t._c).length},Ih=function(t){fh.call(Yo,(function(){var e;bh?mh.emit("rejectionHandled",t):(e=Yo.onrejectionhandled)&&e({promise:t,reason:t._v});}));},Bh=function(t){var e=this;e._d||(e._d=!0,(e=e._w||e)._v=t,e._s=2,e._a||(e._a=e._c.slice()),Eh(e,!0));},Ph=function(t){var e,i=this;if(!i._d){i._d=!0,i=i._w||i;try{if(i===t)throw _h("Promise can't be resolved itself");(e=Sh(t))?dh((function(){var r={_w:i,_d:!1};try{e.call(t,wn(Ph,r,1),wn(Bh,r,1));}catch(t){Bh.call(r,t);}})):(i._v=t,i._s=1,Eh(i,!1));}catch(t){Bh.call({_w:i,_d:!1},t);}}};Th||(yh=function(t){Uu(this,yh,"Promise","_h"),bn(t),rh.call(this);try{t(wn(Ph,this,1),wn(Bh,this,1));}catch(t){Bh.call(this,t);}},(rh=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1;}).prototype=ph(yh.prototype,{then:function(t,e){var i=xh(Cu(this,yh));return i.ok="function"!=typeof t||t,i.fail="function"==typeof e&&e,i.domain=bh?mh.domain:void 0,this._c.push(i),this._a&&this._a.push(i),this._s&&Eh(this,!1),i.promise},catch:function(t){return this.then(void 0,t)}}),nh=function(){var t=new rh;this.promise=t,this.resolve=wn(Ph,t,1),this.reject=wn(Bh,t,1);},sh.f=xh=function(t){return t===yh||t===ah?new nh(t):oh(t)}),Tn(Tn.G+Tn.W+Tn.F*!Th,{Promise:yh}),In(yh,"Promise"),Xl("Promise"),ah=en.Promise,Tn(Tn.S+Tn.F*!Th,"Promise",{reject:function(t){var e=xh(this);return (0,e.reject)(t),e.promise}}),Tn(Tn.S+Tn.F*!Th,"Promise",{resolve:function(t){return hh(this,t)}}),Tn(Tn.S+Tn.F*!(Th&&gl((function(t){yh.all(t).catch(wh);}))),"Promise",{all:function(t){var e=this,i=xh(e),r=i.resolve,o=i.reject,n=ch((function(){var i=[],n=0,a=1;Nu(t,!1,(function(t){var s=n++,c=!1;i.push(void 0),a++,e.resolve(t).then((function(t){c||(c=!0,i[s]=t,--a||r(i));}),o);})),--a||r(i);}));return n.e&&o(n.v),i.promise},race:function(t){var e=this,i=xh(e),r=i.reject,o=ch((function(){Nu(t,!1,(function(t){e.resolve(t).then(i.resolve,r);}));}));return o.e&&r(o.v),i.promise}});var Ch=function(t,e){if(!rn(t)||t._t!==e)throw TypeError("Incompatible receiver, "+e+" required!");return t},zh=hn.f,Dh=Sn.fastKey,Mh=tn?"_s":"size",Rh=function(t,e){var i,r=Dh(e);if("F"!==r)return t._i[r];for(i=t._f;i;i=i.n)if(i.k==e)return i},Lh={getConstructor:function(t,e,i,r){var o=t((function(t,n){Uu(t,o,e,"_i"),t._t=e,t._i=la(null),t._f=void 0,t._l=void 0,t[Mh]=0,null!=n&&Nu(n,i,t[r],t);}));return ph(o.prototype,{clear:function(){for(var t=Ch(this,e),i=t._i,r=t._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete i[r.i];t._f=t._l=void 0,t[Mh]=0;},delete:function(t){var i=Ch(this,e),r=Rh(i,t);if(r){var o=r.n,n=r.p;delete i._i[r.i],r.r=!0,n&&(n.n=o),o&&(o.p=n),i._f==r&&(i._f=o),i._l==r&&(i._l=n),i[Mh]--;}return !!r},forEach:function(t){Ch(this,e);for(var i,r=wn(t,arguments.length>1?arguments[1]:void 0,3);i=i?i.n:this._f;)for(r(i.v,i.k,this);i&&i.r;)i=i.p;},has:function(t){return !!Rh(Ch(this,e),t)}}),tn&&zh(o.prototype,"size",{get:function(){return Ch(this,e)[Mh]}}),o},def:function(t,e,i){var r,o,n=Rh(t,e);return n?n.v=i:(t._l=n={i:o=Dh(e,!0),k:e,v:i,p:r=t._l,n:void 0,r:!1},t._f||(t._f=n),r&&(r.n=n),t[Mh]++,"F"!==o&&(t._i[o]=n)),t},getEntry:Rh,setStrong:function(t,e,i){Uc(t,e,(function(t,i){this._t=Ch(t,e),this._k=i,this._l=void 0;}),(function(){for(var t=this._k,e=this._l;e&&e.r;)e=e.p;return this._t&&(this._l=e=e?e.n:this._t._f)?Kl(0,"keys"==t?e.k:"values"==t?e.v:[e.k,e.v]):(this._t=void 0,Kl(1))}),i?"entries":"values",!i,!0),Xl(e);}},Oh=function(t,e,i,r,o,n){var a=Yo[t],s=a,c=o?"set":"add",l=s&&s.prototype,u={},h=function(t){var e=l[t];yn(l,t,"delete"==t||"has"==t?function(t){return !(n&&!rn(t))&&e.call(this,0===t?0:t)}:"get"==t?function(t){return n&&!rn(t)?void 0:e.call(this,0===t?0:t)}:"add"==t?function(t){return e.call(this,0===t?0:t),this}:function(t,i){return e.call(this,0===t?0:t,i),this});};if("function"==typeof s&&(n||l.forEach&&!$o((function(){(new s).entries().next();})))){var p=new s,f=p[c](n?{}:-0,1)!=p,d=$o((function(){p.has(1);})),_=gl((function(t){new s(t);})),m=!n&&$o((function(){for(var t=new s,e=5;e--;)t[c](e,e);return !t.has(-0)}));_||((s=e((function(e,i){Uu(e,s,t);var r=Ls(new a,e,s);return null!=i&&Nu(i,o,r[c],r),r}))).prototype=l,l.constructor=s),(d||m)&&(h("delete"),h("has"),o&&h("get")),(m||f)&&h(c),n&&l.clear&&delete l.clear;}else s=r.getConstructor(e,t,o,c),ph(s.prototype,i),Sn.NEED=!0;return In(s,t),u[t]=s,Tn(Tn.G+Tn.W+Tn.F*(s!=a),u),n||r.setStrong(s,t,o),s},Fh=(Oh("Map",(function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}}),{get:function(t){var e=Lh.getEntry(Ch(this,"Map"),t);return e&&e.v},set:function(t,e){return Lh.def(Ch(this,"Map"),0===t?0:t,e)}},Lh,!0),Oh("Set",(function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(t){return Lh.def(Ch(this,"Set"),t=0===t?0:t,t)}},Lh),Sn.getWeak),Uh=El(5),Nh=El(6),jh=0,Vh=function(t){return t._l||(t._l=new qh)},qh=function(){this.a=[];},Zh=function(t,e){return Uh(t.a,(function(t){return t[0]===e}))};qh.prototype={get:function(t){var e=Zh(this,t);if(e)return e[1]},has:function(t){return !!Zh(this,t)},set:function(t,e){var i=Zh(this,t);i?i[1]=e:this.a.push([t,e]);},delete:function(t){var e=Nh(this.a,(function(e){return e[0]===t}));return ~e&&this.a.splice(e,1),!!~e}};var Gh={getConstructor:function(t,e,i,r){var o=t((function(t,n){Uu(t,o,e,"_i"),t._t=e,t._i=jh++,t._l=void 0,null!=n&&Nu(n,i,t[r],t);}));return ph(o.prototype,{delete:function(t){if(!rn(t))return !1;var i=Fh(t);return !0===i?Vh(Ch(this,e)).delete(t):i&&Qo(i,this._i)&&delete i[this._i]},has:function(t){if(!rn(t))return !1;var i=Fh(t);return !0===i?Vh(Ch(this,e)).has(t):i&&Qo(i,this._i)}}),o},def:function(t,e,i){var r=Fh(on(e),!0);return !0===r?Vh(t).set(e,i):r[t._i]=i,t},ufstore:Vh};t.createCommonjsModule((function(t){var e,i=El(0),r=Ch,o=!Yo.ActiveXObject&&"ActiveXObject"in Yo,n=Sn.getWeak,a=Object.isExtensible,s=Gh.ufstore,c=function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},l={get:function(t){if(rn(t)){var e=n(t);return !0===e?s(Ch(this,"WeakMap")).get(t):e?e[this._i]:void 0}},set:function(t,e){return Gh.def(Ch(this,"WeakMap"),t,e)}},u=t.exports=Oh("WeakMap",c,l,Gh,!0,!0);r&&o&&(e=Gh.getConstructor(c,"WeakMap"),os(e.prototype,l),Sn.NEED=!0,i(["delete","has","get","set"],(function(t){var i=u.prototype,r=i[t];yn(i,t,(function(i,o){if(rn(i)&&!a(i)){this._f||(this._f=new e);var n=this._f[t](i,o);return "set"==t?this:n}return r.call(this,i,o)}));})));})),Oh("WeakSet",(function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(t){return Gh.def(Ch(this,"WeakSet"),t,!0)}},Gh,!1,!0);for(var Hh,Wh=mn("typed_array"),Xh=mn("view"),Kh=!(!Yo.ArrayBuffer||!Yo.DataView),Yh=Kh,Jh=0,Qh="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");Jh<9;)(Hh=Yo[Qh[Jh++]])?(fn(Hh.prototype,Wh,!0),fn(Hh.prototype,Xh,!0)):Yh=!1;var $h={ABV:Kh,CONSTR:Yh,TYPED:Wh,VIEW:Xh},tp=function(t){if(void 0===t)return 0;var e=Un(t),i=jn(e);if(e!==i)throw RangeError("Wrong length!");return i},ep=t.createCommonjsModule((function(t,e){var i=ha.f,r=hn.f,o=Yo.ArrayBuffer,n=Yo.DataView,a=Yo.Math,s=Yo.RangeError,c=Yo.Infinity,l=o,u=a.abs,h=a.pow,p=a.floor,f=a.log,d=a.LN2,_=tn?"_b":"buffer",m=tn?"_l":"byteLength",g=tn?"_o":"byteOffset";function v(t,e,i){var r,o,n,a=new Array(i),s=8*i-e-1,l=(1<<s)-1,_=l>>1,m=23===e?h(2,-24)-h(2,-77):0,g=0,v=t<0||0===t&&1/t<0?1:0;for((t=u(t))!=t||t===c?(o=t!=t?1:0,r=l):(r=p(f(t)/d),t*(n=h(2,-r))<1&&(r--,n*=2),(t+=r+_>=1?m/n:m*h(2,1-_))*n>=2&&(r++,n/=2),r+_>=l?(o=0,r=l):r+_>=1?(o=(t*n-1)*h(2,e),r+=_):(o=t*h(2,_-1)*h(2,e),r=0));e>=8;a[g++]=255&o,o/=256,e-=8);for(r=r<<e|o,s+=e;s>0;a[g++]=255&r,r/=256,s-=8);return a[--g]|=128*v,a}function y(t,e,i){var r,o=8*i-e-1,n=(1<<o)-1,a=n>>1,s=o-7,l=i-1,u=t[l--],p=127&u;for(u>>=7;s>0;p=256*p+t[l],l--,s-=8);for(r=p&(1<<-s)-1,p>>=-s,s+=e;s>0;r=256*r+t[l],l--,s-=8);if(0===p)p=1-a;else {if(p===n)return r?NaN:u?-c:c;r+=h(2,e),p-=a;}return (u?-1:1)*r*h(2,p-e)}function b(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]}function w(t){return [255&t]}function x(t){return [255&t,t>>8&255]}function T(t){return [255&t,t>>8&255,t>>16&255,t>>24&255]}function S(t){return v(t,52,8)}function E(t){return v(t,23,4)}function A(t,e,i){r(t.prototype,e,{get:function(){return this[i]}});}function k(t,e,i,r){var o=tp(+i);if(o+e>t[m])throw s("Wrong index!");var n=o+t[g],a=t[_]._b.slice(n,n+e);return r?a:a.reverse()}function I(t,e,i,r,o,n){var a=tp(+i);if(a+e>t[m])throw s("Wrong index!");for(var c=t[_]._b,l=a+t[g],u=r(+o),h=0;h<e;h++)c[l+h]=u[n?h:e-h-1];}if($h.ABV){if(!$o((function(){o(1);}))||!$o((function(){new o(-1);}))||$o((function(){return new o,new o(1.5),new o(NaN),"ArrayBuffer"!=o.name}))){for(var B,P=(o=function(t){return Uu(this,o),new l(tp(t))}).prototype=l.prototype,C=i(l),z=0;C.length>z;)(B=C[z++])in o||fn(o,B,l[B]);P.constructor=o;}var D=new n(new o(2)),M=n.prototype.setInt8;D.setInt8(0,2147483648),D.setInt8(1,2147483649),!D.getInt8(0)&&D.getInt8(1)||ph(n.prototype,{setInt8:function(t,e){M.call(this,t,e<<24>>24);},setUint8:function(t,e){M.call(this,t,e<<24>>24);}},!0);}else o=function(t){Uu(this,o,"ArrayBuffer");var e=tp(t);this._b=Vl.call(new Array(e),0),this[m]=e;},n=function(t,e,i){Uu(this,n,"DataView"),Uu(t,o,"DataView");var r=t[m],a=Un(e);if(a<0||a>r)throw s("Wrong offset!");if(a+(i=void 0===i?r-a:jn(i))>r)throw s("Wrong length!");this[_]=t,this[g]=a,this[m]=i;},tn&&(A(o,"byteLength","_l"),A(n,"buffer","_b"),A(n,"byteLength","_l"),A(n,"byteOffset","_o")),ph(n.prototype,{getInt8:function(t){return k(this,1,t)[0]<<24>>24},getUint8:function(t){return k(this,1,t)[0]},getInt16:function(t){var e=k(this,2,t,arguments[1]);return (e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=k(this,2,t,arguments[1]);return e[1]<<8|e[0]},getInt32:function(t){return b(k(this,4,t,arguments[1]))},getUint32:function(t){return b(k(this,4,t,arguments[1]))>>>0},getFloat32:function(t){return y(k(this,4,t,arguments[1]),23,4)},getFloat64:function(t){return y(k(this,8,t,arguments[1]),52,8)},setInt8:function(t,e){I(this,1,t,w,e);},setUint8:function(t,e){I(this,1,t,w,e);},setInt16:function(t,e){I(this,2,t,x,e,arguments[2]);},setUint16:function(t,e){I(this,2,t,x,e,arguments[2]);},setInt32:function(t,e){I(this,4,t,T,e,arguments[2]);},setUint32:function(t,e){I(this,4,t,T,e,arguments[2]);},setFloat32:function(t,e){I(this,4,t,E,e,arguments[2]);},setFloat64:function(t,e){I(this,8,t,S,e,arguments[2]);}});In(o,"ArrayBuffer"),In(n,"DataView"),fn(n.prototype,$h.VIEW,!0),e.ArrayBuffer=o,e.DataView=n;})),ip=Yo.ArrayBuffer,rp=ep.ArrayBuffer,op=ep.DataView,np=$h.ABV&&ip.isView,ap=rp.prototype.slice,sp=$h.VIEW;Tn(Tn.G+Tn.W+Tn.F*(ip!==rp),{ArrayBuffer:rp}),Tn(Tn.S+Tn.F*!$h.CONSTR,"ArrayBuffer",{isView:function(t){return np&&np(t)||rn(t)&&sp in t}}),Tn(Tn.P+Tn.U+Tn.F*$o((function(){return !new rp(2).slice(1,void 0).byteLength})),"ArrayBuffer",{slice:function(t,e){if(void 0!==ap&&void 0===e)return ap.call(on(this),t);for(var i=on(this).byteLength,r=Zn(t,i),o=Zn(void 0===e?i:e,i),n=new(Cu(this,rp))(jn(o-r)),a=new op(this),s=new op(n),c=0;r<o;)s.setUint8(c++,a.getUint8(r++));return n}}),Xl("ArrayBuffer"),Tn(Tn.G+Tn.W+Tn.F*!$h.ABV,{DataView:ep.DataView});var cp=t.createCommonjsModule((function(t){if(tn){var e=Yo,i=$o,r=Tn,o=$h,n=wn,a=Uu,s=pn,c=fn,l=ph,u=Un,h=jn,p=tp,f=Zn,d=ln,_=Qo,m=us,g=rn,v=ia,y=ul,b=la,w=$a,x=ha.f,T=fl,S=mn,E=En,A=El,k=Gn,I=Cu,B=Yl,P=Dc,C=gl,z=Xl,D=Vl,M=Fl,R=hn,L=ga,O=R.f,F=L.f,U=e.RangeError,N=e.TypeError,j=e.Uint8Array,V=Array.prototype,q=ep.ArrayBuffer,Z=ep.DataView,G=A(0),H=A(2),W=A(3),X=A(4),K=A(5),Y=A(6),J=k(!0),Q=k(!1),$=B.values,tt=B.keys,et=B.entries,it=V.lastIndexOf,rt=V.reduce,ot=V.reduceRight,nt=V.join,at=V.sort,st=V.slice,ct=V.toString,lt=V.toLocaleString,ut=E("iterator"),ht=E("toStringTag"),pt=S("typed_constructor"),ft=S("def_constructor"),dt=o.CONSTR,_t=o.TYPED,mt=o.VIEW,gt=A(1,(function(t,e){return xt(I(t,t[ft]),e)})),vt=i((function(){return 1===new j(new Uint16Array([1]).buffer)[0]})),yt=!!j&&!!j.prototype.set&&i((function(){new j(1).set({});})),bt=function(t,e){var i=u(t);if(i<0||i%e)throw U("Wrong offset!");return i},wt=function(t){if(g(t)&&_t in t)return t;throw N(t+" is not a typed array!")},xt=function(t,e){if(!g(t)||!(pt in t))throw N("It is not a typed array constructor!");return new t(e)},Tt=function(t,e){return St(I(t,t[ft]),e)},St=function(t,e){for(var i=0,r=e.length,o=xt(t,r);r>i;)o[i]=e[i++];return o},Et=function(t,e,i){O(t,e,{get:function(){return this._d[i]}});},At=function(t){var e,i,r,o,a,s,c=v(t),l=arguments.length,u=l>1?arguments[1]:void 0,p=void 0!==u,f=T(c);if(null!=f&&!y(f)){for(s=f.call(c),r=[],e=0;!(a=s.next()).done;e++)r.push(a.value);c=r;}for(p&&l>2&&(u=n(u,arguments[2],2)),e=0,i=h(c.length),o=xt(this,i);i>e;e++)o[e]=p?u(c[e],e):c[e];return o},kt=function(){for(var t=arguments,e=0,i=arguments.length,r=xt(this,i);i>e;)r[e]=t[e++];return r},It=!!j&&i((function(){lt.call(new j(1));})),Bt=function(){return lt.apply(It?st.call(wt(this)):wt(this),arguments)},Pt={copyWithin:function(t,e){return M.call(wt(this),t,e,arguments.length>2?arguments[2]:void 0)},every:function(t){return X(wt(this),t,arguments.length>1?arguments[1]:void 0)},fill:function(t){return D.apply(wt(this),arguments)},filter:function(t){return Tt(this,H(wt(this),t,arguments.length>1?arguments[1]:void 0))},find:function(t){return K(wt(this),t,arguments.length>1?arguments[1]:void 0)},findIndex:function(t){return Y(wt(this),t,arguments.length>1?arguments[1]:void 0)},forEach:function(t){G(wt(this),t,arguments.length>1?arguments[1]:void 0);},indexOf:function(t){return Q(wt(this),t,arguments.length>1?arguments[1]:void 0)},includes:function(t){return J(wt(this),t,arguments.length>1?arguments[1]:void 0)},join:function(t){return nt.apply(wt(this),arguments)},lastIndexOf:function(t){return it.apply(wt(this),arguments)},map:function(t){return gt(wt(this),t,arguments.length>1?arguments[1]:void 0)},reduce:function(t){return rt.apply(wt(this),arguments)},reduceRight:function(t){return ot.apply(wt(this),arguments)},reverse:function(){for(var t,e=wt(this).length,i=Math.floor(e/2),r=0;r<i;)t=this[r],this[r++]=this[--e],this[e]=t;return this},some:function(t){return W(wt(this),t,arguments.length>1?arguments[1]:void 0)},sort:function(t){return at.call(wt(this),t)},subarray:function(t,e){var i=wt(this),r=i.length,o=f(t,r);return new(I(i,i[ft]))(i.buffer,i.byteOffset+o*i.BYTES_PER_ELEMENT,h((void 0===e?r:f(e,r))-o))}},Ct=function(t,e){return Tt(this,st.call(wt(this),t,e))},zt=function(t){wt(this);var e=bt(arguments[1],1),i=this.length,r=v(t),o=h(r.length),n=0;if(o+e>i)throw U("Wrong length!");for(;n<o;)this[e+n]=r[n++];},Dt={entries:function(){return et.call(wt(this))},keys:function(){return tt.call(wt(this))},values:function(){return $.call(wt(this))}},Mt=function(t,e){return g(t)&&t[_t]&&"symbol"!=typeof e&&e in t&&String(+e)==String(e)},Rt=function(t,e){return Mt(t,e=d(e,!0))?s(2,t[e]):F(t,e)},Lt=function(t,e,i){return !(Mt(t,e=d(e,!0))&&g(i)&&_(i,"value"))||_(i,"get")||_(i,"set")||i.configurable||_(i,"writable")&&!i.writable||_(i,"enumerable")&&!i.enumerable?O(t,e,i):(t[e]=i.value,t)};dt||(L.f=Rt,R.f=Lt),r(r.S+r.F*!dt,"Object",{getOwnPropertyDescriptor:Rt,defineProperty:Lt}),i((function(){ct.call({});}))&&(ct=lt=function(){return nt.call(this)});var Ot=l({},Pt);l(Ot,Dt),c(Ot,ut,Dt.values),l(Ot,{slice:Ct,set:zt,constructor:function(){},toString:ct,toLocaleString:Bt}),Et(Ot,"buffer","b"),Et(Ot,"byteOffset","o"),Et(Ot,"byteLength","l"),Et(Ot,"length","e"),O(Ot,ht,{get:function(){return this[_t]}}),t.exports=function(t,n,s,l){var u=t+((l=!!l)?"Clamped":"")+"Array",f="get"+t,d="set"+t,_=e[u],v=_||{},y=_&&w(_),T={},S=_&&_.prototype,E=function(t,e){O(t,e,{get:function(){return function(t,e){var i=t._d;return i.v[f](e*n+i.o,vt)}(this,e)},set:function(t){return function(t,e,i){var r=t._d;l&&(i=(i=Math.round(i))<0?0:i>255?255:255&i),r.v[d](e*n+r.o,i,vt);}(this,e,t)},enumerable:!0});};_&&o.ABV?i((function(){_(1);}))&&i((function(){new _(-1);}))&&C((function(t){new _,new _(null),new _(1.5),new _(t);}),!0)||(_=s((function(t,e,i,r){var o;return a(t,_,u),g(e)?e instanceof q||"ArrayBuffer"==(o=m(e))||"SharedArrayBuffer"==o?void 0!==r?new v(e,bt(i,n),r):void 0!==i?new v(e,bt(i,n)):new v(e):_t in e?St(_,e):At.call(_,e):new v(p(e))})),G(y!==Function.prototype?x(v).concat(x(y)):x(v),(function(t){t in _||c(_,t,v[t]);})),_.prototype=S,S.constructor=_):(_=s((function(t,e,i,r){a(t,_,u,"_d");var o,s,l,f,d=0,v=0;if(g(e)){if(!(e instanceof q||"ArrayBuffer"==(f=m(e))||"SharedArrayBuffer"==f))return _t in e?St(_,e):At.call(_,e);o=e,v=bt(i,n);var y=e.byteLength;if(void 0===r){if(y%n)throw U("Wrong length!");if((s=y-v)<0)throw U("Wrong length!")}else if((s=h(r)*n)+v>y)throw U("Wrong length!");l=s/n;}else l=p(e),o=new q(s=l*n);for(c(t,"_d",{b:o,o:v,l:s,e:l,v:new Z(o)});d<l;)E(t,d++);})),S=_.prototype=b(Ot),c(S,"constructor",_));var A=S[ut],k=!!A&&("values"==A.name||null==A.name),I=Dt.values;c(_,pt,!0),c(S,_t,u),c(S,mt,!0),c(S,ft,_),(l?new _(1)[ht]==u:ht in S)||O(S,ht,{get:function(){return u}}),T[u]=_,r(r.G+r.W+r.F*(_!=v),T),r(r.S,u,{BYTES_PER_ELEMENT:n}),r(r.S+r.F*i((function(){v.of.call(_,1);})),u,{from:At,of:kt}),"BYTES_PER_ELEMENT"in S||c(S,"BYTES_PER_ELEMENT",n),r(r.P,u,Pt),z(u),r(r.P+r.F*yt,u,{set:zt}),r(r.P+r.F*!k,u,Dt),S.toString!=ct&&(S.toString=ct),r(r.P+r.F*i((function(){new _(1).slice();})),u,{slice:Ct}),r(r.P+r.F*(i((function(){return [1,2].toLocaleString()!=new _([1,2]).toLocaleString()}))||!i((function(){S.toLocaleString.call([1,2]);}))),u,{toLocaleString:Bt}),P[u]=k?A:I,k||c(S,ut,I);};}else t.exports=function(){};}));cp("Int8",1,(function(t){return function(e,i,r){return t(this,e,i,r)}})),cp("Uint8",1,(function(t){return function(e,i,r){return t(this,e,i,r)}})),cp("Uint8",1,(function(t){return function(e,i,r){return t(this,e,i,r)}}),!0),cp("Int16",2,(function(t){return function(e,i,r){return t(this,e,i,r)}})),cp("Uint16",2,(function(t){return function(e,i,r){return t(this,e,i,r)}})),cp("Int32",4,(function(t){return function(e,i,r){return t(this,e,i,r)}})),cp("Uint32",4,(function(t){return function(e,i,r){return t(this,e,i,r)}})),cp("Float32",4,(function(t){return function(e,i,r){return t(this,e,i,r)}})),cp("Float64",8,(function(t){return function(e,i,r){return t(this,e,i,r)}}));var lp=(Yo.Reflect||{}).apply,up=Function.apply;Tn(Tn.S+Tn.F*!$o((function(){lp((function(){}));})),"Reflect",{apply:function(t,e,i){var r=bn(t),o=on(i);return lp?lp(r,e,o):up.call(r,e,o)}});var hp=(Yo.Reflect||{}).construct,pp=$o((function(){function t(){}return !(hp((function(){}),[],t)instanceof t)})),fp=!$o((function(){hp((function(){}));}));Tn(Tn.S+Tn.F*(pp||fp),"Reflect",{construct:function(t,e){bn(t),on(e);var i=arguments.length<3?t:bn(arguments[2]);if(fp&&!pp)return hp(t,e,i);if(t==i){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var r=[null];return r.push.apply(r,e),new(ms.apply(t,r))}var o=i.prototype,n=la(rn(o)?o:Object.prototype),a=Function.apply.call(t,n,e);return rn(a)?a:n}}),Tn(Tn.S+Tn.F*$o((function(){Reflect.defineProperty(hn.f({},1,{value:1}),1,{value:2});})),"Reflect",{defineProperty:function(t,e,i){on(t),e=ln(e,!0),on(i);try{return hn.f(t,e,i),!0}catch(t){return !1}}});var dp=ga.f;Tn(Tn.S,"Reflect",{deleteProperty:function(t,e){var i=dp(on(t),e);return !(i&&!i.configurable)&&delete t[e]}});var _p=function(t){this._t=on(t),this._i=0;var e,i=this._k=[];for(e in t)i.push(e);};Rc(_p,"Object",(function(){var t,e=this._k;do{if(this._i>=e.length)return {value:void 0,done:!0}}while(!((t=e[this._i++])in this._t));return {value:t,done:!1}})),Tn(Tn.S,"Reflect",{enumerate:function(t){return new _p(t)}}),Tn(Tn.S,"Reflect",{get:function t(e,i){var r,o,n=arguments.length<3?e:arguments[2];return on(e)===n?e[i]:(r=ga.f(e,i))?Qo(r,"value")?r.value:void 0!==r.get?r.get.call(n):void 0:rn(o=$a(e))?t(o,i,n):void 0}}),Tn(Tn.S,"Reflect",{getOwnPropertyDescriptor:function(t,e){return ga.f(on(t),e)}}),Tn(Tn.S,"Reflect",{getPrototypeOf:function(t){return $a(on(t))}}),Tn(Tn.S,"Reflect",{has:function(t,e){return e in t}});var mp=Object.isExtensible;Tn(Tn.S,"Reflect",{isExtensible:function(t){return on(t),!mp||mp(t)}});var gp=Yo.Reflect,vp=gp&&gp.ownKeys||function(t){var e=ha.f(on(t)),i=$n.f;return i?e.concat(i(t)):e};Tn(Tn.S,"Reflect",{ownKeys:vp});var yp=Object.preventExtensions;Tn(Tn.S,"Reflect",{preventExtensions:function(t){on(t);try{return yp&&yp(t),!0}catch(t){return !1}}}),Tn(Tn.S,"Reflect",{set:function t(e,i,r){var o,n,a=arguments.length<4?e:arguments[3],s=ga.f(on(e),i);if(!s){if(rn(n=$a(e)))return t(n,i,r,a);s=pn(0);}if(Qo(s,"value")){if(!1===s.writable||!rn(a))return !1;if(o=ga.f(a,i)){if(o.get||o.set||!1===o.writable)return !1;o.value=r,hn.f(a,i,o);}else hn.f(a,i,pn(0,r));return !0}return void 0!==s.set&&(s.set.call(a,r),!0)}}),ss&&Tn(Tn.S,"Reflect",{setPrototypeOf:function(t,e){ss.check(t,e);try{return ss.set(t,e),!0}catch(t){return !1}}});var bp=Gn(!0);Tn(Tn.P,"Array",{includes:function(t){return bp(this,t,arguments.length>1?arguments[1]:void 0)}}),jl("includes");var wp=En("isConcatSpreadable"),xp=function t(e,i,r,o,n,a,s,c){for(var l,u,h=n,p=0,f=!!s&&wn(s,c,3);p<o;){if(p in r){if(l=f?f(r[p],p,i):r[p],u=!1,rn(l)&&(u=void 0!==(u=l[wp])?!!u:ea(l)),u&&a>0)h=t(e,i,l,jn(l.length),h,a-1)-1;else {if(h>=9007199254740991)throw TypeError();e[h]=l;}h++;}p++;}return h};Tn(Tn.P,"Array",{flatMap:function(t){var e,i,r=ia(this);return bn(t),e=jn(r.length),i=Sl(r,0),xp(i,r,r,e,0,1,t,arguments[1]),i}}),jl("flatMap");var Tp=function(t,e,i,r){var o=String(Rn(t)),n=o.length,a=void 0===i?" ":String(i),s=jn(e);if(s<=n||""==a)return o;var c=s-n,l=Js.call(a,Math.ceil(c/a.length));return l.length>c&&(l=l.slice(0,c)),r?l+o:o+l},Sp=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(uh);Tn(Tn.P+Tn.F*Sp,"String",{padStart:function(t){return Tp(this,t,arguments.length>1?arguments[1]:void 0,!0)}});var Ep=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(uh);Tn(Tn.P+Tn.F*Ep,"String",{padEnd:function(t){return Tp(this,t,arguments.length>1?arguments[1]:void 0,!1)}}),ks("trimLeft",(function(t){return function(){return t(this,1)}}),"trimStart"),ks("trimRight",(function(t){return function(){return t(this,2)}}),"trimEnd"),Cn("asyncIterator"),Bn.f("asyncIterator"),Tn(Tn.S,"Object",{getOwnPropertyDescriptors:function(t){for(var e,i,r=Ln(t),o=ga.f,n=vp(r),a={},s=0;n.length>s;)void 0!==(i=o(r,e=n[s++]))&&hl(a,e,i);return a}});var Ap=ta.f,kp=function(t){return function(e){for(var i,r=Ln(e),o=Qn(r),n=o.length,a=0,s=[];n>a;)i=o[a++],tn&&!Ap.call(r,i)||s.push(t?[i,r[i]]:r[i]);return s}},Ip=kp(!1);Tn(Tn.S,"Object",{values:function(t){return Ip(t)}});var Bp=kp(!0);Tn(Tn.S,"Object",{entries:function(t){return Bp(t)}}),Tn(Tn.P+Tn.R,"Promise",{finally:function(t){var e=Cu(this,en.Promise||Yo.Promise),i="function"==typeof t;return this.then(i?function(i){return hh(e,t()).then((function(){return i}))}:t,i?function(i){return hh(e,t()).then((function(){throw i}))}:t)}});var Pp=[].slice,Cp=/MSIE .\./.test(uh),zp=function(t){return function(e,i){var r=arguments.length>2,o=!!r&&Pp.call(arguments,2);return t(r?function(){("function"==typeof e?e:Function(e)).apply(this,o);}:e,i)}};Tn(Tn.G+Tn.B+Tn.F*Cp,{setTimeout:zp(Yo.setTimeout),setInterval:zp(Yo.setInterval)}),Tn(Tn.G+Tn.B,{setImmediate:Yu.set,clearImmediate:Yu.clear});for(var Dp=En("iterator"),Mp=En("toStringTag"),Rp=Dc.Array,Lp={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},Op=Qn(Lp),Fp=0;Fp<Op.length;Fp++){var Up,Np=Op[Fp],jp=Lp[Np],Vp=Yo[Np],qp=Vp&&Vp.prototype;if(qp&&(qp[Dp]||fn(qp,Dp,Rp),qp[Mp]||fn(qp,Mp,Np),Dc[Np]=Rp,jp))for(Up in Yl)qp[Up]||yn(qp,Up,Yl[Up],!0);}t.createCommonjsModule((function(t){var e=function(t){var e=Object.prototype,i=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",n=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function s(t,e,i,r){var o=Object.create((e&&e.prototype instanceof u?e:u).prototype),n=new x(r||[]);return o._invoke=function(t,e,i){var r="suspendedStart";return function(o,n){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw n;return {value:void 0,done:!0}}for(i.method=o,i.arg=n;;){var a=i.delegate;if(a){var s=y(a,i);if(s){if(s===l)continue;return s}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if("suspendedStart"===r)throw r="completed",i.arg;i.dispatchException(i.arg);}else "return"===i.method&&i.abrupt("return",i.arg);r="executing";var u=c(t,e,i);if("normal"===u.type){if(r=i.done?"completed":"suspendedYield",u.arg===l)continue;return {value:u.arg,done:i.done}}"throw"===u.type&&(r="completed",i.method="throw",i.arg=u.arg);}}}(t,i,n),o}function c(t,e,i){try{return {type:"normal",arg:t.call(e,i)}}catch(t){return {type:"throw",arg:t}}}t.wrap=s;var l={};function u(){}function h(){}function p(){}var f={};f[o]=function(){return this};var d=Object.getPrototypeOf,_=d&&d(d(T([])));_&&_!==e&&i.call(_,o)&&(f=_);var m=p.prototype=u.prototype=Object.create(f);function g(t){["next","throw","return"].forEach((function(e){t[e]=function(t){return this._invoke(e,t)};}));}function v(t,e){var r;this._invoke=function(o,n){function a(){return new e((function(r,a){!function r(o,n,a,s){var l=c(t[o],t,n);if("throw"!==l.type){var u=l.arg,h=u.value;return h&&"object"==typeof h&&i.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,a,s);}),(function(t){r("throw",t,a,s);})):e.resolve(h).then((function(t){u.value=t,a(u);}),(function(t){return r("throw",t,a,s)}))}s(l.arg);}(o,n,r,a);}))}return r=r?r.then(a,a):a()};}function y(t,e){var i=t.iterator[e.method];if(void 0===i){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,y(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method");}return l}var r=c(i,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,l;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0);}function T(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,n=function e(){for(;++r<t.length;)if(i.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return n.next=n}}return {next:S}}function S(){return {value:void 0,done:!0}}return h.prototype=m.constructor=p,p.constructor=h,p[a]=h.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return !!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,a in t||(t[a]="GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return {__await:t}},g(v.prototype),v.prototype[n]=function(){return this},t.AsyncIterator=v,t.async=function(e,i,r,o,n){void 0===n&&(n=Promise);var a=new v(s(e,i,r,o),n);return t.isGeneratorFunction(i)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(m),m[a]="Generator",m[o]=function(){return this},m.toString=function(){return "[object Generator]"},t.keys=function(t){var e=[];for(var i in t)e.push(i);return e.reverse(),function i(){for(;e.length;){var r=e.pop();if(r in t)return i.value=r,i.done=!1,i}return i.done=!0,i}},t.values=T,x.prototype={constructor:x,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0);},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(i,r){return a.type="throw",a.arg=t,e.next=i,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var n=this.tryEntries[o],a=n.completion;if("root"===n.tryLoc)return r("end");if(n.tryLoc<=this.prev){var s=i.call(n,"catchLoc"),c=i.call(n,"finallyLoc");if(s&&c){if(this.prev<n.catchLoc)return r(n.catchLoc,!0);if(this.prev<n.finallyLoc)return r(n.finallyLoc)}else if(s){if(this.prev<n.catchLoc)return r(n.catchLoc,!0)}else {if(!c)throw new Error("try statement without catch or finally");if(this.prev<n.finallyLoc)return r(n.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&i.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var n=o;break}}n&&("break"===t||"continue"===t)&&n.tryLoc<=e&&e<=n.finallyLoc&&(n=null);var a=n?n.completion:{};return a.type=t,a.arg=e,n?(this.method="next",this.next=n.finallyLoc,l):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return "break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),w(i),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc===t){var r=i.completion;if("throw"===r.type){var o=r.arg;w(i);}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,i){return this.delegate={iterator:T(t),resultName:e,nextLoc:i},"next"===this.method&&(this.arg=void 0),l}},t}(t.exports);try{regeneratorRuntime=e;}catch(t){Function("r","regeneratorRuntime = r")(e);}}));var Zp=t.createCommonjsModule((function(e){var i=e.exports="undefined"!=typeof window&&window.Math==Math?window:void 0!==t.window&&t.window.Math==Math?t.window:Function("return this")();"number"==typeof __g&&(__g=i);})),Gp=t.createCommonjsModule((function(t){var e=t.exports={version:"2.6.12"};"number"==typeof __e&&(__e=e);})),Hp=function(t,e,i){if(function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!")}(t),void 0===e)return t;switch(i){case 1:return function(i){return t.call(e,i)};case 2:return function(i,r){return t.call(e,i,r)};case 3:return function(i,r,o){return t.call(e,i,r,o)}}return function(){return t.apply(e,arguments)}},Wp=function(t){return "object"==typeof t?null!==t:"function"==typeof t},Xp=function(t){if(!Wp(t))throw TypeError(t+" is not an object!");return t},Kp=function(t){try{return !!t()}catch(t){return !0}},Yp=!Kp((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})),Jp=Zp.document,Qp=Wp(Jp)&&Wp(Jp.createElement),$p=!Yp&&!Kp((function(){return 7!=Object.defineProperty(Qp?Jp.createElement("div"):{},"a",{get:function(){return 7}}).a})),tf=Object.defineProperty,ef={f:Yp?Object.defineProperty:function(t,e,i){if(Xp(t),e=function(t,e){if(!Wp(t))return t;var i,r;if("function"==typeof(i=t.toString)&&!Wp(r=i.call(t)))return r;if("function"==typeof(i=t.valueOf)&&!Wp(r=i.call(t)))return r;throw TypeError("Can't convert object to primitive value")}(e),Xp(i),$p)try{return tf(t,e,i)}catch(t){}if("get"in i||"set"in i)throw TypeError("Accessors not supported!");return "value"in i&&(t[e]=i.value),t}},rf=Yp?function(t,e,i){return ef.f(t,e,function(t,e){return {enumerable:!1,configurable:!0,writable:!0,value:e}}(0,i))}:function(t,e,i){return t[e]=i,t},of={}.hasOwnProperty,nf=function(t,e){return of.call(t,e)},af=function(t,e,i){var r,o,n,a=t&af.F,s=t&af.G,c=t&af.S,l=t&af.P,u=t&af.B,h=t&af.W,p=s?Gp:Gp[e]||(Gp[e]={}),f=p.prototype,d=s?Zp:c?Zp[e]:(Zp[e]||{}).prototype;for(r in s&&(i=e),i)(o=!a&&d&&void 0!==d[r])&&nf(p,r)||(n=o?d[r]:i[r],p[r]=s&&"function"!=typeof d[r]?i[r]:u&&o?Hp(n,Zp):h&&d[r]==n?function(t){var e=function(e,i,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,i)}return new t(e,i,r)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(n):l&&"function"==typeof n?Hp(Function.call,n):n,l&&((p.virtual||(p.virtual={}))[r]=n,t&af.R&&f&&!f[r]&&rf(f,r,n)));};af.F=1,af.G=2,af.S=4,af.P=8,af.B=16,af.W=32,af.U=64,af.R=128,af(af.G,{global:Zp});var sf=Gp.global,cf=t.createCommonjsModule((function(t){var e,i=(e=sf)&&e.__esModule?e:{default:e};i.default._babelPolyfill&&"undefined"!=typeof console&&console.warn&&console.warn("@babel/polyfill is loaded more than once on this page. This is probably not desirable/intended and may have consequences if different versions of the polyfills are applied sequentially. If you do need to load the polyfill more than once, use @babel/polyfill/noConflict instead to bypass the warning."),i.default._babelPolyfill=!0;}));t.unwrapExports(cf);var lf={version:"3.0.18.1",supported:e,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:ko,NavigationControl:Bo,GeolocateControl:Uo,AttributionControl:go,ScaleControl:Vo,PitchControl:No,FullscreenControl:Go,Popup:Wo,Marker:Ro,Style:Ue,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:T,Evented:t.Evented,config:t.config$1,get accessToken(){return t.config$1.ACCESS_TOKEN},set accessToken(t){},get baseApiUrl(){return t.config$1.API_URL},set baseApiUrl(t){},get workerCount(){return Rt.workerCount},set workerCount(t){Rt.workerCount=t;},get maxParallelImageRequests(){return t.config$1.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(e){t.config$1.MAX_PARALLEL_IMAGE_REQUESTS=e;},clearStorage:function(e){t.clearTileCache(e);},workerUrl:""},uf="3.0.18.1".split(".").slice(0,2).concat([0]).join(".");return Ko.config.version=uf,lf._loader=Ko,lf.ajax=function(e,i,r){if(void 0===r&&(r=!1),e=t.formatAjax(e),Promise&&!i)return new Promise((function(i,o){void 0===e.cache&&(e.cache=!1),t.makeRequest(e,(function(t,e,n,a){t?o(t):i(r?{data:e,cacheControl:n,expires:a}:e);}));}));t.makeRequest(e,i);},lf.tokenTask=new Xo,lf.plugin=function(t,e){return Ko(t,e)},lf.version="3.0.18.1",""!==lf.config.API_URL?console.warn("SDK为DEV版本版本号3.0.18.1,部署请使用发布版本。"):t.initApiURI(uf,lf.config),Ko.config.apiUrl=lf.config.API_URL,lf.userAgent=Ko.userAgent,lf}));
//
return sgmap;
})));