(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)(n=1))return n;for(;ra?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>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@\,;\:\\"\/\[\]\?\=\{\}\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=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=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=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;n1;){var e=t.pop(),r=e.obj[e.prop];if(xt(r)){for(var n=[],i=0;i=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=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);at?~(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>1):u>>1,u=1,l=0;do{u+=(p=t.charCodeAt(i++)-63-1)<>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-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;o0&&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&&Ft0||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":"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;r255?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=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;e2){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=[];n1)&&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-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;a4?"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=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;p0&&s<0||o<0&&s>0}function Ye(t,e,r){for(var n=0,i=r;nr[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=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;ne))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=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;e0&&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;a1})))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=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)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;oNumber.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=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",(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":[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;r0&&"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;nn.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=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);ee?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=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=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=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=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=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-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;rthis.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);ethis.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(n=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);in.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.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>>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>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>1],o=n-1,s=i+1;;){do{o++;}while(e[o]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-n90&&(n=90),r<-180&&(r=-180),r>180&&(r=180);var a=Co(r),o=Co(n),s=a/(1<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<0&&i<0&&(i=2147483647),{lon:180*i/2147483648,lat:180*(a=parseInt(a+n)<jo.max||C.yjo.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;r1){if(Ko(t,e))return !0;for(var n=0;n1?r:r.sub(e)._mult(i)._add(e))}function Wo(t,e){for(var r,n,i,a=!1,o=0;oe.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;ne.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.xi.x&&e.x>i.x||t.yi.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=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;pt.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;u80*r){n=a=t[0],i=o=t[1];for(var y=r;ya&&(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=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;e0||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=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.x&&n.x>=p&&i!==n.x&&pu(ar.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=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;an;){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);c0;)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 te?1:0}function Iu(t,e){var r=t.length;if(r<=1)return [t];for(var n,i,a=[],o=0;o1)for(var u=0;u0&&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>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>3;}if(n--,1===r||2===r)(i+=t.readSVarint())s&&(s=i),(a+=t.readSVarint())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>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;n8192}))||E.every((function(t){return t.y<0}))||E.every((function(t){return t.y>8192}))))for(var m=0,v=0;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=2&&t[l-1].equals(t[l-2]);)l--;for(var p=0;p0;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&&(_i&&(P="bevel"),"bevel"===P&&(_>2&&(P="flipbevel"),_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;D2*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=3)for(var a=0;a0?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<>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<>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<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>>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=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>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;i239?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.pos127;);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;e268435455||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;a55295&&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=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));b0&&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=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=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=0,h=0,c=0;c-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;sn;)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;rl){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=0&&w=0&&_=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=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-1);a[++u]=s,o[u]=l,o[u+1]=vp;}for(s=0,u=0;s65535)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=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);n0&&(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 te?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;lo)&&(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;ym.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;it.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=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=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);C1){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);U32640&&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=0;o--)if(n.dist(a[o])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=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=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;u0},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;i1||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=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;a0?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=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;h0,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"),I100)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;L0&&(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=0;(a>360||a<-360)&&(a%=360),o<0&&(o=0-o),o*=s?1:-1;for(var l=0,p=e;l=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;_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;on&&(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];A1&&(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;p1&&(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",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(""===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(""===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:"",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=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;cthis.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: , lat: }, an object {lon: , lat: }, or an array of [, ]")};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&&et.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<=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&&et.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=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;mo&&(n=o-m);}if(this.lngRange){var v=f.x,g=l.x/2;v-gu&&(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;st.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<=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)-ao&&(n=o-m);}if(this.lngRange){var v=f.x,g=l.x/2;v-gu&&(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;s0;a--)i+=(e&(n=1<>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>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.wrapt.wrap)&&(this.overscaledZt.overscaledZ)&&(this.canonical.xt.canonical.x)&&this.canonical.y>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>3;}if(n--,1===r||2===r)(i+=t.readSVarint())s&&(s=i),(a+=t.readSVarint())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=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;en)i=!1;else if(e)if(this.expirationTime=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=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=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=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=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=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=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;l1?(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;n0&&(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;fo)a=f,o=y;else if(y===o){var d=Math.abs(f-s);di&&(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=(r/=e)&&o=n)return null;for(var u=[],l=0;l=r&&y=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=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;cr&&(u=p(l,f,y,m,v,r),o&&(l.start=h+s*u)):g>n?x=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;oo.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;s0&&e.size<(i?o:n))r.numPoints+=e.length/3;else {for(var s=[],u=0;uo)&&(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;n0===e)for(n=0,i=t.length;n24)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;n1&&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<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<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;a0&&(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=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>31}function k(e,t){for(var r=e.loadGeometry(),o=e.type,i=0,n=0,s=r.length,a=0;a>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);fc;)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=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));l1?this._map(a,!0):null,d=(s<<5)+(t+1)+this.points.length,g=0,v=h;g>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;o1?"@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=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=a&&e.x=s&&e.y0&&(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+10&&(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;ai.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];tthis.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];r1||(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);pthis._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;n0||(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;_=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=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;i0?(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=-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;gMath.abs(r.x-i.x)*o?{useVertical:!0}:(e===t.WritingMode.vertical?i.yr.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;A0?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=_;M0?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)=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;s0: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=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=_;ga*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=1;C--)P.push(I.path[C]);for(var z=1;z0){for(var L=P[0].clone(),O=P[0].clone(),F=1;F=E.x&&O.x<=A.x&&L.y>=E.y&&O.y<=A.y?[P]:O.xA.x||O.yA.y?[]:t.clipLine([P],E.x,E.y,A.x,A.y);}for(var U=0,N=R;U=this.screenRightBoundary||r<100||e>this.screenBottomBoundary},ce.prototype.isInsideGrid=function(t,e,i,r){return i>=0&&t=0&&e0?(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&&(AT[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;o0&&(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=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=0;--P){var C=B[P];I(a.symbolInstances.get(C),a.collisionArrays[C]);}else for(var z=e.symbolInstanceStart;z=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];a0,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;mt},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._currentTileIndex2};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;rt.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;u0)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=0;n--){var a=this._order[n];if(i(a)){r[a]=n;for(var s=0,c=t;s=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] 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.005feature_maxzoom){\n zoom_opacity=0.0;\n }else{\n zoom_opacity=1.0;\n }\n #else\n if(u_featureZoom+0.005feature_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>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;d0){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=0&&(_[g.associatedIconIndex]={shiftedAnchor:S,angle:E});}else ae(g.numGlyphs,f);}if(h){d.clear();for(var k=e.icon.placedSymbolArray,I=0;I18&&($=Math.pow(2,e.transform.zoom-19));var tt=I.latestFeatureIndex.loadVTLayers()._geojsonTileLayer;if(tt&&1!=$)for(var et=0;et0){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;h256&&this.clearStencil(),r.setColorMode(kt.disabled),r.setDepthMode(Et.disabled);var n=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var a=0,s=i;a256&&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=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.currentLayer0?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.duration0&&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=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;rthis.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;r30)&&(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)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,!(sMath.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;nn?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=Te.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)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=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;i0?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;r255?_(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=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;s0?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()=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()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;a180;){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)e.getEast()||i.latitudee.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="×",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.ythis._map.transform.height-l?["bottom"]:[],o.xthis._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=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>>2]|=(i[n>>>2]>>>24-n%4*8&255)<<24-(r+n)%4*8;else for(n=0;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>>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>>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>>2]>>>24-o%4*8&255));return r.join("")},parse:function(t){for(var e=t.length,i=[],r=0;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>>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>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>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0>>0?1:0)|0,this._b=e[7]>>>0>>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>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0>>0?1:0)|0,this._b=e[7]>>>0>>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>>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>>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>>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<>>32-n)+e}function l(t,e,i,r,o,n,a){var s=t+(e&r|i&~r)+o+a;return (s<>>32-n)+e}function u(t,e,i,r,o,n,a){var s=t+(e^i^r)+o+a;return (s<>>32-n)+e}function h(t,e,i,r,o,n,a){var s=t+(i^(e|~r))+o+a;return (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>>2]>>>16-o%4*8&65535));return r.join("")},parse:function(e){for(var i=e.length,r=[],o=0;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>>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>>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>>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>>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<>>32-S,T<>>32-S):(f=T<>>64-S,x<>>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>>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>>0?1:0))+tt+((nt+=et=($>>>19|Q<<13)^($<<3|Q>>>29)^($>>>6|Q<<26))>>>0>>0?1:0))+(rt=c[G-16]).high+((nt+=ot=rt.low)>>>0>>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>>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>>0?1:0))+pt.high+((dt+=ft)>>>0>>0?1:0))+at+((dt+=nt)>>>0>>0?1:0))+((F=L+dt|0)>>>0>>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>>0?1:0))+((P=dt+mt|0)>>>0
>>0?1:0)|0;}d=r.low=d+P,r.high=f+B+(d>>>0

>>0?1:0),m=o.low=m+z,o.high=_+C+(m>>>0>>0?1:0),v=n.low=v+M,n.high=g+D+(v>>>0>>0?1:0),b=a.low=b+L,a.high=y+R+(b>>>0>>0?1:0),x=l.low=x+F,l.high=w+O+(x>>>0>>0?1:0),S=u.low=S+N,u.high=T+U+(S>>>0>>0?1:0),A=h.low=A+V,h.high=E+j+(A>>>0>>0?1:0),I=p.low=I+Z,p.high=k+q+(I>>>0>>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>>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>>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>>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>>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>>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^this._lBlock)&e;this._lBlock^=i,this._rBlock^=i<>>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>>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>>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>>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>>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>>4).toString(16)),e.push((15&t[i]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],i=0;i>>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>>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>>24)|4278255360&(s[f]<<24|s[f]>>>8);s[c>>>5]|=128<>>9<<4)]=c;var d=n._ff,_=n._gg,m=n._hh,g=n._ii;for(f=0;f>>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<>>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<>>32-n)+e},n._hh=function(t,e,i,r,o,n,a){var s=t+(e^i^r)+(o>>>0)+a;return (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<>>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>>2]|=(i[n>>>2]>>>24-n%4*8&255)<<24-(r+n)%4*8;else if(65535>>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>>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>>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>>2]>>>24-o%4*8&255));return r.join("")},parse:function(t){for(var e=t.length,i=[],r=0;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>>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<this.xBuf.length;)this.ProcessWord(t,e),e+=this.xBuf.length,i-=this.xBuf.length,this.byteCount+=this.xBuf.length;for(;0epgis_Int32.maxValue||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>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>>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;athis.maxValue){var o;for(e=(o=Number(t).toString(2)).substr(o.length-31,31),i="",r=0;r>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<>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,0this.DB?(this[this.t-1]|=(a&(1<>this.DB-n):this[this.t-1]|=a<=this.DB&&(n-=this.DB));}8==i&&0!=(128&t[0])&&(this.s=-1,0>r|a,a=(this[s]&o)<=this.t)e.t=0;else {var r=t%this.DB,o=this.DB-r,n=(1<>r;for(var a=i+1;a>r;0>=this.DB;if(t.t>=this.DB;r+=this.s;}else {for(r+=this.s;i>=this.DB;r-=t.s;}e.s=r<0?-1:0,r<-1?e[i++]=this.DV+r:0=e.DV&&(t[i+e.t]-=e.DV,t[i+e.t+1]=1);}0>this.F2:0),p=this.FV/h,f=(1<>s)&&(o=!0,n=z(i));0<=a;)s>(s+=this.DB-e)):(i=this[a]>>(s-=e)&r,s<=0&&(s+=this.DB,--a)),02*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=i&&(this.dMultiply(r),this.dAddOffset(a,0),a=n=0));}0t&&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>=this.DB;if(t.t>=this.DB;r+=this.s;}else {for(r+=this.s;i>=this.DB;r+=t.s;}e.s=r<0?-1:0,0=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>1)&&(t=K.length);for(var o=C(),n=0;n>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>r)!=(this.s&this.DM)>>r&&(e[o++]=i|this.s<>(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>=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?0!=this.s:0!=(this[e]&1<>o-c&l:(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>>2]|=(i[n>>>2]>>>24-n%4*8&255)<<24-(r+n)%4*8;else for(n=0;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>>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>>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>>2]>>>24-o%4*8&255));return r.join("")},parse:function(t){for(var e=t.length,i=[],r=0;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>>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>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>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0>>0?1:0)|0,this._b=e[7]>>>0>>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>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0>>0?1:0)|0,this._b=e[7]>>>0>>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>>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>>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>>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<>>32-n)+e}function l(t,e,i,r,o,n,a){var s=t+(e&r|i&~r)+o+a;return (s<>>32-n)+e}function u(t,e,i,r,o,n,a){var s=t+(e^i^r)+o+a;return (s<>>32-n)+e}function h(t,e,i,r,o,n,a){var s=t+(i^(e|~r))+o+a;return (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>>2]>>>16-o%4*8&65535));return r.join("")},parse:function(e){for(var i=e.length,r=[],o=0;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>>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>>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>>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>>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<>>32-S,T<>>32-S):(f=T<>>64-S,x<>>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>>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>>0?1:0))+tt+((nt+=et=($>>>19|Q<<13)^($<<3|Q>>>29)^($>>>6|Q<<26))>>>0>>0?1:0))+(rt=c[G-16]).high+((nt+=ot=rt.low)>>>0>>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>>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>>0?1:0))+pt.high+((dt+=ft)>>>0>>0?1:0))+at+((dt+=nt)>>>0>>0?1:0))+((F=L+dt|0)>>>0>>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>>0?1:0))+((P=dt+mt|0)>>>0

>>0?1:0)|0;}d=r.low=d+P,r.high=f+B+(d>>>0

>>0?1:0),m=o.low=m+z,o.high=_+C+(m>>>0>>0?1:0),v=n.low=v+M,n.high=g+D+(v>>>0>>0?1:0),b=a.low=b+L,a.high=y+R+(b>>>0>>0?1:0),x=l.low=x+F,l.high=w+O+(x>>>0>>0?1:0),S=u.low=S+N,u.high=T+U+(S>>>0>>0?1:0),A=h.low=A+V,h.high=E+j+(A>>>0>>0?1:0),I=p.low=I+Z,p.high=k+q+(I>>>0>>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>>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>>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>>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>>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>>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^this._lBlock)&e;this._lBlock^=i,this._rBlock^=i<>>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>>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>>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>>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>>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>>4).toString(16)),e.push((15&t[i]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],i=0;i>>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>>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>>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<>>24)|4278255360&(s[f]<<24|s[f]>>>8);s[c>>>5]|=128<>>9<<4)]=c;var d=t._ff,_=t._gg,m=t._hh,g=t._ii;for(f=0;f>>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<>>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<>>32-n)+e},n._hh=function(t,e,i,r,o,n,a){var s=t+(e^i^r)+(o>>>0)+a;return (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<>>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>>2]|=(i[n>>>2]>>>24-n%4*8&255)<<24-(r+n)%4*8;else if(65535>>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>>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>>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>>2]>>>24-o%4*8&255));return r.join("")},parse:function(t){for(var e=t.length,i=[],r=0;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;cthis.maxValue){var o;for(e=(o=Number(t).toString(2)).substr(o.length-31,31),i="",r=0;r>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<>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,0this.DB?(this[this.t-1]|=(a&(1<>this.DB-n):this[this.t-1]|=a<=this.DB&&(n-=this.DB));}8==i&&0!=(128&t[0])&&(this.s=-1,0>r|a,a=(this[s]&o)<=this.t)e.t=0;else {var r=t%this.DB,o=this.DB-r,n=(1<>r;for(var a=i+1;a>r;0>=this.DB;if(t.t>=this.DB;r+=this.s;}else {for(r+=this.s;i>=this.DB;r-=t.s;}e.s=r<0?-1:0,r<-1?e[i++]=this.DV+r:0=e.DV&&(t[i+e.t]-=e.DV,t[i+e.t+1]=1);}0>this.F2:0),p=this.FV/h,f=(1<>s)&&(o=!0,n=B(i));0<=a;)s>(s+=this.DB-e)):(i=this[a]>>(s-=e)&r,s<=0&&(s+=this.DB,--a)),02*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=i&&(this.dMultiply(r),this.dAddOffset(a,0),a=n=0));}0t&&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>=this.DB;if(t.t>=this.DB;r+=this.s;}else {for(r+=this.s;i>=this.DB;r+=t.s;}e.s=r<0?-1:0,0=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>1)&&(t=H.length);for(var o=I(),n=0;n>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>r)!=(this.s&this.DM)>>r&&(e[o++]=i|this.s<>(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>=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?0!=this.s:0!=(this[e]&1<>o-c&l:(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");},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;io.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;++i0?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("